From owner-svn-src-all@freebsd.org Sun Apr 28 03:49:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C94D157032B; Sun, 28 Apr 2019 03:49:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F2068207E; Sun, 28 Apr 2019 03:49:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AD48516B; Sun, 28 Apr 2019 03:49:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3S3ngax010706; Sun, 28 Apr 2019 03:49:42 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3S3nfgq010698; Sun, 28 Apr 2019 03:49:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904280349.x3S3nfgq010698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 28 Apr 2019 03:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346802 - in stable: 11/etc/mtree 11/lib/libbe 11/lib/libbe/tests 12/etc/mtree 12/lib/libbe 12/lib/libbe/tests X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/etc/mtree 11/lib/libbe 11/lib/libbe/tests 12/etc/mtree 12/lib/libbe 12/lib/libbe/tests X-SVN-Commit-Revision: 346802 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3F2068207E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.90 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.91)[-0.906,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 03:49:44 -0000 Author: kevans Date: Sun Apr 28 03:49:40 2019 New Revision: 346802 URL: https://svnweb.freebsd.org/changeset/base/346802 Log: MFC r346545-r346546, r346680, r346700, r346705 r346545: libbe(3): allow creation of arbitrary depth boot environments libbe currently only provides an API to create a recursive boot environment, without any formal support for intentionally limiting the depth. This changeset adds an API, be_create_depth, that may be used to arbitrarily restrict the depth of the new BE. r346546: libbe(3): Add a test for be creation r346680: libbe(3): Copy received properties as well This was inherently broken on send|recv datasets. r346700: libbe(3): Fix mis-application of patch (SHLIBDIR) Rob's patch in D18564 cemented the SHLIBDIR because bsd.own.mk (included by src.opts.mk) sets it to /usr/lib. r346546 did somehow not apply this part of the patch, leaving it to get installed to the wrong place and subsequently removed via ObsoleteFiles. r346705: libbe(3): Fix libcompat build SHLIBDIR should still be optionally set, just before src.opts.mk is included so that libcompat can properly override it. This fixes lib32 failures reported by both Jenkins and Michael Butler. Added: stable/12/lib/libbe/tests/ - copied from r346546, head/lib/libbe/tests/ Modified: stable/12/etc/mtree/BSD.tests.dist stable/12/lib/libbe/Makefile stable/12/lib/libbe/be.c stable/12/lib/libbe/be.h stable/12/lib/libbe/be_impl.h stable/12/lib/libbe/libbe.3 Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Added: stable/11/lib/libbe/tests/ - copied from r346546, head/lib/libbe/tests/ Modified: stable/11/etc/mtree/BSD.tests.dist stable/11/lib/libbe/Makefile stable/11/lib/libbe/be.c stable/11/lib/libbe/be.h stable/11/lib/libbe/be_impl.h stable/11/lib/libbe/libbe.3 Directory Properties: stable/11/ (props changed) Modified: stable/12/etc/mtree/BSD.tests.dist ============================================================================== --- stable/12/etc/mtree/BSD.tests.dist Sun Apr 28 02:27:04 2019 (r346801) +++ stable/12/etc/mtree/BSD.tests.dist Sun Apr 28 03:49:40 2019 (r346802) @@ -272,6 +272,8 @@ .. libarchive .. + libbe + .. libc c063 .. Modified: stable/12/lib/libbe/Makefile ============================================================================== --- stable/12/lib/libbe/Makefile Sun Apr 28 02:27:04 2019 (r346801) +++ stable/12/lib/libbe/Makefile Sun Apr 28 03:49:40 2019 (r346802) @@ -1,8 +1,11 @@ # $FreeBSD$ +SHLIBDIR?= /lib + +.include + PACKAGE= lib${LIB} LIB= be -SHLIBDIR?= /lib SHLIB_MAJOR= 1 SHLIB_MINOR= 0 @@ -27,5 +30,8 @@ CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/ CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head CFLAGS+= -DNEED_SOLARIS_BOOLEAN + +HAS_TESTS= YES +SUBDIR.${MK_TESTS}+= tests .include Modified: stable/12/lib/libbe/be.c ============================================================================== --- stable/12/lib/libbe/be.c Sun Apr 28 02:27:04 2019 (r346801) +++ stable/12/lib/libbe/be.c Sun Apr 28 03:49:40 2019 (r346802) @@ -372,7 +372,6 @@ be_snapshot(libbe_handle_t *lbh, const char *source, c sizeof(buf)) >= sizeof(buf)) return (set_error(lbh, BE_ERR_INVALIDNAME)); } - if ((err = zfs_snapshot(lbh->lzh, buf, recursive, NULL)) != 0) { switch (err) { case EZFS_INVALIDNAME: @@ -432,8 +431,12 @@ be_deep_clone_prop(int prop, void *cb) /* Just continue if we fail to read a property */ return (ZPROP_CONT); - /* Only copy locally defined properties */ - if (src != ZPROP_SRC_LOCAL) + /* + * Only copy locally defined or received properties. This continues + * to avoid temporary/default/local properties intentionally without + * breaking received datasets. + */ + if (src != ZPROP_SRC_LOCAL && src != ZPROP_SRC_RECEIVED) return (ZPROP_CONT); /* Augment mountpoint with altroot, if needed */ @@ -446,43 +449,78 @@ be_deep_clone_prop(int prop, void *cb) return (ZPROP_CONT); } +/* + * Return the corresponding boot environment path for a given + * dataset path, the constructed path is placed in 'result'. + * + * example: say our new boot environment name is 'bootenv' and + * the dataset path is 'zroot/ROOT/default/data/set'. + * + * result should produce: 'zroot/ROOT/bootenv/data/set' + */ static int -be_deep_clone(zfs_handle_t *ds, void *data) +be_get_path(struct libbe_deep_clone *ldc, const char *dspath, char *result, int result_size) { + char *pos; + char *child_dataset; + + /* match the root path for the boot environments */ + pos = strstr(dspath, ldc->lbh->root); + + /* no match, different pools? */ + if (pos == NULL) + return (BE_ERR_BADPATH); + + /* root path of the new boot environment */ + snprintf(result, result_size, "%s/%s", ldc->lbh->root, ldc->bename); + + /* gets us to the parent dataset, the +1 consumes a trailing slash */ + pos += strlen(ldc->lbh->root) + 1; + + /* skip the parent dataset */ + if ((child_dataset = strchr(pos, '/')) != NULL) + strlcat(result, child_dataset, result_size); + + return (BE_ERR_SUCCESS); +} + +static int +be_clone_cb(zfs_handle_t *ds, void *data) +{ int err; char be_path[BE_MAXPATHLEN]; char snap_path[BE_MAXPATHLEN]; const char *dspath; - char *dsname; zfs_handle_t *snap_hdl; nvlist_t *props; - struct libbe_deep_clone *isdc, sdc; + struct libbe_deep_clone *ldc; struct libbe_dccb dccb; - isdc = (struct libbe_deep_clone *)data; + ldc = (struct libbe_deep_clone *)data; dspath = zfs_get_name(ds); - if ((dsname = strrchr(dspath, '/')) == NULL) - return (BE_ERR_UNKNOWN); - dsname++; - if (isdc->bename == NULL) - snprintf(be_path, sizeof(be_path), "%s/%s", isdc->be_root, dsname); - else - snprintf(be_path, sizeof(be_path), "%s/%s", isdc->be_root, isdc->bename); + snprintf(snap_path, sizeof(snap_path), "%s@%s", dspath, ldc->snapname); - snprintf(snap_path, sizeof(snap_path), "%s@%s", dspath, isdc->snapname); + /* construct the boot environment path from the dataset we're cloning */ + if (be_get_path(ldc, dspath, be_path, sizeof(be_path)) != BE_ERR_SUCCESS) + return (set_error(ldc->lbh, BE_ERR_UNKNOWN)); - if (zfs_dataset_exists(isdc->lbh->lzh, be_path, ZFS_TYPE_DATASET)) - return (set_error(isdc->lbh, BE_ERR_EXISTS)); + /* the dataset to be created (i.e. the boot environment) already exists */ + if (zfs_dataset_exists(ldc->lbh->lzh, be_path, ZFS_TYPE_DATASET)) + return (set_error(ldc->lbh, BE_ERR_EXISTS)); + /* no snapshot found for this dataset, silently skip it */ + if (!zfs_dataset_exists(ldc->lbh->lzh, snap_path, ZFS_TYPE_SNAPSHOT)) + return (0); + if ((snap_hdl = - zfs_open(isdc->lbh->lzh, snap_path, ZFS_TYPE_SNAPSHOT)) == NULL) - return (set_error(isdc->lbh, BE_ERR_ZFSOPEN)); + zfs_open(ldc->lbh->lzh, snap_path, ZFS_TYPE_SNAPSHOT)) == NULL) + return (set_error(ldc->lbh, BE_ERR_ZFSOPEN)); nvlist_alloc(&props, NV_UNIQUE_NAME, KM_SLEEP); nvlist_add_string(props, "canmount", "noauto"); - dccb.lbh = isdc->lbh; + dccb.lbh = ldc->lbh; dccb.zhp = ds; dccb.props = props; if (zprop_iter(be_deep_clone_prop, &dccb, B_FALSE, B_FALSE, @@ -490,58 +528,55 @@ be_deep_clone(zfs_handle_t *ds, void *data) return (-1); if ((err = zfs_clone(snap_hdl, be_path, props)) != 0) - err = BE_ERR_ZFSCLONE; + return (set_error(ldc->lbh, BE_ERR_ZFSCLONE)); nvlist_free(props); zfs_close(snap_hdl); - /* Failed to clone */ - if (err != BE_ERR_SUCCESS) - return (set_error(isdc->lbh, err)); + if (ldc->depth_limit == -1 || ldc->depth < ldc->depth_limit) { + ldc->depth++; + err = zfs_iter_filesystems(ds, be_clone_cb, ldc); + ldc->depth--; + } - sdc.lbh = isdc->lbh; - sdc.bename = NULL; - sdc.snapname = isdc->snapname; - sdc.be_root = (char *)&be_path; - - err = zfs_iter_filesystems(ds, be_deep_clone, &sdc); - - return (err); + return (set_error(ldc->lbh, err)); } /* - * Create the boot environment from pre-existing snapshot - */ -int -be_create_from_existing_snap(libbe_handle_t *lbh, const char *name, - const char *snap) + * Create a boot environment with a given name from a given snapshot. + * Snapshots can be in the format 'zroot/ROOT/default@snapshot' or + * 'default@snapshot'. In the latter case, 'default@snapshot' will be prepended + * with the root path that libbe was initailized with. +*/ +static int +be_clone(libbe_handle_t *lbh, const char *bename, const char *snapshot, int depth) { int err; - char be_path[BE_MAXPATHLEN]; char snap_path[BE_MAXPATHLEN]; - const char *bename; char *parentname, *snapname; zfs_handle_t *parent_hdl; - struct libbe_deep_clone sdc; + struct libbe_deep_clone ldc; - if ((err = be_validate_name(lbh, name)) != 0) + /* ensure the boot environment name is valid */ + if ((err = be_validate_name(lbh, bename)) != 0) return (set_error(lbh, err)); - if ((err = be_root_concat(lbh, snap, snap_path)) != 0) + + /* + * prepend the boot environment root path if we're + * given a partial snapshot name. + */ + if ((err = be_root_concat(lbh, snapshot, snap_path)) != 0) return (set_error(lbh, err)); + + /* ensure the snapshot exists */ if ((err = be_validate_snap(lbh, snap_path)) != 0) return (set_error(lbh, err)); - if ((err = be_root_concat(lbh, name, be_path)) != 0) - return (set_error(lbh, err)); - - if ((bename = strrchr(name, '/')) == NULL) - bename = name; - else - bename++; - + /* get a copy of the snapshot path so we can disect it */ if ((parentname = strdup(snap_path)) == NULL) return (set_error(lbh, BE_ERR_UNKNOWN)); + /* split dataset name from snapshot name */ snapname = strchr(parentname, '@'); if (snapname == NULL) { free(parentname); @@ -550,32 +585,56 @@ be_create_from_existing_snap(libbe_handle_t *lbh, cons *snapname = '\0'; snapname++; - sdc.lbh = lbh; - sdc.bename = bename; - sdc.snapname = snapname; - sdc.be_root = lbh->root; + /* set-up the boot environment */ + ldc.lbh = lbh; + ldc.bename = bename; + ldc.snapname = snapname; + ldc.depth = 0; + ldc.depth_limit = depth; + /* the boot environment will be cloned from this dataset */ parent_hdl = zfs_open(lbh->lzh, parentname, ZFS_TYPE_DATASET); - err = be_deep_clone(parent_hdl, &sdc); + /* create the boot environment */ + err = be_clone_cb(parent_hdl, &ldc); + free(parentname); return (set_error(lbh, err)); } +/* + * Create a boot environment from pre-existing snapshot, specifying a depth. + */ +int be_create_depth(libbe_handle_t *lbh, const char *bename, + const char *snap, int depth) +{ + return (be_clone(lbh, bename, snap, depth)); +} /* + * Create the boot environment from pre-existing snapshot + */ +int +be_create_from_existing_snap(libbe_handle_t *lbh, const char *bename, + const char *snap) +{ + return (be_clone(lbh, bename, snap, -1)); +} + + +/* * Create a boot environment from an existing boot environment */ int -be_create_from_existing(libbe_handle_t *lbh, const char *name, const char *old) +be_create_from_existing(libbe_handle_t *lbh, const char *bename, const char *old) { int err; - char buf[BE_MAXPATHLEN]; + char snap[BE_MAXPATHLEN]; - if ((err = be_snapshot(lbh, old, NULL, true, (char *)&buf)) != 0) + if ((err = be_snapshot(lbh, old, NULL, true, snap)) != 0) return (set_error(lbh, err)); - err = be_create_from_existing_snap(lbh, name, (char *)buf); + err = be_clone(lbh, bename, snap, -1); return (set_error(lbh, err)); } Modified: stable/12/lib/libbe/be.h ============================================================================== --- stable/12/lib/libbe/be.h Sun Apr 28 02:27:04 2019 (r346801) +++ stable/12/lib/libbe/be.h Sun Apr 28 03:49:40 2019 (r346802) @@ -84,6 +84,7 @@ int be_activate(libbe_handle_t *, const char *, bool); /* Bootenv creation functions */ int be_create(libbe_handle_t *, const char *); +int be_create_depth(libbe_handle_t *, const char *, const char *, int); int be_create_from_existing(libbe_handle_t *, const char *, const char *); int be_create_from_existing_snap(libbe_handle_t *, const char *, const char *); int be_snapshot(libbe_handle_t *, const char *, const char *, bool, char *); Modified: stable/12/lib/libbe/be_impl.h ============================================================================== --- stable/12/lib/libbe/be_impl.h Sun Apr 28 02:27:04 2019 (r346801) +++ stable/12/lib/libbe/be_impl.h Sun Apr 28 03:49:40 2019 (r346802) @@ -50,7 +50,8 @@ struct libbe_deep_clone { libbe_handle_t *lbh; const char *bename; const char *snapname; - const char *be_root; + int depth; + int depth_limit; }; struct libbe_dccb { Modified: stable/12/lib/libbe/libbe.3 ============================================================================== --- stable/12/lib/libbe/libbe.3 Sun Apr 28 02:27:04 2019 (r346801) +++ stable/12/lib/libbe/libbe.3 Sun Apr 28 03:49:40 2019 (r346802) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 12, 2019 +.Dd April 22, 2019 .Dt LIBBE 3 .Os .Sh NAME @@ -63,6 +63,9 @@ .Fn be_create "libbe_handle_t *hdl" "const char *be_name" .Pp .Ft int +.Fn be_create_depth "libbe_handle_t *hdl" "const char *be_name" "const char *snap" "int depth" +.Pp +.Ft int .Fn be_create_from_existing "libbe_handle_t *hdl" "const char *be_name" "const char *be_origin" .Pp .Ft int @@ -213,19 +216,29 @@ function returns the boot environment root path. The .Fn be_create function creates a boot environment with the given name. -It will be created from a snapshot of the currently booted boot environment. +The new boot environment will be created from a recursive snapshot of the +currently booted boot environment. .Pp The +.Fn be_create_depth +function creates a boot environment with the given name from an existing +snapshot. +The depth parameter specifies the depth of recursion that will be cloned from +the existing snapshot. +A depth of '0' is no recursion and '-1' is unlimited (i.e., a recursive boot +environment). +.Pp +The .Fn be_create_from_existing function creates a boot environment with the given name from the name of an existing boot environment. -A snapshot will be made of the base boot environment, and the new boot -environment will be created from that. +A recursive snapshot will be made of the origin boot environment, and the new +boot environment will be created from that. .Pp The .Fn be_create_from_existing_snap -function creates a boot environment with the given name from an existing -snapshot. +function creates a recursive boot environment with the given name from an +existing snapshot. .Pp The .Fn be_rename From owner-svn-src-all@freebsd.org Sun Apr 28 03:49:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B0AF1570314; Sun, 28 Apr 2019 03:49:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C154F8207D; Sun, 28 Apr 2019 03:49:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C0BE516A; Sun, 28 Apr 2019 03:49:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3S3nf8n010693; Sun, 28 Apr 2019 03:49:41 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3S3nesu010686; Sun, 28 Apr 2019 03:49:40 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904280349.x3S3nesu010686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 28 Apr 2019 03:49:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346802 - in stable: 11/etc/mtree 11/lib/libbe 11/lib/libbe/tests 12/etc/mtree 12/lib/libbe 12/lib/libbe/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/etc/mtree 11/lib/libbe 11/lib/libbe/tests 12/etc/mtree 12/lib/libbe 12/lib/libbe/tests X-SVN-Commit-Revision: 346802 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C154F8207D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.90 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.91)[-0.906,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 03:49:42 -0000 Author: kevans Date: Sun Apr 28 03:49:40 2019 New Revision: 346802 URL: https://svnweb.freebsd.org/changeset/base/346802 Log: MFC r346545-r346546, r346680, r346700, r346705 r346545: libbe(3): allow creation of arbitrary depth boot environments libbe currently only provides an API to create a recursive boot environment, without any formal support for intentionally limiting the depth. This changeset adds an API, be_create_depth, that may be used to arbitrarily restrict the depth of the new BE. r346546: libbe(3): Add a test for be creation r346680: libbe(3): Copy received properties as well This was inherently broken on send|recv datasets. r346700: libbe(3): Fix mis-application of patch (SHLIBDIR) Rob's patch in D18564 cemented the SHLIBDIR because bsd.own.mk (included by src.opts.mk) sets it to /usr/lib. r346546 did somehow not apply this part of the patch, leaving it to get installed to the wrong place and subsequently removed via ObsoleteFiles. r346705: libbe(3): Fix libcompat build SHLIBDIR should still be optionally set, just before src.opts.mk is included so that libcompat can properly override it. This fixes lib32 failures reported by both Jenkins and Michael Butler. Added: stable/11/lib/libbe/tests/ - copied from r346546, head/lib/libbe/tests/ Modified: stable/11/etc/mtree/BSD.tests.dist stable/11/lib/libbe/Makefile stable/11/lib/libbe/be.c stable/11/lib/libbe/be.h stable/11/lib/libbe/be_impl.h stable/11/lib/libbe/libbe.3 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Added: stable/12/lib/libbe/tests/ - copied from r346546, head/lib/libbe/tests/ Modified: stable/12/etc/mtree/BSD.tests.dist stable/12/lib/libbe/Makefile stable/12/lib/libbe/be.c stable/12/lib/libbe/be.h stable/12/lib/libbe/be_impl.h stable/12/lib/libbe/libbe.3 Directory Properties: stable/12/ (props changed) Modified: stable/11/etc/mtree/BSD.tests.dist ============================================================================== --- stable/11/etc/mtree/BSD.tests.dist Sun Apr 28 02:27:04 2019 (r346801) +++ stable/11/etc/mtree/BSD.tests.dist Sun Apr 28 03:49:40 2019 (r346802) @@ -264,6 +264,8 @@ .. libarchive .. + libbe + .. libc c063 .. Modified: stable/11/lib/libbe/Makefile ============================================================================== --- stable/11/lib/libbe/Makefile Sun Apr 28 02:27:04 2019 (r346801) +++ stable/11/lib/libbe/Makefile Sun Apr 28 03:49:40 2019 (r346802) @@ -1,8 +1,11 @@ # $FreeBSD$ +SHLIBDIR?= /lib + +.include + PACKAGE= lib${LIB} LIB= be -SHLIBDIR?= /lib SHLIB_MAJOR= 1 SHLIB_MINOR= 0 @@ -27,5 +30,8 @@ CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/ CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head CFLAGS+= -DNEED_SOLARIS_BOOLEAN + +HAS_TESTS= YES +SUBDIR.${MK_TESTS}+= tests .include Modified: stable/11/lib/libbe/be.c ============================================================================== --- stable/11/lib/libbe/be.c Sun Apr 28 02:27:04 2019 (r346801) +++ stable/11/lib/libbe/be.c Sun Apr 28 03:49:40 2019 (r346802) @@ -372,7 +372,6 @@ be_snapshot(libbe_handle_t *lbh, const char *source, c sizeof(buf)) >= sizeof(buf)) return (set_error(lbh, BE_ERR_INVALIDNAME)); } - if ((err = zfs_snapshot(lbh->lzh, buf, recursive, NULL)) != 0) { switch (err) { case EZFS_INVALIDNAME: @@ -432,8 +431,12 @@ be_deep_clone_prop(int prop, void *cb) /* Just continue if we fail to read a property */ return (ZPROP_CONT); - /* Only copy locally defined properties */ - if (src != ZPROP_SRC_LOCAL) + /* + * Only copy locally defined or received properties. This continues + * to avoid temporary/default/local properties intentionally without + * breaking received datasets. + */ + if (src != ZPROP_SRC_LOCAL && src != ZPROP_SRC_RECEIVED) return (ZPROP_CONT); /* Augment mountpoint with altroot, if needed */ @@ -446,43 +449,78 @@ be_deep_clone_prop(int prop, void *cb) return (ZPROP_CONT); } +/* + * Return the corresponding boot environment path for a given + * dataset path, the constructed path is placed in 'result'. + * + * example: say our new boot environment name is 'bootenv' and + * the dataset path is 'zroot/ROOT/default/data/set'. + * + * result should produce: 'zroot/ROOT/bootenv/data/set' + */ static int -be_deep_clone(zfs_handle_t *ds, void *data) +be_get_path(struct libbe_deep_clone *ldc, const char *dspath, char *result, int result_size) { + char *pos; + char *child_dataset; + + /* match the root path for the boot environments */ + pos = strstr(dspath, ldc->lbh->root); + + /* no match, different pools? */ + if (pos == NULL) + return (BE_ERR_BADPATH); + + /* root path of the new boot environment */ + snprintf(result, result_size, "%s/%s", ldc->lbh->root, ldc->bename); + + /* gets us to the parent dataset, the +1 consumes a trailing slash */ + pos += strlen(ldc->lbh->root) + 1; + + /* skip the parent dataset */ + if ((child_dataset = strchr(pos, '/')) != NULL) + strlcat(result, child_dataset, result_size); + + return (BE_ERR_SUCCESS); +} + +static int +be_clone_cb(zfs_handle_t *ds, void *data) +{ int err; char be_path[BE_MAXPATHLEN]; char snap_path[BE_MAXPATHLEN]; const char *dspath; - char *dsname; zfs_handle_t *snap_hdl; nvlist_t *props; - struct libbe_deep_clone *isdc, sdc; + struct libbe_deep_clone *ldc; struct libbe_dccb dccb; - isdc = (struct libbe_deep_clone *)data; + ldc = (struct libbe_deep_clone *)data; dspath = zfs_get_name(ds); - if ((dsname = strrchr(dspath, '/')) == NULL) - return (BE_ERR_UNKNOWN); - dsname++; - if (isdc->bename == NULL) - snprintf(be_path, sizeof(be_path), "%s/%s", isdc->be_root, dsname); - else - snprintf(be_path, sizeof(be_path), "%s/%s", isdc->be_root, isdc->bename); + snprintf(snap_path, sizeof(snap_path), "%s@%s", dspath, ldc->snapname); - snprintf(snap_path, sizeof(snap_path), "%s@%s", dspath, isdc->snapname); + /* construct the boot environment path from the dataset we're cloning */ + if (be_get_path(ldc, dspath, be_path, sizeof(be_path)) != BE_ERR_SUCCESS) + return (set_error(ldc->lbh, BE_ERR_UNKNOWN)); - if (zfs_dataset_exists(isdc->lbh->lzh, be_path, ZFS_TYPE_DATASET)) - return (set_error(isdc->lbh, BE_ERR_EXISTS)); + /* the dataset to be created (i.e. the boot environment) already exists */ + if (zfs_dataset_exists(ldc->lbh->lzh, be_path, ZFS_TYPE_DATASET)) + return (set_error(ldc->lbh, BE_ERR_EXISTS)); + /* no snapshot found for this dataset, silently skip it */ + if (!zfs_dataset_exists(ldc->lbh->lzh, snap_path, ZFS_TYPE_SNAPSHOT)) + return (0); + if ((snap_hdl = - zfs_open(isdc->lbh->lzh, snap_path, ZFS_TYPE_SNAPSHOT)) == NULL) - return (set_error(isdc->lbh, BE_ERR_ZFSOPEN)); + zfs_open(ldc->lbh->lzh, snap_path, ZFS_TYPE_SNAPSHOT)) == NULL) + return (set_error(ldc->lbh, BE_ERR_ZFSOPEN)); nvlist_alloc(&props, NV_UNIQUE_NAME, KM_SLEEP); nvlist_add_string(props, "canmount", "noauto"); - dccb.lbh = isdc->lbh; + dccb.lbh = ldc->lbh; dccb.zhp = ds; dccb.props = props; if (zprop_iter(be_deep_clone_prop, &dccb, B_FALSE, B_FALSE, @@ -490,58 +528,55 @@ be_deep_clone(zfs_handle_t *ds, void *data) return (-1); if ((err = zfs_clone(snap_hdl, be_path, props)) != 0) - err = BE_ERR_ZFSCLONE; + return (set_error(ldc->lbh, BE_ERR_ZFSCLONE)); nvlist_free(props); zfs_close(snap_hdl); - /* Failed to clone */ - if (err != BE_ERR_SUCCESS) - return (set_error(isdc->lbh, err)); + if (ldc->depth_limit == -1 || ldc->depth < ldc->depth_limit) { + ldc->depth++; + err = zfs_iter_filesystems(ds, be_clone_cb, ldc); + ldc->depth--; + } - sdc.lbh = isdc->lbh; - sdc.bename = NULL; - sdc.snapname = isdc->snapname; - sdc.be_root = (char *)&be_path; - - err = zfs_iter_filesystems(ds, be_deep_clone, &sdc); - - return (err); + return (set_error(ldc->lbh, err)); } /* - * Create the boot environment from pre-existing snapshot - */ -int -be_create_from_existing_snap(libbe_handle_t *lbh, const char *name, - const char *snap) + * Create a boot environment with a given name from a given snapshot. + * Snapshots can be in the format 'zroot/ROOT/default@snapshot' or + * 'default@snapshot'. In the latter case, 'default@snapshot' will be prepended + * with the root path that libbe was initailized with. +*/ +static int +be_clone(libbe_handle_t *lbh, const char *bename, const char *snapshot, int depth) { int err; - char be_path[BE_MAXPATHLEN]; char snap_path[BE_MAXPATHLEN]; - const char *bename; char *parentname, *snapname; zfs_handle_t *parent_hdl; - struct libbe_deep_clone sdc; + struct libbe_deep_clone ldc; - if ((err = be_validate_name(lbh, name)) != 0) + /* ensure the boot environment name is valid */ + if ((err = be_validate_name(lbh, bename)) != 0) return (set_error(lbh, err)); - if ((err = be_root_concat(lbh, snap, snap_path)) != 0) + + /* + * prepend the boot environment root path if we're + * given a partial snapshot name. + */ + if ((err = be_root_concat(lbh, snapshot, snap_path)) != 0) return (set_error(lbh, err)); + + /* ensure the snapshot exists */ if ((err = be_validate_snap(lbh, snap_path)) != 0) return (set_error(lbh, err)); - if ((err = be_root_concat(lbh, name, be_path)) != 0) - return (set_error(lbh, err)); - - if ((bename = strrchr(name, '/')) == NULL) - bename = name; - else - bename++; - + /* get a copy of the snapshot path so we can disect it */ if ((parentname = strdup(snap_path)) == NULL) return (set_error(lbh, BE_ERR_UNKNOWN)); + /* split dataset name from snapshot name */ snapname = strchr(parentname, '@'); if (snapname == NULL) { free(parentname); @@ -550,32 +585,56 @@ be_create_from_existing_snap(libbe_handle_t *lbh, cons *snapname = '\0'; snapname++; - sdc.lbh = lbh; - sdc.bename = bename; - sdc.snapname = snapname; - sdc.be_root = lbh->root; + /* set-up the boot environment */ + ldc.lbh = lbh; + ldc.bename = bename; + ldc.snapname = snapname; + ldc.depth = 0; + ldc.depth_limit = depth; + /* the boot environment will be cloned from this dataset */ parent_hdl = zfs_open(lbh->lzh, parentname, ZFS_TYPE_DATASET); - err = be_deep_clone(parent_hdl, &sdc); + /* create the boot environment */ + err = be_clone_cb(parent_hdl, &ldc); + free(parentname); return (set_error(lbh, err)); } +/* + * Create a boot environment from pre-existing snapshot, specifying a depth. + */ +int be_create_depth(libbe_handle_t *lbh, const char *bename, + const char *snap, int depth) +{ + return (be_clone(lbh, bename, snap, depth)); +} /* + * Create the boot environment from pre-existing snapshot + */ +int +be_create_from_existing_snap(libbe_handle_t *lbh, const char *bename, + const char *snap) +{ + return (be_clone(lbh, bename, snap, -1)); +} + + +/* * Create a boot environment from an existing boot environment */ int -be_create_from_existing(libbe_handle_t *lbh, const char *name, const char *old) +be_create_from_existing(libbe_handle_t *lbh, const char *bename, const char *old) { int err; - char buf[BE_MAXPATHLEN]; + char snap[BE_MAXPATHLEN]; - if ((err = be_snapshot(lbh, old, NULL, true, (char *)&buf)) != 0) + if ((err = be_snapshot(lbh, old, NULL, true, snap)) != 0) return (set_error(lbh, err)); - err = be_create_from_existing_snap(lbh, name, (char *)buf); + err = be_clone(lbh, bename, snap, -1); return (set_error(lbh, err)); } Modified: stable/11/lib/libbe/be.h ============================================================================== --- stable/11/lib/libbe/be.h Sun Apr 28 02:27:04 2019 (r346801) +++ stable/11/lib/libbe/be.h Sun Apr 28 03:49:40 2019 (r346802) @@ -84,6 +84,7 @@ int be_activate(libbe_handle_t *, const char *, bool); /* Bootenv creation functions */ int be_create(libbe_handle_t *, const char *); +int be_create_depth(libbe_handle_t *, const char *, const char *, int); int be_create_from_existing(libbe_handle_t *, const char *, const char *); int be_create_from_existing_snap(libbe_handle_t *, const char *, const char *); int be_snapshot(libbe_handle_t *, const char *, const char *, bool, char *); Modified: stable/11/lib/libbe/be_impl.h ============================================================================== --- stable/11/lib/libbe/be_impl.h Sun Apr 28 02:27:04 2019 (r346801) +++ stable/11/lib/libbe/be_impl.h Sun Apr 28 03:49:40 2019 (r346802) @@ -50,7 +50,8 @@ struct libbe_deep_clone { libbe_handle_t *lbh; const char *bename; const char *snapname; - const char *be_root; + int depth; + int depth_limit; }; struct libbe_dccb { Modified: stable/11/lib/libbe/libbe.3 ============================================================================== --- stable/11/lib/libbe/libbe.3 Sun Apr 28 02:27:04 2019 (r346801) +++ stable/11/lib/libbe/libbe.3 Sun Apr 28 03:49:40 2019 (r346802) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 12, 2019 +.Dd April 22, 2019 .Dt LIBBE 3 .Os .Sh NAME @@ -63,6 +63,9 @@ .Fn be_create "libbe_handle_t *hdl" "const char *be_name" .Pp .Ft int +.Fn be_create_depth "libbe_handle_t *hdl" "const char *be_name" "const char *snap" "int depth" +.Pp +.Ft int .Fn be_create_from_existing "libbe_handle_t *hdl" "const char *be_name" "const char *be_origin" .Pp .Ft int @@ -213,19 +216,29 @@ function returns the boot environment root path. The .Fn be_create function creates a boot environment with the given name. -It will be created from a snapshot of the currently booted boot environment. +The new boot environment will be created from a recursive snapshot of the +currently booted boot environment. .Pp The +.Fn be_create_depth +function creates a boot environment with the given name from an existing +snapshot. +The depth parameter specifies the depth of recursion that will be cloned from +the existing snapshot. +A depth of '0' is no recursion and '-1' is unlimited (i.e., a recursive boot +environment). +.Pp +The .Fn be_create_from_existing function creates a boot environment with the given name from the name of an existing boot environment. -A snapshot will be made of the base boot environment, and the new boot -environment will be created from that. +A recursive snapshot will be made of the origin boot environment, and the new +boot environment will be created from that. .Pp The .Fn be_create_from_existing_snap -function creates a boot environment with the given name from an existing -snapshot. +function creates a recursive boot environment with the given name from an +existing snapshot. .Pp The .Fn be_rename From owner-svn-src-all@freebsd.org Sun Apr 28 03:51:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C6051570488; Sun, 28 Apr 2019 03:51:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42BA282364; Sun, 28 Apr 2019 03:51:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19ABE529E; Sun, 28 Apr 2019 03:51:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3S3p8Mk014556; Sun, 28 Apr 2019 03:51:08 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3S3p8Gk014555; Sun, 28 Apr 2019 03:51:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904280351.x3S3p8Gk014555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 28 Apr 2019 03:51:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346803 - in stable: 11/sys/net 12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/sys/net 12/sys/net X-SVN-Commit-Revision: 346803 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 42BA282364 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.89 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.90)[-0.898,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 03:51:09 -0000 Author: kevans Date: Sun Apr 28 03:51:08 2019 New Revision: 346803 URL: https://svnweb.freebsd.org/changeset/base/346803 Log: MFC r346688-r346689: tap(4) MODULE_VERSION r346688: tap(4): Add a MODULE_VERSION Otherwise tap(4) can be loaded by loader despite being compiled into the kernel, causing a panic as things try to double-initialize. r346689: tap(4): Correct driver name... PR: 220867 Modified: stable/12/sys/net/if_tap.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/net/if_tap.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/net/if_tap.c ============================================================================== --- stable/12/sys/net/if_tap.c Sun Apr 28 03:49:40 2019 (r346802) +++ stable/12/sys/net/if_tap.c Sun Apr 28 03:51:08 2019 (r346803) @@ -175,6 +175,7 @@ SYSCTL_INT(_net_link_tap, OID_AUTO, devfs_cloning, CTL SYSCTL_INT(_net_link_tap, OID_AUTO, debug, CTLFLAG_RW, &tapdebug, 0, ""); DEV_MODULE(if_tap, tapmodevent, NULL); +MODULE_VERSION(if_tap, 1); static int tap_clone_create(struct if_clone *ifc, int unit, caddr_t params) From owner-svn-src-all@freebsd.org Sun Apr 28 03:51:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DFDE1570481; Sun, 28 Apr 2019 03:51:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05B0982361; Sun, 28 Apr 2019 03:51:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2DC8529B; Sun, 28 Apr 2019 03:51:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3S3p8Uw014355; Sun, 28 Apr 2019 03:51:08 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3S3p8A1014330; Sun, 28 Apr 2019 03:51:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201904280351.x3S3p8A1014330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 28 Apr 2019 03:51:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346803 - in stable: 11/sys/net 12/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/sys/net 12/sys/net X-SVN-Commit-Revision: 346803 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 05B0982361 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.89 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.90)[-0.898,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 03:51:09 -0000 Author: kevans Date: Sun Apr 28 03:51:08 2019 New Revision: 346803 URL: https://svnweb.freebsd.org/changeset/base/346803 Log: MFC r346688-r346689: tap(4) MODULE_VERSION r346688: tap(4): Add a MODULE_VERSION Otherwise tap(4) can be loaded by loader despite being compiled into the kernel, causing a panic as things try to double-initialize. r346689: tap(4): Correct driver name... PR: 220867 Modified: stable/11/sys/net/if_tap.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/net/if_tap.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/net/if_tap.c ============================================================================== --- stable/11/sys/net/if_tap.c Sun Apr 28 03:49:40 2019 (r346802) +++ stable/11/sys/net/if_tap.c Sun Apr 28 03:51:08 2019 (r346803) @@ -175,6 +175,7 @@ SYSCTL_INT(_net_link_tap, OID_AUTO, devfs_cloning, CTL SYSCTL_INT(_net_link_tap, OID_AUTO, debug, CTLFLAG_RW, &tapdebug, 0, ""); DEV_MODULE(if_tap, tapmodevent, NULL); +MODULE_VERSION(if_tap, 1); static int tap_clone_create(struct if_clone *ifc, int unit, caddr_t params) From owner-svn-src-all@freebsd.org Sun Apr 28 04:05:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF2701570C59; Sun, 28 Apr 2019 04:05:44 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3AD0C82C9E; Sun, 28 Apr 2019 04:05:44 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E1A154BD; Sun, 28 Apr 2019 04:05:44 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3S45h7U021235; Sun, 28 Apr 2019 04:05:43 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3S45hBG021234; Sun, 28 Apr 2019 04:05:43 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201904280405.x3S45hBG021234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 28 Apr 2019 04:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346804 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 346804 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3AD0C82C9E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.91)[-0.912,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 04:05:45 -0000 Author: cy Date: Sun Apr 28 04:05:43 2019 New Revision: 346804 URL: https://svnweb.freebsd.org/changeset/base/346804 Log: Left justify a function header brace as it should be. No functional change. MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sun Apr 28 03:51:08 2019 (r346803) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sun Apr 28 04:05:43 2019 (r346804) @@ -1169,7 +1169,7 @@ ipf_checkv6sum(fin) size_t mbufchainlen(m0) struct mbuf *m0; - { +{ size_t len; if ((m0->m_flags & M_PKTHDR) != 0) { From owner-svn-src-all@freebsd.org Sun Apr 28 06:52:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB2DA1574731; Sun, 28 Apr 2019 06:52:01 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B17E86F31; Sun, 28 Apr 2019 06:52:01 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3429C6FFB; Sun, 28 Apr 2019 06:52:01 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3S6q1JI010149; Sun, 28 Apr 2019 06:52:01 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3S6pxhY008312; Sun, 28 Apr 2019 06:51:59 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904280651.x3S6pxhY008312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 28 Apr 2019 06:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346805 - in stable/11: sys/dev/cxgbe sys/dev/cxgbe/tom usr.sbin/cxgbetool X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11: sys/dev/cxgbe sys/dev/cxgbe/tom usr.sbin/cxgbetool X-SVN-Commit-Revision: 346805 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5B17E86F31 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 06:52:02 -0000 Author: np Date: Sun Apr 28 06:51:59 2019 New Revision: 346805 URL: https://svnweb.freebsd.org/changeset/base/346805 Log: MFC r317849 (partial), r332506, and r332787. r317849 (partial, required by r332506): cxgbe/t4_tom: Per-connection rate limiting for TCP sockets handled by the TOE. Sponsored by: Chelsio Communications r332506: cxgbe(4): Add support for Connection Offload Policy (aka COP). COP allows fine-grained control on whether to offload a TCP connection using t4_tom, and what settings to apply to a connection selected for offload. t4_tom must still be loaded and IFCAP_TOE must still be enabled for full TCP offload to take place on an interface. The difference is that IFCAP_TOE used to be the only knob and would enable TOE for all new connections on the inteface, but now the driver will also consult the COP, if any, before offloading to the hardware TOE. A policy is a plain text file with any number of rules, one per line. Each rule has a "match" part consisting of a socket-type (L = listen, A = active open, P = passive open, D = don't care) and a pcap-filter(7) expression, and a "settings" part that specifies whether to offload the connection or not and the parameters to use if so. The general format of a rule is: [socket-type] expr => settings Example. See cxgbetool(8) for more information. [L] ip && port http => offload [L] port 443 => !offload [L] port ssh => offload [P] src net 192.168/16 && dst port ssh => offload !nagle !timestamp cong newreno [P] dst port ssh => offload !nagle ecn cong tahoe [P] dst port http => offload [A] dst port 443 => offload tls [A] dst net 192.168/16 => offload !timestamp cong highspeed The driver processes the rules for each new listen, active open, or passive open and stops at the first match. There is an implicit rule at the end of every policy that prohibits offload when no rule in the policy matches: [D] all => !offload This is a reworked and expanded version of a patch submitted by Krishnamraju Eraparaju @ Chelsio. Sponsored by: Chelsio Communications r332787: cxgbe(4): Fix bugs in the handling of COP rules that match on VLAN tag. Retrieve the tag from the correct ifnet and use the provided tag (instead of hardcoded 0xffff, implying no tag) in the routines that process offload policy. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/offload.h stable/11/sys/dev/cxgbe/t4_ioctl.h stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/cxgbe/t4_sge.c stable/11/sys/dev/cxgbe/tom/t4_connect.c stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c stable/11/sys/dev/cxgbe/tom/t4_listen.c stable/11/sys/dev/cxgbe/tom/t4_tom.c stable/11/sys/dev/cxgbe/tom/t4_tom.h stable/11/usr.sbin/cxgbetool/Makefile stable/11/usr.sbin/cxgbetool/cxgbetool.8 stable/11/usr.sbin/cxgbetool/cxgbetool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Sun Apr 28 04:05:43 2019 (r346804) +++ stable/11/sys/dev/cxgbe/adapter.h Sun Apr 28 06:51:59 2019 (r346805) @@ -804,8 +804,11 @@ struct adapter { void *tom_softc; /* (struct tom_data *) */ struct tom_tunables tt; - struct iw_tunables iwt; + struct t4_offload_policy *policy; + struct rwlock policy_lock; + void *iwarp_softc; /* (struct c4iw_dev *) */ + struct iw_tunables iwt; void *iscsi_ulp_softc; /* (struct cxgbei_data *) */ void *ccr_softc; /* (struct ccr_softc *) */ struct l2t_data *l2t; /* L2 table */ Modified: stable/11/sys/dev/cxgbe/offload.h ============================================================================== --- stable/11/sys/dev/cxgbe/offload.h Sun Apr 28 04:05:43 2019 (r346804) +++ stable/11/sys/dev/cxgbe/offload.h Sun Apr 28 06:51:59 2019 (r346805) @@ -154,6 +154,7 @@ struct tom_tunables { int num_tls_rx_ports; int tx_align; int tx_zcopy; + int cop_managed_offloading; }; /* iWARP driver tunables */ struct iw_tunables { Modified: stable/11/sys/dev/cxgbe/t4_ioctl.h ============================================================================== --- stable/11/sys/dev/cxgbe/t4_ioctl.h Sun Apr 28 04:05:43 2019 (r346804) +++ stable/11/sys/dev/cxgbe/t4_ioctl.h Sun Apr 28 06:51:59 2019 (r346805) @@ -33,6 +33,7 @@ #include #include +#include /* * Ioctl commands specific to this driver. @@ -342,6 +343,44 @@ struct t4_cudbg_dump { uint8_t *data; }; +enum { + OPEN_TYPE_LISTEN = 'L', + OPEN_TYPE_ACTIVE = 'A', + OPEN_TYPE_PASSIVE = 'P', + OPEN_TYPE_DONTCARE = 'D', +}; + +struct offload_settings { + int8_t offload; + int8_t rx_coalesce; + int8_t cong_algo; + int8_t sched_class; + int8_t tstamp; + int8_t sack; + int8_t nagle; + int8_t ecn; + int8_t ddp; + int8_t tls; + int16_t txq; + int16_t rxq; + int16_t mss; +}; + +struct offload_rule { + char open_type; + struct offload_settings settings; + struct bpf_program bpf_prog; /* compiled program/filter */ +}; + +/* + * An offload policy consists of a set of rules matched in sequence. The + * settings of the first rule that matches are applied to that connection. + */ +struct t4_offload_policy { + uint32_t nrules; + struct offload_rule *rule; +}; + #define CHELSIO_T4_GETREG _IOWR('f', T4_GETREG, struct t4_reg) #define CHELSIO_T4_SETREG _IOW('f', T4_SETREG, struct t4_reg) #define CHELSIO_T4_REGDUMP _IOWR('f', T4_REGDUMP, struct t4_regdump) @@ -366,4 +405,5 @@ struct t4_cudbg_dump { #define CHELSIO_T4_LOAD_BOOT _IOW('f', T4_LOAD_BOOT, struct t4_bootrom) #define CHELSIO_T4_LOAD_BOOTCFG _IOW('f', T4_LOAD_BOOTCFG, struct t4_data) #define CHELSIO_T4_CUDBG_DUMP _IOWR('f', T4_CUDBG_DUMP, struct t4_cudbg_dump) +#define CHELSIO_T4_SET_OFLD_POLICY _IOW('f', T4_SET_OFLD_POLICY, struct t4_offload_policy) #endif Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Sun Apr 28 04:05:43 2019 (r346804) +++ stable/11/sys/dev/cxgbe/t4_main.c Sun Apr 28 06:51:59 2019 (r346805) @@ -543,6 +543,14 @@ SYSCTL_INT(_hw_cxgbe, OID_AUTO, pcie_relaxed_ordering, "PCIe Relaxed Ordering: 0 = disable, 1 = enable, 2 = leave alone"); +#ifdef TCP_OFFLOAD +/* + * TOE tunables. + */ +static int t4_cop_managed_offloading = 0; +TUNABLE_INT("hw.cxgbe.cop_managed_offloading", &t4_cop_managed_offloading); +#endif + /* Functions used by VIs to obtain unique MAC addresses for each VI. */ static int vi_mac_funcs[] = { FW_VI_FUNC_ETH, @@ -699,6 +707,8 @@ static int load_cfg(struct adapter *, struct t4_data * static int load_boot(struct adapter *, struct t4_bootrom *); static int load_bootcfg(struct adapter *, struct t4_data *); static int cudbg_dump(struct adapter *, struct t4_cudbg_dump *); +static void free_offload_policy(struct t4_offload_policy *); +static int set_offload_policy(struct adapter *, struct t4_offload_policy *); static int read_card_mem(struct adapter *, int, struct t4_mem_range *); static int read_i2c(struct adapter *, struct t4_i2c_data *); #ifdef TCP_OFFLOAD @@ -1000,6 +1010,9 @@ t4_attach(device_t dev) mtx_init(&sc->reg_lock, "indirect register access", 0, MTX_DEF); + sc->policy = NULL; + rw_init(&sc->policy_lock, "connection offload policy"); + rc = t4_map_bars_0_and_4(sc); if (rc != 0) goto done; /* error message displayed already */ @@ -1541,6 +1554,14 @@ t4_detach_common(device_t dev) if (mtx_initialized(&sc->reg_lock)) mtx_destroy(&sc->reg_lock); + if (rw_initialized(&sc->policy_lock)) { + rw_destroy(&sc->policy_lock); +#ifdef TCP_OFFLOAD + if (sc->policy != NULL) + free_offload_policy(sc->policy); +#endif + } + for (i = 0; i < NUM_MEMWIN; i++) { struct memwin *mw = &sc->memwin[i]; @@ -5817,6 +5838,12 @@ t4_sysctls(struct adapter *sc) CTLFLAG_RW, &sc->tt.tx_zcopy, 0, "Enable zero-copy aio_write(2)"); + sc->tt.cop_managed_offloading = !!t4_cop_managed_offloading; + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "cop_managed_offloading", CTLFLAG_RW, + &sc->tt.cop_managed_offloading, 0, + "COP (Connection Offload Policy) controls all TOE offload"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "timer_tick", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_tp_tick, "A", "TP timer tick (us)"); @@ -9839,6 +9866,113 @@ done: return (rc); } +static void +free_offload_policy(struct t4_offload_policy *op) +{ + struct offload_rule *r; + int i; + + if (op == NULL) + return; + + r = &op->rule[0]; + for (i = 0; i < op->nrules; i++, r++) { + free(r->bpf_prog.bf_insns, M_CXGBE); + } + free(op->rule, M_CXGBE); + free(op, M_CXGBE); +} + +static int +set_offload_policy(struct adapter *sc, struct t4_offload_policy *uop) +{ + int i, rc, len; + struct t4_offload_policy *op, *old; + struct bpf_program *bf; + const struct offload_settings *s; + struct offload_rule *r; + void *u; + + if (!is_offload(sc)) + return (ENODEV); + + if (uop->nrules == 0) { + /* Delete installed policies. */ + op = NULL; + goto set_policy; + } if (uop->nrules > 256) { /* arbitrary */ + return (E2BIG); + } + + /* Copy userspace offload policy to kernel */ + op = malloc(sizeof(*op), M_CXGBE, M_ZERO | M_WAITOK); + op->nrules = uop->nrules; + len = op->nrules * sizeof(struct offload_rule); + op->rule = malloc(len, M_CXGBE, M_ZERO | M_WAITOK); + rc = copyin(uop->rule, op->rule, len); + if (rc) { + free(op->rule, M_CXGBE); + free(op, M_CXGBE); + return (rc); + } + + r = &op->rule[0]; + for (i = 0; i < op->nrules; i++, r++) { + + /* Validate open_type */ + if (r->open_type != OPEN_TYPE_LISTEN && + r->open_type != OPEN_TYPE_ACTIVE && + r->open_type != OPEN_TYPE_PASSIVE && + r->open_type != OPEN_TYPE_DONTCARE) { +error: + /* + * Rules 0 to i have malloc'd filters that need to be + * freed. Rules i+1 to nrules have userspace pointers + * and should be left alone. + */ + op->nrules = i; + free_offload_policy(op); + return (rc); + } + + /* Validate settings */ + s = &r->settings; + if ((s->offload != 0 && s->offload != 1) || + s->cong_algo < -1 || s->cong_algo > CONG_ALG_HIGHSPEED || + s->sched_class < -1 || + s->sched_class >= sc->chip_params->nsched_cls) { + rc = EINVAL; + goto error; + } + + bf = &r->bpf_prog; + u = bf->bf_insns; /* userspace ptr */ + bf->bf_insns = NULL; + if (bf->bf_len == 0) { + /* legal, matches everything */ + continue; + } + len = bf->bf_len * sizeof(*bf->bf_insns); + bf->bf_insns = malloc(len, M_CXGBE, M_ZERO | M_WAITOK); + rc = copyin(u, bf->bf_insns, len); + if (rc != 0) + goto error; + + if (!bpf_validate(bf->bf_insns, bf->bf_len)) { + rc = EINVAL; + goto error; + } + } +set_policy: + rw_wlock(&sc->policy_lock); + old = sc->policy; + sc->policy = op; + rw_wunlock(&sc->policy_lock); + free_offload_policy(old); + + return (0); +} + #define MAX_READ_BUF_SIZE (128 * 1024) static int read_card_mem(struct adapter *sc, int win, struct t4_mem_range *mr) @@ -10204,6 +10338,9 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t break; case CHELSIO_T4_CUDBG_DUMP: rc = cudbg_dump(sc, (struct t4_cudbg_dump *)data); + break; + case CHELSIO_T4_SET_OFLD_POLICY: + rc = set_offload_policy(sc, (struct t4_offload_policy *)data); break; default: rc = ENOTTY; Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Sun Apr 28 04:05:43 2019 (r346804) +++ stable/11/sys/dev/cxgbe/t4_sge.c Sun Apr 28 06:51:59 2019 (r346805) @@ -965,8 +965,10 @@ mtu_to_max_payload(struct adapter *sc, int mtu, const #ifdef TCP_OFFLOAD if (toe) { - payload = sc->tt.rx_coalesce ? - G_RXCOALESCESIZE(t4_read_reg(sc, A_TP_PARA_REG2)) : mtu; + int rxcs = G_RXCOALESCESIZE(t4_read_reg(sc, A_TP_PARA_REG2)); + + /* Note that COP can set rx_coalesce on/off per connection. */ + payload = max(mtu, rxcs); } else { #endif /* large enough even when hw VLAN extraction is disabled */ Modified: stable/11/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_connect.c Sun Apr 28 04:05:43 2019 (r346804) +++ stable/11/sys/dev/cxgbe/tom/t4_connect.c Sun Apr 28 06:51:59 2019 (r346805) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -53,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "common/common.h" #include "common/t4_msg.h" @@ -231,47 +233,85 @@ do_act_open_rpl(struct sge_iq *iq, const struct rss_he * Options2 for active open. */ static uint32_t -calc_opt2a(struct socket *so, struct toepcb *toep) +calc_opt2a(struct socket *so, struct toepcb *toep, + const struct offload_settings *s) { struct tcpcb *tp = so_sototcpcb(so); struct port_info *pi = toep->vi->pi; struct adapter *sc = pi->adapter; - uint32_t opt2; + uint32_t opt2 = 0; - opt2 = V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]) | - F_RSS_QUEUE_VALID | V_RSS_QUEUE(toep->ofld_rxq->iq.abs_id); + /* + * rx flow control, rx coalesce, congestion control, and tx pace are all + * explicitly set by the driver. On T5+ the ISS is also set by the + * driver to the value picked by the kernel. + */ + if (is_t4(sc)) { + opt2 |= F_RX_FC_VALID | F_RX_COALESCE_VALID; + opt2 |= F_CONG_CNTRL_VALID | F_PACE_VALID; + } else { + opt2 |= F_T5_OPT_2_VALID; /* all 4 valid */ + opt2 |= F_T5_ISS; /* ISS provided in CPL */ + } - if (tp->t_flags & TF_SACK_PERMIT) + if (s->sack > 0 || (s->sack < 0 && (tp->t_flags & TF_SACK_PERMIT))) opt2 |= F_SACK_EN; - if (tp->t_flags & TF_REQ_TSTMP) + if (s->tstamp > 0 || (s->tstamp < 0 && (tp->t_flags & TF_REQ_TSTMP))) opt2 |= F_TSTAMPS_EN; if (tp->t_flags & TF_REQ_SCALE) opt2 |= F_WND_SCALE_EN; - if (V_tcp_do_ecn) + if (s->ecn > 0 || (s->ecn < 0 && V_tcp_do_ecn == 1)) opt2 |= F_CCTRL_ECN; - /* RX_COALESCE is always a valid value (M_RX_COALESCE). */ - if (is_t4(sc)) - opt2 |= F_RX_COALESCE_VALID; + /* XXX: F_RX_CHANNEL for multiple rx c-chan support goes here. */ + + opt2 |= V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]); + + /* These defaults are subject to ULP specific fixups later. */ + opt2 |= V_RX_FC_DDP(0) | V_RX_FC_DISABLE(0); + + opt2 |= V_PACE(0); + + if (s->cong_algo >= 0) + opt2 |= V_CONG_CNTRL(s->cong_algo); + else if (sc->tt.cong_algorithm >= 0) + opt2 |= V_CONG_CNTRL(sc->tt.cong_algorithm & M_CONG_CNTRL); else { - opt2 |= F_T5_OPT_2_VALID; - opt2 |= F_T5_ISS; + struct cc_algo *cc = CC_ALGO(tp); + + if (strcasecmp(cc->name, "reno") == 0) + opt2 |= V_CONG_CNTRL(CONG_ALG_RENO); + else if (strcasecmp(cc->name, "tahoe") == 0) + opt2 |= V_CONG_CNTRL(CONG_ALG_TAHOE); + if (strcasecmp(cc->name, "newreno") == 0) + opt2 |= V_CONG_CNTRL(CONG_ALG_NEWRENO); + if (strcasecmp(cc->name, "highspeed") == 0) + opt2 |= V_CONG_CNTRL(CONG_ALG_HIGHSPEED); + else { + /* + * Use newreno in case the algorithm selected by the + * host stack is not supported by the hardware. + */ + opt2 |= V_CONG_CNTRL(CONG_ALG_NEWRENO); + } } - if (sc->tt.rx_coalesce) + + if (s->rx_coalesce > 0 || (s->rx_coalesce < 0 && sc->tt.rx_coalesce)) opt2 |= V_RX_COALESCE(M_RX_COALESCE); - if (sc->tt.cong_algorithm != -1) - opt2 |= V_CONG_CNTRL(sc->tt.cong_algorithm & M_CONG_CNTRL); + /* Note that ofld_rxq is already set according to s->rxq. */ + opt2 |= F_RSS_QUEUE_VALID; + opt2 |= V_RSS_QUEUE(toep->ofld_rxq->iq.abs_id); #ifdef USE_DDP_RX_FLOW_CONTROL if (toep->ulp_mode == ULP_MODE_TCPDDP) - opt2 |= F_RX_FC_VALID | F_RX_FC_DDP; + opt2 |= F_RX_FC_DDP; #endif + if (toep->ulp_mode == ULP_MODE_TLS) { - opt2 |= F_RX_FC_VALID; opt2 &= ~V_RX_COALESCE(M_RX_COALESCE); opt2 |= F_RX_FC_DISABLE; } @@ -346,10 +386,12 @@ t4_connect(struct toedev *tod, struct socket *so, stru struct wrqe *wr = NULL; struct ifnet *rt_ifp = rt->rt_ifp; struct vi_info *vi; - int mtu_idx, rscale, qid_atid, rc, isipv6; + int mtu_idx, rscale, qid_atid, rc, isipv6, txqid, rxqid; struct inpcb *inp = sotoinpcb(so); struct tcpcb *tp = intotcpcb(inp); int reason; + struct offload_settings settings; + uint16_t vid = 0xffff; INP_WLOCK_ASSERT(inp); KASSERT(nam->sa_family == AF_INET || nam->sa_family == AF_INET6, @@ -361,12 +403,30 @@ t4_connect(struct toedev *tod, struct socket *so, stru struct ifnet *ifp = VLAN_COOKIE(rt_ifp); vi = ifp->if_softc; + VLAN_TAG(rt_ifp, &vid); } else if (rt_ifp->if_type == IFT_IEEE8023ADLAG) DONT_OFFLOAD_ACTIVE_OPEN(ENOSYS); /* XXX: implement lagg+TOE */ else DONT_OFFLOAD_ACTIVE_OPEN(ENOTSUP); - toep = alloc_toepcb(vi, -1, -1, M_NOWAIT | M_ZERO); + rw_rlock(&sc->policy_lock); + settings = *lookup_offload_policy(sc, OPEN_TYPE_ACTIVE, NULL, vid, inp); + rw_runlock(&sc->policy_lock); + if (!settings.offload) + DONT_OFFLOAD_ACTIVE_OPEN(EPERM); + + if (settings.txq >= 0 && settings.txq < vi->nofldtxq) + txqid = settings.txq; + else + txqid = arc4random() % vi->nofldtxq; + txqid += vi->first_ofld_txq; + if (settings.rxq >= 0 && settings.rxq < vi->nofldrxq) + rxqid = settings.rxq; + else + rxqid = arc4random() % vi->nofldrxq; + rxqid += vi->first_ofld_rxq; + + toep = alloc_toepcb(vi, txqid, rxqid, M_NOWAIT | M_ZERO); if (toep == NULL) DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM); @@ -385,7 +445,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM); toep->vnet = so->so_vnet; - set_ulp_mode(toep, select_ulp_mode(so, sc)); + set_ulp_mode(toep, select_ulp_mode(so, sc, &settings)); SOCKBUF_LOCK(&so->so_rcv); /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ toep->rx_credits = min(select_rcv_wnd(so) >> 10, M_RCV_BUFSIZ); @@ -400,7 +460,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru rscale = tp->request_r_scale = select_rcv_wscale(); else rscale = 0; - mtu_idx = find_best_mtu_idx(sc, &inp->inp_inc, 0); + mtu_idx = find_best_mtu_idx(sc, &inp->inp_inc, &settings); qid_atid = (toep->ofld_rxq->iq.abs_id << 14) | toep->tid; if (isipv6) { @@ -441,8 +501,8 @@ t4_connect(struct toedev *tod, struct socket *so, stru cpl->peer_ip_hi = *(uint64_t *)&inp->in6p_faddr.s6_addr[0]; cpl->peer_ip_lo = *(uint64_t *)&inp->in6p_faddr.s6_addr[8]; cpl->opt0 = calc_opt0(so, vi, toep->l2te, mtu_idx, rscale, - toep->rx_credits, toep->ulp_mode); - cpl->opt2 = calc_opt2a(so, toep); + toep->rx_credits, toep->ulp_mode, &settings); + cpl->opt2 = calc_opt2a(so, toep, &settings); } else { struct cpl_act_open_req *cpl = wrtod(wr); struct cpl_t5_act_open_req *cpl5 = (void *)cpl; @@ -470,8 +530,8 @@ t4_connect(struct toedev *tod, struct socket *so, stru inp_4tuple_get(inp, &cpl->local_ip, &cpl->local_port, &cpl->peer_ip, &cpl->peer_port); cpl->opt0 = calc_opt0(so, vi, toep->l2te, mtu_idx, rscale, - toep->rx_credits, toep->ulp_mode); - cpl->opt2 = calc_opt2a(so, toep); + toep->rx_credits, toep->ulp_mode, &settings); + cpl->opt2 = calc_opt2a(so, toep, &settings); } CTR5(KTR_CXGBE, "%s: atid %u (%s), toep %p, inp %p", __func__, Modified: stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Sun Apr 28 04:05:43 2019 (r346804) +++ stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Sun Apr 28 06:51:59 2019 (r346805) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" +#include "opt_inet6.h" #ifdef TCP_OFFLOAD #include @@ -130,6 +131,11 @@ send_flowc_wr(struct toepcb *toep, struct flowc_tx_par nparams++; if (toep->tls.fcplenmax != 0) nparams++; + if (toep->tc_idx != -1) { + MPASS(toep->tc_idx >= 0 && + toep->tc_idx < sc->chip_params->nsched_cls); + nparams++; + } flowclen = sizeof(*flowc) + nparams * sizeof(struct fw_flowc_mnemval); @@ -181,6 +187,8 @@ send_flowc_wr(struct toepcb *toep, struct flowc_tx_par FLOWC_PARAM(ULP_MODE, toep->ulp_mode); if (toep->tls.fcplenmax != 0) FLOWC_PARAM(TXDATAPLEN_MAX, toep->tls.fcplenmax); + if (toep->tc_idx != -1) + FLOWC_PARAM(SCHEDCLASS, toep->tc_idx); #undef FLOWC_PARAM KASSERT(paramidx == nparams, ("nparams mismatch")); @@ -198,6 +206,76 @@ send_flowc_wr(struct toepcb *toep, struct flowc_tx_par t4_wrq_tx(sc, wr); } +#ifdef RATELIMIT +/* + * Input is Bytes/second (so_max_pacing-rate), chip counts in Kilobits/second. + */ +static int +update_tx_rate_limit(struct adapter *sc, struct toepcb *toep, u_int Bps) +{ + int tc_idx, rc; + const u_int kbps = (u_int) (uint64_t)Bps * 8ULL / 1000; + const int port_id = toep->vi->pi->port_id; + + CTR3(KTR_CXGBE, "%s: tid %u, rate %uKbps", __func__, toep->tid, kbps); + + if (kbps == 0) { + /* unbind */ + tc_idx = -1; + } else { + rc = t4_reserve_cl_rl_kbps(sc, port_id, kbps, &tc_idx); + if (rc != 0) + return (rc); + MPASS(tc_idx >= 0 && tc_idx < sc->chip_params->nsched_cls); + } + + if (toep->tc_idx != tc_idx) { + struct wrqe *wr; + struct fw_flowc_wr *flowc; + int nparams = 1, flowclen, flowclen16; + struct ofld_tx_sdesc *txsd = &toep->txsd[toep->txsd_pidx]; + + flowclen = sizeof(*flowc) + nparams * sizeof(struct + fw_flowc_mnemval); + flowclen16 = howmany(flowclen, 16); + if (toep->tx_credits < flowclen16 || toep->txsd_avail == 0 || + (wr = alloc_wrqe(roundup2(flowclen, 16), toep->ofld_txq)) == NULL) { + if (tc_idx >= 0) + t4_release_cl_rl_kbps(sc, port_id, tc_idx); + return (ENOMEM); + } + + flowc = wrtod(wr); + memset(flowc, 0, wr->wr_len); + + flowc->op_to_nparams = htobe32(V_FW_WR_OP(FW_FLOWC_WR) | + V_FW_FLOWC_WR_NPARAMS(nparams)); + flowc->flowid_len16 = htonl(V_FW_WR_LEN16(flowclen16) | + V_FW_WR_FLOWID(toep->tid)); + + flowc->mnemval[0].mnemonic = FW_FLOWC_MNEM_SCHEDCLASS; + if (tc_idx == -1) + flowc->mnemval[0].val = htobe32(0xff); + else + flowc->mnemval[0].val = htobe32(tc_idx); + + txsd->tx_credits = flowclen16; + txsd->plen = 0; + toep->tx_credits -= txsd->tx_credits; + if (__predict_false(++toep->txsd_pidx == toep->txsd_total)) + toep->txsd_pidx = 0; + toep->txsd_avail--; + t4_wrq_tx(sc, wr); + } + + if (toep->tc_idx >= 0) + t4_release_cl_rl_kbps(sc, port_id, toep->tc_idx); + toep->tc_idx = tc_idx; + + return (0); +} +#endif + void send_reset(struct adapter *sc, struct toepcb *toep, uint32_t snd_nxt) { @@ -272,19 +350,19 @@ assign_rxopt(struct tcpcb *tp, unsigned int opt) n = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); else n = sizeof(struct ip) + sizeof(struct tcphdr); - if (V_tcp_do_rfc1323) - n += TCPOLEN_TSTAMP_APPA; tp->t_maxseg = sc->params.mtus[G_TCPOPT_MSS(opt)] - n; - CTR4(KTR_CXGBE, "%s: tid %d, mtu_idx %u (%u)", __func__, toep->tid, - G_TCPOPT_MSS(opt), sc->params.mtus[G_TCPOPT_MSS(opt)]); - if (G_TCPOPT_TSTAMP(opt)) { tp->t_flags |= TF_RCVD_TSTMP; /* timestamps ok */ tp->ts_recent = 0; /* hmmm */ tp->ts_recent_age = tcp_ts_getticks(); + tp->t_maxseg -= TCPOLEN_TSTAMP_APPA; } + CTR5(KTR_CXGBE, "%s: tid %d, mtu_idx %u (%u), mss %u", __func__, + toep->tid, G_TCPOPT_MSS(opt), sc->params.mtus[G_TCPOPT_MSS(opt)], + tp->t_maxseg); + if (G_TCPOPT_SACK(opt)) tp->t_flags |= TF_SACK_PERMIT; /* should already be set */ else @@ -661,7 +739,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep struct socket *so = inp->inp_socket; struct sockbuf *sb = &so->so_snd; int tx_credits, shove, compl, sowwakeup; - struct ofld_tx_sdesc *txsd = &toep->txsd[toep->txsd_pidx]; + struct ofld_tx_sdesc *txsd; bool aiotx_mbuf_seen; INP_WLOCK_ASSERT(inp); @@ -681,6 +759,13 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep if (__predict_false(toep->flags & TPF_ABORT_SHUTDOWN)) return; +#ifdef RATELIMIT + if (__predict_false(inp->inp_flags2 & INP_RATE_LIMIT_CHANGED) && + (update_tx_rate_limit(sc, toep, so->so_max_pacing_rate) == 0)) { + inp->inp_flags2 &= ~INP_RATE_LIMIT_CHANGED; + } +#endif + /* * This function doesn't resume by itself. Someone else must clear the * flag and call this function. @@ -691,6 +776,7 @@ t4_push_frames(struct adapter *sc, struct toepcb *toep return; } + txsd = &toep->txsd[toep->txsd_pidx]; do { tx_credits = min(toep->tx_credits, MAX_OFLD_TX_CREDITS); max_imm = max_imm_payload(tx_credits); Modified: stable/11/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_listen.c Sun Apr 28 04:05:43 2019 (r346804) +++ stable/11/sys/dev/cxgbe/tom/t4_listen.c Sun Apr 28 06:51:59 2019 (r346805) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -60,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "common/common.h" #include "common/t4_msg.h" @@ -82,7 +84,8 @@ static struct listen_ctx *listen_hash_find(struct adap static struct listen_ctx *listen_hash_del(struct adapter *, struct inpcb *); static struct inpcb *release_lctx(struct adapter *, struct listen_ctx *); -static inline void save_qids_in_mbuf(struct mbuf *, struct vi_info *); +static inline void save_qids_in_mbuf(struct mbuf *, struct vi_info *, + struct offload_settings *); static inline void get_qids_from_mbuf(struct mbuf *m, int *, int *); static void send_reset_synqe(struct toedev *, struct synq_entry *); @@ -511,9 +514,17 @@ t4_listen_start(struct toedev *tod, struct tcpcb *tp) struct inpcb *inp = tp->t_inpcb; struct listen_ctx *lctx; int i, rc, v; + struct offload_settings settings; INP_WLOCK_ASSERT(inp); + rw_rlock(&sc->policy_lock); + settings = *lookup_offload_policy(sc, OPEN_TYPE_LISTEN, NULL, 0xffff, + inp); + rw_runlock(&sc->policy_lock); + if (!settings.offload) + return (0); + /* Don't start a hardware listener for any loopback address. */ if (inp->inp_vflag & INP_IPV6 && IN6_IS_ADDR_LOOPBACK(&inp->in6p_laddr)) return (0); @@ -946,13 +957,23 @@ t4_offload_socket(struct toedev *tod, void *arg, struc } static inline void -save_qids_in_mbuf(struct mbuf *m, struct vi_info *vi) +save_qids_in_mbuf(struct mbuf *m, struct vi_info *vi, + struct offload_settings *s) { uint32_t txqid, rxqid; - txqid = (arc4random() % vi->nofldtxq) + vi->first_ofld_txq; - rxqid = (arc4random() % vi->nofldrxq) + vi->first_ofld_rxq; + if (s->txq >= 0 && s->txq < vi->nofldtxq) + txqid = s->txq; + else + txqid = arc4random() % vi->nofldtxq; + txqid += vi->first_ofld_txq; + if (s->rxq >= 0 && s->rxq < vi->nofldrxq) + rxqid = s->rxq; + else + rxqid = arc4random() % vi->nofldrxq; + rxqid += vi->first_ofld_rxq; + m->m_pkthdr.flowid = (txqid << 16) | (rxqid & 0xffff); } @@ -1017,50 +1038,88 @@ t4opt_to_tcpopt(const struct tcp_options *t4opt, struc */ static uint32_t calc_opt2p(struct adapter *sc, struct port_info *pi, int rxqid, - const struct tcp_options *tcpopt, struct tcphdr *th, int ulp_mode) + const struct tcp_options *tcpopt, struct tcphdr *th, int ulp_mode, + struct cc_algo *cc, const struct offload_settings *s) { struct sge_ofld_rxq *ofld_rxq = &sc->sge.ofld_rxq[rxqid]; - uint32_t opt2; + uint32_t opt2 = 0; - opt2 = V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]) | - F_RSS_QUEUE_VALID | V_RSS_QUEUE(ofld_rxq->iq.abs_id); - - if (V_tcp_do_rfc1323) { - if (tcpopt->tstamp) - opt2 |= F_TSTAMPS_EN; - if (tcpopt->sack) - opt2 |= F_SACK_EN; - if (tcpopt->wsf <= 14) - opt2 |= F_WND_SCALE_EN; + /* + * rx flow control, rx coalesce, congestion control, and tx pace are all + * explicitly set by the driver. On T5+ the ISS is also set by the + * driver to the value picked by the kernel. + */ + if (is_t4(sc)) { + opt2 |= F_RX_FC_VALID | F_RX_COALESCE_VALID; + opt2 |= F_CONG_CNTRL_VALID | F_PACE_VALID; + } else { + opt2 |= F_T5_OPT_2_VALID; /* all 4 valid */ + opt2 |= F_T5_ISS; /* ISS provided in CPL */ } - if (V_tcp_do_ecn && th->th_flags & (TH_ECE | TH_CWR)) + if (tcpopt->sack && (s->sack > 0 || (s->sack < 0 && V_tcp_do_rfc1323))) + opt2 |= F_SACK_EN; + + if (tcpopt->tstamp && + (s->tstamp > 0 || (s->tstamp < 0 && V_tcp_do_rfc1323))) + opt2 |= F_TSTAMPS_EN; + + if (tcpopt->wsf < 15 && V_tcp_do_rfc1323) + opt2 |= F_WND_SCALE_EN; + + if (th->th_flags & (TH_ECE | TH_CWR) && + (s->ecn > 0 || (s->ecn < 0 && V_tcp_do_ecn))) opt2 |= F_CCTRL_ECN; - /* RX_COALESCE is always a valid value (0 or M_RX_COALESCE). */ - if (is_t4(sc)) - opt2 |= F_RX_COALESCE_VALID; + /* XXX: F_RX_CHANNEL for multiple rx c-chan support goes here. */ + + opt2 |= V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]); + + /* These defaults are subject to ULP specific fixups later. */ + opt2 |= V_RX_FC_DDP(0) | V_RX_FC_DISABLE(0); + + opt2 |= V_PACE(0); + + if (s->cong_algo >= 0) + opt2 |= V_CONG_CNTRL(s->cong_algo); + else if (sc->tt.cong_algorithm >= 0) + opt2 |= V_CONG_CNTRL(sc->tt.cong_algorithm & M_CONG_CNTRL); else { - opt2 |= F_T5_OPT_2_VALID; - opt2 |= F_T5_ISS; + if (strcasecmp(cc->name, "reno") == 0) + opt2 |= V_CONG_CNTRL(CONG_ALG_RENO); + else if (strcasecmp(cc->name, "tahoe") == 0) + opt2 |= V_CONG_CNTRL(CONG_ALG_TAHOE); + if (strcasecmp(cc->name, "newreno") == 0) + opt2 |= V_CONG_CNTRL(CONG_ALG_NEWRENO); + if (strcasecmp(cc->name, "highspeed") == 0) + opt2 |= V_CONG_CNTRL(CONG_ALG_HIGHSPEED); + else { + /* + * Use newreno in case the algorithm selected by the + * host stack is not supported by the hardware. + */ + opt2 |= V_CONG_CNTRL(CONG_ALG_NEWRENO); + } } - if (sc->tt.rx_coalesce) + + if (s->rx_coalesce > 0 || (s->rx_coalesce < 0 && sc->tt.rx_coalesce)) opt2 |= V_RX_COALESCE(M_RX_COALESCE); - if (sc->tt.cong_algorithm != -1) - opt2 |= V_CONG_CNTRL(sc->tt.cong_algorithm & M_CONG_CNTRL); + /* Note that ofld_rxq is already set according to s->rxq. */ + opt2 |= F_RSS_QUEUE_VALID; + opt2 |= V_RSS_QUEUE(ofld_rxq->iq.abs_id); #ifdef USE_DDP_RX_FLOW_CONTROL if (ulp_mode == ULP_MODE_TCPDDP) - opt2 |= F_RX_FC_VALID | F_RX_FC_DDP; + opt2 |= F_RX_FC_DDP; #endif + if (ulp_mode == ULP_MODE_TLS) { - opt2 |= F_RX_FC_VALID; opt2 &= ~V_RX_COALESCE(M_RX_COALESCE); opt2 |= F_RX_FC_DISABLE; } - return htobe32(opt2); + return (htobe32(opt2)); } static void @@ -1196,6 +1255,7 @@ do_pass_accept_req(struct sge_iq *iq, const struct rss #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); #endif + struct offload_settings settings; KASSERT(opcode == CPL_PASS_ACCEPT_REQ, ("%s: unexpected opcode 0x%x", __func__, opcode)); @@ -1331,15 +1391,23 @@ found: REJECT_PASS_ACCEPT(); } so = inp->inp_socket; + rw_rlock(&sc->policy_lock); + settings = *lookup_offload_policy(sc, OPEN_TYPE_PASSIVE, m, 0xffff, inp); + rw_runlock(&sc->policy_lock); + if (!settings.offload) { + INP_WUNLOCK(inp); + free(wr, M_CXGBE); + REJECT_PASS_ACCEPT(); + } - mtu_idx = find_best_mtu_idx(sc, &inc, be16toh(cpl->tcpopt.mss)); + mtu_idx = find_best_mtu_idx(sc, &inc, &settings); rscale = cpl->tcpopt.wsf && V_tcp_do_rfc1323 ? select_rcv_wscale() : 0; SOCKBUF_LOCK(&so->so_rcv); /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ rx_credits = min(select_rcv_wnd(so) >> 10, M_RCV_BUFSIZ); SOCKBUF_UNLOCK(&so->so_rcv); - save_qids_in_mbuf(m, vi); + save_qids_in_mbuf(m, vi, &settings); get_qids_from_mbuf(m, NULL, &rxqid); if (is_t4(sc)) @@ -1349,7 +1417,7 @@ found: INIT_TP_WR_MIT_CPL(rpl5, CPL_PASS_ACCEPT_RPL, tid); } - ulp_mode = select_ulp_mode(so, sc); + ulp_mode = select_ulp_mode(so, sc, &settings); switch (ulp_mode) { case ULP_MODE_TCPDDP: synqe->flags |= TPF_SYNQE_TCPDDP; @@ -1358,8 +1426,10 @@ found: synqe->flags |= TPF_SYNQE_TLS; break; } - rpl->opt0 = calc_opt0(so, vi, e, mtu_idx, rscale, rx_credits, ulp_mode); - rpl->opt2 = calc_opt2p(sc, pi, rxqid, &cpl->tcpopt, &th, ulp_mode); + rpl->opt0 = calc_opt0(so, vi, e, mtu_idx, rscale, rx_credits, ulp_mode, + &settings); + rpl->opt2 = calc_opt2p(sc, pi, rxqid, &cpl->tcpopt, &th, ulp_mode, + CC_ALGO(intotcpcb(inp)), &settings); synqe->tid = tid; synqe->lctx = lctx; Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.c Sun Apr 28 04:05:43 2019 (r346804) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.c Sun Apr 28 06:51:59 2019 (r346805) @@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -134,15 +136,11 @@ alloc_toepcb(struct vi_info *vi, int txqid, int rxqid, txsd_total = tx_credits / howmany(sizeof(struct fw_ofld_tx_data_wr) + 1, 16); - if (txqid < 0) - txqid = (arc4random() % vi->nofldtxq) + vi->first_ofld_txq; KASSERT(txqid >= vi->first_ofld_txq && txqid < vi->first_ofld_txq + vi->nofldtxq, ("%s: txqid %d for vi %p (first %d, n %d)", __func__, txqid, vi, vi->first_ofld_txq, vi->nofldtxq)); - if (rxqid < 0) - rxqid = (arc4random() % vi->nofldrxq) + vi->first_ofld_rxq; KASSERT(rxqid >= vi->first_ofld_rxq && rxqid < vi->first_ofld_rxq + vi->nofldrxq, ("%s: rxqid %d for vi %p (first %d, n %d)", __func__, rxqid, vi, @@ -158,6 +156,7 @@ alloc_toepcb(struct vi_info *vi, int txqid, int rxqid, refcount_init(&toep->refcount, 1); toep->td = sc->tom_softc; toep->vi = vi; + toep->tc_idx = -1; toep->tx_total = tx_credits; toep->tx_credits = tx_credits; toep->ofld_txq = &sc->sge.ofld_txq[txqid]; @@ -316,6 +315,10 @@ release_offload_resources(struct toepcb *toep) if (toep->ce) release_lip(td, toep->ce); +#ifdef RATELIMIT + if (toep->tc_idx != -1) + t4_release_cl_rl_kbps(sc, toep->vi->pi->port_id, toep->tc_idx); +#endif mtx_lock(&td->toep_list_lock); TAILQ_REMOVE(&td->toep_list, toep, link); mtx_unlock(&td->toep_list_lock); @@ -483,27 +486,28 @@ queue_tid_release(struct adapter *sc, int tid) } /* - * What mtu_idx to use, given a 4-tuple and/or an MSS cap + * What mtu_idx to use, given a 4-tuple. Note that both s->mss and tcp_mssopt + * have the MSS that we should advertise in our SYN. Advertised MSS doesn't + * account for any TCP options so the effective MSS (only payload, no headers or + * options) could be different. We fill up tp->t_maxseg with the effective MSS + * at the end of the 3-way handshake. */ int -find_best_mtu_idx(struct adapter *sc, struct in_conninfo *inc, int pmss) +find_best_mtu_idx(struct adapter *sc, struct in_conninfo *inc, + struct offload_settings *s) { unsigned short *mtus = &sc->params.mtus[0]; - int i, mss, n; + int i, mss, mtu; - KASSERT(inc != NULL || pmss > 0, - ("%s: at least one of inc/pmss must be specified", __func__)); + MPASS(inc != NULL); - mss = inc ? tcp_mssopt(inc) : pmss; - if (pmss > 0 && mss > pmss) - mss = pmss; - + mss = s->mss > 0 ? s->mss : tcp_mssopt(inc); if (inc->inc_flags & INC_ISIPV6) - n = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); + mtu = mss + sizeof(struct ip6_hdr) + sizeof(struct tcphdr); else - n = sizeof(struct ip) + sizeof(struct tcphdr); + mtu = mss + sizeof(struct ip) + sizeof(struct tcphdr); - for (i = 0; i < NMTUS - 1 && mtus[i + 1] <= mss + n; i++) + for (i = 0; i < NMTUS - 1 && mtus[i + 1] <= mtu; i++) continue; return (i); @@ -546,34 +550,33 @@ select_rcv_wscale(void) */ uint64_t calc_opt0(struct socket *so, struct vi_info *vi, struct l2t_entry *e, - int mtu_idx, int rscale, int rx_credits, int ulp_mode) + int mtu_idx, int rscale, int rx_credits, int ulp_mode, + struct offload_settings *s) { + int keepalive; uint64_t opt0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Apr 28 08:22:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B5421576988; Sun, 28 Apr 2019 08:22:38 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A4A4689A36; Sun, 28 Apr 2019 08:22:37 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F4AB8044; Sun, 28 Apr 2019 08:22:37 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3S8MbEv057657; Sun, 28 Apr 2019 08:22:37 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3S8MbwJ057656; Sun, 28 Apr 2019 08:22:37 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904280822.x3S8MbwJ057656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 28 Apr 2019 08:22:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346806 - stable/11/usr.sbin/cxgbetool X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/usr.sbin/cxgbetool X-SVN-Commit-Revision: 346806 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A4A4689A36 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 08:22:38 -0000 Author: np Date: Sun Apr 28 08:22:37 2019 New Revision: 346806 URL: https://svnweb.freebsd.org/changeset/base/346806 Log: cxgbetool(8): Make sure getline is available. This is a direct commit to stable/11. Modified: stable/11/usr.sbin/cxgbetool/cxgbetool.c Modified: stable/11/usr.sbin/cxgbetool/cxgbetool.c ============================================================================== --- stable/11/usr.sbin/cxgbetool/cxgbetool.c Sun Apr 28 06:51:59 2019 (r346805) +++ stable/11/usr.sbin/cxgbetool/cxgbetool.c Sun Apr 28 08:22:37 2019 (r346806) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _WITH_GETLINE #include #include #include From owner-svn-src-all@freebsd.org Sun Apr 28 09:35:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DBD015787B7; Sun, 28 Apr 2019 09:35:41 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 234F08BC2E; Sun, 28 Apr 2019 09:35:41 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F27168C34; Sun, 28 Apr 2019 09:35:40 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3S9ZeXB094831; Sun, 28 Apr 2019 09:35:40 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3S9Ze3E094825; Sun, 28 Apr 2019 09:35:40 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904280935.x3S9Ze3E094825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 09:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346807 - in stable/11/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/11/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Commit-Revision: 346807 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 234F08BC2E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 09:35:41 -0000 Author: dchagin Date: Sun Apr 28 09:35:39 2019 New Revision: 346807 URL: https://svnweb.freebsd.org/changeset/base/346807 Log: MFC r321728: Avoid using [LINUX_]SHAREDPAGE constant directly in the vdso code. This is needed for https://reviews.freebsd.org/D11780. Modified: stable/11/sys/amd64/linux/linux_sysvec.c stable/11/sys/amd64/linux32/linux32_sysvec.c stable/11/sys/compat/linux/linux_vdso.c stable/11/sys/compat/linux/linux_vdso.h stable/11/sys/i386/linux/linux_sysvec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 08:22:37 2019 (r346806) +++ stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 09:35:39 2019 (r346807) @@ -821,14 +821,14 @@ linux_vdso_install(void *param) linux_shared_page_obj = __elfN(linux_shared_page_init) (&linux_shared_page_mapping); - __elfN(linux_vdso_reloc)(&elf_linux_sysvec, SHAREDPAGE); + __elfN(linux_vdso_reloc)(&elf_linux_sysvec); bcopy(elf_linux_sysvec.sv_sigcode, linux_shared_page_mapping, linux_szsigcode); elf_linux_sysvec.sv_shared_page_obj = linux_shared_page_obj; linux_kplatform = linux_shared_page_mapping + - (linux_platform - (caddr_t)SHAREDPAGE); + (linux_platform - (caddr_t)elf_linux_sysvec.sv_shared_page_base); } SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_ANY, (sysinit_cfunc_t)linux_vdso_install, NULL); Modified: stable/11/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 08:22:37 2019 (r346806) +++ stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 09:35:39 2019 (r346807) @@ -1021,14 +1021,14 @@ linux_vdso_install(void *param) linux_shared_page_obj = __elfN(linux_shared_page_init) (&linux_shared_page_mapping); - __elfN(linux_vdso_reloc)(&elf_linux_sysvec, LINUX32_SHAREDPAGE); + __elfN(linux_vdso_reloc)(&elf_linux_sysvec); bcopy(elf_linux_sysvec.sv_sigcode, linux_shared_page_mapping, linux_szsigcode); elf_linux_sysvec.sv_shared_page_obj = linux_shared_page_obj; linux_kplatform = linux_shared_page_mapping + - (linux_platform - (caddr_t)LINUX32_SHAREDPAGE); + (linux_platform - (caddr_t)elf_linux_sysvec.sv_shared_page_base); } SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_ANY, (sysinit_cfunc_t)linux_vdso_install, NULL); Modified: stable/11/sys/compat/linux/linux_vdso.c ============================================================================== --- stable/11/sys/compat/linux/linux_vdso.c Sun Apr 28 08:22:37 2019 (r346806) +++ stable/11/sys/compat/linux/linux_vdso.c Sun Apr 28 09:35:39 2019 (r346807) @@ -139,7 +139,7 @@ __elfN(linux_vdso_fixup)(struct sysentvec *sv) } void -__elfN(linux_vdso_reloc)(struct sysentvec *sv, long vdso_adjust) +__elfN(linux_vdso_reloc)(struct sysentvec *sv) { struct linux_vdso_sym *lsym; Elf_Ehdr *ehdr; @@ -152,13 +152,13 @@ __elfN(linux_vdso_reloc)(struct sysentvec *sv, long vd ehdr = (Elf_Ehdr *) sv->sv_sigcode; /* Adjust our so relative to the sigcode_base */ - if (vdso_adjust != 0) { - ehdr->e_entry += vdso_adjust; + if (sv->sv_shared_page_base != 0) { + ehdr->e_entry += sv->sv_shared_page_base; phdr = (Elf_Phdr *)((caddr_t)ehdr + ehdr->e_phoff); /* phdrs */ for (i = 0; i < ehdr->e_phnum; i++) { - phdr[i].p_vaddr += vdso_adjust; + phdr[i].p_vaddr += sv->sv_shared_page_base; if (phdr[i].p_type != PT_DYNAMIC) continue; dyn = (Elf_Dyn *)((caddr_t)ehdr + phdr[i].p_offset); @@ -178,13 +178,13 @@ __elfN(linux_vdso_reloc)(struct sysentvec *sv, long vd case DT_VERDEF: case DT_VERNEED: case DT_ADDRRNGLO ... DT_ADDRRNGHI: - dyn->d_un.d_ptr += vdso_adjust; + dyn->d_un.d_ptr += sv->sv_shared_page_base; break; case DT_ENCODING ... DT_LOOS-1: case DT_LOOS ... DT_HIOS: if (dyn->d_tag >= DT_ENCODING && (dyn->d_tag & 1) == 0) - dyn->d_un.d_ptr += vdso_adjust; + dyn->d_un.d_ptr += sv->sv_shared_page_base; break; default: break; @@ -197,7 +197,7 @@ __elfN(linux_vdso_reloc)(struct sysentvec *sv, long vd for(i = 0; i < ehdr->e_shnum; i++) { if (!(shdr[i].sh_flags & SHF_ALLOC)) continue; - shdr[i].sh_addr += vdso_adjust; + shdr[i].sh_addr += sv->sv_shared_page_base; if (shdr[i].sh_type != SHT_SYMTAB && shdr[i].sh_type != SHT_DYNSYM) continue; @@ -209,7 +209,7 @@ __elfN(linux_vdso_reloc)(struct sysentvec *sv, long vd if (sym->st_shndx == SHN_UNDEF || sym->st_shndx == SHN_ABS) continue; - sym->st_value += vdso_adjust; + sym->st_value += sv->sv_shared_page_base; } } } Modified: stable/11/sys/compat/linux/linux_vdso.h ============================================================================== --- stable/11/sys/compat/linux/linux_vdso.h Sun Apr 28 08:22:37 2019 (r346806) +++ stable/11/sys/compat/linux/linux_vdso.h Sun Apr 28 09:35:39 2019 (r346807) @@ -41,7 +41,7 @@ struct linux_vdso_sym { vm_object_t __elfN(linux_shared_page_init)(char **); void __elfN(linux_shared_page_fini)(vm_object_t); void __elfN(linux_vdso_fixup)(struct sysentvec *); -void __elfN(linux_vdso_reloc)(struct sysentvec *, long); +void __elfN(linux_vdso_reloc)(struct sysentvec *); void __elfN(linux_vdso_sym_init)(struct linux_vdso_sym *); #define LINUX_VDSO_SYM_INTPTR(name) \ Modified: stable/11/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 08:22:37 2019 (r346806) +++ stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 09:35:39 2019 (r346807) @@ -990,7 +990,7 @@ linux_vdso_install(void *param) linux_shared_page_obj = __elfN(linux_shared_page_init) (&linux_shared_page_mapping); - __elfN(linux_vdso_reloc)(&elf_linux_sysvec, LINUX_SHAREDPAGE); + __elfN(linux_vdso_reloc)(&elf_linux_sysvec); bcopy(elf_linux_sysvec.sv_sigcode, linux_shared_page_mapping, linux_szsigcode); From owner-svn-src-all@freebsd.org Sun Apr 28 09:38:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB4F21578932; Sun, 28 Apr 2019 09:38:42 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EC058BDA0; Sun, 28 Apr 2019 09:38:42 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62C928C37; Sun, 28 Apr 2019 09:38:42 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3S9cgtW095003; Sun, 28 Apr 2019 09:38:42 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3S9cgju095002; Sun, 28 Apr 2019 09:38:42 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904280938.x3S9cgju095002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 09:38:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346808 - stable/11/sys/compat/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/11/sys/compat/linux X-SVN-Commit-Revision: 346808 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7EC058BDA0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 09:38:43 -0000 Author: dchagin Date: Sun Apr 28 09:38:41 2019 New Revision: 346808 URL: https://svnweb.freebsd.org/changeset/base/346808 Log: MFC r323980 (by pfg@): Small style(9) issue: spaces vs TAB. Modified: stable/11/sys/compat/linux/linux_stats.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_stats.c ============================================================================== --- stable/11/sys/compat/linux/linux_stats.c Sun Apr 28 09:35:39 2019 (r346807) +++ stable/11/sys/compat/linux/linux_stats.c Sun Apr 28 09:38:41 2019 (r346808) @@ -319,7 +319,7 @@ struct l_statfs { #define LINUX_PROC_SUPER_MAGIC 0x9fa0L #define LINUX_UFS_SUPER_MAGIC 0x00011954L /* XXX - UFS_MAGIC in Linux */ #define LINUX_ZFS_SUPER_MAGIC 0x2FC12FC1 -#define LINUX_DEVFS_SUPER_MAGIC 0x1373L +#define LINUX_DEVFS_SUPER_MAGIC 0x1373L #define LINUX_SHMFS_MAGIC 0x01021994 static long From owner-svn-src-all@freebsd.org Sun Apr 28 09:47:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F93F1578BE4; Sun, 28 Apr 2019 09:47:35 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02CA08C2BC; Sun, 28 Apr 2019 09:47:35 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C14738DF1; Sun, 28 Apr 2019 09:47:34 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3S9lYTv000105; Sun, 28 Apr 2019 09:47:34 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3S9lY4j000102; Sun, 28 Apr 2019 09:47:34 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904280947.x3S9lY4j000102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 09:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346810 - in stable/11/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/11/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Commit-Revision: 346810 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 02CA08C2BC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 09:47:35 -0000 Author: dchagin Date: Sun Apr 28 09:47:33 2019 New Revision: 346810 URL: https://svnweb.freebsd.org/changeset/base/346810 Log: MFC Linuxulator part of r326333 (by brooks@): Disable vim syntax highlighting. Vim's default pick doesn't understand that ';' is a comment character and the result looks horrible. Modified: stable/11/sys/amd64/linux/syscalls.master stable/11/sys/amd64/linux32/syscalls.master stable/11/sys/i386/linux/syscalls.master Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/syscalls.master ============================================================================== --- stable/11/sys/amd64/linux/syscalls.master Sun Apr 28 09:41:46 2019 (r346809) +++ stable/11/sys/amd64/linux/syscalls.master Sun Apr 28 09:47:33 2019 (r346810) @@ -598,3 +598,4 @@ ; please, keep this line at the end. 332 AUE_NULL UNIMPL nosys +; vim: syntax=off Modified: stable/11/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/11/sys/amd64/linux32/syscalls.master Sun Apr 28 09:41:46 2019 (r346809) +++ stable/11/sys/amd64/linux32/syscalls.master Sun Apr 28 09:47:33 2019 (r346810) @@ -690,3 +690,4 @@ ; please, keep this line at the end. 383 AUE_NULL UNIMPL nosys +; vim: syntax=off Modified: stable/11/sys/i386/linux/syscalls.master ============================================================================== --- stable/11/sys/i386/linux/syscalls.master Sun Apr 28 09:41:46 2019 (r346809) +++ stable/11/sys/i386/linux/syscalls.master Sun Apr 28 09:47:33 2019 (r346810) @@ -697,3 +697,4 @@ ; please, keep this line at the end. 383 AUE_NULL UNIMPL nosys +; vim: syntax=off From owner-svn-src-all@freebsd.org Sun Apr 28 09:49:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E35AE1578C5B; Sun, 28 Apr 2019 09:49:31 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 861F08C3F7; Sun, 28 Apr 2019 09:49:31 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 593998DF3; Sun, 28 Apr 2019 09:49:31 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3S9nVUP000245; Sun, 28 Apr 2019 09:49:31 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3S9nVNq000244; Sun, 28 Apr 2019 09:49:31 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904280949.x3S9nVNq000244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 09:49:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346811 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 346811 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 861F08C3F7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 09:49:32 -0000 Author: dchagin Date: Sun Apr 28 09:49:30 2019 New Revision: 346811 URL: https://svnweb.freebsd.org/changeset/base/346811 Log: MFC r328598 (by emaste@): makesyscalls: permit a range of syscall numbers for UNIMPL Some ABIs have large gaps in syscall numbers. Allow gaps to be filled as ranges of UNIMPL, with an entry like: 248-1023 AUE_NULL UNIMPL unimplemented Modified: stable/11/sys/kern/makesyscalls.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/makesyscalls.sh ============================================================================== --- stable/11/sys/kern/makesyscalls.sh Sun Apr 28 09:47:33 2019 (r346810) +++ stable/11/sys/kern/makesyscalls.sh Sun Apr 28 09:49:30 2019 (r346811) @@ -243,13 +243,6 @@ sed -e ' print > systraceret next } - syscall != $1 { - printf "%s: line %d: syscall number out of sync at %d\n", - infile, NR, syscall - printf "line is:\n" - print - exit 1 - } # Returns true if the type "name" is the first flag in the type field function type(name, flags, n) { n = split($3, flags, /\|/) @@ -263,6 +256,29 @@ sed -e ' return 1 return 0 } + { + n = split($1, syscall_range, /-/) + if (n == 1) { + syscall_range[2] = syscall_range[1] + } else if (n == 2) { + if (!type("UNIMPL")) { + printf "%s: line %d: range permitted only with UNIMPL\n", + infile, NR + exit 1 + } + } else { + printf "%s: line %d: invalid syscall number or range %s\n", + infile, NR, $1 + exit 1 + } + } + syscall != syscall_range[1] { + printf "%s: line %d: syscall number out of sync at %d\n", + infile, NR, syscall + printf "line is:\n" + print + exit 1 + } function align_sysent_comment(column) { printf("\t") > sysent column = column + 8 - column % 8 @@ -593,11 +609,13 @@ sed -e ' next } type("UNIMPL") { - printf("\t{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },\t\t\t/* %d = %s */\n", - syscall, comment) > sysent - printf("\t\"#%d\",\t\t\t/* %d = %s */\n", - syscall, syscall, comment) > sysnames - syscall++ + while (syscall <= syscall_range[2]) { + printf("\t{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },\t\t\t/* %d = %s */\n", + syscall, comment) > sysent + printf("\t\"#%d\",\t\t\t/* %d = %s */\n", + syscall, syscall, comment) > sysnames + syscall++ + } next } { From owner-svn-src-all@freebsd.org Sun Apr 28 09:53:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA12A1578E87; Sun, 28 Apr 2019 09:53:16 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5AD708C7D0; Sun, 28 Apr 2019 09:53:16 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E8B68F96; Sun, 28 Apr 2019 09:53:16 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3S9rGLx005493; Sun, 28 Apr 2019 09:53:16 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3S9r8MF005456; Sun, 28 Apr 2019 09:53:08 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904280953.x3S9r8MF005456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 09:53:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346812 - in stable/11/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/11/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Commit-Revision: 346812 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5AD708C7D0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 09:53:17 -0000 Author: dchagin Date: Sun Apr 28 09:53:08 2019 New Revision: 346812 URL: https://svnweb.freebsd.org/changeset/base/346812 Log: MFC r328890 (by emaste@): Linuxolator whitespace cleanup A version of each of the MD files by necessity exists for each CPU architecture supported by the Linuxolator. Clean these up so that new architectures do not inherit whitespace issues. Clean up shared Linuxolator files while here. Modified: stable/11/sys/amd64/linux/linux.h stable/11/sys/amd64/linux/linux_ptrace.c stable/11/sys/amd64/linux/linux_sysvec.c stable/11/sys/amd64/linux/syscalls.master stable/11/sys/amd64/linux32/linux.h stable/11/sys/amd64/linux32/linux32_dummy.c stable/11/sys/amd64/linux32/linux32_locore.s stable/11/sys/amd64/linux32/linux32_sysvec.c stable/11/sys/amd64/linux32/syscalls.master stable/11/sys/compat/linux/check_internal_locks.d stable/11/sys/compat/linux/linux_emul.c stable/11/sys/compat/linux/linux_event.c stable/11/sys/compat/linux/linux_file.h stable/11/sys/compat/linux/linux_fork.c stable/11/sys/compat/linux/linux_ioctl.c stable/11/sys/compat/linux/linux_ioctl.h stable/11/sys/compat/linux/linux_ipc.c stable/11/sys/compat/linux/linux_ipc.h stable/11/sys/compat/linux/linux_ipc64.h stable/11/sys/compat/linux/linux_misc.c stable/11/sys/compat/linux/linux_persona.h stable/11/sys/compat/linux/linux_signal.c stable/11/sys/compat/linux/linux_socket.c stable/11/sys/compat/linux/linux_socket.h stable/11/sys/compat/linux/linux_time.c stable/11/sys/compat/linux/linux_util.h stable/11/sys/compat/linux/stats_timing.d stable/11/sys/compat/linux/trace_futexes.d stable/11/sys/i386/linux/linux.h stable/11/sys/i386/linux/linux_dummy.c stable/11/sys/i386/linux/linux_locore.s stable/11/sys/i386/linux/linux_machdep.c stable/11/sys/i386/linux/linux_support.s stable/11/sys/i386/linux/linux_sysvec.c stable/11/sys/i386/linux/syscalls.master Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux.h ============================================================================== --- stable/11/sys/amd64/linux/linux.h Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/amd64/linux/linux.h Sun Apr 28 09:53:08 2019 (r346812) @@ -459,7 +459,7 @@ struct l_pollfd { struct linux_robust_list { l_uintptr_t next; }; - + struct linux_robust_list_head { struct linux_robust_list list; l_long futex_offset; Modified: stable/11/sys/amd64/linux/linux_ptrace.c ============================================================================== --- stable/11/sys/amd64/linux/linux_ptrace.c Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/amd64/linux/linux_ptrace.c Sun Apr 28 09:53:08 2019 (r346812) @@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$"); #define LINUX_PTRACE_O_TRACEVFORKDONE 32 #define LINUX_PTRACE_O_TRACEEXIT 64 #define LINUX_PTRACE_O_TRACESECCOMP 128 -#define LINUX_PTRACE_O_EXITKILL 1048576 +#define LINUX_PTRACE_O_EXITKILL 1048576 #define LINUX_PTRACE_O_SUSPEND_SECCOMP 2097152 #define LINUX_NT_PRSTATUS 1 @@ -239,7 +239,7 @@ linux_ptrace_setoptions(struct thread *td, pid_t pid, if (data & LINUX_PTRACE_O_TRACEFORK) mask |= PTRACE_FORK; - if (data & LINUX_PTRACE_O_TRACEVFORK) + if (data & LINUX_PTRACE_O_TRACEVFORK) mask |= PTRACE_VFORK; if (data & LINUX_PTRACE_O_TRACECLONE) Modified: stable/11/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 09:53:08 2019 (r346812) @@ -736,7 +736,7 @@ linux_vsyscall(struct thread *td) struct trapframe *frame; uint64_t retqaddr; int code, traced; - int error; + int error; frame = td->td_frame; @@ -810,7 +810,7 @@ linux_vdso_install(void *param) amd64_lower_shared_page(&elf_linux_sysvec); - linux_szsigcode = (&_binary_linux_locore_o_end - + linux_szsigcode = (&_binary_linux_locore_o_end - &_binary_linux_locore_o_start); if (linux_szsigcode > elf_linux_sysvec.sv_shared_page_len) Modified: stable/11/sys/amd64/linux/syscalls.master ============================================================================== --- stable/11/sys/amd64/linux/syscalls.master Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/amd64/linux/syscalls.master Sun Apr 28 09:53:08 2019 (r346812) @@ -471,10 +471,10 @@ 278 AUE_NULL STD { int linux_vmsplice(void); } 279 AUE_NULL STD { int linux_move_pages(void); } 280 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \ - const struct l_timespec *times, l_int flags); } -281 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ - l_int maxevents, l_int timeout, l_sigset_t *mask, \ - l_size_t sigsetsize); } + const struct l_timespec *times, l_int flags); } +281 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ + l_int maxevents, l_int timeout, l_sigset_t *mask, \ + l_size_t sigsetsize); } 282 AUE_NULL STD { int linux_signalfd(void); } 283 AUE_NULL STD { int linux_timerfd_create(l_int clockid, l_int flags); } 284 AUE_NULL STD { int linux_eventfd(l_uint initval); } @@ -496,10 +496,10 @@ 293 AUE_NULL STD { int linux_pipe2(l_int *pipefds, l_int flags); } 294 AUE_NULL STD { int linux_inotify_init1(l_int flags); } ; linux 2.6.30: -295 AUE_NULL STD { int linux_preadv(l_ulong fd, \ +295 AUE_NULL STD { int linux_preadv(l_ulong fd, \ struct iovec *vec, l_ulong vlen, \ l_ulong pos_l, l_ulong pos_h); } -296 AUE_NULL STD { int linux_pwritev(l_ulong fd, \ +296 AUE_NULL STD { int linux_pwritev(l_ulong fd, \ struct iovec *vec, l_ulong vlen, \ l_ulong pos_l, l_ulong pos_h); } ; linux 2.6.31: @@ -551,7 +551,7 @@ void *attr, l_uint size, l_uint flags); } ; linux 3.15: 316 AUE_NULL STD { int linux_renameat2(l_int oldfd, \ - const char *oldname, l_int newfd, \ + const char *oldname, l_int newfd, \ const char *newname, unsigned int flags); } ; linux 3.17: 317 AUE_NULL STD { int linux_seccomp(l_uint op, l_uint flags, \ Modified: stable/11/sys/amd64/linux32/linux.h ============================================================================== --- stable/11/sys/amd64/linux32/linux.h Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/amd64/linux32/linux.h Sun Apr 28 09:53:08 2019 (r346812) @@ -240,19 +240,19 @@ struct l_stat64 { l_ulonglong st_ino; } __packed; -struct l_statfs64 { - l_int f_type; - l_int f_bsize; - uint64_t f_blocks; - uint64_t f_bfree; - uint64_t f_bavail; - uint64_t f_files; - uint64_t f_ffree; - l_fsid_t f_fsid; - l_int f_namelen; - l_int f_frsize; - l_int f_flags; - l_int f_spare[4]; +struct l_statfs64 { + l_int f_type; + l_int f_bsize; + uint64_t f_blocks; + uint64_t f_bfree; + uint64_t f_bavail; + uint64_t f_files; + uint64_t f_ffree; + l_fsid_t f_fsid; + l_int f_namelen; + l_int f_frsize; + l_int f_flags; + l_int f_spare[4]; } __packed; /* sigaction flags */ @@ -452,11 +452,11 @@ struct l_sigframe { struct l_rt_sigframe { l_int sf_sig; - l_uintptr_t sf_siginfo; + l_uintptr_t sf_siginfo; l_uintptr_t sf_ucontext; l_siginfo_t sf_si; - struct l_ucontext sf_sc; - l_handler_t sf_handler; + struct l_ucontext sf_sc; + l_handler_t sf_handler; } __packed; /* Modified: stable/11/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_dummy.c Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/amd64/linux32/linux32_dummy.c Sun Apr 28 09:53:08 2019 (r346812) @@ -6,7 +6,7 @@ * 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 + * notice, this list of conditions and the following disclaimer * in this position and unchanged. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the Modified: stable/11/sys/amd64/linux32/linux32_locore.s ============================================================================== --- stable/11/sys/amd64/linux32/linux32_locore.s Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/amd64/linux32/linux32_locore.s Sun Apr 28 09:53:08 2019 (r346812) @@ -72,12 +72,12 @@ NON_GPROF_ENTRY(linux32_vsyscall) .previous #endif -#define do_cfa_expr(offset) \ - .byte 0x0f; /* DW_CFA_def_cfa_expression */ \ - .uleb128 11f-10f; /* length */ \ -10: .byte 0x74; /* DW_OP_breg4 */ \ - .sleb128 offset; /* offset */ \ - .byte 0x06; /* DW_OP_deref */ \ +#define do_cfa_expr(offset) \ + .byte 0x0f; /* DW_CFA_def_cfa_expression */ \ + .uleb128 11f-10f; /* length */ \ +10: .byte 0x74; /* DW_OP_breg4 */ \ + .sleb128 offset; /* offset */ \ + .byte 0x06; /* DW_OP_deref */ \ 11: Modified: stable/11/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 09:53:08 2019 (r346812) @@ -124,7 +124,7 @@ static int elf_linux_fixup(register_t **stack_base, struct image_params *iparams); static register_t *linux_copyout_strings(struct image_params *imgp); static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); -static void exec_linux_setregs(struct thread *td, +static void exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack); static void linux32_fixlimit(struct rlimit *rl, int which); static boolean_t linux32_trans_osrel(const Elf_Note *note, int32_t *osrel); @@ -297,7 +297,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse int oonstack; int sig; int code; - + sig = ksi->ksi_signo; code = ksi->ksi_code; PROC_LOCK_ASSERT(p, MA_OWNED); @@ -932,10 +932,8 @@ SYSCTL_ULONG(_compat_linux32, OID_AUTO, maxvmem, CTLFL &linux32_maxvmem, 0, ""); #if defined(DEBUG) -SYSCTL_PROC(_compat_linux32, OID_AUTO, debug, - CTLTYPE_STRING | CTLFLAG_RW, - 0, 0, linux_sysctl_debug, "A", - "Linux debugging control"); +SYSCTL_PROC(_compat_linux32, OID_AUTO, debug, CTLTYPE_STRING | CTLFLAG_RW, 0, 0, + linux_sysctl_debug, "A", "Linux debugging control"); #endif static void @@ -1003,14 +1001,14 @@ struct sysentvec elf_linux_sysvec = { .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = linux_schedtail, .sv_thread_detach = linux_thread_detach, - .sv_trap = NULL, + .sv_trap = NULL, }; static void linux_vdso_install(void *param) { - linux_szsigcode = (&_binary_linux32_locore_o_end - + linux_szsigcode = (&_binary_linux32_locore_o_end - &_binary_linux32_locore_o_start); if (linux_szsigcode > elf_linux_sysvec.sv_shared_page_len) Modified: stable/11/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/11/sys/amd64/linux32/syscalls.master Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/amd64/linux32/syscalls.master Sun Apr 28 09:53:08 2019 (r346812) @@ -22,7 +22,7 @@ ; types: ; STD always included ; UNIMPL not implemented, placeholder only -; NOPROTO same as STD except do not create structure or +; NOPROTO same as STD except do not create structure or ; function prototype in sys/sysproto.h. Does add a ; definition to syscall.h besides adding a sysent. @@ -532,9 +532,9 @@ 317 AUE_NULL STD { int linux_move_pages(void); } ; linux 2.6.19: 318 AUE_NULL STD { int linux_getcpu(void); } -319 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ - l_int maxevents, l_int timeout, l_sigset_t *mask, \ - l_size_t sigsetsize); } +319 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ + l_int maxevents, l_int timeout, l_sigset_t *mask, \ + l_size_t sigsetsize); } ; linux 2.6.22: 320 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \ const struct l_timespec *times, l_int flags); } Modified: stable/11/sys/compat/linux/check_internal_locks.d ============================================================================== --- stable/11/sys/compat/linux/check_internal_locks.d Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/compat/linux/check_internal_locks.d Sun Apr 28 09:53:08 2019 (r346812) @@ -92,6 +92,6 @@ tick-10s END { - printf("Number of locks per type:"); + printf("Number of locks per type:"); printa(@stats); } Modified: stable/11/sys/compat/linux/linux_emul.c ============================================================================== --- stable/11/sys/compat/linux/linux_emul.c Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/compat/linux/linux_emul.c Sun Apr 28 09:53:08 2019 (r346812) @@ -138,7 +138,7 @@ linux_proc_init(struct thread *td, struct thread *newt } -void +void linux_proc_exit(void *arg __unused, struct proc *p) { struct linux_pemuldata *pem; @@ -153,7 +153,7 @@ linux_proc_exit(void *arg __unused, struct proc *p) pem = pem_find(p); if (pem == NULL) - return; + return; (p->p_sysent->sv_thread_detach)(td); p->p_emuldata = NULL; @@ -168,7 +168,7 @@ linux_proc_exit(void *arg __unused, struct proc *p) free(pem, M_LINUX); } -int +int linux_common_execve(struct thread *td, struct image_args *eargs) { struct linux_pemuldata *pem; @@ -216,7 +216,7 @@ linux_common_execve(struct thread *td, struct image_ar return (0); } -void +void linux_proc_exec(void *arg __unused, struct proc *p, struct image_params *imgp) { struct thread *td = curthread; Modified: stable/11/sys/compat/linux/linux_event.c ============================================================================== --- stable/11/sys/compat/linux/linux_event.c Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/compat/linux/linux_event.c Sun Apr 28 09:53:08 2019 (r346812) @@ -343,7 +343,7 @@ epoll_to_kevent(struct thread *td, struct file *epfp, return (0); } -/* +/* * Structure converting function from kevent to epoll. In a case * this is called on error in registration we store the error in * event->data and pick it up later in linux_epoll_ctl(). @@ -370,7 +370,7 @@ kevent_to_epoll(struct kevent *kevent, struct epoll_ev } } -/* +/* * Copyout callback used by kevent. This converts kevent * events to epoll events and copies them back to the * userspace. This is also called on error on registering @@ -417,7 +417,7 @@ epoll_kev_copyout(void *arg, struct kevent *kevp, int /* * Copyin callback used by kevent. This copies already - * converted filters from kernel memory to the kevent + * converted filters from kernel memory to the kevent * internal kernel memory. Hence the memcpy instead of * copyin. */ @@ -600,7 +600,7 @@ linux_epoll_wait_common(struct thread *td, int epfd, s if (error == 0 && coargs.error != 0) error = coargs.error; - /* + /* * kern_kevent might return ENOMEM which is not expected from epoll_wait. * Maybe we should translate that but I don't think it matters at all. */ @@ -696,7 +696,7 @@ eventfd_create(struct thread *td, uint32_t initval, in knlist_init_mtx(&efd->efd_sel.si_note, &efd->efd_lock); - fflags = FREAD | FWRITE; + fflags = FREAD | FWRITE; if ((flags & LINUX_O_NONBLOCK) != 0) fflags |= FNONBLOCK; Modified: stable/11/sys/compat/linux/linux_file.h ============================================================================== --- stable/11/sys/compat/linux/linux_file.h Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/compat/linux/linux_file.h Sun Apr 28 09:53:08 2019 (r346812) @@ -40,10 +40,10 @@ */ #define LINUX_POSIX_FADV_NORMAL 0 #define LINUX_POSIX_FADV_RANDOM 1 -#define LINUX_POSIX_FADV_SEQUENTIAL 2 -#define LINUX_POSIX_FADV_WILLNEED 3 -#define LINUX_POSIX_FADV_DONTNEED 4 -#define LINUX_POSIX_FADV_NOREUSE 5 +#define LINUX_POSIX_FADV_SEQUENTIAL 2 +#define LINUX_POSIX_FADV_WILLNEED 3 +#define LINUX_POSIX_FADV_DONTNEED 4 +#define LINUX_POSIX_FADV_NOREUSE 5 /* * mount flags Modified: stable/11/sys/compat/linux/linux_fork.c ============================================================================== --- stable/11/sys/compat/linux/linux_fork.c Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/compat/linux/linux_fork.c Sun Apr 28 09:53:08 2019 (r346812) @@ -122,7 +122,7 @@ linux_vfork(struct thread *td, struct linux_vfork_args linux_proc_init(td, td2, 0); - td->td_retval[0] = p2->p_pid; + td->td_retval[0] = p2->p_pid; /* * Make this runnable after we are finished with it. @@ -197,12 +197,12 @@ linux_clone_proc(struct thread *td, struct linux_clone if (args->flags & LINUX_CLONE_CHILD_SETTID) em->child_set_tid = args->child_tidptr; else - em->child_set_tid = NULL; + em->child_set_tid = NULL; if (args->flags & LINUX_CLONE_CHILD_CLEARTID) em->child_clear_tid = args->child_tidptr; else - em->child_clear_tid = NULL; + em->child_clear_tid = NULL; if (args->flags & LINUX_CLONE_PARENT_SETTID) { error = copyout(&p2->p_pid, args->parent_tidptr, @@ -225,7 +225,7 @@ linux_clone_proc(struct thread *td, struct linux_clone linux_set_cloned_tls(td2, args->tls); /* - * If CLONE_PARENT is set, then the parent of the new process will be + * If CLONE_PARENT is set, then the parent of the new process will be * the same as that of the calling process. */ if (args->flags & LINUX_CLONE_PARENT) { @@ -324,15 +324,15 @@ linux_clone_thread(struct thread *td, struct linux_clo if (args->flags & LINUX_CLONE_CHILD_SETTID) em->child_set_tid = args->child_tidptr; else - em->child_set_tid = NULL; + em->child_set_tid = NULL; if (args->flags & LINUX_CLONE_CHILD_CLEARTID) em->child_clear_tid = args->child_tidptr; else - em->child_clear_tid = NULL; + em->child_clear_tid = NULL; cpu_thread_clean(newtd); - + linux_set_upcall_kse(newtd, PTROUT(args->stack)); PROC_LOCK(p); @@ -468,7 +468,7 @@ linux_thread_detach(struct thread *td) LINUX_CTR2(thread_detach, "thread(%d) %p", em->em_tid, child_clear_tid); - + error = suword32(child_clear_tid, 0); if (error != 0) return; Modified: stable/11/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/11/sys/compat/linux/linux_ioctl.c Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/compat/linux/linux_ioctl.c Sun Apr 28 09:53:08 2019 (r346812) @@ -241,7 +241,7 @@ linux_ioctl_hdio(struct thread *td, struct linux_ioctl #if defined(DEBUG) linux_msg(td, "HDIO_GET_GEO: mediasize %jd, c/h/s %d/%d/%d, " "bpc %jd", - (intmax_t)mediasize, fwcylinders, fwheads, fwsectors, + (intmax_t)mediasize, fwcylinders, fwheads, fwsectors, (intmax_t)bytespercyl); #endif if ((args->cmd & 0xffff) == LINUX_HDIO_GET_GEO) { @@ -1052,7 +1052,7 @@ linux_ioctl_termio(struct thread *td, struct linux_ioc break; case LINUX_TIOCGPTN: { int nb; - + error = fo_ioctl(fp, TIOCGPTN, (caddr_t)&nb, td->td_ucred, td); if (!error) error = copyout(&nb, (void *)args->arg, @@ -2321,7 +2321,7 @@ again: goto again; } - ifc.ifc_len = valid_len; + ifc.ifc_len = valid_len; sbuf_finish(sb); error = copyout(sbuf_data(sb), PTRIN(ifc.ifc_buf), ifc.ifc_len); if (error == 0) @@ -2395,12 +2395,12 @@ bsd_to_linux_ifreq(struct ifreq *arg) struct ifreq ifr; size_t ifr_len = sizeof(struct ifreq); int error; - + if ((error = copyin(arg, &ifr, ifr_len))) return (error); - + *(u_short *)&ifr.ifr_addr = ifr.ifr_addr.sa_family; - + error = copyout(&ifr, arg, ifr_len); return (error); @@ -2985,7 +2985,7 @@ linux_v4l_cliplist_copy(struct l_video_window *lvw, st } } ppvc = &((*ppvc)->next); - plvc = PTRIN(((struct l_video_clip *) plvc)->next); + plvc = PTRIN(((struct l_video_clip *) plvc)->next); } } else { /* Modified: stable/11/sys/compat/linux/linux_ioctl.h ============================================================================== --- stable/11/sys/compat/linux/linux_ioctl.h Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/compat/linux/linux_ioctl.h Sun Apr 28 09:53:08 2019 (r346812) @@ -250,7 +250,7 @@ #define LINUX_IOCTL_SOCKET_MAX LINUX_SIOCGIFCOUNT /* - * Device private ioctl calls + * Device private ioctl calls */ #define LINUX_SIOCDEVPRIVATE 0x89F0 /* to 89FF */ #define LINUX_IOCTL_PRIVATE_MIN LINUX_SIOCDEVPRIVATE @@ -428,7 +428,7 @@ /* In addition to the termio values */ #define LINUX_VSTART 8 #define LINUX_VSTOP 9 -#define LINUX_VSUSP 10 +#define LINUX_VSUSP 10 #define LINUX_VEOL 11 #define LINUX_VREPRINT 12 #define LINUX_VDISCARD 13 Modified: stable/11/sys/compat/linux/linux_ipc.c ============================================================================== --- stable/11/sys/compat/linux/linux_ipc.c Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/compat/linux/linux_ipc.c Sun Apr 28 09:53:08 2019 (r346812) @@ -735,8 +735,8 @@ linux_msgctl(struct thread *td, struct linux_msgctl_ar return (error); } - /* - * TODO: implement this + /* + * TODO: implement this * case LINUX_MSG_STAT: */ case LINUX_IPC_STAT: Modified: stable/11/sys/compat/linux/linux_ipc.h ============================================================================== --- stable/11/sys/compat/linux/linux_ipc.h Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/compat/linux/linux_ipc.h Sun Apr 28 09:53:08 2019 (r346812) @@ -84,7 +84,7 @@ #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) -struct linux_msgctl_args +struct linux_msgctl_args { l_int msqid; l_int cmd; Modified: stable/11/sys/compat/linux/linux_ipc64.h ============================================================================== --- stable/11/sys/compat/linux/linux_ipc64.h Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/compat/linux/linux_ipc64.h Sun Apr 28 09:53:08 2019 (r346812) @@ -149,7 +149,7 @@ struct l_shminfo64 { l_ulong shmmni; l_ulong shmseg; l_ulong shmall; - l_ulong __unused1; + l_ulong __unused1; l_ulong __unused2; l_ulong __unused3; l_ulong __unused4; Modified: stable/11/sys/compat/linux/linux_misc.c ============================================================================== --- stable/11/sys/compat/linux/linux_misc.c Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/compat/linux/linux_misc.c Sun Apr 28 09:53:08 2019 (r346812) @@ -114,7 +114,7 @@ int stclohz; /* Statistics clock frequency */ static unsigned int linux_to_bsd_resource[LINUX_RLIM_NLIMITS] = { RLIMIT_CPU, RLIMIT_FSIZE, RLIMIT_DATA, RLIMIT_STACK, RLIMIT_CORE, RLIMIT_RSS, RLIMIT_NPROC, RLIMIT_NOFILE, - RLIMIT_MEMLOCK, RLIMIT_AS + RLIMIT_MEMLOCK, RLIMIT_AS }; struct l_sysinfo { @@ -837,7 +837,7 @@ linux_utimensat_nsec_valid(l_long nsec) return (1); } -int +int linux_utimensat(struct thread *td, struct linux_utimensat_args *args) { struct l_timespec l_times[2]; @@ -912,7 +912,7 @@ linux_utimensat(struct thread *td, struct linux_utimen error = kern_futimens(td, dfd, timesp, UIO_SYSSPACE); else { error = kern_utimensat(td, dfd, path, UIO_SYSSPACE, timesp, - UIO_SYSSPACE, flags); + UIO_SYSSPACE, flags); LFREEPATH(path); } @@ -1219,7 +1219,7 @@ struct l_itimerval { l_timeval it_value; }; -#define B2L_ITIMERVAL(bip, lip) \ +#define B2L_ITIMERVAL(bip, lip) \ (bip)->it_interval.tv_sec = (lip)->it_interval.tv_sec; \ (bip)->it_interval.tv_usec = (lip)->it_interval.tv_usec; \ (bip)->it_value.tv_sec = (lip)->it_value.tv_sec; \ Modified: stable/11/sys/compat/linux/linux_persona.h ============================================================================== --- stable/11/sys/compat/linux/linux_persona.h Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/compat/linux/linux_persona.h Sun Apr 28 09:53:08 2019 (r346812) @@ -12,7 +12,7 @@ */ enum { LINUX_UNAME26 = 0x0020000, - LINUX_ADDR_NO_RANDOMIZE = 0x0040000, /* disable randomization + LINUX_ADDR_NO_RANDOMIZE = 0x0040000, /* disable randomization * of VA space */ LINUX_FDPIC_FUNCPTRS = 0x0080000, /* userspace function Modified: stable/11/sys/compat/linux/linux_signal.c ============================================================================== --- stable/11/sys/compat/linux/linux_signal.c Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/compat/linux/linux_signal.c Sun Apr 28 09:53:08 2019 (r346812) @@ -434,7 +434,7 @@ linux_rt_sigtimedwait(struct thread *td, tv.tv_sec = (long)ltv.tv_sec; tv.tv_usec = (suseconds_t)ltv.tv_usec; if (itimerfix(&tv)) { - /* + /* * The timeout was invalid. Convert it to something * valid that will act as it does under Linux. */ @@ -473,7 +473,7 @@ linux_rt_sigtimedwait(struct thread *td, error = copyout(&linfo, args->ptr, sizeof(linfo)); } if (error == 0) - td->td_retval[0] = sig; + td->td_retval[0] = sig; return (error); } Modified: stable/11/sys/compat/linux/linux_socket.c ============================================================================== --- stable/11/sys/compat/linux/linux_socket.c Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/compat/linux/linux_socket.c Sun Apr 28 09:53:08 2019 (r346812) @@ -168,7 +168,7 @@ linux_getsockaddr(struct sockaddr **sap, const struct name = ((struct sockaddr_un *)kosa)->sun_path; if (*name == '\0') { /* - * Linux abstract namespace starts with a NULL byte. + * Linux abstract namespace starts with a NULL byte. * XXX We do not support abstract namespace yet. */ namelen = strnlen(name + 1, salen - hdrlen - 1) + 1; @@ -759,7 +759,7 @@ linux_bind(struct thread *td, struct linux_bind_args * error = kern_bindat(td, AT_FDCWD, args->s, sa); free(sa, M_SONAME); if (error == EADDRNOTAVAIL && args->namelen != sizeof(struct sockaddr_in)) - return (EINVAL); + return (EINVAL); return (error); } Modified: stable/11/sys/compat/linux/linux_socket.h ============================================================================== --- stable/11/sys/compat/linux/linux_socket.h Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/compat/linux/linux_socket.h Sun Apr 28 09:53:08 2019 (r346812) @@ -150,19 +150,19 @@ struct linux_accept_args { int linux_accept(struct thread *td, struct linux_accept_args *args); /* Operations for socketcall */ -#define LINUX_SOCKET 1 +#define LINUX_SOCKET 1 #define LINUX_BIND 2 -#define LINUX_CONNECT 3 -#define LINUX_LISTEN 4 -#define LINUX_ACCEPT 5 +#define LINUX_CONNECT 3 +#define LINUX_LISTEN 4 +#define LINUX_ACCEPT 5 #define LINUX_GETSOCKNAME 6 #define LINUX_GETPEERNAME 7 #define LINUX_SOCKETPAIR 8 #define LINUX_SEND 9 #define LINUX_RECV 10 -#define LINUX_SENDTO 11 -#define LINUX_RECVFROM 12 -#define LINUX_SHUTDOWN 13 +#define LINUX_SENDTO 11 +#define LINUX_RECVFROM 12 +#define LINUX_SHUTDOWN 13 #define LINUX_SETSOCKOPT 14 #define LINUX_GETSOCKOPT 15 #define LINUX_SENDMSG 16 Modified: stable/11/sys/compat/linux/linux_time.c ============================================================================== --- stable/11/sys/compat/linux/linux_time.c Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/compat/linux/linux_time.c Sun Apr 28 09:53:08 2019 (r346812) @@ -435,7 +435,7 @@ linux_clock_getres(struct thread *td, struct linux_clo } /* - * Check user supplied clock id in case of per-process + * Check user supplied clock id in case of per-process * or thread-specific cpu-time clock. */ switch (nwhich) { @@ -462,7 +462,7 @@ linux_clock_getres(struct thread *td, struct linux_clo if (args->tp == NULL) { LIN_SDT_PROBE0(time, linux_clock_getres, nullcall); LIN_SDT_PROBE1(time, linux_clock_getres, return, 0); - return (0); + return (0); } switch (nwhich) { Modified: stable/11/sys/compat/linux/linux_util.h ============================================================================== --- stable/11/sys/compat/linux/linux_util.h Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/compat/linux/linux_util.h Sun Apr 28 09:53:08 2019 (r346812) @@ -62,7 +62,7 @@ int linux_emul_convpath(struct thread *, const char *, return (_error); \ } while (0) -#define LCONVPATH(td, upath, pathp, i) \ +#define LCONVPATH(td, upath, pathp, i) \ LCONVPATH_AT(td, upath, pathp, i, AT_FDCWD) #define LCONVPATHEXIST(td, upath, pathp) LCONVPATH(td, upath, pathp, 0) Modified: stable/11/sys/compat/linux/stats_timing.d ============================================================================== --- stable/11/sys/compat/linux/stats_timing.d Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/compat/linux/stats_timing.d Sun Apr 28 09:53:08 2019 (r346812) @@ -57,7 +57,7 @@ linuxulator*:::return @stats[probeprov, execname, probefunc] = quantize(this->timediff); @longest[probeprov, probefunc] = max(this->timediff); - + self->time[probefunc] = 0; } Modified: stable/11/sys/compat/linux/trace_futexes.d ============================================================================== --- stable/11/sys/compat/linux/trace_futexes.d Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/compat/linux/trace_futexes.d Sun Apr 28 09:53:08 2019 (r346812) @@ -157,10 +157,10 @@ linuxulator*:futex::return { this->timediff = self->time[probefunc] - timestamp; - @timestats[probeprov, execname, probefunc] = quantize(this->timediff); - @longest[probeprov, probefunc] = max(this->timediff); + @timestats[probeprov, execname, probefunc] = quantize(this->timediff); + @longest[probeprov, probefunc] = max(this->timediff); - self->time[probefunc] = 0; + self->time[probefunc] = 0; } Modified: stable/11/sys/i386/linux/linux.h ============================================================================== --- stable/11/sys/i386/linux/linux.h Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/i386/linux/linux.h Sun Apr 28 09:53:08 2019 (r346812) @@ -215,19 +215,19 @@ struct l_stat64 { l_ulonglong st_ino; }; -struct l_statfs64 { - l_int f_type; - l_int f_bsize; - uint64_t f_blocks; - uint64_t f_bfree; - uint64_t f_bavail; - uint64_t f_files; - uint64_t f_ffree; - l_fsid_t f_fsid; - l_int f_namelen; - l_int f_frsize; - l_int f_flags; - l_int f_spare[4]; +struct l_statfs64 { + l_int f_type; + l_int f_bsize; + uint64_t f_blocks; + uint64_t f_bfree; + uint64_t f_bavail; + uint64_t f_files; + uint64_t f_ffree; + l_fsid_t f_fsid; + l_int f_namelen; + l_int f_frsize; + l_int f_flags; + l_int f_spare[4]; }; #define LINUX_NSIG_WORDS 2 @@ -429,11 +429,11 @@ struct l_sigframe { struct l_rt_sigframe { l_int sf_sig; - l_siginfo_t *sf_siginfo; + l_siginfo_t *sf_siginfo; struct l_ucontext *sf_ucontext; l_siginfo_t sf_si; - struct l_ucontext sf_sc; - l_handler_t sf_handler; + struct l_ucontext sf_sc; + l_handler_t sf_handler; }; extern struct sysentvec linux_sysvec; Modified: stable/11/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/11/sys/i386/linux/linux_dummy.c Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/i386/linux/linux_dummy.c Sun Apr 28 09:53:08 2019 (r346812) @@ -6,7 +6,7 @@ * 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 + * notice, this list of conditions and the following disclaimer * in this position and unchanged. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the Modified: stable/11/sys/i386/linux/linux_locore.s ============================================================================== --- stable/11/sys/i386/linux/linux_locore.s Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/i386/linux/linux_locore.s Sun Apr 28 09:53:08 2019 (r346812) @@ -65,12 +65,12 @@ NON_GPROF_ENTRY(linux_vsyscall) .previous #endif -#define do_cfa_expr(offset) \ - .byte 0x0f; /* DW_CFA_def_cfa_expression */ \ - .uleb128 11f-10f; /* length */ \ -10: .byte 0x74; /* DW_OP_breg4 */ \ - .sleb128 offset; /* offset */ \ - .byte 0x06; /* DW_OP_deref */ \ +#define do_cfa_expr(offset) \ + .byte 0x0f; /* DW_CFA_def_cfa_expression */ \ + .uleb128 11f-10f; /* length */ \ +10: .byte 0x74; /* DW_OP_breg4 */ \ + .sleb128 offset; /* offset */ \ + .byte 0x06; /* DW_OP_deref */ \ 11: Modified: stable/11/sys/i386/linux/linux_machdep.c ============================================================================== --- stable/11/sys/i386/linux/linux_machdep.c Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/i386/linux/linux_machdep.c Sun Apr 28 09:53:08 2019 (r346812) @@ -280,7 +280,7 @@ linux_set_cloned_tls(struct thread *td, void *desc) } else { idx = info.entry_number; - /* + /* * looks like we're getting the idx we returned * in the set_thread_area() syscall */ @@ -291,8 +291,8 @@ linux_set_cloned_tls(struct thread *td, void *desc) /* this doesnt happen in practice */ if (idx == 6) { - /* we might copy out the entry_number as 3 */ - info.entry_number = 3; + /* we might copy out the entry_number as 3 */ + info.entry_number = 3; error = copyout(&info, desc, sizeof(struct l_user_desc)); if (error) printf(LMSG("copyout failed!")); @@ -636,51 +636,51 @@ linux_set_thread_area(struct thread *td, struct linux_ #ifdef DEBUG if (ldebug(set_thread_area)) - printf(ARGS(set_thread_area, "%i, %x, %x, %i, %i, %i, %i, %i, %i\n"), + printf(ARGS(set_thread_area, "%i, %x, %x, %i, %i, %i, %i, %i, %i\n"), info.entry_number, - info.base_addr, - info.limit, - info.seg_32bit, + info.base_addr, + info.limit, + info.seg_32bit, info.contents, - info.read_exec_only, - info.limit_in_pages, - info.seg_not_present, - info.useable); + info.read_exec_only, + info.limit_in_pages, + info.seg_not_present, + info.useable); #endif idx = info.entry_number; - /* + /* * Semantics of linux version: every thread in the system has array of - * 3 tls descriptors. 1st is GLIBC TLS, 2nd is WINE, 3rd unknown. This + * 3 tls descriptors. 1st is GLIBC TLS, 2nd is WINE, 3rd unknown. This * syscall loads one of the selected tls decriptors with a value and * also loads GDT descriptors 6, 7 and 8 with the content of the * per-thread descriptors. * - * Semantics of fbsd version: I think we can ignore that linux has 3 + * Semantics of fbsd version: I think we can ignore that linux has 3 * per-thread descriptors and use just the 1st one. The tls_array[] * is used only in set/get-thread_area() syscalls and for loading the * GDT descriptors. In fbsd we use just one GDT descriptor for TLS so - * we will load just one. + * we will load just one. * * XXX: this doesn't work when a user space process tries to use more * than 1 TLS segment. Comment in the linux sources says wine might do * this. */ - /* - * we support just GLIBC TLS now + /* + * we support just GLIBC TLS now * we should let 3 proceed as well because we use this segment so * if code does two subsequent calls it should succeed */ if (idx != 6 && idx != -1 && idx != 3) return (EINVAL); - /* + /* * we have to copy out the GDT entry we use * FreeBSD uses GDT entry #3 for storing %gs so load that * * XXX: what if a user space program doesn't check this value and tries - * to use 6, 7 or 8? + * to use 6, 7 or 8? */ idx = info.entry_number = 3; error = copyout(&info, args->desc, sizeof(struct l_user_desc)); @@ -698,7 +698,7 @@ linux_set_thread_area(struct thread *td, struct linux_ memcpy(&sd, &a, sizeof(a)); #ifdef DEBUG if (ldebug(set_thread_area)) - printf("Segment created in set_thread_area: lobase: %x, hibase: %x, lolimit: %x, hilimit: %x, type: %i, dpl: %i, p: %i, xx: %i, def32: %i, gran: %i\n", sd.sd_lobase, + printf("Segment created in set_thread_area: lobase: %x, hibase: %x, lolimit: %x, hilimit: %x, type: %i, dpl: %i, p: %i, xx: %i, def32: %i, gran: %i\n", sd.sd_lobase, sd.sd_hibase, sd.sd_lolimit, sd.sd_hilimit, @@ -717,14 +717,14 @@ linux_set_thread_area(struct thread *td, struct linux_ PCPU_GET(fsgs_gdt)[1] = sd; load_gs(GSEL(GUGS_SEL, SEL_UPL)); critical_exit(); - + return (0); } int linux_get_thread_area(struct thread *td, struct linux_get_thread_area_args *args) { - + struct l_user_desc info; int error; int idx; @@ -765,7 +765,7 @@ linux_get_thread_area(struct thread *td, struct linux_ error = copyout(&info, args->desc, sizeof(struct l_user_desc)); if (error) - return (EFAULT); + return (EFAULT); return (0); } @@ -775,7 +775,7 @@ int linux_mq_open(struct thread *td, struct linux_mq_open_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_open(td, (struct kmq_open_args *) args); + return sys_kmq_open(td, (struct kmq_open_args *) args); #else return (ENOSYS); #endif @@ -785,7 +785,7 @@ int linux_mq_unlink(struct thread *td, struct linux_mq_unlink_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_unlink(td, (struct kmq_unlink_args *) args); + return sys_kmq_unlink(td, (struct kmq_unlink_args *) args); #else return (ENOSYS); #endif @@ -795,7 +795,7 @@ int linux_mq_timedsend(struct thread *td, struct linux_mq_timedsend_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_timedsend(td, (struct kmq_timedsend_args *) args); + return sys_kmq_timedsend(td, (struct kmq_timedsend_args *) args); #else return (ENOSYS); #endif @@ -805,7 +805,7 @@ int linux_mq_timedreceive(struct thread *td, struct linux_mq_timedreceive_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_timedreceive(td, (struct kmq_timedreceive_args *) args); + return sys_kmq_timedreceive(td, (struct kmq_timedreceive_args *) args); #else return (ENOSYS); #endif @@ -825,7 +825,7 @@ int linux_mq_getsetattr(struct thread *td, struct linux_mq_getsetattr_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_setattr(td, (struct kmq_setattr_args *) args); + return sys_kmq_setattr(td, (struct kmq_setattr_args *) args); #else return (ENOSYS); #endif Modified: stable/11/sys/i386/linux/linux_support.s ============================================================================== --- stable/11/sys/i386/linux/linux_support.s Sun Apr 28 09:49:30 2019 (r346811) +++ stable/11/sys/i386/linux/linux_support.s Sun Apr 28 09:53:08 2019 (r346812) @@ -47,7 +47,7 @@ ENTRY(futex_xchgl) movl 4(%esp),%eax movl 8(%esp),%edx cmpl $VM_MAXUSER_ADDRESS-4,%edx - ja futex_fault + ja futex_fault xchgl %eax,(%edx) movl 12(%esp),%edx movl %eax,(%edx) @@ -61,7 +61,7 @@ ENTRY(futex_addl) movl 4(%esp),%eax movl 8(%esp),%edx cmpl $VM_MAXUSER_ADDRESS-4,%edx - ja futex_fault + ja futex_fault #ifdef SMP lock #endif @@ -77,7 +77,7 @@ ENTRY(futex_orl) movl $futex_fault_decx,PCB_ONFAULT(%ecx) movl 8(%esp),%edx cmpl $VM_MAXUSER_ADDRESS-4,%edx - ja futex_fault + ja futex_fault movl (%edx),%eax 1: movl %eax,%ecx orl 4(%esp),%ecx @@ -86,7 +86,7 @@ ENTRY(futex_orl) #endif cmpxchgl %ecx,(%edx) jnz 1b -futex_tail: +futex_tail: movl 12(%esp),%edx movl %eax,(%edx) xorl %eax,%eax @@ -99,7 +99,7 @@ ENTRY(futex_andl) movl $futex_fault_decx,PCB_ONFAULT(%ecx) movl 8(%esp),%edx cmpl $VM_MAXUSER_ADDRESS-4,%edx *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Apr 28 09:54:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46AEC1578F31; Sun, 28 Apr 2019 09:54:51 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9F0F8C927; Sun, 28 Apr 2019 09:54:50 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA67F8F98; Sun, 28 Apr 2019 09:54:50 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3S9soYi005617; Sun, 28 Apr 2019 09:54:50 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3S9sonv005615; Sun, 28 Apr 2019 09:54:50 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904280954.x3S9sonv005615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 09:54:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346813 - in stable/11/sys: amd64/linux i386/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/11/sys: amd64/linux i386/linux X-SVN-Commit-Revision: 346813 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D9F0F8C927 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 09:54:51 -0000 Author: dchagin Date: Sun Apr 28 09:54:50 2019 New Revision: 346813 URL: https://svnweb.freebsd.org/changeset/base/346813 Log: MFC r328894 (by emaste@): Additional linuxolator whitespace cleanup, missed in r328890. Modified: stable/11/sys/amd64/linux/syscalls.master stable/11/sys/i386/linux/syscalls.master Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/syscalls.master ============================================================================== --- stable/11/sys/amd64/linux/syscalls.master Sun Apr 28 09:53:08 2019 (r346812) +++ stable/11/sys/amd64/linux/syscalls.master Sun Apr 28 09:54:50 2019 (r346813) @@ -76,7 +76,7 @@ l_size_t nbyte, l_loff_t offset); } 18 AUE_PWRITE STD { int linux_pwrite(l_uint fd, char *buf, \ l_size_t nbyte, l_loff_t offset); } -19 AUE_READV NOPROTO { int readv(int fd, struct iovec *iovp, \ +19 AUE_READV NOPROTO { int readv(int fd, struct iovec *iovp, \ u_int iovcnt); } 20 AUE_WRITEV NOPROTO { int writev(int fd, struct iovec *iovp, \ u_int iovcnt); } @@ -472,7 +472,7 @@ 279 AUE_NULL STD { int linux_move_pages(void); } 280 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \ const struct l_timespec *times, l_int flags); } -281 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ +281 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ l_int maxevents, l_int timeout, l_sigset_t *mask, \ l_size_t sigsetsize); } 282 AUE_NULL STD { int linux_signalfd(void); } Modified: stable/11/sys/i386/linux/syscalls.master ============================================================================== --- stable/11/sys/i386/linux/syscalls.master Sun Apr 28 09:53:08 2019 (r346812) +++ stable/11/sys/i386/linux/syscalls.master Sun Apr 28 09:54:50 2019 (r346813) @@ -121,10 +121,10 @@ 61 AUE_CHROOT NOPROTO { int chroot(char *path); } 62 AUE_NULL STD { int linux_ustat(l_dev_t dev, \ struct l_ustat *ubuf); } -63 AUE_DUP2 NOPROTO { int dup2(u_int from, u_int to); } +63 AUE_DUP2 NOPROTO { int dup2(u_int from, u_int to); } 64 AUE_GETPPID STD { int linux_getppid(void); } -65 AUE_GETPGRP NOPROTO { int getpgrp(void); } -66 AUE_SETSID NOPROTO { int setsid(void); } +65 AUE_GETPGRP NOPROTO { int getpgrp(void); } +66 AUE_SETSID NOPROTO { int setsid(void); } 67 AUE_NULL STD { int linux_sigaction(l_int sig, \ l_osigaction_t *nsa, \ l_osigaction_t *osa); } From owner-svn-src-all@freebsd.org Sun Apr 28 13:07:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CD4A157DA33; Sun, 28 Apr 2019 13:07:40 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCDC891EB6; Sun, 28 Apr 2019 13:07:39 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A11D4AFAD; Sun, 28 Apr 2019 13:07:39 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SD7dsm006712; Sun, 28 Apr 2019 13:07:39 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SD7dei006710; Sun, 28 Apr 2019 13:07:39 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201904281307.x3SD7dei006710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Sun, 28 Apr 2019 13:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346814 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: rwatson X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 346814 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CCDC891EB6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 13:07:40 -0000 Author: rwatson Date: Sun Apr 28 13:07:38 2019 New Revision: 346814 URL: https://svnweb.freebsd.org/changeset/base/346814 Log: Add a man page for the DTrace Audit Provider, since we are now growing a set of provider man pages. MFC after: 3 days Sponsored by: DARPA, AFRL Added: head/share/man/man4/dtrace_audit.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sun Apr 28 09:54:50 2019 (r346813) +++ head/share/man/man4/Makefile Sun Apr 28 13:07:38 2019 (r346814) @@ -887,7 +887,8 @@ _ccd.4= ccd.4 .endif .if ${MK_CDDL} != "no" -_dtrace_provs= dtrace_io.4 \ +_dtrace_provs= dtrace_audit.4 \ + dtrace_io.4 \ dtrace_ip.4 \ dtrace_lockstat.4 \ dtrace_proc.4 \ @@ -896,6 +897,8 @@ _dtrace_provs= dtrace_io.4 \ dtrace_tcp.4 \ dtrace_udp.4 \ dtrace_udplite.4 + +MLINKS+= dtrace_audit.4 dtaudit.4 .endif .if ${MK_EFI} != "no" Added: head/share/man/man4/dtrace_audit.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/dtrace_audit.4 Sun Apr 28 13:07:38 2019 (r346814) @@ -0,0 +1,178 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2019 Robert N. M. Watson +.\" +.\" This software was developed by BAE Systems, the University of Cambridge +.\" Computer Laboratory, and Memorial University under DARPA/AFRL contract +.\" FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing +.\" (TC) research program. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 28, 2019 +.Dt DTRACE_AUDIT 4 +.Os +.Sh NAME +.Nm dtrace_audit +.Nd A DTrace provider for tracing +.Xr audit 4 +events +.Sh SYNOPSIS +.Pp +.Fn audit:event:aue_*:commit "char *eventname" "struct audit_record *ar" +.Fn audit:event:aue_*:bsm "char *eventname" "struct audit_record *ar" "const void *" "size_t" +.Pp +To compile this module into the kernel, place the following in your kernel +configuration file: +.Pp +.Bd -literal -offset indent +.Cd "options DTAUDIT" +.Ed +.Pp +Alternatively, to load the module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dtaudit_load="YES" +.Ed +.Sh DESCRIPTION +The DTrace +.Nm dtaudit +provider allows users to trace events in the kernel security auditing +subsystem, +.Xr audit 4 . +.Xr audit 4 +provides detailed logging of a configurable set of security-relevant system +calls, including key arguments (such as file paths) and return values that are +copied race-free as the system call proceeds. +The +.Nm dtaudit +provider allows DTrace scripts to selectively enable in-kernel audit-record +capture for system calls, and then access those records in either the +in-kernel format or BSM format (\c +.Xr audit.log 5 ) +when the system call completes. +While the in-kernel audit record data structure is subject to change as the +kernel changes over time, it is a much more friendly interface for use in D +scripts than either those available via the DTrace system-call provider or the +BSM trail itself. +.Ss Configuration +The +.Nm dtaudit +provider relies on +.Xr audit 4 +being compiled into the kernel. +.Nm dtaudit +probes become available only once there is an event-to-name mapping installed +in the kernel, normally done by +.Xr auditd 8 +during the boot process, if audit is enabled in +.Xr rc.conf 5 : +.Bd -literal -offset indent +auditd_enable="YES" +.Ed +.Pp +If +.Nm dtaudit +probes are required earlier in boot -- for example, in single-user mode -- or +without enabling +.Xr audit 4 , +they can be preloaded in the boot loader by adding this line to +.Xr loader.conf 5 . +.Bd -literal -offset indent +audit_event_load="YES" +.Ed +.Ss Probes +The +.Fn audit:event:aue_*:commit +probes fire synchronously during system-call return, giving access to two +arguments: a +.Vt char * +audit event name, and +the +.Vt struct audit_record * +in-kernel audit record. +Because the probe fires in system-call return, the user thread has not yet +regained control, and additional information from the thread and process +remains available for capture by the script. +.Pp +The +.Fn audit:event:aue_*:bsm +probes fire asynchonously from system-call return, following BSM conversion +and just prior to being written to disk, giving access to four arguments: a +.Vt char * +audit event name, the +.Vt struct audit_record * +in-kernel audit record, a +.Vt const void * +pointer to the converted BSM record, and a +.Vt size_t +for the length of the BSM record. +.Sh IMPLEMENTATION NOTES +When a set of +.Nm dtaudit +probes are registered, corresponding in-kernel audit records will be captured +and their probes will fire regardless of whether the +.Xr audit 4 +subsystem itself would have captured the record for the purposes of writing it +to the audit trail, or for delivery to a +.Xr auditpipe 4 . +In-kernel audit records allocated only because of enabled +.Xr dtaudit 4 +probes will not be unnecessarily written to the audit trail or enabled pipes. +.Sh SEE ALSO +.Xr dtrace 1 , +.Xr audit 4 , +.Xr audit.log 5 , +.Xr loader.conf 5 , +.Xr rc.conf 5 , +.Xr auditd 8 +.Sh HISTORY +The +.Nm dtaudit +provider first appeared in +.Fx 12.0 . +.Sh AUTHORS +This software and this manual page were developed by BAE Systems, the +University of Cambridge Computer Laboratory, and Memorial University under +DARPA/AFRL contract +.Pq FA8650-15-C-7558 +.Pq Do CADETS Dc , +as part of the DARPA Transparent Computing (TC) research program. +The +.Nm dtaudit +provider and this manual page were written by +.An Robert Watson Aq Mt rwatson@FreeBSD.org . +.Sh BUGS +Because +.Xr audit 4 +maintains its primary event-to-name mapping database in userspace, that +database must be loaded into the kernel before +.Nm dtaudit +probes become available. +.Pp +.Nm dtaudit +is only able to provide access to system-call audit events, not the full +scope of userspace events, such as those relating to login, password change, +and so on. From owner-svn-src-all@freebsd.org Sun Apr 28 13:16:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8401A157DC53; Sun, 28 Apr 2019 13:16:55 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AB57922E6; Sun, 28 Apr 2019 13:16:55 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E546BB15C; Sun, 28 Apr 2019 13:16:54 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SDGsDt011921; Sun, 28 Apr 2019 13:16:54 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SDGsbK011920; Sun, 28 Apr 2019 13:16:54 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281316.x3SDGsbK011920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 13:16:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346815 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 346815 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1AB57922E6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 13:16:55 -0000 Author: dchagin Date: Sun Apr 28 13:16:54 2019 New Revision: 346815 URL: https://svnweb.freebsd.org/changeset/base/346815 Log: MFC r329787 (by emaste@): Use 'const int *' for sysentvec errno translation table This allows an sv_errtbl to be read-only .rodata. Modified: stable/11/sys/sys/sysent.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/sysent.h ============================================================================== --- stable/11/sys/sys/sysent.h Sun Apr 28 13:07:38 2019 (r346814) +++ stable/11/sys/sys/sysent.h Sun Apr 28 13:16:54 2019 (r346815) @@ -92,7 +92,7 @@ struct sysentvec { struct sysent *sv_table; /* pointer to sysent */ u_int sv_mask; /* optional mask to index */ int sv_errsize; /* size of errno translation table */ - int *sv_errtbl; /* errno translation table */ + const int *sv_errtbl; /* errno translation table */ int (*sv_transtrap)(int, int); /* translate trap-to-signal mapping */ int (*sv_fixup)(register_t **, struct image_params *); From owner-svn-src-all@freebsd.org Sun Apr 28 13:19:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87AC4157DD14; Sun, 28 Apr 2019 13:19:32 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3622B924EF; Sun, 28 Apr 2019 13:19:32 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 11AF8B160; Sun, 28 Apr 2019 13:19:32 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SDJWb3012250; Sun, 28 Apr 2019 13:19:32 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SDJSGY012231; Sun, 28 Apr 2019 13:19:28 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281319.x3SDJSGY012231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 13:19:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346816 - in stable/11/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/11/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Commit-Revision: 346816 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3622B924EF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 13:19:32 -0000 Author: dchagin Date: Sun Apr 28 13:19:28 2019 New Revision: 346816 URL: https://svnweb.freebsd.org/changeset/base/346816 Log: MFC r329794, r329801 (by emaste@): Correct proper nouns in the Linuxulator - Capitalize Linux - Spell FreeBSD out in full - Address some style(9) on changed lines Modified: stable/11/sys/amd64/linux/linux_dummy.c stable/11/sys/amd64/linux/linux_sysvec.c stable/11/sys/amd64/linux/syscalls.master stable/11/sys/amd64/linux32/linux32_dummy.c stable/11/sys/amd64/linux32/linux32_sysvec.c stable/11/sys/amd64/linux32/syscalls.master stable/11/sys/compat/linux/linux_emul.c stable/11/sys/compat/linux/linux_file.c stable/11/sys/compat/linux/linux_ioctl.c stable/11/sys/compat/linux/linux_mib.c stable/11/sys/compat/linux/linux_misc.c stable/11/sys/compat/linux/linux_socket.c stable/11/sys/i386/linux/imgact_linux.c stable/11/sys/i386/linux/linux_dummy.c stable/11/sys/i386/linux/linux_machdep.c stable/11/sys/i386/linux/linux_ptrace.c stable/11/sys/i386/linux/linux_sysvec.c stable/11/sys/i386/linux/syscalls.master Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_dummy.c ============================================================================== --- stable/11/sys/amd64/linux/linux_dummy.c Sun Apr 28 13:16:54 2019 (r346815) +++ stable/11/sys/amd64/linux/linux_dummy.c Sun Apr 28 13:19:28 2019 (r346816) @@ -46,15 +46,15 @@ __FBSDID("$FreeBSD$"); LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); UNIMPLEMENTED(afs_syscall); -UNIMPLEMENTED(create_module); /* added in linux 1.0 removed in 2.6 */ +UNIMPLEMENTED(create_module); /* Added in Linux 1.0 removed in 2.6. */ UNIMPLEMENTED(epoll_ctl_old); UNIMPLEMENTED(epoll_wait_old); -UNIMPLEMENTED(get_kernel_syms); /* added in linux 1.0 removed in 2.6 */ +UNIMPLEMENTED(get_kernel_syms); /* Added in Linux 1.0 removed in 2.6. */ UNIMPLEMENTED(get_thread_area); UNIMPLEMENTED(getpmsg); -UNIMPLEMENTED(nfsservctl); /* added in linux 2.2 removed in 3.1 */ +UNIMPLEMENTED(nfsservctl); /* Added in Linux 2.2 removed in 3.1. */ UNIMPLEMENTED(putpmsg); -UNIMPLEMENTED(query_module); /* added in linux 2.2 removed in 2.6 */ +UNIMPLEMENTED(query_module); /* Added in Linux 2.2 removed in 2.6. */ UNIMPLEMENTED(security); UNIMPLEMENTED(set_thread_area); UNIMPLEMENTED(tuxcall); @@ -86,74 +86,74 @@ DUMMY(mq_timedreceive); DUMMY(mq_notify); DUMMY(mq_getsetattr); DUMMY(kexec_load); -/* linux 2.6.11: */ +/* Linux 2.6.11: */ DUMMY(add_key); DUMMY(request_key); DUMMY(keyctl); -/* linux 2.6.13: */ +/* Linux 2.6.13: */ DUMMY(ioprio_set); DUMMY(ioprio_get); DUMMY(inotify_init); DUMMY(inotify_add_watch); DUMMY(inotify_rm_watch); -/* linux 2.6.16: */ +/* Linux 2.6.16: */ DUMMY(migrate_pages); DUMMY(unshare); -/* linux 2.6.17: */ +/* Linux 2.6.17: */ DUMMY(splice); DUMMY(tee); DUMMY(sync_file_range); DUMMY(vmsplice); -/* linux 2.6.18: */ +/* Linux 2.6.18: */ DUMMY(move_pages); -/* linux 2.6.22: */ +/* Linux 2.6.22: */ DUMMY(signalfd); -/* linux 2.6.27: */ +/* Linux 2.6.27: */ DUMMY(signalfd4); DUMMY(inotify_init1); -/* linux 2.6.31: */ +/* Linux 2.6.31: */ DUMMY(perf_event_open); -/* linux 2.6.38: */ +/* Linux 2.6.38: */ DUMMY(fanotify_init); DUMMY(fanotify_mark); -/* linux 2.6.39: */ +/* Linux 2.6.39: */ DUMMY(name_to_handle_at); DUMMY(open_by_handle_at); DUMMY(clock_adjtime); -/* linux 3.0: */ +/* Linux 3.0: */ DUMMY(setns); DUMMY(getcpu); -/* linux 3.2: */ +/* Linux 3.2: */ DUMMY(process_vm_readv); DUMMY(process_vm_writev); -/* linux 3.5: */ +/* Linux 3.5: */ DUMMY(kcmp); -/* linux 3.8: */ +/* Linux 3.8: */ DUMMY(finit_module); DUMMY(sched_setattr); DUMMY(sched_getattr); -/* linux 3.14: */ +/* Linux 3.14: */ DUMMY(renameat2); -/* linux 3.15: */ +/* Linux 3.15: */ DUMMY(seccomp); DUMMY(memfd_create); DUMMY(kexec_file_load); -/* linux 3.18: */ +/* Linux 3.18: */ DUMMY(bpf); -/* linux 3.19: */ +/* Linux 3.19: */ DUMMY(execveat); -/* linux 4.2: */ +/* Linux 4.2: */ DUMMY(userfaultfd); -/* linux 4.3: */ +/* Linux 4.3: */ DUMMY(membarrier); -/* linux 4.4: */ +/* Linux 4.4: */ DUMMY(mlock2); -/* linux 4.5: */ +/* Linux 4.5: */ DUMMY(copy_file_range); -/* linux 4.6: */ +/* Linux 4.6: */ DUMMY(preadv2); DUMMY(pwritev2); -/* linux 4.8: */ +/* Linux 4.8: */ DUMMY(pkey_mprotect); DUMMY(pkey_alloc); DUMMY(pkey_free); Modified: stable/11/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 13:16:54 2019 (r346815) +++ stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 13:19:28 2019 (r346816) @@ -683,9 +683,9 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse } /* - * If a linux binary is exec'ing something, try this image activator + * If a Linux binary is exec'ing something, try this image activator * first. We override standard shell script execution in order to - * be able to modify the interpreter path. We only do this if a linux + * be able to modify the interpreter path. We only do this if a Linux * binary is doing the exec, so we do not create an EXEC module for it. */ static int exec_linux_imgact_try(struct image_params *iparams); @@ -698,9 +698,9 @@ exec_linux_imgact_try(struct image_params *imgp) int error = -1; /* - * The interpreter for shell scripts run from a linux binary needs + * The interpreter for shell scripts run from a Linux binary needs * to be located in /compat/linux if possible in order to recursively - * maintain linux path emulation. + * maintain Linux path emulation. */ if (((const short *)head)[0] == SHELLMAGIC) { /* @@ -859,7 +859,7 @@ linux_trans_osrel(const Elf_Note *note, int32_t *osrel return (FALSE); /* - * For linux we encode osrel as follows (see linux_mib.c): + * For Linux we encode osrel as follows (see linux_mib.c): * VVVMMMIII (version, major, minor), see linux_mib.c. */ *osrel = desc[1] * 1000000 + desc[2] * 1000 + desc[3]; Modified: stable/11/sys/amd64/linux/syscalls.master ============================================================================== --- stable/11/sys/amd64/linux/syscalls.master Sun Apr 28 13:16:54 2019 (r346815) +++ stable/11/sys/amd64/linux/syscalls.master Sun Apr 28 13:19:28 2019 (r346816) @@ -487,7 +487,7 @@ struct l_itimerspec *old_value); } 288 AUE_ACCEPT STD { int linux_accept4(l_int s, l_uintptr_t addr, \ l_uintptr_t namelen, int flags); } -; linux 2.6.27: +; Linux 2.6.27: 289 AUE_NULL STD { int linux_signalfd4(void); } 290 AUE_NULL STD { int linux_eventfd2(l_uint initval, l_int flags); } 291 AUE_NULL STD { int linux_epoll_create1(l_int flags); } @@ -495,41 +495,41 @@ l_int newfd, l_int flags); } 293 AUE_NULL STD { int linux_pipe2(l_int *pipefds, l_int flags); } 294 AUE_NULL STD { int linux_inotify_init1(l_int flags); } -; linux 2.6.30: +; Linux 2.6.30: 295 AUE_NULL STD { int linux_preadv(l_ulong fd, \ struct iovec *vec, l_ulong vlen, \ l_ulong pos_l, l_ulong pos_h); } 296 AUE_NULL STD { int linux_pwritev(l_ulong fd, \ struct iovec *vec, l_ulong vlen, \ l_ulong pos_l, l_ulong pos_h); } -; linux 2.6.31: +; Linux 2.6.31: 297 AUE_NULL STD { int linux_rt_tgsigqueueinfo(l_pid_t tgid, \ l_pid_t tid, l_int sig, l_siginfo_t *uinfo); } 298 AUE_NULL STD { int linux_perf_event_open(void); } -; linux 2.6.33: +; Linux 2.6.33: 299 AUE_NULL STD { int linux_recvmmsg(l_int s, \ struct l_mmsghdr *msg, l_uint vlen, \ l_uint flags, struct l_timespec *timeout); } -; linux 2.6.37: +; Linux 2.6.37: 300 AUE_NULL STD { int linux_fanotify_init(void); } 301 AUE_NULL STD { int linux_fanotify_mark(void); } -; linux 2.6.36: +; Linux 2.6.36: 302 AUE_NULL STD { int linux_prlimit64(l_pid_t pid, l_uint resource, \ struct rlimit *new, struct rlimit *old); } -; linux 2.6.39 (glibc 2.14): +; Linux 2.6.39 (glibc 2.14): 303 AUE_NULL STD { int linux_name_to_handle_at(void); } 304 AUE_NULL STD { int linux_open_by_handle_at(void); } 305 AUE_NULL STD { int linux_clock_adjtime(void); } 306 AUE_SYNC STD { int linux_syncfs(l_int fd); } -; linux 3.0 (glibc 2.14): +; Linux 3.0 (glibc 2.14): 307 AUE_NULL STD { int linux_sendmmsg(l_int s, \ struct l_mmsghdr *msg, l_uint vlen, \ l_uint flags); } 308 AUE_NULL STD { int linux_setns(l_int fd, l_int nstype); } -; linux 2.6.19 (no glibc wrapper): +; Linux 2.6.19 (no glibc wrapper): 309 AUE_NULL STD { int linux_getcpu(l_uint *cpu, l_uint *node, \ void *cache); } -; linux 3.2 (glibc 2.15): +; Linux 3.2 (glibc 2.15): 310 AUE_NULL STD { int linux_process_vm_readv(l_pid_t pid, \ const struct iovec *lvec, l_ulong liovcnt, \ const struct iovec *rvec, l_ulong riovcnt, \ @@ -538,22 +538,22 @@ const struct iovec *lvec, l_ulong liovcnt, \ const struct iovec *rvec, l_ulong riovcnt, \ l_ulong flags); } -; linux 3.5 (no glibc wrapper): +; Linux 3.5 (no glibc wrapper): 312 AUE_NULL STD { int linux_kcmp(l_pid_t pid1, l_pid_t pid2, \ l_int type, l_ulong idx1, l_ulong idx); } -; linux 3.8 (no glibc wrapper): +; Linux 3.8 (no glibc wrapper): 313 AUE_NULL STD { int linux_finit_module(l_int fd, \ const char *uargs, l_int flags); } -; linux 3.14: +; Linux 3.14: 314 AUE_NULL STD { int linux_sched_setattr(l_pid_t pid, \ void *attr, l_uint flags); } 315 AUE_NULL STD { int linux_sched_getattr(l_pid_t pid, \ void *attr, l_uint size, l_uint flags); } -; linux 3.15: +; Linux 3.15: 316 AUE_NULL STD { int linux_renameat2(l_int oldfd, \ const char *oldname, l_int newfd, \ const char *newname, unsigned int flags); } -; linux 3.17: +; Linux 3.17: 317 AUE_NULL STD { int linux_seccomp(l_uint op, l_uint flags, \ const char *uargs); } 318 AUE_NULL STD { int linux_getrandom(char *buf, \ @@ -563,33 +563,33 @@ 320 AUE_NULL STD { int linux_kexec_file_load(l_int kernel_fd, \ l_int initrd_fd, l_ulong cmdline_len, \ const char *cmdline_ptr, l_ulong flags); } -; linux 3.18: +; Linux 3.18: 321 AUE_NULL STD { int linux_bpf(l_int cmd, void *attr, \ l_uint size); } -; linux 3.19: +; Linux 3.19: 322 AUE_NULL STD { int linux_execveat(l_int dfd, \ const char *filename, const char **argv, \ const char **envp, l_int flags); } -; linux 4.2: +; Linux 4.2: 323 AUE_NULL STD { int linux_userfaultfd(l_int flags); } -; linux 4.3: +; Linux 4.3: 324 AUE_NULL STD { int linux_membarrier(l_int cmd, l_int flags); } -; linux 4.4: +; Linux 4.4: 325 AUE_NULL STD { int linux_mlock2(l_ulong start, l_size_t len, \ l_int flags); } -; linux 4.5: +; Linux 4.5: 326 AUE_NULL STD { int linux_copy_file_range(l_int fd_in, \ l_loff_t *off_in, l_int fd_out, \ l_loff_t *off_out, l_size_t len, \ l_uint flags); } -; linux 4.6: +; Linux 4.6: 327 AUE_NULL STD { int linux_preadv2(l_ulong fd, \ const struct iovec *vec, l_ulong vlen, \ l_ulong pos_l, l_ulong pos_h, l_int flags); } 328 AUE_NULL STD { int linux_pwritev2(l_ulong fd, \ const struct iovec *vec, l_ulong vlen, \ l_ulong pos_l, l_ulong pos_h, l_int flags); } -; linux 4.8: +; Linux 4.8: 329 AUE_NULL STD { int linux_pkey_mprotect(l_ulong start, \ l_size_t len, l_ulong prot, l_int pkey); } 330 AUE_NULL STD { int linux_pkey_alloc(l_ulong flags, \ Modified: stable/11/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_dummy.c Sun Apr 28 13:16:54 2019 (r346815) +++ stable/11/sys/amd64/linux32/linux32_dummy.c Sun Apr 28 13:19:28 2019 (r346816) @@ -47,19 +47,19 @@ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); UNIMPLEMENTED(afs_syscall); UNIMPLEMENTED(break); -UNIMPLEMENTED(create_module); /* added in linux 1.0 removed in 2.6 */ +UNIMPLEMENTED(create_module); /* Added in Linux 1.0 removed in 2.6. */ UNIMPLEMENTED(ftime); -UNIMPLEMENTED(get_kernel_syms); /* added in linux 1.0 removed in 2.6 */ +UNIMPLEMENTED(get_kernel_syms); /* Added in Linux 1.0 removed in 2.6. */ UNIMPLEMENTED(getpmsg); UNIMPLEMENTED(gtty); UNIMPLEMENTED(stty); UNIMPLEMENTED(lock); UNIMPLEMENTED(mpx); -UNIMPLEMENTED(nfsservctl); /* added in linux 2.2 removed in 3.1 */ +UNIMPLEMENTED(nfsservctl); /* Added in Linux 2.2 removed in 3.1. */ UNIMPLEMENTED(prof); UNIMPLEMENTED(profil); UNIMPLEMENTED(putpmsg); -UNIMPLEMENTED(query_module); /* added in linux 2.2 removed in 2.6 */ +UNIMPLEMENTED(query_module); /* Added in Linux 2.2 removed in 2.6. */ UNIMPLEMENTED(ulimit); UNIMPLEMENTED(vserver); @@ -92,74 +92,74 @@ DUMMY(mq_timedreceive); DUMMY(mq_notify); DUMMY(mq_getsetattr); DUMMY(kexec_load); -/* linux 2.6.11: */ +/* Linux 2.6.11: */ DUMMY(add_key); DUMMY(request_key); DUMMY(keyctl); -/* linux 2.6.13: */ +/* Linux 2.6.13: */ DUMMY(ioprio_set); DUMMY(ioprio_get); DUMMY(inotify_init); DUMMY(inotify_add_watch); DUMMY(inotify_rm_watch); -/* linux 2.6.16: */ +/* Linux 2.6.16: */ DUMMY(migrate_pages); DUMMY(unshare); -/* linux 2.6.17: */ +/* Linux 2.6.17: */ DUMMY(splice); DUMMY(sync_file_range); DUMMY(tee); DUMMY(vmsplice); -/* linux 2.6.18: */ +/* Linux 2.6.18: */ DUMMY(move_pages); -/* linux 2.6.19: */ +/* Linux 2.6.19: */ DUMMY(getcpu); -/* linux 2.6.22: */ +/* Linux 2.6.22: */ DUMMY(signalfd); -/* linux 2.6.27: */ +/* Linux 2.6.27: */ DUMMY(signalfd4); DUMMY(inotify_init1); -/* linux 2.6.31: */ +/* Linux 2.6.31: */ DUMMY(perf_event_open); -/* linux 2.6.33: */ +/* Linux 2.6.33: */ DUMMY(fanotify_init); DUMMY(fanotify_mark); -/* linux 2.6.39: */ +/* Linux 2.6.39: */ DUMMY(name_to_handle_at); DUMMY(open_by_handle_at); DUMMY(clock_adjtime); -/* linux 3.0: */ +/* Linux 3.0: */ DUMMY(setns); -/* linux 3.2: */ +/* Linux 3.2: */ DUMMY(process_vm_readv); DUMMY(process_vm_writev); -/* linux 3.5: */ +/* Linux 3.5: */ DUMMY(kcmp); -/* linux 3.8: */ +/* Linux 3.8: */ DUMMY(finit_module); DUMMY(sched_setattr); DUMMY(sched_getattr); -/* linux 3.14: */ +/* Linux 3.14: */ DUMMY(renameat2); -/* linux 3.15: */ +/* Linux 3.15: */ DUMMY(seccomp); DUMMY(memfd_create); -/* linux 3.18: */ +/* Linux 3.18: */ DUMMY(bpf); -/* linux 3.19: */ +/* Linux 3.19: */ DUMMY(execveat); -/* linux 4.2: */ +/* Linux 4.2: */ DUMMY(userfaultfd); -/* linux 4.3: */ +/* Linux 4.3: */ DUMMY(membarrier); -/* linux 4.4: */ +/* Linux 4.4: */ DUMMY(mlock2); -/* linux 4.5: */ +/* Linux 4.5: */ DUMMY(copy_file_range); -/* linux 4.6: */ +/* Linux 4.6: */ DUMMY(preadv2); DUMMY(pwritev2); -/* linux 4.8: */ +/* Linux 4.8: */ DUMMY(pkey_mprotect); DUMMY(pkey_alloc); DUMMY(pkey_free); Modified: stable/11/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 13:16:54 2019 (r346815) +++ stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 13:19:28 2019 (r346816) @@ -737,9 +737,9 @@ linux32_fetch_syscall_args(struct thread *td) } /* - * If a linux binary is exec'ing something, try this image activator + * If a Linux binary is exec'ing something, try this image activator * first. We override standard shell script execution in order to - * be able to modify the interpreter path. We only do this if a linux + * be able to modify the interpreter path. We only do this if a Linux * binary is doing the exec, so we do not create an EXEC module for it. */ static int exec_linux_imgact_try(struct image_params *iparams); @@ -752,9 +752,9 @@ exec_linux_imgact_try(struct image_params *imgp) int error = -1; /* - * The interpreter for shell scripts run from a linux binary needs + * The interpreter for shell scripts run from a Linux binary needs * to be located in /compat/linux if possible in order to recursively - * maintain linux path emulation. + * maintain Linux path emulation. */ if (((const short *)head)[0] == SHELLMAGIC) { /* @@ -1057,7 +1057,7 @@ linux32_trans_osrel(const Elf_Note *note, int32_t *osr return (FALSE); /* - * For linux we encode osrel as follows (see linux_mib.c): + * For Linux we encode osrel as follows (see linux_mib.c): * VVVMMMIII (version, major, minor), see linux_mib.c. */ *osrel = desc[1] * 1000000 + desc[2] * 1000 + desc[3]; Modified: stable/11/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/11/sys/amd64/linux32/syscalls.master Sun Apr 28 13:16:54 2019 (r346815) +++ stable/11/sys/amd64/linux32/syscalls.master Sun Apr 28 13:19:28 2019 (r346816) @@ -463,7 +463,7 @@ 274 AUE_NULL STD { int linux_mbind(void); } 275 AUE_NULL STD { int linux_get_mempolicy(void); } 276 AUE_NULL STD { int linux_set_mempolicy(void); } -; linux 2.6.6: +; Linux 2.6.6: 277 AUE_NULL STD { int linux_mq_open(void); } 278 AUE_NULL STD { int linux_mq_unlink(void); } 279 AUE_NULL STD { int linux_mq_timedsend(void); } @@ -475,17 +475,17 @@ l_siginfo_t *info, int options, \ struct l_rusage *rusage); } 285 AUE_NULL UNIMPL -; linux 2.6.11: +; Linux 2.6.11: 286 AUE_NULL STD { int linux_add_key(void); } 287 AUE_NULL STD { int linux_request_key(void); } 288 AUE_NULL STD { int linux_keyctl(void); } -; linux 2.6.13: +; Linux 2.6.13: 289 AUE_NULL STD { int linux_ioprio_set(void); } 290 AUE_NULL STD { int linux_ioprio_get(void); } 291 AUE_NULL STD { int linux_inotify_init(void); } 292 AUE_NULL STD { int linux_inotify_add_watch(void); } 293 AUE_NULL STD { int linux_inotify_rm_watch(void); } -; linux 2.6.16: +; Linux 2.6.16: 294 AUE_NULL STD { int linux_migrate_pages(void); } 295 AUE_OPEN_RWTC STD { int linux_openat(l_int dfd, const char *filename, \ l_int flags, l_int mode); } @@ -519,7 +519,7 @@ 309 AUE_POLL STD { int linux_ppoll(struct pollfd *fds, uint32_t nfds, \ struct l_timespec *tsp, l_sigset_t *sset, l_size_t ssize); } 310 AUE_NULL STD { int linux_unshare(void); } -; linux 2.6.17: +; Linux 2.6.17: 311 AUE_NULL STD { int linux_set_robust_list(struct linux_robust_list_head *head, \ l_size_t len); } 312 AUE_NULL STD { int linux_get_robust_list(l_int pid, \ @@ -528,29 +528,29 @@ 314 AUE_NULL STD { int linux_sync_file_range(void); } 315 AUE_NULL STD { int linux_tee(void); } 316 AUE_NULL STD { int linux_vmsplice(void); } -; linux 2.6.18: +; Linux 2.6.18: 317 AUE_NULL STD { int linux_move_pages(void); } -; linux 2.6.19: +; Linux 2.6.19: 318 AUE_NULL STD { int linux_getcpu(void); } 319 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ l_int maxevents, l_int timeout, l_sigset_t *mask, \ l_size_t sigsetsize); } -; linux 2.6.22: +; Linux 2.6.22: 320 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \ const struct l_timespec *times, l_int flags); } 321 AUE_NULL STD { int linux_signalfd(void); } 322 AUE_NULL STD { int linux_timerfd_create(l_int clockid, l_int flags); } 323 AUE_NULL STD { int linux_eventfd(l_uint initval); } -; linux 2.6.23: +; Linux 2.6.23: 324 AUE_NULL STD { int linux_fallocate(l_int fd, l_int mode, \ l_loff_t offset, l_loff_t len); } -; linux 2.6.25: +; Linux 2.6.25: 325 AUE_NULL STD { int linux_timerfd_settime(l_int fd, l_int flags, \ const struct l_itimerspec *new_value, \ struct l_itimerspec *old_value); } 326 AUE_NULL STD { int linux_timerfd_gettime(l_int fd, \ struct l_itimerspec *old_value); } -; linux 2.6.27: +; Linux 2.6.27: 327 AUE_NULL STD { int linux_signalfd4(void); } 328 AUE_NULL STD { int linux_eventfd2(l_uint initval, l_int flags); } 329 AUE_NULL STD { int linux_epoll_create1(l_int flags); } @@ -558,39 +558,39 @@ l_int newfd, l_int flags); } 331 AUE_NULL STD { int linux_pipe2(l_int *pipefds, l_int flags); } 332 AUE_NULL STD { int linux_inotify_init1(void); } -; linux 2.6.30: +; Linux 2.6.30: 333 AUE_NULL STD { int linux_preadv(l_ulong fd, \ struct iovec *vec, l_ulong vlen, \ l_ulong pos_l, l_ulong pos_h); } 334 AUE_NULL STD { int linux_pwritev(l_ulong fd, \ struct iovec *vec, l_ulong vlen, \ l_ulong pos_l, l_ulong pos_h); } -; linux 2.6.31: +; Linux 2.6.31: 335 AUE_NULL STD { int linux_rt_tgsigqueueinfo(l_pid_t tgid, \ l_pid_t tid, l_int sig, l_siginfo_t *uinfo); } 336 AUE_NULL STD { int linux_perf_event_open(void); } -; linux 2.6.33: +; Linux 2.6.33: 337 AUE_NULL STD { int linux_recvmmsg(l_int s, \ struct l_mmsghdr *msg, l_uint vlen, \ l_uint flags, struct l_timespec *timeout); } 338 AUE_NULL STD { int linux_fanotify_init(void); } 339 AUE_NULL STD { int linux_fanotify_mark(void); } -; linux 2.6.36: +; Linux 2.6.36: 340 AUE_NULL STD { int linux_prlimit64(l_pid_t pid, \ l_uint resource, \ struct rlimit *new, \ struct rlimit *old); } -; linux 2.6.39: +; Linux 2.6.39: 341 AUE_NULL STD { int linux_name_to_handle_at(void); } 342 AUE_NULL STD { int linux_open_by_handle_at(void); } 343 AUE_NULL STD { int linux_clock_adjtime(void); } 344 AUE_SYNC STD { int linux_syncfs(l_int fd); } -; linux 3.0: +; Linux 3.0: 345 AUE_NULL STD { int linux_sendmmsg(l_int s, \ struct l_mmsghdr *msg, l_uint vlen, \ l_uint flags); } 346 AUE_NULL STD { int linux_setns(void); } -; linux 3.2 (glibc 2.15): +; Linux 3.2 (glibc 2.15): 347 AUE_NULL STD { int linux_process_vm_readv(l_pid_t pid, \ const struct iovec *lvec, l_ulong liovcnt, \ const struct iovec *rvec, l_ulong riovcnt, \ @@ -599,36 +599,36 @@ const struct iovec *lvec, l_ulong liovcnt, \ const struct iovec *rvec, l_ulong riovcnt, \ l_ulong flags); } -; linux 3.5 (no glibc wrapper): +; Linux 3.5 (no glibc wrapper): 349 AUE_NULL STD { int linux_kcmp(l_pid_t pid1, l_pid_t pid2, \ l_int type, l_ulong idx1, l_ulong idx); } -; linux 3.8 (no glibc wrapper): +; Linux 3.8 (no glibc wrapper): 350 AUE_NULL STD { int linux_finit_module(l_int fd, \ const char *uargs, l_int flags); } -; linux 3.14: +; Linux 3.14: 351 AUE_NULL STD { int linux_sched_setattr(l_pid_t pid, \ void *attr, l_uint flags); } 352 AUE_NULL STD { int linux_sched_getattr(l_pid_t pid, \ void *attr, l_uint size, l_uint flags); } -; linux 3.15: +; Linux 3.15: 353 AUE_NULL STD { int linux_renameat2(l_int oldfd, \ const char *oldname, l_int newfd, \ const char *newname, unsigned int flags); } -; linux 3.17: +; Linux 3.17: 354 AUE_NULL STD { int linux_seccomp(l_uint op, l_uint flags, \ const char *uargs); } 355 AUE_NULL STD { int linux_getrandom(char *buf, \ l_size_t count, l_uint flags); } 356 AUE_NULL STD { int linux_memfd_create(const char *uname_ptr, \ l_uint flags); } -; linux 3.18: +; Linux 3.18: 357 AUE_NULL STD { int linux_bpf(l_int cmd, void *attr, \ l_uint size); } -; linux 3.19: +; Linux 3.19: 358 AUE_NULL STD { int linux_execveat(l_int dfd, \ const char *filename, const char **argv, \ const char **envp, l_int flags); } -; linux 4.3: sockets now direct system calls: +; Linux 4.3: sockets now direct system calls: 359 AUE_SOCKET STD { int linux_socket(l_int domain, l_int type, \ l_int protocol); } 360 AUE_SOCKETPAIR STD { int linux_socketpair(l_int domain, \ @@ -662,26 +662,26 @@ l_int flags); } 373 AUE_NULL STD { int linux_shutdown(l_int s, l_int how); } ; -; linux 4.2: +; Linux 4.2: 374 AUE_NULL STD { int linux_userfaultfd(l_int flags); } -; linux 4.3: +; Linux 4.3: 375 AUE_NULL STD { int linux_membarrier(l_int cmd, l_int flags); } -; linux 4.4: +; Linux 4.4: 376 AUE_NULL STD { int linux_mlock2(l_ulong start, l_size_t len, \ l_int flags); } -; linux 4.5: +; Linux 4.5: 377 AUE_NULL STD { int linux_copy_file_range(l_int fd_in, \ l_loff_t *off_in, l_int fd_out, \ l_loff_t *off_out, l_size_t len, \ l_uint flags); } -; linux 4.6: +; Linux 4.6: 378 AUE_NULL STD { int linux_preadv2(l_ulong fd, \ const struct iovec *vec, l_ulong vlen, \ l_ulong pos_l, l_ulong pos_h, l_int flags); } 379 AUE_NULL STD { int linux_pwritev2(l_ulong fd, \ const struct iovec *vec, l_ulong vlen, \ l_ulong pos_l, l_ulong pos_h, l_int flags); } -; linux 4.8: +; Linux 4.8: 380 AUE_NULL STD { int linux_pkey_mprotect(l_ulong start, \ l_size_t len, l_ulong prot, l_int pkey); } 381 AUE_NULL STD { int linux_pkey_alloc(l_ulong flags, \ Modified: stable/11/sys/compat/linux/linux_emul.c ============================================================================== --- stable/11/sys/compat/linux/linux_emul.c Sun Apr 28 13:16:54 2019 (r346815) +++ stable/11/sys/compat/linux/linux_emul.c Sun Apr 28 13:19:28 2019 (r346816) @@ -191,7 +191,7 @@ linux_common_execve(struct thread *td, struct image_ar /* * In a case of transition from Linux binary execing to - * FreeBSD binary we destroy linux emuldata thread & proc entries. + * FreeBSD binary we destroy Linux emuldata thread & proc entries. */ if (SV_CURPROC_ABI() != SV_ABI_LINUX) { PROC_LOCK(p); @@ -226,7 +226,7 @@ linux_proc_exec(void *arg __unused, struct proc *p, st #endif /* - * In a case of execing from linux binary properly detach + * In a case of execing from Linux binary properly detach * other threads from the user space. */ if (__predict_false(SV_PROC_ABI(p) == SV_ABI_LINUX)) { @@ -237,7 +237,7 @@ linux_proc_exec(void *arg __unused, struct proc *p, st } /* - * In a case of execing to linux binary we create linux + * In a case of execing to Linux binary we create Linux * emuldata thread entry. */ if (__predict_false((imgp->sysent->sv_flags & SV_ABI_MASK) == Modified: stable/11/sys/compat/linux/linux_file.c ============================================================================== --- stable/11/sys/compat/linux/linux_file.c Sun Apr 28 13:16:54 2019 (r346815) +++ stable/11/sys/compat/linux/linux_file.c Sun Apr 28 13:19:28 2019 (r346816) @@ -538,7 +538,7 @@ linux_access(struct thread *td, struct linux_access_ar char *path; int error; - /* linux convention */ + /* Linux convention. */ if (args->amode & ~(F_OK | X_OK | W_OK | R_OK)) return (EINVAL); @@ -561,7 +561,7 @@ linux_faccessat(struct thread *td, struct linux_facces char *path; int error, dfd; - /* linux convention */ + /* Linux convention. */ if (args->amode & ~(F_OK | X_OK | W_OK | R_OK)) return (EINVAL); @@ -1004,7 +1004,7 @@ linux_pread(struct thread *td, struct linux_pread_args error = kern_pread(td, uap->fd, uap->buf, uap->nbyte, uap->offset); if (error == 0) { - /* This seems to violate POSIX but linux does it */ + /* This seems to violate POSIX but Linux does it. */ error = fgetvp(td, uap->fd, cap_rights_init(&rights, CAP_PREAD), &vp); if (error != 0) Modified: stable/11/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/11/sys/compat/linux/linux_ioctl.c Sun Apr 28 13:16:54 2019 (r346815) +++ stable/11/sys/compat/linux/linux_ioctl.c Sun Apr 28 13:19:28 2019 (r346816) @@ -165,7 +165,7 @@ DATA_SET(linux_ioctl_handler_set, evdev_handler); static TAILQ_HEAD(, linux_ioctl_handler_element) linux_ioctl_handlers = TAILQ_HEAD_INITIALIZER(linux_ioctl_handlers); static struct sx linux_ioctl_sx; -SX_SYSINIT(linux_ioctl, &linux_ioctl_sx, "linux ioctl handlers"); +SX_SYSINIT(linux_ioctl, &linux_ioctl_sx, "Linux ioctl handlers"); #else extern TAILQ_HEAD(, linux_ioctl_handler_element) linux_ioctl_handlers; extern struct sx linux_ioctl_sx; @@ -1344,7 +1344,7 @@ bsd_to_linux_dvd_struct(struct dvd_struct *bp, l_dvd_s lp->manufact.len = bp->length; memcpy(lp->manufact.value, bp->data, sizeof(lp->manufact.value)); - /* lp->manufact.layer_num is unused in linux (redhat 7.0) */ + /* lp->manufact.layer_num is unused in Linux (redhat 7.0). */ break; default: return (EINVAL); @@ -2909,7 +2909,7 @@ linux_v4l_clip_copy(void *lvc, struct video_clip **ppv linux_to_bsd_v4l_clip(&l_vclip, &vclip); /* XXX: If there can be no concurrency: s/M_NOWAIT/M_WAITOK/ */ if ((*ppvc = malloc(sizeof(**ppvc), M_LINUX, M_NOWAIT)) == NULL) - return (ENOMEM); /* XXX: linux has no ENOMEM here */ + return (ENOMEM); /* XXX: Linux has no ENOMEM here. */ memcpy(*ppvc, &vclip, sizeof(vclip)); (*ppvc)->next = NULL; return (0); Modified: stable/11/sys/compat/linux/linux_mib.c ============================================================================== --- stable/11/sys/compat/linux/linux_mib.c Sun Apr 28 13:16:54 2019 (r346815) +++ stable/11/sys/compat/linux/linux_mib.c Sun Apr 28 13:19:28 2019 (r346816) @@ -434,7 +434,7 @@ linux_osd_jail_register(void) linux_osd_jail_slot = osd_jail_register(linux_prison_destructor, methods); - /* Copy the system linux info to any current prisons. */ + /* Copy the system Linux info to any current prisons. */ sx_slock(&allprison_lock); TAILQ_FOREACH(pr, &allprison, pr_list) linux_alloc_prison(pr, NULL); Modified: stable/11/sys/compat/linux/linux_misc.c ============================================================================== --- stable/11/sys/compat/linux/linux_misc.c Sun Apr 28 13:16:54 2019 (r346815) +++ stable/11/sys/compat/linux/linux_misc.c Sun Apr 28 13:19:28 2019 (r346816) @@ -1994,7 +1994,7 @@ linux_prctl(struct thread *td, struct linux_prctl_args case LINUX_PR_SET_NAME: /* * To be on the safe side we need to make sure to not - * overflow the size a linux program expects. We already + * overflow the size a Linux program expects. We already * do this here in the copyin, so that we don't need to * check on copyout. */ Modified: stable/11/sys/compat/linux/linux_socket.c ============================================================================== --- stable/11/sys/compat/linux/linux_socket.c Sun Apr 28 13:16:54 2019 (r346815) +++ stable/11/sys/compat/linux/linux_socket.c Sun Apr 28 13:19:28 2019 (r346816) @@ -83,7 +83,7 @@ static int linux_recvmsg_common(struct thread *, l_int static int linux_set_socket_flags(int, int *); /* - * Reads a linux sockaddr and does any necessary translation. + * Reads a Linux sockaddr and does any necessary translation. * Linux sockaddrs don't have a length field, only a family. * Copy the osockaddr structure pointed to by osa to kernel, adjust * family and convert to sockaddr. Modified: stable/11/sys/i386/linux/imgact_linux.c ============================================================================== --- stable/11/sys/i386/linux/imgact_linux.c Sun Apr 28 13:16:54 2019 (r346815) +++ stable/11/sys/i386/linux/imgact_linux.c Sun Apr 28 13:19:28 2019 (r346816) @@ -235,5 +235,5 @@ fail: /* * Tell kern_execve.c about it, with a little help from the linker. */ -static struct execsw linux_execsw = { exec_linux_imgact, "linux a.out" }; +static struct execsw linux_execsw = { exec_linux_imgact, "Linux a.out" }; EXEC_SET(linuxaout, linux_execsw); Modified: stable/11/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/11/sys/i386/linux/linux_dummy.c Sun Apr 28 13:16:54 2019 (r346815) +++ stable/11/sys/i386/linux/linux_dummy.c Sun Apr 28 13:19:28 2019 (r346816) @@ -47,19 +47,19 @@ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); UNIMPLEMENTED(afs_syscall); UNIMPLEMENTED(break); -UNIMPLEMENTED(create_module); /* added in linux 1.0 removed in 2.6 */ +UNIMPLEMENTED(create_module); /* Added in Linux 1.0 removed in 2.6. */ UNIMPLEMENTED(ftime); -UNIMPLEMENTED(get_kernel_syms); /* added in linux 1.0 removed in 2.6 */ +UNIMPLEMENTED(get_kernel_syms); /* Added in Linux 1.0 removed in 2.6. */ UNIMPLEMENTED(getpmsg); UNIMPLEMENTED(gtty); UNIMPLEMENTED(stty); UNIMPLEMENTED(lock); UNIMPLEMENTED(mpx); -UNIMPLEMENTED(nfsservctl); /* added in linux 2.2 removed in 3.1 */ +UNIMPLEMENTED(nfsservctl); /* Added in Linux 2.2 removed in 3.1. */ UNIMPLEMENTED(prof); UNIMPLEMENTED(profil); UNIMPLEMENTED(putpmsg); -UNIMPLEMENTED(query_module); /* added in linux 2.2 removed in 2.6 */ +UNIMPLEMENTED(query_module); /* Added in Linux 2.2 removed in 2.6. */ UNIMPLEMENTED(ulimit); UNIMPLEMENTED(vserver); @@ -88,74 +88,74 @@ DUMMY(mbind); DUMMY(get_mempolicy); DUMMY(set_mempolicy); DUMMY(kexec_load); -/* linux 2.6.11: */ +/* Linux 2.6.11: */ DUMMY(add_key); DUMMY(request_key); DUMMY(keyctl); -/* linux 2.6.13: */ +/* Linux 2.6.13: */ DUMMY(ioprio_set); DUMMY(ioprio_get); DUMMY(inotify_init); DUMMY(inotify_add_watch); DUMMY(inotify_rm_watch); -/* linux 2.6.16: */ +/* Linux 2.6.16: */ DUMMY(migrate_pages); DUMMY(unshare); -/* linux 2.6.17: */ +/* Linux 2.6.17: */ DUMMY(splice); DUMMY(sync_file_range); DUMMY(tee); DUMMY(vmsplice); -/* linux 2.6.18: */ +/* Linux 2.6.18: */ DUMMY(move_pages); -/* linux 2.6.19: */ +/* Linux 2.6.19: */ DUMMY(getcpu); -/* linux 2.6.22: */ +/* Linux 2.6.22: */ DUMMY(signalfd); -/* linux 2.6.27: */ +/* Linux 2.6.27: */ DUMMY(signalfd4); DUMMY(inotify_init1); -/* linux 2.6.31: */ +/* Linux 2.6.31: */ DUMMY(perf_event_open); -/* linux 2.6.33: */ +/* Linux 2.6.33: */ DUMMY(fanotify_init); DUMMY(fanotify_mark); -/* linux 2.6.39: */ +/* Linux 2.6.39: */ DUMMY(name_to_handle_at); DUMMY(open_by_handle_at); DUMMY(clock_adjtime); -/* linux 3.0: */ +/* Linux 3.0: */ DUMMY(setns); -/* linux 3.2: */ +/* Linux 3.2: */ DUMMY(process_vm_readv); DUMMY(process_vm_writev); -/* linux 3.5: */ +/* Linux 3.5: */ DUMMY(kcmp); -/* linux 3.8: */ +/* Linux 3.8: */ DUMMY(finit_module); DUMMY(sched_setattr); DUMMY(sched_getattr); -/* linux 3.14: */ +/* Linux 3.14: */ DUMMY(renameat2); -/* linux 3.15: */ +/* Linux 3.15: */ DUMMY(seccomp); DUMMY(memfd_create); -/* linux 3.18: */ +/* Linux 3.18: */ DUMMY(bpf); -/* linux 3.19: */ +/* Linux 3.19: */ DUMMY(execveat); -/* linux 4.2: */ +/* Linux 4.2: */ DUMMY(userfaultfd); -/* linux 4.3: */ +/* Linux 4.3: */ DUMMY(membarrier); -/* linux 4.4: */ +/* Linux 4.4: */ DUMMY(mlock2); -/* linux 4.5: */ +/* Linux 4.5: */ DUMMY(copy_file_range); -/* linux 4.6: */ +/* Linux 4.6: */ DUMMY(preadv2); DUMMY(pwritev2); -/* linux 4.8: */ +/* Linux 4.8: */ DUMMY(pkey_mprotect); DUMMY(pkey_alloc); DUMMY(pkey_free); Modified: stable/11/sys/i386/linux/linux_machdep.c ============================================================================== --- stable/11/sys/i386/linux/linux_machdep.c Sun Apr 28 13:16:54 2019 (r346815) +++ stable/11/sys/i386/linux/linux_machdep.c Sun Apr 28 13:19:28 2019 (r346816) @@ -650,20 +650,20 @@ linux_set_thread_area(struct thread *td, struct linux_ idx = info.entry_number; /* - * Semantics of linux version: every thread in the system has array of + * Semantics of Linux version: every thread in the system has array of * 3 tls descriptors. 1st is GLIBC TLS, 2nd is WINE, 3rd unknown. This * syscall loads one of the selected tls decriptors with a value and * also loads GDT descriptors 6, 7 and 8 with the content of the * per-thread descriptors. * - * Semantics of fbsd version: I think we can ignore that linux has 3 + * Semantics of FreeBSD version: I think we can ignore that Linux has 3 * per-thread descriptors and use just the 1st one. The tls_array[] * is used only in set/get-thread_area() syscalls and for loading the - * GDT descriptors. In fbsd we use just one GDT descriptor for TLS so - * we will load just one. + * GDT descriptors. In FreeBSD we use just one GDT descriptor for TLS + * so we will load just one. * * XXX: this doesn't work when a user space process tries to use more - * than 1 TLS segment. Comment in the linux sources says wine might do + * than 1 TLS segment. Comment in the Linux sources says wine might do * this. */ Modified: stable/11/sys/i386/linux/linux_ptrace.c ============================================================================== --- stable/11/sys/i386/linux/linux_ptrace.c Sun Apr 28 13:16:54 2019 (r346815) +++ stable/11/sys/i386/linux/linux_ptrace.c Sun Apr 28 13:19:28 2019 (r346816) @@ -412,7 +412,7 @@ linux_ptrace(struct thread *td, struct linux_ptrace_ar if (uap->addr < 0 || uap->addr & (sizeof(l_int) - 1)) break; /* - * Allow linux programs to access register values in + * Allow Linux programs to access register values in * user struct. We simulate this through PT_GET/SETREGS * as necessary. */ Modified: stable/11/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 13:16:54 2019 (r346815) +++ stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 13:19:28 2019 (r346816) @@ -826,9 +826,9 @@ linux_fetch_syscall_args(struct thread *td) } /* - * If a linux binary is exec'ing something, try this image activator + * If a Linux binary is exec'ing something, try this image activator * first. We override standard shell script execution in order to - * be able to modify the interpreter path. We only do this if a linux + * be able to modify the interpreter path. We only do this if a Linux * binary is doing the exec, so we do not create an EXEC module for it. */ static int exec_linux_imgact_try(struct image_params *iparams); @@ -841,9 +841,9 @@ exec_linux_imgact_try(struct image_params *imgp) int error = -1; /* - * The interpreter for shell scripts run from a linux binary needs + * The interpreter for shell scripts run from a Linux binary needs * to be located in /compat/linux if possible in order to recursively - * maintain linux path emulation. + * maintain Linux path emulation. */ if (((const short *)head)[0] == SHELLMAGIC) { /* @@ -1023,7 +1023,7 @@ linux_trans_osrel(const Elf_Note *note, int32_t *osrel return (FALSE); /* - * For linux we encode osrel as follows (see linux_mib.c): + * For Linux we encode osrel as follows (see linux_mib.c): * VVVMMMIII (version, major, minor), see linux_mib.c. */ *osrel = desc[1] * 1000000 + desc[2] * 1000 + desc[3]; Modified: stable/11/sys/i386/linux/syscalls.master ============================================================================== --- stable/11/sys/i386/linux/syscalls.master Sun Apr 28 13:16:54 2019 (r346815) +++ stable/11/sys/i386/linux/syscalls.master Sun Apr 28 13:19:28 2019 (r346816) @@ -465,7 +465,7 @@ 274 AUE_NULL STD { int linux_mbind(void); } 275 AUE_NULL STD { int linux_get_mempolicy(void); } 276 AUE_NULL STD { int linux_set_mempolicy(void); } -; linux 2.6.6: +; Linux 2.6.6: 277 AUE_NULL STD { int linux_mq_open(const char *name, int oflag, mode_t mode, \ struct mq_attr *attr); } 278 AUE_NULL STD { int linux_mq_unlink(const char *name); } @@ -483,17 +483,17 @@ l_siginfo_t *info, int options, \ void *rusage); } 285 AUE_NULL UNIMPL -; linux 2.6.11: +; Linux 2.6.11: 286 AUE_NULL STD { int linux_add_key(void); } 287 AUE_NULL STD { int linux_request_key(void); } 288 AUE_NULL STD { int linux_keyctl(void); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Apr 28 13:21:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CAAF157DDEC; Sun, 28 Apr 2019 13:21:05 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B53E09276B; Sun, 28 Apr 2019 13:21:04 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9156CB188; Sun, 28 Apr 2019 13:21:04 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SDL4Be014809; Sun, 28 Apr 2019 13:21:04 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SDL1mo014797; Sun, 28 Apr 2019 13:21:01 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281321.x3SDL1mo014797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 13:21:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346817 - in stable/11/sys: amd64/linux amd64/linux32 compat/freebsd32 dev/aic7xxx dev/drm2 dev/xen/blkback dev/xen/netback i386/ibcs2 i386/linux i386/pci kern netgraph x86/include X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/11/sys: amd64/linux amd64/linux32 compat/freebsd32 dev/aic7xxx dev/drm2 dev/xen/blkback dev/xen/netback i386/ibcs2 i386/linux i386/pci kern netgraph x86/include X-SVN-Commit-Revision: 346817 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B53E09276B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 13:21:05 -0000 Author: dchagin Date: Sun Apr 28 13:21:01 2019 New Revision: 346817 URL: https://svnweb.freebsd.org/changeset/base/346817 Log: MFC r329873 (by emaste@): Correct pseudo misspelling in sys/ comments contrib code and #define in intel_ata.h unchanged. Modified: stable/11/sys/amd64/linux/syscalls.master stable/11/sys/amd64/linux32/syscalls.master stable/11/sys/compat/freebsd32/syscalls.master stable/11/sys/dev/aic7xxx/aic7xxx.seq stable/11/sys/dev/drm2/drm_fb_helper.c stable/11/sys/dev/xen/blkback/blkback.c stable/11/sys/dev/xen/netback/netback.c stable/11/sys/i386/ibcs2/syscalls.master stable/11/sys/i386/linux/syscalls.master stable/11/sys/i386/pci/pci_pir.c stable/11/sys/kern/syscalls.master stable/11/sys/netgraph/ng_atmllc.c stable/11/sys/x86/include/apicvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/syscalls.master ============================================================================== --- stable/11/sys/amd64/linux/syscalls.master Sun Apr 28 13:19:28 2019 (r346816) +++ stable/11/sys/amd64/linux/syscalls.master Sun Apr 28 13:21:01 2019 (r346817) @@ -12,7 +12,7 @@ ; case where the event exists, but we don't want auditing, the ; event should be #defined to AUE_NULL in audit_kevents.h. ; type one of STD, NOPROTO, UNIMPL -; name psuedo-prototype of syscall routine +; name pseudo-prototype of syscall routine ; If one of the following alts is different, then all appear: ; altname name of system call if different ; alttag name of args struct tag if different from [o]`name'"_args" Modified: stable/11/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/11/sys/amd64/linux32/syscalls.master Sun Apr 28 13:19:28 2019 (r346816) +++ stable/11/sys/amd64/linux32/syscalls.master Sun Apr 28 13:21:01 2019 (r346817) @@ -12,7 +12,7 @@ ; case where the event exists, but we don't want auditing, the ; event should be #defined to AUE_NULL in audit_kevents.h. ; type one of STD, NOPROTO, UNIMPL -; name psuedo-prototype of syscall routine +; name pseudo-prototype of syscall routine ; If one of the following alts is different, then all appear: ; altname name of system call if different ; alttag name of args struct tag if different from [o]`name'"_args" Modified: stable/11/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/11/sys/compat/freebsd32/syscalls.master Sun Apr 28 13:19:28 2019 (r346816) +++ stable/11/sys/compat/freebsd32/syscalls.master Sun Apr 28 13:21:01 2019 (r346817) @@ -16,7 +16,7 @@ ; COMPAT7, NODEF, NOARGS, NOPROTO, NOSTD ; The COMPAT* options may be combined with one or more NO* ; options separated by '|' with no spaces (e.g. COMPAT|NOARGS) -; name psuedo-prototype of syscall routine +; name pseudo-prototype of syscall routine ; If one of the following alts is different, then all appear: ; altname name of system call if different ; alttag name of args struct tag if different from [o]`name'"_args" Modified: stable/11/sys/dev/aic7xxx/aic7xxx.seq ============================================================================== --- stable/11/sys/dev/aic7xxx/aic7xxx.seq Sun Apr 28 13:19:28 2019 (r346816) +++ stable/11/sys/dev/aic7xxx/aic7xxx.seq Sun Apr 28 13:21:01 2019 (r346817) @@ -57,7 +57,7 @@ PREFIX = "ahc_" * a later time. This problem cannot be resolved by holding a single entry * in scratch ram since a reconnecting target can request sense and this will * create yet another SCB waiting for selection. The solution used here is to - * use byte 27 of the SCB as a psuedo-next pointer and to thread a list + * use byte 27 of the SCB as a pseudo-next pointer and to thread a list * of SCBs that are awaiting selection. Since 0-0xfe are valid SCB indexes, * SCB_LIST_NULL is 0xff which is out of range. An entry is also added to * this list every time a request sense occurs or after completing a non-tagged Modified: stable/11/sys/dev/drm2/drm_fb_helper.c ============================================================================== --- stable/11/sys/dev/drm2/drm_fb_helper.c Sun Apr 28 13:19:28 2019 (r346816) +++ stable/11/sys/dev/drm2/drm_fb_helper.c Sun Apr 28 13:21:01 2019 (r346817) @@ -580,7 +580,7 @@ static int setcolreg(struct drm_crtc *crtc, u16 red, u if (info->fix.visual == FB_VISUAL_TRUECOLOR) { u32 *palette; u32 value; - /* place color in psuedopalette */ + /* place color in pseudopalette */ if (regno > 16) return -EINVAL; palette = (u32 *)info->pseudo_palette; Modified: stable/11/sys/dev/xen/blkback/blkback.c ============================================================================== --- stable/11/sys/dev/xen/blkback/blkback.c Sun Apr 28 13:19:28 2019 (r346816) +++ stable/11/sys/dev/xen/blkback/blkback.c Sun Apr 28 13:21:01 2019 (r346817) @@ -249,7 +249,7 @@ struct xbb_xen_reqlist { uint8_t *kva; /** - * Base, psuedo-physical address, corresponding to the start + * Base, pseudo-physical address, corresponding to the start * of this request's kva region. */ uint64_t gnt_base; @@ -588,7 +588,7 @@ struct xbb_softc { */ vm_offset_t kva; - /** Psuedo-physical address corresponding to kva. */ + /** Pseudo-physical address corresponding to kva. */ uint64_t gnt_base_addr; /** The size of the global kva pool. */ @@ -937,7 +937,7 @@ xbb_reqlist_ioaddr(struct xbb_xen_reqlist *reqlist, in /** * Given a page index and 512b sector offset within that page, calculate - * an offset into the local psuedo-physical address space used to map a + * an offset into the local pseudo-physical address space used to map a * front-end's request data into a request. * * \param reqlist The request list structure whose pseudo-physical region Modified: stable/11/sys/dev/xen/netback/netback.c ============================================================================== --- stable/11/sys/dev/xen/netback/netback.c Sun Apr 28 13:19:28 2019 (r346816) +++ stable/11/sys/dev/xen/netback/netback.c Sun Apr 28 13:21:01 2019 (r346817) @@ -489,7 +489,7 @@ struct xnb_softc { */ vm_offset_t kva; - /** Psuedo-physical address corresponding to kva. */ + /** Pseudo-physical address corresponding to kva. */ uint64_t gnt_base_addr; /** Various configuration and state bit flags. */ Modified: stable/11/sys/i386/ibcs2/syscalls.master ============================================================================== --- stable/11/sys/i386/ibcs2/syscalls.master Sun Apr 28 13:19:28 2019 (r346816) +++ stable/11/sys/i386/ibcs2/syscalls.master Sun Apr 28 13:21:01 2019 (r346817) @@ -12,7 +12,7 @@ ; case where the event exists, but we don't want auditing, the ; event should be #defined to AUE_NULL in audit_kevents.h. ; type one of STD, OBSOL, UNIMPL, COMPAT -; name psuedo-prototype of syscall routine +; name pseudo-prototype of syscall routine ; If one of the following alts is different, then all appear: ; altname name of system call if different ; alttag name of args struct tag if different from [o]`name'"_args" Modified: stable/11/sys/i386/linux/syscalls.master ============================================================================== --- stable/11/sys/i386/linux/syscalls.master Sun Apr 28 13:19:28 2019 (r346816) +++ stable/11/sys/i386/linux/syscalls.master Sun Apr 28 13:21:01 2019 (r346817) @@ -12,7 +12,7 @@ ; case where the event exists, but we don't want auditing, the ; event should be #defined to AUE_NULL in audit_kevents.h. ; type one of STD, NOPROTO, UNIMPL -; name psuedo-prototype of syscall routine +; name pseudo-prototype of syscall routine ; If one of the following alts is different, then all appear: ; altname name of system call if different ; alttag name of args struct tag if different from [o]`name'"_args" Modified: stable/11/sys/i386/pci/pci_pir.c ============================================================================== --- stable/11/sys/i386/pci/pci_pir.c Sun Apr 28 13:19:28 2019 (r346816) +++ stable/11/sys/i386/pci/pci_pir.c Sun Apr 28 13:21:01 2019 (r346817) @@ -651,7 +651,7 @@ pci_pir_probe(int bus, int require_parse) } /* - * The driver for the new-bus psuedo device pir0 for the $PIR table. + * The driver for the new-bus pseudo device pir0 for the $PIR table. */ static int Modified: stable/11/sys/kern/syscalls.master ============================================================================== --- stable/11/sys/kern/syscalls.master Sun Apr 28 13:19:28 2019 (r346816) +++ stable/11/sys/kern/syscalls.master Sun Apr 28 13:21:01 2019 (r346817) @@ -15,7 +15,7 @@ ; COMPAT7, NODEF, NOARGS, NOPROTO, NOSTD ; The COMPAT* options may be combined with one or more NO* ; options separated by '|' with no spaces (e.g. COMPAT|NOARGS) -; name psuedo-prototype of syscall routine +; name pseudo-prototype of syscall routine ; If one of the following alts is different, then all appear: ; altname name of system call if different ; alttag name of args struct tag if different from [o]`name'"_args" Modified: stable/11/sys/netgraph/ng_atmllc.c ============================================================================== --- stable/11/sys/netgraph/ng_atmllc.c Sun Apr 28 13:19:28 2019 (r346816) +++ stable/11/sys/netgraph/ng_atmllc.c Sun Apr 28 13:21:01 2019 (r346817) @@ -158,7 +158,7 @@ ng_atmllc_rcvdata(hook_p hook, item_p item) padding = 0; if (hook == priv->atm) { - /* Ditch the psuedoheader. */ + /* Ditch the pseudoheader. */ hdr = mtod(m, struct atmllc *); /* m_adj(m, sizeof(struct atm_pseudohdr)); */ Modified: stable/11/sys/x86/include/apicvar.h ============================================================================== --- stable/11/sys/x86/include/apicvar.h Sun Apr 28 13:19:28 2019 (r346816) +++ stable/11/sys/x86/include/apicvar.h Sun Apr 28 13:21:01 2019 (r346817) @@ -158,7 +158,7 @@ #define IRQ_DISABLED -4 /* - * An APIC enumerator is a psuedo bus driver that enumerates APIC's including + * An APIC enumerator is a pseudo bus driver that enumerates APIC's including * CPU's and I/O APIC's. */ struct apic_enumerator { From owner-svn-src-all@freebsd.org Sun Apr 28 13:22:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EE8C157DFDC; Sun, 28 Apr 2019 13:22:31 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8D3A92AAE; Sun, 28 Apr 2019 13:22:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83AE9B316; Sun, 28 Apr 2019 13:22:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SDMUrO017197; Sun, 28 Apr 2019 13:22:30 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SDMU7u017196; Sun, 28 Apr 2019 13:22:30 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281322.x3SDMU7u017196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 13:22:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346818 - stable/11/sys/amd64/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/11/sys/amd64/linux X-SVN-Commit-Revision: 346818 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A8D3A92AAE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 13:22:31 -0000 Author: dchagin Date: Sun Apr 28 13:22:30 2019 New Revision: 346818 URL: https://svnweb.freebsd.org/changeset/base/346818 Log: MFC r329876 (by emaste@): Use linux types for linux-specific syscalls. Modified: stable/11/sys/amd64/linux/syscalls.master Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/syscalls.master ============================================================================== --- stable/11/sys/amd64/linux/syscalls.master Sun Apr 28 13:21:01 2019 (r346817) +++ stable/11/sys/amd64/linux/syscalls.master Sun Apr 28 13:22:30 2019 (r346818) @@ -58,8 +58,8 @@ 9 AUE_MMAP STD { int linux_mmap2(l_ulong addr, l_ulong len, \ l_ulong prot, l_ulong flags, l_ulong fd, \ l_ulong pgoff); } -10 AUE_MPROTECT STD { int linux_mprotect(caddr_t addr, int len, \ - int prot); } +10 AUE_MPROTECT STD { int linux_mprotect(caddr_t addr, l_int len, \ + l_int prot); } 11 AUE_MUNMAP NOPROTO { int munmap(caddr_t addr, int len); } 12 AUE_NULL STD { int linux_brk(l_ulong dsend); } 13 AUE_NULL STD { int linux_rt_sigaction(l_int sig, \ @@ -115,7 +115,7 @@ struct l_itimerval *itv, \ struct l_itimerval *oitv); } 39 AUE_GETPID STD { int linux_getpid(void); } -40 AUE_SENDFILE STD { int linux_sendfile(int out, int in, \ +40 AUE_SENDFILE STD { int linux_sendfile(l_int out, l_int in, \ l_long *offset, l_size_t count); } 41 AUE_SOCKET STD { int linux_socket(l_int domain, l_int type, \ l_int protocol); } @@ -150,12 +150,12 @@ l_int optname, l_uintptr_t optval, \ l_uintptr_t optlen); } 56 AUE_RFORK STD { int linux_clone(l_int flags, void *stack, \ - void *parent_tidptr, void * child_tidptr, void *tls ); } + void *parent_tidptr, void *child_tidptr, void *tls); } 57 AUE_FORK STD { int linux_fork(void); } 58 AUE_VFORK STD { int linux_vfork(void); } 59 AUE_EXECVE STD { int linux_execve(char *path, char **argp, \ char **envp); } -60 AUE_EXIT STD { void linux_exit(int rval); } +60 AUE_EXIT STD { void linux_exit(l_int rval); } 61 AUE_WAIT4 STD { int linux_wait4(l_pid_t pid, \ l_int *status, l_int options, \ struct rusage *rusage); } @@ -281,7 +281,7 @@ struct l_statfs_buf *buf); } 139 AUE_NULL STD { int linux_sysfs(l_int option, \ l_ulong arg1, l_ulong arg2); } -140 AUE_GETPRIORITY STD { int linux_getpriority(int which, int who); } +140 AUE_GETPRIORITY STD { int linux_getpriority(l_int which, l_int who); } 141 AUE_SETPRIORITY NOPROTO { int setpriority(int which, int who, \ int prio); } 142 AUE_SCHED_SETPARAM STD { int linux_sched_setparam(l_pid_t pid, \ @@ -359,10 +359,10 @@ 197 AUE_NULL STD { int linux_removexattr(void); } 198 AUE_NULL STD { int linux_lremovexattr(void); } 199 AUE_NULL STD { int linux_fremovexattr(void); } -200 AUE_NULL STD { int linux_tkill(int tid, int sig); } +200 AUE_NULL STD { int linux_tkill(l_int tid, l_int sig); } 201 AUE_NULL STD { int linux_time(l_time_t *tm); } -202 AUE_NULL STD { int linux_sys_futex(void *uaddr, int op, int val, \ - struct l_timespec *timeout, void *uaddr2, int val3); } +202 AUE_NULL STD { int linux_sys_futex(void *uaddr, l_int op, l_int val, \ + struct l_timespec *timeout, void *uaddr2, l_int val3); } 203 AUE_NULL STD { int linux_sched_setaffinity(l_pid_t pid, l_uint len, \ l_ulong *user_mask_ptr); } 204 AUE_NULL STD { int linux_sched_getaffinity(l_pid_t pid, l_uint len, \ @@ -381,11 +381,11 @@ 216 AUE_NULL STD { int linux_remap_file_pages(void); } 217 AUE_GETDIRENTRIES STD { int linux_getdents64(l_uint fd, \ void *dirent, l_uint count); } -218 AUE_NULL STD { int linux_set_tid_address(int *tidptr); } +218 AUE_NULL STD { int linux_set_tid_address(l_int *tidptr); } 219 AUE_NULL UNIMPL restart_syscall 220 AUE_NULL STD { int linux_semtimedop(void); } -221 AUE_NULL STD { int linux_fadvise64(int fd, l_loff_t offset, \ - l_size_t len, int advice); } +221 AUE_NULL STD { int linux_fadvise64(l_int fd, l_loff_t offset, \ + l_size_t len, l_int advice); } 222 AUE_NULL STD { int linux_timer_create(clockid_t clock_id, \ struct sigevent *evp, l_timer_t *timerid); } 223 AUE_NULL STD { int linux_timer_settime(l_timer_t timerid, l_int flags, \ @@ -398,12 +398,12 @@ 229 AUE_NULL STD { int linux_clock_getres(clockid_t which, struct l_timespec *tp); } 230 AUE_NULL STD { int linux_clock_nanosleep(clockid_t which, int flags, \ struct l_timespec *rqtp, struct l_timespec *rmtp); } -231 AUE_EXIT STD { int linux_exit_group(int error_code); } +231 AUE_EXIT STD { int linux_exit_group(l_int error_code); } 232 AUE_NULL STD { int linux_epoll_wait(l_int epfd, struct epoll_event *events, \ l_int maxevents, l_int timeout); } 233 AUE_NULL STD { int linux_epoll_ctl(l_int epfd, l_int op, l_int fd, \ struct epoll_event *event); } -234 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int sig); } +234 AUE_NULL STD { int linux_tgkill(l_int tgid, l_int pid, l_int sig); } 235 AUE_UTIMES STD { int linux_utimes(char *fname, \ struct l_timeval *tptr); } 236 AUE_NULL UNIMPL vserver @@ -417,8 +417,8 @@ 244 AUE_NULL STD { int linux_mq_notify(void); } 245 AUE_NULL STD { int linux_mq_getsetattr(void); } 246 AUE_NULL STD { int linux_kexec_load(void); } -247 AUE_WAIT6 STD { int linux_waitid(int idtype, l_pid_t id, \ - l_siginfo_t *info, int options, \ +247 AUE_WAIT6 STD { int linux_waitid(l_int idtype, l_pid_t id, \ + l_siginfo_t *info, l_int options, \ struct rusage *rusage); } 248 AUE_NULL STD { int linux_add_key(void); } 249 AUE_NULL STD { int linux_request_key(void); } From owner-svn-src-all@freebsd.org Sun Apr 28 13:23:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A05B157E05F; Sun, 28 Apr 2019 13:23:54 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A32F492BEE; Sun, 28 Apr 2019 13:23:53 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B029B31A; Sun, 28 Apr 2019 13:23:53 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SDNrcs017315; Sun, 28 Apr 2019 13:23:53 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SDNqlV017309; Sun, 28 Apr 2019 13:23:52 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281323.x3SDNqlV017309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 13:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346819 - in stable/11/sys: compat/linux i386/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/11/sys: compat/linux i386/linux X-SVN-Commit-Revision: 346819 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A32F492BEE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 13:23:54 -0000 Author: dchagin Date: Sun Apr 28 13:23:52 2019 New Revision: 346819 URL: https://svnweb.freebsd.org/changeset/base/346819 Log: MFC r330798 (by emaste@): Linuxulator: apply style(9) to return. Modified: stable/11/sys/compat/linux/linux_ioctl.c stable/11/sys/compat/linux/linux_signal.c stable/11/sys/compat/linux/linux_stats.c stable/11/sys/compat/linux/linux_util.c stable/11/sys/i386/linux/imgact_linux.c stable/11/sys/i386/linux/linux_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/11/sys/compat/linux/linux_ioctl.c Sun Apr 28 13:22:30 2019 (r346818) +++ stable/11/sys/compat/linux/linux_ioctl.c Sun Apr 28 13:23:52 2019 (r346819) @@ -388,7 +388,7 @@ linux_to_bsd_speed(int code, struct speedtab *table) for ( ; table->sp_code != -1; table++) if (table->sp_code == code) return (table->sp_speed); - return -1; + return (-1); } static int @@ -397,7 +397,7 @@ bsd_to_linux_speed(int speed, struct speedtab *table) for ( ; table->sp_speed != -1; table++) if (table->sp_speed == speed) return (table->sp_code); - return -1; + return (-1); } static void @@ -2673,7 +2673,7 @@ static int linux_ioctl_drm(struct thread *td, struct linux_ioctl_args *args) { args->cmd = SETDIR(args->cmd); - return sys_ioctl(td, (struct ioctl_args *)args); + return (sys_ioctl(td, (struct ioctl_args *)args)); } #ifdef COMPAT_LINUX32 @@ -3282,9 +3282,9 @@ linux_to_bsd_v4l2_format(struct l_v4l2_format *lvf, st * XXX TODO - needs 32 -> 64 bit conversion: * (unused by webcams?) */ - return EINVAL; + return (EINVAL); memcpy(&vf->fmt, &lvf->fmt, sizeof(vf->fmt)); - return 0; + return (0); } static int @@ -3300,9 +3300,9 @@ bsd_to_linux_v4l2_format(struct v4l2_format *vf, struc * XXX TODO - needs 32 -> 64 bit conversion: * (unused by webcams?) */ - return EINVAL; + return (EINVAL); memcpy(&lvf->fmt, &vf->fmt, sizeof(vf->fmt)); - return 0; + return (0); } static int linux_ioctl_v4l2(struct thread *td, struct linux_ioctl_args *args) @@ -3322,7 +3322,7 @@ linux_ioctl_v4l2(struct thread *td, struct linux_ioctl case LINUX_VIDIOC_RESERVED: case LINUX_VIDIOC_LOG_STATUS: if ((args->cmd & IOC_DIRMASK) != LINUX_IOC_VOID) - return ENOIOCTL; + return (ENOIOCTL); args->cmd = (args->cmd & 0xffff) | IOC_VOID; break; Modified: stable/11/sys/compat/linux/linux_signal.c ============================================================================== --- stable/11/sys/compat/linux/linux_signal.c Sun Apr 28 13:22:30 2019 (r346818) +++ stable/11/sys/compat/linux/linux_signal.c Sun Apr 28 13:23:52 2019 (r346819) @@ -279,7 +279,7 @@ linux_rt_sigprocmask(struct thread *td, struct linux_r #endif if (args->sigsetsize != sizeof(l_sigset_t)) - return EINVAL; + return (EINVAL); if (args->mask != NULL) { error = copyin(args->mask, &set, sizeof(l_sigset_t)); @@ -377,7 +377,7 @@ linux_rt_sigpending(struct thread *td, struct linux_rt l_sigset_t lset; if (args->sigsetsize > sizeof(lset)) - return EINVAL; + return (EINVAL); /* NOT REACHED */ #ifdef DEBUG Modified: stable/11/sys/compat/linux/linux_stats.c ============================================================================== --- stable/11/sys/compat/linux/linux_stats.c Sun Apr 28 13:22:30 2019 (r346818) +++ stable/11/sys/compat/linux/linux_stats.c Sun Apr 28 13:23:52 2019 (r346819) @@ -436,7 +436,7 @@ linux_statfs64(struct thread *td, struct linux_statfs6 int error; if (args->bufsize != sizeof(struct l_statfs64)) - return EINVAL; + return (EINVAL); LCONVPATHEXIST(td, args->path, &path); Modified: stable/11/sys/compat/linux/linux_util.c ============================================================================== --- stable/11/sys/compat/linux/linux_util.c Sun Apr 28 13:22:30 2019 (r346818) +++ stable/11/sys/compat/linux/linux_util.c Sun Apr 28 13:23:52 2019 (r346819) @@ -114,7 +114,7 @@ linux_driver_get_name_dev(device_t dev) const char *device_name = device_get_name(dev); if (device_name == NULL) - return NULL; + return (NULL); TAILQ_FOREACH(de, &devices, list) { if (strcmp(device_name, de->entry.bsd_driver_name) == 0) return (de->entry.linux_driver_name); @@ -131,7 +131,7 @@ linux_driver_get_major_minor(const char *node, int *ma size_t sz; if (node == NULL || major == NULL || minor == NULL) - return 1; + return (1); sz = sizeof("pts/") - 1; if (strncmp(node, "pts/", sz) == 0 && node[sz] != '\0') { Modified: stable/11/sys/i386/linux/imgact_linux.c ============================================================================== --- stable/11/sys/i386/linux/imgact_linux.c Sun Apr 28 13:22:30 2019 (r346818) +++ stable/11/sys/i386/linux/imgact_linux.c Sun Apr 28 13:23:52 2019 (r346819) @@ -69,7 +69,7 @@ exec_linux_imgact(struct image_params *imgp) int error; if (((a_out->a_magic >> 16) & 0xff) != 0x64) - return -1; + return (-1); /* * Set file/virtual offset based on a.out variant. Modified: stable/11/sys/i386/linux/linux_machdep.c ============================================================================== --- stable/11/sys/i386/linux/linux_machdep.c Sun Apr 28 13:22:30 2019 (r346818) +++ stable/11/sys/i386/linux/linux_machdep.c Sun Apr 28 13:23:52 2019 (r346819) @@ -775,7 +775,7 @@ int linux_mq_open(struct thread *td, struct linux_mq_open_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_open(td, (struct kmq_open_args *) args); + return (sys_kmq_open(td, (struct kmq_open_args *)args)); #else return (ENOSYS); #endif @@ -785,7 +785,7 @@ int linux_mq_unlink(struct thread *td, struct linux_mq_unlink_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_unlink(td, (struct kmq_unlink_args *) args); + return (sys_kmq_unlink(td, (struct kmq_unlink_args *)args)); #else return (ENOSYS); #endif @@ -795,7 +795,7 @@ int linux_mq_timedsend(struct thread *td, struct linux_mq_timedsend_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_timedsend(td, (struct kmq_timedsend_args *) args); + return (sys_kmq_timedsend(td, (struct kmq_timedsend_args *)args)); #else return (ENOSYS); #endif @@ -805,7 +805,7 @@ int linux_mq_timedreceive(struct thread *td, struct linux_mq_timedreceive_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_timedreceive(td, (struct kmq_timedreceive_args *) args); + return (sys_kmq_timedreceive(td, (struct kmq_timedreceive_args *)args)); #else return (ENOSYS); #endif @@ -815,7 +815,7 @@ int linux_mq_notify(struct thread *td, struct linux_mq_notify_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_notify(td, (struct kmq_notify_args *) args); + return (sys_kmq_notify(td, (struct kmq_notify_args *)args)); #else return (ENOSYS); #endif @@ -825,7 +825,7 @@ int linux_mq_getsetattr(struct thread *td, struct linux_mq_getsetattr_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_setattr(td, (struct kmq_setattr_args *) args); + return (sys_kmq_setattr(td, (struct kmq_setattr_args *)args)); #else return (ENOSYS); #endif From owner-svn-src-all@freebsd.org Sun Apr 28 13:26:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1183157E11E; Sun, 28 Apr 2019 13:26:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54AE292D3E; Sun, 28 Apr 2019 13:26:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22DFFB31C; Sun, 28 Apr 2019 13:26:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SDQtb4017503; Sun, 28 Apr 2019 13:26:55 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SDQt7Y017502; Sun, 28 Apr 2019 13:26:55 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281326.x3SDQt7Y017502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 13:26:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346820 - stable/11/sys/i386/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/11/sys/i386/linux X-SVN-Commit-Revision: 346820 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 54AE292D3E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 13:26:57 -0000 Author: dchagin Date: Sun Apr 28 13:26:55 2019 New Revision: 346820 URL: https://svnweb.freebsd.org/changeset/base/346820 Log: MFC r330822 (by emaste@): imgact_linux.c: use standard indentation. Modified: stable/11/sys/i386/linux/imgact_linux.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/i386/linux/imgact_linux.c ============================================================================== --- stable/11/sys/i386/linux/imgact_linux.c Sun Apr 28 13:23:52 2019 (r346819) +++ stable/11/sys/i386/linux/imgact_linux.c Sun Apr 28 13:26:55 2019 (r346820) @@ -60,176 +60,166 @@ static int exec_linux_imgact(struct image_params *ipar static int exec_linux_imgact(struct image_params *imgp) { - const struct exec *a_out = (const struct exec *) imgp->image_header; - struct vmspace *vmspace; - vm_offset_t vmaddr; - unsigned long virtual_offset, file_offset; - unsigned long bss_size; - ssize_t aresid; - int error; + const struct exec *a_out = (const struct exec *) imgp->image_header; + struct vmspace *vmspace; + vm_offset_t vmaddr; + unsigned long virtual_offset, file_offset; + unsigned long bss_size; + ssize_t aresid; + int error; - if (((a_out->a_magic >> 16) & 0xff) != 0x64) - return (-1); + if (((a_out->a_magic >> 16) & 0xff) != 0x64) + return (-1); - /* - * Set file/virtual offset based on a.out variant. - */ - switch ((int)(a_out->a_magic & 0xffff)) { - case 0413: - virtual_offset = 0; - file_offset = 1024; - break; - case 0314: - virtual_offset = 4096; - file_offset = 0; - break; - default: - return (-1); - } - bss_size = round_page(a_out->a_bss); + /* + * Set file/virtual offset based on a.out variant. + */ + switch ((int)(a_out->a_magic & 0xffff)) { + case 0413: + virtual_offset = 0; + file_offset = 1024; + break; + case 0314: + virtual_offset = 4096; + file_offset = 0; + break; + default: + return (-1); + } + bss_size = round_page(a_out->a_bss); #ifdef DEBUG - printf("imgact: text: %08lx, data: %08lx, bss: %08lx\n", - (u_long)a_out->a_text, (u_long)a_out->a_data, bss_size); + printf("imgact: text: %08lx, data: %08lx, bss: %08lx\n", + (u_long)a_out->a_text, (u_long)a_out->a_data, bss_size); #endif - /* - * Check various fields in header for validity/bounds. - */ - if (a_out->a_entry < virtual_offset || - a_out->a_entry >= virtual_offset + a_out->a_text || - a_out->a_text & PAGE_MASK || a_out->a_data & PAGE_MASK) - return (-1); + /* + * Check various fields in header for validity/bounds. + */ + if (a_out->a_entry < virtual_offset || + a_out->a_entry >= virtual_offset + a_out->a_text || + a_out->a_text & PAGE_MASK || a_out->a_data & PAGE_MASK) + return (-1); - /* text + data can't exceed file size */ - if (a_out->a_data + a_out->a_text > imgp->attr->va_size) - return (EFAULT); - /* - * text/data/bss must not exceed limits - */ - PROC_LOCK(imgp->proc); - if (a_out->a_text > maxtsiz || - a_out->a_data + bss_size > lim_cur_proc(imgp->proc, RLIMIT_DATA) || - racct_set(imgp->proc, RACCT_DATA, a_out->a_data + bss_size) != 0) { + /* text + data can't exceed file size */ + if (a_out->a_data + a_out->a_text > imgp->attr->va_size) + return (EFAULT); + /* + * text/data/bss must not exceed limits + */ + PROC_LOCK(imgp->proc); + if (a_out->a_text > maxtsiz || + a_out->a_data + bss_size > lim_cur_proc(imgp->proc, RLIMIT_DATA) || + racct_set(imgp->proc, RACCT_DATA, a_out->a_data + bss_size) != 0) { + PROC_UNLOCK(imgp->proc); + return (ENOMEM); + } PROC_UNLOCK(imgp->proc); - return (ENOMEM); - } - PROC_UNLOCK(imgp->proc); - VOP_UNLOCK(imgp->vp, 0); + VOP_UNLOCK(imgp->vp, 0); - /* - * Destroy old process VM and create a new one (with a new stack) - */ - error = exec_new_vmspace(imgp, &linux_sysvec); - if (error) - goto fail; - vmspace = imgp->proc->p_vmspace; - - /* - * Check if file_offset page aligned,. - * Currently we cannot handle misaligned file offsets, - * and so we read in the entire image (what a waste). - */ - if (file_offset & PAGE_MASK) { -#ifdef DEBUG - printf("imgact: Non page aligned binary %lu\n", file_offset); -#endif /* - * Map text+data+bss read/write/execute + * Destroy old process VM and create a new one (with a new stack) */ - vmaddr = virtual_offset; - error = vm_map_find(&vmspace->vm_map, NULL, 0, &vmaddr, - a_out->a_text + a_out->a_data + bss_size, 0, VMFS_NO_SPACE, - VM_PROT_ALL, VM_PROT_ALL, 0); + error = exec_new_vmspace(imgp, &linux_sysvec); if (error) - goto fail; - - error = vn_rdwr(UIO_READ, imgp->vp, (void *)vmaddr, file_offset, - a_out->a_text + a_out->a_data, UIO_USERSPACE, 0, - curthread->td_ucred, NOCRED, &aresid, curthread); - if (error != 0) goto fail; - if (aresid != 0) { - error = ENOEXEC; - goto fail; - } + vmspace = imgp->proc->p_vmspace; /* - * remove write enable on the 'text' part + * Check if file_offset page aligned,. + * Currently we cannot handle misaligned file offsets, + * and so we read in the entire image (what a waste). */ - error = vm_map_protect(&vmspace->vm_map, - vmaddr, - vmaddr + a_out->a_text, - VM_PROT_EXECUTE|VM_PROT_READ, - TRUE); - if (error) - goto fail; - } - else { + if (file_offset & PAGE_MASK) { #ifdef DEBUG - printf("imgact: Page aligned binary %lu\n", file_offset); + printf("imgact: Non page aligned binary %lu\n", file_offset); #endif - /* - * Map text+data read/execute - */ - vmaddr = virtual_offset; - error = vm_mmap(&vmspace->vm_map, &vmaddr, - a_out->a_text + a_out->a_data, - VM_PROT_READ | VM_PROT_EXECUTE, - VM_PROT_ALL, - MAP_PRIVATE | MAP_FIXED, - OBJT_VNODE, - imgp->vp, file_offset); - if (error) - goto fail; + /* + * Map text+data+bss read/write/execute + */ + vmaddr = virtual_offset; + error = vm_map_find(&vmspace->vm_map, NULL, 0, &vmaddr, + a_out->a_text + a_out->a_data + bss_size, 0, VMFS_NO_SPACE, + VM_PROT_ALL, VM_PROT_ALL, 0); + if (error) + goto fail; + error = vn_rdwr(UIO_READ, imgp->vp, (void *)vmaddr, file_offset, + a_out->a_text + a_out->a_data, UIO_USERSPACE, 0, + curthread->td_ucred, NOCRED, &aresid, curthread); + if (error != 0) + goto fail; + if (aresid != 0) { + error = ENOEXEC; + goto fail; + } + + /* + * remove write enable on the 'text' part + */ + error = vm_map_protect(&vmspace->vm_map, vmaddr, + vmaddr + a_out->a_text, VM_PROT_EXECUTE|VM_PROT_READ, TRUE); + if (error) + goto fail; + } else { #ifdef DEBUG - printf("imgact: startaddr=%08lx, length=%08lx\n", - (u_long)vmaddr, (u_long)a_out->a_text + (u_long)a_out->a_data); + printf("imgact: Page aligned binary %lu\n", file_offset); #endif - /* - * allow read/write of data - */ - error = vm_map_protect(&vmspace->vm_map, - vmaddr + a_out->a_text, - vmaddr + a_out->a_text + a_out->a_data, - VM_PROT_ALL, - FALSE); - if (error) - goto fail; + /* + * Map text+data read/execute + */ + vmaddr = virtual_offset; + error = vm_mmap(&vmspace->vm_map, &vmaddr, + a_out->a_text + a_out->a_data, + VM_PROT_READ | VM_PROT_EXECUTE, VM_PROT_ALL, + MAP_PRIVATE | MAP_FIXED, OBJT_VNODE, imgp->vp, file_offset); + if (error) + goto fail; - /* - * Allocate anon demand-zeroed area for uninitialized data - */ - if (bss_size != 0) { - vmaddr = virtual_offset + a_out->a_text + a_out->a_data; - error = vm_map_find(&vmspace->vm_map, NULL, 0, &vmaddr, - bss_size, 0, VMFS_NO_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0); - if (error) - goto fail; #ifdef DEBUG - printf("imgact: bssaddr=%08lx, length=%08lx\n", - (u_long)vmaddr, bss_size); + printf("imgact: startaddr=%08lx, length=%08lx\n", + (u_long)vmaddr, + (u_long)a_out->a_text + (u_long)a_out->a_data); #endif + /* + * allow read/write of data + */ + error = vm_map_protect(&vmspace->vm_map, vmaddr + a_out->a_text, + vmaddr + a_out->a_text + a_out->a_data, VM_PROT_ALL, FALSE); + if (error) + goto fail; + /* + * Allocate anon demand-zeroed area for uninitialized data + */ + if (bss_size != 0) { + vmaddr = virtual_offset + a_out->a_text + a_out->a_data; + error = vm_map_find(&vmspace->vm_map, NULL, 0, &vmaddr, + bss_size, 0, VMFS_NO_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0); + if (error) + goto fail; +#ifdef DEBUG + printf("imgact: bssaddr=%08lx, length=%08lx\n", (u_long)vmaddr, + bss_size); +#endif + } } - } - /* Fill in process VM information */ - vmspace->vm_tsize = round_page(a_out->a_text) >> PAGE_SHIFT; - vmspace->vm_dsize = round_page(a_out->a_data + bss_size) >> PAGE_SHIFT; - vmspace->vm_taddr = (caddr_t)(void *)(uintptr_t)virtual_offset; - vmspace->vm_daddr = (caddr_t)(void *)(uintptr_t) - (virtual_offset + a_out->a_text); + /* Fill in process VM information */ + vmspace->vm_tsize = round_page(a_out->a_text) >> PAGE_SHIFT; + vmspace->vm_dsize = round_page(a_out->a_data + bss_size) >> PAGE_SHIFT; + vmspace->vm_taddr = (caddr_t)(void *)(uintptr_t)virtual_offset; + vmspace->vm_daddr = + (caddr_t)(void *)(uintptr_t)(virtual_offset + a_out->a_text); - /* Fill in image_params */ - imgp->interpreted = 0; - imgp->entry_addr = a_out->a_entry; + /* Fill in image_params */ + imgp->interpreted = 0; + imgp->entry_addr = a_out->a_entry; - imgp->proc->p_sysent = &linux_sysvec; + imgp->proc->p_sysent = &linux_sysvec; fail: - vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); - return (error); + vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY); + return (error); } /* From owner-svn-src-all@freebsd.org Sun Apr 28 13:28:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14FCC157E1B1; Sun, 28 Apr 2019 13:28:07 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADE5792E7B; Sun, 28 Apr 2019 13:28:06 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84FA7B322; Sun, 28 Apr 2019 13:28:06 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SDS6sa017619; Sun, 28 Apr 2019 13:28:06 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SDS5UJ017615; Sun, 28 Apr 2019 13:28:05 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281328.x3SDS5UJ017615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 13:28:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346821 - in stable/11/sys: amd64/linux amd64/linux32 i386/linux kern sys X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/11/sys: amd64/linux amd64/linux32 i386/linux kern sys X-SVN-Commit-Revision: 346821 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ADE5792E7B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 13:28:07 -0000 Author: dchagin Date: Sun Apr 28 13:28:05 2019 New Revision: 346821 URL: https://svnweb.freebsd.org/changeset/base/346821 Log: MFC r330866 (by emaste@): Use C99 boolean type for translate_osrel Migrate to modern types before creating MD Linuxolator bits for new architectures. Modified: stable/11/sys/amd64/linux/linux_sysvec.c stable/11/sys/amd64/linux32/linux32_sysvec.c stable/11/sys/i386/linux/linux_sysvec.c stable/11/sys/kern/imgact_elf.c stable/11/sys/sys/imgact_elf.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 13:26:55 2019 (r346820) +++ stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 13:28:05 2019 (r346821) @@ -121,7 +121,7 @@ SET_DECLARE(linux_ioctl_handler_set, struct linux_ioct static register_t * linux_copyout_strings(struct image_params *imgp); static int elf_linux_fixup(register_t **stack_base, struct image_params *iparams); -static boolean_t linux_trans_osrel(const Elf_Note *note, int32_t *osrel); +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_set_syscall_retval(struct thread *td, int error); @@ -845,7 +845,7 @@ SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER static char GNULINUX_ABI_VENDOR[] = "GNU"; static int GNULINUX_ABI_DESC = 0; -static boolean_t +static bool linux_trans_osrel(const Elf_Note *note, int32_t *osrel) { const Elf32_Word *desc; @@ -856,7 +856,7 @@ linux_trans_osrel(const Elf_Note *note, int32_t *osrel desc = (const Elf32_Word *)p; if (desc[0] != GNULINUX_ABI_DESC) - return (FALSE); + return (false); /* * For Linux we encode osrel as follows (see linux_mib.c): @@ -864,7 +864,7 @@ linux_trans_osrel(const Elf_Note *note, int32_t *osrel */ *osrel = desc[1] * 1000000 + desc[2] * 1000 + desc[3]; - return (TRUE); + return (true); } static Elf_Brandnote linux64_brandnote = { Modified: stable/11/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 13:26:55 2019 (r346820) +++ stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 13:28:05 2019 (r346821) @@ -127,7 +127,7 @@ static void linux_sendsig(sig_t catcher, ksiginfo_ static void exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack); static void linux32_fixlimit(struct rlimit *rl, int which); -static boolean_t linux32_trans_osrel(const Elf_Note *note, int32_t *osrel); +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); @@ -1043,7 +1043,7 @@ SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER static char GNU_ABI_VENDOR[] = "GNU"; static int GNULINUX_ABI_DESC = 0; -static boolean_t +static bool linux32_trans_osrel(const Elf_Note *note, int32_t *osrel) { const Elf32_Word *desc; @@ -1054,7 +1054,7 @@ linux32_trans_osrel(const Elf_Note *note, int32_t *osr desc = (const Elf32_Word *)p; if (desc[0] != GNULINUX_ABI_DESC) - return (FALSE); + return (false); /* * For Linux we encode osrel as follows (see linux_mib.c): @@ -1062,7 +1062,7 @@ linux32_trans_osrel(const Elf_Note *note, int32_t *osr */ *osrel = desc[1] * 1000000 + desc[2] * 1000 + desc[3]; - return (TRUE); + return (true); } static Elf_Brandnote linux32_brandnote = { Modified: stable/11/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 13:26:55 2019 (r346820) +++ stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 13:28:05 2019 (r346821) @@ -115,7 +115,7 @@ static void linux_sendsig(sig_t catcher, ksiginfo_ static void exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack); static register_t *linux_copyout_strings(struct image_params *imgp); -static boolean_t linux_trans_osrel(const Elf_Note *note, int32_t *osrel); +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); @@ -1009,7 +1009,7 @@ SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER static char GNU_ABI_VENDOR[] = "GNU"; static int GNULINUX_ABI_DESC = 0; -static boolean_t +static bool linux_trans_osrel(const Elf_Note *note, int32_t *osrel) { const Elf32_Word *desc; @@ -1020,7 +1020,7 @@ linux_trans_osrel(const Elf_Note *note, int32_t *osrel desc = (const Elf32_Word *)p; if (desc[0] != GNULINUX_ABI_DESC) - return (FALSE); + return (false); /* * For Linux we encode osrel as follows (see linux_mib.c): @@ -1028,7 +1028,7 @@ linux_trans_osrel(const Elf_Note *note, int32_t *osrel */ *osrel = desc[1] * 1000000 + desc[2] * 1000 + desc[3]; - return (TRUE); + return (true); } static Elf_Brandnote linux_brandnote = { Modified: stable/11/sys/kern/imgact_elf.c ============================================================================== --- stable/11/sys/kern/imgact_elf.c Sun Apr 28 13:26:55 2019 (r346820) +++ stable/11/sys/kern/imgact_elf.c Sun Apr 28 13:28:05 2019 (r346821) @@ -95,9 +95,9 @@ static int __elfN(load_section)(struct image_params *i caddr_t vmaddr, size_t memsz, size_t filsz, vm_prot_t prot, size_t pagesize); static int __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp); -static boolean_t __elfN(freebsd_trans_osrel)(const Elf_Note *note, +static bool __elfN(freebsd_trans_osrel)(const Elf_Note *note, int32_t *osrel); -static boolean_t kfreebsd_trans_osrel(const Elf_Note *note, int32_t *osrel); +static bool kfreebsd_trans_osrel(const Elf_Note *note, int32_t *osrel); static boolean_t __elfN(check_note)(struct image_params *imgp, Elf_Brandnote *checknote, int32_t *osrel); static vm_prot_t __elfN(trans_prot)(Elf_Word); @@ -154,7 +154,7 @@ Elf_Brandnote __elfN(freebsd_brandnote) = { .trans_osrel = __elfN(freebsd_trans_osrel) }; -static boolean_t +static bool __elfN(freebsd_trans_osrel)(const Elf_Note *note, int32_t *osrel) { uintptr_t p; @@ -163,7 +163,7 @@ __elfN(freebsd_trans_osrel)(const Elf_Note *note, int3 p += roundup2(note->n_namesz, ELF_NOTE_ROUNDSIZE); *osrel = *(const int32_t *)(p); - return (TRUE); + return (true); } static const char GNU_ABI_VENDOR[] = "GNU"; @@ -178,7 +178,7 @@ Elf_Brandnote __elfN(kfreebsd_brandnote) = { .trans_osrel = kfreebsd_trans_osrel }; -static boolean_t +static bool kfreebsd_trans_osrel(const Elf_Note *note, int32_t *osrel) { const Elf32_Word *desc; @@ -189,7 +189,7 @@ kfreebsd_trans_osrel(const Elf_Note *note, int32_t *os desc = (const Elf32_Word *)p; if (desc[0] != GNU_KFREEBSD_ABI_DESC) - return (FALSE); + return (false); /* * Debian GNU/kFreeBSD embed the earliest compatible kernel version @@ -197,7 +197,7 @@ kfreebsd_trans_osrel(const Elf_Note *note, int32_t *os */ *osrel = desc[1] * 100000 + desc[2] * 1000 + desc[3]; - return (TRUE); + return (true); } int Modified: stable/11/sys/sys/imgact_elf.h ============================================================================== --- stable/11/sys/sys/imgact_elf.h Sun Apr 28 13:26:55 2019 (r346820) +++ stable/11/sys/sys/imgact_elf.h Sun Apr 28 13:28:05 2019 (r346821) @@ -61,7 +61,7 @@ typedef struct { Elf_Note hdr; const char * vendor; int flags; - boolean_t (*trans_osrel)(const Elf_Note *, int32_t *); + bool (*trans_osrel)(const Elf_Note *, int32_t *); #define BN_CAN_FETCH_OSREL 0x0001 /* Deprecated. */ #define BN_TRANSLATE_OSREL 0x0002 /* Use trans_osrel to fetch osrel */ /* after checking the image ABI specification, if needed. */ From owner-svn-src-all@freebsd.org Sun Apr 28 13:29:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4F30157E245; Sun, 28 Apr 2019 13:29:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C6D892FBC; Sun, 28 Apr 2019 13:29:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 279D1B323; Sun, 28 Apr 2019 13:29:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SDTUVV017743; Sun, 28 Apr 2019 13:29:30 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SDTThn017740; Sun, 28 Apr 2019 13:29:29 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281329.x3SDTThn017740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 13:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346822 - in stable/11/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/11/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Commit-Revision: 346822 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4C6D892FBC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 13:29:31 -0000 Author: dchagin Date: Sun Apr 28 13:29:29 2019 New Revision: 346822 URL: https://svnweb.freebsd.org/changeset/base/346822 Log: MFC r330927 (by emaste@): Remove stray ; at end of linux_vdso_deinstall() Modified: stable/11/sys/amd64/linux/linux_sysvec.c stable/11/sys/amd64/linux32/linux32_sysvec.c stable/11/sys/i386/linux/linux_sysvec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 13:28:05 2019 (r346821) +++ stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 13:29:29 2019 (r346822) @@ -838,7 +838,7 @@ linux_vdso_deinstall(void *param) { __elfN(linux_shared_page_fini)(linux_shared_page_obj); -}; +} SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t)linux_vdso_deinstall, NULL); Modified: stable/11/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 13:28:05 2019 (r346821) +++ stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 13:29:29 2019 (r346822) @@ -1036,7 +1036,7 @@ linux_vdso_deinstall(void *param) { __elfN(linux_shared_page_fini)(linux_shared_page_obj); -}; +} SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t)linux_vdso_deinstall, NULL); Modified: stable/11/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 13:28:05 2019 (r346821) +++ stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 13:29:29 2019 (r346822) @@ -1002,7 +1002,7 @@ linux_vdso_deinstall(void *param) { __elfN(linux_shared_page_fini)(linux_shared_page_obj); -}; +} SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t)linux_vdso_deinstall, NULL); From owner-svn-src-all@freebsd.org Sun Apr 28 13:33:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3D6D157E5C8; Sun, 28 Apr 2019 13:33:38 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5157B93457; Sun, 28 Apr 2019 13:33:38 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 290B1B4C4; Sun, 28 Apr 2019 13:33:38 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SDXcEq023110; Sun, 28 Apr 2019 13:33:38 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SDXae2023101; Sun, 28 Apr 2019 13:33:36 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281333.x3SDXae2023101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 13:33:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346823 - in stable/11: lib/libsysdecode sys/amd64/linux sys/amd64/linux32 sys/compat/linux sys/conf sys/i386/linux sys/modules/linux sys/modules/linux_common X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/11: lib/libsysdecode sys/amd64/linux sys/amd64/linux32 sys/compat/linux sys/conf sys/i386/linux sys/modules/linux sys/modules/linux_common X-SVN-Commit-Revision: 346823 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5157B93457 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 13:33:38 -0000 Author: dchagin Date: Sun Apr 28 13:33:35 2019 New Revision: 346823 URL: https://svnweb.freebsd.org/changeset/base/346823 Log: MFC r331056: Share a single bsd-linux errno table across MD consumers Three copies of the linuxulator linux_sysvec.c contained identical BSD to Linux errno translation tables, and future work to support other architectures will also use the same table. Move the table to a common file to be used by all. Make it 'const int' to place it in .rodata. (Some existing Linux architectures use MD errno values, but x86 and Arm share the generic set.) This change should introduce no functional change; a followup will add missing errno values. MFC r331057: linux_errno.c: add newer errno values Also introduce a static assert to ensure the list is kept up to date. MFC r331060: Chase r331057 in libsysdecode erno table Added: stable/11/sys/compat/linux/linux_errno.c - copied, changed from r331056, head/sys/compat/linux/linux_errno.c Modified: stable/11/lib/libsysdecode/errno.c stable/11/sys/amd64/linux/linux_sysvec.c stable/11/sys/amd64/linux32/linux32_sysvec.c stable/11/sys/compat/linux/linux_emul.h stable/11/sys/conf/files.amd64 stable/11/sys/conf/files.i386 stable/11/sys/i386/linux/linux_sysvec.c stable/11/sys/modules/linux/Makefile stable/11/sys/modules/linux_common/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libsysdecode/errno.c ============================================================================== --- stable/11/lib/libsysdecode/errno.c Sun Apr 28 13:29:29 2019 (r346822) +++ stable/11/lib/libsysdecode/errno.c Sun Apr 28 13:33:35 2019 (r346823) @@ -41,8 +41,8 @@ __FBSDID("$FreeBSD$"); * Linux syscalls return negative errno's, we do positive and map them * Reference: * FreeBSD: src/sys/sys/errno.h - * Linux: linux-2.6.17.8/include/asm-generic/errno-base.h - * linux-2.6.17.8/include/asm-generic/errno.h + * Linux: include/uapi/asm-generic/errno-base.h + * include/uapi/asm-generic/errno.h */ static int bsd_to_linux_errno[ELAST + 1] = { -0, -1, -2, -3, -4, -5, -6, -7, -8, -9, @@ -54,7 +54,7 @@ static int bsd_to_linux_errno[ELAST + 1] = { -110,-111, -40, -36,-112,-113, -39, -11, -87,-122, -116, -66, -6, -6, -6, -6, -6, -37, -38, -9, -6, -6, -43, -42, -75,-125, -84, -61, -16, -74, - -72, -67, -71 + -72, -67, -71, -1, -1, -131, -130 }; #endif Modified: stable/11/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 13:29:29 2019 (r346822) +++ stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 13:33:35 2019 (r346823) @@ -130,26 +130,6 @@ static void linux_exec_setregs(struct thread *td, stru u_long stack); static int linux_vsyscall(struct thread *td); -/* - * Linux syscalls return negative errno's, we do positive and map them - * Reference: - * FreeBSD: src/sys/sys/errno.h - * Linux: linux-2.6.17.8/include/asm-generic/errno-base.h - * linux-2.6.17.8/include/asm-generic/errno.h - */ -static int bsd_to_linux_errno[ELAST + 1] = { - -0, -1, -2, -3, -4, -5, -6, -7, -8, -9, - -10, -35, -12, -13, -14, -15, -16, -17, -18, -19, - -20, -21, -22, -23, -24, -25, -26, -27, -28, -29, - -30, -31, -32, -33, -34, -11,-115,-114, -88, -89, - -90, -91, -92, -93, -94, -95, -96, -97, -98, -99, - -100,-101,-102,-103,-104,-105,-106,-107,-108,-109, - -110,-111, -40, -36,-112,-113, -39, -11, -87,-122, - -116, -66, -6, -6, -6, -6, -6, -37, -38, -9, - -6, -6, -43, -42, -75,-125, -84, -61, -16, -74, - -72, -67, -71 -}; - #define LINUX_T_UNKNOWN 255 static int _bsd_to_linux_trapcode[] = { LINUX_T_UNKNOWN, /* 0 */ @@ -773,7 +753,7 @@ struct sysentvec elf_linux_sysvec = { .sv_table = linux_sysent, .sv_mask = 0, .sv_errsize = ELAST + 1, - .sv_errtbl = bsd_to_linux_errno, + .sv_errtbl = bsd_to_linux_errno_generic, .sv_transtrap = translate_traps, .sv_fixup = elf_linux_fixup, .sv_sendsig = linux_rt_sendsig, Modified: stable/11/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 13:29:29 2019 (r346822) +++ stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 13:33:35 2019 (r346823) @@ -131,26 +131,6 @@ static bool linux32_trans_osrel(const Elf_Note *note, static void linux_vdso_install(void *param); static void linux_vdso_deinstall(void *param); -/* - * Linux syscalls return negative errno's, we do positive and map them - * Reference: - * FreeBSD: src/sys/sys/errno.h - * Linux: linux-2.6.17.8/include/asm-generic/errno-base.h - * linux-2.6.17.8/include/asm-generic/errno.h - */ -static int bsd_to_linux_errno[ELAST + 1] = { - -0, -1, -2, -3, -4, -5, -6, -7, -8, -9, - -10, -35, -12, -13, -14, -15, -16, -17, -18, -19, - -20, -21, -22, -23, -24, -25, -26, -27, -28, -29, - -30, -31, -32, -33, -34, -11,-115,-114, -88, -89, - -90, -91, -92, -93, -94, -95, -96, -97, -98, -99, - -100,-101,-102,-103,-104,-105,-106,-107,-108,-109, - -110,-111, -40, -36,-112,-113, -39, -11, -87,-122, - -116, -66, -6, -6, -6, -6, -6, -37, -38, -9, - -6, -6, -43, -42, -75,-125, -84, -61, -16, -74, - -72, -67, -71 -}; - #define LINUX_T_UNKNOWN 255 static int _bsd_to_linux_trapcode[] = { LINUX_T_UNKNOWN, /* 0 */ @@ -973,7 +953,7 @@ struct sysentvec elf_linux_sysvec = { .sv_table = linux32_sysent, .sv_mask = 0, .sv_errsize = ELAST + 1, - .sv_errtbl = bsd_to_linux_errno, + .sv_errtbl = bsd_to_linux_errno_generic, .sv_transtrap = translate_traps, .sv_fixup = elf_linux_fixup, .sv_sendsig = linux_sendsig, Modified: stable/11/sys/compat/linux/linux_emul.h ============================================================================== --- stable/11/sys/compat/linux/linux_emul.h Sun Apr 28 13:29:29 2019 (r346822) +++ stable/11/sys/compat/linux/linux_emul.h Sun Apr 28 13:33:35 2019 (r346823) @@ -77,4 +77,6 @@ struct linux_pemuldata { struct linux_pemuldata *pem_find(struct proc *); +extern const int bsd_to_linux_errno_generic[]; + #endif /* !_LINUX_EMUL_H_ */ Copied and modified: stable/11/sys/compat/linux/linux_errno.c (from r331056, head/sys/compat/linux/linux_errno.c) ============================================================================== --- head/sys/compat/linux/linux_errno.c Fri Mar 16 14:46:38 2018 (r331056, copy source) +++ stable/11/sys/compat/linux/linux_errno.c Sun Apr 28 13:33:35 2019 (r346823) @@ -28,14 +28,15 @@ * $FreeBSD$ */ +#include #include /* * Linux syscalls return negative errno's, we do positive and map them * Reference: * FreeBSD: src/sys/sys/errno.h - * Linux: linux-2.6.17.8/include/asm-generic/errno-base.h - * linux-2.6.17.8/include/asm-generic/errno.h + * Linux: include/uapi/asm-generic/errno-base.h + * include/uapi/asm-generic/errno.h */ const int bsd_to_linux_errno_generic[ELAST + 1] = { -0, @@ -140,4 +141,11 @@ const int bsd_to_linux_errno_generic[ELAST + 1] = { -72, -67, -71, + -1, /* ENOTCAPABLE -> EPERM */ + -1, /* ECAPMODE -> EPERM */ + -131, /* ENOTRECOVERABLE */ + -130, /* EOWNERDEAD */ }; + +_Static_assert(ELAST == 96, + "missing errno entries in bsd_to_linux_errno_generic"); Modified: stable/11/sys/conf/files.amd64 ============================================================================== --- stable/11/sys/conf/files.amd64 Sun Apr 28 13:29:29 2019 (r346822) +++ stable/11/sys/conf/files.amd64 Sun Apr 28 13:33:35 2019 (r346823) @@ -623,6 +623,7 @@ amd64/linux32/linux32_support.s optional compat_linux3 amd64/linux32/linux32_sysent.c optional compat_linux32 amd64/linux32/linux32_sysvec.c optional compat_linux32 compat/linux/linux_emul.c optional compat_linux32 +compat/linux/linux_errno.c optional compat_linux32 compat/linux/linux_file.c optional compat_linux32 compat/linux/linux_fork.c optional compat_linux32 compat/linux/linux_futex.c optional compat_linux32 Modified: stable/11/sys/conf/files.i386 ============================================================================== --- stable/11/sys/conf/files.i386 Sun Apr 28 13:29:29 2019 (r346822) +++ stable/11/sys/conf/files.i386 Sun Apr 28 13:33:35 2019 (r346823) @@ -100,6 +100,7 @@ compat/linprocfs/linprocfs.c optional linprocfs compat/linsysfs/linsysfs.c optional linsysfs compat/linux/linux_event.c optional compat_linux compat/linux/linux_emul.c optional compat_linux +compat/linux/linux_errno.c optional compat_linux compat/linux/linux_file.c optional compat_linux compat/linux/linux_fork.c optional compat_linux compat/linux/linux_futex.c optional compat_linux Modified: stable/11/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 13:29:29 2019 (r346822) +++ stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 13:33:35 2019 (r346823) @@ -126,26 +126,6 @@ static eventhandler_tag linux_exit_tag; static eventhandler_tag linux_exec_tag; static eventhandler_tag linux_thread_dtor_tag; -/* - * Linux syscalls return negative errno's, we do positive and map them - * Reference: - * FreeBSD: src/sys/sys/errno.h - * Linux: linux-2.6.17.8/include/asm-generic/errno-base.h - * linux-2.6.17.8/include/asm-generic/errno.h - */ -static int bsd_to_linux_errno[ELAST + 1] = { - -0, -1, -2, -3, -4, -5, -6, -7, -8, -9, - -10, -35, -12, -13, -14, -15, -16, -17, -18, -19, - -20, -21, -22, -23, -24, -25, -26, -27, -28, -29, - -30, -31, -32, -33, -34, -11,-115,-114, -88, -89, - -90, -91, -92, -93, -94, -95, -96, -97, -98, -99, - -100,-101,-102,-103,-104,-105,-106,-107,-108,-109, - -110,-111, -40, -36,-112,-113, -39, -11, -87,-122, - -116, -66, -6, -6, -6, -6, -6, -37, -38, -9, - -6, -6, -43, -42, -75,-125, -84, -61, -16, -74, - -72, -67, -71 -}; - #define LINUX_T_UNKNOWN 255 static int _bsd_to_linux_trapcode[] = { LINUX_T_UNKNOWN, /* 0 */ @@ -905,7 +885,7 @@ struct sysentvec linux_sysvec = { .sv_table = linux_sysent, .sv_mask = 0, .sv_errsize = ELAST + 1, - .sv_errtbl = bsd_to_linux_errno, + .sv_errtbl = bsd_to_linux_errno_generic, .sv_transtrap = translate_traps, .sv_fixup = linux_fixup, .sv_sendsig = linux_sendsig, @@ -942,7 +922,7 @@ struct sysentvec elf_linux_sysvec = { .sv_table = linux_sysent, .sv_mask = 0, .sv_errsize = ELAST + 1, - .sv_errtbl = bsd_to_linux_errno, + .sv_errtbl = bsd_to_linux_errno_generic, .sv_transtrap = translate_traps, .sv_fixup = elf_linux_fixup, .sv_sendsig = linux_sendsig, Modified: stable/11/sys/modules/linux/Makefile ============================================================================== --- stable/11/sys/modules/linux/Makefile Sun Apr 28 13:29:29 2019 (r346822) +++ stable/11/sys/modules/linux/Makefile Sun Apr 28 13:33:35 2019 (r346823) @@ -31,7 +31,7 @@ OBJS= ${VDSO}.so .if ${MACHINE_CPUARCH} == "i386" SRCS+= linux_ptrace.c imgact_linux.c linux_util.c linux_mib.c linux_mmap.c \ - linux_emul.c opt_cpu.h linux.c + linux_emul.c linux_errno.c opt_cpu.h linux.c .endif .if ${MACHINE_CPUARCH} == "i386" Modified: stable/11/sys/modules/linux_common/Makefile ============================================================================== --- stable/11/sys/modules/linux_common/Makefile Sun Apr 28 13:29:29 2019 (r346822) +++ stable/11/sys/modules/linux_common/Makefile Sun Apr 28 13:33:35 2019 (r346823) @@ -4,9 +4,11 @@ KMOD= linux_common SRCS= linux_common.c linux_mib.c linux_mmap.c linux_util.c linux_emul.c \ + linux_errno.c \ linux.c opt_compat.h device_if.h vnode_if.h bus_if.h EXPORT_SYMS= +EXPORT_SYMS+= bsd_to_linux_errno_generic EXPORT_SYMS+= linux_emul_path EXPORT_SYMS+= linux_ioctl_register_handler EXPORT_SYMS+= linux_ioctl_unregister_handler From owner-svn-src-all@freebsd.org Sun Apr 28 13:35:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFC3F157E704; Sun, 28 Apr 2019 13:35:37 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9415A935BE; Sun, 28 Apr 2019 13:35:37 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5EC90B4C5; Sun, 28 Apr 2019 13:35:37 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SDZb5W023258; Sun, 28 Apr 2019 13:35:37 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SDZaKq023255; Sun, 28 Apr 2019 13:35:36 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281335.x3SDZaKq023255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 13:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346824 - in stable/11/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/11/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Commit-Revision: 346824 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9415A935BE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 13:35:38 -0000 Author: dchagin Date: Sun Apr 28 13:35:36 2019 New Revision: 346824 URL: https://svnweb.freebsd.org/changeset/base/346824 Log: MFC r331208 (by emaste@): linux*_sysvec.c: rationalize whitespace and comments There's a fair amount of duplication between MD linuxulator files. Make indentation and comments consistent between the three versions of linux_sysvec.c to reduce diffs when comparing them. Modified: stable/11/sys/amd64/linux/linux_sysvec.c stable/11/sys/amd64/linux32/linux32_sysvec.c stable/11/sys/i386/linux/linux_sysvec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 13:33:35 2019 (r346823) +++ stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 13:35:36 2019 (r346824) @@ -126,6 +126,7 @@ static void linux_vdso_install(void *param); static void linux_vdso_deinstall(void *param); static void linux_set_syscall_retval(struct thread *td, int error); static int linux_fetch_syscall_args(struct thread *td); +static int exec_linux_imgact_try(struct image_params *iparams); static void linux_exec_setregs(struct thread *td, struct image_params *imgp, u_long stack); static int linux_vsyscall(struct thread *td); @@ -668,8 +669,6 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse * be able to modify the interpreter path. We only do this if a Linux * binary is doing the exec, so we do not create an EXEC module for it. */ -static int exec_linux_imgact_try(struct image_params *iparams); - static int exec_linux_imgact_try(struct image_params *imgp) { @@ -684,15 +683,14 @@ exec_linux_imgact_try(struct image_params *imgp) */ if (((const short *)head)[0] == SHELLMAGIC) { /* - * Run our normal shell image activator. If it succeeds - * attempt to use the alternate path for the interpreter. - * If an alternate path is found, use our stringspace - * to store it. + * Run our normal shell image activator. If it succeeds then + * attempt to use the alternate path for the interpreter. If + * an alternate path is found, use our stringspace to store it. */ if ((error = exec_shell_imgact(imgp)) == 0) { linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc), - imgp->interpreter_name, UIO_SYSSPACE, - &rpath, 0, AT_FDCWD); + imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0, + AT_FDCWD); if (rpath != NULL) imgp->args->fname_buf = imgp->interpreter_name = rpath; Modified: stable/11/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 13:33:35 2019 (r346823) +++ stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 13:35:36 2019 (r346824) @@ -124,6 +124,7 @@ static int elf_linux_fixup(register_t **stack_base, struct image_params *iparams); static register_t *linux_copyout_strings(struct image_params *imgp); static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); +static int exec_linux_imgact_try(struct image_params *iparams); static void exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack); static void linux32_fixlimit(struct rlimit *rl, int which); @@ -722,8 +723,6 @@ linux32_fetch_syscall_args(struct thread *td) * be able to modify the interpreter path. We only do this if a Linux * binary is doing the exec, so we do not create an EXEC module for it. */ -static int exec_linux_imgact_try(struct image_params *iparams); - static int exec_linux_imgact_try(struct image_params *imgp) { @@ -732,16 +731,16 @@ exec_linux_imgact_try(struct image_params *imgp) int error = -1; /* - * The interpreter for shell scripts run from a Linux binary needs - * to be located in /compat/linux if possible in order to recursively - * maintain Linux path emulation. - */ + * The interpreter for shell scripts run from a Linux binary needs + * to be located in /compat/linux if possible in order to recursively + * maintain Linux path emulation. + */ if (((const short *)head)[0] == SHELLMAGIC) { /* - * Run our normal shell image activator. If it succeeds attempt - * to use the alternate path for the interpreter. If an - * alternate * path is found, use our stringspace to store it. - */ + * Run our normal shell image activator. If it succeeds then + * attempt to use the alternate path for the interpreter. If + * an alternate path is found, use our stringspace to store it. + */ if ((error = exec_shell_imgact(imgp)) == 0) { linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc), imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0, Modified: stable/11/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 13:33:35 2019 (r346823) +++ stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 13:35:36 2019 (r346824) @@ -112,6 +112,7 @@ static int linux_fixup(register_t **stack_base, static int elf_linux_fixup(register_t **stack_base, struct image_params *iparams); static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); +static int exec_linux_imgact_try(struct image_params *iparams); static void exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack); static register_t *linux_copyout_strings(struct image_params *imgp); @@ -811,35 +812,34 @@ linux_fetch_syscall_args(struct thread *td) * be able to modify the interpreter path. We only do this if a Linux * binary is doing the exec, so we do not create an EXEC module for it. */ -static int exec_linux_imgact_try(struct image_params *iparams); - static int exec_linux_imgact_try(struct image_params *imgp) { - const char *head = (const char *)imgp->image_header; - char *rpath; - int error = -1; + const char *head = (const char *)imgp->image_header; + char *rpath; + int error = -1; - /* - * The interpreter for shell scripts run from a Linux binary needs - * to be located in /compat/linux if possible in order to recursively - * maintain Linux path emulation. - */ - if (((const short *)head)[0] == SHELLMAGIC) { - /* - * Run our normal shell image activator. If it succeeds attempt - * to use the alternate path for the interpreter. If an alternate - * path is found, use our stringspace to store it. - */ - if ((error = exec_shell_imgact(imgp)) == 0) { - linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc), - imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0, AT_FDCWD); - if (rpath != NULL) - imgp->args->fname_buf = - imgp->interpreter_name = rpath; - } - } - return (error); + /* + * The interpreter for shell scripts run from a Linux binary needs + * to be located in /compat/linux if possible in order to recursively + * maintain Linux path emulation. + */ + if (((const short *)head)[0] == SHELLMAGIC) { + /* + * Run our normal shell image activator. If it succeeds then + * attempt to use the alternate path for the interpreter. If + * an alternate path is found, use our stringspace to store it. + */ + if ((error = exec_shell_imgact(imgp)) == 0) { + linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc), + imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0, + AT_FDCWD); + if (rpath != NULL) + imgp->args->fname_buf = + imgp->interpreter_name = rpath; + } + } + return (error); } /* From owner-svn-src-all@freebsd.org Sun Apr 28 13:37:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57F37157E79D; Sun, 28 Apr 2019 13:37:15 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 00014936EF; Sun, 28 Apr 2019 13:37:14 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7526B4C6; Sun, 28 Apr 2019 13:37:14 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SDbEi9023395; Sun, 28 Apr 2019 13:37:14 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SDbD6t023390; Sun, 28 Apr 2019 13:37:13 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281337.x3SDbD6t023390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 13:37:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346825 - in stable/11/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/11/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Commit-Revision: 346825 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 00014936EF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 13:37:15 -0000 Author: dchagin Date: Sun Apr 28 13:37:13 2019 New Revision: 346825 URL: https://svnweb.freebsd.org/changeset/base/346825 Log: MFC r331226 (byu emaste@): Rename linuxulator functions with linux_ prefix It's preferable to have a consistent prefix. This also reduces differences between the three linux*_sysvec.c files. Modified: stable/11/sys/amd64/linux/linux_sysvec.c stable/11/sys/amd64/linux32/linux.h stable/11/sys/amd64/linux32/linux32_sysvec.c stable/11/sys/i386/linux/linux.h stable/11/sys/i386/linux/linux_sysvec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 13:35:36 2019 (r346824) +++ stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 13:37:13 2019 (r346825) @@ -119,14 +119,14 @@ extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler); static register_t * linux_copyout_strings(struct image_params *imgp); -static int elf_linux_fixup(register_t **stack_base, +static int linux_elf_fixup(register_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_set_syscall_retval(struct thread *td, int error); static int linux_fetch_syscall_args(struct thread *td); -static int exec_linux_imgact_try(struct image_params *iparams); +static int linux_exec_imgact_try(struct image_params *iparams); static void linux_exec_setregs(struct thread *td, struct image_params *imgp, u_long stack); static int linux_vsyscall(struct thread *td); @@ -180,7 +180,7 @@ LINUX_VDSO_SYM_CHAR(linux_platform); * MPSAFE */ static int -translate_traps(int signal, int trap_code) +linux_translate_traps(int signal, int trap_code) { if (signal != SIGBUS) @@ -246,7 +246,7 @@ linux_set_syscall_retval(struct thread *td, int error) } static int -elf_linux_fixup(register_t **stack_base, struct image_params *imgp) +linux_fixup_elf(register_t **stack_base, struct image_params *imgp) { Elf_Auxargs *args; Elf_Addr *base; @@ -259,7 +259,7 @@ elf_linux_fixup(register_t **stack_base, struct image_ arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings; KASSERT(curthread->td_proc == imgp->proc, - ("unsafe elf_linux_fixup(), should be curproc")); + ("unsafe linux_fixup_elf(), should be curproc")); base = (Elf64_Addr *)*stack_base; args = (Elf64_Auxargs *)imgp->auxargs; pos = base + (imgp->args->argc + imgp->args->envc + 2); @@ -670,7 +670,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse * binary is doing the exec, so we do not create an EXEC module for it. */ static int -exec_linux_imgact_try(struct image_params *imgp) +linux_exec_imgact_try(struct image_params *imgp) { const char *head = (const char *)imgp->image_header; char *rpath; @@ -752,14 +752,14 @@ struct sysentvec elf_linux_sysvec = { .sv_mask = 0, .sv_errsize = ELAST + 1, .sv_errtbl = bsd_to_linux_errno_generic, - .sv_transtrap = translate_traps, - .sv_fixup = elf_linux_fixup, + .sv_transtrap = linux_translate_traps, + .sv_fixup = linux_fixup_elf, .sv_sendsig = linux_rt_sendsig, .sv_sigcode = &_binary_linux_locore_o_start, .sv_szsigcode = &linux_szsigcode, .sv_name = "Linux ELF64", .sv_coredump = elf64_coredump, - .sv_imgact_try = exec_linux_imgact_try, + .sv_imgact_try = linux_exec_imgact_try, .sv_minsigstksz = LINUX_MINSIGSTKSZ, .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, Modified: stable/11/sys/amd64/linux32/linux.h ============================================================================== --- stable/11/sys/amd64/linux32/linux.h Sun Apr 28 13:35:36 2019 (r346824) +++ stable/11/sys/amd64/linux32/linux.h Sun Apr 28 13:37:13 2019 (r346825) @@ -114,7 +114,7 @@ typedef struct { */ #define LINUX_AT_COUNT 20 /* Count of used aux entry types. * Keep this synchronized with - * elf_linux_fixup() code. + * linux_fixup_elf() code. */ struct l___sysctl_args { Modified: stable/11/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 13:35:36 2019 (r346824) +++ stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 13:37:13 2019 (r346825) @@ -120,12 +120,12 @@ extern struct sysent linux32_sysent[LINUX32_SYS_MAXSYS SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler); -static int elf_linux_fixup(register_t **stack_base, +static int linux_fixup_elf(register_t **stack_base, struct image_params *iparams); static register_t *linux_copyout_strings(struct image_params *imgp); static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); -static int exec_linux_imgact_try(struct image_params *iparams); -static void exec_linux_setregs(struct thread *td, +static int linux_exec_imgact_try(struct image_params *iparams); +static void linux_exec_setregs(struct thread *td, struct image_params *imgp, u_long stack); static void linux32_fixlimit(struct rlimit *rl, int which); static bool linux32_trans_osrel(const Elf_Note *note, int32_t *osrel); @@ -190,7 +190,7 @@ LINUX_VDSO_SYM_CHAR(linux_platform); * MPSAFE */ static int -translate_traps(int signal, int trap_code) +linux_translate_traps(int signal, int trap_code) { if (signal != SIGBUS) return (signal); @@ -206,7 +206,7 @@ translate_traps(int signal, int trap_code) } static int -elf_linux_fixup(register_t **stack_base, struct image_params *imgp) +linux_fixup_elf(register_t **stack_base, struct image_params *imgp) { Elf32_Auxargs *args; Elf32_Addr *base; @@ -217,7 +217,7 @@ elf_linux_fixup(register_t **stack_base, struct image_ arginfo = (struct linux32_ps_strings *)LINUX32_PS_STRINGS; KASSERT(curthread->td_proc == imgp->proc, - ("unsafe elf_linux_fixup(), should be curproc")); + ("unsafe linux_fixup_elf(), should be curproc")); base = (Elf32_Addr *)*stack_base; args = (Elf32_Auxargs *)imgp->auxargs; pos = base + (imgp->args->argc + imgp->args->envc + 2); @@ -724,7 +724,7 @@ linux32_fetch_syscall_args(struct thread *td) * binary is doing the exec, so we do not create an EXEC module for it. */ static int -exec_linux_imgact_try(struct image_params *imgp) +linux_exec_imgact_try(struct image_params *imgp) { const char *head = (const char *)imgp->image_header; char *rpath; @@ -758,7 +758,7 @@ exec_linux_imgact_try(struct image_params *imgp) * XXX copied from ia32_signal.c. */ static void -exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack) +linux_exec_setregs(struct thread *td, struct image_params *imgp, u_long stack) { struct trapframe *regs = td->td_frame; struct pcb *pcb = td->td_pcb; @@ -953,14 +953,14 @@ struct sysentvec elf_linux_sysvec = { .sv_mask = 0, .sv_errsize = ELAST + 1, .sv_errtbl = bsd_to_linux_errno_generic, - .sv_transtrap = translate_traps, - .sv_fixup = elf_linux_fixup, + .sv_transtrap = linux_translate_traps, + .sv_fixup = linux_fixup_elf, .sv_sendsig = linux_sendsig, .sv_sigcode = &_binary_linux32_locore_o_start, .sv_szsigcode = &linux_szsigcode, .sv_name = "Linux ELF32", .sv_coredump = elf32_coredump, - .sv_imgact_try = exec_linux_imgact_try, + .sv_imgact_try = linux_exec_imgact_try, .sv_minsigstksz = LINUX_MINSIGSTKSZ, .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, @@ -969,7 +969,7 @@ struct sysentvec elf_linux_sysvec = { .sv_psstrings = LINUX32_PS_STRINGS, .sv_stackprot = VM_PROT_ALL, .sv_copyout_strings = linux_copyout_strings, - .sv_setregs = exec_linux_setregs, + .sv_setregs = linux_exec_setregs, .sv_fixlimit = linux32_fixlimit, .sv_maxssiz = &linux32_maxssiz, .sv_flags = SV_ABI_LINUX | SV_ILP32 | SV_IA32 | SV_SHP, Modified: stable/11/sys/i386/linux/linux.h ============================================================================== --- stable/11/sys/i386/linux/linux.h Sun Apr 28 13:35:36 2019 (r346824) +++ stable/11/sys/i386/linux/linux.h Sun Apr 28 13:37:13 2019 (r346825) @@ -108,7 +108,7 @@ typedef struct { */ #define LINUX_AT_COUNT 20 /* Count of used aux entry types. * Keep this synchronized with - * elf_linux_fixup() code. + * linux_fixup_elf() code. */ struct l___sysctl_args { Modified: stable/11/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 13:35:36 2019 (r346824) +++ stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 13:37:13 2019 (r346825) @@ -109,11 +109,11 @@ SET_DECLARE(linux_ioctl_handler_set, struct linux_ioct static int linux_fixup(register_t **stack_base, struct image_params *iparams); -static int elf_linux_fixup(register_t **stack_base, +static int linux_fixup_elf(register_t **stack_base, struct image_params *iparams); static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); -static int exec_linux_imgact_try(struct image_params *iparams); -static void exec_linux_setregs(struct thread *td, +static int linux_exec_imgact_try(struct image_params *iparams); +static void linux_exec_setregs(struct thread *td, struct image_params *imgp, u_long stack); static register_t *linux_copyout_strings(struct image_params *imgp); static bool linux_trans_osrel(const Elf_Note *note, int32_t *osrel); @@ -177,7 +177,7 @@ LINUX_VDSO_SYM_INTPTR(linux_vsyscall); * MPSAFE */ static int -translate_traps(int signal, int trap_code) +linux_translate_traps(int signal, int trap_code) { if (signal != SIGBUS) return (signal); @@ -209,7 +209,7 @@ linux_fixup(register_t **stack_base, struct image_para } static int -elf_linux_fixup(register_t **stack_base, struct image_params *imgp) +linux_fixup_elf(register_t **stack_base, struct image_params *imgp) { struct proc *p; Elf32_Auxargs *args; @@ -219,7 +219,7 @@ elf_linux_fixup(register_t **stack_base, struct image_ int issetugid; KASSERT(curthread->td_proc == imgp->proc, - ("unsafe elf_linux_fixup(), should be curproc")); + ("unsafe linux_fixup_elf(), should be curproc")); p = imgp->proc; issetugid = imgp->proc->p_flag & P_SUGID ? 1 : 0; @@ -813,7 +813,7 @@ linux_fetch_syscall_args(struct thread *td) * binary is doing the exec, so we do not create an EXEC module for it. */ static int -exec_linux_imgact_try(struct image_params *imgp) +linux_exec_imgact_try(struct image_params *imgp) { const char *head = (const char *)imgp->image_header; char *rpath; @@ -848,7 +848,7 @@ exec_linux_imgact_try(struct image_params *imgp) * override the exec_setregs default(s) here. */ static void -exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack) +linux_exec_setregs(struct thread *td, struct image_params *imgp, u_long stack) { struct pcb *pcb = td->td_pcb; @@ -886,14 +886,14 @@ struct sysentvec linux_sysvec = { .sv_mask = 0, .sv_errsize = ELAST + 1, .sv_errtbl = bsd_to_linux_errno_generic, - .sv_transtrap = translate_traps, + .sv_transtrap = linux_translate_traps, .sv_fixup = linux_fixup, .sv_sendsig = linux_sendsig, .sv_sigcode = &_binary_linux_locore_o_start, .sv_szsigcode = &linux_szsigcode, .sv_name = "Linux a.out", .sv_coredump = NULL, - .sv_imgact_try = exec_linux_imgact_try, + .sv_imgact_try = linux_exec_imgact_try, .sv_minsigstksz = LINUX_MINSIGSTKSZ, .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, @@ -902,7 +902,7 @@ struct sysentvec linux_sysvec = { .sv_psstrings = PS_STRINGS, .sv_stackprot = VM_PROT_ALL, .sv_copyout_strings = exec_copyout_strings, - .sv_setregs = exec_linux_setregs, + .sv_setregs = linux_exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, .sv_flags = SV_ABI_LINUX | SV_AOUT | SV_IA32 | SV_ILP32, @@ -923,14 +923,14 @@ struct sysentvec elf_linux_sysvec = { .sv_mask = 0, .sv_errsize = ELAST + 1, .sv_errtbl = bsd_to_linux_errno_generic, - .sv_transtrap = translate_traps, - .sv_fixup = elf_linux_fixup, + .sv_transtrap = linux_translate_traps, + .sv_fixup = linux_fixup_elf, .sv_sendsig = linux_sendsig, .sv_sigcode = &_binary_linux_locore_o_start, .sv_szsigcode = &linux_szsigcode, .sv_name = "Linux ELF", .sv_coredump = elf32_coredump, - .sv_imgact_try = exec_linux_imgact_try, + .sv_imgact_try = linux_exec_imgact_try, .sv_minsigstksz = LINUX_MINSIGSTKSZ, .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, @@ -939,7 +939,7 @@ struct sysentvec elf_linux_sysvec = { .sv_psstrings = LINUX_PS_STRINGS, .sv_stackprot = VM_PROT_ALL, .sv_copyout_strings = linux_copyout_strings, - .sv_setregs = exec_linux_setregs, + .sv_setregs = linux_exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, .sv_flags = SV_ABI_LINUX | SV_IA32 | SV_ILP32 | SV_SHP, From owner-svn-src-all@freebsd.org Sun Apr 28 13:38:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5F97157E9B2; Sun, 28 Apr 2019 13:38:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B52093914; Sun, 28 Apr 2019 13:38:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14E96B4C7; Sun, 28 Apr 2019 13:38:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SDcT8B023501; Sun, 28 Apr 2019 13:38:29 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SDcTZn023500; Sun, 28 Apr 2019 13:38:29 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281338.x3SDcTZn023500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 13:38:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346826 - stable/11/sys/amd64/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/11/sys/amd64/linux X-SVN-Commit-Revision: 346826 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3B52093914 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 13:38:30 -0000 Author: dchagin Date: Sun Apr 28 13:38:29 2019 New Revision: 346826 URL: https://svnweb.freebsd.org/changeset/base/346826 Log: MFC r331256 (by emaste@): Make linuxulator fn declaration match definition I accidentally swapped 'linux_fixup_elf' to 'linux_elf_fixup' in amd64's declaration (only), while bringing this change over from git and encountering a conflict. Modified: stable/11/sys/amd64/linux/linux_sysvec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 13:37:13 2019 (r346825) +++ stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 13:38:29 2019 (r346826) @@ -119,7 +119,7 @@ extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler); static register_t * linux_copyout_strings(struct image_params *imgp); -static int linux_elf_fixup(register_t **stack_base, +static int linux_fixup_elf(register_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); From owner-svn-src-all@freebsd.org Sun Apr 28 13:40:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED70E157EAD8; Sun, 28 Apr 2019 13:40:19 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92F6193A68; Sun, 28 Apr 2019 13:40:19 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A207B4CB; Sun, 28 Apr 2019 13:40:19 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SDeJ9U023674; Sun, 28 Apr 2019 13:40:19 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SDeHkn023667; Sun, 28 Apr 2019 13:40:17 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281340.x3SDeHkn023667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 13:40:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346827 - in stable/11: lib/libsysdecode sys/amd64/linux sys/amd64/linux32 sys/compat/linux sys/i386/linux sys/modules/linux_common X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/11: lib/libsysdecode sys/amd64/linux sys/amd64/linux32 sys/compat/linux sys/i386/linux sys/modules/linux_common X-SVN-Commit-Revision: 346827 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 92F6193A68 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 13:40:20 -0000 Author: dchagin Date: Sun Apr 28 13:40:17 2019 New Revision: 346827 URL: https://svnweb.freebsd.org/changeset/base/346827 Log: MFC r331356 (by emaste@): Share Linux errno table with libsysdecode. Added: stable/11/sys/compat/linux/linux_errno.inc - copied unchanged from r331356, head/sys/compat/linux/linux_errno.inc Modified: stable/11/lib/libsysdecode/errno.c stable/11/sys/amd64/linux/linux_sysvec.c stable/11/sys/amd64/linux32/linux32_sysvec.c stable/11/sys/compat/linux/linux_emul.h stable/11/sys/compat/linux/linux_errno.c stable/11/sys/i386/linux/linux_sysvec.c stable/11/sys/modules/linux_common/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libsysdecode/errno.c ============================================================================== --- stable/11/lib/libsysdecode/errno.c Sun Apr 28 13:38:29 2019 (r346826) +++ stable/11/lib/libsysdecode/errno.c Sun Apr 28 13:40:17 2019 (r346827) @@ -37,25 +37,8 @@ __FBSDID("$FreeBSD$"); #include #if defined(__i386__) || defined(__amd64__) -/* - * Linux syscalls return negative errno's, we do positive and map them - * Reference: - * FreeBSD: src/sys/sys/errno.h - * Linux: include/uapi/asm-generic/errno-base.h - * include/uapi/asm-generic/errno.h - */ -static int bsd_to_linux_errno[ELAST + 1] = { - -0, -1, -2, -3, -4, -5, -6, -7, -8, -9, - -10, -35, -12, -13, -14, -15, -16, -17, -18, -19, - -20, -21, -22, -23, -24, -25, -26, -27, -28, -29, - -30, -31, -32, -33, -34, -11,-115,-114, -88, -89, - -90, -91, -92, -93, -94, -95, -96, -97, -98, -99, - -100,-101,-102,-103,-104,-105,-106,-107,-108,-109, - -110,-111, -40, -36,-112,-113, -39, -11, -87,-122, - -116, -66, -6, -6, -6, -6, -6, -37, -38, -9, - -6, -6, -43, -42, -75,-125, -84, -61, -16, -74, - -72, -67, -71, -1, -1, -131, -130 -}; +static +#include #endif #if defined(__aarch64__) || defined(__amd64__) @@ -158,8 +141,8 @@ sysdecode_abi_to_freebsd_errno(enum sysdecode_abi abi, * This is imprecise since it returns the first * matching errno. */ - for (i = 0; i < nitems(bsd_to_linux_errno); i++) { - if (error == bsd_to_linux_errno[i]) + for (i = 0; i < nitems(linux_errtbl); i++) { + if (error == linux_errtbl[i]) return (i); } break; @@ -190,7 +173,7 @@ sysdecode_freebsd_to_abi_errno(enum sysdecode_abi abi, case SYSDECODE_ABI_LINUX: case SYSDECODE_ABI_LINUX32: if (error >= 0 && error <= ELAST) - return (bsd_to_linux_errno[error]); + return (linux_errtbl[error]); break; #endif #if defined(__aarch64__) || defined(__amd64__) Modified: stable/11/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 13:38:29 2019 (r346826) +++ stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 13:40:17 2019 (r346827) @@ -751,7 +751,7 @@ struct sysentvec elf_linux_sysvec = { .sv_table = linux_sysent, .sv_mask = 0, .sv_errsize = ELAST + 1, - .sv_errtbl = bsd_to_linux_errno_generic, + .sv_errtbl = linux_errtbl, .sv_transtrap = linux_translate_traps, .sv_fixup = linux_fixup_elf, .sv_sendsig = linux_rt_sendsig, Modified: stable/11/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 13:38:29 2019 (r346826) +++ stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 13:40:17 2019 (r346827) @@ -952,7 +952,7 @@ struct sysentvec elf_linux_sysvec = { .sv_table = linux32_sysent, .sv_mask = 0, .sv_errsize = ELAST + 1, - .sv_errtbl = bsd_to_linux_errno_generic, + .sv_errtbl = linux_errtbl, .sv_transtrap = linux_translate_traps, .sv_fixup = linux_fixup_elf, .sv_sendsig = linux_sendsig, Modified: stable/11/sys/compat/linux/linux_emul.h ============================================================================== --- stable/11/sys/compat/linux/linux_emul.h Sun Apr 28 13:38:29 2019 (r346826) +++ stable/11/sys/compat/linux/linux_emul.h Sun Apr 28 13:40:17 2019 (r346827) @@ -77,6 +77,6 @@ struct linux_pemuldata { struct linux_pemuldata *pem_find(struct proc *); -extern const int bsd_to_linux_errno_generic[]; +extern const int linux_errtbl[]; #endif /* !_LINUX_EMUL_H_ */ Modified: stable/11/sys/compat/linux/linux_errno.c ============================================================================== --- stable/11/sys/compat/linux/linux_errno.c Sun Apr 28 13:38:29 2019 (r346826) +++ stable/11/sys/compat/linux/linux_errno.c Sun Apr 28 13:40:17 2019 (r346827) @@ -1,151 +1,6 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 1994-1996 Søren Schmidt - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ +/* $FreeBSD$ */ #include #include -/* - * Linux syscalls return negative errno's, we do positive and map them - * Reference: - * FreeBSD: src/sys/sys/errno.h - * Linux: include/uapi/asm-generic/errno-base.h - * include/uapi/asm-generic/errno.h - */ -const int bsd_to_linux_errno_generic[ELAST + 1] = { - -0, - -1, - -2, - -3, - -4, - -5, - -6, - -7, - -8, - -9, - - -10, - -35, /* EDEADLK */ - -12, - -13, - -14, - -15, - -16, - -17, - -18, - -19, - - -20, - -21, - -22, - -23, - -24, - -25, - -26, - -27, - -28, - -29, - - -30, - -31, - -32, - -33, - -34, - -11, /* EAGAIN */ - -115, - -114, - -88, - -89, - - -90, - -91, - -92, - -93, - -94, - -95, - -96, - -97, - -98, - -99, - - -100, - -101, - -102, - -103, - -104, - -105, - -106, - -107, - -108, - -109, - - -110, - -111, - -40, - -36, - -112, - -113, - -39, - -11, - -87, - -122, - - -116, - -66, - -6, /* EBADRPC -> ENXIO */ - -6, /* ERPCMISMATCH -> ENXIO */ - -6, /* EPROGUNAVAIL -> ENXIO */ - -6, /* EPROGMISMATCH -> ENXIO */ - -6, /* EPROCUNAVAIL -> ENXIO */ - -37, - -38, - -9, - - -6, /* EAUTH -> ENXIO */ - -6, /* ENEEDAUTH -> ENXIO */ - -43, - -42, - -75, - -125, - -84, - -61, - -16, /* EDOOFUS -> EBUSY */ - -74, - - -72, - -67, - -71, - -1, /* ENOTCAPABLE -> EPERM */ - -1, /* ECAPMODE -> EPERM */ - -131, /* ENOTRECOVERABLE */ - -130, /* EOWNERDEAD */ -}; - -_Static_assert(ELAST == 96, - "missing errno entries in bsd_to_linux_errno_generic"); +#include Copied: stable/11/sys/compat/linux/linux_errno.inc (from r331356, head/sys/compat/linux/linux_errno.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/compat/linux/linux_errno.inc Sun Apr 28 13:40:17 2019 (r346827, copy of r331356, head/sys/compat/linux/linux_errno.inc) @@ -0,0 +1,148 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 1994-1996 Søren Schmidt + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Linux syscalls return negative errno's, we do positive and map them + * Reference: + * FreeBSD: src/sys/sys/errno.h + * Linux: include/uapi/asm-generic/errno-base.h + * include/uapi/asm-generic/errno.h + */ +const int linux_errtbl[ELAST + 1] = { + -0, + -1, + -2, + -3, + -4, + -5, + -6, + -7, + -8, + -9, + + -10, + -35, /* EDEADLK */ + -12, + -13, + -14, + -15, + -16, + -17, + -18, + -19, + + -20, + -21, + -22, + -23, + -24, + -25, + -26, + -27, + -28, + -29, + + -30, + -31, + -32, + -33, + -34, + -11, /* EAGAIN */ + -115, + -114, + -88, + -89, + + -90, + -91, + -92, + -93, + -94, + -95, + -96, + -97, + -98, + -99, + + -100, + -101, + -102, + -103, + -104, + -105, + -106, + -107, + -108, + -109, + + -110, + -111, + -40, + -36, + -112, + -113, + -39, + -11, + -87, + -122, + + -116, + -66, + -6, /* EBADRPC -> ENXIO */ + -6, /* ERPCMISMATCH -> ENXIO */ + -6, /* EPROGUNAVAIL -> ENXIO */ + -6, /* EPROGMISMATCH -> ENXIO */ + -6, /* EPROCUNAVAIL -> ENXIO */ + -37, + -38, + -9, + + -6, /* EAUTH -> ENXIO */ + -6, /* ENEEDAUTH -> ENXIO */ + -43, + -42, + -75, + -125, + -84, + -61, + -16, /* EDOOFUS -> EBUSY */ + -74, + + -72, + -67, + -71, + -1, /* ENOTCAPABLE -> EPERM */ + -1, /* ECAPMODE -> EPERM */ + -131, /* ENOTRECOVERABLE */ + -130, /* EOWNERDEAD */ +}; + +_Static_assert(ELAST == 96, + "missing errno entries in linux_errtbl"); Modified: stable/11/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 13:38:29 2019 (r346826) +++ stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 13:40:17 2019 (r346827) @@ -885,7 +885,7 @@ struct sysentvec linux_sysvec = { .sv_table = linux_sysent, .sv_mask = 0, .sv_errsize = ELAST + 1, - .sv_errtbl = bsd_to_linux_errno_generic, + .sv_errtbl = linux_errtbl, .sv_transtrap = linux_translate_traps, .sv_fixup = linux_fixup, .sv_sendsig = linux_sendsig, @@ -922,7 +922,7 @@ struct sysentvec elf_linux_sysvec = { .sv_table = linux_sysent, .sv_mask = 0, .sv_errsize = ELAST + 1, - .sv_errtbl = bsd_to_linux_errno_generic, + .sv_errtbl = linux_errtbl, .sv_transtrap = linux_translate_traps, .sv_fixup = linux_fixup_elf, .sv_sendsig = linux_sendsig, Modified: stable/11/sys/modules/linux_common/Makefile ============================================================================== --- stable/11/sys/modules/linux_common/Makefile Sun Apr 28 13:38:29 2019 (r346826) +++ stable/11/sys/modules/linux_common/Makefile Sun Apr 28 13:40:17 2019 (r346827) @@ -8,8 +8,8 @@ SRCS= linux_common.c linux_mib.c linux_mmap.c linux_ut linux.c opt_compat.h device_if.h vnode_if.h bus_if.h EXPORT_SYMS= -EXPORT_SYMS+= bsd_to_linux_errno_generic EXPORT_SYMS+= linux_emul_path +EXPORT_SYMS+= linux_errtbl EXPORT_SYMS+= linux_ioctl_register_handler EXPORT_SYMS+= linux_ioctl_unregister_handler EXPORT_SYMS+= linux_get_osname From owner-svn-src-all@freebsd.org Sun Apr 28 13:41:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2748157EB61; Sun, 28 Apr 2019 13:41:24 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 879B193D48; Sun, 28 Apr 2019 13:41:24 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 636BDB512; Sun, 28 Apr 2019 13:41:24 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SDfO6w025304; Sun, 28 Apr 2019 13:41:24 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SDfNHk025301; Sun, 28 Apr 2019 13:41:23 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281341.x3SDfNHk025301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 13:41:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346828 - in stable/11/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/11/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Commit-Revision: 346828 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 879B193D48 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 13:41:25 -0000 Author: dchagin Date: Sun Apr 28 13:41:23 2019 New Revision: 346828 URL: https://svnweb.freebsd.org/changeset/base/346828 Log: MFC r331462 (by emaste@): Remove redundant cast from Linuxulator SYSINITs. Modified: stable/11/sys/amd64/linux/linux_sysvec.c stable/11/sys/amd64/linux32/linux32_sysvec.c stable/11/sys/i386/linux/linux_sysvec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 13:40:17 2019 (r346827) +++ stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 13:41:23 2019 (r346828) @@ -809,7 +809,7 @@ linux_vdso_install(void *param) (linux_platform - (caddr_t)elf_linux_sysvec.sv_shared_page_base); } SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_ANY, - (sysinit_cfunc_t)linux_vdso_install, NULL); + linux_vdso_install, NULL); static void linux_vdso_deinstall(void *param) @@ -818,7 +818,7 @@ linux_vdso_deinstall(void *param) __elfN(linux_shared_page_fini)(linux_shared_page_obj); } SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER_FIRST, - (sysinit_cfunc_t)linux_vdso_deinstall, NULL); + linux_vdso_deinstall, NULL); static char GNULINUX_ABI_VENDOR[] = "GNU"; static int GNULINUX_ABI_DESC = 0; Modified: stable/11/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 13:40:17 2019 (r346827) +++ stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 13:41:23 2019 (r346828) @@ -1008,7 +1008,7 @@ linux_vdso_install(void *param) (linux_platform - (caddr_t)elf_linux_sysvec.sv_shared_page_base); } SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_ANY, - (sysinit_cfunc_t)linux_vdso_install, NULL); + linux_vdso_install, NULL); static void linux_vdso_deinstall(void *param) @@ -1017,7 +1017,7 @@ linux_vdso_deinstall(void *param) __elfN(linux_shared_page_fini)(linux_shared_page_obj); } SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER_FIRST, - (sysinit_cfunc_t)linux_vdso_deinstall, NULL); + linux_vdso_deinstall, NULL); static char GNU_ABI_VENDOR[] = "GNU"; static int GNULINUX_ABI_DESC = 0; Modified: stable/11/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 13:40:17 2019 (r346827) +++ stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 13:41:23 2019 (r346828) @@ -975,7 +975,7 @@ linux_vdso_install(void *param) elf_linux_sysvec.sv_shared_page_obj = linux_shared_page_obj; } SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_ANY, - (sysinit_cfunc_t)linux_vdso_install, NULL); + linux_vdso_install, NULL); static void linux_vdso_deinstall(void *param) @@ -984,7 +984,7 @@ linux_vdso_deinstall(void *param) __elfN(linux_shared_page_fini)(linux_shared_page_obj); } SYSUNINIT(elf_linux_vdso_uninit, SI_SUB_EXEC, SI_ORDER_FIRST, - (sysinit_cfunc_t)linux_vdso_deinstall, NULL); + linux_vdso_deinstall, NULL); static char GNU_ABI_VENDOR[] = "GNU"; static int GNULINUX_ABI_DESC = 0; From owner-svn-src-all@freebsd.org Sun Apr 28 13:42:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67272157ED58; Sun, 28 Apr 2019 13:42:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D30493F58; Sun, 28 Apr 2019 13:42:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDC0AB669; Sun, 28 Apr 2019 13:42:35 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SDgZ7C028394; Sun, 28 Apr 2019 13:42:35 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SDgYIM028388; Sun, 28 Apr 2019 13:42:34 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281342.x3SDgYIM028388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 13:42:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346829 - in stable/11/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/11/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Commit-Revision: 346829 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0D30493F58 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 13:42:36 -0000 Author: dchagin Date: Sun Apr 28 13:42:34 2019 New Revision: 346829 URL: https://svnweb.freebsd.org/changeset/base/346829 Log: MFC r332333 (by emaste@): linuxulator: deduplicate linux_exec_imgact_try Previously linuxulator had three identical copies of linux_exec_imgact_try. Deduplicate before adding another arch to linuxulator. Modified: stable/11/sys/amd64/linux/linux_sysvec.c stable/11/sys/amd64/linux32/linux32_sysvec.c stable/11/sys/compat/linux/linux_emul.c stable/11/sys/compat/linux/linux_emul.h stable/11/sys/i386/linux/linux_sysvec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 13:41:23 2019 (r346828) +++ stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 13:42:34 2019 (r346829) @@ -87,12 +87,6 @@ __FBSDID("$FreeBSD$"); MODULE_VERSION(linux64, 1); -#if BYTE_ORDER == LITTLE_ENDIAN -#define SHELLMAGIC 0x2123 /* #! */ -#else -#define SHELLMAGIC 0x2321 -#endif - #if defined(DEBUG) SYSCTL_PROC(_compat_linux, OID_AUTO, debug, CTLTYPE_STRING | CTLFLAG_RW, @@ -126,7 +120,6 @@ static void linux_vdso_install(void *param); static void linux_vdso_deinstall(void *param); static void linux_set_syscall_retval(struct thread *td, int error); static int linux_fetch_syscall_args(struct thread *td); -static int linux_exec_imgact_try(struct image_params *iparams); static void linux_exec_setregs(struct thread *td, struct image_params *imgp, u_long stack); static int linux_vsyscall(struct thread *td); @@ -661,42 +654,6 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse set_pcb_flags(td->td_pcb, PCB_FULL_IRET); PROC_LOCK(p); mtx_lock(&psp->ps_mtx); -} - -/* - * If a Linux binary is exec'ing something, try this image activator - * first. We override standard shell script execution in order to - * be able to modify the interpreter path. We only do this if a Linux - * binary is doing the exec, so we do not create an EXEC module for it. - */ -static int -linux_exec_imgact_try(struct image_params *imgp) -{ - const char *head = (const char *)imgp->image_header; - char *rpath; - int error = -1; - - /* - * The interpreter for shell scripts run from a Linux binary needs - * to be located in /compat/linux if possible in order to recursively - * maintain Linux path emulation. - */ - if (((const short *)head)[0] == SHELLMAGIC) { - /* - * Run our normal shell image activator. If it succeeds then - * attempt to use the alternate path for the interpreter. If - * an alternate path is found, use our stringspace to store it. - */ - if ((error = exec_shell_imgact(imgp)) == 0) { - linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc), - imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0, - AT_FDCWD); - if (rpath != NULL) - imgp->args->fname_buf = - imgp->interpreter_name = rpath; - } - } - return (error); } #define LINUX_VSYSCALL_START (-10UL << 20) Modified: stable/11/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 13:41:23 2019 (r346828) +++ stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 13:42:34 2019 (r346829) @@ -95,12 +95,6 @@ MODULE_VERSION(linux, 1); suword32(pos++, val); \ } while (0) -#if BYTE_ORDER == LITTLE_ENDIAN -#define SHELLMAGIC 0x2123 /* #! */ -#else -#define SHELLMAGIC 0x2321 -#endif - /* * Allow the sendsig functions to use the ldebug() facility even though they * are not syscalls themselves. Map them to syscall 0. This is slightly less @@ -124,7 +118,6 @@ static int linux_fixup_elf(register_t **stack_base, struct image_params *iparams); static register_t *linux_copyout_strings(struct image_params *imgp); static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); -static int linux_exec_imgact_try(struct image_params *iparams); static void linux_exec_setregs(struct thread *td, struct image_params *imgp, u_long stack); static void linux32_fixlimit(struct rlimit *rl, int which); @@ -715,42 +708,6 @@ linux32_fetch_syscall_args(struct thread *td) td->td_retval[1] = frame->tf_rdx; return (0); -} - -/* - * If a Linux binary is exec'ing something, try this image activator - * first. We override standard shell script execution in order to - * be able to modify the interpreter path. We only do this if a Linux - * binary is doing the exec, so we do not create an EXEC module for it. - */ -static int -linux_exec_imgact_try(struct image_params *imgp) -{ - const char *head = (const char *)imgp->image_header; - char *rpath; - int error = -1; - - /* - * The interpreter for shell scripts run from a Linux binary needs - * to be located in /compat/linux if possible in order to recursively - * maintain Linux path emulation. - */ - if (((const short *)head)[0] == SHELLMAGIC) { - /* - * Run our normal shell image activator. If it succeeds then - * attempt to use the alternate path for the interpreter. If - * an alternate path is found, use our stringspace to store it. - */ - if ((error = exec_shell_imgact(imgp)) == 0) { - linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc), - imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0, - AT_FDCWD); - if (rpath != NULL) - imgp->args->fname_buf = - imgp->interpreter_name = rpath; - } - } - return (error); } /* Modified: stable/11/sys/compat/linux/linux_emul.c ============================================================================== --- stable/11/sys/compat/linux/linux_emul.c Sun Apr 28 13:41:23 2019 (r346828) +++ stable/11/sys/compat/linux/linux_emul.c Sun Apr 28 13:42:34 2019 (r346829) @@ -1,6 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * + * Copyright (c) 1994-1996 Søren Schmidt * Copyright (c) 2006 Roman Divacky * Copyright (c) 2013 Dmitry Chagin * All rights reserved. @@ -32,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -48,6 +50,11 @@ __FBSDID("$FreeBSD$"); #include #include +#if BYTE_ORDER == LITTLE_ENDIAN +#define SHELLMAGIC 0x2123 /* #! */ +#else +#define SHELLMAGIC 0x2321 +#endif /* * This returns reference to the thread emuldata entry (if found) @@ -166,6 +173,42 @@ linux_proc_exit(void *arg __unused, struct proc *p) sx_destroy(&pem->pem_sx); free(pem, M_LINUX); +} + +/* + * If a Linux binary is exec'ing something, try this image activator + * first. We override standard shell script execution in order to + * be able to modify the interpreter path. We only do this if a Linux + * binary is doing the exec, so we do not create an EXEC module for it. + */ +int +linux_exec_imgact_try(struct image_params *imgp) +{ + const char *head = (const char *)imgp->image_header; + char *rpath; + int error = -1; + + /* + * The interpreter for shell scripts run from a Linux binary needs + * to be located in /compat/linux if possible in order to recursively + * maintain Linux path emulation. + */ + if (((const short *)head)[0] == SHELLMAGIC) { + /* + * Run our normal shell image activator. If it succeeds attempt + * to use the alternate path for the interpreter. If an + * alternate path is found, use our stringspace to store it. + */ + if ((error = exec_shell_imgact(imgp)) == 0) { + linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc), + imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0, + AT_FDCWD); + if (rpath != NULL) + imgp->args->fname_buf = + imgp->interpreter_name = rpath; + } + } + return (error); } int Modified: stable/11/sys/compat/linux/linux_emul.h ============================================================================== --- stable/11/sys/compat/linux/linux_emul.h Sun Apr 28 13:41:23 2019 (r346828) +++ stable/11/sys/compat/linux/linux_emul.h Sun Apr 28 13:42:34 2019 (r346829) @@ -49,6 +49,7 @@ struct linux_emuldata { struct linux_emuldata *em_find(struct thread *); +int linux_exec_imgact_try(struct image_params *); void linux_proc_init(struct thread *, struct thread *, int); void linux_proc_exit(void *, struct proc *); void linux_schedtail(struct thread *); Modified: stable/11/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 13:41:23 2019 (r346828) +++ stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 13:42:34 2019 (r346829) @@ -76,12 +76,6 @@ __FBSDID("$FreeBSD$"); MODULE_VERSION(linux, 1); -#if BYTE_ORDER == LITTLE_ENDIAN -#define SHELLMAGIC 0x2123 /* #! */ -#else -#define SHELLMAGIC 0x2321 -#endif - #if defined(DEBUG) SYSCTL_PROC(_compat_linux, OID_AUTO, debug, CTLTYPE_STRING | CTLFLAG_RW, 0, 0, linux_sysctl_debug, "A", "Linux debugging control"); @@ -112,7 +106,6 @@ static int linux_fixup(register_t **stack_base, static int linux_fixup_elf(register_t **stack_base, struct image_params *iparams); static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); -static int linux_exec_imgact_try(struct image_params *iparams); static void linux_exec_setregs(struct thread *td, struct image_params *imgp, u_long stack); static register_t *linux_copyout_strings(struct image_params *imgp); @@ -804,42 +797,6 @@ linux_fetch_syscall_args(struct thread *td) td->td_retval[1] = frame->tf_edx; return (0); -} - -/* - * If a Linux binary is exec'ing something, try this image activator - * first. We override standard shell script execution in order to - * be able to modify the interpreter path. We only do this if a Linux - * binary is doing the exec, so we do not create an EXEC module for it. - */ -static int -linux_exec_imgact_try(struct image_params *imgp) -{ - const char *head = (const char *)imgp->image_header; - char *rpath; - int error = -1; - - /* - * The interpreter for shell scripts run from a Linux binary needs - * to be located in /compat/linux if possible in order to recursively - * maintain Linux path emulation. - */ - if (((const short *)head)[0] == SHELLMAGIC) { - /* - * Run our normal shell image activator. If it succeeds then - * attempt to use the alternate path for the interpreter. If - * an alternate path is found, use our stringspace to store it. - */ - if ((error = exec_shell_imgact(imgp)) == 0) { - linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc), - imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0, - AT_FDCWD); - if (rpath != NULL) - imgp->args->fname_buf = - imgp->interpreter_name = rpath; - } - } - return (error); } /* From owner-svn-src-all@freebsd.org Sun Apr 28 13:43:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13425157EEA8; Sun, 28 Apr 2019 13:43:59 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEE09940D2; Sun, 28 Apr 2019 13:43:58 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AF39B66C; Sun, 28 Apr 2019 13:43:58 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SDhw4V028510; Sun, 28 Apr 2019 13:43:58 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SDhwoP028509; Sun, 28 Apr 2019 13:43:58 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281343.x3SDhwoP028509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 13:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346830 - stable/11/sys/compat/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/11/sys/compat/linux X-SVN-Commit-Revision: 346830 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AEE09940D2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 13:43:59 -0000 Author: dchagin Date: Sun Apr 28 13:43:58 2019 New Revision: 346830 URL: https://svnweb.freebsd.org/changeset/base/346830 Log: MFC r332893 (by emaste@): Map FreeBSD EDOOFUS to Linux EINVAL Previously EDOOFUS mapped to EBUSY. EINVAL seems more appropriate. Modified: stable/11/sys/compat/linux/linux_errno.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_errno.inc ============================================================================== --- stable/11/sys/compat/linux/linux_errno.inc Sun Apr 28 13:42:34 2019 (r346829) +++ stable/11/sys/compat/linux/linux_errno.inc Sun Apr 28 13:43:58 2019 (r346830) @@ -132,7 +132,7 @@ const int linux_errtbl[ELAST + 1] = { -125, -84, -61, - -16, /* EDOOFUS -> EBUSY */ + -22, /* EDOOFUS -> EINVAL */ -74, -72, From owner-svn-src-all@freebsd.org Sun Apr 28 13:45:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E11A157EF42; Sun, 28 Apr 2019 13:45:19 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20A8C9421C; Sun, 28 Apr 2019 13:45:19 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF333B672; Sun, 28 Apr 2019 13:45:18 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SDjICw028654; Sun, 28 Apr 2019 13:45:18 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SDjIko028653; Sun, 28 Apr 2019 13:45:18 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281345.x3SDjIko028653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 13:45:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346831 - stable/11/sys/compat/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/11/sys/compat/linux X-SVN-Commit-Revision: 346831 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 20A8C9421C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 13:45:19 -0000 Author: dchagin Date: Sun Apr 28 13:45:18 2019 New Revision: 346831 URL: https://svnweb.freebsd.org/changeset/base/346831 Log: MFC r335200 (by emaste@): Correct debug control for linuxulator faccessat The Linuxulator provides per-syscall debug control via the compat.linux.debug sysctl. There's generally a 1:1 mapping between sysctl setting and syscall, but faccessat was controlled by the access setting, perhaps due to copy-paste. Modified: stable/11/sys/compat/linux/linux_file.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_file.c ============================================================================== --- stable/11/sys/compat/linux/linux_file.c Sun Apr 28 13:43:58 2019 (r346830) +++ stable/11/sys/compat/linux/linux_file.c Sun Apr 28 13:45:18 2019 (r346831) @@ -569,7 +569,7 @@ linux_faccessat(struct thread *td, struct linux_facces LCONVPATHEXIST_AT(td, args->filename, &path, dfd); #ifdef DEBUG - if (ldebug(access)) + if (ldebug(faccessat)) printf(ARGS(access, "%s, %d"), path, args->amode); #endif From owner-svn-src-all@freebsd.org Sun Apr 28 14:03:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FE78157F38C; Sun, 28 Apr 2019 14:03:35 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D4A894A65; Sun, 28 Apr 2019 14:03:34 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 724C6B9FF; Sun, 28 Apr 2019 14:03:34 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SE3YDA038886; Sun, 28 Apr 2019 14:03:34 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SE3WFh038877; Sun, 28 Apr 2019 14:03:32 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281403.x3SE3WFh038877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 14:03:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346832 - in stable/11/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/11/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Commit-Revision: 346832 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9D4A894A65 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 14:03:35 -0000 Author: dchagin Date: Sun Apr 28 14:03:32 2019 New Revision: 346832 URL: https://svnweb.freebsd.org/changeset/base/346832 Log: MFC r335201 (by emaste@): linuxulator: do not include legacy syscalls on arm64 Existing linuxulator platforms (i386, amd64) support legacy syscalls, such as non-*at ones like open, but arm64 and other new platforms do not. Wrap these in #ifdef LINUX_LEGACY_SYSCALLS, #defined in the MD linux.h files. We may need finer grained control in the future but this is sufficient for now. Modified: stable/11/sys/amd64/linux/linux.h stable/11/sys/amd64/linux32/linux.h stable/11/sys/compat/linux/linux_event.c stable/11/sys/compat/linux/linux_file.c stable/11/sys/compat/linux/linux_fork.c stable/11/sys/compat/linux/linux_misc.c stable/11/sys/compat/linux/linux_stats.c stable/11/sys/compat/linux/linux_sysctl.c stable/11/sys/i386/linux/linux.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux.h ============================================================================== --- stable/11/sys/amd64/linux/linux.h Sun Apr 28 13:45:18 2019 (r346831) +++ stable/11/sys/amd64/linux/linux.h Sun Apr 28 14:03:32 2019 (r346832) @@ -35,6 +35,8 @@ #include #include +#define LINUX_LEGACY_SYSCALLS + /* * debugging support */ Modified: stable/11/sys/amd64/linux32/linux.h ============================================================================== --- stable/11/sys/amd64/linux32/linux.h Sun Apr 28 13:45:18 2019 (r346831) +++ stable/11/sys/amd64/linux32/linux.h Sun Apr 28 14:03:32 2019 (r346832) @@ -36,6 +36,8 @@ #include #include +#define LINUX_LEGACY_SYSCALLS + /* * debugging support */ Modified: stable/11/sys/compat/linux/linux_event.c ============================================================================== --- stable/11/sys/compat/linux/linux_event.c Sun Apr 28 13:45:18 2019 (r346831) +++ stable/11/sys/compat/linux/linux_event.c Sun Apr 28 14:03:32 2019 (r346832) @@ -263,6 +263,7 @@ epoll_create_common(struct thread *td, int flags) return (0); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_epoll_create(struct thread *td, struct linux_epoll_create_args *args) { @@ -276,6 +277,7 @@ linux_epoll_create(struct thread *td, struct linux_epo return (epoll_create_common(td, 0)); } +#endif int linux_epoll_create1(struct thread *td, struct linux_epoll_create1_args *args) @@ -616,6 +618,7 @@ leave1: return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_epoll_wait(struct thread *td, struct linux_epoll_wait_args *args) { @@ -623,6 +626,7 @@ linux_epoll_wait(struct thread *td, struct linux_epoll return (linux_epoll_wait_common(td, args->epfd, args->events, args->maxevents, args->timeout, NULL)); } +#endif int linux_epoll_pwait(struct thread *td, struct linux_epoll_pwait_args *args) @@ -707,12 +711,14 @@ eventfd_create(struct thread *td, uint32_t initval, in return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_eventfd(struct thread *td, struct linux_eventfd_args *args) { return (eventfd_create(td, args->initval, 0)); } +#endif int linux_eventfd2(struct thread *td, struct linux_eventfd2_args *args) Modified: stable/11/sys/compat/linux/linux_file.c ============================================================================== --- stable/11/sys/compat/linux/linux_file.c Sun Apr 28 13:45:18 2019 (r346831) +++ stable/11/sys/compat/linux/linux_file.c Sun Apr 28 14:03:32 2019 (r346832) @@ -68,6 +68,7 @@ static int linux_common_open(struct thread *, int, cha static int linux_getdents_error(struct thread *, int, int); +#ifdef LINUX_LEGACY_SYSCALLS int linux_creat(struct thread *td, struct linux_creat_args *args) { @@ -84,8 +85,8 @@ linux_creat(struct thread *td, struct linux_creat_args LFREEPATH(path); return (error); } +#endif - static int linux_common_open(struct thread *td, int dirfd, char *path, int l_flags, int mode) { @@ -166,7 +167,11 @@ linux_common_open(struct thread *td, int dirfd, char * done: #ifdef DEBUG +#ifdef LINUX_LEGACY_SYSCALLS if (ldebug(open)) +#else + if (ldebug(openat)) +#endif printf(LMSG("open returns error %d"), error); #endif LFREEPATH(path); @@ -192,6 +197,7 @@ linux_openat(struct thread *td, struct linux_openat_ar return (linux_common_open(td, dfd, path, args->flags, args->mode)); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_open(struct thread *td, struct linux_open_args *args) { @@ -208,6 +214,7 @@ linux_open(struct thread *td, struct linux_open_args * #endif return (linux_common_open(td, AT_FDCWD, path, args->flags, args->mode)); } +#endif int linux_lseek(struct thread *td, struct linux_lseek_args *args) @@ -317,6 +324,7 @@ struct l_dirent64 { #define LINUX_RECLEN64_RATIO(X) X * offsetof(struct dirent, d_name) / \ offsetof(struct l_dirent64, d_name); +#ifdef LINUX_LEGACY_SYSCALLS int linux_getdents(struct thread *td, struct linux_getdents_args *args) { @@ -397,6 +405,7 @@ out1: free(buf, M_TEMP); return (error); } +#endif int linux_getdents64(struct thread *td, struct linux_getdents64_args *args) @@ -532,6 +541,7 @@ out: * These exist mainly for hooks for doing /compat/linux translation. */ +#ifdef LINUX_LEGACY_SYSCALLS int linux_access(struct thread *td, struct linux_access_args *args) { @@ -554,6 +564,7 @@ linux_access(struct thread *td, struct linux_access_ar return (error); } +#endif int linux_faccessat(struct thread *td, struct linux_faccessat_args *args) @@ -579,6 +590,7 @@ linux_faccessat(struct thread *td, struct linux_facces return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_unlink(struct thread *td, struct linux_unlink_args *args) { @@ -605,6 +617,7 @@ linux_unlink(struct thread *td, struct linux_unlink_ar LFREEPATH(path); return (error); } +#endif int linux_unlinkat(struct thread *td, struct linux_unlinkat_args *args) @@ -654,6 +667,7 @@ linux_chdir(struct thread *td, struct linux_chdir_args return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_chmod(struct thread *td, struct linux_chmod_args *args) { @@ -671,6 +685,7 @@ linux_chmod(struct thread *td, struct linux_chmod_args LFREEPATH(path); return (error); } +#endif int linux_fchmodat(struct thread *td, struct linux_fchmodat_args *args) @@ -691,6 +706,7 @@ linux_fchmodat(struct thread *td, struct linux_fchmoda return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_mkdir(struct thread *td, struct linux_mkdir_args *args) { @@ -707,6 +723,7 @@ linux_mkdir(struct thread *td, struct linux_mkdir_args LFREEPATH(path); return (error); } +#endif int linux_mkdirat(struct thread *td, struct linux_mkdirat_args *args) @@ -726,6 +743,7 @@ linux_mkdirat(struct thread *td, struct linux_mkdirat_ return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_rmdir(struct thread *td, struct linux_rmdir_args *args) { @@ -766,6 +784,7 @@ linux_rename(struct thread *td, struct linux_rename_ar LFREEPATH(to); return (error); } +#endif int linux_renameat(struct thread *td, struct linux_renameat_args *args) @@ -793,6 +812,7 @@ linux_renameat(struct thread *td, struct linux_renamea return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_symlink(struct thread *td, struct linux_symlink_args *args) { @@ -816,6 +836,7 @@ linux_symlink(struct thread *td, struct linux_symlink_ LFREEPATH(to); return (error); } +#endif int linux_symlinkat(struct thread *td, struct linux_symlinkat_args *args) @@ -843,6 +864,7 @@ linux_symlinkat(struct thread *td, struct linux_symlin return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_readlink(struct thread *td, struct linux_readlink_args *args) { @@ -861,6 +883,7 @@ linux_readlink(struct thread *td, struct linux_readlin LFREEPATH(name); return (error); } +#endif int linux_readlinkat(struct thread *td, struct linux_readlinkat_args *args) @@ -928,6 +951,7 @@ linux_ftruncate(struct thread *td, struct linux_ftrunc return (kern_ftruncate(td, args->fd, args->length)); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_link(struct thread *td, struct linux_link_args *args) { @@ -952,6 +976,7 @@ linux_link(struct thread *td, struct linux_link_args * LFREEPATH(to); return (error); } +#endif int linux_linkat(struct thread *td, struct linux_linkat_args *args) @@ -1151,6 +1176,7 @@ linux_oldumount(struct thread *td, struct linux_oldumo } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ +#ifdef LINUX_LEGACY_SYSCALLS int linux_umount(struct thread *td, struct linux_umount_args *args) { @@ -1160,6 +1186,7 @@ linux_umount(struct thread *td, struct linux_umount_ar bsd.flags = args->flags; /* XXX correct? */ return (sys_unmount(td, &bsd)); } +#endif /* * fcntl family of syscalls @@ -1472,6 +1499,7 @@ linux_fcntl64(struct thread *td, struct linux_fcntl64_ } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ +#ifdef LINUX_LEGACY_SYSCALLS int linux_chown(struct thread *td, struct linux_chown_args *args) { @@ -1489,6 +1517,7 @@ linux_chown(struct thread *td, struct linux_chown_args LFREEPATH(path); return (error); } +#endif int linux_fchownat(struct thread *td, struct linux_fchownat_args *args) @@ -1515,6 +1544,7 @@ linux_fchownat(struct thread *td, struct linux_fchowna return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_lchown(struct thread *td, struct linux_lchown_args *args) { @@ -1532,6 +1562,7 @@ linux_lchown(struct thread *td, struct linux_lchown_ar LFREEPATH(path); return (error); } +#endif static int convert_fadvice(int advice) @@ -1580,6 +1611,7 @@ linux_fadvise64_64(struct thread *td, struct linux_fad } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ +#ifdef LINUX_LEGACY_SYSCALLS int linux_pipe(struct thread *td, struct linux_pipe_args *args) { @@ -1603,6 +1635,7 @@ linux_pipe(struct thread *td, struct linux_pipe_args * return (error); } +#endif int linux_pipe2(struct thread *td, struct linux_pipe2_args *args) Modified: stable/11/sys/compat/linux/linux_fork.c ============================================================================== --- stable/11/sys/compat/linux/linux_fork.c Sun Apr 28 13:45:18 2019 (r346831) +++ stable/11/sys/compat/linux/linux_fork.c Sun Apr 28 14:03:32 2019 (r346832) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef LINUX_LEGACY_SYSCALLS int linux_fork(struct thread *td, struct linux_fork_args *args) { @@ -134,6 +135,7 @@ linux_vfork(struct thread *td, struct linux_vfork_args return (0); } +#endif static int linux_clone_proc(struct thread *td, struct linux_clone_args *args) Modified: stable/11/sys/compat/linux/linux_misc.c ============================================================================== --- stable/11/sys/compat/linux/linux_misc.c Sun Apr 28 13:45:18 2019 (r346831) +++ stable/11/sys/compat/linux/linux_misc.c Sun Apr 28 14:03:32 2019 (r346832) @@ -189,6 +189,7 @@ linux_sysinfo(struct thread *td, struct linux_sysinfo_ return (copyout(&sysinfo, args->info, sizeof(sysinfo))); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_alarm(struct thread *td, struct linux_alarm_args *args) { @@ -223,6 +224,7 @@ linux_alarm(struct thread *td, struct linux_alarm_args td->td_retval[0] = old_it.it_value.tv_sec; return (0); } +#endif int linux_brk(struct thread *td, struct linux_brk_args *args) @@ -492,6 +494,7 @@ cleanup: #endif /* __i386__ */ +#ifdef LINUX_LEGACY_SYSCALLS int linux_select(struct thread *td, struct linux_select_args *args) { @@ -583,6 +586,7 @@ select_out: #endif return (error); } +#endif int linux_mremap(struct thread *td, struct linux_mremap_args *args) @@ -644,6 +648,7 @@ linux_msync(struct thread *td, struct linux_msync_args args->fl & ~LINUX_MS_SYNC)); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_time(struct thread *td, struct linux_time_args *args) { @@ -663,6 +668,7 @@ linux_time(struct thread *td, struct linux_time_args * td->td_retval[0] = tm; return (0); } +#endif struct l_times_argv { l_clock_t tms_utime; @@ -759,6 +765,7 @@ struct l_utimbuf { l_time_t l_modtime; }; +#ifdef LINUX_LEGACY_SYSCALLS int linux_utime(struct thread *td, struct linux_utime_args *args) { @@ -792,7 +799,9 @@ linux_utime(struct thread *td, struct linux_utime_args LFREEPATH(fname); return (error); } +#endif +#ifdef LINUX_LEGACY_SYSCALLS int linux_utimes(struct thread *td, struct linux_utimes_args *args) { @@ -825,6 +834,7 @@ linux_utimes(struct thread *td, struct linux_utimes_ar LFREEPATH(fname); return (error); } +#endif static int linux_utimensat_nsec_valid(l_long nsec) @@ -919,6 +929,7 @@ linux_utimensat(struct thread *td, struct linux_utimen return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_futimesat(struct thread *td, struct linux_futimesat_args *args) { @@ -951,6 +962,7 @@ linux_futimesat(struct thread *td, struct linux_futime LFREEPATH(fname); return (error); } +#endif int linux_common_wait(struct thread *td, int pid, int *status, @@ -1091,6 +1103,7 @@ linux_waitid(struct thread *td, struct linux_waitid_ar return (error); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_mknod(struct thread *td, struct linux_mknod_args *args) { @@ -1139,6 +1152,7 @@ linux_mknod(struct thread *td, struct linux_mknod_args LFREEPATH(path); return (error); } +#endif int linux_mknodat(struct thread *td, struct linux_mknodat_args *args) Modified: stable/11/sys/compat/linux/linux_stats.c ============================================================================== --- stable/11/sys/compat/linux/linux_stats.c Sun Apr 28 13:45:18 2019 (r346831) +++ stable/11/sys/compat/linux/linux_stats.c Sun Apr 28 14:03:32 2019 (r346832) @@ -81,6 +81,7 @@ linux_kern_statat(struct thread *td, int flag, int fd, translate_vnhook_major_minor)); } +#ifdef LINUX_LEGACY_SYSCALLS static int linux_kern_stat(struct thread *td, char *path, enum uio_seg pathseg, struct stat *sbp) @@ -97,6 +98,7 @@ linux_kern_lstat(struct thread *td, char *path, enum u return (linux_kern_statat(td, AT_SYMLINK_NOFOLLOW, AT_FDCWD, path, pathseg, sbp)); } +#endif static void translate_fd_major_minor(struct thread *td, int fd, struct stat *buf) @@ -155,6 +157,7 @@ newstat_copyout(struct stat *buf, void *ubuf) return (copyout(&tbuf, ubuf, sizeof(tbuf))); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_newstat(struct thread *td, struct linux_newstat_args *args) { @@ -196,6 +199,7 @@ linux_newlstat(struct thread *td, struct linux_newlsta return (error); return (newstat_copyout(&sb, args->buf)); } +#endif int linux_newfstat(struct thread *td, struct linux_newfstat_args *args) @@ -509,6 +513,7 @@ struct l_ustat char f_fpack[6]; }; +#ifdef LINUX_LEGACY_SYSCALLS int linux_ustat(struct thread *td, struct linux_ustat_args *args) { @@ -519,6 +524,7 @@ linux_ustat(struct thread *td, struct linux_ustat_args return (EOPNOTSUPP); } +#endif #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) Modified: stable/11/sys/compat/linux/linux_sysctl.c ============================================================================== --- stable/11/sys/compat/linux/linux_sysctl.c Sun Apr 28 13:45:18 2019 (r346831) +++ stable/11/sys/compat/linux/linux_sysctl.c Sun Apr 28 14:03:32 2019 (r346832) @@ -115,6 +115,7 @@ handle_string(struct l___sysctl_args *la, char *value) return (0); } +#ifdef LINUX_LEGACY_SYSCALLS int linux_sysctl(struct thread *td, struct linux_sysctl_args *args) { @@ -191,3 +192,4 @@ linux_sysctl(struct thread *td, struct linux_sysctl_ar LIN_SDT_PROBE1(sysctl, linux_sysctl, return, ENOTDIR); return (ENOTDIR); } +#endif Modified: stable/11/sys/i386/linux/linux.h ============================================================================== --- stable/11/sys/i386/linux/linux.h Sun Apr 28 13:45:18 2019 (r346831) +++ stable/11/sys/i386/linux/linux.h Sun Apr 28 14:03:32 2019 (r346832) @@ -36,6 +36,8 @@ #include #include +#define LINUX_LEGACY_SYSCALLS + /* * debugging support */ From owner-svn-src-all@freebsd.org Sun Apr 28 14:05:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B10D157F41E; Sun, 28 Apr 2019 14:05:06 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3FBA594BA2; Sun, 28 Apr 2019 14:05:06 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19EF7BA01; Sun, 28 Apr 2019 14:05:06 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SE55sC039010; Sun, 28 Apr 2019 14:05:05 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SE55Xv039009; Sun, 28 Apr 2019 14:05:05 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281405.x3SE55Xv039009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 14:05:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346833 - stable/11/sys/compat/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/11/sys/compat/linux X-SVN-Commit-Revision: 346833 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3FBA594BA2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 14:05:06 -0000 Author: dchagin Date: Sun Apr 28 14:05:05 2019 New Revision: 346833 URL: https://svnweb.freebsd.org/changeset/base/346833 Log: MFC r335327 (by emaste@): linuxulator: add debugging for invalid capget/capset version. Modified: stable/11/sys/compat/linux/linux_misc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_misc.c ============================================================================== --- stable/11/sys/compat/linux/linux_misc.c Sun Apr 28 14:03:32 2019 (r346832) +++ stable/11/sys/compat/linux/linux_misc.c Sun Apr 28 14:05:05 2019 (r346833) @@ -1892,6 +1892,11 @@ linux_capget(struct thread *td, struct linux_capget_ar return (error); if (luch.version != _LINUX_CAPABILITY_VERSION) { +#ifdef DEBUG + if (ldebug(capget)) + printf(LMSG("invalid capget capability version 0x%x"), + luch.version); +#endif luch.version = _LINUX_CAPABILITY_VERSION; error = copyout(&luch, args->hdrp, sizeof(luch)); if (error) @@ -1931,6 +1936,11 @@ linux_capset(struct thread *td, struct linux_capset_ar return (error); if (luch.version != _LINUX_CAPABILITY_VERSION) { +#ifdef DEBUG + if (ldebug(capset)) + printf(LMSG("invalid capset capability version 0x%x"), + luch.version); +#endif luch.version = _LINUX_CAPABILITY_VERSION; error = copyout(&luch, args->hdrp, sizeof(luch)); if (error) From owner-svn-src-all@freebsd.org Sun Apr 28 14:06:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15808157F4F3; Sun, 28 Apr 2019 14:06:23 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACF2494CF7; Sun, 28 Apr 2019 14:06:22 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81E6CBA02; Sun, 28 Apr 2019 14:06:22 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SE6MMG039126; Sun, 28 Apr 2019 14:06:22 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SE6MvD039125; Sun, 28 Apr 2019 14:06:22 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281406.x3SE6MvD039125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 14:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346834 - stable/11/sys/compat/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/11/sys/compat/linux X-SVN-Commit-Revision: 346834 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ACF2494CF7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 14:06:23 -0000 Author: dchagin Date: Sun Apr 28 14:06:22 2019 New Revision: 346834 URL: https://svnweb.freebsd.org/changeset/base/346834 Log: MFC r335387 (by emaste@): linuxulator: handle V3 capget/capset Linux 2.6.26 introduced 64-bit capability sets. Extend our stub implementation to handle both 32- and 64-bit. (We still report no capabilities in capget, and disallow any in capset.) Modified: stable/11/sys/compat/linux/linux_misc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_misc.c ============================================================================== --- stable/11/sys/compat/linux/linux_misc.c Sun Apr 28 14:05:05 2019 (r346833) +++ stable/11/sys/compat/linux/linux_misc.c Sun Apr 28 14:06:22 2019 (r346834) @@ -1864,7 +1864,9 @@ linux_exit_group(struct thread *td, struct linux_exit_ /* NOTREACHED */ } -#define _LINUX_CAPABILITY_VERSION 0x19980330 +#define _LINUX_CAPABILITY_VERSION_1 0x19980330 +#define _LINUX_CAPABILITY_VERSION_2 0x20071026 +#define _LINUX_CAPABILITY_VERSION_3 0x20080522 struct l_user_cap_header { l_int version; @@ -1878,27 +1880,35 @@ struct l_user_cap_data { }; int -linux_capget(struct thread *td, struct linux_capget_args *args) +linux_capget(struct thread *td, struct linux_capget_args *uap) { struct l_user_cap_header luch; - struct l_user_cap_data lucd; - int error; + struct l_user_cap_data lucd[2]; + int error, u32s; - if (args->hdrp == NULL) + if (uap->hdrp == NULL) return (EFAULT); - error = copyin(args->hdrp, &luch, sizeof(luch)); + error = copyin(uap->hdrp, &luch, sizeof(luch)); if (error != 0) return (error); - if (luch.version != _LINUX_CAPABILITY_VERSION) { + switch (luch.version) { + case _LINUX_CAPABILITY_VERSION_1: + u32s = 1; + break; + case _LINUX_CAPABILITY_VERSION_2: + case _LINUX_CAPABILITY_VERSION_3: + u32s = 2; + break; + default: #ifdef DEBUG if (ldebug(capget)) printf(LMSG("invalid capget capability version 0x%x"), luch.version); #endif - luch.version = _LINUX_CAPABILITY_VERSION; - error = copyout(&luch, args->hdrp, sizeof(luch)); + luch.version = _LINUX_CAPABILITY_VERSION_1; + error = copyout(&luch, uap->hdrp, sizeof(luch)); if (error) return (error); return (EINVAL); @@ -1907,42 +1917,50 @@ linux_capget(struct thread *td, struct linux_capget_ar if (luch.pid) return (EPERM); - if (args->datap) { + if (uap->datap) { /* * The current implementation doesn't support setting * a capability (it's essentially a stub) so indicate * that no capabilities are currently set or available * to request. */ - bzero (&lucd, sizeof(lucd)); - error = copyout(&lucd, args->datap, sizeof(lucd)); + memset(&lucd, 0, u32s * sizeof(lucd[0])); + error = copyout(&lucd, uap->datap, u32s * sizeof(lucd[0])); } return (error); } int -linux_capset(struct thread *td, struct linux_capset_args *args) +linux_capset(struct thread *td, struct linux_capset_args *uap) { struct l_user_cap_header luch; - struct l_user_cap_data lucd; - int error; + struct l_user_cap_data lucd[2]; + int error, i, u32s; - if (args->hdrp == NULL || args->datap == NULL) + if (uap->hdrp == NULL || uap->datap == NULL) return (EFAULT); - error = copyin(args->hdrp, &luch, sizeof(luch)); + error = copyin(uap->hdrp, &luch, sizeof(luch)); if (error != 0) return (error); - if (luch.version != _LINUX_CAPABILITY_VERSION) { + switch (luch.version) { + case _LINUX_CAPABILITY_VERSION_1: + u32s = 1; + break; + case _LINUX_CAPABILITY_VERSION_2: + case _LINUX_CAPABILITY_VERSION_3: + u32s = 2; + break; + default: #ifdef DEBUG if (ldebug(capset)) printf(LMSG("invalid capset capability version 0x%x"), luch.version); #endif - luch.version = _LINUX_CAPABILITY_VERSION; - error = copyout(&luch, args->hdrp, sizeof(luch)); + luch.version = _LINUX_CAPABILITY_VERSION_1; + error = copyout(&luch, uap->hdrp, sizeof(luch)); if (error) return (error); return (EINVAL); @@ -1951,18 +1969,21 @@ linux_capset(struct thread *td, struct linux_capset_ar if (luch.pid) return (EPERM); - error = copyin(args->datap, &lucd, sizeof(lucd)); + error = copyin(uap->datap, &lucd, u32s * sizeof(lucd[0])); if (error != 0) return (error); /* We currently don't support setting any capabilities. */ - if (lucd.effective || lucd.permitted || lucd.inheritable) { - linux_msg(td, - "capset effective=0x%x, permitted=0x%x, " - "inheritable=0x%x is not implemented", - (int)lucd.effective, (int)lucd.permitted, - (int)lucd.inheritable); - return (EPERM); + for (i = 0; i < u32s; i++) { + if (lucd[i].effective || lucd[i].permitted || + lucd[i].inheritable) { + linux_msg(td, + "capset[%d] effective=0x%x, permitted=0x%x, " + "inheritable=0x%x is not implemented", i, + (int)lucd[i].effective, (int)lucd[i].permitted, + (int)lucd[i].inheritable); + return (EPERM); + } } return (0); From owner-svn-src-all@freebsd.org Sun Apr 28 14:08:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5995157F5EC; Sun, 28 Apr 2019 14:08:06 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E91994E73; Sun, 28 Apr 2019 14:08:06 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BFACBA03; Sun, 28 Apr 2019 14:08:06 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SE85Qf039264; Sun, 28 Apr 2019 14:08:05 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SE85K9039261; Sun, 28 Apr 2019 14:08:05 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281408.x3SE85K9039261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 14:08:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346835 - in stable/11/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/11/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Commit-Revision: 346835 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5E91994E73 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 14:08:06 -0000 Author: dchagin Date: Sun Apr 28 14:08:05 2019 New Revision: 346835 URL: https://svnweb.freebsd.org/changeset/base/346835 Log: MFC r335515 (by chuck@): Fix the Linux kernel version number calculation The Linux compatibility code was converting the version number (e.g. 2.6.32) in two different ways and then comparing the results. The linux_map_osrel() function converted MAJOR.MINOR.PATCH similar to what FreeBSD does natively. I.e. where major=v0, minor=v1, and patch=v2 v = v0 * 1000000 + v1 * 1000 + v2; The LINUX_KERNVER() macro, on the other hand, converted the value with bit shifts. I.e. where major=a, minor=b, and patch=c v = (((a) << 16) + ((b) << 8) + (c)) The Linux kernel uses the later format via the KERNEL_VERSION() macro in include/generated/uapi/linux/version.h Fix is to use the LINUX_KERNVER() macro in linux_map_osrel() as well as in the .trans_osrel functions. PR: 229209 Modified: stable/11/sys/amd64/linux/linux_sysvec.c stable/11/sys/amd64/linux32/linux32_sysvec.c stable/11/sys/compat/linux/linux_mib.c stable/11/sys/i386/linux/linux_sysvec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 14:06:22 2019 (r346834) +++ stable/11/sys/amd64/linux/linux_sysvec.c Sun Apr 28 14:08:05 2019 (r346835) @@ -794,10 +794,11 @@ linux_trans_osrel(const Elf_Note *note, int32_t *osrel return (false); /* - * For Linux we encode osrel as follows (see linux_mib.c): - * VVVMMMIII (version, major, minor), see linux_mib.c. + * For Linux we encode osrel using the Linux convention of + * (version << 16) | (major << 8) | (minor) + * See macro in linux_mib.h */ - *osrel = desc[1] * 1000000 + desc[2] * 1000 + desc[3]; + *osrel = LINUX_KERNVER(desc[1], desc[2], desc[3]); return (true); } Modified: stable/11/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 14:06:22 2019 (r346834) +++ stable/11/sys/amd64/linux32/linux32_sysvec.c Sun Apr 28 14:08:05 2019 (r346835) @@ -993,10 +993,11 @@ linux32_trans_osrel(const Elf_Note *note, int32_t *osr return (false); /* - * For Linux we encode osrel as follows (see linux_mib.c): - * VVVMMMIII (version, major, minor), see linux_mib.c. + * For Linux we encode osrel using the Linux convention of + * (version << 16) | (major << 8) | (minor) + * See macro in linux_mib.h */ - *osrel = desc[1] * 1000000 + desc[2] * 1000 + desc[3]; + *osrel = LINUX_KERNVER(desc[1], desc[2], desc[3]); return (true); } Modified: stable/11/sys/compat/linux/linux_mib.c ============================================================================== --- stable/11/sys/compat/linux/linux_mib.c Sun Apr 28 14:06:22 2019 (r346834) +++ stable/11/sys/compat/linux/linux_mib.c Sun Apr 28 14:08:05 2019 (r346835) @@ -149,8 +149,8 @@ linux_map_osrel(char *osrelease, int *osrel) if (osrelease == sep || sep != eosrelease) return (EINVAL); - v = v0 * 1000000 + v1 * 1000 + v2; - if (v < 1000000) + v = LINUX_KERNVER(v0, v1, v2); + if (v < LINUX_KERNVER(1, 0, 0)) return (EINVAL); if (osrel != NULL) Modified: stable/11/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 14:06:22 2019 (r346834) +++ stable/11/sys/i386/linux/linux_sysvec.c Sun Apr 28 14:08:05 2019 (r346835) @@ -960,10 +960,11 @@ linux_trans_osrel(const Elf_Note *note, int32_t *osrel return (false); /* - * For Linux we encode osrel as follows (see linux_mib.c): - * VVVMMMIII (version, major, minor), see linux_mib.c. + * For Linux we encode osrel using the Linux convention of + * (version << 16) | (major << 8) | (minor) + * See macro in linux_mib.h */ - *osrel = desc[1] * 1000000 + desc[2] * 1000 + desc[3]; + *osrel = LINUX_KERNVER(desc[1], desc[2], desc[3]); return (true); } From owner-svn-src-all@freebsd.org Sun Apr 28 14:09:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02E21157F682; Sun, 28 Apr 2019 14:09:32 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C9A394FC3; Sun, 28 Apr 2019 14:09:31 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 773CCBA05; Sun, 28 Apr 2019 14:09:31 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SE9Vg3039393; Sun, 28 Apr 2019 14:09:31 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SE9VJ4039392; Sun, 28 Apr 2019 14:09:31 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281409.x3SE9VJ4039392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 14:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346836 - stable/11/sys/compat/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/11/sys/compat/linux X-SVN-Commit-Revision: 346836 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9C9A394FC3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 14:09:32 -0000 Author: dchagin Date: Sun Apr 28 14:09:31 2019 New Revision: 346836 URL: https://svnweb.freebsd.org/changeset/base/346836 Log: MFC r335644 (by emaste@): Quiet unused fn warning for linuxulator w/o legacy syscalls. Modified: stable/11/sys/compat/linux/linux_sysctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_sysctl.c ============================================================================== --- stable/11/sys/compat/linux/linux_sysctl.c Sun Apr 28 14:08:05 2019 (r346835) +++ stable/11/sys/compat/linux/linux_sysctl.c Sun Apr 28 14:09:31 2019 (r346836) @@ -86,6 +86,7 @@ LIN_SDT_PROBE_DEFINE2(sysctl, linux_sysctl, wrong_leng LIN_SDT_PROBE_DEFINE1(sysctl, linux_sysctl, unsupported_sysctl, "char *"); LIN_SDT_PROBE_DEFINE1(sysctl, linux_sysctl, return, "int"); +#ifdef LINUX_LEGACY_SYSCALLS static int handle_string(struct l___sysctl_args *la, char *value) { @@ -115,7 +116,6 @@ handle_string(struct l___sysctl_args *la, char *value) return (0); } -#ifdef LINUX_LEGACY_SYSCALLS int linux_sysctl(struct thread *td, struct linux_sysctl_args *args) { From owner-svn-src-all@freebsd.org Sun Apr 28 14:11:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED6EF157F8BC; Sun, 28 Apr 2019 14:11:22 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9269C952F2; Sun, 28 Apr 2019 14:11:22 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6CABEBA4F; Sun, 28 Apr 2019 14:11:22 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SEBMQS040300; Sun, 28 Apr 2019 14:11:22 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SEBMT5040299; Sun, 28 Apr 2019 14:11:22 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281411.x3SEBMT5040299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 14:11:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346837 - stable/11/sys/amd64/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/11/sys/amd64/linux X-SVN-Commit-Revision: 346837 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9269C952F2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 14:11:23 -0000 Author: dchagin Date: Sun Apr 28 14:11:21 2019 New Revision: 346837 URL: https://svnweb.freebsd.org/changeset/base/346837 Log: MFC r345468: Revert r313993. AMD64_SET_**BASE expects a pointer to a pointer, we just passing in the pointer value itself. Set PCB_FULL_IRET for doreti to restore %fs, %gs and its correspondig base. Modified: stable/11/sys/amd64/linux/linux_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_machdep.c ============================================================================== --- stable/11/sys/amd64/linux/linux_machdep.c Sun Apr 28 14:09:31 2019 (r346836) +++ stable/11/sys/amd64/linux/linux_machdep.c Sun Apr 28 14:11:21 2019 (r346837) @@ -227,35 +227,38 @@ linux_sigaltstack(struct thread *td, struct linux_siga int linux_arch_prctl(struct thread *td, struct linux_arch_prctl_args *args) { + struct pcb *pcb; int error; - struct sysarch_args bsd_args; + pcb = td->td_pcb; LINUX_CTR2(arch_prctl, "0x%x, %p", args->code, args->addr); switch (args->code) { case LINUX_ARCH_SET_GS: - bsd_args.op = AMD64_SET_GSBASE; - bsd_args.parms = (void *)args->addr; - error = sysarch(td, &bsd_args); - if (error == EINVAL) + if (args->addr < VM_MAXUSER_ADDRESS) { + set_pcb_flags(pcb, PCB_FULL_IRET); + pcb->pcb_gsbase = args->addr; + td->td_frame->tf_gs = _ugssel; + error = 0; + } else error = EPERM; break; case LINUX_ARCH_SET_FS: - bsd_args.op = AMD64_SET_FSBASE; - bsd_args.parms = (void *)args->addr; - error = sysarch(td, &bsd_args); - if (error == EINVAL) + if (args->addr < VM_MAXUSER_ADDRESS) { + set_pcb_flags(pcb, PCB_FULL_IRET); + pcb->pcb_fsbase = args->addr; + td->td_frame->tf_fs = _ufssel; + error = 0; + } else error = EPERM; break; case LINUX_ARCH_GET_FS: - bsd_args.op = AMD64_GET_FSBASE; - bsd_args.parms = (void *)args->addr; - error = sysarch(td, &bsd_args); + error = copyout(&pcb->pcb_fsbase, PTRIN(args->addr), + sizeof(args->addr)); break; case LINUX_ARCH_GET_GS: - bsd_args.op = AMD64_GET_GSBASE; - bsd_args.parms = (void *)args->addr; - error = sysarch(td, &bsd_args); + error = copyout(&pcb->pcb_gsbase, PTRIN(args->addr), + sizeof(args->addr)); break; default: error = EINVAL; From owner-svn-src-all@freebsd.org Sun Apr 28 14:16:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60EC9157F994; Sun, 28 Apr 2019 14:16:04 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0BB5595527; Sun, 28 Apr 2019 14:16:04 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9889BD51; Sun, 28 Apr 2019 14:16:03 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SEG3J7044905; Sun, 28 Apr 2019 14:16:03 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SEG1NP044893; Sun, 28 Apr 2019 14:16:01 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281416.x3SEG1NP044893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 14:16:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346838 - in stable/11/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/11/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Commit-Revision: 346838 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0BB5595527 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 14:16:04 -0000 Author: dchagin Date: Sun Apr 28 14:16:00 2019 New Revision: 346838 URL: https://svnweb.freebsd.org/changeset/base/346838 Log: MFC r345469, r345470: Linux between 4.18 and 5.0 split IPC system calls. In preparation for doing this in the Linuxulator modify our linux_shmat() to match actual Linux shmat() system call. Modified: stable/11/sys/amd64/linux/linux_proto.h stable/11/sys/amd64/linux/linux_systrace_args.c stable/11/sys/amd64/linux32/linux32_machdep.c stable/11/sys/amd64/linux32/linux32_proto.h stable/11/sys/amd64/linux32/linux32_systrace_args.c stable/11/sys/amd64/linux32/syscalls.master stable/11/sys/compat/linux/linux_ipc.c stable/11/sys/compat/linux/linux_ipc.h stable/11/sys/i386/linux/linux_machdep.c stable/11/sys/i386/linux/linux_proto.h stable/11/sys/i386/linux/linux_systrace_args.c stable/11/sys/i386/linux/syscalls.master Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_proto.h ============================================================================== --- stable/11/sys/amd64/linux/linux_proto.h Sun Apr 28 14:11:21 2019 (r346837) +++ stable/11/sys/amd64/linux/linux_proto.h Sun Apr 28 14:16:00 2019 (r346838) @@ -66,8 +66,8 @@ struct linux_mmap2_args { }; struct linux_mprotect_args { char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)]; - char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; - char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)]; + char len_l_[PADL_(l_int)]; l_int len; char len_r_[PADR_(l_int)]; + char prot_l_[PADL_(l_int)]; l_int prot; char prot_r_[PADR_(l_int)]; }; struct linux_brk_args { char dsend_l_[PADL_(l_ulong)]; l_ulong dsend; char dsend_r_[PADR_(l_ulong)]; @@ -173,8 +173,8 @@ struct linux_getpid_args { register_t dummy; }; struct linux_sendfile_args { - char out_l_[PADL_(int)]; int out; char out_r_[PADR_(int)]; - char in_l_[PADL_(int)]; int in; char in_r_[PADR_(int)]; + char out_l_[PADL_(l_int)]; l_int out; char out_r_[PADR_(l_int)]; + char in_l_[PADL_(l_int)]; l_int in; char in_r_[PADR_(l_int)]; char offset_l_[PADL_(l_long *)]; l_long * offset; char offset_r_[PADR_(l_long *)]; char count_l_[PADL_(l_size_t)]; l_size_t count; char count_r_[PADR_(l_size_t)]; }; @@ -281,7 +281,7 @@ struct linux_execve_args { char envp_l_[PADL_(char **)]; char ** envp; char envp_r_[PADR_(char **)]; }; struct linux_exit_args { - char rval_l_[PADL_(int)]; int rval; char rval_r_[PADR_(int)]; + char rval_l_[PADL_(l_int)]; l_int rval; char rval_r_[PADR_(l_int)]; }; struct linux_wait4_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; @@ -518,8 +518,8 @@ struct linux_sysfs_args { char arg2_l_[PADL_(l_ulong)]; l_ulong arg2; char arg2_r_[PADR_(l_ulong)]; }; struct linux_getpriority_args { - char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)]; - char who_l_[PADL_(int)]; int who; char who_r_[PADR_(int)]; + char which_l_[PADL_(l_int)]; l_int which; char which_r_[PADR_(l_int)]; + char who_l_[PADL_(l_int)]; l_int who; char who_r_[PADR_(l_int)]; }; struct linux_sched_setparam_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; @@ -654,19 +654,19 @@ struct linux_fremovexattr_args { register_t dummy; }; struct linux_tkill_args { - char tid_l_[PADL_(int)]; int tid; char tid_r_[PADR_(int)]; - char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)]; + char tid_l_[PADL_(l_int)]; l_int tid; char tid_r_[PADR_(l_int)]; + char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; }; struct linux_time_args { char tm_l_[PADL_(l_time_t *)]; l_time_t * tm; char tm_r_[PADR_(l_time_t *)]; }; struct linux_sys_futex_args { char uaddr_l_[PADL_(void *)]; void * uaddr; char uaddr_r_[PADR_(void *)]; - char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; - char val_l_[PADL_(int)]; int val; char val_r_[PADR_(int)]; + char op_l_[PADL_(l_int)]; l_int op; char op_r_[PADR_(l_int)]; + char val_l_[PADL_(l_int)]; l_int val; char val_r_[PADR_(l_int)]; char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)]; char uaddr2_l_[PADL_(void *)]; void * uaddr2; char uaddr2_r_[PADR_(void *)]; - char val3_l_[PADL_(int)]; int val3; char val3_r_[PADR_(int)]; + char val3_l_[PADL_(l_int)]; l_int val3; char val3_r_[PADR_(l_int)]; }; struct linux_sched_setaffinity_args { char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; @@ -693,16 +693,16 @@ struct linux_getdents64_args { char count_l_[PADL_(l_uint)]; l_uint count; char count_r_[PADR_(l_uint)]; }; struct linux_set_tid_address_args { - char tidptr_l_[PADL_(int *)]; int * tidptr; char tidptr_r_[PADR_(int *)]; + char tidptr_l_[PADL_(l_int *)]; l_int * tidptr; char tidptr_r_[PADR_(l_int *)]; }; struct linux_semtimedop_args { register_t dummy; }; struct linux_fadvise64_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; - char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; + char advice_l_[PADL_(l_int)]; l_int advice; char advice_r_[PADR_(l_int)]; }; struct linux_timer_create_args { char clock_id_l_[PADL_(clockid_t)]; clockid_t clock_id; char clock_id_r_[PADR_(clockid_t)]; @@ -744,7 +744,7 @@ struct linux_clock_nanosleep_args { char rmtp_l_[PADL_(struct l_timespec *)]; struct l_timespec * rmtp; char rmtp_r_[PADR_(struct l_timespec *)]; }; struct linux_exit_group_args { - char error_code_l_[PADL_(int)]; int error_code; char error_code_r_[PADR_(int)]; + char error_code_l_[PADL_(l_int)]; l_int error_code; char error_code_r_[PADR_(l_int)]; }; struct linux_epoll_wait_args { char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)]; @@ -759,9 +759,9 @@ struct linux_epoll_ctl_args { char event_l_[PADL_(struct epoll_event *)]; struct epoll_event * event; char event_r_[PADR_(struct epoll_event *)]; }; struct linux_tgkill_args { - char tgid_l_[PADL_(int)]; int tgid; char tgid_r_[PADR_(int)]; - char pid_l_[PADL_(int)]; int pid; char pid_r_[PADR_(int)]; - char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)]; + char tgid_l_[PADL_(l_int)]; l_int tgid; char tgid_r_[PADR_(l_int)]; + char pid_l_[PADL_(l_int)]; l_int pid; char pid_r_[PADR_(l_int)]; + char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; }; struct linux_utimes_args { char fname_l_[PADL_(char *)]; char * fname; char fname_r_[PADR_(char *)]; @@ -798,10 +798,10 @@ struct linux_kexec_load_args { register_t dummy; }; struct linux_waitid_args { - char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)]; + char idtype_l_[PADL_(l_int)]; l_int idtype; char idtype_r_[PADR_(l_int)]; char id_l_[PADL_(l_pid_t)]; l_pid_t id; char id_r_[PADR_(l_pid_t)]; char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)]; - char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)]; + char options_l_[PADL_(l_int)]; l_int options; char options_r_[PADR_(l_int)]; char rusage_l_[PADL_(struct rusage *)]; struct rusage * rusage; char rusage_r_[PADR_(struct rusage *)]; }; struct linux_add_key_args { Modified: stable/11/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- stable/11/sys/amd64/linux/linux_systrace_args.c Sun Apr 28 14:11:21 2019 (r346837) +++ stable/11/sys/amd64/linux/linux_systrace_args.c Sun Apr 28 14:16:00 2019 (r346838) @@ -104,8 +104,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 10: { struct linux_mprotect_args *p = params; uarg[0] = (intptr_t) p->addr; /* caddr_t */ - iarg[1] = p->len; /* int */ - iarg[2] = p->prot; /* int */ + iarg[1] = p->len; /* l_int */ + iarg[2] = p->prot; /* l_int */ *n_args = 3; break; } @@ -354,8 +354,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* linux_sendfile */ case 40: { struct linux_sendfile_args *p = params; - iarg[0] = p->out; /* int */ - iarg[1] = p->in; /* int */ + iarg[0] = p->out; /* l_int */ + iarg[1] = p->in; /* l_int */ uarg[2] = (intptr_t) p->offset; /* l_long * */ iarg[3] = p->count; /* l_size_t */ *n_args = 4; @@ -538,7 +538,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* linux_exit */ case 60: { struct linux_exit_args *p = params; - iarg[0] = p->rval; /* int */ + iarg[0] = p->rval; /* l_int */ *n_args = 1; break; } @@ -1160,8 +1160,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* linux_getpriority */ case 140: { struct linux_getpriority_args *p = params; - iarg[0] = p->which; /* int */ - iarg[1] = p->who; /* int */ + iarg[0] = p->which; /* l_int */ + iarg[1] = p->who; /* l_int */ *n_args = 2; break; } @@ -1479,8 +1479,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* linux_tkill */ case 200: { struct linux_tkill_args *p = params; - iarg[0] = p->tid; /* int */ - iarg[1] = p->sig; /* int */ + iarg[0] = p->tid; /* l_int */ + iarg[1] = p->sig; /* l_int */ *n_args = 2; break; } @@ -1495,11 +1495,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 202: { struct linux_sys_futex_args *p = params; uarg[0] = (intptr_t) p->uaddr; /* void * */ - iarg[1] = p->op; /* int */ - iarg[2] = p->val; /* int */ + iarg[1] = p->op; /* l_int */ + iarg[2] = p->val; /* l_int */ uarg[3] = (intptr_t) p->timeout; /* struct l_timespec * */ uarg[4] = (intptr_t) p->uaddr2; /* void * */ - iarg[5] = p->val3; /* int */ + iarg[5] = p->val3; /* l_int */ *n_args = 6; break; } @@ -1550,7 +1550,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* linux_set_tid_address */ case 218: { struct linux_set_tid_address_args *p = params; - uarg[0] = (intptr_t) p->tidptr; /* int * */ + uarg[0] = (intptr_t) p->tidptr; /* l_int * */ *n_args = 1; break; } @@ -1562,10 +1562,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* linux_fadvise64 */ case 221: { struct linux_fadvise64_args *p = params; - iarg[0] = p->fd; /* int */ + iarg[0] = p->fd; /* l_int */ iarg[1] = p->offset; /* l_loff_t */ iarg[2] = p->len; /* l_size_t */ - iarg[3] = p->advice; /* int */ + iarg[3] = p->advice; /* l_int */ *n_args = 4; break; } @@ -1647,7 +1647,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* linux_exit_group */ case 231: { struct linux_exit_group_args *p = params; - iarg[0] = p->error_code; /* int */ + iarg[0] = p->error_code; /* l_int */ *n_args = 1; break; } @@ -1674,9 +1674,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* linux_tgkill */ case 234: { struct linux_tgkill_args *p = params; - iarg[0] = p->tgid; /* int */ - iarg[1] = p->pid; /* int */ - iarg[2] = p->sig; /* int */ + iarg[0] = p->tgid; /* l_int */ + iarg[1] = p->pid; /* l_int */ + iarg[2] = p->sig; /* l_int */ *n_args = 3; break; } @@ -1741,10 +1741,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg /* linux_waitid */ case 247: { struct linux_waitid_args *p = params; - iarg[0] = p->idtype; /* int */ + iarg[0] = p->idtype; /* l_int */ iarg[1] = p->id; /* l_pid_t */ uarg[2] = (intptr_t) p->info; /* l_siginfo_t * */ - iarg[3] = p->options; /* int */ + iarg[3] = p->options; /* l_int */ uarg[4] = (intptr_t) p->rusage; /* struct rusage * */ *n_args = 5; break; @@ -2619,10 +2619,10 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "caddr_t"; break; case 1: - p = "int"; + p = "l_int"; break; case 2: - p = "int"; + p = "l_int"; break; default: break; @@ -3036,10 +3036,10 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 40: switch(ndx) { case 0: - p = "int"; + p = "l_int"; break; case 1: - p = "int"; + p = "l_int"; break; case 2: p = "l_long *"; @@ -3366,7 +3366,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 60: switch(ndx) { case 0: - p = "int"; + p = "l_int"; break; default: break; @@ -4356,10 +4356,10 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 140: switch(ndx) { case 0: - p = "int"; + p = "l_int"; break; case 1: - p = "int"; + p = "l_int"; break; default: break; @@ -4763,10 +4763,10 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 200: switch(ndx) { case 0: - p = "int"; + p = "l_int"; break; case 1: - p = "int"; + p = "l_int"; break; default: break; @@ -4789,10 +4789,10 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "void *"; break; case 1: - p = "int"; + p = "l_int"; break; case 2: - p = "int"; + p = "l_int"; break; case 3: p = "struct l_timespec *"; @@ -4801,7 +4801,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "void *"; break; case 5: - p = "int"; + p = "l_int"; break; default: break; @@ -4875,7 +4875,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 218: switch(ndx) { case 0: - p = "int *"; + p = "l_int *"; break; default: break; @@ -4888,7 +4888,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 221: switch(ndx) { case 0: - p = "int"; + p = "l_int"; break; case 1: p = "l_loff_t"; @@ -4897,7 +4897,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "l_size_t"; break; case 3: - p = "int"; + p = "l_int"; break; default: break; @@ -5033,7 +5033,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 231: switch(ndx) { case 0: - p = "int"; + p = "l_int"; break; default: break; @@ -5081,13 +5081,13 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 234: switch(ndx) { case 0: - p = "int"; + p = "l_int"; break; case 1: - p = "int"; + p = "l_int"; break; case 2: - p = "int"; + p = "l_int"; break; default: break; @@ -5140,7 +5140,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d case 247: switch(ndx) { case 0: - p = "int"; + p = "l_int"; break; case 1: p = "l_pid_t"; @@ -5149,7 +5149,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "l_siginfo_t *"; break; case 3: - p = "int"; + p = "l_int"; break; case 4: p = "struct rusage *"; Modified: stable/11/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_machdep.c Sun Apr 28 14:11:21 2019 (r346837) +++ stable/11/sys/amd64/linux32/linux32_machdep.c Sun Apr 28 14:16:00 2019 (r346838) @@ -255,7 +255,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar struct linux_semop_args a; a.semid = args->arg1; - a.tsops = args->ptr; + a.tsops = PTRIN(args->ptr); a.nsops = args->arg2; return (linux_semop(td, &a)); } @@ -274,7 +274,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar a.semid = args->arg1; a.semnum = args->arg2; a.cmd = args->arg3; - error = copyin(args->ptr, &a.arg, sizeof(a.arg)); + error = copyin(PTRIN(args->ptr), &a.arg, sizeof(a.arg)); if (error) return (error); return (linux_semctl(td, &a)); @@ -283,7 +283,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar struct linux_msgsnd_args a; a.msqid = args->arg1; - a.msgp = args->ptr; + a.msgp = PTRIN(args->ptr); a.msgsz = args->arg2; a.msgflg = args->arg3; return (linux_msgsnd(td, &a)); @@ -300,13 +300,13 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar if (args->ptr == 0) return (EINVAL); - error = copyin(args->ptr, &tmp, sizeof(tmp)); + error = copyin(PTRIN(args->ptr), &tmp, sizeof(tmp)); if (error) return (error); a.msgp = PTRIN(tmp.msgp); a.msgtyp = tmp.msgtyp; } else { - a.msgp = args->ptr; + a.msgp = PTRIN(args->ptr); a.msgtyp = args->arg5; } return (linux_msgrcv(td, &a)); @@ -323,22 +323,29 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar a.msqid = args->arg1; a.cmd = args->arg2; - a.buf = args->ptr; + a.buf = PTRIN(args->ptr); return (linux_msgctl(td, &a)); } case LINUX_SHMAT: { struct linux_shmat_args a; + l_uintptr_t addr; + int error; a.shmid = args->arg1; - a.shmaddr = args->ptr; + a.shmaddr = PTRIN(args->ptr); a.shmflg = args->arg2; - a.raddr = PTRIN((l_uint)args->arg3); - return (linux_shmat(td, &a)); + error = linux_shmat(td, &a); + if (error != 0) + return (error); + addr = td->td_retval[0]; + error = copyout(&addr, PTRIN(args->arg3), sizeof(addr)); + td->td_retval[0] = 0; + return (error); } case LINUX_SHMDT: { struct linux_shmdt_args a; - a.shmaddr = args->ptr; + a.shmaddr = PTRIN(args->ptr); return (linux_shmdt(td, &a)); } case LINUX_SHMGET: { @@ -354,7 +361,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar a.shmid = args->arg1; a.cmd = args->arg2; - a.buf = args->ptr; + a.buf = PTRIN(args->ptr); return (linux_shmctl(td, &a)); } default: Modified: stable/11/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/11/sys/amd64/linux32/linux32_proto.h Sun Apr 28 14:11:21 2019 (r346837) +++ stable/11/sys/amd64/linux32/linux32_proto.h Sun Apr 28 14:16:00 2019 (r346838) @@ -368,9 +368,9 @@ struct linux_ipc_args { char what_l_[PADL_(l_uint)]; l_uint what; char what_r_[PADR_(l_uint)]; char arg1_l_[PADL_(l_int)]; l_int arg1; char arg1_r_[PADR_(l_int)]; char arg2_l_[PADL_(l_int)]; l_int arg2; char arg2_r_[PADR_(l_int)]; - char arg3_l_[PADL_(l_int)]; l_int arg3; char arg3_r_[PADR_(l_int)]; - char ptr_l_[PADL_(void *)]; void * ptr; char ptr_r_[PADR_(void *)]; - char arg5_l_[PADL_(l_long)]; l_long arg5; char arg5_r_[PADR_(l_long)]; + char arg3_l_[PADL_(l_uint)]; l_uint arg3; char arg3_r_[PADR_(l_uint)]; + char ptr_l_[PADL_(l_uintptr_t)]; l_uintptr_t ptr; char ptr_r_[PADR_(l_uintptr_t)]; + char arg5_l_[PADL_(l_uint)]; l_uint arg5; char arg5_r_[PADR_(l_uint)]; }; struct linux_sigreturn_args { char sfp_l_[PADL_(struct l_sigframe *)]; struct l_sigframe * sfp; char sfp_r_[PADR_(struct l_sigframe *)]; Modified: stable/11/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_systrace_args.c Sun Apr 28 14:11:21 2019 (r346837) +++ stable/11/sys/amd64/linux32/linux32_systrace_args.c Sun Apr 28 14:16:00 2019 (r346838) @@ -785,9 +785,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg iarg[0] = p->what; /* l_uint */ iarg[1] = p->arg1; /* l_int */ iarg[2] = p->arg2; /* l_int */ - iarg[3] = p->arg3; /* l_int */ - uarg[4] = (intptr_t) p->ptr; /* void * */ - iarg[5] = p->arg5; /* l_long */ + iarg[3] = p->arg3; /* l_uint */ + iarg[4] = p->ptr; /* l_uintptr_t */ + iarg[5] = p->arg5; /* l_uint */ *n_args = 6; break; } @@ -3894,13 +3894,13 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "l_int"; break; case 3: - p = "l_int"; + p = "l_uint"; break; case 4: - p = "void *"; + p = "l_uintptr_t"; break; case 5: - p = "l_long"; + p = "l_uint"; break; default: break; Modified: stable/11/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/11/sys/amd64/linux32/syscalls.master Sun Apr 28 14:11:21 2019 (r346837) +++ stable/11/sys/amd64/linux32/syscalls.master Sun Apr 28 14:16:00 2019 (r346838) @@ -213,8 +213,8 @@ 115 AUE_SWAPOFF STD { int linux_swapoff(void); } 116 AUE_NULL STD { int linux_sysinfo(struct l_sysinfo *info); } 117 AUE_NULL STD { int linux_ipc(l_uint what, l_int arg1, \ - l_int arg2, l_int arg3, void *ptr, \ - l_long arg5); } + l_int arg2, l_uint arg3, l_uintptr_t ptr, \ + l_uint arg5); } 118 AUE_FSYNC NOPROTO { int fsync(int fd); } 119 AUE_SIGRETURN STD { int linux_sigreturn( \ struct l_sigframe *sfp); } Modified: stable/11/sys/compat/linux/linux_ipc.c ============================================================================== --- stable/11/sys/compat/linux/linux_ipc.c Sun Apr 28 14:11:21 2019 (r346837) +++ stable/11/sys/compat/linux/linux_ipc.c Sun Apr 28 14:16:00 2019 (r346838) @@ -785,23 +785,11 @@ linux_shmat(struct thread *td, struct linux_shmat_args void *shmaddr; int shmflg; } */ bsd_args; - int error; -#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) - l_uintptr_t addr; -#endif bsd_args.shmid = args->shmid; bsd_args.shmaddr = PTRIN(args->shmaddr); bsd_args.shmflg = args->shmflg; - if ((error = sys_shmat(td, &bsd_args))) - return (error); -#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) - addr = td->td_retval[0]; - if ((error = copyout(&addr, PTRIN(args->raddr), sizeof(addr)))) - return (error); - td->td_retval[0] = 0; -#endif - return (0); + return (sys_shmat(td, &bsd_args)); } int Modified: stable/11/sys/compat/linux/linux_ipc.h ============================================================================== --- stable/11/sys/compat/linux/linux_ipc.h Sun Apr 28 14:11:21 2019 (r346837) +++ stable/11/sys/compat/linux/linux_ipc.h Sun Apr 28 14:16:00 2019 (r346838) @@ -141,7 +141,6 @@ struct linux_shmat_args l_int shmid; char *shmaddr; l_int shmflg; - l_ulong *raddr; }; struct linux_shmctl_args Modified: stable/11/sys/i386/linux/linux_machdep.c ============================================================================== --- stable/11/sys/i386/linux/linux_machdep.c Sun Apr 28 14:11:21 2019 (r346837) +++ stable/11/sys/i386/linux/linux_machdep.c Sun Apr 28 14:16:00 2019 (r346838) @@ -133,7 +133,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar struct linux_semop_args a; a.semid = args->arg1; - a.tsops = args->ptr; + a.tsops = PTRIN(args->ptr); a.nsops = args->arg2; return (linux_semop(td, &a)); } @@ -152,7 +152,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar a.semid = args->arg1; a.semnum = args->arg2; a.cmd = args->arg3; - error = copyin(args->ptr, &a.arg, sizeof(a.arg)); + error = copyin(PTRIN(args->ptr), &a.arg, sizeof(a.arg)); if (error) return (error); return (linux_semctl(td, &a)); @@ -161,7 +161,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar struct linux_msgsnd_args a; a.msqid = args->arg1; - a.msgp = args->ptr; + a.msgp = PTRIN(args->ptr); a.msgsz = args->arg2; a.msgflg = args->arg3; return (linux_msgsnd(td, &a)); @@ -176,15 +176,15 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar struct l_ipc_kludge tmp; int error; - if (args->ptr == NULL) + if (args->ptr == 0) return (EINVAL); - error = copyin(args->ptr, &tmp, sizeof(tmp)); + error = copyin(PTRIN(args->ptr), &tmp, sizeof(tmp)); if (error) return (error); - a.msgp = tmp.msgp; + a.msgp = PTRIN(tmp.msgp); a.msgtyp = tmp.msgtyp; } else { - a.msgp = args->ptr; + a.msgp = PTRIN(args->ptr); a.msgtyp = args->arg5; } return (linux_msgrcv(td, &a)); @@ -201,22 +201,29 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar a.msqid = args->arg1; a.cmd = args->arg2; - a.buf = args->ptr; + a.buf = PTRIN(args->ptr); return (linux_msgctl(td, &a)); } case LINUX_SHMAT: { struct linux_shmat_args a; + l_uintptr_t addr; + int error; a.shmid = args->arg1; - a.shmaddr = args->ptr; + a.shmaddr = PTRIN(args->ptr); a.shmflg = args->arg2; - a.raddr = (l_ulong *)args->arg3; - return (linux_shmat(td, &a)); + error = linux_shmat(td, &a); + if (error != 0) + return (error); + addr = td->td_retval[0]; + error = copyout(&addr, PTRIN(args->arg3), sizeof(addr)); + td->td_retval[0] = 0; + return (error); } case LINUX_SHMDT: { struct linux_shmdt_args a; - a.shmaddr = args->ptr; + a.shmaddr = PTRIN(args->ptr); return (linux_shmdt(td, &a)); } case LINUX_SHMGET: { @@ -232,7 +239,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar a.shmid = args->arg1; a.cmd = args->arg2; - a.buf = args->ptr; + a.buf = PTRIN(args->ptr); return (linux_shmctl(td, &a)); } default: Modified: stable/11/sys/i386/linux/linux_proto.h ============================================================================== --- stable/11/sys/i386/linux/linux_proto.h Sun Apr 28 14:11:21 2019 (r346837) +++ stable/11/sys/i386/linux/linux_proto.h Sun Apr 28 14:16:00 2019 (r346838) @@ -371,9 +371,9 @@ struct linux_ipc_args { char what_l_[PADL_(l_uint)]; l_uint what; char what_r_[PADR_(l_uint)]; char arg1_l_[PADL_(l_int)]; l_int arg1; char arg1_r_[PADR_(l_int)]; char arg2_l_[PADL_(l_int)]; l_int arg2; char arg2_r_[PADR_(l_int)]; - char arg3_l_[PADL_(l_int)]; l_int arg3; char arg3_r_[PADR_(l_int)]; - char ptr_l_[PADL_(void *)]; void * ptr; char ptr_r_[PADR_(void *)]; - char arg5_l_[PADL_(l_long)]; l_long arg5; char arg5_r_[PADR_(l_long)]; + char arg3_l_[PADL_(l_uint)]; l_uint arg3; char arg3_r_[PADR_(l_uint)]; + char ptr_l_[PADL_(l_uintptr_t)]; l_uintptr_t ptr; char ptr_r_[PADR_(l_uintptr_t)]; + char arg5_l_[PADL_(l_uint)]; l_uint arg5; char arg5_r_[PADR_(l_uint)]; }; struct linux_sigreturn_args { char sfp_l_[PADL_(struct l_sigframe *)]; struct l_sigframe * sfp; char sfp_r_[PADR_(struct l_sigframe *)]; Modified: stable/11/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/11/sys/i386/linux/linux_systrace_args.c Sun Apr 28 14:11:21 2019 (r346837) +++ stable/11/sys/i386/linux/linux_systrace_args.c Sun Apr 28 14:16:00 2019 (r346838) @@ -814,9 +814,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg iarg[0] = p->what; /* l_uint */ iarg[1] = p->arg1; /* l_int */ iarg[2] = p->arg2; /* l_int */ - iarg[3] = p->arg3; /* l_int */ - uarg[4] = (intptr_t) p->ptr; /* void * */ - iarg[5] = p->arg5; /* l_long */ + iarg[3] = p->arg3; /* l_uint */ + iarg[4] = p->ptr; /* l_uintptr_t */ + iarg[5] = p->arg5; /* l_uint */ *n_args = 6; break; } @@ -4012,13 +4012,13 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "l_int"; break; case 3: - p = "l_int"; + p = "l_uint"; break; case 4: - p = "void *"; + p = "l_uintptr_t"; break; case 5: - p = "l_long"; + p = "l_uint"; break; default: break; Modified: stable/11/sys/i386/linux/syscalls.master ============================================================================== --- stable/11/sys/i386/linux/syscalls.master Sun Apr 28 14:11:21 2019 (r346837) +++ stable/11/sys/i386/linux/syscalls.master Sun Apr 28 14:16:00 2019 (r346838) @@ -214,8 +214,8 @@ 115 AUE_SWAPOFF STD { int linux_swapoff(void); } 116 AUE_NULL STD { int linux_sysinfo(struct l_sysinfo *info); } 117 AUE_NULL STD { int linux_ipc(l_uint what, l_int arg1, \ - l_int arg2, l_int arg3, void *ptr, \ - l_long arg5); } + l_int arg2, l_uint arg3, l_uintptr_t ptr, \ + l_uint arg5); } 118 AUE_FSYNC NOPROTO { int fsync(int fd); } 119 AUE_SIGRETURN STD { int linux_sigreturn( \ struct l_sigframe *sfp); } From owner-svn-src-all@freebsd.org Sun Apr 28 14:19:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C808F157FA68; Sun, 28 Apr 2019 14:19:34 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FC6295671; Sun, 28 Apr 2019 14:19:34 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C51CBD52; Sun, 28 Apr 2019 14:19:34 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SEJY4U045126; Sun, 28 Apr 2019 14:19:34 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SEJVac045112; Sun, 28 Apr 2019 14:19:31 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281419.x3SEJVac045112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 14:19:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346839 - in stable/11/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/11/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Commit-Revision: 346839 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6FC6295671 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 14:19:35 -0000 Author: dchagin Date: Sun Apr 28 14:19:31 2019 New Revision: 346839 URL: https://svnweb.freebsd.org/changeset/base/346839 Log: MFC r345471, r345472, r346603: Update syscall.master to 5.0. For 32-bit Linuxulator, ipc() syscall was historically the entry point for the IPC API. Starting in Linux 4.18, direct syscalls are provided for the IPC. Enable it. Modified: stable/11/sys/amd64/linux/linux_dummy.c stable/11/sys/amd64/linux/linux_proto.h stable/11/sys/amd64/linux/linux_syscall.h stable/11/sys/amd64/linux/linux_syscalls.c stable/11/sys/amd64/linux/linux_sysent.c stable/11/sys/amd64/linux/linux_systrace_args.c stable/11/sys/amd64/linux/syscalls.master stable/11/sys/amd64/linux32/linux32_dummy.c stable/11/sys/amd64/linux32/linux32_proto.h stable/11/sys/amd64/linux32/linux32_syscall.h stable/11/sys/amd64/linux32/linux32_syscalls.c stable/11/sys/amd64/linux32/linux32_sysent.c stable/11/sys/amd64/linux32/linux32_systrace_args.c stable/11/sys/amd64/linux32/syscalls.master stable/11/sys/compat/linux/linux_ipc.h stable/11/sys/i386/linux/linux.h stable/11/sys/i386/linux/linux_dummy.c stable/11/sys/i386/linux/linux_proto.h stable/11/sys/i386/linux/linux_syscall.h stable/11/sys/i386/linux/linux_syscalls.c stable/11/sys/i386/linux/linux_sysent.c stable/11/sys/i386/linux/linux_systrace_args.c stable/11/sys/i386/linux/syscalls.master Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_dummy.c ============================================================================== --- stable/11/sys/amd64/linux/linux_dummy.c Sun Apr 28 14:16:00 2019 (r346838) +++ stable/11/sys/amd64/linux/linux_dummy.c Sun Apr 28 14:19:31 2019 (r346839) @@ -157,6 +157,16 @@ DUMMY(pwritev2); DUMMY(pkey_mprotect); DUMMY(pkey_alloc); DUMMY(pkey_free); +/* Linux 4.11: */ +DUMMY(statx); +/* Linux 4.18: */ +DUMMY(io_pgetevents); +DUMMY(rseq); +/* Linux 5.0: */ +DUMMY(pidfd_send_signal); +DUMMY(io_uring_setup); +DUMMY(io_uring_enter); +DUMMY(io_uring_register); #define DUMMY_XATTR(s) \ int \ Modified: stable/11/sys/amd64/linux/linux_proto.h ============================================================================== --- stable/11/sys/amd64/linux/linux_proto.h Sun Apr 28 14:16:00 2019 (r346838) +++ stable/11/sys/amd64/linux/linux_proto.h Sun Apr 28 14:19:31 2019 (r346839) @@ -1212,6 +1212,34 @@ struct linux_pkey_alloc_args { struct linux_pkey_free_args { char pkey_l_[PADL_(l_int)]; l_int pkey; char pkey_r_[PADR_(l_int)]; }; +struct linux_statx_args { + char dirfd_l_[PADL_(l_int)]; l_int dirfd; char dirfd_r_[PADR_(l_int)]; + char pathname_l_[PADL_(const char *)]; const char * pathname; char pathname_r_[PADR_(const char *)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; + char mask_l_[PADL_(l_uint)]; l_uint mask; char mask_r_[PADR_(l_uint)]; + char statxbuf_l_[PADL_(void *)]; void * statxbuf; char statxbuf_r_[PADR_(void *)]; +}; +struct linux_io_pgetevents_args { + register_t dummy; +}; +struct linux_rseq_args { + register_t dummy; +}; +struct linux_pidfd_send_signal_args { + char pidfd_l_[PADL_(l_int)]; l_int pidfd; char pidfd_r_[PADR_(l_int)]; + char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; + char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; +}; +struct linux_io_uring_setup_args { + register_t dummy; +}; +struct linux_io_uring_enter_args { + register_t dummy; +}; +struct linux_io_uring_register_args { + register_t dummy; +}; #define nosys linux_nosys int linux_open(struct thread *, struct linux_open_args *); int linux_newstat(struct thread *, struct linux_newstat_args *); @@ -1478,6 +1506,13 @@ int linux_pwritev2(struct thread *, struct linux_pwrit int linux_pkey_mprotect(struct thread *, struct linux_pkey_mprotect_args *); int linux_pkey_alloc(struct thread *, struct linux_pkey_alloc_args *); int linux_pkey_free(struct thread *, struct linux_pkey_free_args *); +int linux_statx(struct thread *, struct linux_statx_args *); +int linux_io_pgetevents(struct thread *, struct linux_io_pgetevents_args *); +int linux_rseq(struct thread *, struct linux_rseq_args *); +int linux_pidfd_send_signal(struct thread *, struct linux_pidfd_send_signal_args *); +int linux_io_uring_setup(struct thread *, struct linux_io_uring_setup_args *); +int linux_io_uring_enter(struct thread *, struct linux_io_uring_enter_args *); +int linux_io_uring_register(struct thread *, struct linux_io_uring_register_args *); #ifdef COMPAT_43 @@ -1778,6 +1813,13 @@ int linux_pkey_free(struct thread *, struct linux_pkey #define LINUX_SYS_AUE_linux_pkey_mprotect AUE_NULL #define LINUX_SYS_AUE_linux_pkey_alloc AUE_NULL #define LINUX_SYS_AUE_linux_pkey_free AUE_NULL +#define LINUX_SYS_AUE_linux_statx AUE_NULL +#define LINUX_SYS_AUE_linux_io_pgetevents AUE_NULL +#define LINUX_SYS_AUE_linux_rseq AUE_NULL +#define LINUX_SYS_AUE_linux_pidfd_send_signal AUE_NULL +#define LINUX_SYS_AUE_linux_io_uring_setup AUE_NULL +#define LINUX_SYS_AUE_linux_io_uring_enter AUE_NULL +#define LINUX_SYS_AUE_linux_io_uring_register AUE_NULL #undef PAD_ #undef PADL_ Modified: stable/11/sys/amd64/linux/linux_syscall.h ============================================================================== --- stable/11/sys/amd64/linux/linux_syscall.h Sun Apr 28 14:16:00 2019 (r346838) +++ stable/11/sys/amd64/linux/linux_syscall.h Sun Apr 28 14:19:31 2019 (r346839) @@ -313,4 +313,11 @@ #define LINUX_SYS_linux_pkey_mprotect 329 #define LINUX_SYS_linux_pkey_alloc 330 #define LINUX_SYS_linux_pkey_free 331 -#define LINUX_SYS_MAXSYSCALL 333 +#define LINUX_SYS_linux_statx 332 +#define LINUX_SYS_linux_io_pgetevents 333 +#define LINUX_SYS_linux_rseq 334 +#define LINUX_SYS_linux_pidfd_send_signal 424 +#define LINUX_SYS_linux_io_uring_setup 425 +#define LINUX_SYS_linux_io_uring_enter 426 +#define LINUX_SYS_linux_io_uring_register 427 +#define LINUX_SYS_MAXSYSCALL 429 Modified: stable/11/sys/amd64/linux/linux_syscalls.c ============================================================================== --- stable/11/sys/amd64/linux/linux_syscalls.c Sun Apr 28 14:16:00 2019 (r346838) +++ stable/11/sys/amd64/linux/linux_syscalls.c Sun Apr 28 14:19:31 2019 (r346839) @@ -339,5 +339,101 @@ const char *linux_syscallnames[] = { "linux_pkey_mprotect", /* 329 = linux_pkey_mprotect */ "linux_pkey_alloc", /* 330 = linux_pkey_alloc */ "linux_pkey_free", /* 331 = linux_pkey_free */ - "#332", /* 332 = nosys */ + "linux_statx", /* 332 = linux_statx */ + "linux_io_pgetevents", /* 333 = linux_io_pgetevents */ + "linux_rseq", /* 334 = linux_rseq */ + "#335", /* 335 = nosys */ + "#336", /* 336 = nosys */ + "#337", /* 337 = nosys */ + "#338", /* 338 = nosys */ + "#339", /* 339 = nosys */ + "#340", /* 340 = nosys */ + "#341", /* 341 = nosys */ + "#342", /* 342 = nosys */ + "#343", /* 343 = nosys */ + "#344", /* 344 = nosys */ + "#345", /* 345 = nosys */ + "#346", /* 346 = nosys */ + "#347", /* 347 = nosys */ + "#348", /* 348 = nosys */ + "#349", /* 349 = nosys */ + "#350", /* 350 = nosys */ + "#351", /* 351 = nosys */ + "#352", /* 352 = nosys */ + "#353", /* 353 = nosys */ + "#354", /* 354 = nosys */ + "#355", /* 355 = nosys */ + "#356", /* 356 = nosys */ + "#357", /* 357 = nosys */ + "#358", /* 358 = nosys */ + "#359", /* 359 = nosys */ + "#360", /* 360 = nosys */ + "#361", /* 361 = nosys */ + "#362", /* 362 = nosys */ + "#363", /* 363 = nosys */ + "#364", /* 364 = nosys */ + "#365", /* 365 = nosys */ + "#366", /* 366 = nosys */ + "#367", /* 367 = nosys */ + "#368", /* 368 = nosys */ + "#369", /* 369 = nosys */ + "#370", /* 370 = nosys */ + "#371", /* 371 = nosys */ + "#372", /* 372 = nosys */ + "#373", /* 373 = nosys */ + "#374", /* 374 = nosys */ + "#375", /* 375 = nosys */ + "#376", /* 376 = nosys */ + "#377", /* 377 = nosys */ + "#378", /* 378 = nosys */ + "#379", /* 379 = nosys */ + "#380", /* 380 = nosys */ + "#381", /* 381 = nosys */ + "#382", /* 382 = nosys */ + "#383", /* 383 = nosys */ + "#384", /* 384 = nosys */ + "#385", /* 385 = nosys */ + "#386", /* 386 = nosys */ + "#387", /* 387 = nosys */ + "#388", /* 388 = nosys */ + "#389", /* 389 = nosys */ + "#390", /* 390 = nosys */ + "#391", /* 391 = nosys */ + "#392", /* 392 = nosys */ + "#393", /* 393 = nosys */ + "#394", /* 394 = nosys */ + "#395", /* 395 = nosys */ + "#396", /* 396 = nosys */ + "#397", /* 397 = nosys */ + "#398", /* 398 = nosys */ + "#399", /* 399 = nosys */ + "#400", /* 400 = nosys */ + "#401", /* 401 = nosys */ + "#402", /* 402 = nosys */ + "#403", /* 403 = nosys */ + "#404", /* 404 = nosys */ + "#405", /* 405 = nosys */ + "#406", /* 406 = nosys */ + "#407", /* 407 = nosys */ + "#408", /* 408 = nosys */ + "#409", /* 409 = nosys */ + "#410", /* 410 = nosys */ + "#411", /* 411 = nosys */ + "#412", /* 412 = nosys */ + "#413", /* 413 = nosys */ + "#414", /* 414 = nosys */ + "#415", /* 415 = nosys */ + "#416", /* 416 = nosys */ + "#417", /* 417 = nosys */ + "#418", /* 418 = nosys */ + "#419", /* 419 = nosys */ + "#420", /* 420 = nosys */ + "#421", /* 421 = nosys */ + "#422", /* 422 = nosys */ + "#423", /* 423 = nosys */ + "linux_pidfd_send_signal", /* 424 = linux_pidfd_send_signal */ + "linux_io_uring_setup", /* 425 = linux_io_uring_setup */ + "linux_io_uring_enter", /* 426 = linux_io_uring_enter */ + "linux_io_uring_register", /* 427 = linux_io_uring_register */ + "#428", /* 428 = nosys */ }; Modified: stable/11/sys/amd64/linux/linux_sysent.c ============================================================================== --- stable/11/sys/amd64/linux/linux_sysent.c Sun Apr 28 14:16:00 2019 (r346838) +++ stable/11/sys/amd64/linux/linux_sysent.c Sun Apr 28 14:19:31 2019 (r346839) @@ -349,5 +349,101 @@ struct sysent linux_sysent[] = { { AS(linux_pkey_mprotect_args), (sy_call_t *)linux_pkey_mprotect, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = linux_pkey_mprotect */ { AS(linux_pkey_alloc_args), (sy_call_t *)linux_pkey_alloc, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 330 = linux_pkey_alloc */ { AS(linux_pkey_free_args), (sy_call_t *)linux_pkey_free, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 331 = linux_pkey_free */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 332 = nosys */ + { AS(linux_statx_args), (sy_call_t *)linux_statx, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 332 = linux_statx */ + { 0, (sy_call_t *)linux_io_pgetevents, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 333 = linux_io_pgetevents */ + { 0, (sy_call_t *)linux_rseq, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 334 = linux_rseq */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 335 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 336 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 337 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 338 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 339 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 340 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 341 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 342 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 343 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 344 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 345 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 346 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 347 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 348 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 349 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 350 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 351 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 352 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 353 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 354 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 355 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 356 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 357 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 358 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 359 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 360 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 361 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 362 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 363 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 364 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 365 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 366 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 367 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 368 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 369 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 370 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 371 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 372 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 373 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 374 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 375 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 376 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 377 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 378 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 379 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 380 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 381 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 382 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 383 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 384 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 385 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 386 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 387 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 388 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 389 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 390 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 391 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 392 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 393 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 394 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 395 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 396 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 397 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 398 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 399 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 400 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 401 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 402 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 403 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 404 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 405 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 406 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 407 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 408 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 409 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 410 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 411 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 412 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 413 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 414 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 415 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 416 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 417 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 418 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 419 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 420 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 421 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 422 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 423 = nosys */ + { AS(linux_pidfd_send_signal_args), (sy_call_t *)linux_pidfd_send_signal, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 424 = linux_pidfd_send_signal */ + { 0, (sy_call_t *)linux_io_uring_setup, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 425 = linux_io_uring_setup */ + { 0, (sy_call_t *)linux_io_uring_enter, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 426 = linux_io_uring_enter */ + { 0, (sy_call_t *)linux_io_uring_register, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 427 = linux_io_uring_register */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 428 = nosys */ }; Modified: stable/11/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- stable/11/sys/amd64/linux/linux_systrace_args.c Sun Apr 28 14:16:00 2019 (r346838) +++ stable/11/sys/amd64/linux/linux_systrace_args.c Sun Apr 28 14:19:31 2019 (r346839) @@ -2447,6 +2447,52 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 1; break; } + /* linux_statx */ + case 332: { + struct linux_statx_args *p = params; + iarg[0] = p->dirfd; /* l_int */ + uarg[1] = (intptr_t) p->pathname; /* const char * */ + iarg[2] = p->flags; /* l_uint */ + iarg[3] = p->mask; /* l_uint */ + uarg[4] = (intptr_t) p->statxbuf; /* void * */ + *n_args = 5; + break; + } + /* linux_io_pgetevents */ + case 333: { + *n_args = 0; + break; + } + /* linux_rseq */ + case 334: { + *n_args = 0; + break; + } + /* linux_pidfd_send_signal */ + case 424: { + struct linux_pidfd_send_signal_args *p = params; + iarg[0] = p->pidfd; /* l_int */ + iarg[1] = p->sig; /* l_int */ + uarg[2] = (intptr_t) p->info; /* l_siginfo_t * */ + iarg[3] = p->flags; /* l_uint */ + *n_args = 4; + break; + } + /* linux_io_uring_setup */ + case 425: { + *n_args = 0; + break; + } + /* linux_io_uring_enter */ + case 426: { + *n_args = 0; + break; + } + /* linux_io_uring_register */ + case 427: { + *n_args = 0; + break; + } default: *n_args = 0; break; @@ -6305,6 +6351,62 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* linux_statx */ + case 332: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "const char *"; + break; + case 2: + p = "l_uint"; + break; + case 3: + p = "l_uint"; + break; + case 4: + p = "void *"; + break; + default: + break; + }; + break; + /* linux_io_pgetevents */ + case 333: + break; + /* linux_rseq */ + case 334: + break; + /* linux_pidfd_send_signal */ + case 424: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "l_siginfo_t *"; + break; + case 3: + p = "l_uint"; + break; + default: + break; + }; + break; + /* linux_io_uring_setup */ + case 425: + break; + /* linux_io_uring_enter */ + case 426: + break; + /* linux_io_uring_register */ + case 427: + break; default: break; }; @@ -7647,6 +7749,26 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "int"; break; + /* linux_statx */ + case 332: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_io_pgetevents */ + case 333: + /* linux_rseq */ + case 334: + /* linux_pidfd_send_signal */ + case 424: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_io_uring_setup */ + case 425: + /* linux_io_uring_enter */ + case 426: + /* linux_io_uring_register */ + case 427: default: break; }; Modified: stable/11/sys/amd64/linux/syscalls.master ============================================================================== --- stable/11/sys/amd64/linux/syscalls.master Sun Apr 28 14:16:00 2019 (r346838) +++ stable/11/sys/amd64/linux/syscalls.master Sun Apr 28 14:19:31 2019 (r346839) @@ -595,7 +595,21 @@ 330 AUE_NULL STD { int linux_pkey_alloc(l_ulong flags, \ l_ulong init_val); } 331 AUE_NULL STD { int linux_pkey_free(l_int pkey); } +; Linux 4.11: +332 AUE_NULL STD { int linux_statx(l_int dirfd, \ + const char *pathname, l_uint flags, \ + l_uint mask, void *statxbuf); } +; Linux 4.18: +333 AUE_NULL STD { int linux_io_pgetevents(void); } +334 AUE_NULL STD { int linux_rseq(void); } +; Linux 5.0: +335-423 AUE_NULL UNIMPL nosys +424 AUE_NULL STD { int linux_pidfd_send_signal(l_int pidfd, \ + l_int sig, l_siginfo_t *info, l_uint flags); } +425 AUE_NULL STD { int linux_io_uring_setup(void); } +426 AUE_NULL STD { int linux_io_uring_enter(void); } +427 AUE_NULL STD { int linux_io_uring_register(void); } ; please, keep this line at the end. -332 AUE_NULL UNIMPL nosys +428 AUE_NULL UNIMPL nosys ; vim: syntax=off Modified: stable/11/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_dummy.c Sun Apr 28 14:16:00 2019 (r346838) +++ stable/11/sys/amd64/linux32/linux32_dummy.c Sun Apr 28 14:19:31 2019 (r346839) @@ -163,6 +163,37 @@ DUMMY(pwritev2); DUMMY(pkey_mprotect); DUMMY(pkey_alloc); DUMMY(pkey_free); +/* Linux 4.11: */ +DUMMY(statx); +DUMMY(arch_prctl); +/* Linux 4.18: */ +DUMMY(io_pgetevents); +DUMMY(rseq); +/* Linux 5.0: */ +DUMMY(clock_gettime64); +DUMMY(clock_settime64); +DUMMY(clock_adjtime64); +DUMMY(clock_getres_time64); +DUMMY(clock_nanosleep_time64); +DUMMY(timer_gettime64); +DUMMY(timer_settime64); +DUMMY(timerfd_gettime64); +DUMMY(timerfd_settime64); +DUMMY(utimensat_time64); +DUMMY(pselect6_time64); +DUMMY(ppoll_time64); +DUMMY(io_pgetevents_time64); +DUMMY(recvmmsg_time64); +DUMMY(mq_timedsend_time64); +DUMMY(mq_timedreceive_time64); +DUMMY(semtimedop_time64); +DUMMY(rt_sigtimedwait_time64); +DUMMY(futex_time64); +DUMMY(sched_rr_get_interval_time64); +DUMMY(pidfd_send_signal); +DUMMY(io_uring_setup); +DUMMY(io_uring_enter); +DUMMY(io_uring_register); #define DUMMY_XATTR(s) \ int \ Modified: stable/11/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/11/sys/amd64/linux32/linux32_proto.h Sun Apr 28 14:16:00 2019 (r346838) +++ stable/11/sys/amd64/linux32/linux32_proto.h Sun Apr 28 14:19:31 2019 (r346839) @@ -1364,6 +1364,149 @@ struct linux_pkey_alloc_args { struct linux_pkey_free_args { char pkey_l_[PADL_(l_int)]; l_int pkey; char pkey_r_[PADR_(l_int)]; }; +struct linux_statx_args { + char dirfd_l_[PADL_(l_int)]; l_int dirfd; char dirfd_r_[PADR_(l_int)]; + char pathname_l_[PADL_(const char *)]; const char * pathname; char pathname_r_[PADR_(const char *)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; + char mask_l_[PADL_(l_uint)]; l_uint mask; char mask_r_[PADR_(l_uint)]; + char statxbuf_l_[PADL_(void *)]; void * statxbuf; char statxbuf_r_[PADR_(void *)]; +}; +struct linux_arch_prctl_args { + char option_l_[PADL_(l_int)]; l_int option; char option_r_[PADR_(l_int)]; + char arg2_l_[PADL_(l_ulong)]; l_ulong arg2; char arg2_r_[PADR_(l_ulong)]; +}; +struct linux_io_pgetevents_args { + register_t dummy; +}; +struct linux_rseq_args { + register_t dummy; +}; +struct linux_semget_args { + char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)]; + char nsems_l_[PADL_(l_int)]; l_int nsems; char nsems_r_[PADR_(l_int)]; + char semflg_l_[PADL_(l_int)]; l_int semflg; char semflg_r_[PADR_(l_int)]; +}; +struct linux_semctl_args { + char semid_l_[PADL_(l_int)]; l_int semid; char semid_r_[PADR_(l_int)]; + char semnum_l_[PADL_(l_int)]; l_int semnum; char semnum_r_[PADR_(l_int)]; + char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)]; + char arg_l_[PADL_(union l_semun)]; union l_semun arg; char arg_r_[PADR_(union l_semun)]; +}; +struct linux_shmget_args { + char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)]; + char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; + char shmflg_l_[PADL_(l_int)]; l_int shmflg; char shmflg_r_[PADR_(l_int)]; +}; +struct linux_shmctl_args { + char shmid_l_[PADL_(l_int)]; l_int shmid; char shmid_r_[PADR_(l_int)]; + char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)]; + char buf_l_[PADL_(struct l_shmid_ds *)]; struct l_shmid_ds * buf; char buf_r_[PADR_(struct l_shmid_ds *)]; +}; +struct linux_shmat_args { + char shmid_l_[PADL_(l_int)]; l_int shmid; char shmid_r_[PADR_(l_int)]; + char shmaddr_l_[PADL_(char *)]; char * shmaddr; char shmaddr_r_[PADR_(char *)]; + char shmflg_l_[PADL_(l_int)]; l_int shmflg; char shmflg_r_[PADR_(l_int)]; +}; +struct linux_shmdt_args { + char shmaddr_l_[PADL_(char *)]; char * shmaddr; char shmaddr_r_[PADR_(char *)]; +}; +struct linux_msgget_args { + char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)]; + char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)]; +}; +struct linux_msgsnd_args { + char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)]; + char msgp_l_[PADL_(struct l_msgbuf *)]; struct l_msgbuf * msgp; char msgp_r_[PADR_(struct l_msgbuf *)]; + char msgsz_l_[PADL_(l_size_t)]; l_size_t msgsz; char msgsz_r_[PADR_(l_size_t)]; + char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)]; +}; +struct linux_msgrcv_args { + char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)]; + char msgp_l_[PADL_(struct l_msgbuf *)]; struct l_msgbuf * msgp; char msgp_r_[PADR_(struct l_msgbuf *)]; + char msgsz_l_[PADL_(l_size_t)]; l_size_t msgsz; char msgsz_r_[PADR_(l_size_t)]; + char msgtyp_l_[PADL_(l_long)]; l_long msgtyp; char msgtyp_r_[PADR_(l_long)]; + char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)]; +}; +struct linux_msgctl_args { + char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)]; + char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)]; + char buf_l_[PADL_(struct l_msqid_ds *)]; struct l_msqid_ds * buf; char buf_r_[PADR_(struct l_msqid_ds *)]; +}; +struct linux_clock_gettime64_args { + register_t dummy; +}; +struct linux_clock_settime64_args { + register_t dummy; +}; +struct linux_clock_adjtime64_args { + register_t dummy; +}; +struct linux_clock_getres_time64_args { + register_t dummy; +}; +struct linux_clock_nanosleep_time64_args { + register_t dummy; +}; +struct linux_timer_gettime64_args { + register_t dummy; +}; +struct linux_timer_settime64_args { + register_t dummy; +}; +struct linux_timerfd_gettime64_args { + register_t dummy; +}; +struct linux_timerfd_settime64_args { + register_t dummy; +}; +struct linux_utimensat_time64_args { + register_t dummy; +}; +struct linux_pselect6_time64_args { + register_t dummy; +}; +struct linux_ppoll_time64_args { + register_t dummy; +}; +struct linux_io_pgetevents_time64_args { + register_t dummy; +}; +struct linux_recvmmsg_time64_args { + register_t dummy; +}; +struct linux_mq_timedsend_time64_args { + register_t dummy; +}; +struct linux_mq_timedreceive_time64_args { + register_t dummy; +}; +struct linux_semtimedop_time64_args { + register_t dummy; +}; +struct linux_rt_sigtimedwait_time64_args { + register_t dummy; +}; +struct linux_futex_time64_args { + register_t dummy; +}; +struct linux_sched_rr_get_interval_time64_args { + register_t dummy; +}; +struct linux_pidfd_send_signal_args { + char pidfd_l_[PADL_(l_int)]; l_int pidfd; char pidfd_r_[PADR_(l_int)]; + char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; + char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; +}; +struct linux_io_uring_setup_args { + register_t dummy; +}; +struct linux_io_uring_enter_args { + register_t dummy; +}; +struct linux_io_uring_register_args { + register_t dummy; +}; #define nosys linux_nosys int linux_exit(struct thread *, struct linux_exit_args *); int linux_fork(struct thread *, struct linux_fork_args *); @@ -1672,6 +1815,44 @@ int linux_pwritev2(struct thread *, struct linux_pwrit int linux_pkey_mprotect(struct thread *, struct linux_pkey_mprotect_args *); int linux_pkey_alloc(struct thread *, struct linux_pkey_alloc_args *); int linux_pkey_free(struct thread *, struct linux_pkey_free_args *); +int linux_statx(struct thread *, struct linux_statx_args *); +int linux_arch_prctl(struct thread *, struct linux_arch_prctl_args *); +int linux_io_pgetevents(struct thread *, struct linux_io_pgetevents_args *); +int linux_rseq(struct thread *, struct linux_rseq_args *); +int linux_semget(struct thread *, struct linux_semget_args *); +int linux_semctl(struct thread *, struct linux_semctl_args *); +int linux_shmget(struct thread *, struct linux_shmget_args *); +int linux_shmctl(struct thread *, struct linux_shmctl_args *); +int linux_shmat(struct thread *, struct linux_shmat_args *); +int linux_shmdt(struct thread *, struct linux_shmdt_args *); +int linux_msgget(struct thread *, struct linux_msgget_args *); +int linux_msgsnd(struct thread *, struct linux_msgsnd_args *); +int linux_msgrcv(struct thread *, struct linux_msgrcv_args *); +int linux_msgctl(struct thread *, struct linux_msgctl_args *); +int linux_clock_gettime64(struct thread *, struct linux_clock_gettime64_args *); +int linux_clock_settime64(struct thread *, struct linux_clock_settime64_args *); +int linux_clock_adjtime64(struct thread *, struct linux_clock_adjtime64_args *); +int linux_clock_getres_time64(struct thread *, struct linux_clock_getres_time64_args *); +int linux_clock_nanosleep_time64(struct thread *, struct linux_clock_nanosleep_time64_args *); +int linux_timer_gettime64(struct thread *, struct linux_timer_gettime64_args *); +int linux_timer_settime64(struct thread *, struct linux_timer_settime64_args *); +int linux_timerfd_gettime64(struct thread *, struct linux_timerfd_gettime64_args *); +int linux_timerfd_settime64(struct thread *, struct linux_timerfd_settime64_args *); +int linux_utimensat_time64(struct thread *, struct linux_utimensat_time64_args *); +int linux_pselect6_time64(struct thread *, struct linux_pselect6_time64_args *); +int linux_ppoll_time64(struct thread *, struct linux_ppoll_time64_args *); +int linux_io_pgetevents_time64(struct thread *, struct linux_io_pgetevents_time64_args *); +int linux_recvmmsg_time64(struct thread *, struct linux_recvmmsg_time64_args *); +int linux_mq_timedsend_time64(struct thread *, struct linux_mq_timedsend_time64_args *); +int linux_mq_timedreceive_time64(struct thread *, struct linux_mq_timedreceive_time64_args *); +int linux_semtimedop_time64(struct thread *, struct linux_semtimedop_time64_args *); +int linux_rt_sigtimedwait_time64(struct thread *, struct linux_rt_sigtimedwait_time64_args *); +int linux_futex_time64(struct thread *, struct linux_futex_time64_args *); +int linux_sched_rr_get_interval_time64(struct thread *, struct linux_sched_rr_get_interval_time64_args *); +int linux_pidfd_send_signal(struct thread *, struct linux_pidfd_send_signal_args *); +int linux_io_uring_setup(struct thread *, struct linux_io_uring_setup_args *); +int linux_io_uring_enter(struct thread *, struct linux_io_uring_enter_args *); +int linux_io_uring_register(struct thread *, struct linux_io_uring_register_args *); #ifdef COMPAT_43 @@ -2014,6 +2195,44 @@ int linux_pkey_free(struct thread *, struct linux_pkey #define LINUX32_SYS_AUE_linux_pkey_mprotect AUE_NULL #define LINUX32_SYS_AUE_linux_pkey_alloc AUE_NULL #define LINUX32_SYS_AUE_linux_pkey_free AUE_NULL +#define LINUX32_SYS_AUE_linux_statx AUE_NULL +#define LINUX32_SYS_AUE_linux_arch_prctl AUE_NULL +#define LINUX32_SYS_AUE_linux_io_pgetevents AUE_NULL +#define LINUX32_SYS_AUE_linux_rseq AUE_NULL +#define LINUX32_SYS_AUE_linux_semget AUE_NULL +#define LINUX32_SYS_AUE_linux_semctl AUE_NULL +#define LINUX32_SYS_AUE_linux_shmget AUE_NULL +#define LINUX32_SYS_AUE_linux_shmctl AUE_NULL +#define LINUX32_SYS_AUE_linux_shmat AUE_NULL +#define LINUX32_SYS_AUE_linux_shmdt AUE_NULL +#define LINUX32_SYS_AUE_linux_msgget AUE_NULL +#define LINUX32_SYS_AUE_linux_msgsnd AUE_NULL +#define LINUX32_SYS_AUE_linux_msgrcv AUE_NULL +#define LINUX32_SYS_AUE_linux_msgctl AUE_NULL +#define LINUX32_SYS_AUE_linux_clock_gettime64 AUE_NULL +#define LINUX32_SYS_AUE_linux_clock_settime64 AUE_NULL +#define LINUX32_SYS_AUE_linux_clock_adjtime64 AUE_NULL +#define LINUX32_SYS_AUE_linux_clock_getres_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_clock_nanosleep_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_timer_gettime64 AUE_NULL +#define LINUX32_SYS_AUE_linux_timer_settime64 AUE_NULL +#define LINUX32_SYS_AUE_linux_timerfd_gettime64 AUE_NULL +#define LINUX32_SYS_AUE_linux_timerfd_settime64 AUE_NULL +#define LINUX32_SYS_AUE_linux_utimensat_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_pselect6_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_ppoll_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_io_pgetevents_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_recvmmsg_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_mq_timedsend_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_mq_timedreceive_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_semtimedop_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_rt_sigtimedwait_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_futex_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_sched_rr_get_interval_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_pidfd_send_signal AUE_NULL +#define LINUX32_SYS_AUE_linux_io_uring_setup AUE_NULL +#define LINUX32_SYS_AUE_linux_io_uring_enter AUE_NULL +#define LINUX32_SYS_AUE_linux_io_uring_register AUE_NULL #undef PAD_ #undef PADL_ Modified: stable/11/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/11/sys/amd64/linux32/linux32_syscall.h Sun Apr 28 14:16:00 2019 (r346838) +++ stable/11/sys/amd64/linux32/linux32_syscall.h Sun Apr 28 14:19:31 2019 (r346839) @@ -350,4 +350,42 @@ #define LINUX32_SYS_linux_pkey_mprotect 380 #define LINUX32_SYS_linux_pkey_alloc 381 #define LINUX32_SYS_linux_pkey_free 382 -#define LINUX32_SYS_MAXSYSCALL 384 +#define LINUX32_SYS_linux_statx 383 +#define LINUX32_SYS_linux_arch_prctl 384 +#define LINUX32_SYS_linux_io_pgetevents 385 +#define LINUX32_SYS_linux_rseq 386 +#define LINUX32_SYS_linux_semget 393 +#define LINUX32_SYS_linux_semctl 394 +#define LINUX32_SYS_linux_shmget 395 +#define LINUX32_SYS_linux_shmctl 396 +#define LINUX32_SYS_linux_shmat 397 +#define LINUX32_SYS_linux_shmdt 398 +#define LINUX32_SYS_linux_msgget 399 +#define LINUX32_SYS_linux_msgsnd 400 +#define LINUX32_SYS_linux_msgrcv 401 +#define LINUX32_SYS_linux_msgctl 402 +#define LINUX32_SYS_linux_clock_gettime64 403 +#define LINUX32_SYS_linux_clock_settime64 404 +#define LINUX32_SYS_linux_clock_adjtime64 405 +#define LINUX32_SYS_linux_clock_getres_time64 406 +#define LINUX32_SYS_linux_clock_nanosleep_time64 407 +#define LINUX32_SYS_linux_timer_gettime64 408 +#define LINUX32_SYS_linux_timer_settime64 409 +#define LINUX32_SYS_linux_timerfd_gettime64 410 +#define LINUX32_SYS_linux_timerfd_settime64 411 +#define LINUX32_SYS_linux_utimensat_time64 412 +#define LINUX32_SYS_linux_pselect6_time64 413 +#define LINUX32_SYS_linux_ppoll_time64 414 +#define LINUX32_SYS_linux_io_pgetevents_time64 416 +#define LINUX32_SYS_linux_recvmmsg_time64 417 +#define LINUX32_SYS_linux_mq_timedsend_time64 418 +#define LINUX32_SYS_linux_mq_timedreceive_time64 419 +#define LINUX32_SYS_linux_semtimedop_time64 420 +#define LINUX32_SYS_linux_rt_sigtimedwait_time64 421 +#define LINUX32_SYS_linux_futex_time64 422 +#define LINUX32_SYS_linux_sched_rr_get_interval_time64 423 +#define LINUX32_SYS_linux_pidfd_send_signal 424 +#define LINUX32_SYS_linux_io_uring_setup 425 +#define LINUX32_SYS_linux_io_uring_enter 426 +#define LINUX32_SYS_linux_io_uring_register 427 +#define LINUX32_SYS_MAXSYSCALL 429 Modified: stable/11/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_syscalls.c Sun Apr 28 14:16:00 2019 (r346838) +++ stable/11/sys/amd64/linux32/linux32_syscalls.c Sun Apr 28 14:19:31 2019 (r346839) @@ -390,5 +390,50 @@ const char *linux32_syscallnames[] = { "linux_pkey_mprotect", /* 380 = linux_pkey_mprotect */ "linux_pkey_alloc", /* 381 = linux_pkey_alloc */ "linux_pkey_free", /* 382 = linux_pkey_free */ - "#383", /* 383 = nosys */ + "linux_statx", /* 383 = linux_statx */ + "linux_arch_prctl", /* 384 = linux_arch_prctl */ + "linux_io_pgetevents", /* 385 = linux_io_pgetevents */ + "linux_rseq", /* 386 = linux_rseq */ + "#387", /* 387 = nosys */ + "#388", /* 388 = nosys */ + "#389", /* 389 = nosys */ + "#390", /* 390 = nosys */ + "#391", /* 391 = nosys */ + "#392", /* 392 = nosys */ + "linux_semget", /* 393 = linux_semget */ + "linux_semctl", /* 394 = linux_semctl */ + "linux_shmget", /* 395 = linux_shmget */ + "linux_shmctl", /* 396 = linux_shmctl */ + "linux_shmat", /* 397 = linux_shmat */ + "linux_shmdt", /* 398 = linux_shmdt */ + "linux_msgget", /* 399 = linux_msgget */ + "linux_msgsnd", /* 400 = linux_msgsnd */ + "linux_msgrcv", /* 401 = linux_msgrcv */ + "linux_msgctl", /* 402 = linux_msgctl */ + "linux_clock_gettime64", /* 403 = linux_clock_gettime64 */ + "linux_clock_settime64", /* 404 = linux_clock_settime64 */ + "linux_clock_adjtime64", /* 405 = linux_clock_adjtime64 */ + "linux_clock_getres_time64", /* 406 = linux_clock_getres_time64 */ + "linux_clock_nanosleep_time64", /* 407 = linux_clock_nanosleep_time64 */ + "linux_timer_gettime64", /* 408 = linux_timer_gettime64 */ + "linux_timer_settime64", /* 409 = linux_timer_settime64 */ + "linux_timerfd_gettime64", /* 410 = linux_timerfd_gettime64 */ + "linux_timerfd_settime64", /* 411 = linux_timerfd_settime64 */ + "linux_utimensat_time64", /* 412 = linux_utimensat_time64 */ + "linux_pselect6_time64", /* 413 = linux_pselect6_time64 */ + "linux_ppoll_time64", /* 414 = linux_ppoll_time64 */ + "#415", /* 415 = nosys */ + "linux_io_pgetevents_time64", /* 416 = linux_io_pgetevents_time64 */ + "linux_recvmmsg_time64", /* 417 = linux_recvmmsg_time64 */ + "linux_mq_timedsend_time64", /* 418 = linux_mq_timedsend_time64 */ + "linux_mq_timedreceive_time64", /* 419 = linux_mq_timedreceive_time64 */ + "linux_semtimedop_time64", /* 420 = linux_semtimedop_time64 */ + "linux_rt_sigtimedwait_time64", /* 421 = linux_rt_sigtimedwait_time64 */ + "linux_futex_time64", /* 422 = linux_futex_time64 */ + "linux_sched_rr_get_interval_time64", /* 423 = linux_sched_rr_get_interval_time64 */ + "linux_pidfd_send_signal", /* 424 = linux_pidfd_send_signal */ + "linux_io_uring_setup", /* 425 = linux_io_uring_setup */ + "linux_io_uring_enter", /* 426 = linux_io_uring_enter */ + "linux_io_uring_register", /* 427 = linux_io_uring_register */ + "#428", /* 428 = nosys */ }; Modified: stable/11/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_sysent.c Sun Apr 28 14:16:00 2019 (r346838) +++ stable/11/sys/amd64/linux32/linux32_sysent.c Sun Apr 28 14:19:31 2019 (r346839) @@ -401,5 +401,50 @@ struct sysent linux32_sysent[] = { { AS(linux_pkey_mprotect_args), (sy_call_t *)linux_pkey_mprotect, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 380 = linux_pkey_mprotect */ { AS(linux_pkey_alloc_args), (sy_call_t *)linux_pkey_alloc, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 381 = linux_pkey_alloc */ { AS(linux_pkey_free_args), (sy_call_t *)linux_pkey_free, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 382 = linux_pkey_free */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 383 = nosys */ + { AS(linux_statx_args), (sy_call_t *)linux_statx, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 383 = linux_statx */ + { AS(linux_arch_prctl_args), (sy_call_t *)linux_arch_prctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 384 = linux_arch_prctl */ + { 0, (sy_call_t *)linux_io_pgetevents, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 385 = linux_io_pgetevents */ + { 0, (sy_call_t *)linux_rseq, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 386 = linux_rseq */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 387 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 388 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 389 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 390 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 391 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 392 = nosys */ + { AS(linux_semget_args), (sy_call_t *)linux_semget, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 393 = linux_semget */ + { AS(linux_semctl_args), (sy_call_t *)linux_semctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 394 = linux_semctl */ + { AS(linux_shmget_args), (sy_call_t *)linux_shmget, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 395 = linux_shmget */ + { AS(linux_shmctl_args), (sy_call_t *)linux_shmctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 396 = linux_shmctl */ + { AS(linux_shmat_args), (sy_call_t *)linux_shmat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 397 = linux_shmat */ + { AS(linux_shmdt_args), (sy_call_t *)linux_shmdt, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 398 = linux_shmdt */ + { AS(linux_msgget_args), (sy_call_t *)linux_msgget, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 399 = linux_msgget */ + { AS(linux_msgsnd_args), (sy_call_t *)linux_msgsnd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 400 = linux_msgsnd */ + { AS(linux_msgrcv_args), (sy_call_t *)linux_msgrcv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 401 = linux_msgrcv */ + { AS(linux_msgctl_args), (sy_call_t *)linux_msgctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 402 = linux_msgctl */ + { 0, (sy_call_t *)linux_clock_gettime64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 403 = linux_clock_gettime64 */ + { 0, (sy_call_t *)linux_clock_settime64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 404 = linux_clock_settime64 */ + { 0, (sy_call_t *)linux_clock_adjtime64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 405 = linux_clock_adjtime64 */ + { 0, (sy_call_t *)linux_clock_getres_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 406 = linux_clock_getres_time64 */ + { 0, (sy_call_t *)linux_clock_nanosleep_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 407 = linux_clock_nanosleep_time64 */ + { 0, (sy_call_t *)linux_timer_gettime64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 408 = linux_timer_gettime64 */ + { 0, (sy_call_t *)linux_timer_settime64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 409 = linux_timer_settime64 */ + { 0, (sy_call_t *)linux_timerfd_gettime64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 410 = linux_timerfd_gettime64 */ + { 0, (sy_call_t *)linux_timerfd_settime64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 411 = linux_timerfd_settime64 */ + { 0, (sy_call_t *)linux_utimensat_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 412 = linux_utimensat_time64 */ + { 0, (sy_call_t *)linux_pselect6_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 413 = linux_pselect6_time64 */ + { 0, (sy_call_t *)linux_ppoll_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 414 = linux_ppoll_time64 */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 415 = nosys */ + { 0, (sy_call_t *)linux_io_pgetevents_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 416 = linux_io_pgetevents_time64 */ + { 0, (sy_call_t *)linux_recvmmsg_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 417 = linux_recvmmsg_time64 */ + { 0, (sy_call_t *)linux_mq_timedsend_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 418 = linux_mq_timedsend_time64 */ + { 0, (sy_call_t *)linux_mq_timedreceive_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 419 = linux_mq_timedreceive_time64 */ + { 0, (sy_call_t *)linux_semtimedop_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 420 = linux_semtimedop_time64 */ + { 0, (sy_call_t *)linux_rt_sigtimedwait_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 421 = linux_rt_sigtimedwait_time64 */ + { 0, (sy_call_t *)linux_futex_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 422 = linux_futex_time64 */ + { 0, (sy_call_t *)linux_sched_rr_get_interval_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 423 = linux_sched_rr_get_interval_time64 */ + { AS(linux_pidfd_send_signal_args), (sy_call_t *)linux_pidfd_send_signal, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 424 = linux_pidfd_send_signal */ + { 0, (sy_call_t *)linux_io_uring_setup, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 425 = linux_io_uring_setup */ + { 0, (sy_call_t *)linux_io_uring_enter, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 426 = linux_io_uring_enter */ + { 0, (sy_call_t *)linux_io_uring_register, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 427 = linux_io_uring_register */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 428 = nosys */ }; Modified: stable/11/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/11/sys/amd64/linux32/linux32_systrace_args.c Sun Apr 28 14:16:00 2019 (r346838) +++ stable/11/sys/amd64/linux32/linux32_systrace_args.c Sun Apr 28 14:19:31 2019 (r346839) @@ -2708,6 +2708,251 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 1; break; } + /* linux_statx */ + case 383: { + struct linux_statx_args *p = params; + iarg[0] = p->dirfd; /* l_int */ + uarg[1] = (intptr_t) p->pathname; /* const char * */ + iarg[2] = p->flags; /* l_uint */ + iarg[3] = p->mask; /* l_uint */ + uarg[4] = (intptr_t) p->statxbuf; /* void * */ + *n_args = 5; + break; + } + /* linux_arch_prctl */ + case 384: { + struct linux_arch_prctl_args *p = params; + iarg[0] = p->option; /* l_int */ + iarg[1] = p->arg2; /* l_ulong */ + *n_args = 2; + break; + } + /* linux_io_pgetevents */ + case 385: { + *n_args = 0; + break; + } + /* linux_rseq */ + case 386: { + *n_args = 0; + break; + } + /* linux_semget */ + case 393: { + struct linux_semget_args *p = params; + iarg[0] = p->key; /* l_key_t */ + iarg[1] = p->nsems; /* l_int */ + iarg[2] = p->semflg; /* l_int */ + *n_args = 3; + break; + } + /* linux_semctl */ + case 394: { + struct linux_semctl_args *p = params; + iarg[0] = p->semid; /* l_int */ + iarg[1] = p->semnum; /* l_int */ + iarg[2] = p->cmd; /* l_int */ + uarg[3] = p->arg.buf; /* union l_semun */ + *n_args = 4; + break; + } + /* linux_shmget */ + case 395: { + struct linux_shmget_args *p = params; + iarg[0] = p->key; /* l_key_t */ + iarg[1] = p->size; /* l_size_t */ + iarg[2] = p->shmflg; /* l_int */ + *n_args = 3; + break; + } + /* linux_shmctl */ + case 396: { + struct linux_shmctl_args *p = params; + iarg[0] = p->shmid; /* l_int */ + iarg[1] = p->cmd; /* l_int */ + uarg[2] = (intptr_t) p->buf; /* struct l_shmid_ds * */ + *n_args = 3; + break; + } + /* linux_shmat */ + case 397: { + struct linux_shmat_args *p = params; + iarg[0] = p->shmid; /* l_int */ + uarg[1] = (intptr_t) p->shmaddr; /* char * */ + iarg[2] = p->shmflg; /* l_int */ + *n_args = 3; + break; + } + /* linux_shmdt */ + case 398: { + struct linux_shmdt_args *p = params; + uarg[0] = (intptr_t) p->shmaddr; /* char * */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Apr 28 14:20:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFFBD157FAE7; Sun, 28 Apr 2019 14:20:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 661B3957A7; Sun, 28 Apr 2019 14:20:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3529EBD57; Sun, 28 Apr 2019 14:20:30 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SEKTMr045258; Sun, 28 Apr 2019 14:20:29 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SEKTWQ045257; Sun, 28 Apr 2019 14:20:29 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281420.x3SEKTWQ045257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 14:20:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346840 - stable/11/sys/compat/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/11/sys/compat/linux X-SVN-Commit-Revision: 346840 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 661B3957A7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 14:20:30 -0000 Author: dchagin Date: Sun Apr 28 14:20:29 2019 New Revision: 346840 URL: https://svnweb.freebsd.org/changeset/base/346840 Log: MFC r345473: Whitespace cleanup (annoying). Modified: stable/11/sys/compat/linux/linux_fork.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_fork.c ============================================================================== --- stable/11/sys/compat/linux/linux_fork.c Sun Apr 28 14:19:31 2019 (r346839) +++ stable/11/sys/compat/linux/linux_fork.c Sun Apr 28 14:20:29 2019 (r346840) @@ -352,7 +352,7 @@ linux_clone_thread(struct thread *td, struct linux_clo thread_unlock(td); if (P_SHOULDSTOP(p)) newtd->td_flags |= TDF_ASTPENDING | TDF_NEEDSUSPCHK; - + if (p->p_ptevents & PTRACE_LWP) newtd->td_dbgflags |= TDB_BORN; PROC_UNLOCK(p); From owner-svn-src-all@freebsd.org Sun Apr 28 14:30:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D618F157FDAE; Sun, 28 Apr 2019 14:30:26 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 759ED95C20; Sun, 28 Apr 2019 14:30:26 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AE88BF01; Sun, 28 Apr 2019 14:30:26 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SEUQhk050513; Sun, 28 Apr 2019 14:30:26 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SEUQcW050512; Sun, 28 Apr 2019 14:30:26 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281430.x3SEUQcW050512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 14:30:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346841 - stable/12/sys/amd64/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/12/sys/amd64/linux X-SVN-Commit-Revision: 346841 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 759ED95C20 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 14:30:27 -0000 Author: dchagin Date: Sun Apr 28 14:30:25 2019 New Revision: 346841 URL: https://svnweb.freebsd.org/changeset/base/346841 Log: MFC r345468: Revert r313993. AMD64_SET_**BASE expects a pointer to a pointer, we just passing in the pointer value itself. Set PCB_FULL_IRET for doreti to restore %fs, %gs and its correspondig base. PR: 225105 Modified: stable/12/sys/amd64/linux/linux_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/linux/linux_machdep.c ============================================================================== --- stable/12/sys/amd64/linux/linux_machdep.c Sun Apr 28 14:20:29 2019 (r346840) +++ stable/12/sys/amd64/linux/linux_machdep.c Sun Apr 28 14:30:25 2019 (r346841) @@ -228,35 +228,38 @@ linux_sigaltstack(struct thread *td, struct linux_siga int linux_arch_prctl(struct thread *td, struct linux_arch_prctl_args *args) { + struct pcb *pcb; int error; - struct sysarch_args bsd_args; + pcb = td->td_pcb; LINUX_CTR2(arch_prctl, "0x%x, %p", args->code, args->addr); switch (args->code) { case LINUX_ARCH_SET_GS: - bsd_args.op = AMD64_SET_GSBASE; - bsd_args.parms = (void *)args->addr; - error = sysarch(td, &bsd_args); - if (error == EINVAL) + if (args->addr < VM_MAXUSER_ADDRESS) { + set_pcb_flags(pcb, PCB_FULL_IRET); + pcb->pcb_gsbase = args->addr; + td->td_frame->tf_gs = _ugssel; + error = 0; + } else error = EPERM; break; case LINUX_ARCH_SET_FS: - bsd_args.op = AMD64_SET_FSBASE; - bsd_args.parms = (void *)args->addr; - error = sysarch(td, &bsd_args); - if (error == EINVAL) + if (args->addr < VM_MAXUSER_ADDRESS) { + set_pcb_flags(pcb, PCB_FULL_IRET); + pcb->pcb_fsbase = args->addr; + td->td_frame->tf_fs = _ufssel; + error = 0; + } else error = EPERM; break; case LINUX_ARCH_GET_FS: - bsd_args.op = AMD64_GET_FSBASE; - bsd_args.parms = (void *)args->addr; - error = sysarch(td, &bsd_args); + error = copyout(&pcb->pcb_fsbase, PTRIN(args->addr), + sizeof(args->addr)); break; case LINUX_ARCH_GET_GS: - bsd_args.op = AMD64_GET_GSBASE; - bsd_args.parms = (void *)args->addr; - error = sysarch(td, &bsd_args); + error = copyout(&pcb->pcb_gsbase, PTRIN(args->addr), + sizeof(args->addr)); break; default: error = EINVAL; From owner-svn-src-all@freebsd.org Sun Apr 28 14:34:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FCE4157FFAA; Sun, 28 Apr 2019 14:34:35 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A48E395FE8; Sun, 28 Apr 2019 14:34:34 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6911DC0B6; Sun, 28 Apr 2019 14:34:34 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SEYYOF055532; Sun, 28 Apr 2019 14:34:34 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SEYWa0055517; Sun, 28 Apr 2019 14:34:32 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281434.x3SEYWa0055517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 14:34:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346842 - in stable/12/sys: amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/12/sys: amd64/linux32 compat/linux i386/linux X-SVN-Commit-Revision: 346842 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A48E395FE8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 14:34:35 -0000 Author: dchagin Date: Sun Apr 28 14:34:31 2019 New Revision: 346842 URL: https://svnweb.freebsd.org/changeset/base/346842 Log: MFC r345469, r345470: Linux between 4.18 and 5.0 split IPC system calls. In preparation for doing this in the Linuxulator modify our linux_shmat() to match actual Linux shmat() system call. Modified: stable/12/sys/amd64/linux32/linux32_machdep.c stable/12/sys/amd64/linux32/linux32_proto.h stable/12/sys/amd64/linux32/linux32_systrace_args.c stable/12/sys/amd64/linux32/syscalls.master stable/12/sys/compat/linux/linux_ipc.c stable/12/sys/compat/linux/linux_ipc.h stable/12/sys/i386/linux/linux_machdep.c stable/12/sys/i386/linux/linux_proto.h stable/12/sys/i386/linux/linux_systrace_args.c stable/12/sys/i386/linux/syscalls.master Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- stable/12/sys/amd64/linux32/linux32_machdep.c Sun Apr 28 14:30:25 2019 (r346841) +++ stable/12/sys/amd64/linux32/linux32_machdep.c Sun Apr 28 14:34:31 2019 (r346842) @@ -259,7 +259,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar struct linux_semop_args a; a.semid = args->arg1; - a.tsops = args->ptr; + a.tsops = PTRIN(args->ptr); a.nsops = args->arg2; return (linux_semop(td, &a)); } @@ -278,7 +278,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar a.semid = args->arg1; a.semnum = args->arg2; a.cmd = args->arg3; - error = copyin(args->ptr, &a.arg, sizeof(a.arg)); + error = copyin(PTRIN(args->ptr), &a.arg, sizeof(a.arg)); if (error) return (error); return (linux_semctl(td, &a)); @@ -287,7 +287,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar struct linux_msgsnd_args a; a.msqid = args->arg1; - a.msgp = args->ptr; + a.msgp = PTRIN(args->ptr); a.msgsz = args->arg2; a.msgflg = args->arg3; return (linux_msgsnd(td, &a)); @@ -304,13 +304,13 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar if (args->ptr == 0) return (EINVAL); - error = copyin(args->ptr, &tmp, sizeof(tmp)); + error = copyin(PTRIN(args->ptr), &tmp, sizeof(tmp)); if (error) return (error); a.msgp = PTRIN(tmp.msgp); a.msgtyp = tmp.msgtyp; } else { - a.msgp = args->ptr; + a.msgp = PTRIN(args->ptr); a.msgtyp = args->arg5; } return (linux_msgrcv(td, &a)); @@ -327,22 +327,29 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar a.msqid = args->arg1; a.cmd = args->arg2; - a.buf = args->ptr; + a.buf = PTRIN(args->ptr); return (linux_msgctl(td, &a)); } case LINUX_SHMAT: { struct linux_shmat_args a; + l_uintptr_t addr; + int error; a.shmid = args->arg1; - a.shmaddr = args->ptr; + a.shmaddr = PTRIN(args->ptr); a.shmflg = args->arg2; - a.raddr = PTRIN((l_uint)args->arg3); - return (linux_shmat(td, &a)); + error = linux_shmat(td, &a); + if (error != 0) + return (error); + addr = td->td_retval[0]; + error = copyout(&addr, PTRIN(args->arg3), sizeof(addr)); + td->td_retval[0] = 0; + return (error); } case LINUX_SHMDT: { struct linux_shmdt_args a; - a.shmaddr = args->ptr; + a.shmaddr = PTRIN(args->ptr); return (linux_shmdt(td, &a)); } case LINUX_SHMGET: { @@ -358,7 +365,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar a.shmid = args->arg1; a.cmd = args->arg2; - a.buf = args->ptr; + a.buf = PTRIN(args->ptr); return (linux_shmctl(td, &a)); } default: Modified: stable/12/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/12/sys/amd64/linux32/linux32_proto.h Sun Apr 28 14:30:25 2019 (r346841) +++ stable/12/sys/amd64/linux32/linux32_proto.h Sun Apr 28 14:34:31 2019 (r346842) @@ -369,9 +369,9 @@ struct linux_ipc_args { char what_l_[PADL_(l_uint)]; l_uint what; char what_r_[PADR_(l_uint)]; char arg1_l_[PADL_(l_int)]; l_int arg1; char arg1_r_[PADR_(l_int)]; char arg2_l_[PADL_(l_int)]; l_int arg2; char arg2_r_[PADR_(l_int)]; - char arg3_l_[PADL_(l_int)]; l_int arg3; char arg3_r_[PADR_(l_int)]; - char ptr_l_[PADL_(void *)]; void * ptr; char ptr_r_[PADR_(void *)]; - char arg5_l_[PADL_(l_long)]; l_long arg5; char arg5_r_[PADR_(l_long)]; + char arg3_l_[PADL_(l_uint)]; l_uint arg3; char arg3_r_[PADR_(l_uint)]; + char ptr_l_[PADL_(l_uintptr_t)]; l_uintptr_t ptr; char ptr_r_[PADR_(l_uintptr_t)]; + char arg5_l_[PADL_(l_uint)]; l_uint arg5; char arg5_r_[PADR_(l_uint)]; }; struct linux_sigreturn_args { char sfp_l_[PADL_(struct l_sigframe *)]; struct l_sigframe * sfp; char sfp_r_[PADR_(struct l_sigframe *)]; Modified: stable/12/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/12/sys/amd64/linux32/linux32_systrace_args.c Sun Apr 28 14:30:25 2019 (r346841) +++ stable/12/sys/amd64/linux32/linux32_systrace_args.c Sun Apr 28 14:34:31 2019 (r346842) @@ -785,9 +785,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg iarg[0] = p->what; /* l_uint */ iarg[1] = p->arg1; /* l_int */ iarg[2] = p->arg2; /* l_int */ - iarg[3] = p->arg3; /* l_int */ - uarg[4] = (intptr_t) p->ptr; /* void * */ - iarg[5] = p->arg5; /* l_long */ + iarg[3] = p->arg3; /* l_uint */ + iarg[4] = p->ptr; /* l_uintptr_t */ + iarg[5] = p->arg5; /* l_uint */ *n_args = 6; break; } @@ -3894,13 +3894,13 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "l_int"; break; case 3: - p = "l_int"; + p = "l_uint"; break; case 4: - p = "userland void *"; + p = "l_uintptr_t"; break; case 5: - p = "l_long"; + p = "l_uint"; break; default: break; Modified: stable/12/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/12/sys/amd64/linux32/syscalls.master Sun Apr 28 14:30:25 2019 (r346841) +++ stable/12/sys/amd64/linux32/syscalls.master Sun Apr 28 14:34:31 2019 (r346842) @@ -212,8 +212,8 @@ 115 AUE_SWAPOFF STD { int linux_swapoff(void); } 116 AUE_NULL STD { int linux_sysinfo(struct l_sysinfo *info); } 117 AUE_NULL STD { int linux_ipc(l_uint what, l_int arg1, \ - l_int arg2, l_int arg3, void *ptr, \ - l_long arg5); } + l_int arg2, l_uint arg3, l_uintptr_t ptr, \ + l_uint arg5); } 118 AUE_FSYNC NOPROTO { int fsync(int fd); } 119 AUE_SIGRETURN STD { int linux_sigreturn( \ struct l_sigframe *sfp); } Modified: stable/12/sys/compat/linux/linux_ipc.c ============================================================================== --- stable/12/sys/compat/linux/linux_ipc.c Sun Apr 28 14:30:25 2019 (r346841) +++ stable/12/sys/compat/linux/linux_ipc.c Sun Apr 28 14:34:31 2019 (r346842) @@ -785,23 +785,11 @@ linux_shmat(struct thread *td, struct linux_shmat_args void *shmaddr; int shmflg; } */ bsd_args; - int error; -#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) - l_uintptr_t addr; -#endif bsd_args.shmid = args->shmid; bsd_args.shmaddr = PTRIN(args->shmaddr); bsd_args.shmflg = args->shmflg; - if ((error = sys_shmat(td, &bsd_args))) - return (error); -#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) - addr = td->td_retval[0]; - if ((error = copyout(&addr, PTRIN(args->raddr), sizeof(addr)))) - return (error); - td->td_retval[0] = 0; -#endif - return (0); + return (sys_shmat(td, &bsd_args)); } int Modified: stable/12/sys/compat/linux/linux_ipc.h ============================================================================== --- stable/12/sys/compat/linux/linux_ipc.h Sun Apr 28 14:30:25 2019 (r346841) +++ stable/12/sys/compat/linux/linux_ipc.h Sun Apr 28 14:34:31 2019 (r346842) @@ -141,7 +141,6 @@ struct linux_shmat_args l_int shmid; char *shmaddr; l_int shmflg; - l_ulong *raddr; }; struct linux_shmctl_args Modified: stable/12/sys/i386/linux/linux_machdep.c ============================================================================== --- stable/12/sys/i386/linux/linux_machdep.c Sun Apr 28 14:30:25 2019 (r346841) +++ stable/12/sys/i386/linux/linux_machdep.c Sun Apr 28 14:34:31 2019 (r346842) @@ -133,7 +133,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar struct linux_semop_args a; a.semid = args->arg1; - a.tsops = args->ptr; + a.tsops = PTRIN(args->ptr); a.nsops = args->arg2; return (linux_semop(td, &a)); } @@ -152,7 +152,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar a.semid = args->arg1; a.semnum = args->arg2; a.cmd = args->arg3; - error = copyin(args->ptr, &a.arg, sizeof(a.arg)); + error = copyin(PTRIN(args->ptr), &a.arg, sizeof(a.arg)); if (error) return (error); return (linux_semctl(td, &a)); @@ -161,7 +161,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar struct linux_msgsnd_args a; a.msqid = args->arg1; - a.msgp = args->ptr; + a.msgp = PTRIN(args->ptr); a.msgsz = args->arg2; a.msgflg = args->arg3; return (linux_msgsnd(td, &a)); @@ -176,15 +176,15 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar struct l_ipc_kludge tmp; int error; - if (args->ptr == NULL) + if (args->ptr == 0) return (EINVAL); - error = copyin(args->ptr, &tmp, sizeof(tmp)); + error = copyin(PTRIN(args->ptr), &tmp, sizeof(tmp)); if (error) return (error); - a.msgp = tmp.msgp; + a.msgp = PTRIN(tmp.msgp); a.msgtyp = tmp.msgtyp; } else { - a.msgp = args->ptr; + a.msgp = PTRIN(args->ptr); a.msgtyp = args->arg5; } return (linux_msgrcv(td, &a)); @@ -201,22 +201,29 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar a.msqid = args->arg1; a.cmd = args->arg2; - a.buf = args->ptr; + a.buf = PTRIN(args->ptr); return (linux_msgctl(td, &a)); } case LINUX_SHMAT: { struct linux_shmat_args a; + l_uintptr_t addr; + int error; a.shmid = args->arg1; - a.shmaddr = args->ptr; + a.shmaddr = PTRIN(args->ptr); a.shmflg = args->arg2; - a.raddr = (l_ulong *)args->arg3; - return (linux_shmat(td, &a)); + error = linux_shmat(td, &a); + if (error != 0) + return (error); + addr = td->td_retval[0]; + error = copyout(&addr, PTRIN(args->arg3), sizeof(addr)); + td->td_retval[0] = 0; + return (error); } case LINUX_SHMDT: { struct linux_shmdt_args a; - a.shmaddr = args->ptr; + a.shmaddr = PTRIN(args->ptr); return (linux_shmdt(td, &a)); } case LINUX_SHMGET: { @@ -232,7 +239,7 @@ linux_ipc(struct thread *td, struct linux_ipc_args *ar a.shmid = args->arg1; a.cmd = args->arg2; - a.buf = args->ptr; + a.buf = PTRIN(args->ptr); return (linux_shmctl(td, &a)); } default: Modified: stable/12/sys/i386/linux/linux_proto.h ============================================================================== --- stable/12/sys/i386/linux/linux_proto.h Sun Apr 28 14:30:25 2019 (r346841) +++ stable/12/sys/i386/linux/linux_proto.h Sun Apr 28 14:34:31 2019 (r346842) @@ -372,9 +372,9 @@ struct linux_ipc_args { char what_l_[PADL_(l_uint)]; l_uint what; char what_r_[PADR_(l_uint)]; char arg1_l_[PADL_(l_int)]; l_int arg1; char arg1_r_[PADR_(l_int)]; char arg2_l_[PADL_(l_int)]; l_int arg2; char arg2_r_[PADR_(l_int)]; - char arg3_l_[PADL_(l_int)]; l_int arg3; char arg3_r_[PADR_(l_int)]; - char ptr_l_[PADL_(void *)]; void * ptr; char ptr_r_[PADR_(void *)]; - char arg5_l_[PADL_(l_long)]; l_long arg5; char arg5_r_[PADR_(l_long)]; + char arg3_l_[PADL_(l_uint)]; l_uint arg3; char arg3_r_[PADR_(l_uint)]; + char ptr_l_[PADL_(l_uintptr_t)]; l_uintptr_t ptr; char ptr_r_[PADR_(l_uintptr_t)]; + char arg5_l_[PADL_(l_uint)]; l_uint arg5; char arg5_r_[PADR_(l_uint)]; }; struct linux_sigreturn_args { char sfp_l_[PADL_(struct l_sigframe *)]; struct l_sigframe * sfp; char sfp_r_[PADR_(struct l_sigframe *)]; Modified: stable/12/sys/i386/linux/linux_systrace_args.c ============================================================================== --- stable/12/sys/i386/linux/linux_systrace_args.c Sun Apr 28 14:30:25 2019 (r346841) +++ stable/12/sys/i386/linux/linux_systrace_args.c Sun Apr 28 14:34:31 2019 (r346842) @@ -814,9 +814,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg iarg[0] = p->what; /* l_uint */ iarg[1] = p->arg1; /* l_int */ iarg[2] = p->arg2; /* l_int */ - iarg[3] = p->arg3; /* l_int */ - uarg[4] = (intptr_t) p->ptr; /* void * */ - iarg[5] = p->arg5; /* l_long */ + iarg[3] = p->arg3; /* l_uint */ + iarg[4] = p->ptr; /* l_uintptr_t */ + iarg[5] = p->arg5; /* l_uint */ *n_args = 6; break; } @@ -4012,13 +4012,13 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "l_int"; break; case 3: - p = "l_int"; + p = "l_uint"; break; case 4: - p = "userland void *"; + p = "l_uintptr_t"; break; case 5: - p = "l_long"; + p = "l_uint"; break; default: break; Modified: stable/12/sys/i386/linux/syscalls.master ============================================================================== --- stable/12/sys/i386/linux/syscalls.master Sun Apr 28 14:30:25 2019 (r346841) +++ stable/12/sys/i386/linux/syscalls.master Sun Apr 28 14:34:31 2019 (r346842) @@ -214,8 +214,8 @@ 115 AUE_SWAPOFF STD { int linux_swapoff(void); } 116 AUE_NULL STD { int linux_sysinfo(struct l_sysinfo *info); } 117 AUE_NULL STD { int linux_ipc(l_uint what, l_int arg1, \ - l_int arg2, l_int arg3, void *ptr, \ - l_long arg5); } + l_int arg2, l_uint arg3, l_uintptr_t ptr, \ + l_uint arg5); } 118 AUE_FSYNC NOPROTO { int fsync(int fd); } 119 AUE_SIGRETURN STD { int linux_sigreturn( \ struct l_sigframe *sfp); } From owner-svn-src-all@freebsd.org Sun Apr 28 14:37:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25294158003C; Sun, 28 Apr 2019 14:37:24 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4CD396163; Sun, 28 Apr 2019 14:37:23 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A99A6C0BB; Sun, 28 Apr 2019 14:37:23 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SEbNXJ055984; Sun, 28 Apr 2019 14:37:23 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SEbKhD055963; Sun, 28 Apr 2019 14:37:20 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281437.x3SEbKhD055963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 14:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346843 - in stable/12/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in stable/12/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Commit-Revision: 346843 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C4CD396163 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 14:37:24 -0000 Author: dchagin Date: Sun Apr 28 14:37:20 2019 New Revision: 346843 URL: https://svnweb.freebsd.org/changeset/base/346843 Log: MFC r345471, r345472, r346603: Update syscall.master to 5.0. For 32-bit Linuxulator, ipc() syscall was historically the entry point for the IPC API. Starting in Linux 4.18, direct syscalls are provided for the IPC. Enable it. Modified: stable/12/sys/amd64/linux/linux_dummy.c stable/12/sys/amd64/linux/linux_proto.h stable/12/sys/amd64/linux/linux_syscall.h stable/12/sys/amd64/linux/linux_syscalls.c stable/12/sys/amd64/linux/linux_sysent.c stable/12/sys/amd64/linux/linux_systrace_args.c stable/12/sys/amd64/linux/syscalls.master stable/12/sys/amd64/linux32/linux32_dummy.c stable/12/sys/amd64/linux32/linux32_proto.h stable/12/sys/amd64/linux32/linux32_syscall.h stable/12/sys/amd64/linux32/linux32_syscalls.c stable/12/sys/amd64/linux32/linux32_sysent.c stable/12/sys/amd64/linux32/linux32_systrace_args.c stable/12/sys/amd64/linux32/syscalls.master stable/12/sys/compat/linux/linux_ipc.h stable/12/sys/i386/linux/linux.h stable/12/sys/i386/linux/linux_dummy.c stable/12/sys/i386/linux/linux_proto.h stable/12/sys/i386/linux/linux_syscall.h stable/12/sys/i386/linux/linux_syscalls.c stable/12/sys/i386/linux/linux_sysent.c stable/12/sys/i386/linux/linux_systrace_args.c stable/12/sys/i386/linux/syscalls.master Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/linux/linux_dummy.c ============================================================================== --- stable/12/sys/amd64/linux/linux_dummy.c Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux/linux_dummy.c Sun Apr 28 14:37:20 2019 (r346843) @@ -155,6 +155,16 @@ DUMMY(pwritev2); DUMMY(pkey_mprotect); DUMMY(pkey_alloc); DUMMY(pkey_free); +/* Linux 4.11: */ +DUMMY(statx); +/* Linux 4.18: */ +DUMMY(io_pgetevents); +DUMMY(rseq); +/* Linux 5.0: */ +DUMMY(pidfd_send_signal); +DUMMY(io_uring_setup); +DUMMY(io_uring_enter); +DUMMY(io_uring_register); #define DUMMY_XATTR(s) \ int \ Modified: stable/12/sys/amd64/linux/linux_proto.h ============================================================================== --- stable/12/sys/amd64/linux/linux_proto.h Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux/linux_proto.h Sun Apr 28 14:37:20 2019 (r346843) @@ -1213,6 +1213,34 @@ struct linux_pkey_alloc_args { struct linux_pkey_free_args { char pkey_l_[PADL_(l_int)]; l_int pkey; char pkey_r_[PADR_(l_int)]; }; +struct linux_statx_args { + char dirfd_l_[PADL_(l_int)]; l_int dirfd; char dirfd_r_[PADR_(l_int)]; + char pathname_l_[PADL_(const char *)]; const char * pathname; char pathname_r_[PADR_(const char *)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; + char mask_l_[PADL_(l_uint)]; l_uint mask; char mask_r_[PADR_(l_uint)]; + char statxbuf_l_[PADL_(void *)]; void * statxbuf; char statxbuf_r_[PADR_(void *)]; +}; +struct linux_io_pgetevents_args { + register_t dummy; +}; +struct linux_rseq_args { + register_t dummy; +}; +struct linux_pidfd_send_signal_args { + char pidfd_l_[PADL_(l_int)]; l_int pidfd; char pidfd_r_[PADR_(l_int)]; + char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; + char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; +}; +struct linux_io_uring_setup_args { + register_t dummy; +}; +struct linux_io_uring_enter_args { + register_t dummy; +}; +struct linux_io_uring_register_args { + register_t dummy; +}; #define nosys linux_nosys int linux_open(struct thread *, struct linux_open_args *); int linux_newstat(struct thread *, struct linux_newstat_args *); @@ -1479,6 +1507,13 @@ int linux_pwritev2(struct thread *, struct linux_pwrit int linux_pkey_mprotect(struct thread *, struct linux_pkey_mprotect_args *); int linux_pkey_alloc(struct thread *, struct linux_pkey_alloc_args *); int linux_pkey_free(struct thread *, struct linux_pkey_free_args *); +int linux_statx(struct thread *, struct linux_statx_args *); +int linux_io_pgetevents(struct thread *, struct linux_io_pgetevents_args *); +int linux_rseq(struct thread *, struct linux_rseq_args *); +int linux_pidfd_send_signal(struct thread *, struct linux_pidfd_send_signal_args *); +int linux_io_uring_setup(struct thread *, struct linux_io_uring_setup_args *); +int linux_io_uring_enter(struct thread *, struct linux_io_uring_enter_args *); +int linux_io_uring_register(struct thread *, struct linux_io_uring_register_args *); #ifdef COMPAT_43 @@ -1786,6 +1821,13 @@ int linux_pkey_free(struct thread *, struct linux_pkey #define LINUX_SYS_AUE_linux_pkey_mprotect AUE_NULL #define LINUX_SYS_AUE_linux_pkey_alloc AUE_NULL #define LINUX_SYS_AUE_linux_pkey_free AUE_NULL +#define LINUX_SYS_AUE_linux_statx AUE_NULL +#define LINUX_SYS_AUE_linux_io_pgetevents AUE_NULL +#define LINUX_SYS_AUE_linux_rseq AUE_NULL +#define LINUX_SYS_AUE_linux_pidfd_send_signal AUE_NULL +#define LINUX_SYS_AUE_linux_io_uring_setup AUE_NULL +#define LINUX_SYS_AUE_linux_io_uring_enter AUE_NULL +#define LINUX_SYS_AUE_linux_io_uring_register AUE_NULL #undef PAD_ #undef PADL_ Modified: stable/12/sys/amd64/linux/linux_syscall.h ============================================================================== --- stable/12/sys/amd64/linux/linux_syscall.h Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux/linux_syscall.h Sun Apr 28 14:37:20 2019 (r346843) @@ -313,4 +313,11 @@ #define LINUX_SYS_linux_pkey_mprotect 329 #define LINUX_SYS_linux_pkey_alloc 330 #define LINUX_SYS_linux_pkey_free 331 -#define LINUX_SYS_MAXSYSCALL 333 +#define LINUX_SYS_linux_statx 332 +#define LINUX_SYS_linux_io_pgetevents 333 +#define LINUX_SYS_linux_rseq 334 +#define LINUX_SYS_linux_pidfd_send_signal 424 +#define LINUX_SYS_linux_io_uring_setup 425 +#define LINUX_SYS_linux_io_uring_enter 426 +#define LINUX_SYS_linux_io_uring_register 427 +#define LINUX_SYS_MAXSYSCALL 429 Modified: stable/12/sys/amd64/linux/linux_syscalls.c ============================================================================== --- stable/12/sys/amd64/linux/linux_syscalls.c Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux/linux_syscalls.c Sun Apr 28 14:37:20 2019 (r346843) @@ -339,5 +339,101 @@ const char *linux_syscallnames[] = { "linux_pkey_mprotect", /* 329 = linux_pkey_mprotect */ "linux_pkey_alloc", /* 330 = linux_pkey_alloc */ "linux_pkey_free", /* 331 = linux_pkey_free */ - "#332", /* 332 = nosys */ + "linux_statx", /* 332 = linux_statx */ + "linux_io_pgetevents", /* 333 = linux_io_pgetevents */ + "linux_rseq", /* 334 = linux_rseq */ + "#335", /* 335 = nosys */ + "#336", /* 336 = nosys */ + "#337", /* 337 = nosys */ + "#338", /* 338 = nosys */ + "#339", /* 339 = nosys */ + "#340", /* 340 = nosys */ + "#341", /* 341 = nosys */ + "#342", /* 342 = nosys */ + "#343", /* 343 = nosys */ + "#344", /* 344 = nosys */ + "#345", /* 345 = nosys */ + "#346", /* 346 = nosys */ + "#347", /* 347 = nosys */ + "#348", /* 348 = nosys */ + "#349", /* 349 = nosys */ + "#350", /* 350 = nosys */ + "#351", /* 351 = nosys */ + "#352", /* 352 = nosys */ + "#353", /* 353 = nosys */ + "#354", /* 354 = nosys */ + "#355", /* 355 = nosys */ + "#356", /* 356 = nosys */ + "#357", /* 357 = nosys */ + "#358", /* 358 = nosys */ + "#359", /* 359 = nosys */ + "#360", /* 360 = nosys */ + "#361", /* 361 = nosys */ + "#362", /* 362 = nosys */ + "#363", /* 363 = nosys */ + "#364", /* 364 = nosys */ + "#365", /* 365 = nosys */ + "#366", /* 366 = nosys */ + "#367", /* 367 = nosys */ + "#368", /* 368 = nosys */ + "#369", /* 369 = nosys */ + "#370", /* 370 = nosys */ + "#371", /* 371 = nosys */ + "#372", /* 372 = nosys */ + "#373", /* 373 = nosys */ + "#374", /* 374 = nosys */ + "#375", /* 375 = nosys */ + "#376", /* 376 = nosys */ + "#377", /* 377 = nosys */ + "#378", /* 378 = nosys */ + "#379", /* 379 = nosys */ + "#380", /* 380 = nosys */ + "#381", /* 381 = nosys */ + "#382", /* 382 = nosys */ + "#383", /* 383 = nosys */ + "#384", /* 384 = nosys */ + "#385", /* 385 = nosys */ + "#386", /* 386 = nosys */ + "#387", /* 387 = nosys */ + "#388", /* 388 = nosys */ + "#389", /* 389 = nosys */ + "#390", /* 390 = nosys */ + "#391", /* 391 = nosys */ + "#392", /* 392 = nosys */ + "#393", /* 393 = nosys */ + "#394", /* 394 = nosys */ + "#395", /* 395 = nosys */ + "#396", /* 396 = nosys */ + "#397", /* 397 = nosys */ + "#398", /* 398 = nosys */ + "#399", /* 399 = nosys */ + "#400", /* 400 = nosys */ + "#401", /* 401 = nosys */ + "#402", /* 402 = nosys */ + "#403", /* 403 = nosys */ + "#404", /* 404 = nosys */ + "#405", /* 405 = nosys */ + "#406", /* 406 = nosys */ + "#407", /* 407 = nosys */ + "#408", /* 408 = nosys */ + "#409", /* 409 = nosys */ + "#410", /* 410 = nosys */ + "#411", /* 411 = nosys */ + "#412", /* 412 = nosys */ + "#413", /* 413 = nosys */ + "#414", /* 414 = nosys */ + "#415", /* 415 = nosys */ + "#416", /* 416 = nosys */ + "#417", /* 417 = nosys */ + "#418", /* 418 = nosys */ + "#419", /* 419 = nosys */ + "#420", /* 420 = nosys */ + "#421", /* 421 = nosys */ + "#422", /* 422 = nosys */ + "#423", /* 423 = nosys */ + "linux_pidfd_send_signal", /* 424 = linux_pidfd_send_signal */ + "linux_io_uring_setup", /* 425 = linux_io_uring_setup */ + "linux_io_uring_enter", /* 426 = linux_io_uring_enter */ + "linux_io_uring_register", /* 427 = linux_io_uring_register */ + "#428", /* 428 = nosys */ }; Modified: stable/12/sys/amd64/linux/linux_sysent.c ============================================================================== --- stable/12/sys/amd64/linux/linux_sysent.c Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux/linux_sysent.c Sun Apr 28 14:37:20 2019 (r346843) @@ -349,5 +349,101 @@ struct sysent linux_sysent[] = { { AS(linux_pkey_mprotect_args), (sy_call_t *)linux_pkey_mprotect, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = linux_pkey_mprotect */ { AS(linux_pkey_alloc_args), (sy_call_t *)linux_pkey_alloc, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 330 = linux_pkey_alloc */ { AS(linux_pkey_free_args), (sy_call_t *)linux_pkey_free, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 331 = linux_pkey_free */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 332 = nosys */ + { AS(linux_statx_args), (sy_call_t *)linux_statx, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 332 = linux_statx */ + { 0, (sy_call_t *)linux_io_pgetevents, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 333 = linux_io_pgetevents */ + { 0, (sy_call_t *)linux_rseq, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 334 = linux_rseq */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 335 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 336 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 337 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 338 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 339 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 340 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 341 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 342 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 343 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 344 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 345 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 346 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 347 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 348 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 349 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 350 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 351 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 352 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 353 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 354 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 355 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 356 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 357 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 358 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 359 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 360 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 361 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 362 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 363 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 364 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 365 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 366 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 367 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 368 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 369 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 370 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 371 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 372 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 373 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 374 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 375 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 376 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 377 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 378 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 379 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 380 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 381 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 382 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 383 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 384 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 385 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 386 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 387 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 388 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 389 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 390 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 391 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 392 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 393 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 394 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 395 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 396 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 397 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 398 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 399 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 400 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 401 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 402 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 403 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 404 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 405 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 406 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 407 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 408 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 409 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 410 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 411 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 412 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 413 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 414 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 415 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 416 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 417 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 418 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 419 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 420 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 421 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 422 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 423 = nosys */ + { AS(linux_pidfd_send_signal_args), (sy_call_t *)linux_pidfd_send_signal, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 424 = linux_pidfd_send_signal */ + { 0, (sy_call_t *)linux_io_uring_setup, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 425 = linux_io_uring_setup */ + { 0, (sy_call_t *)linux_io_uring_enter, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 426 = linux_io_uring_enter */ + { 0, (sy_call_t *)linux_io_uring_register, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 427 = linux_io_uring_register */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 428 = nosys */ }; Modified: stable/12/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- stable/12/sys/amd64/linux/linux_systrace_args.c Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux/linux_systrace_args.c Sun Apr 28 14:37:20 2019 (r346843) @@ -2447,6 +2447,52 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 1; break; } + /* linux_statx */ + case 332: { + struct linux_statx_args *p = params; + iarg[0] = p->dirfd; /* l_int */ + uarg[1] = (intptr_t) p->pathname; /* const char * */ + iarg[2] = p->flags; /* l_uint */ + iarg[3] = p->mask; /* l_uint */ + uarg[4] = (intptr_t) p->statxbuf; /* void * */ + *n_args = 5; + break; + } + /* linux_io_pgetevents */ + case 333: { + *n_args = 0; + break; + } + /* linux_rseq */ + case 334: { + *n_args = 0; + break; + } + /* linux_pidfd_send_signal */ + case 424: { + struct linux_pidfd_send_signal_args *p = params; + iarg[0] = p->pidfd; /* l_int */ + iarg[1] = p->sig; /* l_int */ + uarg[2] = (intptr_t) p->info; /* l_siginfo_t * */ + iarg[3] = p->flags; /* l_uint */ + *n_args = 4; + break; + } + /* linux_io_uring_setup */ + case 425: { + *n_args = 0; + break; + } + /* linux_io_uring_enter */ + case 426: { + *n_args = 0; + break; + } + /* linux_io_uring_register */ + case 427: { + *n_args = 0; + break; + } default: *n_args = 0; break; @@ -6305,6 +6351,62 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* linux_statx */ + case 332: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "userland const char *"; + break; + case 2: + p = "l_uint"; + break; + case 3: + p = "l_uint"; + break; + case 4: + p = "userland void *"; + break; + default: + break; + }; + break; + /* linux_io_pgetevents */ + case 333: + break; + /* linux_rseq */ + case 334: + break; + /* linux_pidfd_send_signal */ + case 424: + switch(ndx) { + case 0: + p = "l_int"; + break; + case 1: + p = "l_int"; + break; + case 2: + p = "userland l_siginfo_t *"; + break; + case 3: + p = "l_uint"; + break; + default: + break; + }; + break; + /* linux_io_uring_setup */ + case 425: + break; + /* linux_io_uring_enter */ + case 426: + break; + /* linux_io_uring_register */ + case 427: + break; default: break; }; @@ -7647,6 +7749,26 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "int"; break; + /* linux_statx */ + case 332: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_io_pgetevents */ + case 333: + /* linux_rseq */ + case 334: + /* linux_pidfd_send_signal */ + case 424: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* linux_io_uring_setup */ + case 425: + /* linux_io_uring_enter */ + case 426: + /* linux_io_uring_register */ + case 427: default: break; }; Modified: stable/12/sys/amd64/linux/syscalls.master ============================================================================== --- stable/12/sys/amd64/linux/syscalls.master Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux/syscalls.master Sun Apr 28 14:37:20 2019 (r346843) @@ -595,7 +595,21 @@ 330 AUE_NULL STD { int linux_pkey_alloc(l_ulong flags, \ l_ulong init_val); } 331 AUE_NULL STD { int linux_pkey_free(l_int pkey); } +; Linux 4.11: +332 AUE_NULL STD { int linux_statx(l_int dirfd, \ + const char *pathname, l_uint flags, \ + l_uint mask, void *statxbuf); } +; Linux 4.18: +333 AUE_NULL STD { int linux_io_pgetevents(void); } +334 AUE_NULL STD { int linux_rseq(void); } +; Linux 5.0: +335-423 AUE_NULL UNIMPL nosys +424 AUE_NULL STD { int linux_pidfd_send_signal(l_int pidfd, \ + l_int sig, l_siginfo_t *info, l_uint flags); } +425 AUE_NULL STD { int linux_io_uring_setup(void); } +426 AUE_NULL STD { int linux_io_uring_enter(void); } +427 AUE_NULL STD { int linux_io_uring_register(void); } ; please, keep this line at the end. -332 AUE_NULL UNIMPL nosys +428 AUE_NULL UNIMPL nosys ; vim: syntax=off Modified: stable/12/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/12/sys/amd64/linux32/linux32_dummy.c Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux32/linux32_dummy.c Sun Apr 28 14:37:20 2019 (r346843) @@ -161,6 +161,37 @@ DUMMY(pwritev2); DUMMY(pkey_mprotect); DUMMY(pkey_alloc); DUMMY(pkey_free); +/* Linux 4.11: */ +DUMMY(statx); +DUMMY(arch_prctl); +/* Linux 4.18: */ +DUMMY(io_pgetevents); +DUMMY(rseq); +/* Linux 5.0: */ +DUMMY(clock_gettime64); +DUMMY(clock_settime64); +DUMMY(clock_adjtime64); +DUMMY(clock_getres_time64); +DUMMY(clock_nanosleep_time64); +DUMMY(timer_gettime64); +DUMMY(timer_settime64); +DUMMY(timerfd_gettime64); +DUMMY(timerfd_settime64); +DUMMY(utimensat_time64); +DUMMY(pselect6_time64); +DUMMY(ppoll_time64); +DUMMY(io_pgetevents_time64); +DUMMY(recvmmsg_time64); +DUMMY(mq_timedsend_time64); +DUMMY(mq_timedreceive_time64); +DUMMY(semtimedop_time64); +DUMMY(rt_sigtimedwait_time64); +DUMMY(futex_time64); +DUMMY(sched_rr_get_interval_time64); +DUMMY(pidfd_send_signal); +DUMMY(io_uring_setup); +DUMMY(io_uring_enter); +DUMMY(io_uring_register); #define DUMMY_XATTR(s) \ int \ Modified: stable/12/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/12/sys/amd64/linux32/linux32_proto.h Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux32/linux32_proto.h Sun Apr 28 14:37:20 2019 (r346843) @@ -1365,6 +1365,149 @@ struct linux_pkey_alloc_args { struct linux_pkey_free_args { char pkey_l_[PADL_(l_int)]; l_int pkey; char pkey_r_[PADR_(l_int)]; }; +struct linux_statx_args { + char dirfd_l_[PADL_(l_int)]; l_int dirfd; char dirfd_r_[PADR_(l_int)]; + char pathname_l_[PADL_(const char *)]; const char * pathname; char pathname_r_[PADR_(const char *)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; + char mask_l_[PADL_(l_uint)]; l_uint mask; char mask_r_[PADR_(l_uint)]; + char statxbuf_l_[PADL_(void *)]; void * statxbuf; char statxbuf_r_[PADR_(void *)]; +}; +struct linux_arch_prctl_args { + char option_l_[PADL_(l_int)]; l_int option; char option_r_[PADR_(l_int)]; + char arg2_l_[PADL_(l_ulong)]; l_ulong arg2; char arg2_r_[PADR_(l_ulong)]; +}; +struct linux_io_pgetevents_args { + register_t dummy; +}; +struct linux_rseq_args { + register_t dummy; +}; +struct linux_semget_args { + char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)]; + char nsems_l_[PADL_(l_int)]; l_int nsems; char nsems_r_[PADR_(l_int)]; + char semflg_l_[PADL_(l_int)]; l_int semflg; char semflg_r_[PADR_(l_int)]; +}; +struct linux_semctl_args { + char semid_l_[PADL_(l_int)]; l_int semid; char semid_r_[PADR_(l_int)]; + char semnum_l_[PADL_(l_int)]; l_int semnum; char semnum_r_[PADR_(l_int)]; + char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)]; + char arg_l_[PADL_(union l_semun)]; union l_semun arg; char arg_r_[PADR_(union l_semun)]; +}; +struct linux_shmget_args { + char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)]; + char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; + char shmflg_l_[PADL_(l_int)]; l_int shmflg; char shmflg_r_[PADR_(l_int)]; +}; +struct linux_shmctl_args { + char shmid_l_[PADL_(l_int)]; l_int shmid; char shmid_r_[PADR_(l_int)]; + char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)]; + char buf_l_[PADL_(struct l_shmid_ds *)]; struct l_shmid_ds * buf; char buf_r_[PADR_(struct l_shmid_ds *)]; +}; +struct linux_shmat_args { + char shmid_l_[PADL_(l_int)]; l_int shmid; char shmid_r_[PADR_(l_int)]; + char shmaddr_l_[PADL_(char *)]; char * shmaddr; char shmaddr_r_[PADR_(char *)]; + char shmflg_l_[PADL_(l_int)]; l_int shmflg; char shmflg_r_[PADR_(l_int)]; +}; +struct linux_shmdt_args { + char shmaddr_l_[PADL_(char *)]; char * shmaddr; char shmaddr_r_[PADR_(char *)]; +}; +struct linux_msgget_args { + char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)]; + char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)]; +}; +struct linux_msgsnd_args { + char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)]; + char msgp_l_[PADL_(struct l_msgbuf *)]; struct l_msgbuf * msgp; char msgp_r_[PADR_(struct l_msgbuf *)]; + char msgsz_l_[PADL_(l_size_t)]; l_size_t msgsz; char msgsz_r_[PADR_(l_size_t)]; + char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)]; +}; +struct linux_msgrcv_args { + char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)]; + char msgp_l_[PADL_(struct l_msgbuf *)]; struct l_msgbuf * msgp; char msgp_r_[PADR_(struct l_msgbuf *)]; + char msgsz_l_[PADL_(l_size_t)]; l_size_t msgsz; char msgsz_r_[PADR_(l_size_t)]; + char msgtyp_l_[PADL_(l_long)]; l_long msgtyp; char msgtyp_r_[PADR_(l_long)]; + char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)]; +}; +struct linux_msgctl_args { + char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)]; + char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)]; + char buf_l_[PADL_(struct l_msqid_ds *)]; struct l_msqid_ds * buf; char buf_r_[PADR_(struct l_msqid_ds *)]; +}; +struct linux_clock_gettime64_args { + register_t dummy; +}; +struct linux_clock_settime64_args { + register_t dummy; +}; +struct linux_clock_adjtime64_args { + register_t dummy; +}; +struct linux_clock_getres_time64_args { + register_t dummy; +}; +struct linux_clock_nanosleep_time64_args { + register_t dummy; +}; +struct linux_timer_gettime64_args { + register_t dummy; +}; +struct linux_timer_settime64_args { + register_t dummy; +}; +struct linux_timerfd_gettime64_args { + register_t dummy; +}; +struct linux_timerfd_settime64_args { + register_t dummy; +}; +struct linux_utimensat_time64_args { + register_t dummy; +}; +struct linux_pselect6_time64_args { + register_t dummy; +}; +struct linux_ppoll_time64_args { + register_t dummy; +}; +struct linux_io_pgetevents_time64_args { + register_t dummy; +}; +struct linux_recvmmsg_time64_args { + register_t dummy; +}; +struct linux_mq_timedsend_time64_args { + register_t dummy; +}; +struct linux_mq_timedreceive_time64_args { + register_t dummy; +}; +struct linux_semtimedop_time64_args { + register_t dummy; +}; +struct linux_rt_sigtimedwait_time64_args { + register_t dummy; +}; +struct linux_futex_time64_args { + register_t dummy; +}; +struct linux_sched_rr_get_interval_time64_args { + register_t dummy; +}; +struct linux_pidfd_send_signal_args { + char pidfd_l_[PADL_(l_int)]; l_int pidfd; char pidfd_r_[PADR_(l_int)]; + char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; + char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; +}; +struct linux_io_uring_setup_args { + register_t dummy; +}; +struct linux_io_uring_enter_args { + register_t dummy; +}; +struct linux_io_uring_register_args { + register_t dummy; +}; #define nosys linux_nosys int linux_exit(struct thread *, struct linux_exit_args *); int linux_fork(struct thread *, struct linux_fork_args *); @@ -1673,6 +1816,44 @@ int linux_pwritev2(struct thread *, struct linux_pwrit int linux_pkey_mprotect(struct thread *, struct linux_pkey_mprotect_args *); int linux_pkey_alloc(struct thread *, struct linux_pkey_alloc_args *); int linux_pkey_free(struct thread *, struct linux_pkey_free_args *); +int linux_statx(struct thread *, struct linux_statx_args *); +int linux_arch_prctl(struct thread *, struct linux_arch_prctl_args *); +int linux_io_pgetevents(struct thread *, struct linux_io_pgetevents_args *); +int linux_rseq(struct thread *, struct linux_rseq_args *); +int linux_semget(struct thread *, struct linux_semget_args *); +int linux_semctl(struct thread *, struct linux_semctl_args *); +int linux_shmget(struct thread *, struct linux_shmget_args *); +int linux_shmctl(struct thread *, struct linux_shmctl_args *); +int linux_shmat(struct thread *, struct linux_shmat_args *); +int linux_shmdt(struct thread *, struct linux_shmdt_args *); +int linux_msgget(struct thread *, struct linux_msgget_args *); +int linux_msgsnd(struct thread *, struct linux_msgsnd_args *); +int linux_msgrcv(struct thread *, struct linux_msgrcv_args *); +int linux_msgctl(struct thread *, struct linux_msgctl_args *); +int linux_clock_gettime64(struct thread *, struct linux_clock_gettime64_args *); +int linux_clock_settime64(struct thread *, struct linux_clock_settime64_args *); +int linux_clock_adjtime64(struct thread *, struct linux_clock_adjtime64_args *); +int linux_clock_getres_time64(struct thread *, struct linux_clock_getres_time64_args *); +int linux_clock_nanosleep_time64(struct thread *, struct linux_clock_nanosleep_time64_args *); +int linux_timer_gettime64(struct thread *, struct linux_timer_gettime64_args *); +int linux_timer_settime64(struct thread *, struct linux_timer_settime64_args *); +int linux_timerfd_gettime64(struct thread *, struct linux_timerfd_gettime64_args *); +int linux_timerfd_settime64(struct thread *, struct linux_timerfd_settime64_args *); +int linux_utimensat_time64(struct thread *, struct linux_utimensat_time64_args *); +int linux_pselect6_time64(struct thread *, struct linux_pselect6_time64_args *); +int linux_ppoll_time64(struct thread *, struct linux_ppoll_time64_args *); +int linux_io_pgetevents_time64(struct thread *, struct linux_io_pgetevents_time64_args *); +int linux_recvmmsg_time64(struct thread *, struct linux_recvmmsg_time64_args *); +int linux_mq_timedsend_time64(struct thread *, struct linux_mq_timedsend_time64_args *); +int linux_mq_timedreceive_time64(struct thread *, struct linux_mq_timedreceive_time64_args *); +int linux_semtimedop_time64(struct thread *, struct linux_semtimedop_time64_args *); +int linux_rt_sigtimedwait_time64(struct thread *, struct linux_rt_sigtimedwait_time64_args *); +int linux_futex_time64(struct thread *, struct linux_futex_time64_args *); +int linux_sched_rr_get_interval_time64(struct thread *, struct linux_sched_rr_get_interval_time64_args *); +int linux_pidfd_send_signal(struct thread *, struct linux_pidfd_send_signal_args *); +int linux_io_uring_setup(struct thread *, struct linux_io_uring_setup_args *); +int linux_io_uring_enter(struct thread *, struct linux_io_uring_enter_args *); +int linux_io_uring_register(struct thread *, struct linux_io_uring_register_args *); #ifdef COMPAT_43 @@ -2022,6 +2203,44 @@ int linux_pkey_free(struct thread *, struct linux_pkey #define LINUX32_SYS_AUE_linux_pkey_mprotect AUE_NULL #define LINUX32_SYS_AUE_linux_pkey_alloc AUE_NULL #define LINUX32_SYS_AUE_linux_pkey_free AUE_NULL +#define LINUX32_SYS_AUE_linux_statx AUE_NULL +#define LINUX32_SYS_AUE_linux_arch_prctl AUE_NULL +#define LINUX32_SYS_AUE_linux_io_pgetevents AUE_NULL +#define LINUX32_SYS_AUE_linux_rseq AUE_NULL +#define LINUX32_SYS_AUE_linux_semget AUE_NULL +#define LINUX32_SYS_AUE_linux_semctl AUE_NULL +#define LINUX32_SYS_AUE_linux_shmget AUE_NULL +#define LINUX32_SYS_AUE_linux_shmctl AUE_NULL +#define LINUX32_SYS_AUE_linux_shmat AUE_NULL +#define LINUX32_SYS_AUE_linux_shmdt AUE_NULL +#define LINUX32_SYS_AUE_linux_msgget AUE_NULL +#define LINUX32_SYS_AUE_linux_msgsnd AUE_NULL +#define LINUX32_SYS_AUE_linux_msgrcv AUE_NULL +#define LINUX32_SYS_AUE_linux_msgctl AUE_NULL +#define LINUX32_SYS_AUE_linux_clock_gettime64 AUE_NULL +#define LINUX32_SYS_AUE_linux_clock_settime64 AUE_NULL +#define LINUX32_SYS_AUE_linux_clock_adjtime64 AUE_NULL +#define LINUX32_SYS_AUE_linux_clock_getres_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_clock_nanosleep_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_timer_gettime64 AUE_NULL +#define LINUX32_SYS_AUE_linux_timer_settime64 AUE_NULL +#define LINUX32_SYS_AUE_linux_timerfd_gettime64 AUE_NULL +#define LINUX32_SYS_AUE_linux_timerfd_settime64 AUE_NULL +#define LINUX32_SYS_AUE_linux_utimensat_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_pselect6_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_ppoll_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_io_pgetevents_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_recvmmsg_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_mq_timedsend_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_mq_timedreceive_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_semtimedop_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_rt_sigtimedwait_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_futex_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_sched_rr_get_interval_time64 AUE_NULL +#define LINUX32_SYS_AUE_linux_pidfd_send_signal AUE_NULL +#define LINUX32_SYS_AUE_linux_io_uring_setup AUE_NULL +#define LINUX32_SYS_AUE_linux_io_uring_enter AUE_NULL +#define LINUX32_SYS_AUE_linux_io_uring_register AUE_NULL #undef PAD_ #undef PADL_ Modified: stable/12/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/12/sys/amd64/linux32/linux32_syscall.h Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux32/linux32_syscall.h Sun Apr 28 14:37:20 2019 (r346843) @@ -350,4 +350,42 @@ #define LINUX32_SYS_linux_pkey_mprotect 380 #define LINUX32_SYS_linux_pkey_alloc 381 #define LINUX32_SYS_linux_pkey_free 382 -#define LINUX32_SYS_MAXSYSCALL 384 +#define LINUX32_SYS_linux_statx 383 +#define LINUX32_SYS_linux_arch_prctl 384 +#define LINUX32_SYS_linux_io_pgetevents 385 +#define LINUX32_SYS_linux_rseq 386 +#define LINUX32_SYS_linux_semget 393 +#define LINUX32_SYS_linux_semctl 394 +#define LINUX32_SYS_linux_shmget 395 +#define LINUX32_SYS_linux_shmctl 396 +#define LINUX32_SYS_linux_shmat 397 +#define LINUX32_SYS_linux_shmdt 398 +#define LINUX32_SYS_linux_msgget 399 +#define LINUX32_SYS_linux_msgsnd 400 +#define LINUX32_SYS_linux_msgrcv 401 +#define LINUX32_SYS_linux_msgctl 402 +#define LINUX32_SYS_linux_clock_gettime64 403 +#define LINUX32_SYS_linux_clock_settime64 404 +#define LINUX32_SYS_linux_clock_adjtime64 405 +#define LINUX32_SYS_linux_clock_getres_time64 406 +#define LINUX32_SYS_linux_clock_nanosleep_time64 407 +#define LINUX32_SYS_linux_timer_gettime64 408 +#define LINUX32_SYS_linux_timer_settime64 409 +#define LINUX32_SYS_linux_timerfd_gettime64 410 +#define LINUX32_SYS_linux_timerfd_settime64 411 +#define LINUX32_SYS_linux_utimensat_time64 412 +#define LINUX32_SYS_linux_pselect6_time64 413 +#define LINUX32_SYS_linux_ppoll_time64 414 +#define LINUX32_SYS_linux_io_pgetevents_time64 416 +#define LINUX32_SYS_linux_recvmmsg_time64 417 +#define LINUX32_SYS_linux_mq_timedsend_time64 418 +#define LINUX32_SYS_linux_mq_timedreceive_time64 419 +#define LINUX32_SYS_linux_semtimedop_time64 420 +#define LINUX32_SYS_linux_rt_sigtimedwait_time64 421 +#define LINUX32_SYS_linux_futex_time64 422 +#define LINUX32_SYS_linux_sched_rr_get_interval_time64 423 +#define LINUX32_SYS_linux_pidfd_send_signal 424 +#define LINUX32_SYS_linux_io_uring_setup 425 +#define LINUX32_SYS_linux_io_uring_enter 426 +#define LINUX32_SYS_linux_io_uring_register 427 +#define LINUX32_SYS_MAXSYSCALL 429 Modified: stable/12/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- stable/12/sys/amd64/linux32/linux32_syscalls.c Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux32/linux32_syscalls.c Sun Apr 28 14:37:20 2019 (r346843) @@ -390,5 +390,50 @@ const char *linux32_syscallnames[] = { "linux_pkey_mprotect", /* 380 = linux_pkey_mprotect */ "linux_pkey_alloc", /* 381 = linux_pkey_alloc */ "linux_pkey_free", /* 382 = linux_pkey_free */ - "#383", /* 383 = nosys */ + "linux_statx", /* 383 = linux_statx */ + "linux_arch_prctl", /* 384 = linux_arch_prctl */ + "linux_io_pgetevents", /* 385 = linux_io_pgetevents */ + "linux_rseq", /* 386 = linux_rseq */ + "#387", /* 387 = nosys */ + "#388", /* 388 = nosys */ + "#389", /* 389 = nosys */ + "#390", /* 390 = nosys */ + "#391", /* 391 = nosys */ + "#392", /* 392 = nosys */ + "linux_semget", /* 393 = linux_semget */ + "linux_semctl", /* 394 = linux_semctl */ + "linux_shmget", /* 395 = linux_shmget */ + "linux_shmctl", /* 396 = linux_shmctl */ + "linux_shmat", /* 397 = linux_shmat */ + "linux_shmdt", /* 398 = linux_shmdt */ + "linux_msgget", /* 399 = linux_msgget */ + "linux_msgsnd", /* 400 = linux_msgsnd */ + "linux_msgrcv", /* 401 = linux_msgrcv */ + "linux_msgctl", /* 402 = linux_msgctl */ + "linux_clock_gettime64", /* 403 = linux_clock_gettime64 */ + "linux_clock_settime64", /* 404 = linux_clock_settime64 */ + "linux_clock_adjtime64", /* 405 = linux_clock_adjtime64 */ + "linux_clock_getres_time64", /* 406 = linux_clock_getres_time64 */ + "linux_clock_nanosleep_time64", /* 407 = linux_clock_nanosleep_time64 */ + "linux_timer_gettime64", /* 408 = linux_timer_gettime64 */ + "linux_timer_settime64", /* 409 = linux_timer_settime64 */ + "linux_timerfd_gettime64", /* 410 = linux_timerfd_gettime64 */ + "linux_timerfd_settime64", /* 411 = linux_timerfd_settime64 */ + "linux_utimensat_time64", /* 412 = linux_utimensat_time64 */ + "linux_pselect6_time64", /* 413 = linux_pselect6_time64 */ + "linux_ppoll_time64", /* 414 = linux_ppoll_time64 */ + "#415", /* 415 = nosys */ + "linux_io_pgetevents_time64", /* 416 = linux_io_pgetevents_time64 */ + "linux_recvmmsg_time64", /* 417 = linux_recvmmsg_time64 */ + "linux_mq_timedsend_time64", /* 418 = linux_mq_timedsend_time64 */ + "linux_mq_timedreceive_time64", /* 419 = linux_mq_timedreceive_time64 */ + "linux_semtimedop_time64", /* 420 = linux_semtimedop_time64 */ + "linux_rt_sigtimedwait_time64", /* 421 = linux_rt_sigtimedwait_time64 */ + "linux_futex_time64", /* 422 = linux_futex_time64 */ + "linux_sched_rr_get_interval_time64", /* 423 = linux_sched_rr_get_interval_time64 */ + "linux_pidfd_send_signal", /* 424 = linux_pidfd_send_signal */ + "linux_io_uring_setup", /* 425 = linux_io_uring_setup */ + "linux_io_uring_enter", /* 426 = linux_io_uring_enter */ + "linux_io_uring_register", /* 427 = linux_io_uring_register */ + "#428", /* 428 = nosys */ }; Modified: stable/12/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/12/sys/amd64/linux32/linux32_sysent.c Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux32/linux32_sysent.c Sun Apr 28 14:37:20 2019 (r346843) @@ -400,5 +400,50 @@ struct sysent linux32_sysent[] = { { AS(linux_pkey_mprotect_args), (sy_call_t *)linux_pkey_mprotect, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 380 = linux_pkey_mprotect */ { AS(linux_pkey_alloc_args), (sy_call_t *)linux_pkey_alloc, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 381 = linux_pkey_alloc */ { AS(linux_pkey_free_args), (sy_call_t *)linux_pkey_free, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 382 = linux_pkey_free */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 383 = nosys */ + { AS(linux_statx_args), (sy_call_t *)linux_statx, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 383 = linux_statx */ + { AS(linux_arch_prctl_args), (sy_call_t *)linux_arch_prctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 384 = linux_arch_prctl */ + { 0, (sy_call_t *)linux_io_pgetevents, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 385 = linux_io_pgetevents */ + { 0, (sy_call_t *)linux_rseq, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 386 = linux_rseq */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 387 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 388 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 389 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 390 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 391 = nosys */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 392 = nosys */ + { AS(linux_semget_args), (sy_call_t *)linux_semget, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 393 = linux_semget */ + { AS(linux_semctl_args), (sy_call_t *)linux_semctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 394 = linux_semctl */ + { AS(linux_shmget_args), (sy_call_t *)linux_shmget, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 395 = linux_shmget */ + { AS(linux_shmctl_args), (sy_call_t *)linux_shmctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 396 = linux_shmctl */ + { AS(linux_shmat_args), (sy_call_t *)linux_shmat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 397 = linux_shmat */ + { AS(linux_shmdt_args), (sy_call_t *)linux_shmdt, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 398 = linux_shmdt */ + { AS(linux_msgget_args), (sy_call_t *)linux_msgget, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 399 = linux_msgget */ + { AS(linux_msgsnd_args), (sy_call_t *)linux_msgsnd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 400 = linux_msgsnd */ + { AS(linux_msgrcv_args), (sy_call_t *)linux_msgrcv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 401 = linux_msgrcv */ + { AS(linux_msgctl_args), (sy_call_t *)linux_msgctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 402 = linux_msgctl */ + { 0, (sy_call_t *)linux_clock_gettime64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 403 = linux_clock_gettime64 */ + { 0, (sy_call_t *)linux_clock_settime64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 404 = linux_clock_settime64 */ + { 0, (sy_call_t *)linux_clock_adjtime64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 405 = linux_clock_adjtime64 */ + { 0, (sy_call_t *)linux_clock_getres_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 406 = linux_clock_getres_time64 */ + { 0, (sy_call_t *)linux_clock_nanosleep_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 407 = linux_clock_nanosleep_time64 */ + { 0, (sy_call_t *)linux_timer_gettime64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 408 = linux_timer_gettime64 */ + { 0, (sy_call_t *)linux_timer_settime64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 409 = linux_timer_settime64 */ + { 0, (sy_call_t *)linux_timerfd_gettime64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 410 = linux_timerfd_gettime64 */ + { 0, (sy_call_t *)linux_timerfd_settime64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 411 = linux_timerfd_settime64 */ + { 0, (sy_call_t *)linux_utimensat_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 412 = linux_utimensat_time64 */ + { 0, (sy_call_t *)linux_pselect6_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 413 = linux_pselect6_time64 */ + { 0, (sy_call_t *)linux_ppoll_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 414 = linux_ppoll_time64 */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 415 = nosys */ + { 0, (sy_call_t *)linux_io_pgetevents_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 416 = linux_io_pgetevents_time64 */ + { 0, (sy_call_t *)linux_recvmmsg_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 417 = linux_recvmmsg_time64 */ + { 0, (sy_call_t *)linux_mq_timedsend_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 418 = linux_mq_timedsend_time64 */ + { 0, (sy_call_t *)linux_mq_timedreceive_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 419 = linux_mq_timedreceive_time64 */ + { 0, (sy_call_t *)linux_semtimedop_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 420 = linux_semtimedop_time64 */ + { 0, (sy_call_t *)linux_rt_sigtimedwait_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 421 = linux_rt_sigtimedwait_time64 */ + { 0, (sy_call_t *)linux_futex_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 422 = linux_futex_time64 */ + { 0, (sy_call_t *)linux_sched_rr_get_interval_time64, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 423 = linux_sched_rr_get_interval_time64 */ + { AS(linux_pidfd_send_signal_args), (sy_call_t *)linux_pidfd_send_signal, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 424 = linux_pidfd_send_signal */ + { 0, (sy_call_t *)linux_io_uring_setup, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 425 = linux_io_uring_setup */ + { 0, (sy_call_t *)linux_io_uring_enter, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 426 = linux_io_uring_enter */ + { 0, (sy_call_t *)linux_io_uring_register, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 427 = linux_io_uring_register */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 428 = nosys */ }; Modified: stable/12/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- stable/12/sys/amd64/linux32/linux32_systrace_args.c Sun Apr 28 14:34:31 2019 (r346842) +++ stable/12/sys/amd64/linux32/linux32_systrace_args.c Sun Apr 28 14:37:20 2019 (r346843) @@ -2708,6 +2708,251 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 1; break; } + /* linux_statx */ + case 383: { + struct linux_statx_args *p = params; + iarg[0] = p->dirfd; /* l_int */ + uarg[1] = (intptr_t) p->pathname; /* const char * */ + iarg[2] = p->flags; /* l_uint */ + iarg[3] = p->mask; /* l_uint */ + uarg[4] = (intptr_t) p->statxbuf; /* void * */ + *n_args = 5; + break; + } + /* linux_arch_prctl */ + case 384: { + struct linux_arch_prctl_args *p = params; + iarg[0] = p->option; /* l_int */ + iarg[1] = p->arg2; /* l_ulong */ + *n_args = 2; + break; + } + /* linux_io_pgetevents */ + case 385: { + *n_args = 0; + break; + } + /* linux_rseq */ + case 386: { + *n_args = 0; + break; + } + /* linux_semget */ + case 393: { + struct linux_semget_args *p = params; + iarg[0] = p->key; /* l_key_t */ + iarg[1] = p->nsems; /* l_int */ + iarg[2] = p->semflg; /* l_int */ + *n_args = 3; + break; + } + /* linux_semctl */ + case 394: { + struct linux_semctl_args *p = params; + iarg[0] = p->semid; /* l_int */ + iarg[1] = p->semnum; /* l_int */ + iarg[2] = p->cmd; /* l_int */ + uarg[3] = p->arg.buf; /* union l_semun */ + *n_args = 4; + break; + } + /* linux_shmget */ + case 395: { + struct linux_shmget_args *p = params; + iarg[0] = p->key; /* l_key_t */ + iarg[1] = p->size; /* l_size_t */ + iarg[2] = p->shmflg; /* l_int */ + *n_args = 3; + break; + } + /* linux_shmctl */ + case 396: { + struct linux_shmctl_args *p = params; + iarg[0] = p->shmid; /* l_int */ + iarg[1] = p->cmd; /* l_int */ + uarg[2] = (intptr_t) p->buf; /* struct l_shmid_ds * */ + *n_args = 3; + break; + } + /* linux_shmat */ + case 397: { + struct linux_shmat_args *p = params; + iarg[0] = p->shmid; /* l_int */ + uarg[1] = (intptr_t) p->shmaddr; /* char * */ + iarg[2] = p->shmflg; /* l_int */ + *n_args = 3; + break; + } + /* linux_shmdt */ + case 398: { + struct linux_shmdt_args *p = params; + uarg[0] = (intptr_t) p->shmaddr; /* char * */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Apr 28 14:38:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3427F15800C5; Sun, 28 Apr 2019 14:38:22 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC79D9629F; Sun, 28 Apr 2019 14:38:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A72A4C0BC; Sun, 28 Apr 2019 14:38:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SEcLHD056147; Sun, 28 Apr 2019 14:38:21 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SEcLTg056146; Sun, 28 Apr 2019 14:38:21 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904281438.x3SEcLTg056146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 28 Apr 2019 14:38:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346844 - stable/12/sys/compat/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/12/sys/compat/linux X-SVN-Commit-Revision: 346844 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CC79D9629F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 14:38:22 -0000 Author: dchagin Date: Sun Apr 28 14:38:21 2019 New Revision: 346844 URL: https://svnweb.freebsd.org/changeset/base/346844 Log: MFC r345473: Whitespace cleanup (annoying). Modified: stable/12/sys/compat/linux/linux_fork.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linux/linux_fork.c ============================================================================== --- stable/12/sys/compat/linux/linux_fork.c Sun Apr 28 14:37:20 2019 (r346843) +++ stable/12/sys/compat/linux/linux_fork.c Sun Apr 28 14:38:21 2019 (r346844) @@ -353,7 +353,7 @@ linux_clone_thread(struct thread *td, struct linux_clo thread_unlock(td); if (P_SHOULDSTOP(p)) newtd->td_flags |= TDF_ASTPENDING | TDF_NEEDSUSPCHK; - + if (p->p_ptevents & PTRACE_LWP) newtd->td_dbgflags |= TDB_BORN; PROC_UNLOCK(p); From owner-svn-src-all@freebsd.org Sun Apr 28 15:08:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 811ED1580CBA; Sun, 28 Apr 2019 15:08:58 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2551E970FD; Sun, 28 Apr 2019 15:08:58 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1533C5C1; Sun, 28 Apr 2019 15:08:57 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SF8vEF072134; Sun, 28 Apr 2019 15:08:57 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SF8vJQ072133; Sun, 28 Apr 2019 15:08:57 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201904281508.x3SF8vJQ072133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 28 Apr 2019 15:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346845 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 346845 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2551E970FD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 15:08:58 -0000 Author: trasz Date: Sun Apr 28 15:08:57 2019 New Revision: 346845 URL: https://svnweb.freebsd.org/changeset/base/346845 Log: Make isp(4) suggest loading ispfw(4) when it fails to attach. It cannot load it automatically at boot, because the root filesystem is not there yet. An alternative would be adding ispfw(4) to GENERIC, but it's an additional 1MB. Reviewed by: mav MFC after: 2 weeks Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D19369 Modified: head/sys/dev/isp/isp_pci.c Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Sun Apr 28 14:38:21 2019 (r346844) +++ head/sys/dev/isp/isp_pci.c Sun Apr 28 15:08:57 2019 (r346845) @@ -931,6 +931,15 @@ isp_pci_attach(device_t dev) return (0); bad: + if (isp->isp_osinfo.fw == NULL && !IS_26XX(isp)) { + /* + * Failure to attach at boot time might have been caused + * by a missing ispfw(4). Except for for 16Gb adapters, + * there's no loadable firmware for them. + */ + isp_prt(isp, ISP_LOGWARN, "See the ispfw(4) man page on " + "how to load known good firmware at boot time"); + } for (i = 0; i < isp->isp_nirq; i++) { (void) bus_teardown_intr(dev, pcs->irq[i].irq, pcs->irq[i].ih); (void) bus_release_resource(dev, SYS_RES_IRQ, pcs->irq[i].iqd, From owner-svn-src-all@freebsd.org Sun Apr 28 16:28:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 563451582AB0; Sun, 28 Apr 2019 16:28:37 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED6A06ABF1; Sun, 28 Apr 2019 16:28:36 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C42F4D32B; Sun, 28 Apr 2019 16:28:36 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SGSaAg014550; Sun, 28 Apr 2019 16:28:36 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SGSaZU014548; Sun, 28 Apr 2019 16:28:36 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201904281628.x3SGSaZU014548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Sun, 28 Apr 2019 16:28:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346846 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: rwatson X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 346846 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ED6A06ABF1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 16:28:37 -0000 Author: rwatson Date: Sun Apr 28 16:28:36 2019 New Revision: 346846 URL: https://svnweb.freebsd.org/changeset/base/346846 Log: Update the audit(4) man page to talk about dtaudit(4), and also add a dtaudit(4) cross reference to auditpipe(4). MFC after: 3 days Sponsored by: DARPA, AFRL Modified: head/share/man/man4/audit.4 head/share/man/man4/auditpipe.4 Modified: head/share/man/man4/audit.4 ============================================================================== --- head/share/man/man4/audit.4 Sun Apr 28 15:08:57 2019 (r346845) +++ head/share/man/man4/audit.4 Sun Apr 28 16:28:36 2019 (r346846) @@ -1,6 +1,11 @@ -.\" Copyright (c) 2006 Robert N. M. Watson +.\" Copyright (c) 2006, 2019 Robert N. M. Watson .\" All rights reserved. .\" +.\" This software was developed in part by BAE Systems, the University of +.\" Cambridge Computer Laboratory, and Memorial University under DARPA/AFRL +.\" contract FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent +.\" Computing (TC) research program. +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -24,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 31, 2009 +.Dd April 28, 2019 .Dt AUDIT 4 .Os .Sh NAME @@ -74,6 +79,12 @@ Audit pipe special devices, discussed in provide a configurable live tracking mechanism to allow applications to tee the audit trail, as well as to configure custom preselection parameters to track users and events in a fine-grained manner. +.Ss DTrace Audit Provider +The DTrace Audit Provider, +.Xr dtaudit 4 , +allows D scripts to enable capture of in-kernel audit records for kernel audit +event types, and then process their contents during audit commit or BSM +generation. .Sh SEE ALSO .Xr auditreduce 1 , .Xr praudit 1 , @@ -88,6 +99,7 @@ to track users and events in a fine-grained manner. .Xr setauid 2 , .Xr libbsm 3 , .Xr auditpipe 4 , +.Xr dtaudit 4 , .Xr audit.log 5 , .Xr audit_class 5 , .Xr audit_control 5 , Modified: head/share/man/man4/auditpipe.4 ============================================================================== --- head/share/man/man4/auditpipe.4 Sun Apr 28 15:08:57 2019 (r346845) +++ head/share/man/man4/auditpipe.4 Sun Apr 28 16:28:36 2019 (r346846) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 30, 2018 +.Dd April 28, 2019 .Dt AUDITPIPE 4 .Os .Sh NAME @@ -221,6 +221,7 @@ to review the default audit trail. .Xr poll 2 , .Xr select 2 , .Xr audit 4 , +.Xr dtaudit 4 , .Xr audit_control 5 , .Xr audit 8 , .Xr auditd 8 From owner-svn-src-all@freebsd.org Sun Apr 28 17:27:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B639F158421A; Sun, 28 Apr 2019 17:27:07 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5339D6CB03; Sun, 28 Apr 2019 17:27:07 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06038DD59; Sun, 28 Apr 2019 17:27:07 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SHR6lU046202; Sun, 28 Apr 2019 17:27:06 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SHR64w046201; Sun, 28 Apr 2019 17:27:06 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201904281727.x3SHR64w046201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 28 Apr 2019 17:27:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346847 - head/tools/regression/fsx X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tools/regression/fsx X-SVN-Commit-Revision: 346847 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5339D6CB03 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 17:27:07 -0000 Author: asomers Date: Sun Apr 28 17:27:06 2019 New Revision: 346847 URL: https://svnweb.freebsd.org/changeset/base/346847 Log: fsx: seed more randomly with the -S0 option When using -S0, seed the PRNG with the current time in nanoseconds, not seconds, so consecutive runs don't accidentally use the same seed. Also, rename some variables for clarity. Reviewed by: ngie MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20078 Modified: head/tools/regression/fsx/fsx.c Modified: head/tools/regression/fsx/fsx.c ============================================================================== --- head/tools/regression/fsx/fsx.c Sun Apr 28 16:28:36 2019 (r346846) +++ head/tools/regression/fsx/fsx.c Sun Apr 28 17:27:06 2019 (r346847) @@ -48,6 +48,7 @@ # include # include #endif +#include #include #include #ifndef MAP_FILE @@ -274,16 +275,22 @@ logdump(void) prt("\t***RRRR***"); break; case OP_WRITE: - prt("WRITE\t0x%x thru 0x%x\t(0x%x bytes)", - lp->args[0], lp->args[0] + lp->args[1] - 1, - lp->args[1]); - if (lp->args[0] > lp->args[2]) - prt(" HOLE"); - else if (lp->args[0] + lp->args[1] > lp->args[2]) - prt(" EXTEND"); - if ((badoff >= lp->args[0] || badoff >=lp->args[2]) && - badoff < lp->args[0] + lp->args[1]) - prt("\t***WWWW"); + { + int offset = lp->args[0]; + int len = lp->args[1]; + int oldlen = lp->args[2]; + + prt("WRITE\t0x%x thru 0x%x\t(0x%x bytes)", + offset, offset + len - 1, + len); + if (offset > oldlen) + prt(" HOLE"); + else if (offset + len > oldlen) + prt(" EXTEND"); + if ((badoff >= offset || badoff >=oldlen) && + badoff < offset + len) + prt("\t***WWWW"); + } break; case OP_TRUNCATE: down = lp->args[0] < lp->args[1]; @@ -993,6 +1000,7 @@ main(int argc, char **argv) char *endp; char goodfile[1024]; char logfile[1024]; + struct timespec now; goodfile[0] = 0; logfile[0] = 0; @@ -1115,8 +1123,11 @@ main(int argc, char **argv) break; case 'S': seed = getnum(optarg, &endp); - if (seed == 0) - seed = time(0) % 10000; + if (seed == 0) { + if (clock_gettime(CLOCK_REALTIME, &now) != 0) + err(1, "clock_gettime"); + seed = now.tv_nsec % 10000; + } if (!quiet) fprintf(stdout, "Seed set to %d\n", seed); if (seed < 0) @@ -1206,7 +1217,7 @@ main(int argc, char **argv) prterr(fname); warn("main: error on write"); } else - warn("main: short write, 0x%x bytes instead of 0x%x\n", + warn("main: short write, 0x%x bytes instead of 0x%lx\n", (unsigned)written, maxfilelen); exit(98); } From owner-svn-src-all@freebsd.org Sun Apr 28 18:30:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B34115860C9; Sun, 28 Apr 2019 18:30:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B29967012B; Sun, 28 Apr 2019 18:30:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C291E793; Sun, 28 Apr 2019 18:30:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SIUKs4081575; Sun, 28 Apr 2019 18:30:20 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SIUJYp081571; Sun, 28 Apr 2019 18:30:19 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904281830.x3SIUJYp081571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 28 Apr 2019 18:30:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346848 - in stable/11/sys/dev/cxgbe: . common tom X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys/dev/cxgbe: . common tom X-SVN-Commit-Revision: 346848 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B29967012B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 18:30:21 -0000 Author: np Date: Sun Apr 28 18:30:19 2019 New Revision: 346848 URL: https://svnweb.freebsd.org/changeset/base/346848 Log: MFC r331902: r331902: cxgbe: Implement tcp_info handler for connections handled by t4_tom. Modified: stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/common/common.h stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/cxgbe/tom/t4_tom.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Sun Apr 28 17:27:06 2019 (r346847) +++ stable/11/sys/dev/cxgbe/adapter.h Sun Apr 28 18:30:19 2019 (r346848) @@ -1118,6 +1118,7 @@ int vi_full_init(struct vi_info *); int vi_full_uninit(struct vi_info *); void vi_sysctls(struct vi_info *); void vi_tick(void *); +int rw_via_memwin(struct adapter *, int, uint32_t, uint32_t *, int, int); #ifdef DEV_NETMAP /* t4_netmap.c */ @@ -1210,4 +1211,19 @@ t4_wrq_tx(struct adapter *sc, struct wrqe *wr) TXQ_UNLOCK(wrq); } +static inline int +read_via_memwin(struct adapter *sc, int idx, uint32_t addr, uint32_t *val, + int len) +{ + + return (rw_via_memwin(sc, idx, addr, val, len, 0)); +} + +static inline int +write_via_memwin(struct adapter *sc, int idx, uint32_t addr, + const uint32_t *val, int len) +{ + + return (rw_via_memwin(sc, idx, addr, (void *)(uintptr_t)val, len, 1)); +} #endif Modified: stable/11/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/11/sys/dev/cxgbe/common/common.h Sun Apr 28 17:27:06 2019 (r346847) +++ stable/11/sys/dev/cxgbe/common/common.h Sun Apr 28 18:30:19 2019 (r346848) @@ -520,6 +520,12 @@ static inline u_int us_to_tcp_ticks(const struct adapt return (us * adap->params.vpd.cclk / 1000 >> adap->params.tp.tre); } +static inline u_int tcp_ticks_to_us(const struct adapter *adap, u_int ticks) +{ + return ((uint64_t)ticks << adap->params.tp.tre) / + core_ticks_per_usec(adap); +} + void t4_set_reg_field(struct adapter *adap, unsigned int addr, u32 mask, u32 val); int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox, const void *cmd, Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Sun Apr 28 17:27:06 2019 (r346847) +++ stable/11/sys/dev/cxgbe/t4_main.c Sun Apr 28 18:30:19 2019 (r346848) @@ -592,11 +592,6 @@ struct filter_entry { static void setup_memwin(struct adapter *); static void position_memwin(struct adapter *, int, uint32_t); -static int rw_via_memwin(struct adapter *, int, uint32_t, uint32_t *, int, int); -static inline int read_via_memwin(struct adapter *, int, uint32_t, uint32_t *, - int); -static inline int write_via_memwin(struct adapter *, int, uint32_t, - const uint32_t *, int); static int validate_mem_range(struct adapter *, uint32_t, uint32_t); static int fwmtype_to_hwmtype(int); static int validate_mt_off_len(struct adapter *, int, uint32_t, uint32_t, @@ -2712,7 +2707,7 @@ position_memwin(struct adapter *sc, int idx, uint32_t t4_read_reg(sc, reg); /* flush */ } -static int +int rw_via_memwin(struct adapter *sc, int idx, uint32_t addr, uint32_t *val, int len, int rw) { @@ -2758,22 +2753,6 @@ rw_via_memwin(struct adapter *sc, int idx, uint32_t ad } return (0); -} - -static inline int -read_via_memwin(struct adapter *sc, int idx, uint32_t addr, uint32_t *val, - int len) -{ - - return (rw_via_memwin(sc, idx, addr, val, len, 0)); -} - -static inline int -write_via_memwin(struct adapter *sc, int idx, uint32_t addr, - const uint32_t *val, int len) -{ - - return (rw_via_memwin(sc, idx, addr, (void *)(uintptr_t)val, len, 1)); } static int Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.c Sun Apr 28 17:27:06 2019 (r346847) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.c Sun Apr 28 18:30:19 2019 (r346848) @@ -396,7 +396,85 @@ t4_ctloutput(struct toedev *tod, struct tcpcb *tp, int } } +static inline int +get_tcb_bit(u_char *tcb, int bit) +{ + int ix, shift; + + ix = 127 - (bit >> 3); + shift = bit & 0x7; + + return ((tcb[ix] >> shift) & 1); +} + +static inline uint64_t +get_tcb_bits(u_char *tcb, int hi, int lo) +{ + uint64_t rc = 0; + + while (hi >= lo) { + rc = (rc << 1) | get_tcb_bit(tcb, hi); + --hi; + } + + return (rc); +} + /* + * Called by the kernel to allow the TOE driver to "refine" values filled up in + * the tcp_info for an offloaded connection. + */ +static void +t4_tcp_info(struct toedev *tod, struct tcpcb *tp, struct tcp_info *ti) +{ + int i, j, k, rc; + struct adapter *sc = tod->tod_softc; + struct toepcb *toep = tp->t_toe; + uint32_t addr, v; + uint32_t buf[TCB_SIZE / sizeof(uint32_t)]; + u_char *tcb, tmp; + + INP_WLOCK_ASSERT(tp->t_inpcb); + MPASS(ti != NULL); + + addr = t4_read_reg(sc, A_TP_CMM_TCB_BASE) + toep->tid * TCB_SIZE; + rc = read_via_memwin(sc, 2, addr, &buf[0], TCB_SIZE); + if (rc != 0) + return; + + tcb = (u_char *)&buf[0]; + for (i = 0, j = TCB_SIZE - 16; i < j; i += 16, j -= 16) { + for (k = 0; k < 16; k++) { + tmp = tcb[i + k]; + tcb[i + k] = tcb[j + k]; + tcb[j + k] = tmp; + } + } + + ti->tcpi_state = get_tcb_bits(tcb, 115, 112); + + v = get_tcb_bits(tcb, 271, 256); + ti->tcpi_rtt = tcp_ticks_to_us(sc, v); + + v = get_tcb_bits(tcb, 287, 272); + ti->tcpi_rttvar = tcp_ticks_to_us(sc, v); + + ti->tcpi_snd_ssthresh = get_tcb_bits(tcb, 487, 460); + ti->tcpi_snd_cwnd = get_tcb_bits(tcb, 459, 432); + ti->tcpi_rcv_nxt = get_tcb_bits(tcb, 553, 522); + + ti->tcpi_snd_nxt = get_tcb_bits(tcb, 319, 288) - + get_tcb_bits(tcb, 375, 348); + + /* Receive window being advertised by us. */ + ti->tcpi_rcv_space = get_tcb_bits(tcb, 581, 554); + + /* Send window ceiling. */ + v = get_tcb_bits(tcb, 159, 144) << get_tcb_bits(tcb, 131, 128); + ti->tcpi_snd_wnd = min(v, ti->tcpi_snd_cwnd); +} + +/* * The TOE driver will not receive any more CPLs for the tid associated with the * toepcb; release the hold on the inpcb. */ @@ -1292,6 +1370,11 @@ t4_tom_activate(struct adapter *sc) tod->tod_syncache_respond = t4_syncache_respond; tod->tod_offload_socket = t4_offload_socket; tod->tod_ctloutput = t4_ctloutput; +#if 0 + tod->tod_tcp_info = t4_tcp_info; +#else + (void)&t4_tcp_info; +#endif for_each_port(sc, i) { for_each_vi(sc->port[i], v, vi) { From owner-svn-src-all@freebsd.org Sun Apr 28 18:36:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23DE31586353; Sun, 28 Apr 2019 18:36:56 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E6F670549; Sun, 28 Apr 2019 18:36:55 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58B59E949; Sun, 28 Apr 2019 18:36:55 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SIatmP086788; Sun, 28 Apr 2019 18:36:55 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SIaswn086784; Sun, 28 Apr 2019 18:36:54 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904281836.x3SIaswn086784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 28 Apr 2019 18:36:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346849 - in stable/11/sys/dev/cxgbe: . tom X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys/dev/cxgbe: . tom X-SVN-Commit-Revision: 346849 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8E6F670549 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 18:36:56 -0000 Author: np Date: Sun Apr 28 18:36:54 2019 New Revision: 346849 URL: https://svnweb.freebsd.org/changeset/base/346849 Log: MFC r333030: cxgbe(4): Break up alloc_tid_tabs and move the atid routines to the base NIC driver. The atid services will be used by new features (hashfilters and inline TLS) that do not involve TOE. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/cxgbe/tom/t4_connect.c stable/11/sys/dev/cxgbe/tom/t4_tom.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Sun Apr 28 18:30:19 2019 (r346848) +++ stable/11/sys/dev/cxgbe/adapter.h Sun Apr 28 18:36:54 2019 (r346849) @@ -1119,6 +1119,11 @@ int vi_full_uninit(struct vi_info *); void vi_sysctls(struct vi_info *); void vi_tick(void *); int rw_via_memwin(struct adapter *, int, uint32_t, uint32_t *, int, int); +int alloc_atid_tab(struct tid_info *, int); +void free_atid_tab(struct tid_info *); +int alloc_atid(struct adapter *, void *); +void *lookup_atid(struct adapter *, int); +void free_atid(struct adapter *, int); #ifdef DEV_NETMAP /* t4_netmap.c */ Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Sun Apr 28 18:30:19 2019 (r346848) +++ stable/11/sys/dev/cxgbe/t4_main.c Sun Apr 28 18:36:54 2019 (r346849) @@ -2755,6 +2755,81 @@ rw_via_memwin(struct adapter *sc, int idx, uint32_t ad return (0); } +int +alloc_atid_tab(struct tid_info *t, int flags) +{ + int i; + + MPASS(t->natids > 0); + MPASS(t->atid_tab == NULL); + + t->atid_tab = malloc(t->natids * sizeof(*t->atid_tab), M_CXGBE, + M_ZERO | flags); + if (t->atid_tab == NULL) + return (ENOMEM); + mtx_init(&t->atid_lock, "atid lock", NULL, MTX_DEF); + t->afree = t->atid_tab; + t->atids_in_use = 0; + for (i = 1; i < t->natids; i++) + t->atid_tab[i - 1].next = &t->atid_tab[i]; + t->atid_tab[t->natids - 1].next = NULL; + + return (0); +} + +void +free_atid_tab(struct tid_info *t) +{ + + KASSERT(t->atids_in_use == 0, + ("%s: %d atids still in use.", __func__, t->atids_in_use)); + + if (mtx_initialized(&t->atid_lock)) + mtx_destroy(&t->atid_lock); + free(t->atid_tab, M_CXGBE); + t->atid_tab = NULL; +} + +int +alloc_atid(struct adapter *sc, void *ctx) +{ + struct tid_info *t = &sc->tids; + int atid = -1; + + mtx_lock(&t->atid_lock); + if (t->afree) { + union aopen_entry *p = t->afree; + + atid = p - t->atid_tab; + t->afree = p->next; + p->data = ctx; + t->atids_in_use++; + } + mtx_unlock(&t->atid_lock); + return (atid); +} + +void * +lookup_atid(struct adapter *sc, int atid) +{ + struct tid_info *t = &sc->tids; + + return (t->atid_tab[atid].data); +} + +void +free_atid(struct adapter *sc, int atid) +{ + struct tid_info *t = &sc->tids; + union aopen_entry *p = &t->atid_tab[atid]; + + mtx_lock(&t->atid_lock); + p->next = t->afree; + t->afree = p; + t->atids_in_use--; + mtx_unlock(&t->atid_lock); +} + static int t4_range_cmp(const void *a, const void *b) { Modified: stable/11/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_connect.c Sun Apr 28 18:30:19 2019 (r346848) +++ stable/11/sys/dev/cxgbe/tom/t4_connect.c Sun Apr 28 18:36:54 2019 (r346849) @@ -63,51 +63,6 @@ __FBSDID("$FreeBSD$"); #include "tom/t4_tom_l2t.h" #include "tom/t4_tom.h" -/* atid services */ -static int alloc_atid(struct adapter *, void *); -static void *lookup_atid(struct adapter *, int); -static void free_atid(struct adapter *, int); - -static int -alloc_atid(struct adapter *sc, void *ctx) -{ - struct tid_info *t = &sc->tids; - int atid = -1; - - mtx_lock(&t->atid_lock); - if (t->afree) { - union aopen_entry *p = t->afree; - - atid = p - t->atid_tab; - t->afree = p->next; - p->data = ctx; - t->atids_in_use++; - } - mtx_unlock(&t->atid_lock); - return (atid); -} - -static void * -lookup_atid(struct adapter *sc, int atid) -{ - struct tid_info *t = &sc->tids; - - return (t->atid_tab[atid].data); -} - -static void -free_atid(struct adapter *sc, int atid) -{ - struct tid_info *t = &sc->tids; - union aopen_entry *p = &t->atid_tab[atid]; - - mtx_lock(&t->atid_lock); - p->next = t->afree; - t->afree = p; - t->atids_in_use--; - mtx_unlock(&t->atid_lock); -} - /* * Active open succeeded. */ Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.c Sun Apr 28 18:30:19 2019 (r346848) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.c Sun Apr 28 18:36:54 2019 (r346849) @@ -751,55 +751,94 @@ negative_advice(int status) } static int -alloc_tid_tabs(struct tid_info *t) +alloc_tid_tab(struct tid_info *t, int flags) { - size_t size; - unsigned int i; - size = t->ntids * sizeof(*t->tid_tab) + - t->natids * sizeof(*t->atid_tab) + - t->nstids * sizeof(*t->stid_tab); + MPASS(t->ntids > 0); + MPASS(t->tid_tab == NULL); - t->tid_tab = malloc(size, M_CXGBE, M_ZERO | M_NOWAIT); + t->tid_tab = malloc(t->ntids * sizeof(*t->tid_tab), M_CXGBE, + M_ZERO | flags); if (t->tid_tab == NULL) return (ENOMEM); + atomic_store_rel_int(&t->tids_in_use, 0); - mtx_init(&t->atid_lock, "atid lock", NULL, MTX_DEF); - t->atid_tab = (union aopen_entry *)&t->tid_tab[t->ntids]; - t->afree = t->atid_tab; - t->atids_in_use = 0; - for (i = 1; i < t->natids; i++) - t->atid_tab[i - 1].next = &t->atid_tab[i]; - t->atid_tab[t->natids - 1].next = NULL; + return (0); +} +static void +free_tid_tab(struct tid_info *t) +{ + + KASSERT(t->tids_in_use == 0, + ("%s: %d tids still in use.", __func__, t->tids_in_use)); + + free(t->tid_tab, M_CXGBE); + t->tid_tab = NULL; +} + +static int +alloc_stid_tab(struct tid_info *t, int flags) +{ + + MPASS(t->nstids > 0); + MPASS(t->stid_tab == NULL); + + t->stid_tab = malloc(t->nstids * sizeof(*t->stid_tab), M_CXGBE, + M_ZERO | flags); + if (t->stid_tab == NULL) + return (ENOMEM); mtx_init(&t->stid_lock, "stid lock", NULL, MTX_DEF); - t->stid_tab = (struct listen_ctx **)&t->atid_tab[t->natids]; t->stids_in_use = 0; TAILQ_INIT(&t->stids); t->nstids_free_head = t->nstids; - atomic_store_rel_int(&t->tids_in_use, 0); - return (0); } static void -free_tid_tabs(struct tid_info *t) +free_stid_tab(struct tid_info *t) { - KASSERT(t->tids_in_use == 0, - ("%s: %d tids still in use.", __func__, t->tids_in_use)); - KASSERT(t->atids_in_use == 0, - ("%s: %d atids still in use.", __func__, t->atids_in_use)); + KASSERT(t->stids_in_use == 0, ("%s: %d tids still in use.", __func__, t->stids_in_use)); - free(t->tid_tab, M_CXGBE); - t->tid_tab = NULL; - - if (mtx_initialized(&t->atid_lock)) - mtx_destroy(&t->atid_lock); if (mtx_initialized(&t->stid_lock)) mtx_destroy(&t->stid_lock); + free(t->stid_tab, M_CXGBE); + t->stid_tab = NULL; +} + +static void +free_tid_tabs(struct tid_info *t) +{ + + free_tid_tab(t); + free_atid_tab(t); + free_stid_tab(t); +} + +static int +alloc_tid_tabs(struct tid_info *t) +{ + int rc; + + rc = alloc_tid_tab(t, M_NOWAIT); + if (rc != 0) + goto failed; + + rc = alloc_atid_tab(t, M_NOWAIT); + if (rc != 0) + goto failed; + + rc = alloc_stid_tab(t, M_NOWAIT); + if (rc != 0) + goto failed; + + return (0); +failed: + free_tid_tabs(t); + return (rc); } static int From owner-svn-src-all@freebsd.org Sun Apr 28 18:44:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E394715865E4; Sun, 28 Apr 2019 18:44:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7ADB670B05; Sun, 28 Apr 2019 18:44:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FA40EB01; Sun, 28 Apr 2019 18:44:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SIiUrv091898; Sun, 28 Apr 2019 18:44:30 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SIiTig091895; Sun, 28 Apr 2019 18:44:29 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904281844.x3SIiTig091895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 28 Apr 2019 18:44:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346850 - in stable/11/sys/dev/cxgbe: . tom X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys/dev/cxgbe: . tom X-SVN-Commit-Revision: 346850 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7ADB670B05 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 18:44:31 -0000 Author: np Date: Sun Apr 28 18:44:29 2019 New Revision: 346850 URL: https://svnweb.freebsd.org/changeset/base/346850 Log: MFC r333043: cxgbe(4): Move release_tid to the base NIC driver for future consumers. Sponsored by: Chelsio Communications. Modified: stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/cxgbe/tom/t4_tom.c stable/11/sys/dev/cxgbe/tom/t4_tom.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Sun Apr 28 18:36:54 2019 (r346849) +++ stable/11/sys/dev/cxgbe/adapter.h Sun Apr 28 18:44:29 2019 (r346850) @@ -1124,6 +1124,7 @@ void free_atid_tab(struct tid_info *); int alloc_atid(struct adapter *, void *); void *lookup_atid(struct adapter *, int); void free_atid(struct adapter *, int); +void release_tid(struct adapter *, int, struct sge_wrq *); #ifdef DEV_NETMAP /* t4_netmap.c */ Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Sun Apr 28 18:36:54 2019 (r346849) +++ stable/11/sys/dev/cxgbe/t4_main.c Sun Apr 28 18:44:29 2019 (r346850) @@ -2830,6 +2830,31 @@ free_atid(struct adapter *sc, int atid) mtx_unlock(&t->atid_lock); } +static void +queue_tid_release(struct adapter *sc, int tid) +{ + + CXGBE_UNIMPLEMENTED("deferred tid release"); +} + +void +release_tid(struct adapter *sc, int tid, struct sge_wrq *ctrlq) +{ + struct wrqe *wr; + struct cpl_tid_release *req; + + wr = alloc_wrqe(sizeof(*req), ctrlq); + if (wr == NULL) { + queue_tid_release(sc, tid); /* defer */ + return; + } + req = wrtod(wr); + + INIT_TP_WR_MIT_CPL(req, CPL_TID_RELEASE, tid); + + t4_wrq_tx(sc, wr); +} + static int t4_range_cmp(const void *a, const void *b) { Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.c Sun Apr 28 18:36:54 2019 (r346849) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.c Sun Apr 28 18:44:29 2019 (r346850) @@ -93,7 +93,6 @@ static struct uld_info tom_uld_info = { .deactivate = t4_tom_deactivate, }; -static void queue_tid_release(struct adapter *, int); static void release_offload_resources(struct toepcb *); static int alloc_tid_tabs(struct tid_info *); static void free_tid_tabs(struct tid_info *); @@ -536,31 +535,6 @@ remove_tid(struct adapter *sc, int tid, int ntids) t->tid_tab[tid] = NULL; atomic_subtract_int(&t->tids_in_use, ntids); -} - -void -release_tid(struct adapter *sc, int tid, struct sge_wrq *ctrlq) -{ - struct wrqe *wr; - struct cpl_tid_release *req; - - wr = alloc_wrqe(sizeof(*req), ctrlq); - if (wr == NULL) { - queue_tid_release(sc, tid); /* defer */ - return; - } - req = wrtod(wr); - - INIT_TP_WR_MIT_CPL(req, CPL_TID_RELEASE, tid); - - t4_wrq_tx(sc, wr); -} - -static void -queue_tid_release(struct adapter *sc, int tid) -{ - - CXGBE_UNIMPLEMENTED("deferred tid release"); } /* Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.h Sun Apr 28 18:36:54 2019 (r346849) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.h Sun Apr 28 18:44:29 2019 (r346850) @@ -329,7 +329,6 @@ void insert_tid(struct adapter *, int, void *, int); void *lookup_tid(struct adapter *, int); void update_tid(struct adapter *, int, void *); void remove_tid(struct adapter *, int, int); -void release_tid(struct adapter *, int, struct sge_wrq *); int find_best_mtu_idx(struct adapter *, struct in_conninfo *, struct offload_settings *); u_long select_rcv_wnd(struct socket *); From owner-svn-src-all@freebsd.org Sun Apr 28 18:45:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFBA9158665B; Sun, 28 Apr 2019 18:45:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 543DE70C34; Sun, 28 Apr 2019 18:45:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CFF0EB02; Sun, 28 Apr 2019 18:45:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SIjj58092009; Sun, 28 Apr 2019 18:45:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SIjjWN092008; Sun, 28 Apr 2019 18:45:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201904281845.x3SIjjWN092008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 28 Apr 2019 18:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346851 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 346851 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 543DE70C34 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 18:45:45 -0000 Author: kib Date: Sun Apr 28 18:45:44 2019 New Revision: 346851 URL: https://svnweb.freebsd.org/changeset/base/346851 Log: Remove witness warning, same as r346351 for busdma_dmar. bounce_bus_dmamap_create() does not sleep either. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/x86/x86/busdma_bounce.c Modified: head/sys/x86/x86/busdma_bounce.c ============================================================================== --- head/sys/x86/x86/busdma_bounce.c Sun Apr 28 18:44:29 2019 (r346850) +++ head/sys/x86/x86/busdma_bounce.c Sun Apr 28 18:45:44 2019 (r346851) @@ -286,8 +286,6 @@ bounce_bus_dmamap_create(bus_dma_tag_t dmat, int flags struct bounce_zone *bz; int error, maxpages, pages; - WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "%s", __func__); - error = 0; if (dmat->segments == NULL) { From owner-svn-src-all@freebsd.org Sun Apr 28 18:50:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C45B1586757; Sun, 28 Apr 2019 18:50:27 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F392770DED; Sun, 28 Apr 2019 18:50:26 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3DC8EB19; Sun, 28 Apr 2019 18:50:26 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SIoQTN092264; Sun, 28 Apr 2019 18:50:26 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SIoPn9092257; Sun, 28 Apr 2019 18:50:25 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904281850.x3SIoPn9092257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 28 Apr 2019 18:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346852 - in stable/11/sys/dev/cxgbe: . tom X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys/dev/cxgbe: . tom X-SVN-Commit-Revision: 346852 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F392770DED X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 18:50:27 -0000 Author: np Date: Sun Apr 28 18:50:25 2019 New Revision: 346852 URL: https://svnweb.freebsd.org/changeset/base/346852 Log: MFC r333114: cxgbe(4): Use opaque cookies or tid range-checks to determine the intended recipient of a CPL when it can't be determined solely from the opcode. Retire the per-queue handlers for such CPLs in favor of the new scheme. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/cxgbe/t4_sge.c stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c stable/11/sys/dev/cxgbe/tom/t4_ddp.c stable/11/sys/dev/cxgbe/tom/t4_tom.c stable/11/sys/dev/cxgbe/tom/t4_tom.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Sun Apr 28 18:45:44 2019 (r346851) +++ stable/11/sys/dev/cxgbe/adapter.h Sun Apr 28 18:50:25 2019 (r346852) @@ -366,6 +366,19 @@ enum { NM_BUSY = 2, }; +enum { + CPL_COOKIE_RESERVED = 0, + CPL_COOKIE_FILTER, + CPL_COOKIE_DDP0, + CPL_COOKIE_DDP1, + CPL_COOKIE_TOM, + CPL_COOKIE_AVAILABLE1, + CPL_COOKIE_AVAILABLE2, + CPL_COOKIE_AVAILABLE3, + + NUM_CPL_COOKIES = 8 /* Limited by M_COOKIE. Do not increase. */ +}; + struct sge_iq; struct rss_header; typedef int (*cpl_handler_t)(struct sge_iq *, const struct rss_header *, @@ -380,8 +393,6 @@ struct sge_iq { uint32_t flags; volatile int state; struct adapter *adapter; - cpl_handler_t set_tcb_rpl; - cpl_handler_t l2t_write_rpl; struct iq_desc *desc; /* KVA of descriptor ring */ int8_t intr_pktc_idx; /* packet count threshold index */ uint8_t gen; /* generation bit */ @@ -1158,9 +1169,10 @@ int parse_pkt(struct adapter *, struct mbuf **); void *start_wrq_wr(struct sge_wrq *, int, struct wrq_cookie *); void commit_wrq_wr(struct sge_wrq *, void *, struct wrq_cookie *); int tnl_cong(struct port_info *, int); -int t4_register_an_handler(an_handler_t); -int t4_register_fw_msg_handler(int, fw_msg_handler_t); -int t4_register_cpl_handler(int, cpl_handler_t); +void t4_register_an_handler(an_handler_t); +void t4_register_fw_msg_handler(int, fw_msg_handler_t); +void t4_register_cpl_handler(int, cpl_handler_t); +void t4_register_shared_cpl_handler(int, cpl_handler_t, int); /* t4_tracer.c */ struct t4_tracer; Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Sun Apr 28 18:45:44 2019 (r346851) +++ stable/11/sys/dev/cxgbe/t4_main.c Sun Apr 28 18:50:25 2019 (r346852) @@ -694,8 +694,6 @@ static int del_filter(struct adapter *, struct t4_filt static void clear_filter(struct filter_entry *); static int set_filter_wr(struct adapter *, int); static int del_filter_wr(struct adapter *, int); -static int set_tcb_rpl(struct sge_iq *, const struct rss_header *, - struct mbuf *); static int get_sge_context(struct adapter *, struct t4_sge_context *); static int load_fw(struct adapter *, struct t4_data *); static int load_cfg(struct adapter *, struct t4_data *); @@ -9703,22 +9701,6 @@ t4_filter_rpl(struct sge_iq *iq, const struct rss_head } static int -set_tcb_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) -{ - - MPASS(iq->set_tcb_rpl != NULL); - return (iq->set_tcb_rpl(iq, rss, m)); -} - -static int -l2t_write_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) -{ - - MPASS(iq->l2t_write_rpl != NULL); - return (iq->l2t_write_rpl(iq, rss, m)); -} - -static int get_sge_context(struct adapter *sc, struct t4_sge_context *cntxt) { int rc; @@ -11007,8 +10989,10 @@ mod_event(module_t mod, int cmd, void *arg) sx_xlock(&mlu); if (loaded++ == 0) { t4_sge_modload(); - t4_register_cpl_handler(CPL_SET_TCB_RPL, set_tcb_rpl); - t4_register_cpl_handler(CPL_L2T_WRITE_RPL, l2t_write_rpl); + t4_register_shared_cpl_handler(CPL_SET_TCB_RPL, + t4_filter_rpl, CPL_COOKIE_FILTER); + t4_register_shared_cpl_handler(CPL_L2T_WRITE_RPL, + do_l2t_write_rpl, CPL_COOKIE_FILTER); t4_register_cpl_handler(CPL_TRACE_PKT, t4_trace_pkt); t4_register_cpl_handler(CPL_T5_TRACE_PKT, t5_trace_pkt); sx_init(&t4_list_lock, "T4/T5 adapters"); Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Sun Apr 28 18:45:44 2019 (r346851) +++ stable/11/sys/dev/cxgbe/t4_sge.c Sun Apr 28 18:50:25 2019 (r346852) @@ -296,98 +296,122 @@ static counter_u64_t extfree_rels; an_handler_t t4_an_handler; fw_msg_handler_t t4_fw_msg_handler[NUM_FW6_TYPES]; cpl_handler_t t4_cpl_handler[NUM_CPL_CMDS]; +cpl_handler_t set_tcb_rpl_handlers[NUM_CPL_COOKIES]; +cpl_handler_t l2t_write_rpl_handlers[NUM_CPL_COOKIES]; - -static int -an_not_handled(struct sge_iq *iq, const struct rsp_ctrl *ctrl) +void +t4_register_an_handler(an_handler_t h) { + uintptr_t *loc; -#ifdef INVARIANTS - panic("%s: async notification on iq %p (ctrl %p)", __func__, iq, ctrl); -#else - log(LOG_ERR, "%s: async notification on iq %p (ctrl %p)\n", - __func__, iq, ctrl); -#endif - return (EDOOFUS); + MPASS(h == NULL || t4_an_handler == NULL); + + loc = (uintptr_t *)&t4_an_handler; + atomic_store_rel_ptr(loc, (uintptr_t)h); } -int -t4_register_an_handler(an_handler_t h) +void +t4_register_fw_msg_handler(int type, fw_msg_handler_t h) { - uintptr_t *loc, new; + uintptr_t *loc; - new = h ? (uintptr_t)h : (uintptr_t)an_not_handled; - loc = (uintptr_t *) &t4_an_handler; - atomic_store_rel_ptr(loc, new); + MPASS(type < nitems(t4_fw_msg_handler)); + MPASS(h == NULL || t4_fw_msg_handler[type] == NULL); + /* + * These are dispatched by the handler for FW{4|6}_CPL_MSG using the CPL + * handler dispatch table. Reject any attempt to install a handler for + * this subtype. + */ + MPASS(type != FW_TYPE_RSSCPL); + MPASS(type != FW6_TYPE_RSSCPL); - return (0); + loc = (uintptr_t *)&t4_fw_msg_handler[type]; + atomic_store_rel_ptr(loc, (uintptr_t)h); } -static int -fw_msg_not_handled(struct adapter *sc, const __be64 *rpl) +void +t4_register_cpl_handler(int opcode, cpl_handler_t h) { - const struct cpl_fw6_msg *cpl = - __containerof(rpl, struct cpl_fw6_msg, data[0]); + uintptr_t *loc; -#ifdef INVARIANTS - panic("%s: fw_msg type %d", __func__, cpl->type); -#else - log(LOG_ERR, "%s: fw_msg type %d\n", __func__, cpl->type); -#endif - return (EDOOFUS); + MPASS(opcode < nitems(t4_cpl_handler)); + MPASS(h == NULL || t4_cpl_handler[opcode] == NULL); + + loc = (uintptr_t *)&t4_cpl_handler[opcode]; + atomic_store_rel_ptr(loc, (uintptr_t)h); } -int -t4_register_fw_msg_handler(int type, fw_msg_handler_t h) +static int +set_tcb_rpl_handler(struct sge_iq *iq, const struct rss_header *rss, + struct mbuf *m) { - uintptr_t *loc, new; + const struct cpl_set_tcb_rpl *cpl = (const void *)(rss + 1); + u_int tid; + int cookie; - if (type >= nitems(t4_fw_msg_handler)) - return (EINVAL); + MPASS(m == NULL); - /* - * These are dispatched by the handler for FW{4|6}_CPL_MSG using the CPL - * handler dispatch table. Reject any attempt to install a handler for - * this subtype. - */ - if (type == FW_TYPE_RSSCPL || type == FW6_TYPE_RSSCPL) - return (EINVAL); + tid = GET_TID(cpl); + if (is_ftid(iq->adapter, tid)) { + /* + * The return code for filter-write is put in the CPL cookie so + * we have to rely on the hardware tid (is_ftid) to determine + * that this is a response to a filter. + */ + cookie = CPL_COOKIE_FILTER; + } else { + cookie = G_COOKIE(cpl->cookie); + } + MPASS(cookie > CPL_COOKIE_RESERVED); + MPASS(cookie < nitems(set_tcb_rpl_handlers)); - new = h ? (uintptr_t)h : (uintptr_t)fw_msg_not_handled; - loc = (uintptr_t *) &t4_fw_msg_handler[type]; - atomic_store_rel_ptr(loc, new); - - return (0); + return (set_tcb_rpl_handlers[cookie](iq, rss, m)); } static int -cpl_not_handled(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) +l2t_write_rpl_handler(struct sge_iq *iq, const struct rss_header *rss, + struct mbuf *m) { + const struct cpl_l2t_write_rpl *rpl = (const void *)(rss + 1); + unsigned int cookie; -#ifdef INVARIANTS - panic("%s: opcode 0x%02x on iq %p with payload %p", - __func__, rss->opcode, iq, m); -#else - log(LOG_ERR, "%s: opcode 0x%02x on iq %p with payload %p\n", - __func__, rss->opcode, iq, m); - m_freem(m); -#endif - return (EDOOFUS); + MPASS(m == NULL); + + cookie = GET_TID(rpl) & F_SYNC_WR ? CPL_COOKIE_TOM : CPL_COOKIE_FILTER; + return (l2t_write_rpl_handlers[cookie](iq, rss, m)); } -int -t4_register_cpl_handler(int opcode, cpl_handler_t h) +static void +t4_init_shared_cpl_handlers(void) { - uintptr_t *loc, new; - if (opcode >= nitems(t4_cpl_handler)) - return (EINVAL); + t4_register_cpl_handler(CPL_SET_TCB_RPL, set_tcb_rpl_handler); + t4_register_cpl_handler(CPL_L2T_WRITE_RPL, l2t_write_rpl_handler); +} - new = h ? (uintptr_t)h : (uintptr_t)cpl_not_handled; - loc = (uintptr_t *) &t4_cpl_handler[opcode]; - atomic_store_rel_ptr(loc, new); +void +t4_register_shared_cpl_handler(int opcode, cpl_handler_t h, int cookie) +{ + uintptr_t *loc; - return (0); + MPASS(opcode < nitems(t4_cpl_handler)); + MPASS(cookie > CPL_COOKIE_RESERVED); + MPASS(cookie < NUM_CPL_COOKIES); + MPASS(t4_cpl_handler[opcode] != NULL); + + switch (opcode) { + case CPL_SET_TCB_RPL: + loc = (uintptr_t *)&set_tcb_rpl_handlers[cookie]; + break; + case CPL_L2T_WRITE_RPL: + loc = (uintptr_t *)&l2t_write_rpl_handlers[cookie]; + break; + default: + MPASS(0); + return; + } + MPASS(h == NULL || *loc == (uintptr_t)NULL); + atomic_store_rel_ptr(loc, (uintptr_t)h); } /* @@ -396,7 +420,6 @@ t4_register_cpl_handler(int opcode, cpl_handler_t h) void t4_sge_modload(void) { - int i; if (fl_pktshift < 0 || fl_pktshift > 7) { printf("Invalid hw.cxgbe.fl_pktshift value (%d)," @@ -436,12 +459,7 @@ t4_sge_modload(void) counter_u64_zero(extfree_refs); counter_u64_zero(extfree_rels); - t4_an_handler = an_not_handled; - for (i = 0; i < nitems(t4_fw_msg_handler); i++) - t4_fw_msg_handler[i] = fw_msg_not_handled; - for (i = 0; i < nitems(t4_cpl_handler); i++) - t4_cpl_handler[i] = cpl_not_handled; - + t4_init_shared_cpl_handlers(); t4_register_cpl_handler(CPL_FW4_MSG, handle_fw_msg); t4_register_cpl_handler(CPL_FW6_MSG, handle_fw_msg); t4_register_cpl_handler(CPL_SGE_EGR_UPDATE, handle_sge_egr_update); @@ -2903,11 +2921,8 @@ alloc_fwq(struct adapter *sc) init_iq(fwq, sc, 0, 0, FW_IQ_QSIZE); if (sc->flags & IS_VF) intr_idx = 0; - else { + else intr_idx = sc->intr_count > 1 ? 1 : 0; - fwq->set_tcb_rpl = t4_filter_rpl; - fwq->l2t_write_rpl = do_l2t_write_rpl; - } rc = alloc_iq_fl(&sc->port[0]->vi[0], fwq, NULL, intr_idx, -1); if (rc != 0) { device_printf(sc->dev, Modified: stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Sun Apr 28 18:45:44 2019 (r346851) +++ stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Sun Apr 28 18:50:25 2019 (r346852) @@ -1912,44 +1912,6 @@ do_fw4_ack(struct sge_iq *iq, const struct rss_header return (0); } -int -do_set_tcb_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) -{ - struct adapter *sc = iq->adapter; - const struct cpl_set_tcb_rpl *cpl = (const void *)(rss + 1); - unsigned int tid = GET_TID(cpl); - struct toepcb *toep; -#ifdef INVARIANTS - unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); -#endif - - KASSERT(opcode == CPL_SET_TCB_RPL, - ("%s: unexpected opcode 0x%x", __func__, opcode)); - KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); - MPASS(iq != &sc->sge.fwq); - - toep = lookup_tid(sc, tid); - if (toep->ulp_mode == ULP_MODE_TCPDDP) { - handle_ddp_tcb_rpl(toep, cpl); - return (0); - } - - /* - * TOM and/or other ULPs don't request replies for CPL_SET_TCB or - * CPL_SET_TCB_FIELD requests. This can easily change and when it does - * the dispatch code will go here. - */ -#ifdef INVARIANTS - panic("%s: Unexpected CPL_SET_TCB_RPL for tid %u on iq %p", __func__, - tid, iq); -#else - log(LOG_ERR, "%s: Unexpected CPL_SET_TCB_RPL for tid %u on iq %p\n", - __func__, tid, iq); -#endif - - return (0); -} - void t4_set_tcb_field(struct adapter *sc, struct sge_wrq *wrq, struct toepcb *toep, uint16_t word, uint64_t mask, uint64_t val, int reply, int cookie) @@ -1959,6 +1921,9 @@ t4_set_tcb_field(struct adapter *sc, struct sge_wrq *w struct ofld_tx_sdesc *txsd; MPASS((cookie & ~M_COOKIE) == 0); + if (reply) { + MPASS(cookie != CPL_COOKIE_RESERVED); + } wr = alloc_wrqe(sizeof(*req), wrq); if (wr == NULL) { Modified: stable/11/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_ddp.c Sun Apr 28 18:45:44 2019 (r346851) +++ stable/11/sys/dev/cxgbe/tom/t4_ddp.c Sun Apr 28 18:50:25 2019 (r346852) @@ -631,11 +631,17 @@ enum { DDP_BUF1_INVALIDATED }; -void -handle_ddp_tcb_rpl(struct toepcb *toep, const struct cpl_set_tcb_rpl *cpl) +CTASSERT(DDP_BUF0_INVALIDATED == CPL_COOKIE_DDP0); + +static int +do_ddp_tcb_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) { + struct adapter *sc = iq->adapter; + const struct cpl_set_tcb_rpl *cpl = (const void *)(rss + 1); + unsigned int tid = GET_TID(cpl); unsigned int db_idx; - struct inpcb *inp = toep->inp; + struct toepcb *toep; + struct inpcb *inp; struct ddp_buffer *db; struct kaiocb *job; long copied; @@ -643,6 +649,8 @@ handle_ddp_tcb_rpl(struct toepcb *toep, const struct c if (cpl->status != CPL_ERR_NONE) panic("XXX: tcp_rpl failed: %d", cpl->status); + toep = lookup_tid(sc, tid); + inp = toep->inp; switch (cpl->cookie) { case V_WORD(W_TCB_RX_DDP_FLAGS) | V_COOKIE(DDP_BUF0_INVALIDATED): case V_WORD(W_TCB_RX_DDP_FLAGS) | V_COOKIE(DDP_BUF1_INVALIDATED): @@ -650,6 +658,7 @@ handle_ddp_tcb_rpl(struct toepcb *toep, const struct c * XXX: This duplicates a lot of code with handle_ddp_data(). */ db_idx = G_COOKIE(cpl->cookie) - DDP_BUF0_INVALIDATED; + MPASS(db_idx < nitems(toep->ddp.db)); INP_WLOCK(inp); DDP_LOCK(toep); db = &toep->ddp.db[db_idx]; @@ -694,6 +703,8 @@ handle_ddp_tcb_rpl(struct toepcb *toep, const struct c panic("XXX: unknown tcb_rpl offset %#x, cookie %#x", G_WORD(cpl->cookie), G_COOKIE(cpl->cookie)); } + + return (0); } void @@ -1946,6 +1957,10 @@ void t4_ddp_mod_load(void) { + t4_register_shared_cpl_handler(CPL_SET_TCB_RPL, do_ddp_tcb_rpl, + CPL_COOKIE_DDP0); + t4_register_shared_cpl_handler(CPL_SET_TCB_RPL, do_ddp_tcb_rpl, + CPL_COOKIE_DDP1); t4_register_cpl_handler(CPL_RX_DATA_DDP, do_rx_data_ddp); t4_register_cpl_handler(CPL_RX_DDP_COMPLETE, do_rx_ddp_complete); TAILQ_INIT(&ddp_orphan_pagesets); Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.c Sun Apr 28 18:45:44 2019 (r346851) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.c Sun Apr 28 18:50:25 2019 (r346852) @@ -1326,8 +1326,7 @@ t4_tom_activate(struct adapter *sc) struct tom_data *td; struct toedev *tod; struct vi_info *vi; - struct sge_ofld_rxq *ofld_rxq; - int i, j, rc, v; + int i, rc, v; ASSERT_SYNCHRONIZED_OP(sc); @@ -1392,10 +1391,6 @@ t4_tom_activate(struct adapter *sc) for_each_port(sc, i) { for_each_vi(sc->port[i], v, vi) { TOEDEV(vi->ifp) = &td->tod; - for_each_ofld_rxq(vi, j, ofld_rxq) { - ofld_rxq->iq.set_tcb_rpl = do_set_tcb_rpl; - ofld_rxq->iq.l2t_write_rpl = do_l2t_write_rpl2; - } } } @@ -1498,6 +1493,8 @@ t4_tom_mod_load(void) struct protosw *tcp_protosw, *tcp6_protosw; /* CPL handlers */ + t4_register_shared_cpl_handler(CPL_L2T_WRITE_RPL, do_l2t_write_rpl2, + CPL_COOKIE_TOM); t4_init_connect_cpl_handlers(); t4_init_listen_cpl_handlers(); t4_init_cpl_io_handlers(); @@ -1562,6 +1559,7 @@ t4_tom_mod_unload(void) t4_uninit_connect_cpl_handlers(); t4_uninit_listen_cpl_handlers(); t4_uninit_cpl_io_handlers(); + t4_register_shared_cpl_handler(CPL_L2T_WRITE_RPL, NULL, CPL_COOKIE_TOM); return (0); } Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.h Sun Apr 28 18:45:44 2019 (r346851) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.h Sun Apr 28 18:50:25 2019 (r346852) @@ -386,7 +386,6 @@ void t4_set_tcb_field(struct adapter *, struct sge_wrq uint16_t, uint64_t, uint64_t, int, int); void t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop); void t4_push_pdus(struct adapter *sc, struct toepcb *toep, int drop); -int do_set_tcb_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); /* t4_ddp.c */ int t4_init_ppod_region(struct ppod_region *, struct t4_range *, u_int, @@ -412,7 +411,6 @@ void ddp_queue_toep(struct toepcb *); void release_ddp_resources(struct toepcb *toep); void handle_ddp_close(struct toepcb *, struct tcpcb *, uint32_t); void handle_ddp_indicate(struct toepcb *); -void handle_ddp_tcb_rpl(struct toepcb *, const struct cpl_set_tcb_rpl *); void insert_ddp_data(struct toepcb *, uint32_t); const struct offload_settings *lookup_offload_policy(struct adapter *, int, struct mbuf *, uint16_t, struct inpcb *); From owner-svn-src-all@freebsd.org Sun Apr 28 19:02:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10D051586C33; Sun, 28 Apr 2019 19:02:36 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A4F5171680; Sun, 28 Apr 2019 19:02:35 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DAA3EE87; Sun, 28 Apr 2019 19:02:35 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SJ2Z8S002652; Sun, 28 Apr 2019 19:02:35 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SJ2YBa002647; Sun, 28 Apr 2019 19:02:34 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904281902.x3SJ2YBa002647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 28 Apr 2019 19:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346853 - in stable/11/sys/dev/cxgbe: . common tom X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys/dev/cxgbe: . common tom X-SVN-Commit-Revision: 346853 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A4F5171680 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 19:02:36 -0000 Author: np Date: Sun Apr 28 19:02:34 2019 New Revision: 346853 URL: https://svnweb.freebsd.org/changeset/base/346853 Log: MFC r333121, r333128 r333121: cxgbe/t4_tom: Use appropriate macros instead of magic math while constructing the atid of an active open work request. Sponsored by: Chelsio Communications r333128: cxgbe(4): Convert ACT_OPEN_RPL to a shared CPL. Reserve 3b in the 14b atid to identify the owner and use it to dispatch the CPL. This allows all CPLs that use an atid to be used as shared CPLs, although ACT_OPEN_RPL is the only one being converted in this revision. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/common/t4_msg.h stable/11/sys/dev/cxgbe/offload.h stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/cxgbe/t4_sge.c stable/11/sys/dev/cxgbe/tom/t4_connect.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/common/t4_msg.h ============================================================================== --- stable/11/sys/dev/cxgbe/common/t4_msg.h Sun Apr 28 18:50:25 2019 (r346852) +++ stable/11/sys/dev/cxgbe/common/t4_msg.h Sun Apr 28 19:02:34 2019 (r346853) @@ -306,9 +306,14 @@ union opcode_tid { /* partitioning of TID fields that also carry a queue id */ #define S_TID_TID 0 -#define M_TID_TID 0x3fff +#define M_TID_TID 0x7ff #define V_TID_TID(x) ((x) << S_TID_TID) #define G_TID_TID(x) (((x) >> S_TID_TID) & M_TID_TID) + +#define S_TID_COOKIE 11 +#define M_TID_COOKIE 0x7 +#define V_TID_COOKIE(x) ((x) << S_TID_COOKIE) +#define G_TID_COOKIE(x) (((x) >> S_TID_COOKIE) & M_TID_COOKIE) #define S_TID_QID 14 #define M_TID_QID 0x3ff Modified: stable/11/sys/dev/cxgbe/offload.h ============================================================================== --- stable/11/sys/dev/cxgbe/offload.h Sun Apr 28 18:50:25 2019 (r346852) +++ stable/11/sys/dev/cxgbe/offload.h Sun Apr 28 19:02:34 2019 (r346853) @@ -64,9 +64,10 @@ struct stid_region { }; /* - * Max # of ATIDs. The absolute HW max is 16K but we keep it lower. + * Max # of ATIDs. The absolute HW max is 14b (enough for 16K) but we reserve + * the upper 3b for use as a cookie to demux the reply. */ -#define MAX_ATIDS 8192U +#define MAX_ATIDS 2048U union aopen_entry { void *data; Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Sun Apr 28 18:50:25 2019 (r346852) +++ stable/11/sys/dev/cxgbe/t4_main.c Sun Apr 28 19:02:34 2019 (r346853) @@ -2799,6 +2799,7 @@ alloc_atid(struct adapter *sc, void *ctx) union aopen_entry *p = t->afree; atid = p - t->atid_tab; + MPASS(atid <= M_TID_TID); t->afree = p->next; p->data = ctx; t->atids_in_use++; Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Sun Apr 28 18:50:25 2019 (r346852) +++ stable/11/sys/dev/cxgbe/t4_sge.c Sun Apr 28 19:02:34 2019 (r346853) @@ -298,6 +298,7 @@ fw_msg_handler_t t4_fw_msg_handler[NUM_FW6_TYPES]; cpl_handler_t t4_cpl_handler[NUM_CPL_CMDS]; cpl_handler_t set_tcb_rpl_handlers[NUM_CPL_COOKIES]; cpl_handler_t l2t_write_rpl_handlers[NUM_CPL_COOKIES]; +cpl_handler_t act_open_rpl_handlers[NUM_CPL_COOKIES]; void t4_register_an_handler(an_handler_t h) @@ -381,12 +382,26 @@ l2t_write_rpl_handler(struct sge_iq *iq, const struct return (l2t_write_rpl_handlers[cookie](iq, rss, m)); } +static int +act_open_rpl_handler(struct sge_iq *iq, const struct rss_header *rss, + struct mbuf *m) +{ + const struct cpl_act_open_rpl *cpl = (const void *)(rss + 1); + u_int cookie = G_TID_COOKIE(G_AOPEN_ATID(be32toh(cpl->atid_status))); + + MPASS(m == NULL); + MPASS(cookie != CPL_COOKIE_RESERVED); + + return (act_open_rpl_handlers[cookie](iq, rss, m)); +} + static void t4_init_shared_cpl_handlers(void) { t4_register_cpl_handler(CPL_SET_TCB_RPL, set_tcb_rpl_handler); t4_register_cpl_handler(CPL_L2T_WRITE_RPL, l2t_write_rpl_handler); + t4_register_cpl_handler(CPL_ACT_OPEN_RPL, act_open_rpl_handler); } void @@ -405,6 +420,9 @@ t4_register_shared_cpl_handler(int opcode, cpl_handler break; case CPL_L2T_WRITE_RPL: loc = (uintptr_t *)&l2t_write_rpl_handlers[cookie]; + break; + case CPL_ACT_OPEN_RPL: + loc = (uintptr_t *)&act_open_rpl_handlers[cookie]; break; default: MPASS(0); Modified: stable/11/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_connect.c Sun Apr 28 18:50:25 2019 (r346852) +++ stable/11/sys/dev/cxgbe/tom/t4_connect.c Sun Apr 28 19:02:34 2019 (r346853) @@ -279,7 +279,8 @@ t4_init_connect_cpl_handlers(void) { t4_register_cpl_handler(CPL_ACT_ESTABLISH, do_act_establish); - t4_register_cpl_handler(CPL_ACT_OPEN_RPL, do_act_open_rpl); + t4_register_shared_cpl_handler(CPL_ACT_OPEN_RPL, do_act_open_rpl, + CPL_COOKIE_TOM); } void @@ -287,7 +288,7 @@ t4_uninit_connect_cpl_handlers(void) { t4_register_cpl_handler(CPL_ACT_ESTABLISH, NULL); - t4_register_cpl_handler(CPL_ACT_OPEN_RPL, NULL); + t4_register_shared_cpl_handler(CPL_ACT_OPEN_RPL, NULL, CPL_COOKIE_TOM); } #define DONT_OFFLOAD_ACTIVE_OPEN(x) do { \ @@ -416,7 +417,8 @@ t4_connect(struct toedev *tod, struct socket *so, stru else rscale = 0; mtu_idx = find_best_mtu_idx(sc, &inp->inp_inc, &settings); - qid_atid = (toep->ofld_rxq->iq.abs_id << 14) | toep->tid; + qid_atid = V_TID_QID(toep->ofld_rxq->iq.abs_id) | V_TID_TID(toep->tid) | + V_TID_COOKIE(CPL_COOKIE_TOM); if (isipv6) { struct cpl_act_open_req6 *cpl = wrtod(wr); From owner-svn-src-all@freebsd.org Sun Apr 28 19:07:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 447531586D79; Sun, 28 Apr 2019 19:07:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDC63718C1; Sun, 28 Apr 2019 19:07:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9951AEE8B; Sun, 28 Apr 2019 19:07:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SJ7WG7003067; Sun, 28 Apr 2019 19:07:32 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SJ7WFA003066; Sun, 28 Apr 2019 19:07:32 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201904281907.x3SJ7WFA003066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 28 Apr 2019 19:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346854 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip X-SVN-Commit-Revision: 346854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CDC63718C1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 19:07:33 -0000 Author: tuexen Date: Sun Apr 28 19:07:31 2019 New Revision: 346854 URL: https://svnweb.freebsd.org/changeset/base/346854 Log: Some test scripts use ncat --sctp --listen port to run an SCTP discard server in the background. However, when running in the background, stdin is closed and ncat initiates a graceful shutdown of the SCTP association. This is not expected by the client. Therefore, the ncat-based discard server is replaced by a perl-based one. In addition, to remove the dependency from ncat, which needs to be installed via the nmap port, also the code testing for a free SCTP port is changed to use the perl-based client. Finally, remove some debug output from the report generated. Reviewed by: lwhsu@ Differential Revision: https://reviews.freebsd.org/D20086 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh Sun Apr 28 19:02:34 2019 (r346853) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh Sun Apr 28 19:07:31 2019 (r346854) @@ -58,36 +58,52 @@ DIR=/var/tmp/dtest.$$ sctpport=1024 bound=5000 -while [ $sctpport -lt $bound ]; do - ncat --sctp -z $local $sctpport > /dev/null || break - sctpport=$(($sctpport + 1)) -done -if [ $sctpport -eq $bound ]; then - echo "couldn't find an available SCTP port" - exit 1 -fi mkdir $DIR cd $DIR -# ncat will exit when the association is closed. -ncat --sctp --listen $local $sctpport & - -cat > test.pl <<-EOPERL +cat > client.pl <<-EOPERL use IO::Socket; my \$s = IO::Socket::INET->new( Type => SOCK_STREAM, Proto => "sctp", LocalAddr => "$local", PeerAddr => "$local", - PeerPort => $sctpport, + PeerPort => \$ARGV[0], Timeout => 3); - die "Could not connect to host $local port $sctpport \$@" unless \$s; + die "Could not connect to host $local port \$ARGV[0] \$@" unless \$s; close \$s; - sleep(2); + sleep(\$ARGV[1]); EOPERL -$dtrace -c 'perl test.pl' -qs /dev/stdin <&- || break + sctpport=$(($sctpport + 1)) +done +if [ $sctpport -eq $bound ]; then + echo "couldn't find an available SCTP port" + exit 1 +fi + +cat > server.pl <<-EOPERL + use IO::Socket; + my \$l = IO::Socket::INET->new( + Type => SOCK_STREAM, + Proto => "sctp", + LocalAddr => "$local", + LocalPort => $sctpport, + Listen => 1, + Reuse => 1); + die "Could not listen on $local port $sctpport \$@" unless \$l; + my \$c = \$l->accept(); + close \$l; + while (<\$c>) {}; + close \$c; +EOPERL + +perl server.pl & + +$dtrace -c "perl client.pl $sctpport 2" -qs /dev/stdin <= 7 ? "yes" : "no"); - printf("ip:::receive (%d) - %s\n", ipreceive, ipreceive >= 7 ? "yes" : "no"); - printf("sctp:::send (%d) - %s\n", sctpsend, sctpsend >= 7 ? "yes" : "no"); - printf("sctp:::receive (%d) - %s\n", sctpreceive, sctpreceive >= 7 ? "yes" : "no"); + printf("ip:::send - %s\n", ipsend >= 7 ? "yes" : "no"); + printf("ip:::receive - %s\n", ipreceive >= 7 ? "yes" : "no"); + printf("sctp:::send - %s\n", sctpsend >= 7 ? "yes" : "no"); + printf("sctp:::receive - %s\n", sctpreceive >= 7 ? "yes" : "no"); } EODTRACE Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh Sun Apr 28 19:02:34 2019 (r346853) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh Sun Apr 28 19:07:31 2019 (r346854) @@ -61,36 +61,52 @@ DIR=/var/tmp/dtest.$$ sctpport=1024 bound=5000 -while [ $sctpport -lt $bound ]; do - ncat --sctp -z $local $sctpport > /dev/null || break - sctpport=$(($sctpport + 1)) -done -if [ $sctpport -eq $bound ]; then - echo "couldn't find an available SCTP port" - exit 1 -fi mkdir $DIR cd $DIR -# ncat will exit when the association is closed. -ncat --sctp --listen $local $sctpport & - -cat > test.pl <<-EOPERL +cat > client.pl <<-EOPERL use IO::Socket; my \$s = IO::Socket::INET->new( Type => SOCK_STREAM, Proto => "sctp", LocalAddr => "$local", PeerAddr => "$local", - PeerPort => $sctpport, + PeerPort => \$ARGV[0], Timeout => 3); - die "Could not connect to host $local port $sctpport \$@" unless \$s; + die "Could not connect to host $local port \$ARGV[0] \$@" unless \$s; close \$s; - sleep(2); + sleep(\$ARGV[1]); EOPERL -$dtrace -c 'perl test.pl' -qs /dev/stdin <&- || break + sctpport=$(($sctpport + 1)) +done +if [ $sctpport -eq $bound ]; then + echo "couldn't find an available SCTP port" + exit 1 +fi + +cat > server.pl <<-EOPERL + use IO::Socket; + my \$l = IO::Socket::INET->new( + Type => SOCK_STREAM, + Proto => "sctp", + LocalAddr => "$local", + LocalPort => $sctpport, + Listen => 1, + Reuse => 1); + die "Could not listen on $local port $sctpport \$@" unless \$l; + my \$c = \$l->accept(); + close \$l; + while (<\$c>) {}; + close \$c; +EOPERL + +perl server.pl & + +$dtrace -c "perl client.pl $sctpport 2" -qs /dev/stdin < Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EAE21587C74; Sun, 28 Apr 2019 19:52:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35C1072E5A; Sun, 28 Apr 2019 19:52:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 074FEF722; Sun, 28 Apr 2019 19:52:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SJqphg029857; Sun, 28 Apr 2019 19:52:51 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SJqnxt029847; Sun, 28 Apr 2019 19:52:49 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904281952.x3SJqnxt029847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 28 Apr 2019 19:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346855 - in stable/11/sys: conf dev/cxgbe dev/cxgbe/common dev/cxgbe/firmware dev/cxgbe/tom modules/cxgbe/if_cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys: conf dev/cxgbe dev/cxgbe/common dev/cxgbe/firmware dev/cxgbe/tom modules/cxgbe/if_cxgbe X-SVN-Commit-Revision: 346855 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 35C1072E5A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 19:52:52 -0000 Author: np Date: Sun Apr 28 19:52:48 2019 New Revision: 346855 URL: https://svnweb.freebsd.org/changeset/base/346855 Log: MFC r333153, r333394, r333442, r333472, r333620, r334058, r334447, r334452, and r335684. These revisions added hashfilters, NAT offload, and SMAC/DMAC swapping filters to cxgbe. r333153: cxgbe(4): Move all TCAM filter code into a separate file. Sponsored by: Chelsio Communications r333394: cxgbe(4): Add support for hash filters. These filters reside in the card's memory instead of its TCAM and can be configured via a new "hashfilter" subcommand in cxgbetool. Hash and normal TCAM filters can be used together. The hardware does an exact-match of packet fields for hash filters, unlike the masked match performed for TCAM filters. Any T5/T6 card with memory can support at least half a million hash filters. The sample config file with the driver configures 512K of these, it is possible to double this to 1 million+ in some cases. The chip does an exact-match of fields of incoming datagrams with hash filters and performs the action configured for the filter if it matches. The fields to match are specified in a "filter mask" in the firmware config file. The filter mask always includes the 5-tuple (sip, dip, sport, dport, ipproto). It can, optionally, also include any subset of the filter mode (see filterMode and filterMask in the firmware config file). For example: filterMode = fragmentation, mpshittype, protocol, vlan, port, fcoe filterMask = protocol, port, vlan Exact values of the 5-tuple, the physical port, and VLAN tag would have to be provided while setting up a hash filter with the chip configuration above. Hash filters support all actions supported by TCAM filters. A packet that hits a hash filter can be dropped, let through (with optional steering to a specific queue or RSS region), switched out of another port (with optional L2 rewrite of DMAC, SMAC, VLAN tag), or get NAT'ed. (Support for some of these will show up in the driver in a follow-up commit very shortly). Sponsored by: Chelsio Communications r333442: cxgbe(4): Determine whether the firmware supports the FILTER2 work request, which can be used to configure hardware NAT and swapmac. All firmwares released after Jan 2017 support this work request. Sponsored by: Chelsio Communications r333472: cxgbe(4): Add fields to support configuration of hardware NAT and swapmac (SMAC/DMAC switcheroo) from userspace. Sponsored by: Chelsio Communications r333620: cxgbe(4): Filtering related features and fixes. - Driver support for hardware NAT. - Driver support for swapmac action. - Validate a request to create a hashfilter against the filter mask. - Add a hashfilter config file for T5. Sponsored by: Chelsio Communications r334058: cxgbe(4): Only valid filters are expected to have a valid tid. r334447: cxgbe(4): Add code to deal with the chip's source MAC table (aka SMT). Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications r334452: cxgbe(4): Add support for SMAC-rewriting filters. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications r335684: cxgbe(4): Do not leak the filters in the hashfilter table on module unload. Sponsored by: Chelsio Communications Relnotes: Yes Added: stable/11/sys/dev/cxgbe/firmware/t5fw_cfg_hashfilter.txt - copied unchanged from r333620, head/sys/dev/cxgbe/firmware/t5fw_cfg_hashfilter.txt stable/11/sys/dev/cxgbe/firmware/t6fw_cfg_hashfilter.txt - copied unchanged from r333394, head/sys/dev/cxgbe/firmware/t6fw_cfg_hashfilter.txt stable/11/sys/dev/cxgbe/t4_filter.c - copied, changed from r333153, head/sys/dev/cxgbe/t4_filter.c stable/11/sys/dev/cxgbe/t4_smt.c - copied unchanged from r334447, head/sys/dev/cxgbe/t4_smt.c stable/11/sys/dev/cxgbe/t4_smt.h - copied unchanged from r334447, head/sys/dev/cxgbe/t4_smt.h Modified: stable/11/sys/conf/files stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/common/common.h stable/11/sys/dev/cxgbe/common/t4_hw.c stable/11/sys/dev/cxgbe/common/t4_msg.h stable/11/sys/dev/cxgbe/common/t4_regs_values.h stable/11/sys/dev/cxgbe/offload.h stable/11/sys/dev/cxgbe/t4_ioctl.h stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/cxgbe/t4_sge.c stable/11/sys/dev/cxgbe/tom/t4_connect.c stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c stable/11/sys/dev/cxgbe/tom/t4_tom.c stable/11/sys/modules/cxgbe/if_cxgbe/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Sun Apr 28 19:07:31 2019 (r346854) +++ stable/11/sys/conf/files Sun Apr 28 19:52:48 2019 (r346855) @@ -1330,6 +1330,8 @@ dev/cxgb/sys/uipc_mvec.c optional cxgb pci \ compile-with "${NORMAL_C} -I$S/dev/cxgb" dev/cxgb/cxgb_t3fw.c optional cxgb cxgb_t3fw \ compile-with "${NORMAL_C} -I$S/dev/cxgb" +dev/cxgbe/t4_filter.c optional cxgbe pci \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/t4_if.m optional cxgbe pci dev/cxgbe/t4_iov.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" @@ -1342,6 +1344,8 @@ dev/cxgbe/t4_netmap.c optional cxgbe pci \ dev/cxgbe/t4_sched.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/t4_sge.c optional cxgbe pci \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/t4_smt.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/t4_l2t.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Sun Apr 28 19:07:31 2019 (r346854) +++ stable/11/sys/dev/cxgbe/adapter.h Sun Apr 28 19:52:48 2019 (r346855) @@ -372,7 +372,7 @@ enum { CPL_COOKIE_DDP0, CPL_COOKIE_DDP1, CPL_COOKIE_TOM, - CPL_COOKIE_AVAILABLE1, + CPL_COOKIE_HASHFILTER, CPL_COOKIE_AVAILABLE2, CPL_COOKIE_AVAILABLE3, @@ -823,6 +823,7 @@ struct adapter { void *iscsi_ulp_softc; /* (struct cxgbei_data *) */ void *ccr_softc; /* (struct ccr_softc *) */ struct l2t_data *l2t; /* L2 table */ + struct smt_data *smt; /* Source MAC Table */ struct tid_info tids; vmem_t *key_map; @@ -1113,7 +1114,6 @@ void t4_init_devnames(struct adapter *); void t4_add_adapter(struct adapter *); void t4_aes_getdeckey(void *, const void *, unsigned int); int t4_detach_common(device_t); -int t4_filter_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); int t4_map_bars_0_and_4(struct adapter *); int t4_map_bar_2(struct adapter *); int t4_setup_intr_handlers(struct adapter *); @@ -1192,6 +1192,18 @@ int t4_free_tx_sched(struct adapter *); void t4_update_tx_sched(struct adapter *); int t4_reserve_cl_rl_kbps(struct adapter *, int, u_int, int *); void t4_release_cl_rl_kbps(struct adapter *, int, int); + +/* t4_filter.c */ +int get_filter_mode(struct adapter *, uint32_t *); +int set_filter_mode(struct adapter *, uint32_t); +int get_filter(struct adapter *, struct t4_filter *); +int set_filter(struct adapter *, struct t4_filter *); +int del_filter(struct adapter *, struct t4_filter *); +int t4_filter_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); +int t4_hashfilter_ao_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); +int t4_hashfilter_tcb_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); +int t4_del_hashfilter_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); +void free_hftid_tab(struct tid_info *); static inline struct wrqe * alloc_wrqe(int wr_len, struct sge_wrq *wrq) Modified: stable/11/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/11/sys/dev/cxgbe/common/common.h Sun Apr 28 19:07:31 2019 (r346854) +++ stable/11/sys/dev/cxgbe/common/common.h Sun Apr 28 19:52:48 2019 (r346855) @@ -237,6 +237,7 @@ struct tp_params { uint32_t vlan_pri_map; uint32_t ingress_config; + uint64_t hash_filter_mask; __be16 err_vec_mask; int8_t fcoe_shift; @@ -370,6 +371,8 @@ struct adapter_params { unsigned int bypass:1; /* this is a bypass card */ unsigned int ethoffload:1; unsigned int port_caps32:1; + unsigned int hash_filter:1; + unsigned int filter2_wr_support:1; unsigned int ofldq_wr_cred; unsigned int eo_wr_cred; @@ -457,6 +460,11 @@ static inline int is_offload(const struct adapter *ada static inline int is_ethoffload(const struct adapter *adap) { return adap->params.ethoffload; +} + +static inline int is_hashfilter(const struct adapter *adap) +{ + return adap->params.hash_filter; } static inline int chip_id(struct adapter *adap) Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/11/sys/dev/cxgbe/common/t4_hw.c Sun Apr 28 19:07:31 2019 (r346854) +++ stable/11/sys/dev/cxgbe/common/t4_hw.c Sun Apr 28 19:52:48 2019 (r346855) @@ -8685,6 +8685,7 @@ int t4_init_sge_params(struct adapter *adapter) static void read_filter_mode_and_ingress_config(struct adapter *adap, bool sleep_ok) { + uint32_t v; struct tp_params *tpp = &adap->params.tp; t4_tp_pio_read(adap, &tpp->vlan_pri_map, 1, A_TP_VLAN_PRI_MAP, @@ -8708,12 +8709,12 @@ static void read_filter_mode_and_ingress_config(struct tpp->matchtype_shift = t4_filter_field_shift(adap, F_MPSHITTYPE); tpp->frag_shift = t4_filter_field_shift(adap, F_FRAGMENTATION); - /* - * If TP_INGRESS_CONFIG.VNID == 0, then TP_VLAN_PRI_MAP.VNIC_ID - * represents the presence of an Outer VLAN instead of a VNIC ID. - */ - if ((tpp->ingress_config & F_VNIC) == 0) - tpp->vnic_shift = -1; + if (chip_id(adap) > CHELSIO_T4) { + v = t4_read_reg(adap, LE_HASH_MASK_GEN_IPV4T5(3)); + adap->params.tp.hash_filter_mask = v; + v = t4_read_reg(adap, LE_HASH_MASK_GEN_IPV4T5(4)); + adap->params.tp.hash_filter_mask |= (u64)v << 32; + } } /** Modified: stable/11/sys/dev/cxgbe/common/t4_msg.h ============================================================================== --- stable/11/sys/dev/cxgbe/common/t4_msg.h Sun Apr 28 19:07:31 2019 (r346854) +++ stable/11/sys/dev/cxgbe/common/t4_msg.h Sun Apr 28 19:52:48 2019 (r346855) @@ -195,6 +195,30 @@ static inline int act_open_has_tid(int status) status != CPL_ERR_CONN_EXIST); } +/* + * Convert an ACT_OPEN_RPL status to an errno. + */ +static inline int +act_open_rpl_status_to_errno(int status) +{ + + switch (status) { + case CPL_ERR_CONN_RESET: + return (ECONNREFUSED); + case CPL_ERR_ARP_MISS: + return (EHOSTUNREACH); + case CPL_ERR_CONN_TIMEDOUT: + return (ETIMEDOUT); + case CPL_ERR_TCAM_FULL: + return (EAGAIN); + case CPL_ERR_CONN_EXIST: + return (EAGAIN); + default: + return (EIO); + } +} + + enum { CPL_CONN_POLICY_AUTO = 0, CPL_CONN_POLICY_ASK = 1, @@ -1038,6 +1062,14 @@ struct cpl_abort_req { __u8 rsvd2[6]; }; +struct cpl_abort_req_core { + union opcode_tid ot; + __be32 rsvd0; + __u8 rsvd1; + __u8 cmd; + __u8 rsvd2[6]; +}; + struct cpl_abort_rpl_rss { RSS_HDR union opcode_tid ot; @@ -1053,6 +1085,14 @@ struct cpl_abort_rpl_rss6 { struct cpl_abort_rpl { WR_HDR; + union opcode_tid ot; + __be32 rsvd0; + __u8 rsvd1; + __u8 cmd; + __u8 rsvd2[6]; +}; + +struct cpl_abort_rpl_core { union opcode_tid ot; __be32 rsvd0; __u8 rsvd1; Modified: stable/11/sys/dev/cxgbe/common/t4_regs_values.h ============================================================================== --- stable/11/sys/dev/cxgbe/common/t4_regs_values.h Sun Apr 28 19:07:31 2019 (r346854) +++ stable/11/sys/dev/cxgbe/common/t4_regs_values.h Sun Apr 28 19:52:48 2019 (r346855) @@ -290,6 +290,17 @@ #define W_FT_MPSHITTYPE 3 #define W_FT_FRAGMENTATION 1 +#define M_FT_FCOE ((1ULL << W_FT_FCOE) - 1) +#define M_FT_PORT ((1ULL << W_FT_PORT) - 1) +#define M_FT_VNIC_ID ((1ULL << W_FT_VNIC_ID) - 1) +#define M_FT_VLAN ((1ULL << W_FT_VLAN) - 1) +#define M_FT_TOS ((1ULL << W_FT_TOS) - 1) +#define M_FT_PROTOCOL ((1ULL << W_FT_PROTOCOL) - 1) +#define M_FT_ETHERTYPE ((1ULL << W_FT_ETHERTYPE) - 1) +#define M_FT_MACMATCH ((1ULL << W_FT_MACMATCH) - 1) +#define M_FT_MPSHITTYPE ((1ULL << W_FT_MPSHITTYPE) - 1) +#define M_FT_FRAGMENTATION ((1ULL << W_FT_FRAGMENTATION) - 1) + /* * Some of the Compressed Filter Tuple fields have internal structure. These * bit shifts/masks describe those structures. All shifts are relative to the Copied: stable/11/sys/dev/cxgbe/firmware/t5fw_cfg_hashfilter.txt (from r333620, head/sys/dev/cxgbe/firmware/t5fw_cfg_hashfilter.txt) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/cxgbe/firmware/t5fw_cfg_hashfilter.txt Sun Apr 28 19:52:48 2019 (r346855, copy of r333620, head/sys/dev/cxgbe/firmware/t5fw_cfg_hashfilter.txt) @@ -0,0 +1,300 @@ +# Firmware configuration file. +# +# Global limits (some are hardware limits, others are due to the firmware). +# nvi = 128 virtual interfaces +# niqflint = 1023 ingress queues with freelists and/or interrupts +# nethctrl = 64K Ethernet or ctrl egress queues +# neq = 64K egress queues of all kinds, including freelists +# nexactf = 512 MPS TCAM entries, can oversubscribe. +# + +[global] + rss_glb_config_mode = basicvirtual + rss_glb_config_options = tnlmapen,hashtoeplitz,tnlalllkp + + # PL_TIMEOUT register + pl_timeout_value = 10000 # the timeout value in units of us + + # SGE_THROTTLE_CONTROL + bar2throttlecount = 500 # bar2throttlecount in us + + sge_timer_value = 1, 5, 10, 50, 100, 200 # SGE_TIMER_VALUE* in usecs + + reg[0x1124] = 0x00000400/0x00000400 # SGE_CONTROL2, enable VFIFO; if + # SGE_VFIFO_SIZE is not set, then + # firmware will set it up in function + # of number of egress queues used + + reg[0x1130] = 0x00d5ffeb # SGE_DBP_FETCH_THRESHOLD, fetch + # threshold set to queue depth + # minus 128-entries for FL and HP + # queues, and 0xfff for LP which + # prompts the firmware to set it up + # in function of egress queues + # used + + reg[0x113c] = 0x0002ffc0 # SGE_VFIFO_SIZE, set to 0x2ffc0 which + # prompts the firmware to set it up in + # function of number of egress queues + # used + + # enable TP_OUT_CONFIG.IPIDSPLITMODE + reg[0x7d04] = 0x00010000/0x00010000 + + # disable TP_PARA_REG3.RxFragEn + reg[0x7d6c] = 0x00000000/0x00007000 + + # enable TP_PARA_REG6.EnableCSnd + reg[0x7d78] = 0x00000400/0x00000000 + + reg[0x7dc0] = 0x0e2f8849 # TP_SHIFT_CNT + + filterMode = fragmentation, mpshittype, protocol, vlan, port, fcoe + filterMask = port, protocol + + tp_pmrx = 20, 512 + tp_pmrx_pagesize = 16K + + # TP number of RX channels (0 = auto) + tp_nrxch = 0 + + tp_pmtx = 40, 512 + tp_pmtx_pagesize = 64K + + # TP number of TX channels (0 = auto) + tp_ntxch = 0 + + # TP OFLD MTUs + tp_mtus = 88, 256, 512, 576, 808, 1024, 1280, 1488, 1500, 2002, 2048, 4096, 4352, 8192, 9000, 9600 + + # TP_GLOBAL_CONFIG + reg[0x7d08] = 0x00000800/0x00000800 # set IssFromCplEnable + + # TP_PC_CONFIG + reg[0x7d48] = 0x00000000/0x00000400 # clear EnableFLMError + + # TP_PC_CONFIG2 + reg[0x7d4c] = 0x00010000/0x00010000 # set DisableNewPshFlag + + # TP_PARA_REG0 + reg[0x7d60] = 0x06000000/0x07000000 # set InitCWND to 6 + + # TP_PARA_REG3 + reg[0x7d6c] = 0x28000000/0x28000000 # set EnableTnlCngHdr + # set RxMacCheck (Note: + # Only for hash filter, + # no tcp offload) + + # TP_PIO_ADDR:TP_RX_LPBK + reg[tp_pio:0x28] = 0x00208208/0x00ffffff # set commit limits to 8 + + # MC configuration + mc_mode_brc[0] = 0 # mc0 - 1: enable BRC, 0: enable RBC + mc_mode_brc[1] = 0 # mc1 - 1: enable BRC, 0: enable RBC + + # ULP_TX_CONFIG + reg[0x8dc0] = 0x00000004/0x00000004 # Enable more error msg for ... + # TPT error. + +# PFs 0-3. These get 8 MSI/8 MSI-X vectors each. VFs are supported by +# these 4 PFs only. +[function "0"] + nvf = 4 + wx_caps = all + r_caps = all + nvi = 2 + rssnvi = 2 + niqflint = 4 + nethctrl = 4 + neq = 8 + nexactf = 4 + cmask = all + pmask = 0x1 + +[function "1"] + nvf = 4 + wx_caps = all + r_caps = all + nvi = 2 + rssnvi = 2 + niqflint = 4 + nethctrl = 4 + neq = 8 + nexactf = 4 + cmask = all + pmask = 0x2 + +[function "2"] + nvf = 4 + wx_caps = all + r_caps = all + nvi = 2 + rssnvi = 2 + niqflint = 4 + nethctrl = 4 + neq = 8 + nexactf = 4 + cmask = all + pmask = 0x4 + +[function "3"] + nvf = 4 + wx_caps = all + r_caps = all + nvi = 2 + rssnvi = 2 + niqflint = 4 + nethctrl = 4 + neq = 8 + nexactf = 4 + cmask = all + pmask = 0x8 + +# PF4 is the resource-rich PF that the bus/nexus driver attaches to. +# It gets 32 MSI/128 MSI-X vectors. +[function "4"] + wx_caps = all + r_caps = all + nvi = 32 + rssnvi = 8 + niqflint = 512 + nethctrl = 1024 + neq = 2048 + nqpcq = 8192 + nexactf = 456 + cmask = all + pmask = all + + # driver will mask off features it won't use + protocol = nic_hashfilter + + tp_l2t = 4096 + + # TCAM has 8K cells; each region must start at a multiple of 128 cell. + # Each entry in these categories takes 4 cells each. nhash will use the + # TCAM iff there is room left (that is, the rest don't add up to 2048). + nroute = 32 + nclip = 32 + nfilter = 1008 + nserver = 512 + nhash = 524288 + +# PF5 is the SCSI Controller PF. It gets 32 MSI/40 MSI-X vectors. +# Not used right now. +[function "5"] + nvi = 1 + rssnvi = 0 + +# PF6 is the FCoE Controller PF. It gets 32 MSI/40 MSI-X vectors. +# Not used right now. +[function "6"] + nvi = 1 + rssnvi = 0 + +# The following function, 1023, is not an actual PCIE function but is used to +# configure and reserve firmware internal resources that come from the global +# resource pool. +[function "1023"] + wx_caps = all + r_caps = all + nvi = 4 + rssnvi = 0 + cmask = all + pmask = all + nexactf = 8 + nfilter = 16 + +# For Virtual functions, we only allow NIC functionality and we only allow +# access to one port (1 << PF). Note that because of limitations in the +# Scatter Gather Engine (SGE) hardware which checks writes to VF KDOORBELL +# and GTS registers, the number of Ingress and Egress Queues must be a power +# of 2. +# +[function "0/*"] + wx_caps = 0x82 + r_caps = 0x86 + nvi = 1 + rssnvi = 1 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 + cmask = all + pmask = 0x1 + +[function "1/*"] + wx_caps = 0x82 + r_caps = 0x86 + nvi = 1 + rssnvi = 1 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 + cmask = all + pmask = 0x2 + +[function "2/*"] + wx_caps = 0x82 + r_caps = 0x86 + nvi = 1 + rssnvi = 1 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 + cmask = all + pmask = 0x4 + +[function "3/*"] + wx_caps = 0x82 + r_caps = 0x86 + nvi = 1 + rssnvi = 1 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 + cmask = all + pmask = 0x8 + +# MPS has 192K buffer space for ingress packets from the wire as well as +# loopback path of the L2 switch. +[port "0"] + dcb = none + bg_mem = 25 + lpbk_mem = 25 + hwm = 30 + lwm = 15 + dwm = 30 + +[port "1"] + dcb = none + bg_mem = 25 + lpbk_mem = 25 + hwm = 30 + lwm = 15 + dwm = 30 + +[port "2"] + dcb = none + bg_mem = 25 + lpbk_mem = 25 + hwm = 30 + lwm = 15 + dwm = 30 + +[port "3"] + dcb = none + bg_mem = 25 + lpbk_mem = 25 + hwm = 30 + lwm = 15 + dwm = 30 + +[fini] + version = 0x1 + checksum = 0x380a0a4 +# +# $FreeBSD$ +# Copied: stable/11/sys/dev/cxgbe/firmware/t6fw_cfg_hashfilter.txt (from r333394, head/sys/dev/cxgbe/firmware/t6fw_cfg_hashfilter.txt) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/cxgbe/firmware/t6fw_cfg_hashfilter.txt Sun Apr 28 19:52:48 2019 (r346855, copy of r333394, head/sys/dev/cxgbe/firmware/t6fw_cfg_hashfilter.txt) @@ -0,0 +1,265 @@ +# Firmware configuration file. +# +# Global limits (some are hardware limits, others are due to the firmware). +# nvi = 128 virtual interfaces +# niqflint = 1023 ingress queues with freelists and/or interrupts +# nethctrl = 64K Ethernet or ctrl egress queues +# neq = 64K egress queues of all kinds, including freelists +# nexactf = 512 MPS TCAM entries, can oversubscribe. + +[global] + rss_glb_config_mode = basicvirtual + rss_glb_config_options = tnlmapen,hashtoeplitz,tnlalllkp + + # PL_TIMEOUT register + pl_timeout_value = 200 # the timeout value in units of us + + sge_timer_value = 1, 5, 10, 50, 100, 200 # SGE_TIMER_VALUE* in usecs + + reg[0x10c4] = 0x20000000/0x20000000 # GK_CONTROL, enable 5th thread + + reg[0x7dc0] = 0x0e2f8849 # TP_SHIFT_CNT + + #Tick granularities in kbps + tsch_ticks = 100000, 10000, 1000, 10 + + filterMode = fragmentation, mpshittype, protocol, vlan, port, fcoe + filterMask = port, protocol + + tp_pmrx = 20, 512 + tp_pmrx_pagesize = 16K + + # TP number of RX channels (0 = auto) + tp_nrxch = 0 + + tp_pmtx = 40, 512 + tp_pmtx_pagesize = 64K + + # TP number of TX channels (0 = auto) + tp_ntxch = 0 + + # TP OFLD MTUs + tp_mtus = 88, 256, 512, 576, 808, 1024, 1280, 1488, 1500, 2002, 2048, 4096, 4352, 8192, 9000, 9600 + + # enable TP_OUT_CONFIG.IPIDSPLITMODE and CRXPKTENC + reg[0x7d04] = 0x00010008/0x00010008 + + # TP_GLOBAL_CONFIG + reg[0x7d08] = 0x00000800/0x00000800 # set IssFromCplEnable + + # TP_PC_CONFIG + reg[0x7d48] = 0x00000000/0x00000400 # clear EnableFLMError + + # TP_PC_CONFIG2 + reg[0x7d4c] = 0x00010000/0x00010000 # set DisableNewPshFlag + + # TP_PARA_REG0 + reg[0x7d60] = 0x06000000/0x07000000 # set InitCWND to 6 + + # TP_PARA_REG3 + reg[0x7d6c] = 0x28000000/0x28000000 # set EnableTnlCngHdr + # set RxMacCheck (Note: + # Only for hash filter, + # no tcp offload) + + # LE_DB_CONFIG + reg[0x19c04] = 0x00000000/0x02040000 # LE IPv4 compression disabled + # EXTN_HASH_IPV4 Disable + + # LE_DB_RSP_CODE_0 + reg[0x19c74] = 0x00000004/0x0000000f # TCAM_ACTV_HIT = 4 + + # LE_DB_RSP_CODE_1 + reg[0x19c78] = 0x08000000/0x0e000000 # HASH_ACTV_HIT = 4 + + # LE_DB_HASH_CONFIG + reg[0x19c28] = 0x00800000/0x01f00000 # LE Hash bucket size 8, + + # MC configuration + mc_mode_brc[0] = 0 # mc0 - 1: enable BRC, 0: enable RBC + +# PFs 0-3. These get 8 MSI/8 MSI-X vectors each. VFs are supported by +# these 4 PFs only. +[function "0"] + nvf = 4 + wx_caps = all + r_caps = all + nvi = 2 + rssnvi = 2 + niqflint = 4 + nethctrl = 4 + neq = 8 + nexactf = 4 + cmask = all + pmask = 0x1 + +[function "1"] + nvf = 4 + wx_caps = all + r_caps = all + nvi = 2 + rssnvi = 2 + niqflint = 4 + nethctrl = 4 + neq = 8 + nexactf = 4 + cmask = all + pmask = 0x2 + +[function "2"] + nvf = 4 + wx_caps = all + r_caps = all + nvi = 2 + rssnvi = 2 + niqflint = 4 + nethctrl = 4 + neq = 8 + nexactf = 4 + cmask = all + pmask = 0x4 + +[function "3"] + nvf = 4 + wx_caps = all + r_caps = all + nvi = 2 + rssnvi = 2 + niqflint = 4 + nethctrl = 4 + neq = 8 + nexactf = 4 + cmask = all + pmask = 0x8 + +# PF4 is the resource-rich PF that the bus/nexus driver attaches to. +# It gets 32 MSI/128 MSI-X vectors. +[function "4"] + wx_caps = all + r_caps = all + nvi = 32 + rssnvi = 8 + niqflint = 512 + nethctrl = 1024 + neq = 2048 + nqpcq = 8192 + nexactf = 456 + cmask = all + pmask = all + nclip = 320 + + # TCAM has 6K cells; each region must start at a multiple of 128 cell. + # Each entry in these categories takes 2 cells each. nhash will use the + # TCAM iff there is room left (that is, the rest don't add up to 3072). + nfilter = 2032 + nserver = 512 + nhpfilter = 0 + nhash = 524288 + protocol = nic_hashfilter + tp_l2t = 4096 + +# PF5 is the SCSI Controller PF. It gets 32 MSI/40 MSI-X vectors. +# Not used right now. +[function "5"] + nvi = 1 + rssnvi = 0 + +# PF6 is the FCoE Controller PF. It gets 32 MSI/40 MSI-X vectors. +# Not used right now. +[function "6"] + nvi = 1 + rssnvi = 0 + +# The following function, 1023, is not an actual PCIE function but is used to +# configure and reserve firmware internal resources that come from the global +# resource pool. +# +[function "1023"] + wx_caps = all + r_caps = all + nvi = 4 + rssnvi = 0 + cmask = all + pmask = all + nexactf = 8 + nfilter = 16 + + +# For Virtual functions, we only allow NIC functionality and we only allow +# access to one port (1 << PF). Note that because of limitations in the +# Scatter Gather Engine (SGE) hardware which checks writes to VF KDOORBELL +# and GTS registers, the number of Ingress and Egress Queues must be a power +# of 2. +# +[function "0/*"] + wx_caps = 0x82 + r_caps = 0x86 + nvi = 1 + rssnvi = 1 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 + cmask = all + pmask = 0x1 + +[function "1/*"] + wx_caps = 0x82 + r_caps = 0x86 + nvi = 1 + rssnvi = 1 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 + cmask = all + pmask = 0x2 + +[function "2/*"] + wx_caps = 0x82 + r_caps = 0x86 + nvi = 1 + rssnvi = 1 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 + cmask = all + pmask = 0x1 + +[function "3/*"] + wx_caps = 0x82 + r_caps = 0x86 + nvi = 1 + rssnvi = 1 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 + cmask = all + pmask = 0x2 + +# MPS has 192K buffer space for ingress packets from the wire as well as +# loopback path of the L2 switch. +[port "0"] + dcb = none + #bg_mem = 25 + #lpbk_mem = 25 + hwm = 60 + lwm = 15 + dwm = 30 + +[port "1"] + dcb = none + #bg_mem = 25 + #lpbk_mem = 25 + hwm = 60 + lwm = 15 + dwm = 30 + +[fini] + version = 0x1 + checksum = 0xb577311e +# +# $FreeBSD$ +# Modified: stable/11/sys/dev/cxgbe/offload.h ============================================================================== --- stable/11/sys/dev/cxgbe/offload.h Sun Apr 28 19:07:31 2019 (r346854) +++ stable/11/sys/dev/cxgbe/offload.h Sun Apr 28 19:52:48 2019 (r346855) @@ -30,6 +30,9 @@ #ifndef __T4_OFFLOAD_H__ #define __T4_OFFLOAD_H__ +#include +#include +#include #define INIT_ULPTX_WRH(w, wrlen, atomic, tid) do { \ (w)->wr_hi = htonl(V_FW_WR_OP(FW_ULPTX_WR) | V_FW_WR_ATOMIC(atomic)); \ @@ -98,10 +101,16 @@ struct tid_info { u_int atids_in_use; struct mtx ftid_lock __aligned(CACHE_LINE_SIZE); + struct cv ftid_cv; struct filter_entry *ftid_tab; u_int nftids; u_int ftid_base; u_int ftids_in_use; + + struct mtx hftid_lock __aligned(CACHE_LINE_SIZE); + struct cv hftid_cv; + void **hftid_tab; + /* ntids, tids_in_use */ struct mtx etid_lock __aligned(CACHE_LINE_SIZE); struct etid_entry *etid_tab; Copied and modified: stable/11/sys/dev/cxgbe/t4_filter.c (from r333153, head/sys/dev/cxgbe/t4_filter.c) ============================================================================== --- head/sys/dev/cxgbe/t4_filter.c Tue May 1 20:17:22 2018 (r333153, copy source) +++ stable/11/sys/dev/cxgbe/t4_filter.c Sun Apr 28 19:52:48 2019 (r346855) @@ -47,60 +47,93 @@ __FBSDID("$FreeBSD$"); #include "common/common.h" #include "common/t4_msg.h" #include "common/t4_regs.h" +#include "common/t4_regs_values.h" +#include "common/t4_tcb.h" #include "t4_l2t.h" +#include "t4_smt.h" struct filter_entry { - uint32_t valid:1; /* filter allocated and valid */ - uint32_t locked:1; /* filter is administratively locked */ - uint32_t pending:1; /* filter action is pending firmware reply */ - uint32_t smtidx:8; /* Source MAC Table index for smac */ - struct l2t_entry *l2t; /* Layer Two Table entry for dmac */ + uint32_t valid:1; /* filter allocated and valid */ + uint32_t locked:1; /* filter is administratively locked or busy */ + uint32_t pending:1; /* filter action is pending firmware reply */ + int tid; /* tid of the filter TCB */ + struct l2t_entry *l2te; /* L2 table entry for DMAC rewrite */ + struct smt_entry *smt; /* SMT entry for SMAC rewrite */ - struct t4_filter_specification fs; + struct t4_filter_specification fs; }; -static uint32_t -fconf_iconf_to_mode(uint32_t fconf, uint32_t iconf) +static void free_filter_resources(struct filter_entry *); +static int get_hashfilter(struct adapter *, struct t4_filter *); +static int set_hashfilter(struct adapter *, struct t4_filter *, uint64_t, + struct l2t_entry *, struct smt_entry *); +static int del_hashfilter(struct adapter *, struct t4_filter *); +static int configure_hashfilter_tcb(struct adapter *, struct filter_entry *); + +static int +alloc_hftid_tab(struct tid_info *t, int flags) { - uint32_t mode; - mode = T4_FILTER_IPv4 | T4_FILTER_IPv6 | T4_FILTER_IP_SADDR | - T4_FILTER_IP_DADDR | T4_FILTER_IP_SPORT | T4_FILTER_IP_DPORT; + MPASS(t->ntids > 0); + MPASS(t->hftid_tab == NULL); - if (fconf & F_FRAGMENTATION) - mode |= T4_FILTER_IP_FRAGMENT; + t->hftid_tab = malloc(sizeof(*t->hftid_tab) * t->ntids, M_CXGBE, + M_ZERO | flags); + if (t->hftid_tab == NULL) + return (ENOMEM); + mtx_init(&t->hftid_lock, "T4 hashfilters", 0, MTX_DEF); + cv_init(&t->hftid_cv, "t4hfcv"); - if (fconf & F_MPSHITTYPE) - mode |= T4_FILTER_MPS_HIT_TYPE; + return (0); +} - if (fconf & F_MACMATCH) - mode |= T4_FILTER_MAC_IDX; +void +free_hftid_tab(struct tid_info *t) +{ + int i; - if (fconf & F_ETHERTYPE) - mode |= T4_FILTER_ETH_TYPE; + if (t->hftid_tab != NULL) { + MPASS(t->ntids > 0); + for (i = 0; t->tids_in_use > 0 && i < t->ntids; i++) { + if (t->hftid_tab[i] == NULL) + continue; + free(t->hftid_tab[i], M_CXGBE); + t->tids_in_use--; + } + free(t->hftid_tab, M_CXGBE); + t->hftid_tab = NULL; + } - if (fconf & F_PROTOCOL) - mode |= T4_FILTER_IP_PROTO; + if (mtx_initialized(&t->hftid_lock)) { + mtx_destroy(&t->hftid_lock); + cv_destroy(&t->hftid_cv); + } +} - if (fconf & F_TOS) - mode |= T4_FILTER_IP_TOS; +static void +insert_hftid(struct adapter *sc, int tid, void *ctx, int ntids) +{ + struct tid_info *t = &sc->tids; - if (fconf & F_VLAN) - mode |= T4_FILTER_VLAN; + t->hftid_tab[tid] = ctx; + atomic_add_int(&t->tids_in_use, ntids); +} - if (fconf & F_VNIC_ID) { - mode |= T4_FILTER_VNIC; - if (iconf & F_VNIC) - mode |= T4_FILTER_IC_VNIC; - } +static void * +lookup_hftid(struct adapter *sc, int tid) +{ + struct tid_info *t = &sc->tids; - if (fconf & F_PORT) - mode |= T4_FILTER_PORT; + return (t->hftid_tab[tid]); +} - if (fconf & F_FCOE) - mode |= T4_FILTER_FCoE; +static void +remove_hftid(struct adapter *sc, int tid, int ntids) +{ + struct tid_info *t = &sc->tids; - return (mode); + t->hftid_tab[tid] = NULL; + atomic_subtract_int(&t->tids_in_use, ntids); } static uint32_t @@ -150,7 +183,8 @@ mode_to_iconf(uint32_t mode) return (0); } -static int check_fspec_against_fconf_iconf(struct adapter *sc, +static int +check_fspec_against_fconf_iconf(struct adapter *sc, struct t4_filter_specification *fs) { struct tp_params *tpp = &sc->params.tp; @@ -204,15 +238,38 @@ static int check_fspec_against_fconf_iconf(struct adap int get_filter_mode(struct adapter *sc, uint32_t *mode) { - struct tp_params *tpp = &sc->params.tp; + struct tp_params *tp = &sc->params.tp; + uint64_t mask; - /* - * We trust the cached values of the relevant TP registers. This means - * things work reliably only if writes to those registers are always via - * t4_set_filter_mode_. - */ - *mode = fconf_iconf_to_mode(tpp->vlan_pri_map, tpp->ingress_config); + /* Non-zero incoming value in mode means "hashfilter mode". */ + mask = *mode ? tp->hash_filter_mask : UINT64_MAX; + /* Always */ + *mode = T4_FILTER_IPv4 | T4_FILTER_IPv6 | T4_FILTER_IP_SADDR | + T4_FILTER_IP_DADDR | T4_FILTER_IP_SPORT | T4_FILTER_IP_DPORT; + +#define CHECK_FIELD(fconf_bit, field_shift, field_mask, mode_bit) do { \ + if (tp->vlan_pri_map & (fconf_bit)) { \ + MPASS(tp->field_shift >= 0); \ + if ((mask >> tp->field_shift & field_mask) == field_mask) \ + *mode |= (mode_bit); \ + } \ +} while (0) + + CHECK_FIELD(F_FRAGMENTATION, frag_shift, M_FT_FRAGMENTATION, T4_FILTER_IP_FRAGMENT); + CHECK_FIELD(F_MPSHITTYPE, matchtype_shift, M_FT_MPSHITTYPE, T4_FILTER_MPS_HIT_TYPE); + CHECK_FIELD(F_MACMATCH, macmatch_shift, M_FT_MACMATCH, T4_FILTER_MAC_IDX); + CHECK_FIELD(F_ETHERTYPE, ethertype_shift, M_FT_ETHERTYPE, T4_FILTER_ETH_TYPE); + CHECK_FIELD(F_PROTOCOL, protocol_shift, M_FT_PROTOCOL, T4_FILTER_IP_PROTO); + CHECK_FIELD(F_TOS, tos_shift, M_FT_TOS, T4_FILTER_IP_TOS); + CHECK_FIELD(F_VLAN, vlan_shift, M_FT_VLAN, T4_FILTER_VLAN); + CHECK_FIELD(F_VNIC_ID, vnic_shift, M_FT_VNIC_ID , T4_FILTER_VNIC); + if (tp->ingress_config & F_VNIC) + *mode |= T4_FILTER_IC_VNIC; + CHECK_FIELD(F_PORT, port_shift, M_FT_PORT , T4_FILTER_PORT); + CHECK_FIELD(F_FCOE, fcoe_shift, M_FT_FCOE , T4_FILTER_FCoE); +#undef CHECK_FIELD + return (0); } @@ -230,6 +287,10 @@ set_filter_mode(struct adapter *sc, uint32_t mode) * already set to the correct value for the requested filter * mode. It's not clear if it's safe to write to this register * on the fly. (And we trust the cached value of the register). *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Apr 28 22:38:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F921158C1CF; Sun, 28 Apr 2019 22:38:00 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D649980701; Sun, 28 Apr 2019 22:37:59 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA17C1926C; Sun, 28 Apr 2019 22:37:59 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SMbx85014197; Sun, 28 Apr 2019 22:37:59 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SMbxIE014196; Sun, 28 Apr 2019 22:37:59 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201904282237.x3SMbxIE014196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 28 Apr 2019 22:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346856 - head/usr.sbin/nfsdumpstate X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/nfsdumpstate X-SVN-Commit-Revision: 346856 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D649980701 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 22:38:00 -0000 Author: rmacklem Date: Sun Apr 28 22:37:59 2019 New Revision: 346856 URL: https://svnweb.freebsd.org/changeset/base/346856 Log: Add #ifdef INET6 around declaration of nbuf. It was reported that without #ifdef INET6 around the declaration of "nbuf", a build would report an unused variable. For some reason, I didn't see that warning when I did a build, but it seems reasonable to add these #ifdef INET6's. Submitted by: dmitryluhtionov@gmail.com MFC after: 1 week Modified: head/usr.sbin/nfsdumpstate/nfsdumpstate.c Modified: head/usr.sbin/nfsdumpstate/nfsdumpstate.c ============================================================================== --- head/usr.sbin/nfsdumpstate/nfsdumpstate.c Sun Apr 28 19:52:48 2019 (r346855) +++ head/usr.sbin/nfsdumpstate/nfsdumpstate.c Sun Apr 28 22:37:59 2019 (r346856) @@ -121,7 +121,9 @@ dump_openstate(void) { struct nfsd_dumplist dumplist; int cnt, i; +#ifdef INET6 char nbuf[INET6_ADDRSTRLEN]; +#endif dumplist.ndl_size = DUMPSIZE; dumplist.ndl_list = (void *)dp; @@ -176,7 +178,9 @@ dump_lockstate(char *fname) { struct nfsd_dumplocklist dumplocklist; int cnt, i; +#ifdef INET6 char nbuf[INET6_ADDRSTRLEN]; +#endif dumplocklist.ndllck_size = DUMPSIZE; dumplocklist.ndllck_list = (void *)lp; From owner-svn-src-all@freebsd.org Mon Apr 29 00:08:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D935C158E397; Mon, 29 Apr 2019 00:08:31 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C7CD833CC; Mon, 29 Apr 2019 00:08:31 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50F821A195; Mon, 29 Apr 2019 00:08:31 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T08V9d061161; Mon, 29 Apr 2019 00:08:31 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T08VmJ061160; Mon, 29 Apr 2019 00:08:31 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904290008.x3T08VmJ061160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 00:08:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346859 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346859 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7C7CD833CC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.934,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 00:08:32 -0000 Author: np Date: Mon Apr 29 00:08:30 2019 New Revision: 346859 URL: https://svnweb.freebsd.org/changeset/base/346859 Log: MFC r333141 (by gallatin@): Optionally panic when cxgbe encounters a fatal error Sometimes it is better to panic than to leave a machine unreachable. Reviewed by: np Sponsored by: Netflix Modified: stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Sun Apr 28 23:46:01 2019 (r346858) +++ stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 00:08:30 2019 (r346859) @@ -544,6 +544,8 @@ SYSCTL_INT(_hw_cxgbe, OID_AUTO, pcie_relaxed_ordering, &pcie_relaxed_ordering, 0, "PCIe Relaxed Ordering: 0 = disable, 1 = enable, 2 = leave alone"); +static int t4_panic_on_fatal_err = 0; +TUNABLE_INT("hw.cxgbe.panic_on_fatal_err", &t4_panic_on_fatal_err); #ifdef TCP_OFFLOAD /* @@ -2509,6 +2511,8 @@ t4_fatal_err(struct adapter *sc) t4_intr_disable(sc); log(LOG_EMERG, "%s: encountered fatal error, adapter stopped.\n", device_get_nameunit(sc->dev)); + if (t4_panic_on_fatal_err) + panic("panic requested on fatal error"); } void From owner-svn-src-all@freebsd.org Mon Apr 29 00:16:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42983158E756; Mon, 29 Apr 2019 00:16:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6B7683810; Mon, 29 Apr 2019 00:16:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2DF01A33A; Mon, 29 Apr 2019 00:16:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T0GKR5066504; Mon, 29 Apr 2019 00:16:20 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T0GKfO066503; Mon, 29 Apr 2019 00:16:20 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904290016.x3T0GKfO066503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 00:16:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346860 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346860 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D6B7683810 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.934,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 00:16:21 -0000 Author: np Date: Mon Apr 29 00:16:20 2019 New Revision: 346860 URL: https://svnweb.freebsd.org/changeset/base/346860 Log: MFC r334132: cxgbe(4): Make sure that the egress queue's cidx is updated periodically when the driver is writing WRs using start_wrq_wr/commit_wrq_wr all the time. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 00:08:30 2019 (r346859) +++ stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 00:16:20 2019 (r346860) @@ -2358,9 +2358,29 @@ commit_wrq_wr(struct sge_wrq *wrq, void *w, struct wrq next = TAILQ_NEXT(cookie, link); if (prev == NULL) { MPASS(pidx == eq->dbidx); - if (next == NULL || ndesc >= 16) + if (next == NULL || ndesc >= 16) { + int available; + struct fw_eth_tx_pkt_wr *dst; /* any fw WR struct will do */ + + /* + * Note that the WR via which we'll request tx updates + * is at pidx and not eq->pidx, which has moved on + * already. + */ + dst = (void *)&eq->desc[pidx]; + available = IDXDIFF(eq->cidx, eq->pidx, eq->sidx) - 1; + if (available < eq->sidx / 4 && + atomic_cmpset_int(&eq->equiq, 0, 1)) { + dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUIQ | + F_FW_WR_EQUEQ); + eq->equeqidx = pidx; + } else if (IDXDIFF(eq->pidx, eq->equeqidx, eq->sidx) >= 32) { + dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUEQ); + eq->equeqidx = pidx; + } + ring_eq_db(wrq->adapter, eq, ndesc); - else { + } else { MPASS(IDXDIFF(next->pidx, pidx, eq->sidx) == ndesc); next->pidx = pidx; next->ndesc += ndesc; From owner-svn-src-all@freebsd.org Mon Apr 29 00:22:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD5A6158E944; Mon, 29 Apr 2019 00:22:35 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7039583C22; Mon, 29 Apr 2019 00:22:35 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 488B11A4F0; Mon, 29 Apr 2019 00:22:35 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T0MZYK071446; Mon, 29 Apr 2019 00:22:35 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T0MZUc071445; Mon, 29 Apr 2019 00:22:35 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904290022.x3T0MZUc071445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 00:22:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346861 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346861 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7039583C22 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.934,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 00:22:36 -0000 Author: np Date: Mon Apr 29 00:22:34 2019 New Revision: 346861 URL: https://svnweb.freebsd.org/changeset/base/346861 Log: MFC r334136: cxgbe(4): Slightly simpler needs_ functions. Modified: stable/11/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 00:16:20 2019 (r346860) +++ stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 00:22:34 2019 (r346861) @@ -2053,14 +2053,7 @@ needs_tso(struct mbuf *m) M_ASSERTPKTHDR(m); - if (m->m_pkthdr.csum_flags & CSUM_TSO) { - KASSERT(m->m_pkthdr.tso_segsz > 0, - ("%s: TSO requested in mbuf %p but MSS not provided", - __func__, m)); - return (1); - } - - return (0); + return (m->m_pkthdr.csum_flags & CSUM_TSO); } static inline int @@ -2069,9 +2062,7 @@ needs_l3_csum(struct mbuf *m) M_ASSERTPKTHDR(m); - if (m->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TSO)) - return (1); - return (0); + return (m->m_pkthdr.csum_flags & (CSUM_IP | CSUM_TSO)); } static inline int @@ -2080,10 +2071,8 @@ needs_l4_csum(struct mbuf *m) M_ASSERTPKTHDR(m); - if (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP | CSUM_UDP_IPV6 | - CSUM_TCP_IPV6 | CSUM_TSO)) - return (1); - return (0); + return (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP | CSUM_UDP_IPV6 | + CSUM_TCP_IPV6 | CSUM_TSO)); } static inline int @@ -2092,13 +2081,7 @@ needs_vlan_insertion(struct mbuf *m) M_ASSERTPKTHDR(m); - if (m->m_flags & M_VLANTAG) { - KASSERT(m->m_pkthdr.ether_vtag != 0, - ("%s: HWVLAN requested in mbuf %p but tag not provided", - __func__, m)); - return (1); - } - return (0); + return (m->m_flags & M_VLANTAG); } static void * From owner-svn-src-all@freebsd.org Mon Apr 29 00:31:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67E20158EB57; Mon, 29 Apr 2019 00:31:59 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B7DE83FF6; Mon, 29 Apr 2019 00:31:59 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9C711A667; Mon, 29 Apr 2019 00:31:58 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T0Vw5p075340; Mon, 29 Apr 2019 00:31:58 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T0VwUu075018; Mon, 29 Apr 2019 00:31:58 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904290031.x3T0VwUu075018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 00:31:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346862 - in stable/11/sys/dev/cxgbe: . common X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 346862 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B7DE83FF6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.934,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 00:31:59 -0000 Author: np Date: Mon Apr 29 00:31:58 2019 New Revision: 346862 URL: https://svnweb.freebsd.org/changeset/base/346862 Log: MFC r334137: cxgbe(4): Fix range checks in is_etid. Modified: stable/11/sys/dev/cxgbe/common/common.h stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/11/sys/dev/cxgbe/common/common.h Mon Apr 29 00:22:34 2019 (r346861) +++ stable/11/sys/dev/cxgbe/common/common.h Mon Apr 29 00:31:58 2019 (r346862) @@ -357,7 +357,7 @@ struct adapter_params { u_int ftid_min; u_int ftid_max; u_int etid_min; - u_int netids; + u_int etid_max; unsigned int cim_la_size; @@ -449,7 +449,8 @@ static inline int is_ftid(const struct adapter *sc, u_ static inline int is_etid(const struct adapter *sc, u_int tid) { - return (tid >= sc->params.etid_min); + return (sc->params.etid_min > 0 && tid >= sc->params.etid_min && + tid <= sc->params.etid_max); } static inline int is_offload(const struct adapter *adap) Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 00:22:34 2019 (r346861) +++ stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 00:31:58 2019 (r346862) @@ -4016,8 +4016,8 @@ get_params__post_init(struct adapter *sc) } sc->tids.etid_base = val[0]; sc->params.etid_min = val[0]; + sc->params.etid_max = val[1]; sc->tids.netids = val[1] - val[0] + 1; - sc->params.netids = sc->tids.netids; sc->params.eo_wr_cred = val[2]; sc->params.ethoffload = 1; } From owner-svn-src-all@freebsd.org Mon Apr 29 00:40:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F226E158EC46; Mon, 29 Apr 2019 00:40:03 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96993841DA; Mon, 29 Apr 2019 00:40:03 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D9BA1A6AC; Mon, 29 Apr 2019 00:40:03 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T0e3wD076842; Mon, 29 Apr 2019 00:40:03 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T0e2Nd076838; Mon, 29 Apr 2019 00:40:02 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904290040.x3T0e2Nd076838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 00:40:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346863 - in stable/11/sys/dev/cxgbe: . common tom X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys/dev/cxgbe: . common tom X-SVN-Commit-Revision: 346863 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 96993841DA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.937,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 00:40:04 -0000 Author: np Date: Mon Apr 29 00:40:02 2019 New Revision: 346863 URL: https://svnweb.freebsd.org/changeset/base/346863 Log: MFC r334138: r334138: cxgbe(4): Make FW4_ACK a shared CPL. Modified: stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/common/t4_msg.h stable/11/sys/dev/cxgbe/t4_sge.c stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 00:31:58 2019 (r346862) +++ stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 00:40:02 2019 (r346863) @@ -373,7 +373,7 @@ enum { CPL_COOKIE_DDP1, CPL_COOKIE_TOM, CPL_COOKIE_HASHFILTER, - CPL_COOKIE_AVAILABLE2, + CPL_COOKIE_ETHOFLD, CPL_COOKIE_AVAILABLE3, NUM_CPL_COOKIES = 8 /* Limited by M_COOKIE. Do not increase. */ Modified: stable/11/sys/dev/cxgbe/common/t4_msg.h ============================================================================== --- stable/11/sys/dev/cxgbe/common/t4_msg.h Mon Apr 29 00:31:58 2019 (r346862) +++ stable/11/sys/dev/cxgbe/common/t4_msg.h Mon Apr 29 00:40:02 2019 (r346863) @@ -2749,6 +2749,30 @@ enum { CPL_FW4_ACK_FLAGS_FLOWC = 0x4, /* fw_flowc_wr complete */ }; +#define S_CPL_FW4_ACK_OPCODE 24 +#define M_CPL_FW4_ACK_OPCODE 0xff +#define V_CPL_FW4_ACK_OPCODE(x) ((x) << S_CPL_FW4_ACK_OPCODE) +#define G_CPL_FW4_ACK_OPCODE(x) \ + (((x) >> S_CPL_FW4_ACK_OPCODE) & M_CPL_FW4_ACK_OPCODE) + +#define S_CPL_FW4_ACK_FLOWID 0 +#define M_CPL_FW4_ACK_FLOWID 0xffffff +#define V_CPL_FW4_ACK_FLOWID(x) ((x) << S_CPL_FW4_ACK_FLOWID) +#define G_CPL_FW4_ACK_FLOWID(x) \ + (((x) >> S_CPL_FW4_ACK_FLOWID) & M_CPL_FW4_ACK_FLOWID) + +#define S_CPL_FW4_ACK_CR 24 +#define M_CPL_FW4_ACK_CR 0xff +#define V_CPL_FW4_ACK_CR(x) ((x) << S_CPL_FW4_ACK_CR) +#define G_CPL_FW4_ACK_CR(x) (((x) >> S_CPL_FW4_ACK_CR) & M_CPL_FW4_ACK_CR) + +#define S_CPL_FW4_ACK_SEQVAL 0 +#define M_CPL_FW4_ACK_SEQVAL 0x1 +#define V_CPL_FW4_ACK_SEQVAL(x) ((x) << S_CPL_FW4_ACK_SEQVAL) +#define G_CPL_FW4_ACK_SEQVAL(x) \ + (((x) >> S_CPL_FW4_ACK_SEQVAL) & M_CPL_FW4_ACK_SEQVAL) +#define F_CPL_FW4_ACK_SEQVAL V_CPL_FW4_ACK_SEQVAL(1U) + struct cpl_fw6_msg { RSS_HDR u8 opcode; Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 00:31:58 2019 (r346862) +++ stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 00:40:02 2019 (r346863) @@ -300,6 +300,7 @@ cpl_handler_t set_tcb_rpl_handlers[NUM_CPL_COOKIES]; cpl_handler_t l2t_write_rpl_handlers[NUM_CPL_COOKIES]; cpl_handler_t act_open_rpl_handlers[NUM_CPL_COOKIES]; cpl_handler_t abort_rpl_rss_handlers[NUM_CPL_COOKIES]; +cpl_handler_t fw4_ack_handlers[NUM_CPL_COOKIES]; void t4_register_an_handler(an_handler_t h) @@ -412,6 +413,23 @@ abort_rpl_rss_handler(struct sge_iq *iq, const struct return (abort_rpl_rss_handlers[cookie](iq, rss, m)); } +static int +fw4_ack_handler(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) +{ + struct adapter *sc = iq->adapter; + const struct cpl_fw4_ack *cpl = (const void *)(rss + 1); + unsigned int tid = G_CPL_FW4_ACK_FLOWID(be32toh(OPCODE_TID(cpl))); + u_int cookie; + + MPASS(m == NULL); + if (is_etid(sc, tid)) + cookie = CPL_COOKIE_ETHOFLD; + else + cookie = CPL_COOKIE_TOM; + + return (fw4_ack_handlers[cookie](iq, rss, m)); +} + static void t4_init_shared_cpl_handlers(void) { @@ -420,6 +438,7 @@ t4_init_shared_cpl_handlers(void) t4_register_cpl_handler(CPL_L2T_WRITE_RPL, l2t_write_rpl_handler); t4_register_cpl_handler(CPL_ACT_OPEN_RPL, act_open_rpl_handler); t4_register_cpl_handler(CPL_ABORT_RPL_RSS, abort_rpl_rss_handler); + t4_register_cpl_handler(CPL_FW4_ACK, fw4_ack_handler); } void @@ -444,6 +463,9 @@ t4_register_shared_cpl_handler(int opcode, cpl_handler break; case CPL_ABORT_RPL_RSS: loc = (uintptr_t *)&abort_rpl_rss_handlers[cookie]; + break; + case CPL_FW4_ACK: + loc = (uintptr_t *)&fw4_ack_handlers[cookie]; break; default: MPASS(0); Modified: stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Apr 29 00:31:58 2019 (r346862) +++ stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Apr 29 00:40:02 2019 (r346863) @@ -1735,30 +1735,6 @@ do_rx_data(struct sge_iq *iq, const struct rss_header return (0); } -#define S_CPL_FW4_ACK_OPCODE 24 -#define M_CPL_FW4_ACK_OPCODE 0xff -#define V_CPL_FW4_ACK_OPCODE(x) ((x) << S_CPL_FW4_ACK_OPCODE) -#define G_CPL_FW4_ACK_OPCODE(x) \ - (((x) >> S_CPL_FW4_ACK_OPCODE) & M_CPL_FW4_ACK_OPCODE) - -#define S_CPL_FW4_ACK_FLOWID 0 -#define M_CPL_FW4_ACK_FLOWID 0xffffff -#define V_CPL_FW4_ACK_FLOWID(x) ((x) << S_CPL_FW4_ACK_FLOWID) -#define G_CPL_FW4_ACK_FLOWID(x) \ - (((x) >> S_CPL_FW4_ACK_FLOWID) & M_CPL_FW4_ACK_FLOWID) - -#define S_CPL_FW4_ACK_CR 24 -#define M_CPL_FW4_ACK_CR 0xff -#define V_CPL_FW4_ACK_CR(x) ((x) << S_CPL_FW4_ACK_CR) -#define G_CPL_FW4_ACK_CR(x) (((x) >> S_CPL_FW4_ACK_CR) & M_CPL_FW4_ACK_CR) - -#define S_CPL_FW4_ACK_SEQVAL 0 -#define M_CPL_FW4_ACK_SEQVAL 0x1 -#define V_CPL_FW4_ACK_SEQVAL(x) ((x) << S_CPL_FW4_ACK_SEQVAL) -#define G_CPL_FW4_ACK_SEQVAL(x) \ - (((x) >> S_CPL_FW4_ACK_SEQVAL) & M_CPL_FW4_ACK_SEQVAL) -#define F_CPL_FW4_ACK_SEQVAL V_CPL_FW4_ACK_SEQVAL(1U) - static int do_fw4_ack(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) { @@ -1966,7 +1942,7 @@ t4_init_cpl_io_handlers(void) t4_register_shared_cpl_handler(CPL_ABORT_RPL_RSS, do_abort_rpl, CPL_COOKIE_TOM); t4_register_cpl_handler(CPL_RX_DATA, do_rx_data); - t4_register_cpl_handler(CPL_FW4_ACK, do_fw4_ack); + t4_register_shared_cpl_handler(CPL_FW4_ACK, do_fw4_ack, CPL_COOKIE_TOM); } void @@ -1978,7 +1954,7 @@ t4_uninit_cpl_io_handlers(void) t4_register_cpl_handler(CPL_ABORT_REQ_RSS, NULL); t4_register_cpl_handler(CPL_ABORT_RPL_RSS, NULL); t4_register_cpl_handler(CPL_RX_DATA, NULL); - t4_register_cpl_handler(CPL_FW4_ACK, NULL); + t4_register_shared_cpl_handler(CPL_FW4_ACK, NULL, CPL_COOKIE_TOM); } /* From owner-svn-src-all@freebsd.org Mon Apr 29 00:57:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 698FC158F0FA; Mon, 29 Apr 2019 00:57:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07D91848E0; Mon, 29 Apr 2019 00:57:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D28841A9ED; Mon, 29 Apr 2019 00:57:47 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T0vlL3087480; Mon, 29 Apr 2019 00:57:47 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T0vlQ1087479; Mon, 29 Apr 2019 00:57:47 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904290057.x3T0vlQ1087479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 00:57:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346864 - stable/11/sys/dev/cxgbe/tom X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 346864 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 07D91848E0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 00:57:48 -0000 Author: np Date: Mon Apr 29 00:57:47 2019 New Revision: 346864 URL: https://svnweb.freebsd.org/changeset/base/346864 Log: MFC r334139: cxgbe/t4_tom: ABORT_RPL_RSS is a shared CPL and t4_tom shouldn't remove the global handler when it's being unloaded. Modified: stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Apr 29 00:40:02 2019 (r346863) +++ stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Apr 29 00:57:47 2019 (r346864) @@ -1952,7 +1952,7 @@ t4_uninit_cpl_io_handlers(void) t4_register_cpl_handler(CPL_PEER_CLOSE, NULL); t4_register_cpl_handler(CPL_CLOSE_CON_RPL, NULL); t4_register_cpl_handler(CPL_ABORT_REQ_RSS, NULL); - t4_register_cpl_handler(CPL_ABORT_RPL_RSS, NULL); + t4_register_shared_cpl_handler(CPL_ABORT_RPL_RSS, NULL, CPL_COOKIE_TOM); t4_register_cpl_handler(CPL_RX_DATA, NULL); t4_register_shared_cpl_handler(CPL_FW4_ACK, NULL, CPL_COOKIE_TOM); } From owner-svn-src-all@freebsd.org Mon Apr 29 01:10:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2341158F3B1; Mon, 29 Apr 2019 01:10:58 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7494784DB6; Mon, 29 Apr 2019 01:10:58 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F31F1AC01; Mon, 29 Apr 2019 01:10:58 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T1AwF0095578; Mon, 29 Apr 2019 01:10:58 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T1Aw2T095577; Mon, 29 Apr 2019 01:10:58 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201904290110.x3T1Aw2T095577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 29 Apr 2019 01:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346865 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 346865 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7494784DB6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 01:10:59 -0000 Author: jhibbits Date: Mon Apr 29 01:10:57 2019 New Revision: 346865 URL: https://svnweb.freebsd.org/changeset/base/346865 Log: powerpc: Make OPAL root node probe at bus pass This way its children can attach earlier if needed, and some subsystems are attached earlier, like the asynchronous token management. MFC after: 2 weeks Modified: head/sys/powerpc/powernv/opal_dev.c Modified: head/sys/powerpc/powernv/opal_dev.c ============================================================================== --- head/sys/powerpc/powernv/opal_dev.c Mon Apr 29 00:57:47 2019 (r346864) +++ head/sys/powerpc/powernv/opal_dev.c Mon Apr 29 01:10:57 2019 (r346865) @@ -95,7 +95,8 @@ static driver_t opaldev_driver = { static devclass_t opaldev_devclass; -DRIVER_MODULE(opaldev, ofwbus, opaldev_driver, opaldev_devclass, 0, 0); +EARLY_DRIVER_MODULE(opaldev, ofwbus, opaldev_driver, opaldev_devclass, 0, 0, + BUS_PASS_BUS); static void opal_heartbeat(void); static void opal_handle_messages(void); From owner-svn-src-all@freebsd.org Mon Apr 29 01:15:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CC8F158F72D; Mon, 29 Apr 2019 01:15:24 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2D4285253; Mon, 29 Apr 2019 01:15:23 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E8521AD7E; Mon, 29 Apr 2019 01:15:23 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T1FN6D097591; Mon, 29 Apr 2019 01:15:23 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T1FM6A097585; Mon, 29 Apr 2019 01:15:22 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904290115.x3T1FM6A097585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 01:15:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346866 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C2D4285253 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 01:15:24 -0000 Author: np Date: Mon Apr 29 01:15:22 2019 New Revision: 346866 URL: https://svnweb.freebsd.org/changeset/base/346866 Log: MFC r334467: cxgbe(4): Retire an old check. Modified: stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/t4_l2t.c stable/11/sys/dev/cxgbe/t4_l2t.h stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/cxgbe/t4_smt.c stable/11/sys/dev/cxgbe/t4_smt.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 01:10:57 2019 (r346865) +++ stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 01:15:22 2019 (r346866) @@ -80,11 +80,6 @@ prefetch(void *x) #define CTLTYPE_U64 CTLTYPE_QUAD #endif -#if (__FreeBSD_version >= 900030) || \ - ((__FreeBSD_version >= 802507) && (__FreeBSD_version < 900000)) -#define SBUF_DRAIN 1 -#endif - SYSCTL_DECL(_hw_cxgbe); struct adapter; Modified: stable/11/sys/dev/cxgbe/t4_l2t.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_l2t.c Mon Apr 29 01:10:57 2019 (r346865) +++ stable/11/sys/dev/cxgbe/t4_l2t.c Mon Apr 29 01:15:22 2019 (r346866) @@ -255,7 +255,6 @@ do_l2t_write_rpl(struct sge_iq *iq, const struct rss_h return (0); } -#ifdef SBUF_DRAIN static inline unsigned int vlan_prio(const struct l2t_entry *e) { @@ -333,4 +332,3 @@ skip: return (rc); } -#endif Modified: stable/11/sys/dev/cxgbe/t4_l2t.h ============================================================================== --- stable/11/sys/dev/cxgbe/t4_l2t.h Mon Apr 29 01:10:57 2019 (r346865) +++ stable/11/sys/dev/cxgbe/t4_l2t.h Mon Apr 29 01:15:22 2019 (r346866) @@ -104,9 +104,6 @@ t4_l2t_release(struct l2t_entry *e) atomic_add_int(&d->nfree, 1); } - -#ifdef SBUF_DRAIN int sysctl_l2t(SYSCTL_HANDLER_ARGS); -#endif #endif /* __T4_L2T_H */ Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 01:10:57 2019 (r346865) +++ stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 01:15:22 2019 (r346866) @@ -632,7 +632,6 @@ static int sysctl_fec(SYSCTL_HANDLER_ARGS); static int sysctl_autoneg(SYSCTL_HANDLER_ARGS); static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS); static int sysctl_temperature(SYSCTL_HANDLER_ARGS); -#ifdef SBUF_DRAIN static int sysctl_loadavg(SYSCTL_HANDLER_ARGS); static int sysctl_cctrl(SYSCTL_HANDLER_ARGS); static int sysctl_cim_ibq_obq(SYSCTL_HANDLER_ARGS); @@ -663,7 +662,6 @@ static int sysctl_tx_rate(SYSCTL_HANDLER_ARGS); static int sysctl_ulprx_la(SYSCTL_HANDLER_ARGS); static int sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS); static int sysctl_tc_params(SYSCTL_HANDLER_ARGS); -#endif #ifdef TCP_OFFLOAD static int sysctl_tls_rx_ports(SYSCTL_HANDLER_ARGS); static int sysctl_tp_tick(SYSCTL_HANDLER_ARGS); @@ -5730,7 +5728,6 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "core_vdd", CTLFLAG_RD, &sc->params.core_vdd, 0, "core Vdd (in mV)"); -#ifdef SBUF_DRAIN /* * dev.t4nex.X.misc. Marked CTLFLAG_SKIP to avoid information overload. */ @@ -5904,7 +5901,6 @@ t4_sysctls(struct adapter *sc) CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_wcwr_stats, "A", "write combined work requests"); } -#endif #ifdef TCP_OFFLOAD if (is_offload(sc)) { @@ -6188,11 +6184,9 @@ cxgbe_sysctls(struct port_info *pi) &tc->flags, 0, "flags"); SYSCTL_ADD_UINT(ctx, children2, OID_AUTO, "refcount", CTLFLAG_RD, &tc->refcount, 0, "references to this class"); -#ifdef SBUF_DRAIN SYSCTL_ADD_PROC(ctx, children2, OID_AUTO, "params", CTLTYPE_STRING | CTLFLAG_RD, sc, (pi->port_id << 16) | i, sysctl_tc_params, "A", "traffic class parameters"); -#endif } /* @@ -6813,7 +6807,6 @@ sysctl_temperature(SYSCTL_HANDLER_ARGS) return (rc); } -#ifdef SBUF_DRAIN static int sysctl_loadavg(SYSCTL_HANDLER_ARGS) { @@ -8861,7 +8854,6 @@ done: return (rc); } -#endif #ifdef TCP_OFFLOAD static int Modified: stable/11/sys/dev/cxgbe/t4_smt.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_smt.c Mon Apr 29 01:10:57 2019 (r346865) +++ stable/11/sys/dev/cxgbe/t4_smt.c Mon Apr 29 01:15:22 2019 (r346866) @@ -287,7 +287,6 @@ do_smt_write_rpl(struct sge_iq *iq, const struct rss_h return (0); } -#ifdef SBUF_DRAIN static char smt_state(const struct smt_entry *e) { @@ -343,4 +342,3 @@ skip: return (rc); } -#endif Modified: stable/11/sys/dev/cxgbe/t4_smt.h ============================================================================== --- stable/11/sys/dev/cxgbe/t4_smt.h Mon Apr 29 01:10:57 2019 (r346865) +++ stable/11/sys/dev/cxgbe/t4_smt.h Mon Apr 29 01:15:22 2019 (r346866) @@ -84,9 +84,6 @@ t4_smt_release(struct smt_entry *e) } - -#ifdef SBUF_DRAIN int sysctl_smt(SYSCTL_HANDLER_ARGS); -#endif #endif /* __T4_SMT_H */ From owner-svn-src-all@freebsd.org Mon Apr 29 01:22:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0AAD158FB03; Mon, 29 Apr 2019 01:22:59 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76F41856FE; Mon, 29 Apr 2019 01:22:59 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E5421AF21; Mon, 29 Apr 2019 01:22:59 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T1Mx0J002908; Mon, 29 Apr 2019 01:22:59 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T1Mxv3002907; Mon, 29 Apr 2019 01:22:59 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904290122.x3T1Mxv3002907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 01:22:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346867 - stable/11/sys/dev/cxgbe/cxgbei X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe/cxgbei X-SVN-Commit-Revision: 346867 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 76F41856FE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 01:23:00 -0000 Author: np Date: Mon Apr 29 01:22:58 2019 New Revision: 346867 URL: https://svnweb.freebsd.org/changeset/base/346867 Log: MFC r335701: cxgbe/cxgbei: Fix harmful typo in the iSCSI offload driver. Reported by: gcc8 (via mmacy@) Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/cxgbei/cxgbei.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/cxgbei/cxgbei.c ============================================================================== --- stable/11/sys/dev/cxgbe/cxgbei/cxgbei.c Mon Apr 29 01:15:22 2019 (r346866) +++ stable/11/sys/dev/cxgbe/cxgbei/cxgbei.c Mon Apr 29 01:22:58 2019 (r346867) @@ -969,7 +969,7 @@ start_worker_threads(void) i + 1, worker_thread_count, rc); mtx_destroy(&cwt->cwt_lock); cv_destroy(&cwt->cwt_cv); - bzero(&cwt, sizeof(*cwt)); + bzero(cwt, sizeof(*cwt)); if (i == 0) { free(cwt_softc, M_CXGBE); worker_thread_count = 0; From owner-svn-src-all@freebsd.org Mon Apr 29 02:30:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E9D71590DEC; Mon, 29 Apr 2019 02:30:07 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A739687137; Mon, 29 Apr 2019 02:30:06 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81A971B962; Mon, 29 Apr 2019 02:30:06 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T2U6cj034439; Mon, 29 Apr 2019 02:30:06 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T2U6J5034438; Mon, 29 Apr 2019 02:30:06 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904290230.x3T2U6J5034438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 02:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346869 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346869 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A739687137 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 02:30:07 -0000 Author: np Date: Mon Apr 29 02:30:06 2019 New Revision: 346869 URL: https://svnweb.freebsd.org/changeset/base/346869 Log: MFC r335223: cxgbe(4): sysctls to display the local and intr CPUs for the adapter. The driver assumes the list can change (even though it does't right now) and queries it every time the sysctl runs. sysctl dev...local_cpus sysctl dev...intr_cpus sysctl dev.t6nex.0.local_cpus sysctl dev.t6nex.0.intr_cpus Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 01:40:35 2019 (r346868) +++ stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 02:30:06 2019 (r346869) @@ -662,6 +662,7 @@ static int sysctl_tx_rate(SYSCTL_HANDLER_ARGS); static int sysctl_ulprx_la(SYSCTL_HANDLER_ARGS); static int sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS); static int sysctl_tc_params(SYSCTL_HANDLER_ARGS); +static int sysctl_cpus(SYSCTL_HANDLER_ARGS); #ifdef TCP_OFFLOAD static int sysctl_tls_rx_ports(SYSCTL_HANDLER_ARGS); static int sysctl_tp_tick(SYSCTL_HANDLER_ARGS); @@ -5728,6 +5729,14 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "core_vdd", CTLFLAG_RD, &sc->params.core_vdd, 0, "core Vdd (in mV)"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "local_cpus", + CTLTYPE_STRING | CTLFLAG_RD, sc, LOCAL_CPUS, + sysctl_cpus, "A", "local CPUs"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_cpus", + CTLTYPE_STRING | CTLFLAG_RD, sc, INTR_CPUS, + sysctl_cpus, "A", "preferred CPUs for interrupts"); + /* * dev.t4nex.X.misc. Marked CTLFLAG_SKIP to avoid information overload. */ @@ -8853,6 +8862,39 @@ done: sbuf_delete(sb); return (rc); +} + +static int +sysctl_cpus(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + enum cpu_sets op = arg2; + cpuset_t cpuset; + struct sbuf *sb; + int i, rc; + + MPASS(op == LOCAL_CPUS || op == INTR_CPUS); + + CPU_ZERO(&cpuset); + rc = bus_get_cpus(sc->dev, op, sizeof(cpuset), &cpuset); + if (rc != 0) + return (rc); + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return (rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); + if (sb == NULL) + return (ENOMEM); + + CPU_FOREACH(i) + sbuf_printf(sb, "%d ", i); + rc = sbuf_finish(sb); + sbuf_delete(sb); + + return (rc); + } #ifdef TCP_OFFLOAD From owner-svn-src-all@freebsd.org Mon Apr 29 02:38:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF90F1591159; Mon, 29 Apr 2019 02:38:52 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5ECEE875C2; Mon, 29 Apr 2019 02:38:52 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 335701BB03; Mon, 29 Apr 2019 02:38:52 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T2cq3I039677; Mon, 29 Apr 2019 02:38:52 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T2cqMo039676; Mon, 29 Apr 2019 02:38:52 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904290238.x3T2cqMo039676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 02:38:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346870 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346870 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5ECEE875C2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 02:38:53 -0000 Author: np Date: Mon Apr 29 02:38:51 2019 New Revision: 346870 URL: https://svnweb.freebsd.org/changeset/base/346870 Log: MFC r337397: cxgbe(4): Break up sysctl_bitfield into 8 bit and 16 bit variants. Have them display the current value of the bitfield rather than the fixed value that was provided when the sysctl node was created. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 02:30:06 2019 (r346869) +++ stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 02:38:51 2019 (r346870) @@ -620,7 +620,8 @@ static void cxgbe_tick(void *); static void cxgbe_vlan_config(void *, struct ifnet *, uint16_t); static void cxgbe_sysctls(struct port_info *); static int sysctl_int_array(SYSCTL_HANDLER_ARGS); -static int sysctl_bitfield(SYSCTL_HANDLER_ARGS); +static int sysctl_bitfield_8b(SYSCTL_HANDLER_ARGS); +static int sysctl_bitfield_16b(SYSCTL_HANDLER_ARGS); static int sysctl_btphy(SYSCTL_HANDLER_ARGS); static int sysctl_noflowq(SYSCTL_HANDLER_ARGS); static int sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_ARGS); @@ -5629,8 +5630,8 @@ t4_sysctls(struct adapter *sc) sc->params.nports, "# of ports"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "doorbells", - CTLTYPE_STRING | CTLFLAG_RD, doorbells, sc->doorbells, - sysctl_bitfield, "A", "available doorbells"); + CTLTYPE_STRING | CTLFLAG_RD, doorbells, (uintptr_t)&sc->doorbells, + sysctl_bitfield_8b, "A", "available doorbells"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "core_clock", CTLFLAG_RD, NULL, sc->params.vpd.cclk, "core clock frequency (in KHz)"); @@ -5701,8 +5702,8 @@ t4_sysctls(struct adapter *sc) #define SYSCTL_CAP(name, n, text) \ SYSCTL_ADD_PROC(ctx, children, OID_AUTO, #name, \ - CTLTYPE_STRING | CTLFLAG_RD, caps_decoder[n], sc->name, \ - sysctl_bitfield, "A", "available " text " capabilities") + CTLTYPE_STRING | CTLFLAG_RD, caps_decoder[n], (uintptr_t)&sc->name, \ + sysctl_bitfield_16b, "A", "available " text " capabilities") SYSCTL_CAP(nbmcaps, 0, "NBM"); SYSCTL_CAP(linkcaps, 1, "link"); @@ -6390,7 +6391,7 @@ sysctl_int_array(SYSCTL_HANDLER_ARGS) } static int -sysctl_bitfield(SYSCTL_HANDLER_ARGS) +sysctl_bitfield_8b(SYSCTL_HANDLER_ARGS) { int rc; struct sbuf *sb; @@ -6403,7 +6404,28 @@ sysctl_bitfield(SYSCTL_HANDLER_ARGS) if (sb == NULL) return (ENOMEM); - sbuf_printf(sb, "%b", (int)arg2, (char *)arg1); + sbuf_printf(sb, "%b", *(uint8_t *)(uintptr_t)arg2, (char *)arg1); + rc = sbuf_finish(sb); + sbuf_delete(sb); + + return (rc); +} + +static int +sysctl_bitfield_16b(SYSCTL_HANDLER_ARGS) +{ + int rc; + struct sbuf *sb; + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return(rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 128, req); + if (sb == NULL) + return (ENOMEM); + + sbuf_printf(sb, "%b", *(uint16_t *)(uintptr_t)arg2, (char *)arg1); rc = sbuf_finish(sb); sbuf_delete(sb); From owner-svn-src-all@freebsd.org Mon Apr 29 03:11:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 765491591816; Mon, 29 Apr 2019 03:11:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19B5888636; Mon, 29 Apr 2019 03:11:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A1FD1C0A5; Mon, 29 Apr 2019 03:11:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T3B0Yp059407; Mon, 29 Apr 2019 03:11:00 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T3Awwl059372; Mon, 29 Apr 2019 03:10:58 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904290310.x3T3Awwl059372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 03:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346871 - in stable/11/sys/dev/cxgbe: . common tom X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys/dev/cxgbe: . common tom X-SVN-Commit-Revision: 346871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 19B5888636 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 03:11:00 -0000 Author: np Date: Mon Apr 29 03:10:58 2019 New Revision: 346871 URL: https://svnweb.freebsd.org/changeset/base/346871 Log: MFC r336718, r336720, r336734-r336735, r337398, r337439, and r337540. These are all related to tx rate limiting in cxgbe. r336718: cxgbe(4): Validate only those parameters that are relevant to the type of rate limiter being programmed. Skip the ones that are not applicable. Sponsored by: Chelsio Communications r336720: cxgbe(4): Remove useless code that crept in with r336718. X-MFC With: 336718 r336734: cxgbe(4): Better defaults for all cl-rl rate limiters. Start in "class" instead of "flow" mode. This eliminates the need to specify an MTU, which is not available that early anyway. It also allows the user to manually configure ch-rl rate limiting after attach. This used to fail because ch-rl isn't supported if cl-rl "flow" mode is configured. Set all traffic classes to 1Gbps during initialization. The goal is to start off with _any_ valid configuration and 1Gbps works even for gigabit cards. Sponsored by: Chelsio Communications r336735: cxgbe(4): Consider rateunit before ratemode when displaying information about a traffic class. This matches the order in which the firmware evaluates unit and mode internally. Sponsored by: Chelsio Communications r337398: cxgbe(4): Allow user-configured and driver-configured traffic classes to be used simultaneously. Move sysctl_tc and sysctl_tc_params to t4_sched.c while here. Sponsored by: Chelsio Communications r337439: cxgbe(4): Allow the driver to specify a burst size when configuring a traffic class for rate limiting. Add experimental knobs that allow the user to specify a default pktsize and burstsize for traffic classes associated with a port: dev...tc.pktsize dev...tc.burstsize Sponsored by: Chelsio Communications r337540: cxgbe(4): Display pkt-size and burst-size in traffic class parameters. Modified: stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/common/common.h stable/11/sys/dev/cxgbe/common/t4_hw.c stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/cxgbe/t4_sched.c stable/11/sys/dev/cxgbe/t4_sge.c stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c stable/11/sys/dev/cxgbe/tom/t4_tom.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 02:38:51 2019 (r346870) +++ stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 03:10:58 2019 (r346871) @@ -236,18 +236,21 @@ struct tx_ch_rl_params { }; enum { - TX_CLRL_REFRESH = (1 << 0), /* Need to update hardware state. */ - TX_CLRL_ERROR = (1 << 1), /* Error, hardware state unknown. */ + CLRL_USER = (1 << 0), /* allocated manually. */ + CLRL_SYNC = (1 << 1), /* sync hw update in progress. */ + CLRL_ASYNC = (1 << 2), /* async hw update requested. */ + CLRL_ERR = (1 << 3), /* last hw setup ended in error. */ }; struct tx_cl_rl_params { int refcount; - u_int flags; + uint8_t flags; enum fw_sched_params_rate ratemode; /* %port REL or ABS value */ enum fw_sched_params_unit rateunit; /* kbps or pps (when ABS) */ enum fw_sched_params_mode mode; /* aggr or per-flow */ uint32_t maxrate; uint16_t pktsize; + uint16_t burstsize; }; /* Tx scheduler parameters for a channel/port */ @@ -258,7 +261,9 @@ struct tx_sched_params { /* Class WRR */ /* XXX */ - /* Class Rate Limiter */ + /* Class Rate Limiter (including the default pktsize and burstsize). */ + int pktsize; + int burstsize; struct tx_cl_rl_params cl_rl[]; }; @@ -1186,7 +1191,9 @@ int t4_init_tx_sched(struct adapter *); int t4_free_tx_sched(struct adapter *); void t4_update_tx_sched(struct adapter *); int t4_reserve_cl_rl_kbps(struct adapter *, int, u_int, int *); -void t4_release_cl_rl_kbps(struct adapter *, int, int); +void t4_release_cl_rl(struct adapter *, int, int); +int sysctl_tc(SYSCTL_HANDLER_ARGS); +int sysctl_tc_params(SYSCTL_HANDLER_ARGS); /* t4_filter.c */ int get_filter_mode(struct adapter *, uint32_t *); Modified: stable/11/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/11/sys/dev/cxgbe/common/common.h Mon Apr 29 02:38:51 2019 (r346870) +++ stable/11/sys/dev/cxgbe/common/common.h Mon Apr 29 03:10:58 2019 (r346871) @@ -819,7 +819,7 @@ int t4_sched_config(struct adapter *adapter, int type, int t4_sched_params(struct adapter *adapter, int type, int level, int mode, int rateunit, int ratemode, int channel, int cl, int minrate, int maxrate, int weight, int pktsize, - int sleep_ok); + int burstsize, int sleep_ok); int t4_sched_params_ch_rl(struct adapter *adapter, int channel, int ratemode, unsigned int maxrate, int sleep_ok); int t4_sched_params_cl_wrr(struct adapter *adapter, int channel, int cl, Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/11/sys/dev/cxgbe/common/t4_hw.c Mon Apr 29 02:38:51 2019 (r346870) +++ stable/11/sys/dev/cxgbe/common/t4_hw.c Mon Apr 29 03:10:58 2019 (r346871) @@ -10034,7 +10034,7 @@ int t4_sched_config(struct adapter *adapter, int type, int t4_sched_params(struct adapter *adapter, int type, int level, int mode, int rateunit, int ratemode, int channel, int cl, int minrate, int maxrate, int weight, int pktsize, - int sleep_ok) + int burstsize, int sleep_ok) { struct fw_sched_cmd cmd; @@ -10056,6 +10056,7 @@ int t4_sched_params(struct adapter *adapter, int type, cmd.u.params.max = cpu_to_be32(maxrate); cmd.u.params.weight = cpu_to_be16(weight); cmd.u.params.pktsize = cpu_to_be16(pktsize); + cmd.u.params.burstsize = cpu_to_be16(burstsize); return t4_wr_mbox_meat(adapter,adapter->mbox, &cmd, sizeof(cmd), NULL, sleep_ok); Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 02:38:51 2019 (r346870) +++ stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 03:10:58 2019 (r346871) @@ -662,7 +662,6 @@ static int sysctl_tp_la(SYSCTL_HANDLER_ARGS); static int sysctl_tx_rate(SYSCTL_HANDLER_ARGS); static int sysctl_ulprx_la(SYSCTL_HANDLER_ARGS); static int sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS); -static int sysctl_tc_params(SYSCTL_HANDLER_ARGS); static int sysctl_cpus(SYSCTL_HANDLER_ARGS); #ifdef TCP_OFFLOAD static int sysctl_tls_rx_ports(SYSCTL_HANDLER_ARGS); @@ -6138,6 +6137,7 @@ cxgbe_sysctls(struct port_info *pi) struct adapter *sc = pi->adapter; int i; char name[16]; + static char *tc_flags = {"\20\1USER\2SYNC\3ASYNC\4ERR"}; ctx = device_get_sysctl_ctx(pi->dev); @@ -6183,6 +6183,13 @@ cxgbe_sysctls(struct port_info *pi) */ oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "tc", CTLFLAG_RD, NULL, "Tx scheduler traffic classes (cl_rl)"); + children2 = SYSCTL_CHILDREN(oid); + SYSCTL_ADD_UINT(ctx, children2, OID_AUTO, "pktsize", + CTLFLAG_RW, &pi->sched_params->pktsize, 0, + "pktsize for per-flow cl-rl (0 means up to the driver )"); + SYSCTL_ADD_UINT(ctx, children2, OID_AUTO, "burstsize", + CTLFLAG_RW, &pi->sched_params->burstsize, 0, + "burstsize for per-flow cl-rl (0 means up to the driver)"); for (i = 0; i < sc->chip_params->nsched_cls; i++) { struct tx_cl_rl_params *tc = &pi->sched_params->cl_rl[i]; @@ -6190,8 +6197,9 @@ cxgbe_sysctls(struct port_info *pi) children2 = SYSCTL_CHILDREN(SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, name, CTLFLAG_RD, NULL, "traffic class")); - SYSCTL_ADD_UINT(ctx, children2, OID_AUTO, "flags", CTLFLAG_RD, - &tc->flags, 0, "flags"); + SYSCTL_ADD_PROC(ctx, children2, OID_AUTO, "flags", + CTLTYPE_STRING | CTLFLAG_RD, tc_flags, (uintptr_t)&tc->flags, + sysctl_bitfield_8b, "A", "flags"); SYSCTL_ADD_UINT(ctx, children2, OID_AUTO, "refcount", CTLFLAG_RD, &tc->refcount, 0, "references to this class"); SYSCTL_ADD_PROC(ctx, children2, OID_AUTO, "params", @@ -8805,82 +8813,6 @@ sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS) } } rc = sbuf_finish(sb); - sbuf_delete(sb); - - return (rc); -} - -static int -sysctl_tc_params(SYSCTL_HANDLER_ARGS) -{ - struct adapter *sc = arg1; - struct tx_cl_rl_params tc; - struct sbuf *sb; - int i, rc, port_id, mbps, gbps; - - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - - sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); - if (sb == NULL) - return (ENOMEM); - - port_id = arg2 >> 16; - MPASS(port_id < sc->params.nports); - MPASS(sc->port[port_id] != NULL); - i = arg2 & 0xffff; - MPASS(i < sc->chip_params->nsched_cls); - - mtx_lock(&sc->tc_lock); - tc = sc->port[port_id]->sched_params->cl_rl[i]; - mtx_unlock(&sc->tc_lock); - - if (tc.flags & TX_CLRL_ERROR) { - sbuf_printf(sb, "error"); - goto done; - } - - if (tc.ratemode == SCHED_CLASS_RATEMODE_REL) { - /* XXX: top speed or actual link speed? */ - gbps = port_top_speed(sc->port[port_id]); - sbuf_printf(sb, " %u%% of %uGbps", tc.maxrate, gbps); - } else if (tc.ratemode == SCHED_CLASS_RATEMODE_ABS) { - switch (tc.rateunit) { - case SCHED_CLASS_RATEUNIT_BITS: - mbps = tc.maxrate / 1000; - gbps = tc.maxrate / 1000000; - if (tc.maxrate == gbps * 1000000) - sbuf_printf(sb, " %uGbps", gbps); - else if (tc.maxrate == mbps * 1000) - sbuf_printf(sb, " %uMbps", mbps); - else - sbuf_printf(sb, " %uKbps", tc.maxrate); - break; - case SCHED_CLASS_RATEUNIT_PKTS: - sbuf_printf(sb, " %upps", tc.maxrate); - break; - default: - rc = ENXIO; - goto done; - } - } - - switch (tc.mode) { - case SCHED_CLASS_MODE_CLASS: - sbuf_printf(sb, " aggregate"); - break; - case SCHED_CLASS_MODE_FLOW: - sbuf_printf(sb, " per-flow"); - break; - default: - rc = ENXIO; - goto done; - } - -done: - if (rc == 0) - rc = sbuf_finish(sb); sbuf_delete(sb); return (rc); Modified: stable/11/sys/dev/cxgbe/t4_sched.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sched.c Mon Apr 29 02:38:51 2019 (r346870) +++ stable/11/sys/dev/cxgbe/t4_sched.c Mon Apr 29 03:10:58 2019 (r346871) @@ -74,7 +74,8 @@ set_sched_class_params(struct adapter *sc, struct t4_s { int rc, top_speed, fw_level, fw_mode, fw_rateunit, fw_ratemode; struct port_info *pi; - struct tx_cl_rl_params *tc; + struct tx_cl_rl_params *tc, old; + bool check_pktsize = false; if (p->level == SCHED_CLASS_LEVEL_CL_RL) fw_level = FW_SCHED_PARAMS_LEVEL_CL_RL; @@ -85,28 +86,20 @@ set_sched_class_params(struct adapter *sc, struct t4_s else return (EINVAL); - if (p->mode == SCHED_CLASS_MODE_CLASS) - fw_mode = FW_SCHED_PARAMS_MODE_CLASS; - else if (p->mode == SCHED_CLASS_MODE_FLOW) - fw_mode = FW_SCHED_PARAMS_MODE_FLOW; - else - return (EINVAL); + if (p->level == SCHED_CLASS_LEVEL_CL_RL) { + if (p->mode == SCHED_CLASS_MODE_CLASS) + fw_mode = FW_SCHED_PARAMS_MODE_CLASS; + else if (p->mode == SCHED_CLASS_MODE_FLOW) { + check_pktsize = true; + fw_mode = FW_SCHED_PARAMS_MODE_FLOW; + } else + return (EINVAL); + } else + fw_mode = 0; - if (p->rateunit == SCHED_CLASS_RATEUNIT_BITS) - fw_rateunit = FW_SCHED_PARAMS_UNIT_BITRATE; - else if (p->rateunit == SCHED_CLASS_RATEUNIT_PKTS) - fw_rateunit = FW_SCHED_PARAMS_UNIT_PKTRATE; - else + /* Valid channel must always be provided. */ + if (p->channel < 0) return (EINVAL); - - if (p->ratemode == SCHED_CLASS_RATEMODE_REL) - fw_ratemode = FW_SCHED_PARAMS_RATE_REL; - else if (p->ratemode == SCHED_CLASS_RATEMODE_ABS) - fw_ratemode = FW_SCHED_PARAMS_RATE_ABS; - else - return (EINVAL); - - /* Vet our parameters ... */ if (!in_range(p->channel, 0, sc->chip_params->nchan - 1)) return (ERANGE); @@ -116,80 +109,131 @@ set_sched_class_params(struct adapter *sc, struct t4_s MPASS(pi->tx_chan == p->channel); top_speed = port_top_speed(pi) * 1000000; /* Gbps -> Kbps */ - if (!in_range(p->cl, 0, sc->chip_params->nsched_cls) || - !in_range(p->minrate, 0, top_speed) || - !in_range(p->maxrate, 0, top_speed) || - !in_range(p->weight, 0, 100)) - return (ERANGE); + if (p->level == SCHED_CLASS_LEVEL_CL_RL || + p->level == SCHED_CLASS_LEVEL_CH_RL) { + /* + * Valid rate (mode, unit and values) must be provided. + */ - /* - * Translate any unset parameters into the firmware's - * nomenclature and/or fail the call if the parameters - * are required ... - */ - if (p->rateunit < 0 || p->ratemode < 0 || p->channel < 0 || p->cl < 0) - return (EINVAL); + if (p->minrate < 0) + p->minrate = 0; + if (p->maxrate < 0) + return (EINVAL); - if (p->minrate < 0) - p->minrate = 0; - if (p->maxrate < 0) { - if (p->level == SCHED_CLASS_LEVEL_CL_RL || - p->level == SCHED_CLASS_LEVEL_CH_RL) + if (p->rateunit == SCHED_CLASS_RATEUNIT_BITS) { + fw_rateunit = FW_SCHED_PARAMS_UNIT_BITRATE; + /* ratemode could be relative (%) or absolute. */ + if (p->ratemode == SCHED_CLASS_RATEMODE_REL) { + fw_ratemode = FW_SCHED_PARAMS_RATE_REL; + /* maxrate is % of port bandwidth. */ + if (!in_range(p->minrate, 0, 100) || + !in_range(p->maxrate, 0, 100)) { + return (ERANGE); + } + } else if (p->ratemode == SCHED_CLASS_RATEMODE_ABS) { + fw_ratemode = FW_SCHED_PARAMS_RATE_ABS; + /* maxrate is absolute value in kbps. */ + if (!in_range(p->minrate, 0, top_speed) || + !in_range(p->maxrate, 0, top_speed)) { + return (ERANGE); + } + } else + return (EINVAL); + } else if (p->rateunit == SCHED_CLASS_RATEUNIT_PKTS) { + /* maxrate is the absolute value in pps. */ + check_pktsize = true; + fw_rateunit = FW_SCHED_PARAMS_UNIT_PKTRATE; + } else return (EINVAL); - else - p->maxrate = 0; + } else { + MPASS(p->level == SCHED_CLASS_LEVEL_CL_WRR); + + /* + * Valid weight must be provided. + */ + if (p->weight < 0) + return (EINVAL); + if (!in_range(p->weight, 1, 99)) + return (ERANGE); + + fw_rateunit = 0; + fw_ratemode = 0; } - if (p->weight < 0) { - if (p->level == SCHED_CLASS_LEVEL_CL_WRR) + + if (p->level == SCHED_CLASS_LEVEL_CL_RL || + p->level == SCHED_CLASS_LEVEL_CL_WRR) { + /* + * Valid scheduling class must be provided. + */ + if (p->cl < 0) return (EINVAL); - else - p->weight = 0; + if (!in_range(p->cl, 0, sc->chip_params->nsched_cls - 1)) + return (ERANGE); } - if (p->pktsize < 0) { - if (p->level == SCHED_CLASS_LEVEL_CL_RL || - p->level == SCHED_CLASS_LEVEL_CH_RL) + + if (check_pktsize) { + if (p->pktsize < 0) return (EINVAL); - else - p->pktsize = 0; + if (!in_range(p->pktsize, 64, pi->vi[0].ifp->if_mtu)) + return (ERANGE); } - rc = begin_synchronized_op(sc, NULL, - sleep_ok ? (SLEEP_OK | INTR_OK) : HOLD_LOCK, "t4sscp"); - if (rc) - return (rc); if (p->level == SCHED_CLASS_LEVEL_CL_RL) { tc = &pi->sched_params->cl_rl[p->cl]; - if (tc->refcount > 0) { + mtx_lock(&sc->tc_lock); + if (tc->refcount > 0 || tc->flags & (CLRL_SYNC | CLRL_ASYNC)) rc = EBUSY; - goto done; - } else { + else { + tc->flags |= CLRL_SYNC | CLRL_USER; tc->ratemode = fw_ratemode; tc->rateunit = fw_rateunit; tc->mode = fw_mode; tc->maxrate = p->maxrate; tc->pktsize = p->pktsize; + rc = 0; + old= *tc; } + mtx_unlock(&sc->tc_lock); + if (rc != 0) + return (rc); } + + rc = begin_synchronized_op(sc, NULL, + sleep_ok ? (SLEEP_OK | INTR_OK) : HOLD_LOCK, "t4sscp"); + if (rc != 0) { + if (p->level == SCHED_CLASS_LEVEL_CL_RL) { + mtx_lock(&sc->tc_lock); + *tc = old; + mtx_unlock(&sc->tc_lock); + } + return (rc); + } rc = -t4_sched_params(sc, FW_SCHED_TYPE_PKTSCHED, fw_level, fw_mode, fw_rateunit, fw_ratemode, p->channel, p->cl, p->minrate, p->maxrate, - p->weight, p->pktsize, sleep_ok); - if (p->level == SCHED_CLASS_LEVEL_CL_RL && rc != 0) { - /* - * Unknown state at this point, see parameters in tc for what - * was attempted. - */ - tc->flags |= TX_CLRL_ERROR; - } -done: + p->weight, p->pktsize, 0, sleep_ok); end_synchronized_op(sc, sleep_ok ? 0 : LOCK_HELD); + if (p->level == SCHED_CLASS_LEVEL_CL_RL) { + mtx_lock(&sc->tc_lock); + MPASS(tc->flags & CLRL_SYNC); + MPASS(tc->flags & CLRL_USER); + MPASS(tc->refcount == 0); + + tc->flags &= ~CLRL_SYNC; + if (rc == 0) + tc->flags &= ~CLRL_ERR; + else + tc->flags |= CLRL_ERR; + mtx_unlock(&sc->tc_lock); + } + return (rc); } static void update_tx_sched(void *context, int pending) { - int i, j, mode, rateunit, ratemode, maxrate, pktsize, rc; + int i, j, rc; struct port_info *pi; struct tx_cl_rl_params *tc; struct adapter *sc = context; @@ -201,14 +245,8 @@ update_tx_sched(void *context, int pending) tc = &pi->sched_params->cl_rl[0]; for (j = 0; j < n; j++, tc++) { MPASS(mtx_owned(&sc->tc_lock)); - if ((tc->flags & TX_CLRL_REFRESH) == 0) + if ((tc->flags & CLRL_ASYNC) == 0) continue; - - mode = tc->mode; - rateunit = tc->rateunit; - ratemode = tc->ratemode; - maxrate = tc->maxrate; - pktsize = tc->pktsize; mtx_unlock(&sc->tc_lock); if (begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, @@ -216,21 +254,19 @@ update_tx_sched(void *context, int pending) mtx_lock(&sc->tc_lock); continue; } - rc = t4_sched_params(sc, FW_SCHED_TYPE_PKTSCHED, - FW_SCHED_PARAMS_LEVEL_CL_RL, mode, rateunit, - ratemode, pi->tx_chan, j, 0, maxrate, 0, pktsize, - 1); + rc = -t4_sched_params(sc, FW_SCHED_TYPE_PKTSCHED, + FW_SCHED_PARAMS_LEVEL_CL_RL, tc->mode, tc->rateunit, + tc->ratemode, pi->tx_chan, j, 0, tc->maxrate, 0, + tc->pktsize, tc->burstsize, 1); end_synchronized_op(sc, 0); mtx_lock(&sc->tc_lock); - if (rc != 0) { - tc->flags |= TX_CLRL_ERROR; - } else if (tc->mode == mode && - tc->rateunit == rateunit && - tc->maxrate == maxrate && - tc->pktsize == tc->pktsize) { - tc->flags &= ~(TX_CLRL_REFRESH | TX_CLRL_ERROR); - } + MPASS(tc->flags & CLRL_ASYNC); + tc->flags &= ~CLRL_ASYNC; + if (rc == 0) + tc->flags &= ~CLRL_ERR; + else + tc->flags |= CLRL_ERR; } } mtx_unlock(&sc->tc_lock); @@ -252,74 +288,135 @@ t4_set_sched_class(struct adapter *sc, struct t4_sched return (EINVAL); } -int -t4_set_sched_queue(struct adapter *sc, struct t4_sched_queue *p) +static int +bind_txq_to_traffic_class(struct adapter *sc, struct sge_txq *txq, int idx) { - struct port_info *pi = NULL; - struct vi_info *vi; - struct sge_txq *txq; - uint32_t fw_mnem, fw_queue, fw_class; - int i, rc; + struct tx_cl_rl_params *tc0, *tc; + int rc, old_idx; + uint32_t fw_mnem, fw_class; - rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4setsq"); - if (rc) - return (rc); + if (!(txq->eq.flags & EQ_ALLOCATED)) + return (EAGAIN); - if (p->port >= sc->params.nports) { - rc = EINVAL; + mtx_lock(&sc->tc_lock); + if (txq->tc_idx == -2) { + rc = EBUSY; /* Another bind/unbind in progress already. */ goto done; } - - /* XXX: Only supported for the main VI. */ - pi = sc->port[p->port]; - vi = &pi->vi[0]; - if (!(vi->flags & VI_INIT_DONE)) { - /* tx queues not set up yet */ - rc = EAGAIN; + if (idx == txq->tc_idx) { + rc = 0; /* No change, nothing to do. */ goto done; } - if (!in_range(p->queue, 0, vi->ntxq - 1) || - !in_range(p->cl, 0, sc->chip_params->nsched_cls - 1)) { - rc = EINVAL; - goto done; + tc0 = &sc->port[txq->eq.tx_chan]->sched_params->cl_rl[0]; + if (idx != -1) { + /* + * Bind to a different class at index idx. + */ + tc = &tc0[idx]; + if (tc->flags & CLRL_ERR) { + rc = ENXIO; + goto done; + } else { + /* + * Ok to proceed. Place a reference on the new class + * while still holding on to the reference on the + * previous class, if any. + */ + tc->refcount++; + } } + /* Mark as busy before letting go of the lock. */ + old_idx = txq->tc_idx; + txq->tc_idx = -2; + mtx_unlock(&sc->tc_lock); - /* - * Create a template for the FW_PARAMS_CMD mnemonic and value (TX - * Scheduling Class in this case). - */ + rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4btxq"); + if (rc != 0) + return (rc); fw_mnem = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) | - V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_EQ_SCHEDCLASS_ETH)); - fw_class = p->cl < 0 ? 0xffffffff : p->cl; + V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_EQ_SCHEDCLASS_ETH) | + V_FW_PARAMS_PARAM_YZ(txq->eq.cntxt_id)); + fw_class = idx < 0 ? 0xffffffff : idx; + rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, &fw_mnem, &fw_class); + end_synchronized_op(sc, 0); - /* - * If op.queue is non-negative, then we're only changing the scheduling - * on a single specified TX queue. - */ - if (p->queue >= 0) { - txq = &sc->sge.txq[vi->first_txq + p->queue]; - fw_queue = (fw_mnem | V_FW_PARAMS_PARAM_YZ(txq->eq.cntxt_id)); - rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, &fw_queue, - &fw_class); - goto done; + mtx_lock(&sc->tc_lock); + MPASS(txq->tc_idx == -2); + if (rc == 0) { + /* + * Unbind, bind, or bind to a different class succeeded. Remove + * the reference on the old traffic class, if any. + */ + if (old_idx != -1) { + tc = &tc0[old_idx]; + MPASS(tc->refcount > 0); + tc->refcount--; + } + txq->tc_idx = idx; + } else { + /* + * Unbind, bind, or bind to a different class failed. Remove + * the anticipatory reference on the new traffic class, if any. + */ + if (idx != -1) { + tc = &tc0[idx]; + MPASS(tc->refcount > 0); + tc->refcount--; + } + txq->tc_idx = old_idx; } +done: + MPASS(txq->tc_idx >= -1 && txq->tc_idx < sc->chip_params->nsched_cls); + mtx_unlock(&sc->tc_lock); + return (rc); +} +int +t4_set_sched_queue(struct adapter *sc, struct t4_sched_queue *p) +{ + struct port_info *pi = NULL; + struct vi_info *vi; + struct sge_txq *txq; + int i, rc; + + if (p->port >= sc->params.nports) + return (EINVAL); + /* - * Change the scheduling on all the TX queues for the - * interface. + * XXX: cxgbetool allows the user to specify the physical port only. So + * we always operate on the main VI. */ - for_each_txq(vi, i, txq) { - fw_queue = (fw_mnem | V_FW_PARAMS_PARAM_YZ(txq->eq.cntxt_id)); - rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, &fw_queue, - &fw_class); - if (rc) - goto done; + pi = sc->port[p->port]; + vi = &pi->vi[0]; + + /* Checking VI_INIT_DONE outside a synch-op is a harmless race here. */ + if (!(vi->flags & VI_INIT_DONE)) + return (EAGAIN); + + if (!in_range(p->queue, 0, vi->ntxq - 1) || + !in_range(p->cl, 0, sc->chip_params->nsched_cls - 1)) + return (EINVAL); + + if (p->queue < 0) { + /* + * Change the scheduling on all the TX queues for the + * interface. + */ + for_each_txq(vi, i, txq) { + rc = bind_txq_to_traffic_class(sc, txq, p->cl); + if (rc != 0) + break; + } + } else { + /* + * If op.queue is non-negative, then we're only changing the + * scheduling on a single specified TX queue. + */ + txq = &sc->sge.txq[vi->first_txq + p->queue]; + rc = bind_txq_to_traffic_class(sc, txq, p->cl); } - rc = 0; -done: - end_synchronized_op(sc, 0); return (rc); } @@ -330,24 +427,6 @@ t4_init_tx_sched(struct adapter *sc) const int n = sc->chip_params->nsched_cls; struct port_info *pi; struct tx_cl_rl_params *tc; - static const uint32_t init_kbps[] = { - 100 * 1000, - 200 * 1000, - 400 * 1000, - 500 * 1000, - 800 * 1000, - 1000 * 1000, - 1200 * 1000, - 1500 * 1000, - 1800 * 1000, - 2000 * 1000, - 2500 * 1000, - 3000 * 1000, - 3500 * 1000, - 4000 * 1000, - 5000 * 1000, - 10000 * 1000 - }; mtx_init(&sc->tc_lock, "tx_sched lock", NULL, MTX_DEF); TASK_INIT(&sc->tc_task, 0, update_tx_sched, sc); @@ -360,15 +439,12 @@ t4_init_tx_sched(struct adapter *sc) tc->refcount = 0; tc->ratemode = FW_SCHED_PARAMS_RATE_ABS; tc->rateunit = FW_SCHED_PARAMS_UNIT_BITRATE; - tc->mode = FW_SCHED_PARAMS_MODE_FLOW; - tc->maxrate = init_kbps[min(j, nitems(init_kbps) - 1)]; - tc->pktsize = ETHERMTU; /* XXX */ + tc->mode = FW_SCHED_PARAMS_MODE_CLASS; + tc->maxrate = 1000 * 1000; /* 1 Gbps. Arbitrary */ if (t4_sched_params_cl_rl_kbps(sc, pi->tx_chan, j, - tc->mode, tc->maxrate, tc->pktsize, 1) == 0) - tc->flags = 0; - else - tc->flags = TX_CLRL_ERROR; + tc->mode, tc->maxrate, tc->pktsize, 1) != 0) + tc->flags = CLRL_ERR; } } @@ -404,50 +480,72 @@ int t4_reserve_cl_rl_kbps(struct adapter *sc, int port_id, u_int maxrate, int *tc_idx) { - int rc = 0, fa = -1, i; + int rc = 0, fa = -1, i, pktsize, burstsize; + bool update; struct tx_cl_rl_params *tc; + struct port_info *pi; MPASS(port_id >= 0 && port_id < sc->params.nports); - tc = &sc->port[port_id]->sched_params->cl_rl[0]; + pi = sc->port[port_id]; + if (pi->sched_params->pktsize > 0) + pktsize = pi->sched_params->pktsize; + else + pktsize = pi->vi[0].ifp->if_mtu; + if (pi->sched_params->burstsize > 0) + burstsize = pi->sched_params->burstsize; + else + burstsize = pktsize * 4; + tc = &pi->sched_params->cl_rl[0]; + + update = false; mtx_lock(&sc->tc_lock); for (i = 0; i < sc->chip_params->nsched_cls; i++, tc++) { - if (fa < 0 && tc->refcount == 0) - fa = i; + if (fa < 0 && tc->refcount == 0 && !(tc->flags & CLRL_USER)) + fa = i; /* first available */ if (tc->ratemode == FW_SCHED_PARAMS_RATE_ABS && tc->rateunit == FW_SCHED_PARAMS_UNIT_BITRATE && tc->mode == FW_SCHED_PARAMS_MODE_FLOW && - tc->maxrate == maxrate) { + tc->maxrate == maxrate && tc->pktsize == pktsize && + tc->burstsize == burstsize) { tc->refcount++; *tc_idx = i; + if ((tc->flags & (CLRL_ERR | CLRL_ASYNC | CLRL_SYNC)) == + CLRL_ERR) { + update = true; + } goto done; } } /* Not found */ MPASS(i == sc->chip_params->nsched_cls); if (fa != -1) { - tc = &sc->port[port_id]->sched_params->cl_rl[fa]; - tc->flags = TX_CLRL_REFRESH; + tc = &pi->sched_params->cl_rl[fa]; tc->refcount = 1; tc->ratemode = FW_SCHED_PARAMS_RATE_ABS; tc->rateunit = FW_SCHED_PARAMS_UNIT_BITRATE; tc->mode = FW_SCHED_PARAMS_MODE_FLOW; tc->maxrate = maxrate; - tc->pktsize = ETHERMTU; /* XXX */ + tc->pktsize = pktsize; + tc->burstsize = burstsize; *tc_idx = fa; - t4_update_tx_sched(sc); + update = true; } else { *tc_idx = -1; rc = ENOSPC; } done: mtx_unlock(&sc->tc_lock); + if (update) { + tc->flags |= CLRL_ASYNC; + t4_update_tx_sched(sc); + } return (rc); } void -t4_release_cl_rl_kbps(struct adapter *sc, int port_id, int tc_idx) +t4_release_cl_rl(struct adapter *sc, int port_id, int tc_idx) { struct tx_cl_rl_params *tc; @@ -457,9 +555,114 @@ t4_release_cl_rl_kbps(struct adapter *sc, int port_id, mtx_lock(&sc->tc_lock); tc = &sc->port[port_id]->sched_params->cl_rl[tc_idx]; MPASS(tc->refcount > 0); - MPASS(tc->ratemode == FW_SCHED_PARAMS_RATE_ABS); - MPASS(tc->rateunit == FW_SCHED_PARAMS_UNIT_BITRATE); - MPASS(tc->mode == FW_SCHED_PARAMS_MODE_FLOW); tc->refcount--; mtx_unlock(&sc->tc_lock); +} + +int +sysctl_tc(SYSCTL_HANDLER_ARGS) +{ + struct vi_info *vi = arg1; + struct port_info *pi; + struct adapter *sc; + struct sge_txq *txq; + int qidx = arg2, rc, tc_idx; + + MPASS(qidx >= 0 && qidx < vi->ntxq); + pi = vi->pi; + sc = pi->adapter; + txq = &sc->sge.txq[vi->first_txq + qidx]; + + tc_idx = txq->tc_idx; + rc = sysctl_handle_int(oidp, &tc_idx, 0, req); + if (rc != 0 || req->newptr == NULL) + return (rc); + + if (sc->flags & IS_VF) + return (EPERM); + if (!in_range(tc_idx, 0, sc->chip_params->nsched_cls - 1)) + return (EINVAL); + + return (bind_txq_to_traffic_class(sc, txq, tc_idx)); +} + +int +sysctl_tc_params(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + struct tx_cl_rl_params tc; + struct sbuf *sb; + int i, rc, port_id, mbps, gbps; + + rc = sysctl_wire_old_buffer(req, 0); + if (rc != 0) + return (rc); + + sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); + if (sb == NULL) + return (ENOMEM); + + port_id = arg2 >> 16; + MPASS(port_id < sc->params.nports); + MPASS(sc->port[port_id] != NULL); + i = arg2 & 0xffff; + MPASS(i < sc->chip_params->nsched_cls); + + mtx_lock(&sc->tc_lock); + tc = sc->port[port_id]->sched_params->cl_rl[i]; + mtx_unlock(&sc->tc_lock); + + switch (tc.rateunit) { + case SCHED_CLASS_RATEUNIT_BITS: + switch (tc.ratemode) { + case SCHED_CLASS_RATEMODE_REL: + /* XXX: top speed or actual link speed? */ + gbps = port_top_speed(sc->port[port_id]); + sbuf_printf(sb, "%u%% of %uGbps", tc.maxrate, gbps); + break; + case SCHED_CLASS_RATEMODE_ABS: + mbps = tc.maxrate / 1000; + gbps = tc.maxrate / 1000000; + if (tc.maxrate == gbps * 1000000) + sbuf_printf(sb, "%uGbps", gbps); + else if (tc.maxrate == mbps * 1000) + sbuf_printf(sb, "%uMbps", mbps); + else + sbuf_printf(sb, "%uKbps", tc.maxrate); + break; + default: + rc = ENXIO; + goto done; + } + break; + case SCHED_CLASS_RATEUNIT_PKTS: + sbuf_printf(sb, "%upps", tc.maxrate); + break; + default: + rc = ENXIO; + goto done; + } + + switch (tc.mode) { + case SCHED_CLASS_MODE_CLASS: + sbuf_printf(sb, " aggregate"); + break; + case SCHED_CLASS_MODE_FLOW: + sbuf_printf(sb, " per-flow"); + if (tc.pktsize > 0) + sbuf_printf(sb, " pkt-size %u", tc.pktsize); + if (tc.burstsize > 0) + sbuf_printf(sb, " burst-size %u", tc.burstsize); + break; + default: + rc = ENXIO; + goto done; + } + +done: + if (rc == 0) + rc = sbuf_finish(sb); + sbuf_delete(sb); + + return (rc); } Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 02:38:51 2019 (r346870) +++ stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 03:10:58 2019 (r346871) @@ -288,7 +288,6 @@ static void drain_wrq_wr_list(struct adapter *, struct static int sysctl_uint16(SYSCTL_HANDLER_ARGS); static int sysctl_bufsizes(SYSCTL_HANDLER_ARGS); -static int sysctl_tc(SYSCTL_HANDLER_ARGS); static counter_u64_t extfree_refs; static counter_u64_t extfree_rels; @@ -5197,90 +5196,5 @@ sysctl_bufsizes(SYSCTL_HANDLER_ARGS) sbuf_finish(&sb); rc = sysctl_handle_string(oidp, sbuf_data(&sb), sbuf_len(&sb), req); sbuf_delete(&sb); - return (rc); -} - -static int -sysctl_tc(SYSCTL_HANDLER_ARGS) -{ - struct vi_info *vi = arg1; - struct port_info *pi; - struct adapter *sc; - struct sge_txq *txq; - struct tx_cl_rl_params *tc; - int qidx = arg2, rc, tc_idx; - uint32_t fw_queue, fw_class; - - MPASS(qidx >= 0 && qidx < vi->ntxq); - pi = vi->pi; - sc = pi->adapter; - txq = &sc->sge.txq[vi->first_txq + qidx]; - - tc_idx = txq->tc_idx; - rc = sysctl_handle_int(oidp, &tc_idx, 0, req); - if (rc != 0 || req->newptr == NULL) - return (rc); - - if (sc->flags & IS_VF) - return (EPERM); - - /* Note that -1 is legitimate input (it means unbind). */ - if (tc_idx < -1 || tc_idx >= sc->chip_params->nsched_cls) - return (EINVAL); - - mtx_lock(&sc->tc_lock); - if (tc_idx == txq->tc_idx) { - rc = 0; /* No change, nothing to do. */ - goto done; - } - - fw_queue = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) | - V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_EQ_SCHEDCLASS_ETH) | - V_FW_PARAMS_PARAM_YZ(txq->eq.cntxt_id); - - if (tc_idx == -1) - fw_class = 0xffffffff; /* Unbind. */ - else { - /* - * Bind to a different class. - */ - tc = &pi->sched_params->cl_rl[tc_idx]; - if (tc->flags & TX_CLRL_ERROR) { - /* Previous attempt to set the cl-rl params failed. */ - rc = EIO; - goto done; - } else { - /* - * Ok to proceed. Place a reference on the new class - * while still holding on to the reference on the - * previous class, if any. - */ - fw_class = tc_idx; - tc->refcount++; - } - } - mtx_unlock(&sc->tc_lock); - - rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4stc"); - if (rc) - return (rc); - rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, &fw_queue, &fw_class); - end_synchronized_op(sc, 0); - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Apr 29 03:31:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A58C1591BD1; Mon, 29 Apr 2019 03:31:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B310688EB7; Mon, 29 Apr 2019 03:31:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C15B1C530; Mon, 29 Apr 2019 03:31:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T3VLQY071102; Mon, 29 Apr 2019 03:31:21 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T3VK5J071099; Mon, 29 Apr 2019 03:31:20 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904290331.x3T3VK5J071099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 03:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346872 - in stable/11/sys/dev/cxgbe: . common X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 346872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B310688EB7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 03:31:22 -0000 Author: np Date: Mon Apr 29 03:31:20 2019 New Revision: 346872 URL: https://svnweb.freebsd.org/changeset/base/346872 Log: MFC r337192: cxgbe(4): Improvements in TID management. - Ignore any type of TID where the start/end values are not in the correct order. There are situations where the firmware isn't able to reserve room for the number requested in the config file but doesn't report a failure during configuration and instead sets end <= start. - Track start/end in tid_tab and remove some redundant copies from adapter->params. - Move all the start/end and other read-only parameters to a quiet part of tid_tab, away from the tid locks. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/common/common.h stable/11/sys/dev/cxgbe/offload.h stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/11/sys/dev/cxgbe/common/common.h Mon Apr 29 03:10:58 2019 (r346871) +++ stable/11/sys/dev/cxgbe/common/common.h Mon Apr 29 03:31:20 2019 (r346872) @@ -354,11 +354,6 @@ struct adapter_params { unsigned short a_wnd[NCCTRL_WIN]; unsigned short b_wnd[NCCTRL_WIN]; - u_int ftid_min; - u_int ftid_max; - u_int etid_min; - u_int etid_max; - unsigned int cim_la_size; uint8_t nports; /* # of ethernet ports */ @@ -443,14 +438,15 @@ struct link_config { static inline int is_ftid(const struct adapter *sc, u_int tid) { - return (tid >= sc->params.ftid_min && tid <= sc->params.ftid_max); + return (sc->tids.nftids > 0 && tid >= sc->tids.ftid_base && + tid <= sc->tids.ftid_end); } static inline int is_etid(const struct adapter *sc, u_int tid) { - return (sc->params.etid_min > 0 && tid >= sc->params.etid_min && - tid <= sc->params.etid_max); + return (sc->tids.netids > 0 && tid >= sc->tids.etid_base && + tid <= sc->tids.etid_end); } static inline int is_offload(const struct adapter *adap) Modified: stable/11/sys/dev/cxgbe/offload.h ============================================================================== --- stable/11/sys/dev/cxgbe/offload.h Mon Apr 29 03:10:58 2019 (r346871) +++ stable/11/sys/dev/cxgbe/offload.h Mon Apr 29 03:31:20 2019 (r346872) @@ -78,44 +78,52 @@ union aopen_entry { }; /* - * Holds the size, base address, free list start, etc of the TID, server TID, - * and active-open TID tables. The tables themselves are allocated dynamically. + * Holds the size, base address, start, end, etc. of various types of TIDs. The + * tables themselves are allocated dynamically. */ struct tid_info { - void **tid_tab; + u_int nstids; + u_int stid_base; + + u_int natids; + + u_int nftids; + u_int ftid_base; + u_int ftid_end; + u_int ntids; - u_int tids_in_use; + u_int netids; + u_int etid_base; + u_int etid_end; + struct mtx stid_lock __aligned(CACHE_LINE_SIZE); struct listen_ctx **stid_tab; - u_int nstids; - u_int stid_base; u_int stids_in_use; u_int nstids_free_head; /* # of available stids at the beginning */ struct stid_head stids; struct mtx atid_lock __aligned(CACHE_LINE_SIZE); union aopen_entry *atid_tab; - u_int natids; union aopen_entry *afree; u_int atids_in_use; struct mtx ftid_lock __aligned(CACHE_LINE_SIZE); struct cv ftid_cv; struct filter_entry *ftid_tab; - u_int nftids; - u_int ftid_base; u_int ftids_in_use; + /* + * hashfilter and TOE are mutually exclusive and both use ntids and + * tids_in_use. The lock and cv are used only by hashfilter. + */ struct mtx hftid_lock __aligned(CACHE_LINE_SIZE); struct cv hftid_cv; - void **hftid_tab; - /* ntids, tids_in_use */ - - struct mtx etid_lock __aligned(CACHE_LINE_SIZE); - struct etid_entry *etid_tab; - u_int netids; - u_int etid_base; + union { + void **hftid_tab; + void **tid_tab; + }; + u_int tids_in_use; }; struct t4_range { Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 03:10:58 2019 (r346871) +++ stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 03:31:20 2019 (r346872) @@ -3926,10 +3926,11 @@ get_params__post_init(struct adapter *sc) sc->sge.iq_start = val[0]; sc->sge.eq_start = val[1]; - sc->tids.ftid_base = val[2]; - sc->tids.nftids = val[3] - val[2] + 1; - sc->params.ftid_min = val[2]; - sc->params.ftid_max = val[3]; + if (val[3] > val[2]) { + sc->tids.ftid_base = val[2]; + sc->tids.ftid_end = val[3]; + sc->tids.nftids = val[3] - val[2] + 1; + } sc->vres.l2t.start = val[4]; sc->vres.l2t.size = val[5] - val[4] + 1; KASSERT(sc->vres.l2t.size <= L2T_SIZE, @@ -4013,12 +4014,13 @@ get_params__post_init(struct adapter *sc) "failed to query NIC parameters: %d.\n", rc); return (rc); } - sc->tids.etid_base = val[0]; - sc->params.etid_min = val[0]; - sc->params.etid_max = val[1]; - sc->tids.netids = val[1] - val[0] + 1; - sc->params.eo_wr_cred = val[2]; - sc->params.ethoffload = 1; + if (val[1] > val[0]) { + sc->tids.etid_base = val[0]; + sc->tids.etid_end = val[1]; + sc->tids.netids = val[1] - val[0] + 1; + sc->params.eo_wr_cred = val[2]; + sc->params.ethoffload = 1; + } } if (sc->toecaps) { /* query offload-related parameters */ @@ -4036,8 +4038,10 @@ get_params__post_init(struct adapter *sc) } sc->tids.ntids = val[0]; sc->tids.natids = min(sc->tids.ntids / 2, MAX_ATIDS); - sc->tids.stid_base = val[1]; - sc->tids.nstids = val[2] - val[1] + 1; + if (val[2] > val[1]) { + sc->tids.stid_base = val[1]; + sc->tids.nstids = val[2] - val[1] + 1; + } sc->vres.ddp.start = val[3]; sc->vres.ddp.size = val[4] - val[3] + 1; sc->params.ofldq_wr_cred = val[5]; From owner-svn-src-all@freebsd.org Mon Apr 29 03:50:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 542111592016; Mon, 29 Apr 2019 03:50:22 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EABB289676; Mon, 29 Apr 2019 03:50:21 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C52DD1C760; Mon, 29 Apr 2019 03:50:21 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T3oL6j077048; Mon, 29 Apr 2019 03:50:21 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T3oLXV077047; Mon, 29 Apr 2019 03:50:21 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201904290350.x3T3oLXV077047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 29 Apr 2019 03:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346873 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip X-SVN-Commit-Revision: 346873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EABB289676 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 03:50:22 -0000 Author: lwhsu Date: Mon Apr 29 03:50:21 2019 New Revision: 346873 URL: https://svnweb.freebsd.org/changeset/base/346873 Log: Add a trailing empty line to match the test code output This is added for letting these long failing test case pass, and for consistency. The test code should be fixed later to not output this extra empty line. Sponsored by: The FreeBSD Foundation Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh.out Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh.out ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh.out Mon Apr 29 03:31:20 2019 (r346872) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh.out Mon Apr 29 03:50:21 2019 (r346873) @@ -10,3 +10,4 @@ sctp:::state-change to established - yes sctp:::state-change to shutdown-sent - yes sctp:::state-change to shutdown-received - yes sctp:::state-change to shutdown-ack-sent - yes + From owner-svn-src-all@freebsd.org Mon Apr 29 03:52:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 555D81592241; Mon, 29 Apr 2019 03:52:05 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0187989A43; Mon, 29 Apr 2019 03:52:05 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B46B81C8DE; Mon, 29 Apr 2019 03:52:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T3q4Eu077890; Mon, 29 Apr 2019 03:52:04 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T3q3ri077885; Mon, 29 Apr 2019 03:52:03 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904290352.x3T3q3ri077885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 03:52:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346874 - in stable/11/sys/dev/cxgbe: . common tom X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys/dev/cxgbe: . common tom X-SVN-Commit-Revision: 346874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0187989A43 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 03:52:05 -0000 Author: np Date: Mon Apr 29 03:52:03 2019 New Revision: 346874 URL: https://svnweb.freebsd.org/changeset/base/346874 Log: MFC r337538, r337987 r337538: cxgbe(4): Add support for high priority filters on T6+. They have their own region in the TCAM starting with T6, unlike previous chips where they were in the same region as normal filters. These filters "hit" before anything else in the LE's lookup. The exact order is: a) High priority filters b) TOE's active region (TCAM and/or hash) c) Servers (TOE hw listeners) d) Normal filters Sponsored by: Chelsio Communications r337987: cxgbe(4): Adjust ntids to account for nhptids in the TOE case too. This should have been part of r337538. Modified: stable/11/sys/dev/cxgbe/common/common.h stable/11/sys/dev/cxgbe/offload.h stable/11/sys/dev/cxgbe/t4_filter.c stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/cxgbe/t4_sge.c stable/11/sys/dev/cxgbe/tom/t4_tom.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/11/sys/dev/cxgbe/common/common.h Mon Apr 29 03:50:21 2019 (r346873) +++ stable/11/sys/dev/cxgbe/common/common.h Mon Apr 29 03:52:03 2019 (r346874) @@ -442,6 +442,13 @@ static inline int is_ftid(const struct adapter *sc, u_ tid <= sc->tids.ftid_end); } +static inline int is_hpftid(const struct adapter *sc, u_int tid) +{ + + return (sc->tids.nhpftids > 0 && tid >= sc->tids.hpftid_base && + tid <= sc->tids.hpftid_end); +} + static inline int is_etid(const struct adapter *sc, u_int tid) { Modified: stable/11/sys/dev/cxgbe/offload.h ============================================================================== --- stable/11/sys/dev/cxgbe/offload.h Mon Apr 29 03:50:21 2019 (r346873) +++ stable/11/sys/dev/cxgbe/offload.h Mon Apr 29 03:52:03 2019 (r346874) @@ -91,7 +91,12 @@ struct tid_info { u_int ftid_base; u_int ftid_end; + u_int nhpftids; + u_int hpftid_base; + u_int hpftid_end; + u_int ntids; + u_int tid_base; u_int netids; u_int etid_base; @@ -108,10 +113,13 @@ struct tid_info { union aopen_entry *afree; u_int atids_in_use; + /* High priority filters and normal filters share the lock and cv. */ struct mtx ftid_lock __aligned(CACHE_LINE_SIZE); struct cv ftid_cv; struct filter_entry *ftid_tab; + struct filter_entry *hpftid_tab; u_int ftids_in_use; + u_int hpftids_in_use; /* * hashfilter and TOE are mutually exclusive and both use ntids and Modified: stable/11/sys/dev/cxgbe/t4_filter.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_filter.c Mon Apr 29 03:50:21 2019 (r346873) +++ stable/11/sys/dev/cxgbe/t4_filter.c Mon Apr 29 03:52:03 2019 (r346874) @@ -64,12 +64,20 @@ struct filter_entry { }; static void free_filter_resources(struct filter_entry *); +static int get_tcamfilter(struct adapter *, struct t4_filter *); static int get_hashfilter(struct adapter *, struct t4_filter *); static int set_hashfilter(struct adapter *, struct t4_filter *, uint64_t, struct l2t_entry *, struct smt_entry *); static int del_hashfilter(struct adapter *, struct t4_filter *); static int configure_hashfilter_tcb(struct adapter *, struct filter_entry *); +static inline bool +separate_hpfilter_region(struct adapter *sc) +{ + + return (chip_id(sc) >= CHELSIO_T6); +} + static int alloc_hftid_tab(struct tid_info *t, int flags) { @@ -302,7 +310,7 @@ set_filter_mode(struct adapter *sc, uint32_t mode) if (rc) return (rc); - if (sc->tids.ftids_in_use > 0) { + if (sc->tids.ftids_in_use > 0 || sc->tids.hpftids_in_use > 0) { rc = EBUSY; goto done; } @@ -343,39 +351,10 @@ get_filter_hits(struct adapter *sc, uint32_t tid) int get_filter(struct adapter *sc, struct t4_filter *t) { - int i, nfilters = sc->tids.nftids; - struct filter_entry *f; - if (t->fs.hash) return (get_hashfilter(sc, t)); - - if (sc->tids.ftids_in_use == 0 || sc->tids.ftid_tab == NULL || - t->idx >= nfilters) { - t->idx = 0xffffffff; - return (0); - } - - mtx_lock(&sc->tids.ftid_lock); - f = &sc->tids.ftid_tab[t->idx]; - for (i = t->idx; i < nfilters; i++, f++) { - if (f->valid) { - MPASS(f->tid == sc->tids.ftid_base + i); - t->idx = i; - t->l2tidx = f->l2te ? f->l2te->idx : 0; - t->smtidx = f->smt ? f->smt->idx : 0; - if (f->fs.hitcnts) - t->hits = get_filter_hits(sc, f->tid); - else - t->hits = UINT64_MAX; - t->fs = f->fs; - - goto done; - } - } - t->idx = 0xffffffff; -done: - mtx_unlock(&sc->tids.ftid_lock); - return (0); + else + return (get_tcamfilter(sc, t)); } static int @@ -387,15 +366,23 @@ set_tcamfilter(struct adapter *sc, struct t4_filter *t u_int vnic_vld, vnic_vld_mask; struct wrq_cookie cookie; int i, rc, busy, locked; + u_int tid; const int ntids = t->fs.type ? 4 : 1; MPASS(!t->fs.hash); - MPASS(t->idx < sc->tids.nftids); /* Already validated against fconf, iconf */ MPASS((t->fs.val.pfvf_vld & t->fs.val.ovlan_vld) == 0); MPASS((t->fs.mask.pfvf_vld & t->fs.mask.ovlan_vld) == 0); - f = &sc->tids.ftid_tab[t->idx]; + if (separate_hpfilter_region(sc) && t->fs.prio) { + MPASS(t->idx < sc->tids.nhpftids); + f = &sc->tids.hpftid_tab[t->idx]; + tid = sc->tids.hpftid_base + t->idx; + } else { + MPASS(t->idx < sc->tids.nftids); + f = &sc->tids.ftid_tab[t->idx]; + tid = sc->tids.ftid_base + t->idx; + } rc = busy = locked = 0; mtx_lock(&sc->tids.ftid_lock); for (i = 0; i < ntids; i++) { @@ -418,7 +405,10 @@ set_tcamfilter(struct adapter *sc, struct t4_filter *t rc = ENOMEM; else { f->pending = 1; - sc->tids.ftids_in_use++; + if (separate_hpfilter_region(sc) && t->fs.prio) + sc->tids.hpftids_in_use++; + else + sc->tids.ftids_in_use++; } } mtx_unlock(&sc->tids.ftid_lock); @@ -434,7 +424,7 @@ set_tcamfilter(struct adapter *sc, struct t4_filter *t * Can't fail now. A set-filter WR will definitely be sent. */ - f->tid = sc->tids.ftid_base + t->idx; + f->tid = tid; f->fs = t->fs; f->l2te = l2te; f->smt = smt; @@ -649,10 +639,17 @@ set_filter(struct adapter *sc, struct t4_filter *t) if (rc != 0) return (rc); } else { - if (ti->nftids == 0) - return (ENOTSUP); - if (t->idx >= ti->nftids) - return (EINVAL); + if (separate_hpfilter_region(sc) && t->fs.prio) { + if (ti->nhpftids == 0) + return (ENOTSUP); + if (t->idx >= ti->nhpftids) + return (EINVAL); + } else { + if (ti->nftids == 0) + return (ENOTSUP); + if (t->idx >= ti->nftids) + return (EINVAL); + } /* IPv6 filter idx must be 4 aligned */ if (t->fs.type == 1 && ((t->idx & 0x3) || t->idx + 4 >= ti->nftids)) @@ -702,17 +699,37 @@ set_filter(struct adapter *sc, struct t4_filter *t) if (rc != 0) goto done; } + } else if (separate_hpfilter_region(sc) && t->fs.prio && + __predict_false(ti->hpftid_tab == NULL)) { + MPASS(ti->nhpftids != 0); + KASSERT(ti->hpftids_in_use == 0, + ("%s: no memory allocated but hpftids_in_use is %u", + __func__, ti->hpftids_in_use)); + ti->hpftid_tab = malloc(sizeof(struct filter_entry) * + ti->nhpftids, M_CXGBE, M_NOWAIT | M_ZERO); + if (ti->hpftid_tab == NULL) { + rc = ENOMEM; + goto done; + } + if (!mtx_initialized(&sc->tids.ftid_lock)) { + mtx_init(&ti->ftid_lock, "T4 filters", 0, MTX_DEF); + cv_init(&ti->ftid_cv, "t4fcv"); + } } else if (__predict_false(ti->ftid_tab == NULL)) { + MPASS(ti->nftids != 0); KASSERT(ti->ftids_in_use == 0, - ("%s: no memory allocated but ftids_in_use > 0", __func__)); + ("%s: no memory allocated but ftids_in_use is %u", + __func__, ti->ftids_in_use)); ti->ftid_tab = malloc(sizeof(struct filter_entry) * ti->nftids, M_CXGBE, M_NOWAIT | M_ZERO); if (ti->ftid_tab == NULL) { rc = ENOMEM; goto done; } - mtx_init(&ti->ftid_lock, "T4 filters", 0, MTX_DEF); - cv_init(&ti->ftid_cv, "t4fcv"); + if (!mtx_initialized(&sc->tids.ftid_lock)) { + mtx_init(&ti->ftid_lock, "T4 filters", 0, MTX_DEF); + cv_init(&ti->ftid_cv, "t4fcv"); + } } done: end_synchronized_op(sc, 0); @@ -768,16 +785,32 @@ del_tcamfilter(struct adapter *sc, struct t4_filter *t struct filter_entry *f; struct fw_filter_wr *fwr; struct wrq_cookie cookie; - int rc; + int rc, nfilters; +#ifdef INVARIANTS + u_int tid_base; +#endif - MPASS(sc->tids.ftid_tab != NULL); - MPASS(sc->tids.nftids > 0); - - if (t->idx >= sc->tids.nftids) - return (EINVAL); - mtx_lock(&sc->tids.ftid_lock); - f = &sc->tids.ftid_tab[t->idx]; + if (separate_hpfilter_region(sc) && t->fs.prio) { + nfilters = sc->tids.nhpftids; + f = sc->tids.hpftid_tab; +#ifdef INVARIANTS + tid_base = sc->tids.hpftid_base; +#endif + } else { + nfilters = sc->tids.nftids; + f = sc->tids.ftid_tab; +#ifdef INVARIANTS + tid_base = sc->tids.ftid_base; +#endif + } + MPASS(f != NULL); /* Caller checked this. */ + if (t->idx >= nfilters) { + rc = EINVAL; + goto done; + } + f += t->idx; + if (f->locked) { rc = EPERM; goto done; @@ -790,7 +823,7 @@ del_tcamfilter(struct adapter *sc, struct t4_filter *t rc = EINVAL; goto done; } - MPASS(f->tid == sc->tids.ftid_base + t->idx); + MPASS(f->tid == tid_base + t->idx); fwr = start_wrq_wr(&sc->sge.mgmtq, howmany(sizeof(*fwr), 16), &cookie); if (fwr == NULL) { rc = ENOMEM; @@ -833,6 +866,9 @@ del_filter(struct adapter *sc, struct t4_filter *t) if (t->fs.hash) { if (sc->tids.hftid_tab != NULL) return (del_hashfilter(sc, t)); + } else if (separate_hpfilter_region(sc) && t->fs.prio) { + if (sc->tids.hpftid_tab != NULL) + return (del_tcamfilter(sc, t)); } else { if (sc->tids.ftid_tab != NULL) return (del_tcamfilter(sc, t)); @@ -899,21 +935,28 @@ t4_filter_rpl(struct sge_iq *iq, const struct rss_head struct adapter *sc = iq->adapter; const struct cpl_set_tcb_rpl *rpl = (const void *)(rss + 1); u_int tid = GET_TID(rpl); - u_int rc, cleanup, idx; + u_int rc, idx; struct filter_entry *f; KASSERT(m == NULL, ("%s: payload with opcode %02x", __func__, rss->opcode)); - MPASS(is_ftid(sc, tid)); - cleanup = 0; - idx = tid - sc->tids.ftid_base; - f = &sc->tids.ftid_tab[idx]; + + if (is_hpftid(sc, tid)) { + idx = tid - sc->tids.hpftid_base; + f = &sc->tids.hpftid_tab[idx]; + } else if (is_ftid(sc, tid)) { + idx = tid - sc->tids.ftid_base; + f = &sc->tids.ftid_tab[idx]; + } else + panic("%s: FW reply for invalid TID %d.", __func__, tid); + + MPASS(f->tid == tid); rc = G_COOKIE(rpl->cookie); mtx_lock(&sc->tids.ftid_lock); KASSERT(f->pending, ("%s: reply %d for filter[%u] that isn't pending.", - __func__, rc, idx)); + __func__, rc, tid)); switch(rc) { case FW_FILTER_WR_FLT_ADDED: /* set-filter succeeded */ @@ -936,7 +979,10 @@ t4_filter_rpl(struct sge_iq *iq, const struct rss_head /* set-filter failed due to lack of SMT space. */ MPASS(f->valid == 0); free_filter_resources(f); - sc->tids.ftids_in_use--; + if (separate_hpfilter_region(sc) && f->fs.prio) + sc->tids.hpftids_in_use--; + else + sc->tids.ftids_in_use--; break; case FW_FILTER_WR_SUCCESS: case FW_FILTER_WR_EINVAL: @@ -1077,10 +1123,68 @@ t4_del_hashfilter_rpl(struct sge_iq *iq, const struct } static int +get_tcamfilter(struct adapter *sc, struct t4_filter *t) +{ + int i, nfilters; + struct filter_entry *f; + u_int in_use; +#ifdef INVARIANTS + u_int tid_base; +#endif + + MPASS(!t->fs.hash); + + if (separate_hpfilter_region(sc) && t->fs.prio) { + nfilters = sc->tids.nhpftids; + f = sc->tids.hpftid_tab; + in_use = sc->tids.hpftids_in_use; +#ifdef INVARIANTS + tid_base = sc->tids.hpftid_base; +#endif + } else { + nfilters = sc->tids.nftids; + f = sc->tids.ftid_tab; + in_use = sc->tids.ftids_in_use; +#ifdef INVARIANTS + tid_base = sc->tids.ftid_base; +#endif + } + + if (in_use == 0 || f == NULL || t->idx >= nfilters) { + t->idx = 0xffffffff; + return (0); + } + + f += t->idx; + mtx_lock(&sc->tids.ftid_lock); + for (i = t->idx; i < nfilters; i++, f++) { + if (f->valid) { + MPASS(f->tid == tid_base + i); + t->idx = i; + t->l2tidx = f->l2te ? f->l2te->idx : 0; + t->smtidx = f->smt ? f->smt->idx : 0; + if (f->fs.hitcnts) + t->hits = get_filter_hits(sc, f->tid); + else + t->hits = UINT64_MAX; + t->fs = f->fs; + + goto done; + } + } + t->idx = 0xffffffff; +done: + mtx_unlock(&sc->tids.ftid_lock); + return (0); +} + +static int get_hashfilter(struct adapter *sc, struct t4_filter *t) { int i, nfilters = sc->tids.ntids; struct filter_entry *f; + + MPASS(t->fs.hash); if (sc->tids.tids_in_use == 0 || sc->tids.hftid_tab == NULL || t->idx >= nfilters) { Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 03:50:21 2019 (r346873) +++ stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 03:52:03 2019 (r346874) @@ -1510,6 +1510,7 @@ t4_detach_common(device_t dev) free(sc->sge.iqmap, M_CXGBE); free(sc->sge.eqmap, M_CXGBE); free(sc->tids.ftid_tab, M_CXGBE); + free(sc->tids.hpftid_tab, M_CXGBE); if (sc->tids.hftid_tab) free_hftid_tab(&sc->tids); free(sc->tids.atid_tab, M_CXGBE); @@ -3938,6 +3939,47 @@ get_params__post_init(struct adapter *sc) __func__, sc->vres.l2t.size, L2T_SIZE)); sc->params.core_vdd = val[6]; + if (chip_id(sc) >= CHELSIO_T6) { + +#ifdef INVARIANTS + if (sc->params.fw_vers >= + (V_FW_HDR_FW_VER_MAJOR(1) | V_FW_HDR_FW_VER_MINOR(20) | + V_FW_HDR_FW_VER_MICRO(1) | V_FW_HDR_FW_VER_BUILD(0))) { + /* + * Note that the code to enable the region should run + * before t4_fw_initialize and not here. This is just a + * reminder to add said code. + */ + device_printf(sc->dev, + "hpfilter region not enabled.\n"); + } +#endif + + sc->tids.tid_base = t4_read_reg(sc, + A_LE_DB_ACTIVE_TABLE_START_INDEX); + + param[0] = FW_PARAM_PFVF(HPFILTER_START); + param[1] = FW_PARAM_PFVF(HPFILTER_END); + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 2, param, val); + if (rc != 0) { + device_printf(sc->dev, + "failed to query hpfilter parameters: %d.\n", rc); + return (rc); + } + if ((int)val[1] > (int)val[0]) { + sc->tids.hpftid_base = val[0]; + sc->tids.hpftid_end = val[1]; + sc->tids.nhpftids = val[1] - val[0] + 1; + + /* + * These should go off if the layout changes and the + * driver needs to catch up. + */ + MPASS(sc->tids.hpftid_base == 0); + MPASS(sc->tids.tid_base == sc->tids.nhpftids); + } + } + /* * MPSBGMAP is queried separately because only recent firmwares support * it as a parameter and we don't want the compound query above to fail @@ -4001,6 +4043,12 @@ get_params__post_init(struct adapter *sc) return (rc); } sc->tids.ntids = val[0]; + if (sc->params.fw_vers < + (V_FW_HDR_FW_VER_MAJOR(1) | V_FW_HDR_FW_VER_MINOR(20) | + V_FW_HDR_FW_VER_MICRO(5) | V_FW_HDR_FW_VER_BUILD(0))) { + MPASS(sc->tids.ntids >= sc->tids.nhpftids); + sc->tids.ntids -= sc->tids.nhpftids; + } sc->tids.natids = min(sc->tids.ntids / 2, MAX_ATIDS); sc->params.hash_filter = 1; } @@ -4037,6 +4085,12 @@ get_params__post_init(struct adapter *sc) return (rc); } sc->tids.ntids = val[0]; + if (sc->params.fw_vers < + (V_FW_HDR_FW_VER_MAJOR(1) | V_FW_HDR_FW_VER_MINOR(20) | + V_FW_HDR_FW_VER_MICRO(5) | V_FW_HDR_FW_VER_BUILD(0))) { + MPASS(sc->tids.ntids >= sc->tids.nhpftids); + sc->tids.ntids -= sc->tids.nhpftids; + } sc->tids.natids = min(sc->tids.ntids / 2, MAX_ATIDS); if (val[2] > val[1]) { sc->tids.stid_base = val[1]; @@ -8329,6 +8383,11 @@ sysctl_tids(SYSCTL_HANDLER_ARGS) t->atids_in_use); } + if (t->nhpftids) { + sbuf_printf(sb, "HPFTID range: %u-%u, in use: %u\n", + t->hpftid_base, t->hpftid_end, t->hpftids_in_use); + } + if (t->ntids) { sbuf_printf(sb, "TID range: "); if (t4_read_reg(sc, A_LE_DB_CONFIG) & F_HASHEN) { @@ -8343,10 +8402,10 @@ sysctl_tids(SYSCTL_HANDLER_ARGS) } if (b) - sbuf_printf(sb, "0-%u, ", b - 1); + sbuf_printf(sb, "%u-%u, ", t->tid_base, b - 1); sbuf_printf(sb, "%u-%u", hb, t->ntids - 1); } else - sbuf_printf(sb, "0-%u", t->ntids - 1); + sbuf_printf(sb, "%u-%u", t->tid_base, t->ntids - 1); sbuf_printf(sb, ", in use: %u\n", atomic_load_acq_int(&t->tids_in_use)); } @@ -8357,8 +8416,8 @@ sysctl_tids(SYSCTL_HANDLER_ARGS) } if (t->nftids) { - sbuf_printf(sb, "FTID range: %u-%u\n", t->ftid_base, - t->ftid_base + t->nftids - 1); + sbuf_printf(sb, "FTID range: %u-%u, in use: %u\n", t->ftid_base, + t->ftid_end, t->ftids_in_use); } if (t->netids) { Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 03:50:21 2019 (r346873) +++ stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 03:52:03 2019 (r346874) @@ -354,7 +354,7 @@ set_tcb_rpl_handler(struct sge_iq *iq, const struct rs MPASS(m == NULL); tid = GET_TID(cpl); - if (is_ftid(iq->adapter, tid)) { + if (is_hpftid(iq->adapter, tid) || is_ftid(iq->adapter, tid)) { /* * The return code for filter-write is put in the CPL cookie so * we have to rely on the hardware tid (is_ftid) to determine Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.c Mon Apr 29 03:50:21 2019 (r346873) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.c Mon Apr 29 03:52:03 2019 (r346874) @@ -507,7 +507,10 @@ insert_tid(struct adapter *sc, int tid, void *ctx, int { struct tid_info *t = &sc->tids; - t->tid_tab[tid] = ctx; + MPASS(tid >= t->tid_base); + MPASS(tid - t->tid_base < t->ntids); + + t->tid_tab[tid - t->tid_base] = ctx; atomic_add_int(&t->tids_in_use, ntids); } @@ -516,7 +519,7 @@ lookup_tid(struct adapter *sc, int tid) { struct tid_info *t = &sc->tids; - return (t->tid_tab[tid]); + return (t->tid_tab[tid - t->tid_base]); } void @@ -524,7 +527,7 @@ update_tid(struct adapter *sc, int tid, void *ctx) { struct tid_info *t = &sc->tids; - t->tid_tab[tid] = ctx; + t->tid_tab[tid - t->tid_base] = ctx; } void @@ -532,7 +535,7 @@ remove_tid(struct adapter *sc, int tid, int ntids) { struct tid_info *t = &sc->tids; - t->tid_tab[tid] = NULL; + t->tid_tab[tid - t->tid_base] = NULL; atomic_subtract_int(&t->tids_in_use, ntids); } From owner-svn-src-all@freebsd.org Mon Apr 29 04:31:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2EEF1592C15; Mon, 29 Apr 2019 04:31:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5558C8A974; Mon, 29 Apr 2019 04:31:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14ED41CF72; Mon, 29 Apr 2019 04:31:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T4VSEW099290; Mon, 29 Apr 2019 04:31:28 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T4VRhp099286; Mon, 29 Apr 2019 04:31:27 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904290431.x3T4VRhp099286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 04:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346875 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346875 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5558C8A974 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 04:31:29 -0000 Author: np Date: Mon Apr 29 04:31:27 2019 New Revision: 346875 URL: https://svnweb.freebsd.org/changeset/base/346875 Log: MFC r337609: cxgbe(4): Create two variants of service_iq, one for queues with freelists and one for those without. MFH: 3 weeks Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/cxgbe/t4_netmap.c stable/11/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 03:52:03 2019 (r346874) +++ stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 04:31:27 2019 (r346875) @@ -670,6 +670,7 @@ struct sge_wrq { struct sge_nm_rxq { + volatile int nm_state; /* NM_OFF, NM_ON, or NM_BUSY */ struct vi_info *vi; struct iq_desc *iq_desc; @@ -795,7 +796,6 @@ struct adapter { struct irq { struct resource *res; int rid; - volatile int nm_state; /* NM_OFF, NM_ON, or NM_BUSY */ void *tag; struct sge_rxq *rxq; struct sge_nm_rxq *nm_rxq; @@ -1139,9 +1139,10 @@ void release_tid(struct adapter *, int, struct sge_wrq #ifdef DEV_NETMAP /* t4_netmap.c */ +struct sge_nm_rxq; void cxgbe_nm_attach(struct vi_info *); void cxgbe_nm_detach(struct vi_info *); -void t4_nm_intr(void *); +void service_nm_rxq(struct sge_nm_rxq *); #endif /* t4_sge.c */ @@ -1160,7 +1161,10 @@ int t4_setup_vi_queues(struct vi_info *); int t4_teardown_vi_queues(struct vi_info *); void t4_intr_all(void *); void t4_intr(void *); +#ifdef DEV_NETMAP +void t4_nm_intr(void *); void t4_vi_intr(void *); +#endif void t4_intr_err(void *); void t4_intr_evt(void *); void t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, struct wrqe *); Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 03:52:03 2019 (r346874) +++ stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 04:31:27 2019 (r346875) @@ -761,8 +761,8 @@ struct { #ifdef TCP_OFFLOAD /* - * service_iq() has an iq and needs the fl. Offset of fl from the iq should be - * exactly the same for both rxq and ofld_rxq. + * service_iq_fl() has an iq and needs the fl. Offset of fl from the iq should + * be exactly the same for both rxq and ofld_rxq. */ CTASSERT(offsetof(struct sge_ofld_rxq, iq) == offsetof(struct sge_rxq, iq)); CTASSERT(offsetof(struct sge_ofld_rxq, fl) == offsetof(struct sge_rxq, fl)); @@ -5004,9 +5004,26 @@ t4_setup_intr_handlers(struct adapter *sc) #ifdef DEV_NETMAP if (q < vi->nnmrxq) irq->nm_rxq = nm_rxq++; + + if (irq->nm_rxq != NULL && + irq->rxq == NULL) { + /* Netmap rx only */ + rc = t4_alloc_irq(sc, irq, rid, + t4_nm_intr, irq->nm_rxq, s); + } + if (irq->nm_rxq != NULL && + irq->rxq != NULL) { + /* NIC and Netmap rx */ + rc = t4_alloc_irq(sc, irq, rid, + t4_vi_intr, irq, s); + } #endif - rc = t4_alloc_irq(sc, irq, rid, - t4_vi_intr, irq, s); + if (irq->rxq != NULL && + irq->nm_rxq == NULL) { + /* NIC rx only */ + rc = t4_alloc_irq(sc, irq, rid, + t4_intr, irq->rxq, s); + } if (rc != 0) return (rc); #ifdef RSS Modified: stable/11/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_netmap.c Mon Apr 29 03:52:03 2019 (r346874) +++ stable/11/sys/dev/cxgbe/t4_netmap.c Mon Apr 29 04:31:27 2019 (r346875) @@ -339,8 +339,6 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi nm_set_native_flags(na); for_each_nm_rxq(vi, i, nm_rxq) { - struct irq *irq = &sc->irq[vi->first_intr + i]; - alloc_nm_rxq_hwq(vi, nm_rxq, tnl_cong(vi->pi, nm_cong_drop)); nm_rxq->fl_hwidx = hwidx; slot = netmap_reset(na, NR_RX, i, 0); @@ -363,7 +361,7 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi t4_write_reg(sc, sc->sge_kdoorbell_reg, nm_rxq->fl_db_val | V_PIDX(j)); - atomic_cmpset_int(&irq->nm_state, NM_OFF, NM_ON); + atomic_cmpset_int(&nm_rxq->nm_state, NM_OFF, NM_ON); } for_each_nm_txq(vi, i, nm_txq) { @@ -424,9 +422,7 @@ cxgbe_netmap_off(struct adapter *sc, struct vi_info *v free_nm_txq_hwq(vi, nm_txq); } for_each_nm_rxq(vi, i, nm_rxq) { - struct irq *irq = &sc->irq[vi->first_intr + i]; - - while (!atomic_cmpset_int(&irq->nm_state, NM_ON, NM_OFF)) + while (!atomic_cmpset_int(&nm_rxq->nm_state, NM_ON, NM_OFF)) pause("nmst", 1); free_nm_rxq_hwq(vi, nm_rxq); @@ -902,9 +898,8 @@ handle_nm_sge_egr_update(struct adapter *sc, struct if } void -t4_nm_intr(void *arg) +service_nm_rxq(struct sge_nm_rxq *nm_rxq) { - struct sge_nm_rxq *nm_rxq = arg; struct vi_info *vi = nm_rxq->vi; struct adapter *sc = vi->pi->adapter; struct ifnet *ifp = vi->ifp; Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 03:52:03 2019 (r346874) +++ stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 04:31:27 2019 (r346875) @@ -196,6 +196,7 @@ struct sgl { }; static int service_iq(struct sge_iq *, int); +static int service_iq_fl(struct sge_iq *, int); static struct mbuf *get_fl_payload(struct adapter *, struct sge_fl *, uint32_t); static int t4_eth_rx(struct sge_iq *, const struct rss_header *, struct mbuf *); static inline void init_iq(struct sge_iq *, struct adapter *, int, int, int); @@ -1297,8 +1298,12 @@ t4_teardown_vi_queues(struct vi_info *vi) } /* - * Deals with errors and the firmware event queue. All data rx queues forward - * their interrupt to the firmware event queue. + * Interrupt handler when the driver is using only 1 interrupt. This is a very + * unusual scenario. + * + * a) Deals with errors, if any. + * b) Services firmware event queue, which is taking interrupts for all other + * queues. */ void t4_intr_all(void *arg) @@ -1306,14 +1311,16 @@ t4_intr_all(void *arg) struct adapter *sc = arg; struct sge_iq *fwq = &sc->sge.fwq; + MPASS(sc->intr_count == 1); + t4_intr_err(arg); - if (atomic_cmpset_int(&fwq->state, IQS_IDLE, IQS_BUSY)) { - service_iq(fwq, 0); - atomic_cmpset_int(&fwq->state, IQS_BUSY, IQS_IDLE); - } + t4_intr_evt(fwq); } -/* Deals with error interrupts */ +/* + * Interrupt handler for errors (installed directly when multiple interrupts are + * being used, or called by t4_intr_all). + */ void t4_intr_err(void *arg) { @@ -1323,6 +1330,10 @@ t4_intr_err(void *arg) t4_slow_intr_handler(sc); } +/* + * Interrupt handler for iq-only queues. The firmware event queue is the only + * such queue right now. + */ void t4_intr_evt(void *arg) { @@ -1334,90 +1345,74 @@ t4_intr_evt(void *arg) } } +/* + * Interrupt handler for iq+fl queues. + */ void t4_intr(void *arg) { struct sge_iq *iq = arg; if (atomic_cmpset_int(&iq->state, IQS_IDLE, IQS_BUSY)) { - service_iq(iq, 0); + service_iq_fl(iq, 0); atomic_cmpset_int(&iq->state, IQS_BUSY, IQS_IDLE); } } +#ifdef DEV_NETMAP +/* + * Interrupt handler for netmap rx queues. + */ void -t4_vi_intr(void *arg) +t4_nm_intr(void *arg) { - struct irq *irq = arg; + struct sge_nm_rxq *nm_rxq = arg; -#ifdef DEV_NETMAP - if (atomic_cmpset_int(&irq->nm_state, NM_ON, NM_BUSY)) { - t4_nm_intr(irq->nm_rxq); - atomic_cmpset_int(&irq->nm_state, NM_BUSY, NM_ON); + if (atomic_cmpset_int(&nm_rxq->nm_state, NM_ON, NM_BUSY)) { + service_nm_rxq(nm_rxq); + atomic_cmpset_int(&nm_rxq->nm_state, NM_BUSY, NM_ON); } -#endif - if (irq->rxq != NULL) - t4_intr(irq->rxq); } -static inline int -sort_before_lro(struct lro_ctrl *lro) +/* + * Interrupt handler for vectors shared between NIC and netmap rx queues. + */ +void +t4_vi_intr(void *arg) { + struct irq *irq = arg; - return (lro->lro_mbuf_max != 0); + MPASS(irq->nm_rxq != NULL); + t4_nm_intr(irq->nm_rxq); + + MPASS(irq->rxq != NULL); + t4_intr(irq->rxq); } +#endif /* - * Deals with anything and everything on the given ingress queue. + * Deals with interrupts on an iq-only (no freelist) queue. */ static int service_iq(struct sge_iq *iq, int budget) { struct sge_iq *q; - struct sge_rxq *rxq = iq_to_rxq(iq); /* Use iff iq is part of rxq */ - struct sge_fl *fl; /* Use iff IQ_HAS_FL */ struct adapter *sc = iq->adapter; struct iq_desc *d = &iq->desc[iq->cidx]; int ndescs = 0, limit; - int rsp_type, refill; + int rsp_type; uint32_t lq; - uint16_t fl_hw_cidx; - struct mbuf *m0; STAILQ_HEAD(, sge_iq) iql = STAILQ_HEAD_INITIALIZER(iql); -#if defined(INET) || defined(INET6) - const struct timeval lro_timeout = {0, sc->lro_timeout}; - struct lro_ctrl *lro = &rxq->lro; -#endif KASSERT(iq->state == IQS_BUSY, ("%s: iq %p not BUSY", __func__, iq)); + KASSERT((iq->flags & IQ_HAS_FL) == 0, + ("%s: called for iq %p with fl (iq->flags 0x%x)", __func__, iq, + iq->flags)); + MPASS((iq->flags & IQ_ADJ_CREDIT) == 0); + MPASS((iq->flags & IQ_LRO_ENABLED) == 0); limit = budget ? budget : iq->qsize / 16; - if (iq->flags & IQ_HAS_FL) { - fl = &rxq->fl; - fl_hw_cidx = fl->hw_cidx; /* stable snapshot */ - } else { - fl = NULL; - fl_hw_cidx = 0; /* to silence gcc warning */ - } - -#if defined(INET) || defined(INET6) - if (iq->flags & IQ_ADJ_CREDIT) { - MPASS(sort_before_lro(lro)); - iq->flags &= ~IQ_ADJ_CREDIT; - if ((d->rsp.u.type_gen & F_RSPD_GEN) != iq->gen) { - tcp_lro_flush_all(lro); - t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(1) | - V_INGRESSQID((u32)iq->cntxt_id) | - V_SEINTARM(iq->intr_params)); - return (0); - } - ndescs = 1; - } -#else - MPASS((iq->flags & IQ_ADJ_CREDIT) == 0); -#endif - /* * We always come back and check the descriptor ring for new indirect * interrupts and other responses after running a single handler. @@ -1427,74 +1422,40 @@ service_iq(struct sge_iq *iq, int budget) rmb(); - refill = 0; - m0 = NULL; rsp_type = G_RSPD_TYPE(d->rsp.u.type_gen); lq = be32toh(d->rsp.pldbuflen_qid); switch (rsp_type) { case X_RSPD_TYPE_FLBUF: + panic("%s: data for an iq (%p) with no freelist", + __func__, iq); - KASSERT(iq->flags & IQ_HAS_FL, - ("%s: data for an iq (%p) with no freelist", - __func__, iq)); + /* NOTREACHED */ - m0 = get_fl_payload(sc, fl, lq); - if (__predict_false(m0 == NULL)) - goto process_iql; - refill = IDXDIFF(fl->hw_cidx, fl_hw_cidx, fl->sidx) > 2; -#ifdef T4_PKT_TIMESTAMP - /* - * 60 bit timestamp for the payload is - * *(uint64_t *)m0->m_pktdat. Note that it is - * in the leading free-space in the mbuf. The - * kernel can clobber it during a pullup, - * m_copymdata, etc. You need to make sure that - * the mbuf reaches you unmolested if you care - * about the timestamp. - */ - *(uint64_t *)m0->m_pktdat = - be64toh(ctrl->u.last_flit) & - 0xfffffffffffffff; -#endif - - /* fall through */ - case X_RSPD_TYPE_CPL: KASSERT(d->rss.opcode < NUM_CPL_CMDS, ("%s: bad opcode %02x.", __func__, d->rss.opcode)); - t4_cpl_handler[d->rss.opcode](iq, &d->rss, m0); + t4_cpl_handler[d->rss.opcode](iq, &d->rss, NULL); break; case X_RSPD_TYPE_INTR: - /* - * Interrupts should be forwarded only to queues - * that are not forwarding their interrupts. - * This means service_iq can recurse but only 1 - * level deep. - */ - KASSERT(budget == 0, - ("%s: budget %u, rsp_type %u", __func__, - budget, rsp_type)); - - /* * There are 1K interrupt-capable queues (qids 0 * through 1023). A response type indicating a * forwarded interrupt with a qid >= 1K is an * iWARP async notification. */ - if (lq >= 1024) { - t4_an_handler(iq, &d->rsp); - break; - } + if (__predict_true(lq >= 1024)) { + t4_an_handler(iq, &d->rsp); + break; + } q = sc->sge.iqmap[lq - sc->sge.iq_start - sc->sge.iq_base]; if (atomic_cmpset_int(&q->state, IQS_IDLE, IQS_BUSY)) { - if (service_iq(q, q->qsize / 16) == 0) { + if (service_iq_fl(q, q->qsize / 16) == 0) { atomic_cmpset_int(&q->state, IQS_BUSY, IQS_IDLE); } else { @@ -1527,33 +1488,12 @@ service_iq(struct sge_iq *iq, int budget) V_SEINTARM(V_QINTR_TIMER_IDX(X_TIMERREG_UPDATE_CIDX))); ndescs = 0; -#if defined(INET) || defined(INET6) - if (iq->flags & IQ_LRO_ENABLED && - !sort_before_lro(lro) && - sc->lro_timeout != 0) { - tcp_lro_flush_inactive(lro, - &lro_timeout); - } -#endif - if (budget) { - if (iq->flags & IQ_HAS_FL) { - FL_LOCK(fl); - refill_fl(sc, fl, 32); - FL_UNLOCK(fl); - } return (EINPROGRESS); } } - if (refill) { - FL_LOCK(fl); - refill_fl(sc, fl, 32); - FL_UNLOCK(fl); - fl_hw_cidx = fl->hw_cidx; - } } -process_iql: if (STAILQ_EMPTY(&iql)) break; @@ -1563,13 +1503,168 @@ process_iql: */ q = STAILQ_FIRST(&iql); STAILQ_REMOVE_HEAD(&iql, link); - if (service_iq(q, q->qsize / 8) == 0) + if (service_iq_fl(q, q->qsize / 8) == 0) atomic_cmpset_int(&q->state, IQS_BUSY, IQS_IDLE); else STAILQ_INSERT_TAIL(&iql, q, link); } + t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(ndescs) | + V_INGRESSQID((u32)iq->cntxt_id) | V_SEINTARM(iq->intr_params)); + + return (0); +} + +static inline int +sort_before_lro(struct lro_ctrl *lro) +{ + + return (lro->lro_mbuf_max != 0); +} + +/* + * Deals with interrupts on an iq+fl queue. + */ +static int +service_iq_fl(struct sge_iq *iq, int budget) +{ + struct sge_rxq *rxq = iq_to_rxq(iq); + struct sge_fl *fl; + struct adapter *sc = iq->adapter; + struct iq_desc *d = &iq->desc[iq->cidx]; + int ndescs = 0, limit; + int rsp_type, refill, starved; + uint32_t lq; + uint16_t fl_hw_cidx; + struct mbuf *m0; #if defined(INET) || defined(INET6) + const struct timeval lro_timeout = {0, sc->lro_timeout}; + struct lro_ctrl *lro = &rxq->lro; +#endif + + KASSERT(iq->state == IQS_BUSY, ("%s: iq %p not BUSY", __func__, iq)); + MPASS(iq->flags & IQ_HAS_FL); + + limit = budget ? budget : iq->qsize / 16; + fl = &rxq->fl; + fl_hw_cidx = fl->hw_cidx; /* stable snapshot */ + +#if defined(INET) || defined(INET6) + if (iq->flags & IQ_ADJ_CREDIT) { + MPASS(sort_before_lro(lro)); + iq->flags &= ~IQ_ADJ_CREDIT; + if ((d->rsp.u.type_gen & F_RSPD_GEN) != iq->gen) { + tcp_lro_flush_all(lro); + t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(1) | + V_INGRESSQID((u32)iq->cntxt_id) | + V_SEINTARM(iq->intr_params)); + return (0); + } + ndescs = 1; + } +#else + MPASS((iq->flags & IQ_ADJ_CREDIT) == 0); +#endif + + while ((d->rsp.u.type_gen & F_RSPD_GEN) == iq->gen) { + + rmb(); + + refill = 0; + m0 = NULL; + rsp_type = G_RSPD_TYPE(d->rsp.u.type_gen); + lq = be32toh(d->rsp.pldbuflen_qid); + + switch (rsp_type) { + case X_RSPD_TYPE_FLBUF: + + m0 = get_fl_payload(sc, fl, lq); + if (__predict_false(m0 == NULL)) + goto out; + refill = IDXDIFF(fl->hw_cidx, fl_hw_cidx, fl->sidx) > 2; +#ifdef T4_PKT_TIMESTAMP + /* + * 60 bit timestamp for the payload is + * *(uint64_t *)m0->m_pktdat. Note that it is + * in the leading free-space in the mbuf. The + * kernel can clobber it during a pullup, + * m_copymdata, etc. You need to make sure that + * the mbuf reaches you unmolested if you care + * about the timestamp. + */ + *(uint64_t *)m0->m_pktdat = + be64toh(ctrl->u.last_flit) & 0xfffffffffffffff; +#endif + + /* fall through */ + + case X_RSPD_TYPE_CPL: + KASSERT(d->rss.opcode < NUM_CPL_CMDS, + ("%s: bad opcode %02x.", __func__, d->rss.opcode)); + t4_cpl_handler[d->rss.opcode](iq, &d->rss, m0); + break; + + case X_RSPD_TYPE_INTR: + + /* + * There are 1K interrupt-capable queues (qids 0 + * through 1023). A response type indicating a + * forwarded interrupt with a qid >= 1K is an + * iWARP async notification. That is the only + * acceptable indirect interrupt on this queue. + */ + if (__predict_false(lq < 1024)) { + panic("%s: indirect interrupt on iq_fl %p " + "with qid %u", __func__, iq, lq); + } + + t4_an_handler(iq, &d->rsp); + break; + + default: + KASSERT(0, ("%s: illegal response type %d on iq %p", + __func__, rsp_type, iq)); + log(LOG_ERR, "%s: illegal response type %d on iq %p", + device_get_nameunit(sc->dev), rsp_type, iq); + break; + } + + d++; + if (__predict_false(++iq->cidx == iq->sidx)) { + iq->cidx = 0; + iq->gen ^= F_RSPD_GEN; + d = &iq->desc[0]; + } + if (__predict_false(++ndescs == limit)) { + t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(ndescs) | + V_INGRESSQID(iq->cntxt_id) | + V_SEINTARM(V_QINTR_TIMER_IDX(X_TIMERREG_UPDATE_CIDX))); + ndescs = 0; + +#if defined(INET) || defined(INET6) + if (iq->flags & IQ_LRO_ENABLED && + !sort_before_lro(lro) && + sc->lro_timeout != 0) { + tcp_lro_flush_inactive(lro, &lro_timeout); + } +#endif + if (budget) { + FL_LOCK(fl); + refill_fl(sc, fl, 32); + FL_UNLOCK(fl); + + return (EINPROGRESS); + } + } + if (refill) { + FL_LOCK(fl); + refill_fl(sc, fl, 32); + FL_UNLOCK(fl); + fl_hw_cidx = fl->hw_cidx; + } + } +out: +#if defined(INET) || defined(INET6) if (iq->flags & IQ_LRO_ENABLED) { if (ndescs > 0 && lro->lro_mbuf_count > 8) { MPASS(sort_before_lro(lro)); @@ -1585,15 +1680,11 @@ process_iql: t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(ndescs) | V_INGRESSQID((u32)iq->cntxt_id) | V_SEINTARM(iq->intr_params)); - if (iq->flags & IQ_HAS_FL) { - int starved; - - FL_LOCK(fl); - starved = refill_fl(sc, fl, 64); - FL_UNLOCK(fl); - if (__predict_false(starved != 0)) - add_fl_to_sfl(sc, fl); - } + FL_LOCK(fl); + starved = refill_fl(sc, fl, 64); + FL_UNLOCK(fl); + if (__predict_false(starved != 0)) + add_fl_to_sfl(sc, fl); return (0); } From owner-svn-src-all@freebsd.org Mon Apr 29 04:42:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56FBE1592F4D; Mon, 29 Apr 2019 04:42:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F41138ACCF; Mon, 29 Apr 2019 04:42:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A962E1D155; Mon, 29 Apr 2019 04:42:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T4gKEp007645; Mon, 29 Apr 2019 04:42:20 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T4gIB5006907; Mon, 29 Apr 2019 04:42:18 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904290442.x3T4gIB5006907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 04:42:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346876 - in stable/11/sys/dev/cxgbe: . iw_cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys/dev/cxgbe: . iw_cxgbe X-SVN-Commit-Revision: 346876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F41138ACCF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 04:42:21 -0000 Author: np Date: Mon Apr 29 04:42:18 2019 New Revision: 346876 URL: https://svnweb.freebsd.org/changeset/base/346876 Log: MFC r337659: cxgbe(4): Move all control queues to the adapter. There used to be one control queue per adapter (the mgmtq) that was initialized during adapter init and one per port that was initialized later during port init. This change moves all the control queues (one per port/channel) to the adapter so that they are initialized during adapter init and are available before any port is up. This allows the driver to issue ctrlq work requests over any channel without having to bring up any port. Modified: stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/iw_cxgbe/cq.c stable/11/sys/dev/cxgbe/iw_cxgbe/mem.c stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c stable/11/sys/dev/cxgbe/t4_filter.c stable/11/sys/dev/cxgbe/t4_l2t.c stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/cxgbe/t4_sge.c stable/11/sys/dev/cxgbe/t4_smt.c stable/11/sys/dev/cxgbe/t4_vf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 04:31:27 2019 (r346875) +++ stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 04:42:18 2019 (r346876) @@ -101,7 +101,7 @@ enum { EQ_ESIZE = 64, /* Default queue sizes for all kinds of egress queues */ - CTRL_EQ_QSIZE = 128, + CTRL_EQ_QSIZE = 1024, TX_EQ_QSIZE = 1024, #if MJUMPAGESIZE != MCLBYTES @@ -736,7 +736,6 @@ struct sge { int neq; /* total # of egress queues */ struct sge_iq fwq; /* Firmware event queue */ - struct sge_wrq mgmtq; /* Management queue (control queue) */ struct sge_wrq *ctrlq; /* Control queues */ struct sge_txq *txq; /* NIC tx queues */ struct sge_rxq *rxq; /* NIC rx queues */ Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/cq.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/cq.c Mon Apr 29 04:31:27 2019 (r346875) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/cq.c Mon Apr 29 04:42:18 2019 (r346876) @@ -61,7 +61,7 @@ static int destroy_cq(struct c4iw_rdev *rdev, struct t struct wrqe *wr; wr_len = sizeof *res_wr + sizeof *res; - wr = alloc_wrqe(wr_len, &sc->sge.mgmtq); + wr = alloc_wrqe(wr_len, &sc->sge.ctrlq[0]); if (wr == NULL) return (0); res_wr = wrtod(wr); @@ -131,7 +131,7 @@ create_cq(struct c4iw_rdev *rdev, struct t4_cq *cq, /* build fw_ri_res_wr */ wr_len = sizeof *res_wr + sizeof *res; - wr = alloc_wrqe(wr_len, &sc->sge.mgmtq); + wr = alloc_wrqe(wr_len, &sc->sge.ctrlq[0]); if (wr == NULL) return (0); res_wr = wrtod(wr); Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/mem.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/mem.c Mon Apr 29 04:31:27 2019 (r346875) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/mem.c Mon Apr 29 04:42:18 2019 (r346876) @@ -80,7 +80,7 @@ write_adapter_mem(struct c4iw_rdev *rdev, u32 addr, u3 wr_len = roundup(sizeof *ulpmc + sizeof *ulpsc + roundup(copy_len, T4_ULPTX_MIN_IO), 16); - wr = alloc_wrqe(wr_len, &sc->sge.mgmtq); + wr = alloc_wrqe(wr_len, &sc->sge.ctrlq[0]); if (wr == NULL) return (0); ulpmc = wrtod(wr); Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c Mon Apr 29 04:31:27 2019 (r346875) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c Mon Apr 29 04:42:18 2019 (r346876) @@ -234,7 +234,7 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4 /* build fw_ri_res_wr */ wr_len = sizeof *res_wr + 2 * sizeof *res; - wr = alloc_wrqe(wr_len, &sc->sge.mgmtq); + wr = alloc_wrqe(wr_len, &sc->sge.ctrlq[0]); if (wr == NULL) { ret = -ENOMEM; goto free_rq_dma; Modified: stable/11/sys/dev/cxgbe/t4_filter.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_filter.c Mon Apr 29 04:31:27 2019 (r346875) +++ stable/11/sys/dev/cxgbe/t4_filter.c Mon Apr 29 04:42:18 2019 (r346876) @@ -400,7 +400,7 @@ set_tcamfilter(struct adapter *sc, struct t4_filter *t len16 = howmany(sizeof(struct fw_filter2_wr), 16); else len16 = howmany(sizeof(struct fw_filter_wr), 16); - fwr = start_wrq_wr(&sc->sge.mgmtq, len16, &cookie); + fwr = start_wrq_wr(&sc->sge.ctrlq[0], len16, &cookie); if (__predict_false(fwr == NULL)) rc = ENOMEM; else { @@ -519,7 +519,7 @@ set_tcamfilter(struct adapter *sc, struct t4_filter *t fwr->newfport = htobe16(f->fs.nat_sport); fwr->natseqcheck = htobe32(f->fs.nat_seq_chk); } - commit_wrq_wr(&sc->sge.mgmtq, fwr, &cookie); + commit_wrq_wr(&sc->sge.ctrlq[0], fwr, &cookie); /* Wait for response. */ mtx_lock(&sc->tids.ftid_lock); @@ -824,7 +824,7 @@ del_tcamfilter(struct adapter *sc, struct t4_filter *t goto done; } MPASS(f->tid == tid_base + t->idx); - fwr = start_wrq_wr(&sc->sge.mgmtq, howmany(sizeof(*fwr), 16), &cookie); + fwr = start_wrq_wr(&sc->sge.ctrlq[0], howmany(sizeof(*fwr), 16), &cookie); if (fwr == NULL) { rc = ENOMEM; goto done; @@ -833,7 +833,7 @@ del_tcamfilter(struct adapter *sc, struct t4_filter *t bzero(fwr, sizeof (*fwr)); t4_mk_filtdelwr(f->tid, fwr, sc->sge.fwq.abs_id); f->pending = 1; - commit_wrq_wr(&sc->sge.mgmtq, fwr, &cookie); + commit_wrq_wr(&sc->sge.ctrlq[0], fwr, &cookie); t->fs = f->fs; /* extra info for the caller */ for (;;) { @@ -901,7 +901,7 @@ set_tcb_field(struct adapter *sc, u_int tid, uint16_t struct wrq_cookie cookie; struct cpl_set_tcb_field *req; - req = start_wrq_wr(&sc->sge.mgmtq, howmany(sizeof(*req), 16), &cookie); + req = start_wrq_wr(&sc->sge.ctrlq[0], howmany(sizeof(*req), 16), &cookie); if (req == NULL) return (ENOMEM); bzero(req, sizeof(*req)); @@ -914,7 +914,7 @@ set_tcb_field(struct adapter *sc, u_int tid, uint16_t req->word_cookie = htobe16(V_WORD(word) | V_COOKIE(CPL_COOKIE_HASHFILTER)); req->mask = htobe64(mask); req->val = htobe64(val); - commit_wrq_wr(&sc->sge.mgmtq, req, &cookie); + commit_wrq_wr(&sc->sge.ctrlq[0], req, &cookie); return (0); } @@ -1044,7 +1044,7 @@ t4_hashfilter_ao_rpl(struct sge_iq *iq, const struct r f->tid = act_open_rpl_status_to_errno(status); f->valid = 0; if (act_open_has_tid(status)) - release_tid(sc, GET_TID(cpl), &sc->sge.mgmtq); + release_tid(sc, GET_TID(cpl), &sc->sge.ctrlq[0]); free_filter_resources(f); if (f->locked == 0) free(f, M_CXGBE); @@ -1081,7 +1081,7 @@ t4_hashfilter_tcb_rpl(struct sge_iq *iq, const struct f->valid = 0; free_filter_resources(f); remove_hftid(sc, tid, f->fs.type ? 2 : 1); - release_tid(sc, tid, &sc->sge.mgmtq); + release_tid(sc, tid, &sc->sge.ctrlq[0]); if (f->locked == 0) free(f, M_CXGBE); } @@ -1112,7 +1112,7 @@ t4_del_hashfilter_rpl(struct sge_iq *iq, const struct f->valid = 0; free_filter_resources(f); remove_hftid(sc, tid, f->fs.type ? 2 : 1); - release_tid(sc, tid, &sc->sge.mgmtq); + release_tid(sc, tid, &sc->sge.ctrlq[0]); if (f->locked == 0) free(f, M_CXGBE); } @@ -1374,7 +1374,7 @@ set_hashfilter(struct adapter *sc, struct t4_filter *t } MPASS(atid >= 0); - wr = start_wrq_wr(&sc->sge.mgmtq, act_open_cpl_len16(sc, f->fs.type), + wr = start_wrq_wr(&sc->sge.ctrlq[0], act_open_cpl_len16(sc, f->fs.type), &cookie); if (wr == NULL) { free_atid(sc, atid); @@ -1394,7 +1394,7 @@ set_hashfilter(struct adapter *sc, struct t4_filter *t f->locked = 1; /* ithread mustn't free f if ioctl is still around. */ f->pending = 1; f->tid = -1; - commit_wrq_wr(&sc->sge.mgmtq, wr, &cookie); + commit_wrq_wr(&sc->sge.ctrlq[0], wr, &cookie); for (;;) { MPASS(f->locked); @@ -1571,7 +1571,7 @@ del_hashfilter(struct adapter *sc, struct t4_filter *t rc = EBUSY; goto done; } - wr = start_wrq_wr(&sc->sge.mgmtq, howmany(wrlen, 16), &cookie); + wr = start_wrq_wr(&sc->sge.ctrlq[0], howmany(wrlen, 16), &cookie); if (wr == NULL) { rc = ENOMEM; goto done; @@ -1580,7 +1580,7 @@ del_hashfilter(struct adapter *sc, struct t4_filter *t mk_del_hashfilter_wr(t->idx, wr, wrlen, sc->sge.fwq.abs_id); f->locked = 1; f->pending = 1; - commit_wrq_wr(&sc->sge.mgmtq, wr, &cookie); + commit_wrq_wr(&sc->sge.ctrlq[0], wr, &cookie); t->fs = f->fs; /* extra info for the caller */ for (;;) { Modified: stable/11/sys/dev/cxgbe/t4_l2t.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_l2t.c Mon Apr 29 04:31:27 2019 (r346875) +++ stable/11/sys/dev/cxgbe/t4_l2t.c Mon Apr 29 04:42:18 2019 (r346876) @@ -180,7 +180,7 @@ t4_l2t_set_switching(struct adapter *sc, struct l2t_en e->vlan = vlan; e->lport = port; - e->wrq = &sc->sge.mgmtq; + e->wrq = &sc->sge.ctrlq[0]; e->iqid = sc->sge.fwq.abs_id; memcpy(e->dmac, eth_addr, ETHER_ADDR_LEN); mtx_lock(&e->lock); Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 04:31:27 2019 (r346875) +++ stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 04:42:18 2019 (r346876) @@ -1153,7 +1153,7 @@ t4_attach(device_t dev) s->ntxq += nports * (num_vis - 1) * iaq.ntxq_vi; } s->neq = s->ntxq + s->nrxq; /* the free list in an rxq is an eq */ - s->neq += nports + 1;/* ctrl queues: 1 per port + 1 mgmt */ + s->neq += nports; /* ctrl queues: 1 per port */ s->niq = s->nrxq + 1; /* 1 extra for firmware event queue */ #ifdef TCP_OFFLOAD if (is_offload(sc)) { Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 04:31:27 2019 (r346875) +++ stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 04:42:18 2019 (r346876) @@ -216,8 +216,8 @@ static void add_fl_sysctls(struct adapter *, struct sy struct sysctl_oid *, struct sge_fl *); static int alloc_fwq(struct adapter *); static int free_fwq(struct adapter *); -static int alloc_mgmtq(struct adapter *); -static int free_mgmtq(struct adapter *); +static int alloc_ctrlq(struct adapter *, struct sge_wrq *, int, + struct sysctl_oid *); static int alloc_rxq(struct vi_info *, struct sge_rxq *, int, int, struct sysctl_oid *); static int free_rxq(struct vi_info *, struct sge_rxq *); @@ -983,7 +983,8 @@ t4_destroy_dma_tag(struct adapter *sc) } /* - * Allocate and initialize the firmware event queue and the management queue. + * Allocate and initialize the firmware event queue, control queues, and special + * purpose rx queues owned by the adapter. * * Returns errno on failure. Resources allocated up to that point may still be * allocated. Caller is responsible for cleanup in case this function fails. @@ -991,7 +992,9 @@ t4_destroy_dma_tag(struct adapter *sc) int t4_setup_adapter_queues(struct adapter *sc) { - int rc; + struct sysctl_oid *oid; + struct sysctl_oid_list *children; + int rc, i; ADAPTER_LOCK_ASSERT_NOTOWNED(sc); @@ -1006,12 +1009,31 @@ t4_setup_adapter_queues(struct adapter *sc) return (rc); /* - * Management queue. This is just a control queue that uses the fwq as - * its associated iq. + * That's all for the VF driver. */ - if (!(sc->flags & IS_VF)) - rc = alloc_mgmtq(sc); + if (sc->flags & IS_VF) + return (rc); + oid = device_get_sysctl_tree(sc->dev); + children = SYSCTL_CHILDREN(oid); + + /* + * XXX: General purpose rx queues, one per port. + */ + + /* + * Control queues, one per port. + */ + oid = SYSCTL_ADD_NODE(&sc->ctx, children, OID_AUTO, "ctrlq", + CTLFLAG_RD, NULL, "control queues"); + for_each_port(sc, i) { + struct sge_wrq *ctrlq = &sc->sge.ctrlq[i]; + + rc = alloc_ctrlq(sc, ctrlq, i, oid); + if (rc != 0) + return (rc); + } + return (rc); } @@ -1021,6 +1043,7 @@ t4_setup_adapter_queues(struct adapter *sc) int t4_teardown_adapter_queues(struct adapter *sc) { + int i; ADAPTER_LOCK_ASSERT_NOTOWNED(sc); @@ -1030,7 +1053,8 @@ t4_teardown_adapter_queues(struct adapter *sc) sc->flags &= ~ADAP_SYSCTL_CTX; } - free_mgmtq(sc); + for_each_port(sc, i) + free_wrq(sc, &sc->sge.ctrlq[i]); free_fwq(sc); return (0); @@ -1066,7 +1090,6 @@ t4_setup_vi_queues(struct vi_info *vi) int rc = 0, i, intr_idx, iqidx; struct sge_rxq *rxq; struct sge_txq *txq; - struct sge_wrq *ctrlq; #ifdef TCP_OFFLOAD struct sge_ofld_rxq *ofld_rxq; struct sge_wrq *ofld_txq; @@ -1205,20 +1228,6 @@ t4_setup_vi_queues(struct vi_info *vi) goto done; } #endif - - /* - * Finally, the control queue. - */ - if (!IS_MAIN_VI(vi) || sc->flags & IS_VF) - goto done; - oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "ctrlq", CTLFLAG_RD, - NULL, "ctrl queue"); - ctrlq = &sc->sge.ctrlq[pi->port_id]; - snprintf(name, sizeof(name), "%s ctrlq", device_get_nameunit(vi->dev)); - init_eq(sc, &ctrlq->eq, EQ_CTRL, CTRL_EQ_QSIZE, pi->tx_chan, - sc->sge.rxq[vi->first_rxq].iq.cntxt_id, name); - rc = alloc_wrq(sc, vi, ctrlq, oid); - done: if (rc) t4_teardown_vi_queues(vi); @@ -1233,13 +1242,15 @@ int t4_teardown_vi_queues(struct vi_info *vi) { int i; - struct port_info *pi = vi->pi; - struct adapter *sc = pi->adapter; struct sge_rxq *rxq; struct sge_txq *txq; +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) + struct port_info *pi = vi->pi; + struct adapter *sc = pi->adapter; + struct sge_wrq *ofld_txq; +#endif #ifdef TCP_OFFLOAD struct sge_ofld_rxq *ofld_rxq; - struct sge_wrq *ofld_txq; #endif #ifdef DEV_NETMAP struct sge_nm_rxq *nm_rxq; @@ -1269,9 +1280,6 @@ t4_teardown_vi_queues(struct vi_info *vi) * (for egress updates, etc.). */ - if (IS_MAIN_VI(vi) && !(sc->flags & IS_VF)) - free_wrq(sc, &sc->sge.ctrlq[pi->port_id]); - for_each_txq(vi, i, txq) { free_txq(vi, txq); } @@ -3098,35 +3106,25 @@ free_fwq(struct adapter *sc) } static int -alloc_mgmtq(struct adapter *sc) +alloc_ctrlq(struct adapter *sc, struct sge_wrq *ctrlq, int idx, + struct sysctl_oid *oid) { int rc; - struct sge_wrq *mgmtq = &sc->sge.mgmtq; char name[16]; - struct sysctl_oid *oid = device_get_sysctl_tree(sc->dev); - struct sysctl_oid_list *children = SYSCTL_CHILDREN(oid); + struct sysctl_oid_list *children; - oid = SYSCTL_ADD_NODE(&sc->ctx, children, OID_AUTO, "mgmtq", CTLFLAG_RD, - NULL, "management queue"); - - snprintf(name, sizeof(name), "%s mgmtq", device_get_nameunit(sc->dev)); - init_eq(sc, &mgmtq->eq, EQ_CTRL, CTRL_EQ_QSIZE, sc->port[0]->tx_chan, + snprintf(name, sizeof(name), "%s ctrlq%d", device_get_nameunit(sc->dev), + idx); + init_eq(sc, &ctrlq->eq, EQ_CTRL, CTRL_EQ_QSIZE, sc->port[idx]->tx_chan, sc->sge.fwq.cntxt_id, name); - rc = alloc_wrq(sc, NULL, mgmtq, oid); - if (rc != 0) { - device_printf(sc->dev, - "failed to create management queue: %d\n", rc); - return (rc); - } - return (0); -} + children = SYSCTL_CHILDREN(oid); + snprintf(name, sizeof(name), "%d", idx); + oid = SYSCTL_ADD_NODE(&sc->ctx, children, OID_AUTO, name, CTLFLAG_RD, + NULL, "ctrl queue"); + rc = alloc_wrq(sc, NULL, ctrlq, oid); -static int -free_mgmtq(struct adapter *sc) -{ - - return free_wrq(sc, &sc->sge.mgmtq); + return (rc); } int Modified: stable/11/sys/dev/cxgbe/t4_smt.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_smt.c Mon Apr 29 04:31:27 2019 (r346875) +++ stable/11/sys/dev/cxgbe/t4_smt.c Mon Apr 29 04:42:18 2019 (r346876) @@ -210,7 +210,7 @@ t4_smt_set_switching(struct adapter *sc, struct smt_en if (atomic_load_acq_int(&e->refcnt) == 1) { /* Setup the entry for the first time */ mtx_lock(&e->lock); - e->wrq = &sc->sge.mgmtq; + e->wrq = &sc->sge.ctrlq[0]; e->iqid = sc->sge.fwq.abs_id; e->pfvf = pfvf; e->state = SMT_STATE_SWITCHING; Modified: stable/11/sys/dev/cxgbe/t4_vf.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_vf.c Mon Apr 29 04:31:27 2019 (r346875) +++ stable/11/sys/dev/cxgbe/t4_vf.c Mon Apr 29 04:42:18 2019 (r346876) @@ -662,7 +662,7 @@ t4vf_attach(device_t dev) s->nrxq = sc->params.nports * iaq.nrxq; s->ntxq = sc->params.nports * iaq.ntxq; s->neq = s->ntxq + s->nrxq; /* the free list in an rxq is an eq */ - s->neq += sc->params.nports + 1;/* ctrl queues: 1 per port + 1 mgmt */ + s->neq += sc->params.nports; /* ctrl queues: 1 per port */ s->niq = s->nrxq + 1; /* 1 extra for firmware event queue */ s->rxq = malloc(s->nrxq * sizeof(struct sge_rxq), M_CXGBE, From owner-svn-src-all@freebsd.org Mon Apr 29 04:51:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87EA11580010; Mon, 29 Apr 2019 04:51:31 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 362C68B150; Mon, 29 Apr 2019 04:51:31 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F6371D2B8; Mon, 29 Apr 2019 04:51:31 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T4pVST013155; Mon, 29 Apr 2019 04:51:31 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T4pUrc013151; Mon, 29 Apr 2019 04:51:30 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904290451.x3T4pUrc013151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 04:51:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346877 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346877 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 362C68B150 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 04:51:31 -0000 Author: np Date: Mon Apr 29 04:51:30 2019 New Revision: 346877 URL: https://svnweb.freebsd.org/changeset/base/346877 Log: MFC r337830: cxgbe(4): Use two hashes instead of a table to keep track of hashfilters. Two because the driver needs to look up a hashfilter by its 4-tuple or tid. A couple of fixes while here: - Reject attempts to add duplicate hashfilters. - Do not assume that any part of the 4-tuple that isn't specified is 0. This makes it consistent with all other mandatory parameters that already require explicit user input. Modified: stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/offload.h stable/11/sys/dev/cxgbe/t4_filter.c stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 04:42:18 2019 (r346876) +++ stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 04:51:30 2019 (r346877) @@ -1208,7 +1208,7 @@ int t4_filter_rpl(struct sge_iq *, const struct rss_he int t4_hashfilter_ao_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); int t4_hashfilter_tcb_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); int t4_del_hashfilter_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); -void free_hftid_tab(struct tid_info *); +void free_hftid_hash(struct tid_info *); static inline struct wrqe * alloc_wrqe(int wr_len, struct sge_wrq *wrq) Modified: stable/11/sys/dev/cxgbe/offload.h ============================================================================== --- stable/11/sys/dev/cxgbe/offload.h Mon Apr 29 04:42:18 2019 (r346876) +++ stable/11/sys/dev/cxgbe/offload.h Mon Apr 29 04:51:30 2019 (r346877) @@ -127,11 +127,13 @@ struct tid_info { */ struct mtx hftid_lock __aligned(CACHE_LINE_SIZE); struct cv hftid_cv; - union { - void **hftid_tab; - void **tid_tab; - }; + void **tid_tab; u_int tids_in_use; + + void *hftid_hash_4t; /* LIST_HEAD(, filter_entry) *hftid_hash_4t; */ + u_long hftid_4t_mask; + void *hftid_hash_tid; /* LIST_HEAD(, filter_entry) *hftid_hash_tid; */ + u_long hftid_tid_mask; }; struct t4_range { Modified: stable/11/sys/dev/cxgbe/t4_filter.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_filter.c Mon Apr 29 04:42:18 2019 (r346876) +++ stable/11/sys/dev/cxgbe/t4_filter.c Mon Apr 29 04:51:30 2019 (r346877) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -53,6 +54,9 @@ __FBSDID("$FreeBSD$"); #include "t4_smt.h" struct filter_entry { + LIST_ENTRY(filter_entry) link_4t; + LIST_ENTRY(filter_entry) link_tid; + uint32_t valid:1; /* filter allocated and valid */ uint32_t locked:1; /* filter is administratively locked or busy */ uint32_t pending:1; /* filter action is pending firmware reply */ @@ -78,17 +82,54 @@ separate_hpfilter_region(struct adapter *sc) return (chip_id(sc) >= CHELSIO_T6); } +static inline uint32_t +hf_hashfn_4t(struct t4_filter_specification *fs) +{ + struct t4_filter_tuple *ft = &fs->val; + uint32_t hash; + + if (fs->type) { + /* IPv6 */ + hash = fnv_32_buf(&ft->sip[0], 16, FNV1_32_INIT); + hash = fnv_32_buf(&ft->dip[0], 16, hash); + } else { + hash = fnv_32_buf(&ft->sip[0], 4, FNV1_32_INIT); + hash = fnv_32_buf(&ft->dip[0], 4, hash); + } + hash = fnv_32_buf(&ft->sport, sizeof(ft->sport), hash); + hash = fnv_32_buf(&ft->dport, sizeof(ft->dport), hash); + + return (hash); +} + +static inline uint32_t +hf_hashfn_tid(int tid) +{ + + return (fnv_32_buf(&tid, sizeof(tid), FNV1_32_INIT)); +} + static int -alloc_hftid_tab(struct tid_info *t, int flags) +alloc_hftid_hash(struct tid_info *t, int flags) { + int n; MPASS(t->ntids > 0); - MPASS(t->hftid_tab == NULL); + MPASS(t->hftid_hash_4t == NULL); + MPASS(t->hftid_hash_tid == NULL); - t->hftid_tab = malloc(sizeof(*t->hftid_tab) * t->ntids, M_CXGBE, - M_ZERO | flags); - if (t->hftid_tab == NULL) + n = max(t->ntids / 1024, 16); + t->hftid_hash_4t = hashinit_flags(n, M_CXGBE, &t->hftid_4t_mask, flags); + if (t->hftid_hash_4t == NULL) return (ENOMEM); + t->hftid_hash_tid = hashinit_flags(n, M_CXGBE, &t->hftid_tid_mask, + flags); + if (t->hftid_hash_tid == NULL) { + hashdestroy(t->hftid_hash_4t, M_CXGBE, t->hftid_4t_mask); + t->hftid_hash_4t = NULL; + return (ENOMEM); + } + mtx_init(&t->hftid_lock, "T4 hashfilters", 0, MTX_DEF); cv_init(&t->hftid_cv, "t4hfcv"); @@ -96,22 +137,47 @@ alloc_hftid_tab(struct tid_info *t, int flags) } void -free_hftid_tab(struct tid_info *t) +free_hftid_hash(struct tid_info *t) { + struct filter_entry *f, *ftmp; + LIST_HEAD(, filter_entry) *head; int i; +#ifdef INVARIANTS + int n = 0; +#endif - if (t->hftid_tab != NULL) { - MPASS(t->ntids > 0); - for (i = 0; t->tids_in_use > 0 && i < t->ntids; i++) { - if (t->hftid_tab[i] == NULL) - continue; - free(t->hftid_tab[i], M_CXGBE); - t->tids_in_use--; + if (t->tids_in_use > 0) { + /* Remove everything from the tid hash. */ + head = t->hftid_hash_tid; + for (i = 0; i <= t->hftid_tid_mask; i++) { + LIST_FOREACH_SAFE(f, &head[i], link_tid, ftmp) { + LIST_REMOVE(f, link_tid); + } } - free(t->hftid_tab, M_CXGBE); - t->hftid_tab = NULL; + + /* Remove and then free each filter in the 4t hash. */ + head = t->hftid_hash_4t; + for (i = 0; i <= t->hftid_4t_mask; i++) { + LIST_FOREACH_SAFE(f, &head[i], link_4t, ftmp) { +#ifdef INVARIANTS + n += f->fs.type ? 2 : 1; +#endif + LIST_REMOVE(f, link_4t); + free(f, M_CXGBE); + } + } + MPASS(t->tids_in_use == n); + t->tids_in_use = 0; } + if (t->hftid_hash_4t) { + hashdestroy(t->hftid_hash_4t, M_CXGBE, t->hftid_4t_mask); + t->hftid_hash_4t = NULL; + } + if (t->hftid_hash_tid) { + hashdestroy(t->hftid_hash_tid, M_CXGBE, t->hftid_tid_mask); + t->hftid_hash_tid = NULL; + } if (mtx_initialized(&t->hftid_lock)) { mtx_destroy(&t->hftid_lock); cv_destroy(&t->hftid_cv); @@ -119,31 +185,146 @@ free_hftid_tab(struct tid_info *t) } static void -insert_hftid(struct adapter *sc, int tid, void *ctx, int ntids) +insert_hf(struct adapter *sc, struct filter_entry *f, uint32_t hash) { struct tid_info *t = &sc->tids; + LIST_HEAD(, filter_entry) *head = t->hftid_hash_4t; - t->hftid_tab[tid] = ctx; - atomic_add_int(&t->tids_in_use, ntids); + MPASS(head != NULL); + if (hash == 0) + hash = hf_hashfn_4t(&f->fs); + LIST_INSERT_HEAD(&head[hash & t->hftid_4t_mask], f, link_4t); + atomic_add_int(&t->tids_in_use, f->fs.type ? 2 : 1); } -static void * +static void +insert_hftid(struct adapter *sc, struct filter_entry *f) +{ + struct tid_info *t = &sc->tids; + LIST_HEAD(, filter_entry) *head = t->hftid_hash_tid; + uint32_t hash; + + MPASS(f->tid >= t->tid_base); + MPASS(f->tid - t->tid_base < t->ntids); + mtx_assert(&t->hftid_lock, MA_OWNED); + + hash = hf_hashfn_tid(f->tid); + LIST_INSERT_HEAD(&head[hash & t->hftid_tid_mask], f, link_tid); +} + +static bool +filter_eq(struct t4_filter_specification *fs1, + struct t4_filter_specification *fs2) +{ + int n; + + MPASS(fs1->hash && fs2->hash); + + if (fs1->type != fs2->type) + return (false); + + n = fs1->type ? 16 : 4; + if (bcmp(&fs1->val.sip[0], &fs2->val.sip[0], n) || + bcmp(&fs1->val.dip[0], &fs2->val.dip[0], n) || + fs1->val.sport != fs2->val.sport || + fs1->val.dport != fs2->val.dport) + return (false); + + /* + * We know the masks are the same because all hashfilter masks have to + * conform to the global tp->hash_filter_mask and the driver has + * verified that already. + */ + + if ((fs1->mask.pfvf_vld || fs1->mask.ovlan_vld) && + fs1->val.vnic != fs2->val.vnic) + return (false); + if (fs1->mask.vlan_vld && fs1->val.vlan != fs2->val.vlan) + return (false); + if (fs1->mask.macidx && fs1->val.macidx != fs2->val.macidx) + return (false); + if (fs1->mask.frag && fs1->val.frag != fs2->val.frag) + return (false); + if (fs1->mask.matchtype && fs1->val.matchtype != fs2->val.matchtype) + return (false); + if (fs1->mask.iport && fs1->val.iport != fs2->val.iport) + return (false); + if (fs1->mask.fcoe && fs1->val.fcoe != fs2->val.fcoe) + return (false); + if (fs1->mask.proto && fs1->val.proto != fs2->val.proto) + return (false); + if (fs1->mask.tos && fs1->val.tos != fs2->val.tos) + return (false); + if (fs1->mask.ethtype && fs1->val.ethtype != fs2->val.ethtype) + return (false); + + return (true); +} + +static struct filter_entry * +lookup_hf(struct adapter *sc, struct t4_filter_specification *fs, uint32_t hash) +{ + struct tid_info *t = &sc->tids; + LIST_HEAD(, filter_entry) *head = t->hftid_hash_4t; + struct filter_entry *f; + + mtx_assert(&t->hftid_lock, MA_OWNED); + MPASS(head != NULL); + + if (hash == 0) + hash = hf_hashfn_4t(fs); + + LIST_FOREACH(f, &head[hash & t->hftid_4t_mask], link_4t) { + if (filter_eq(&f->fs, fs)) + return (f); + } + + return (NULL); +} + +static struct filter_entry * lookup_hftid(struct adapter *sc, int tid) { struct tid_info *t = &sc->tids; + LIST_HEAD(, filter_entry) *head = t->hftid_hash_tid; + struct filter_entry *f; + uint32_t hash; - return (t->hftid_tab[tid]); + mtx_assert(&t->hftid_lock, MA_OWNED); + MPASS(head != NULL); + + hash = hf_hashfn_tid(tid); + LIST_FOREACH(f, &head[hash & t->hftid_tid_mask], link_tid) { + if (f->tid == tid) + return (f); + } + + return (NULL); } static void -remove_hftid(struct adapter *sc, int tid, int ntids) +remove_hf(struct adapter *sc, struct filter_entry *f) { struct tid_info *t = &sc->tids; - t->hftid_tab[tid] = NULL; - atomic_subtract_int(&t->tids_in_use, ntids); + mtx_assert(&t->hftid_lock, MA_OWNED); + + LIST_REMOVE(f, link_4t); + atomic_subtract_int(&t->tids_in_use, f->fs.type ? 2 : 1); } +static void +remove_hftid(struct adapter *sc, struct filter_entry *f) +{ +#ifdef INVARIANTS + struct tid_info *t = &sc->tids; + + mtx_assert(&t->hftid_lock, MA_OWNED); +#endif + + LIST_REMOVE(f, link_tid); +} + static uint32_t mode_to_fconf(uint32_t mode) { @@ -613,6 +794,25 @@ hashfilter_ntuple(struct adapter *sc, const struct t4_ return (0); } +static bool +is_4tuple_specified(struct t4_filter_specification *fs) +{ + int i; + const int n = fs->type ? 16 : 4; + + if (fs->mask.sport != 0xffff || fs->mask.dport != 0xffff) + return (false); + + for (i = 0; i < n; i++) { + if (fs->mask.sip[i] != 0xff) + return (false); + if (fs->mask.dip[i] != 0xff) + return (false); + } + + return (true); +} + int set_filter(struct adapter *sc, struct t4_filter *t) { @@ -635,6 +835,8 @@ set_filter(struct adapter *sc, struct t4_filter *t) /* T5 can't count hashfilter hits. */ if (is_t5(sc) && t->fs.hitcnts) return (EINVAL); + if (!is_4tuple_specified(&t->fs)) + return (EINVAL); rc = hashfilter_ntuple(sc, &t->fs, &ftuple); if (rc != 0) return (rc); @@ -689,8 +891,8 @@ set_filter(struct adapter *sc, struct t4_filter *t) return (rc); } if (t->fs.hash) { - if (__predict_false(ti->hftid_tab == NULL)) { - rc = alloc_hftid_tab(&sc->tids, M_NOWAIT); + if (__predict_false(ti->hftid_hash_4t == NULL)) { + rc = alloc_hftid_hash(&sc->tids, HASH_NOWAIT); if (rc != 0) goto done; } @@ -864,7 +1066,7 @@ del_filter(struct adapter *sc, struct t4_filter *t) * for are initialized. */ if (t->fs.hash) { - if (sc->tids.hftid_tab != NULL) + if (sc->tids.hftid_hash_4t != NULL) return (del_hashfilter(sc, t)); } else if (separate_hpfilter_region(sc) && t->fs.prio) { if (sc->tids.hpftid_tab != NULL) @@ -1018,18 +1220,9 @@ t4_hashfilter_ao_rpl(struct sge_iq *iq, const struct r KASSERT(f->tid == -1, ("%s: hashfilter[%p] has tid %d already.", __func__, f, f->tid)); if (status == CPL_ERR_NONE) { - struct filter_entry *f2; - f->tid = GET_TID(cpl); - MPASS(f->tid < sc->tids.ntids); - if (__predict_false((f2 = lookup_hftid(sc, f->tid)) != NULL)) { - /* XXX: avoid hash collisions in the first place. */ - MPASS(f2->tid == f->tid); - remove_hftid(sc, f2->tid, f2->fs.type ? 2 : 1); - free_filter_resources(f2); - free(f2, M_CXGBE); - } - insert_hftid(sc, f->tid, f, f->fs.type ? 2 : 1); + MPASS(lookup_hftid(sc, f->tid) == NULL); + insert_hftid(sc, f); /* * Leave the filter pending until it is fully set up, which will * be indicated by the reply to the last TCB update. No need to @@ -1046,6 +1239,7 @@ t4_hashfilter_ao_rpl(struct sge_iq *iq, const struct r if (act_open_has_tid(status)) release_tid(sc, GET_TID(cpl), &sc->sge.ctrlq[0]); free_filter_resources(f); + remove_hf(sc, f); if (f->locked == 0) free(f, M_CXGBE); } @@ -1080,7 +1274,8 @@ t4_hashfilter_tcb_rpl(struct sge_iq *iq, const struct f->tid = EIO; f->valid = 0; free_filter_resources(f); - remove_hftid(sc, tid, f->fs.type ? 2 : 1); + remove_hftid(sc, f); + remove_hf(sc, f); release_tid(sc, tid, &sc->sge.ctrlq[0]); if (f->locked == 0) free(f, M_CXGBE); @@ -1111,7 +1306,8 @@ t4_del_hashfilter_rpl(struct sge_iq *iq, const struct if (cpl->status == 0) { f->valid = 0; free_filter_resources(f); - remove_hftid(sc, tid, f->fs.type ? 2 : 1); + remove_hftid(sc, f); + remove_hf(sc, f); release_tid(sc, tid, &sc->sge.ctrlq[0]); if (f->locked == 0) free(f, M_CXGBE); @@ -1181,26 +1377,30 @@ done: static int get_hashfilter(struct adapter *sc, struct t4_filter *t) { - int i, nfilters = sc->tids.ntids; + struct tid_info *ti = &sc->tids; + int tid; struct filter_entry *f; + const int inv_tid = ti->ntids + ti->tid_base; MPASS(t->fs.hash); - if (sc->tids.tids_in_use == 0 || sc->tids.hftid_tab == NULL || - t->idx >= nfilters) { + if (ti->tids_in_use == 0 || ti->hftid_hash_tid == NULL || + t->idx >= inv_tid) { t->idx = 0xffffffff; return (0); } + if (t->idx < ti->tid_base) + t->idx = ti->tid_base; - mtx_lock(&sc->tids.hftid_lock); - for (i = t->idx; i < nfilters; i++) { - f = lookup_hftid(sc, i); + mtx_lock(&ti->hftid_lock); + for (tid = t->idx; tid < inv_tid; tid++) { + f = lookup_hftid(sc, tid); if (f != NULL && f->valid) { - t->idx = i; + t->idx = tid; t->l2tidx = f->l2te ? f->l2te->idx : 0; t->smtidx = f->smt ? f->smt->idx : 0; if (f->fs.hitcnts) - t->hits = get_filter_hits(sc, t->idx); + t->hits = get_filter_hits(sc, tid); else t->hits = UINT64_MAX; t->fs = f->fs; @@ -1210,7 +1410,7 @@ get_hashfilter(struct adapter *sc, struct t4_filter *t } t->idx = 0xffffffff; done: - mtx_unlock(&sc->tids.hftid_lock); + mtx_unlock(&ti->hftid_lock); return (0); } @@ -1335,20 +1535,21 @@ set_hashfilter(struct adapter *sc, struct t4_filter *t struct wrq_cookie cookie; struct filter_entry *f; int rc, atid = -1; + uint32_t hash; MPASS(t->fs.hash); /* Already validated against fconf, iconf */ MPASS((t->fs.val.pfvf_vld & t->fs.val.ovlan_vld) == 0); MPASS((t->fs.mask.pfvf_vld & t->fs.mask.ovlan_vld) == 0); + hash = hf_hashfn_4t(&t->fs); + mtx_lock(&sc->tids.hftid_lock); + if (lookup_hf(sc, &t->fs, hash) != NULL) { + rc = EEXIST; + goto done; + } - /* - * XXX: Check for hash collisions and insert in the hash based lookup - * table so that in-flight hashfilters are also considered when checking - * for collisions. - */ - f = malloc(sizeof(*f), M_CXGBE, M_ZERO | M_NOWAIT); if (__predict_false(f == NULL)) { if (l2te) @@ -1394,6 +1595,7 @@ set_hashfilter(struct adapter *sc, struct t4_filter *t f->locked = 1; /* ithread mustn't free f if ioctl is still around. */ f->pending = 1; f->tid = -1; + insert_hf(sc, f, hash); commit_wrq_wr(&sc->sge.ctrlq[0], wr, &cookie); for (;;) { @@ -1404,6 +1606,7 @@ set_hashfilter(struct adapter *sc, struct t4_filter *t f->locked = 0; t->idx = f->tid; } else { + remove_hf(sc, f); rc = f->tid; free(f, M_CXGBE); } @@ -1544,19 +1747,21 @@ mk_del_hashfilter_wr(int tid, struct work_request_hdr static int del_hashfilter(struct adapter *sc, struct t4_filter *t) { + struct tid_info *ti = &sc->tids; void *wr; struct filter_entry *f; struct wrq_cookie cookie; int rc; const int wrlen = del_hashfilter_wrlen(); + const int inv_tid = ti->ntids + ti->tid_base; - MPASS(sc->tids.hftid_tab != NULL); + MPASS(sc->tids.hftid_hash_4t != NULL); MPASS(sc->tids.ntids > 0); - if (t->idx >= sc->tids.ntids) + if (t->idx < sc->tids.tid_base || t->idx >= inv_tid) return (EINVAL); - mtx_lock(&sc->tids.hftid_lock); + mtx_lock(&ti->hftid_lock); f = lookup_hftid(sc, t->idx); if (f == NULL || f->valid == 0) { rc = EINVAL; @@ -1595,14 +1800,14 @@ del_hashfilter(struct adapter *sc, struct t4_filter *t } break; } - if (cv_wait_sig(&sc->tids.hftid_cv, &sc->tids.hftid_lock) != 0) { + if (cv_wait_sig(&ti->hftid_cv, &ti->hftid_lock) != 0) { f->locked = 0; rc = EINPROGRESS; break; } } done: - mtx_unlock(&sc->tids.hftid_lock); + mtx_unlock(&ti->hftid_lock); return (rc); } Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 04:42:18 2019 (r346876) +++ stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 04:51:30 2019 (r346877) @@ -1511,8 +1511,7 @@ t4_detach_common(device_t dev) free(sc->sge.eqmap, M_CXGBE); free(sc->tids.ftid_tab, M_CXGBE); free(sc->tids.hpftid_tab, M_CXGBE); - if (sc->tids.hftid_tab) - free_hftid_tab(&sc->tids); + free_hftid_hash(&sc->tids); free(sc->tids.atid_tab, M_CXGBE); free(sc->tids.tid_tab, M_CXGBE); free(sc->tt.tls_rx_ports, M_CXGBE); From owner-svn-src-all@freebsd.org Mon Apr 29 05:01:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD1B91580505; Mon, 29 Apr 2019 05:01:35 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 743278B659; Mon, 29 Apr 2019 05:01:35 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E2921D476; Mon, 29 Apr 2019 05:01:35 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T51Z37016634; Mon, 29 Apr 2019 05:01:35 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T51YJA016631; Mon, 29 Apr 2019 05:01:34 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904290501.x3T51YJA016631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 05:01:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346878 - in stable/11/sys/dev/cxgbe: . tom X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys/dev/cxgbe: . tom X-SVN-Commit-Revision: 346878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 743278B659 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 05:01:36 -0000 Author: np Date: Mon Apr 29 05:01:34 2019 New Revision: 346878 URL: https://svnweb.freebsd.org/changeset/base/346878 Log: MFC r337873: cxgbe(4): Use VLAN_TRUNKDEV instead of private cookie to figure out the parent of a VLAN ifnet. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/cxgbe/tom/t4_connect.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 04:51:30 2019 (r346877) +++ stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 05:01:34 2019 (r346878) @@ -195,8 +195,6 @@ struct vi_info { uint16_t rss_size; /* size of VI's RSS table slice */ uint16_t rss_base; /* start of VI's RSS table slice */ - eventhandler_tag vlan_c; - int nintr; int first_intr; Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 04:51:30 2019 (r346877) +++ stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 05:01:34 2019 (r346878) @@ -617,7 +617,6 @@ static void get_regs(struct adapter *, struct t4_regdu static void vi_refresh_stats(struct adapter *, struct vi_info *); static void cxgbe_refresh_stats(struct adapter *, struct port_info *); static void cxgbe_tick(void *); -static void cxgbe_vlan_config(void *, struct ifnet *, uint16_t); static void cxgbe_sysctls(struct port_info *); static int sysctl_int_array(SYSCTL_HANDLER_ARGS); static int sysctl_bitfield_8b(SYSCTL_HANDLER_ARGS); @@ -1614,9 +1613,6 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS; ifp->if_hw_tsomaxsegsize = 65536; - vi->vlan_c = EVENTHANDLER_REGISTER(vlan_config, cxgbe_vlan_config, ifp, - EVENTHANDLER_PRI_ANY); - ether_ifattach(ifp, vi->hw_addr); #ifdef DEV_NETMAP if (vi->nnmrxq != 0) @@ -1682,9 +1678,6 @@ cxgbe_vi_detach(struct vi_info *vi) ether_ifdetach(ifp); - if (vi->vlan_c) - EVENTHANDLER_DEREGISTER(vlan_config, vi->vlan_c); - /* Let detach proceed even if these fail. */ #ifdef DEV_NETMAP if (ifp->if_capabilities & IFCAP_NETMAP) @@ -5644,18 +5637,6 @@ vi_tick(void *arg) vi_refresh_stats(sc, vi); callout_schedule(&vi->tick, hz); -} - -static void -cxgbe_vlan_config(void *arg, struct ifnet *ifp, uint16_t vid) -{ - struct ifnet *vlan; - - if (arg != ifp || ifp->if_type != IFT_ETHER) - return; - - vlan = VLAN_DEVAT(ifp, vid); - VLAN_SETCOOKIE(vlan, ifp); } /* Modified: stable/11/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_connect.c Mon Apr 29 04:51:30 2019 (r346877) +++ stable/11/sys/dev/cxgbe/tom/t4_connect.c Mon Apr 29 05:01:34 2019 (r346878) @@ -332,7 +332,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru if (rt_ifp->if_type == IFT_ETHER) vi = rt_ifp->if_softc; else if (rt_ifp->if_type == IFT_L2VLAN) { - struct ifnet *ifp = VLAN_COOKIE(rt_ifp); + struct ifnet *ifp = VLAN_TRUNKDEV(rt_ifp); vi = ifp->if_softc; VLAN_TAG(rt_ifp, &vid); From owner-svn-src-all@freebsd.org Mon Apr 29 05:02:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF2771580621; Mon, 29 Apr 2019 05:02:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 86AF38B829; Mon, 29 Apr 2019 05:02:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 791AD1D4B9; Mon, 29 Apr 2019 05:02:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T52PiZ018248; Mon, 29 Apr 2019 05:02:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T52PFD018247; Mon, 29 Apr 2019 05:02:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201904290502.x3T52PFD018247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 29 Apr 2019 05:02:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346879 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 346879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 86AF38B829 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 05:02:26 -0000 Author: imp Date: Mon Apr 29 05:02:25 2019 New Revision: 346879 URL: https://svnweb.freebsd.org/changeset/base/346879 Log: Read in and parse /efi/freebsd/loader.env from the boot device's partition as if it were on the command line. Fetch FreeBSD-LoaderEnv UEFI enviornment variable. If set, read in loader environment variables from it. Otherwise read in /efi/freebsd/loader.env. Both are read relative to the device loader.efi loaded from (they aren't full UEFI device paths) Next fetch FreeBSD-NextLoaderEnv UEFI environment variable. If present, read the file it points to in as above and delete the UEFI environment variable so it only happens once. This lets one set environment variables in the bootloader. Unfortunately, we don't have all the mechanisms in place to parse the file, nor do we have the magic pattern matching in place that loader.conf has. Variables are of the form foo=bar. No quotes are supported, so spaces aren't allowed, for example. Also, variables like foo_load=yes are intercepted when we parse the loader.conf file and things are done based on that. Since those aren't done here, variables that cause an action to happen won't work. Reviewed by: bcran Differential Revision: https://reviews.freebsd.org/D20016 Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Mon Apr 29 05:01:34 2019 (r346878) +++ head/stand/efi/loader/main.c Mon Apr 29 05:02:25 2019 (r346879) @@ -742,6 +742,80 @@ out: return (how); } +void +parse_loader_efi_config(EFI_HANDLE h, const char *env_fn) +{ + pdinfo_t *dp; + struct stat st; + int fd = -1; + char *env = NULL; + + dp = efiblk_get_pdinfo_by_handle(h); + if (dp == NULL) + return; + set_currdev_pdinfo(dp); + if (stat(env_fn, &st) != 0) + return; + fd = open(env_fn, O_RDONLY); + if (fd == -1) + return; + env = malloc(st.st_size + 1); + if (env == NULL) + goto out; + if (read(fd, env, st.st_size) != st.st_size) + goto out; + env[st.st_size] = '\0'; + boot_parse_cmdline(env); +out: + free(env); + close(fd); +} + +static void +read_loader_env(const char *name, char *def_fn, bool once) +{ + UINTN len; + char *fn, *freeme = NULL; + + len = 0; + fn = def_fn; + if (efi_freebsd_getenv(name, NULL, &len) == EFI_BUFFER_TOO_SMALL) { + freeme = fn = malloc(len + 1); + if (fn != NULL) { + if (efi_freebsd_getenv(name, fn, &len) != EFI_SUCCESS) { + free(fn); + fn = NULL; + printf( + "Can't fetch FreeBSD::%s we know is there\n", name); + } else { + /* + * if tagged as 'once' delete the env variable so we + * only use it once. + */ + if (once) + efi_freebsd_delenv(name); + /* + * We malloced 1 more than len above, then redid the call. + * so now we have room at the end of the string to NUL terminate + * it here, even if the typical idium would have '- 1' here to + * not overflow. len should be the same on return both times. + */ + fn[len] = '\0'; + } + } else { + printf( + "Can't allocate %d bytes to fetch FreeBSD::%s env var\n", + len, name); + } + } + if (fn) { + printf(" Reading loader env vars from %s\n", fn); + parse_loader_efi_config(boot_img->DeviceHandle, fn); + } +} + + + EFI_STATUS main(int argc, CHAR16 *argv[]) { @@ -812,6 +886,38 @@ main(int argc, CHAR16 *argv[]) howto |= RB_SERIAL | RB_MULTIPLE; howto &= ~RB_PROBE; uhowto = parse_uefi_con_out(); + + /* + * Scan the BLOCK IO MEDIA handles then + * march through the device switch probing for things. + */ + i = efipart_inithandles(); + if (i != 0 && i != ENOENT) { + printf("efipart_inithandles failed with ERRNO %d, expect " + "failures\n", i); + } + + for (i = 0; devsw[i] != NULL; i++) + if (devsw[i]->dv_init != NULL) + (devsw[i]->dv_init)(); + + /* + * Read additional environment variables from the boot device's + * "LoaderEnv" file. Any boot loader environment variable may be set + * there, which are subtly different than loader.conf variables. Only + * the 'simple' ones may be set so things like foo_load="YES" won't work + * for two reasons. First, the parser is simplistic and doesn't grok + * quotes. Second, because the variables that cause an action to happen + * are parsed by the lua, 4th or whatever code that's not yet + * loaded. This is relative to the root directory when loader.efi is + * loaded off the UFS root drive (when chain booted), or from the ESP + * when directly loaded by the BIOS. + * + * We also read in NextLoaderEnv if it was specified. This allows next boot + * functionality to be implemented and to override anything in LoaderEnv. + */ + read_loader_env("LoaderEnv", "/efi/freebsd/loader.env", false); + read_loader_env("NextLoaderEnv", NULL, true); /* * We now have two notions of console. howto should be viewed as From owner-svn-src-all@freebsd.org Mon Apr 29 05:02:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B30815806B1; Mon, 29 Apr 2019 05:02:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5F888B96D; Mon, 29 Apr 2019 05:02:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C00381D4C9; Mon, 29 Apr 2019 05:02:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T52oRa018320; Mon, 29 Apr 2019 05:02:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T52o9H018319; Mon, 29 Apr 2019 05:02:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201904290502.x3T52o9H018319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 29 Apr 2019 05:02:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346880 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 346880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E5F888B96D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 05:02:51 -0000 Author: imp Date: Mon Apr 29 05:02:50 2019 New Revision: 346880 URL: https://svnweb.freebsd.org/changeset/base/346880 Log: Implement uefi_rootdev If uefi_rootdev is set in the environment, then treat it like a device path. Convert the string to a device path and see if we can find a device that matches. If so, use that device at our root dev no matter what. If it's bad in any way, the boot will fail. Reviewed by: bcran Differential Revision: https://reviews.freebsd.org/D20016 Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Mon Apr 29 05:02:25 2019 (r346879) +++ head/stand/efi/loader/main.c Mon Apr 29 05:02:50 2019 (r346880) @@ -472,13 +472,35 @@ find_currdev(bool do_bootmgr, bool is_last, */ rootdev = getenv("rootdev"); if (rootdev != NULL) { - printf("Setting currdev to configured rootdev %s\n", rootdev); + printf(" Setting currdev to configured rootdev %s\n", + rootdev); set_currdev(rootdev); return (0); } /* - * Second choice: If we can find out image boot_info, and there's + * Second choice: If uefi_rootdev is set, translate that UEFI device + * path to the loader's internal name and use that. + */ + do { + rootdev = getenv("uefi_rootdev"); + if (rootdev == NULL) + break; + devpath = efi_name_to_devpath(rootdev); + if (devpath == NULL) + break; + dp = efiblk_get_pdinfo_by_device_path(devpath); + efi_devpath_free(devpath); + if (dp == NULL) + break; + printf(" Setting currdev to UEFI path %s\n", + rootdev); + set_currdev_pdinfo(dp); + return (0); + } while (0); + + /* + * Third choice: If we can find out image boot_info, and there's * a follow-on boot image in that boot_info, use that. In this * case root will be the partition specified in that image and * we'll load the kernel specified by the file path. Should there From owner-svn-src-all@freebsd.org Mon Apr 29 05:02:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10A8715806E1; Mon, 29 Apr 2019 05:02:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A41FA8B996; Mon, 29 Apr 2019 05:02:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A4731D4CA; Mon, 29 Apr 2019 05:02:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T52tIu018371; Mon, 29 Apr 2019 05:02:55 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T52tYo018370; Mon, 29 Apr 2019 05:02:55 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201904290502.x3T52tYo018370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 29 Apr 2019 05:02:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346881 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 346881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A41FA8B996 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 05:02:56 -0000 Author: imp Date: Mon Apr 29 05:02:54 2019 New Revision: 346881 URL: https://svnweb.freebsd.org/changeset/base/346881 Log: Implement uefi_ignore_boot_mgr env variable. When set, we ignore all the hints that the UEFI boot manager has set for us. We also always fail back to the OK prompt when we can't find the right thing to boot rather than failing back to the UEFI boot manager. This has the side effect of also expanding the cases where we fail back to the OK prompt to include when we're booted under UEFI, but UEFI::BootCurrent isn't set in the environment and we can't find a proper place to boot from. Reviewed by: bcran Differential Revision: https://reviews.freebsd.org/D20016 Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Mon Apr 29 05:02:50 2019 (r346880) +++ head/stand/efi/loader/main.c Mon Apr 29 05:02:54 2019 (r346881) @@ -1027,36 +1027,41 @@ main(int argc, CHAR16 *argv[]) } } - uefi_boot_mgr = true; - boot_current = 0; - sz = sizeof(boot_current); - rv = efi_global_getenv("BootCurrent", &boot_current, &sz); - if (rv == EFI_SUCCESS) - printf(" BootCurrent: %04x\n", boot_current); - else { - boot_current = 0xffff; + if (getenv("uefi_ignore_boot_mgr") != NULL) { + printf(" Ignoring UEFI boot manager\n"); uefi_boot_mgr = false; - } + } else { + uefi_boot_mgr = true; + boot_current = 0; + sz = sizeof(boot_current); + rv = efi_global_getenv("BootCurrent", &boot_current, &sz); + if (rv == EFI_SUCCESS) + printf(" BootCurrent: %04x\n", boot_current); + else { + boot_current = 0xffff; + uefi_boot_mgr = false; + } - sz = sizeof(boot_order); - rv = efi_global_getenv("BootOrder", &boot_order, &sz); - if (rv == EFI_SUCCESS) { - printf(" BootOrder:"); - for (i = 0; i < sz / sizeof(boot_order[0]); i++) - printf(" %04x%s", boot_order[i], - boot_order[i] == boot_current ? "[*]" : ""); - printf("\n"); - is_last = boot_order[(sz / sizeof(boot_order[0])) - 1] == boot_current; - bosz = sz; - } else if (uefi_boot_mgr) { - /* - * u-boot doesn't set BootOrder, but otherwise participates in the - * boot manager protocol. So we fake it here and don't consider it - * a failure. - */ - bosz = sizeof(boot_order[0]); - boot_order[0] = boot_current; - is_last = true; + sz = sizeof(boot_order); + rv = efi_global_getenv("BootOrder", &boot_order, &sz); + if (rv == EFI_SUCCESS) { + printf(" BootOrder:"); + for (i = 0; i < sz / sizeof(boot_order[0]); i++) + printf(" %04x%s", boot_order[i], + boot_order[i] == boot_current ? "[*]" : ""); + printf("\n"); + is_last = boot_order[(sz / sizeof(boot_order[0])) - 1] == boot_current; + bosz = sz; + } else if (uefi_boot_mgr) { + /* + * u-boot doesn't set BootOrder, but otherwise participates in the + * boot manager protocol. So we fake it here and don't consider it + * a failure. + */ + bosz = sizeof(boot_order[0]); + boot_order[0] = boot_current; + is_last = true; + } } /* @@ -1105,7 +1110,8 @@ main(int argc, CHAR16 *argv[]) * to try something different. */ if (find_currdev(uefi_boot_mgr, is_last, boot_info, bisz) != 0) - if (!interactive_interrupt("Failed to find bootable partition")) + if (uefi_boot_mgr && + !interactive_interrupt("Failed to find bootable partition")) return (EFI_NOT_FOUND); efi_init_environment(); From owner-svn-src-all@freebsd.org Mon Apr 29 05:26:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1EDA15813AE; Mon, 29 Apr 2019 05:26:29 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 58B468C5CE; Mon, 29 Apr 2019 05:26:29 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BA9B1D80F; Mon, 29 Apr 2019 05:26:29 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T5QTxG029236; Mon, 29 Apr 2019 05:26:29 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T5QR9I029230; Mon, 29 Apr 2019 05:26:27 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904290526.x3T5QR9I029230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 05:26:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346882 - in stable/11/sys/dev/cxgbe: . common tom X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys/dev/cxgbe: . common tom X-SVN-Commit-Revision: 346882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 58B468C5CE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 05:26:30 -0000 Author: np Date: Mon Apr 29 05:26:27 2019 New Revision: 346882 URL: https://svnweb.freebsd.org/changeset/base/346882 Log: MFC r338156, r338158-r338161, r338166. r338156: cxgbe(4): Avoid overflow while calculating channel rate. Reported by: Coverity (CID 1008352) r338158: cxgbe(4): Check the RO bit properly before disabling relaxed ordering. Reported by: Coverity (CID 1384286) r338159: cxgbe(4): Make it clear that VI_INIT_DONE implies vi->ntxq > 0, and so rc will never be returned uninitialized. Reported by: Coverity (CID 1394884). This is a false positive though. r338160: cxgbe(4): Do not leak memory in case of errors during VI initialization. Reported by: Coverity (CID 1392026) r338161: cxgbe/tom: Make sure 'matched' is always initialized before use. Reported by: Coverity (CID 1390894) r338166: cxgbe(4): Be explicit about ignoring the return value of cmpset in some cases. Reported by: Coverity (CIDs 1009398, 1009400, 1009401, 1357325, 1394783). All false positives. Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/cxgbe/t4_netmap.c stable/11/sys/dev/cxgbe/t4_sched.c stable/11/sys/dev/cxgbe/t4_sge.c stable/11/sys/dev/cxgbe/tom/t4_tom.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/11/sys/dev/cxgbe/common/t4_hw.c Mon Apr 29 05:02:54 2019 (r346881) +++ stable/11/sys/dev/cxgbe/common/t4_hw.c Mon Apr 29 05:26:27 2019 (r346882) @@ -5854,7 +5854,7 @@ int t4_set_sched_ipg(struct adapter *adap, int sched, */ static u64 chan_rate(struct adapter *adap, unsigned int bytes256) { - u64 v = bytes256 * adap->params.vpd.cclk; + u64 v = (u64)bytes256 * adap->params.vpd.cclk; return v * 62 + v / 2; } Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 05:02:54 2019 (r346881) +++ stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 05:26:27 2019 (r346882) @@ -953,7 +953,7 @@ t4_attach(device_t dev) v = pci_read_config(dev, i + PCIER_DEVICE_CTL, 2); sc->params.pci.mps = 128 << ((v & PCIEM_CTL_MAX_PAYLOAD) >> 5); if (pcie_relaxed_ordering == 0 && - (v | PCIEM_CTL_RELAXED_ORD_ENABLE) != 0) { + (v & PCIEM_CTL_RELAXED_ORD_ENABLE) != 0) { v &= ~PCIEM_CTL_RELAXED_ORD_ENABLE; pci_write_config(dev, i + PCIER_DEVICE_CTL, v, 2); } else if (pcie_relaxed_ordering == 1 && @@ -5265,6 +5265,7 @@ vi_full_init(struct vi_info *vi) rc = -t4_config_rss_range(sc, sc->mbox, vi->viid, 0, vi->rss_size, rss, vi->rss_size); if (rc != 0) { + free(rss, M_CXGBE); if_printf(ifp, "rss_config failed: %d\n", rc); goto done; } @@ -5313,6 +5314,7 @@ vi_full_init(struct vi_info *vi) #endif rc = -t4_config_vi_rss(sc, sc->mbox, vi->viid, hashen, rss[0], 0, 0); if (rc != 0) { + free(rss, M_CXGBE); if_printf(ifp, "rss hash/defaultq config failed: %d\n", rc); goto done; } Modified: stable/11/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_netmap.c Mon Apr 29 05:02:54 2019 (r346881) +++ stable/11/sys/dev/cxgbe/t4_netmap.c Mon Apr 29 05:26:27 2019 (r346882) @@ -361,7 +361,7 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi t4_write_reg(sc, sc->sge_kdoorbell_reg, nm_rxq->fl_db_val | V_PIDX(j)); - atomic_cmpset_int(&nm_rxq->nm_state, NM_OFF, NM_ON); + (void) atomic_cmpset_int(&nm_rxq->nm_state, NM_OFF, NM_ON); } for_each_nm_txq(vi, i, nm_txq) { Modified: stable/11/sys/dev/cxgbe/t4_sched.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sched.c Mon Apr 29 05:02:54 2019 (r346881) +++ stable/11/sys/dev/cxgbe/t4_sched.c Mon Apr 29 05:26:27 2019 (r346882) @@ -393,6 +393,7 @@ t4_set_sched_queue(struct adapter *sc, struct t4_sched /* Checking VI_INIT_DONE outside a synch-op is a harmless race here. */ if (!(vi->flags & VI_INIT_DONE)) return (EAGAIN); + MPASS(vi->ntxq > 0); if (!in_range(p->queue, 0, vi->ntxq - 1) || !in_range(p->cl, 0, sc->chip_params->nsched_cls - 1)) Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 05:02:54 2019 (r346881) +++ stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 05:26:27 2019 (r346882) @@ -1349,7 +1349,7 @@ t4_intr_evt(void *arg) if (atomic_cmpset_int(&iq->state, IQS_IDLE, IQS_BUSY)) { service_iq(iq, 0); - atomic_cmpset_int(&iq->state, IQS_BUSY, IQS_IDLE); + (void) atomic_cmpset_int(&iq->state, IQS_BUSY, IQS_IDLE); } } @@ -1363,7 +1363,7 @@ t4_intr(void *arg) if (atomic_cmpset_int(&iq->state, IQS_IDLE, IQS_BUSY)) { service_iq_fl(iq, 0); - atomic_cmpset_int(&iq->state, IQS_BUSY, IQS_IDLE); + (void) atomic_cmpset_int(&iq->state, IQS_BUSY, IQS_IDLE); } } @@ -1378,7 +1378,7 @@ t4_nm_intr(void *arg) if (atomic_cmpset_int(&nm_rxq->nm_state, NM_ON, NM_BUSY)) { service_nm_rxq(nm_rxq); - atomic_cmpset_int(&nm_rxq->nm_state, NM_BUSY, NM_ON); + (void) atomic_cmpset_int(&nm_rxq->nm_state, NM_BUSY, NM_ON); } } @@ -1464,7 +1464,7 @@ service_iq(struct sge_iq *iq, int budget) if (atomic_cmpset_int(&q->state, IQS_IDLE, IQS_BUSY)) { if (service_iq_fl(q, q->qsize / 16) == 0) { - atomic_cmpset_int(&q->state, + (void) atomic_cmpset_int(&q->state, IQS_BUSY, IQS_IDLE); } else { STAILQ_INSERT_TAIL(&iql, q, @@ -1512,7 +1512,7 @@ service_iq(struct sge_iq *iq, int budget) q = STAILQ_FIRST(&iql); STAILQ_REMOVE_HEAD(&iql, link); if (service_iq_fl(q, q->qsize / 8) == 0) - atomic_cmpset_int(&q->state, IQS_BUSY, IQS_IDLE); + (void) atomic_cmpset_int(&q->state, IQS_BUSY, IQS_IDLE); else STAILQ_INSERT_TAIL(&iql, q, link); } Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.c Mon Apr 29 05:02:54 2019 (r346881) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.c Mon Apr 29 05:26:27 2019 (r346882) @@ -1263,6 +1263,7 @@ lookup_offload_policy(struct adapter *sc, int open_typ if (pkt == NULL || pktlen == 0 || buflen == 0) return (&disallow_offloading_settings); + matched = 0; r = &op->rule[0]; for (i = 0; i < op->nrules; i++, r++) { if (r->open_type != open_type && From owner-svn-src-all@freebsd.org Mon Apr 29 05:35:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0BAF1581716; Mon, 29 Apr 2019 05:35:54 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1CF928CC4C; Mon, 29 Apr 2019 05:35:54 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6A331D9E8; Mon, 29 Apr 2019 05:35:53 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T5ZrMf034522; Mon, 29 Apr 2019 05:35:53 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T5Zrpm034518; Mon, 29 Apr 2019 05:35:53 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904290535.x3T5Zrpm034518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 05:35:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346883 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346883 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1CF928CC4C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 05:35:54 -0000 Author: np Date: Mon Apr 29 05:35:52 2019 New Revision: 346883 URL: https://svnweb.freebsd.org/changeset/base/346883 Log: MFC r338218: cxgbev(4): Updates to the VF driver to cope with recent ifmedia and ctrlq changes in the base driver. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/cxgbe/t4_sge.c stable/11/sys/dev/cxgbe/t4_vf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 05:26:27 2019 (r346882) +++ stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 05:35:52 2019 (r346883) @@ -1133,6 +1133,8 @@ int alloc_atid(struct adapter *, void *); void *lookup_atid(struct adapter *, int); void free_atid(struct adapter *, int); void release_tid(struct adapter *, int, struct sge_wrq *); +int cxgbe_media_change(struct ifnet *); +void cxgbe_media_status(struct ifnet *, struct ifmediareq *); #ifdef DEV_NETMAP /* t4_netmap.c */ Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 05:26:27 2019 (r346882) +++ stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 05:35:52 2019 (r346883) @@ -219,13 +219,11 @@ static driver_t vcc_driver = { sizeof(struct vi_info) }; -/* ifnet + media interface */ +/* ifnet interface */ static void cxgbe_init(void *); static int cxgbe_ioctl(struct ifnet *, unsigned long, caddr_t); static int cxgbe_transmit(struct ifnet *, struct mbuf *); static void cxgbe_qflush(struct ifnet *); -static int cxgbe_media_change(struct ifnet *); -static void cxgbe_media_status(struct ifnet *, struct ifmediareq *); MALLOC_DEFINE(M_CXGBE, "cxgbe", "Chelsio T4/T5 Ethernet driver and services"); @@ -2150,7 +2148,7 @@ cxgbe_get_counter(struct ifnet *ifp, ift_counter c) * The kernel picks a media from the list we had provided but we still validate * the requeste. */ -static int +int cxgbe_media_change(struct ifnet *ifp) { struct vi_info *vi = ifp->if_softc; @@ -2339,7 +2337,7 @@ port_mword(struct port_info *pi, uint32_t speed) return (IFM_UNKNOWN); } -static void +void cxgbe_media_status(struct ifnet *ifp, struct ifmediareq *ifmr) { struct vi_info *vi = ifp->if_softc; @@ -4532,7 +4530,9 @@ apply_link_config(struct port_info *pi) #endif rc = -t4_link_l1cfg(sc, sc->mbox, pi->tx_chan, lc); if (rc != 0) { - device_printf(pi->dev, "l1cfg failed: %d\n", rc); + /* Don't complain if the VF driver gets back an EPERM. */ + if (!(sc->flags & IS_VF) || rc != FW_EPERM) + device_printf(pi->dev, "l1cfg failed: %d\n", rc); } else { /* * An L1_CFG will almost always result in a link-change event if Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 05:26:27 2019 (r346882) +++ stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 05:35:52 2019 (r346883) @@ -1053,8 +1053,10 @@ t4_teardown_adapter_queues(struct adapter *sc) sc->flags &= ~ADAP_SYSCTL_CTX; } - for_each_port(sc, i) - free_wrq(sc, &sc->sge.ctrlq[i]); + if (!(sc->flags & IS_VF)) { + for_each_port(sc, i) + free_wrq(sc, &sc->sge.ctrlq[i]); + } free_fwq(sc); return (0); Modified: stable/11/sys/dev/cxgbe/t4_vf.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_vf.c Mon Apr 29 05:26:27 2019 (r346882) +++ stable/11/sys/dev/cxgbe/t4_vf.c Mon Apr 29 05:35:52 2019 (r346883) @@ -637,6 +637,10 @@ t4vf_attach(device_t dev) mtx_init(&pi->pi_lock, pi->lockname, 0, MTX_DEF); sc->chan_map[pi->tx_chan] = i; + /* All VIs on this port share this media. */ + ifmedia_init(&pi->media, IFM_IMASK, cxgbe_media_change, + cxgbe_media_status); + pi->dev = device_add_child(dev, sc->names->vf_ifnet_name, -1); if (pi->dev == NULL) { device_printf(dev, From owner-svn-src-all@freebsd.org Mon Apr 29 07:41:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9354415837C2; Mon, 29 Apr 2019 07:41:36 +0000 (UTC) (envelope-from Andre.Albsmeier@siemens.com) Received: from goliath.siemens.de (goliath.siemens.de [192.35.17.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "goliath.siemens.de", Issuer "Siemens Issuing CA Internet Server 2017" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7875683E2; Mon, 29 Apr 2019 07:41:25 +0000 (UTC) (envelope-from Andre.Albsmeier@siemens.com) Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id x3T7M8PL018843 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Apr 2019 09:22:08 +0200 Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.40.130]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id x3T7M8pO027430; Mon, 29 Apr 2019 09:22:08 +0200 Received: (from user@localhost) by curry.mchp.siemens.de (8.15.2/8.15.2) id x3T7M8vF055483; Date: Mon, 29 Apr 2019 09:22:08 +0200 From: Andre Albsmeier To: Rick Macklem Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r346775 - stable/11/usr.sbin/nfsdumpstate Message-ID: <20190429072208.GA73248@bali> References: <201904270213.x3R2DF8A098274@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201904270213.x3R2DF8A098274@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-Rspamd-Queue-Id: A7875683E2 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of Andre.Albsmeier@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=Andre.Albsmeier@siemens.com X-Spamd-Result: default: False [-4.97 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+exists:192.35.17.28.spf.siemens.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[siemens.com]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; MX_GOOD(-0.01)[zetes.siemens.com,hylas.siemens.com,paxos.siemens.com,hephaistos.siemens.com,meleagros.siemens.com]; NEURAL_HAM_SHORT(-0.92)[-0.918,0]; IP_SCORE(-1.75)[ipnet: 192.35.16.0/22(-4.83), asn: 15465(-3.89), country: DE(-0.01)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; ASN(0.00)[asn:15465, ipnet:192.35.16.0/22, country:DE]; RCVD_IN_DNSWL_HI(-0.50)[28.17.35.192.list.dnswl.org : 127.0.13.3] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 07:41:36 -0000 On Sat, 27-Apr-2019 at 02:13:15 +0000, Rick Macklem wrote: > Author: rmacklem > Date: Sat Apr 27 02:13:15 2019 > New Revision: 346775 > URL: https://svnweb.freebsd.org/changeset/base/346775 > > Log: > MFC: r346190 > Fix nfsdumpstate(8) so that it can print out INET6 callback addresses. > > The patch adds support for printing of INET6 callback addresses. > It also adds the #ifdef INET, INET6 as requested by bz@. We should also put ifdefs around the nbuf def: #ifdef INET6 char nbuf[INET6_ADDRSTRLEN]; #endif -Andre > > Modified: > stable/11/usr.sbin/nfsdumpstate/Makefile > stable/11/usr.sbin/nfsdumpstate/nfsdumpstate.c > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/usr.sbin/nfsdumpstate/Makefile > ============================================================================== > --- stable/11/usr.sbin/nfsdumpstate/Makefile Sat Apr 27 02:05:04 2019 (r346774) > +++ stable/11/usr.sbin/nfsdumpstate/Makefile Sat Apr 27 02:13:15 2019 (r346775) > @@ -1,6 +1,15 @@ > # $FreeBSD$ > > +.include > + > PROG= nfsdumpstate > MAN= nfsdumpstate.8 > + > +.if ${MK_INET_SUPPORT} != "no" > +CFLAGS+= -DINET > +.endif > +.if ${MK_INET6_SUPPORT} != "no" > +CFLAGS+= -DINET6 > +.endif > > .include > > Modified: stable/11/usr.sbin/nfsdumpstate/nfsdumpstate.c > ============================================================================== > --- stable/11/usr.sbin/nfsdumpstate/nfsdumpstate.c Sat Apr 27 02:05:04 2019 (r346774) > +++ stable/11/usr.sbin/nfsdumpstate/nfsdumpstate.c Sat Apr 27 02:13:15 2019 (r346775) > @@ -121,13 +121,14 @@ dump_openstate(void) > { > struct nfsd_dumplist dumplist; > int cnt, i; > + char nbuf[INET6_ADDRSTRLEN]; > > dumplist.ndl_size = DUMPSIZE; > dumplist.ndl_list = (void *)dp; > if (nfssvc(NFSSVC_DUMPCLIENTS, &dumplist) < 0) > errx(1, "Can't perform dump clients syscall"); > > - printf("%-13s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %-15s %s\n", > + printf("%-13s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %-45s %s\n", > "Flags", "OpenOwner", "Open", "LockOwner", > "Lock", "Deleg", "OldDeleg", "Clientaddr", "ClientID"); > /* > @@ -143,9 +144,23 @@ dump_openstate(void) > dp[cnt].ndcl_nlocks, > dp[cnt].ndcl_ndelegs, > dp[cnt].ndcl_nolddelegs); > - if (dp[cnt].ndcl_addrfam == AF_INET) > - printf("%-15s ", > + switch (dp[cnt].ndcl_addrfam) { > +#ifdef INET > + case AF_INET: > + printf("%-45s ", > inet_ntoa(dp[cnt].ndcl_cbaddr.sin_addr)); > + break; > +#endif > +#ifdef INET6 > + case AF_INET6: > + if (inet_ntop(AF_INET6, &dp[cnt].ndcl_cbaddr.sin6_addr, > + nbuf, sizeof(nbuf)) != NULL) > + printf("%-45s ", nbuf); > + else > + printf("%-45s ", " "); > + break; > +#endif > + } > for (i = 0; i < dp[cnt].ndcl_clid.nclid_idlen; i++) > printf("%02x", dp[cnt].ndcl_clid.nclid_id[i]); > printf("\n"); > _______________________________________________ > svn-src-stable-11@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11 > To unsubscribe, send any mail to "svn-src-stable-11-unsubscribe@freebsd.org" -- Linux is only free if your time is worthless. From owner-svn-src-all@freebsd.org Mon Apr 29 09:33:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48B4815861D6; Mon, 29 Apr 2019 09:33:17 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE5B06D13B; Mon, 29 Apr 2019 09:33:16 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5000201F0; Mon, 29 Apr 2019 09:33:16 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T9XG2X061998; Mon, 29 Apr 2019 09:33:16 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T9XGDE061997; Mon, 29 Apr 2019 09:33:16 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201904290933.x3T9XGDE061997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 29 Apr 2019 09:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346884 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 346884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE5B06D13B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 09:33:17 -0000 Author: ae Date: Mon Apr 29 09:33:16 2019 New Revision: 346884 URL: https://svnweb.freebsd.org/changeset/base/346884 Log: Add IPv6 support for O_IPLEN opcode. Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Mon Apr 29 05:35:52 2019 (r346883) +++ head/sys/netpfil/ipfw/ip_fw2.c Mon Apr 29 09:33:16 2019 (r346884) @@ -2191,9 +2191,11 @@ do { \ break; case O_IPID: - case O_IPLEN: case O_IPTTL: - if (is_ipv4) { /* only for IP packets */ + if (!is_ipv4) + break; + case O_IPLEN: + { /* only for IP packets */ uint16_t x; uint16_t *p; int i; From owner-svn-src-all@freebsd.org Mon Apr 29 09:52:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A770615865B9; Mon, 29 Apr 2019 09:52:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42F686D911; Mon, 29 Apr 2019 09:52:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37C9920553; Mon, 29 Apr 2019 09:52:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T9qseh072037; Mon, 29 Apr 2019 09:52:54 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T9qsTG072036; Mon, 29 Apr 2019 09:52:54 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201904290952.x3T9qsTG072036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 29 Apr 2019 09:52:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346885 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 346885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 42F686D911 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 09:52:54 -0000 Author: ae Date: Mon Apr 29 09:52:53 2019 New Revision: 346885 URL: https://svnweb.freebsd.org/changeset/base/346885 Log: Handle HAVE_PROTO flag and print "proto" keyword for O_IP4 and O_IP6 opcodes when it is needed. This should fix the problem, when printed by `ipfw show` rule could not be added due to missing "proto" keyword. MFC after: 2 weeks Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Mon Apr 29 09:33:16 2019 (r346884) +++ head/sbin/ipfw/ipfw2.c Mon Apr 29 09:52:53 2019 (r346885) @@ -1701,9 +1701,13 @@ print_instruction(struct buf_pr *bp, const struct form IPFW_TLV_STATE_NAME)); break; case O_IP6: + if (state->flags & HAVE_PROTO) + bprintf(bp, " proto"); bprintf(bp, " ip6"); break; case O_IP4: + if (state->flags & HAVE_PROTO) + bprintf(bp, " proto"); bprintf(bp, " ip4"); break; case O_ICMP6TYPE: From owner-svn-src-all@freebsd.org Mon Apr 29 13:20:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56C0A158C82E; Mon, 29 Apr 2019 13:20:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF80876E49; Mon, 29 Apr 2019 13:20:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C62972275A; Mon, 29 Apr 2019 13:20:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TDKOb4077316; Mon, 29 Apr 2019 13:20:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TDKO75077315; Mon, 29 Apr 2019 13:20:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201904291320.x3TDKO75077315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 29 Apr 2019 13:20:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346886 - stable/12/sys/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/conf X-SVN-Commit-Revision: 346886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EF80876E49 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 13:20:25 -0000 Author: markj Date: Mon Apr 29 13:20:24 2019 New Revision: 346886 URL: https://svnweb.freebsd.org/changeset/base/346886 Log: MFC r346544: Clarify the relationship between INVARIANTS and DIAGNOSTIC a bit. Modified: stable/12/sys/conf/NOTES Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/conf/NOTES ============================================================================== --- stable/12/sys/conf/NOTES Mon Apr 29 09:52:53 2019 (r346885) +++ stable/12/sys/conf/NOTES Mon Apr 29 13:20:24 2019 (r346886) @@ -563,8 +563,10 @@ options KASSERT_PANIC_OPTIONAL # # The DIAGNOSTIC option is used to enable extra debugging information -# from some parts of the kernel. As this makes everything more noisy, -# it is disabled by default. +# and invariants checking. The added checks are too expensive or noisy +# for an INVARIANTS kernel and thus are disabled by default. It is +# expected that a kernel configured with DIAGNOSTIC will also have the +# INVARIANTS option enabled. # options DIAGNOSTIC From owner-svn-src-all@freebsd.org Mon Apr 29 13:20:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1837D158C8D0; Mon, 29 Apr 2019 13:20:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3EA1770D6; Mon, 29 Apr 2019 13:20:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F3E122776; Mon, 29 Apr 2019 13:20:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TDKt2S077500; Mon, 29 Apr 2019 13:20:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TDKtv6077499; Mon, 29 Apr 2019 13:20:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201904291320.x3TDKtv6077499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 29 Apr 2019 13:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346887 - stable/11/sys/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/conf X-SVN-Commit-Revision: 346887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B3EA1770D6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 13:20:56 -0000 Author: markj Date: Mon Apr 29 13:20:55 2019 New Revision: 346887 URL: https://svnweb.freebsd.org/changeset/base/346887 Log: MFC r346544: Clarify the relationship between INVARIANTS and DIAGNOSTIC a bit. Modified: stable/11/sys/conf/NOTES Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/NOTES ============================================================================== --- stable/11/sys/conf/NOTES Mon Apr 29 13:20:24 2019 (r346886) +++ stable/11/sys/conf/NOTES Mon Apr 29 13:20:55 2019 (r346887) @@ -559,8 +559,10 @@ options INVARIANT_SUPPORT # # The DIAGNOSTIC option is used to enable extra debugging information -# from some parts of the kernel. As this makes everything more noisy, -# it is disabled by default. +# and invariants checking. The added checks are too expensive or noisy +# for an INVARIANTS kernel and thus are disabled by default. It is +# expected that a kernel configured with DIAGNOSTIC will also have the +# INVARIANTS option enabled. # options DIAGNOSTIC From owner-svn-src-all@freebsd.org Mon Apr 29 13:23:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5400A158CC58; Mon, 29 Apr 2019 13:23:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAE63775BD; Mon, 29 Apr 2019 13:23:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAA6D22911; Mon, 29 Apr 2019 13:23:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TDNWF1082518; Mon, 29 Apr 2019 13:23:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TDNWdX082517; Mon, 29 Apr 2019 13:23:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201904291323.x3TDNWdX082517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 29 Apr 2019 13:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346888 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 346888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EAE63775BD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 13:23:33 -0000 Author: markj Date: Mon Apr 29 13:23:32 2019 New Revision: 346888 URL: https://svnweb.freebsd.org/changeset/base/346888 Log: Stop checking TD_IDLETHREAD() in buffer cache routines. These predicates are vestigal and cannot be true today. For example, idle threads are not allowed to acquire locks. Also cache curthread in breada(). No functional change intended. Reviewed by: kib, mckusick MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20066 Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon Apr 29 13:20:55 2019 (r346887) +++ head/sys/kern/vfs_bio.c Mon Apr 29 13:23:32 2019 (r346888) @@ -2073,8 +2073,11 @@ breada(struct vnode * vp, daddr_t * rablkno, int * rab struct ucred * cred, int flags, void (*ckhashfunc)(struct buf *)) { struct buf *rabp; + struct thread *td; int i; + td = curthread; + for (i = 0; i < cnt; i++, rablkno++, rabsize++) { if (inmem(vp, *rablkno)) continue; @@ -2083,16 +2086,14 @@ breada(struct vnode * vp, daddr_t * rablkno, int * rab brelse(rabp); continue; } - if (!TD_IS_IDLETHREAD(curthread)) { #ifdef RACCT - if (racct_enable) { - PROC_LOCK(curproc); - racct_add_buf(curproc, rabp, 0); - PROC_UNLOCK(curproc); - } -#endif /* RACCT */ - curthread->td_ru.ru_inblock++; + if (racct_enable) { + PROC_LOCK(curproc); + racct_add_buf(curproc, rabp, 0); + PROC_UNLOCK(curproc); } +#endif /* RACCT */ + td->td_ru.ru_inblock++; rabp->b_flags |= B_ASYNC; rabp->b_flags &= ~B_INVAL; if ((flags & GB_CKHASH) != 0) { @@ -2148,16 +2149,14 @@ breadn_flags(struct vnode *vp, daddr_t blkno, int size */ readwait = 0; if ((bp->b_flags & B_CACHE) == 0) { - if (!TD_IS_IDLETHREAD(td)) { #ifdef RACCT - if (racct_enable) { - PROC_LOCK(td->td_proc); - racct_add_buf(td->td_proc, bp, 0); - PROC_UNLOCK(td->td_proc); - } -#endif /* RACCT */ - td->td_ru.ru_inblock++; + if (racct_enable) { + PROC_LOCK(td->td_proc); + racct_add_buf(td->td_proc, bp, 0); + PROC_UNLOCK(td->td_proc); } +#endif /* RACCT */ + td->td_ru.ru_inblock++; bp->b_iocmd = BIO_READ; bp->b_flags &= ~B_INVAL; if ((flags & GB_CKHASH) != 0) { @@ -2258,16 +2257,14 @@ bufwrite(struct buf *bp) bp->b_runningbufspace = bp->b_bufsize; space = atomic_fetchadd_long(&runningbufspace, bp->b_runningbufspace); - if (!TD_IS_IDLETHREAD(curthread)) { #ifdef RACCT - if (racct_enable) { - PROC_LOCK(curproc); - racct_add_buf(curproc, bp, 1); - PROC_UNLOCK(curproc); - } -#endif /* RACCT */ - curthread->td_ru.ru_oublock++; + if (racct_enable) { + PROC_LOCK(curproc); + racct_add_buf(curproc, bp, 1); + PROC_UNLOCK(curproc); } +#endif /* RACCT */ + curthread->td_ru.ru_oublock++; if (oldflags & B_ASYNC) BUF_KERNPROC(bp); bp->b_iooffset = dbtob(bp->b_blkno); @@ -4019,9 +4016,6 @@ loop: */ if (flags & GB_NOCREAT) return (EEXIST); - if (bdomain[bo->bo_domain].bd_freebuffers == 0 && - TD_IS_IDLETHREAD(curthread)) - return (EBUSY); bsize = vn_isdisk(vp, NULL) ? DEV_BSIZE : bo->bo_bsize; KASSERT(bsize != 0, ("bsize == 0, check bo->bo_bsize")); From owner-svn-src-all@freebsd.org Mon Apr 29 13:52:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1851A158E533; Mon, 29 Apr 2019 13:52:35 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-eopbgr670089.outbound.protection.outlook.com [40.107.67.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A4DC781530; Mon, 29 Apr 2019 13:52:34 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YQBPR0101MB2260.CANPRD01.PROD.OUTLOOK.COM (52.132.70.13) by YQBPR0101MB2259.CANPRD01.PROD.OUTLOOK.COM (52.132.73.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.13; Mon, 29 Apr 2019 13:52:32 +0000 Received: from YQBPR0101MB2260.CANPRD01.PROD.OUTLOOK.COM ([fe80::8128:ff77:e6ac:fe1a]) by YQBPR0101MB2260.CANPRD01.PROD.OUTLOOK.COM ([fe80::8128:ff77:e6ac:fe1a%5]) with mapi id 15.20.1835.018; Mon, 29 Apr 2019 13:52:32 +0000 From: Rick Macklem To: Andre Albsmeier , Rick Macklem CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-stable@freebsd.org" , "svn-src-stable-11@freebsd.org" Subject: Re: svn commit: r346775 - stable/11/usr.sbin/nfsdumpstate Thread-Topic: svn commit: r346775 - stable/11/usr.sbin/nfsdumpstate Thread-Index: AQHU/l781N2YjcOh9U+mgYJKrUSIy6ZTJ/Tu Date: Mon, 29 Apr 2019 13:52:32 +0000 Message-ID: References: <201904270213.x3R2DF8A098274@repo.freebsd.org>, <20190429072208.GA73248@bali> In-Reply-To: <20190429072208.GA73248@bali> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 16afdf55-c1a7-45df-1ebe-08d6cca9edb2 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:YQBPR0101MB2259; x-ms-traffictypediagnostic: YQBPR0101MB2259: x-ms-exchange-purlcount: 2 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:22; x-forefront-prvs: 0022134A87 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(346002)(39860400002)(366004)(396003)(376002)(199004)(189003)(256004)(446003)(86362001)(316002)(76176011)(4326008)(7696005)(14444005)(99286004)(68736007)(486006)(11346002)(97736004)(6246003)(786003)(8936002)(6306002)(9686003)(478600001)(74482002)(46003)(64756008)(81166006)(186003)(81156014)(8676002)(66946007)(55016002)(74316002)(110136005)(305945005)(66476007)(66556008)(66446008)(76116006)(966005)(229853002)(73956011)(476003)(53936002)(6436002)(54906003)(14454004)(52536014)(71190400001)(71200400001)(2906002)(53546011)(6506007)(25786009)(33656002)(102836004)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:YQBPR0101MB2259; H:YQBPR0101MB2260.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: TKkD6qQPqlc2vqpT3Z25iEc8QdUC2LVKl5cMc3exqLvkHrPov2hFv4YAEB77NWzWBfAg1lkNF6ruZRXXbl+V2DUmfmxoWgMYmPJiPv5Ps1OTvgjPnyzWoP9MIbe5Y00UmFNRWHaDfBQR4VCvptRRaefXmuAxRUIGTVreWc5zh7ikfILOsE0InOX7WhD5f4La0H/FB6wD5iIg6I9g4r/K/fLtDpFeGbh5yi2OSICs7TbbGMTOiLP/DtsAlIuHSmc9BEMUcMRGU8piyeUgNYAq1/HmjmjJr2J8d1zrYr8eN246HgS94J68lCVLXWO6pSnOnEZcDX3QuOJn338o5Bj5PjYB3qih71Ju83r/Li8YKi2tbMDNOOJt2jp3zmAfpvTzYewYIyZEu2i9PK1ARjKr2O8EHBw4uLaNLuyciHuzCUc= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: 16afdf55-c1a7-45df-1ebe-08d6cca9edb2 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Apr 2019 13:52:32.7966 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: YQBPR0101MB2259 X-Rspamd-Queue-Id: A4DC781530 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 13:52:35 -0000 Yes. Someone pointed out that was needed for some builds to avoid an "unused variable" warning. (I don't get the warning when I do a build.) The change was committed to head as r346856 yesterday with a 1 week MFC. rick ________________________________________ From: Andre Albsmeier Sent: Monday, April 29, 2019 3:22:08 AM To: Rick Macklem Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src-stable@fre= ebsd.org; svn-src-stable-11@freebsd.org Subject: Re: svn commit: r346775 - stable/11/usr.sbin/nfsdumpstate On Sat, 27-Apr-2019 at 02:13:15 +0000, Rick Macklem wrote: > Author: rmacklem > Date: Sat Apr 27 02:13:15 2019 > New Revision: 346775 > URL: https://svnweb.freebsd.org/changeset/base/346775 > > Log: > MFC: r346190 > Fix nfsdumpstate(8) so that it can print out INET6 callback addresses. > > The patch adds support for printing of INET6 callback addresses. > It also adds the #ifdef INET, INET6 as requested by bz@. We should also put ifdefs around the nbuf def: #ifdef INET6 char nbuf[INET6_ADDRSTRLEN]; #endif -Andre > > Modified: > stable/11/usr.sbin/nfsdumpstate/Makefile > stable/11/usr.sbin/nfsdumpstate/nfsdumpstate.c > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/usr.sbin/nfsdumpstate/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/11/usr.sbin/nfsdumpstate/Makefile Sat Apr 27 02:05:04 2019 = (r346774) > +++ stable/11/usr.sbin/nfsdumpstate/Makefile Sat Apr 27 02:13:15 2019 = (r346775) > @@ -1,6 +1,15 @@ > # $FreeBSD$ > > +.include > + > PROG=3D nfsdumpstate > MAN=3D nfsdumpstate.8 > + > +.if ${MK_INET_SUPPORT} !=3D "no" > +CFLAGS+=3D -DINET > +.endif > +.if ${MK_INET6_SUPPORT} !=3D "no" > +CFLAGS+=3D -DINET6 > +.endif > > .include > > Modified: stable/11/usr.sbin/nfsdumpstate/nfsdumpstate.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/11/usr.sbin/nfsdumpstate/nfsdumpstate.c Sat Apr 27 02:05:04= 2019 (r346774) > +++ stable/11/usr.sbin/nfsdumpstate/nfsdumpstate.c Sat Apr 27 02:13:15= 2019 (r346775) > @@ -121,13 +121,14 @@ dump_openstate(void) > { > struct nfsd_dumplist dumplist; > int cnt, i; > + char nbuf[INET6_ADDRSTRLEN]; > > dumplist.ndl_size =3D DUMPSIZE; > dumplist.ndl_list =3D (void *)dp; > if (nfssvc(NFSSVC_DUMPCLIENTS, &dumplist) < 0) > errx(1, "Can't perform dump clients syscall"); > > - printf("%-13s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %-15s %s\n", > + printf("%-13s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %-45s %s\n", > "Flags", "OpenOwner", "Open", "LockOwner", > "Lock", "Deleg", "OldDeleg", "Clientaddr", "ClientID"); > /* > @@ -143,9 +144,23 @@ dump_openstate(void) > dp[cnt].ndcl_nlocks, > dp[cnt].ndcl_ndelegs, > dp[cnt].ndcl_nolddelegs); > - if (dp[cnt].ndcl_addrfam =3D=3D AF_INET) > - printf("%-15s ", > + switch (dp[cnt].ndcl_addrfam) { > +#ifdef INET > + case AF_INET: > + printf("%-45s ", > inet_ntoa(dp[cnt].ndcl_cbaddr.sin_addr)); > + break; > +#endif > +#ifdef INET6 > + case AF_INET6: > + if (inet_ntop(AF_INET6, &dp[cnt].ndcl_cbaddr.sin6_a= ddr, > + nbuf, sizeof(nbuf)) !=3D NULL) > + printf("%-45s ", nbuf); > + else > + printf("%-45s ", " "); > + break; > +#endif > + } > for (i =3D 0; i < dp[cnt].ndcl_clid.nclid_idlen; i++) > printf("%02x", dp[cnt].ndcl_clid.nclid_id[i]); > printf("\n"); > _______________________________________________ > svn-src-stable-11@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11 > To unsubscribe, send any mail to "svn-src-stable-11-unsubscribe@freebsd.o= rg" -- Linux is only free if your time is worthless. From owner-svn-src-all@freebsd.org Mon Apr 29 14:09:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA535158F81B; Mon, 29 Apr 2019 14:09:15 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f171.google.com (mail-it1-f171.google.com [209.85.166.171]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 1AD3D82E34; Mon, 29 Apr 2019 14:09:15 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f171.google.com with SMTP id w15so16555499itc.0; Mon, 29 Apr 2019 07:09: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; bh=QPwGYWXU16wZNzDtnXnS3hjjcAOlOeQCvJJ385/EKEg=; b=lN7CBTjqRketr/imVjX7byImG0JHIPLLPEM5e21+7TtYmMZTxqc9I1V72vuXKdrSd+ ocNs7+/EsNulJyY2NKrAqnHO+c9YX1Ok0gRsx+QKj92N08dlcAfdRfhyb10kpmvADgDg vYVgj3Ikx2kd4wa8zpq22yMlkM7eY+8tKfJltIV5ptNmn40k5jjiaKi8ejyxcoq56bHA l2rSQrQazsECdTXdGE6j1IXbSTvTcSZ4AHiqvQ1WFwYn0jywYOSkTRJP5JixGrL2SwKa 9MR6RVvXQ+Txd7ZhzokB2sp43S3pe6WBOwLDUzKpZhxk3OdnFjL6HkedirLmTCvomeNR BcGw== X-Gm-Message-State: APjAAAXhzcAgGl7ZDMCoeWvAQaUymwigT+mNJ9+IfKWSfdSxRJ9Eo6XH SIC0wIKbekWPXkLz9QX1qe4y4HR69qk8gJCHREywDA== X-Google-Smtp-Source: APXvYqzkga1+BBtjAnHskTfch1IREYRiBmSwkGebft0iY5VVluCMdWnFizIArZ5UCgzqQgFd7Id3KPpKNV0mFa/045g= X-Received: by 2002:a05:660c:12d2:: with SMTP id k18mr18566601itd.33.1556546947247; Mon, 29 Apr 2019 07:09:07 -0700 (PDT) MIME-Version: 1.0 References: <201904231511.x3NFB1tR032938@repo.freebsd.org> <201904231725.x3NHPqCt038790@gndrsh.dnsmgr.net> In-Reply-To: <201904231725.x3NHPqCt038790@gndrsh.dnsmgr.net> From: Ed Maste Date: Mon, 29 Apr 2019 10:08:55 -0400 Message-ID: Subject: Re: svn commit: r346598 - head/sys/modules To: "Rodney W. Grimes" Cc: src-committers , svn-src-all , svn-src-head , Greg V Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 1AD3D82E34 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.171 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-5.52 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.88)[-0.875,0]; RCVD_IN_DNSWL_NONE(0.00)[171.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.63)[ip: (-6.99), ipnet: 209.85.128.0/17(-3.86), asn: 15169(-2.24), country: US(-0.06)]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 14:09:16 -0000 On Tue, 23 Apr 2019 at 13:26, Rodney W. Grimes wrote: > > Very cool, now how do I get a PCIe slot into a RPI3!!! lol :-) I know you're joking but the comment does highlight an issue in the AArch64 world - there's a lack of good mid-range developer platforms. FreeBSD runs on Cavium/Marvell ThunderX and ThunderX2 and now on Ampere eMAG with the WIP discussed in PR 237055. These platforms have room for lots of memory, very high core/thread counts (32 to 256), and a good complement of PCIe interfaces. The specs go far beyond those of a typical desktop software development platform, and the price does too. We also run on small embedded boards like the RPi, Pine64, etc. just fine, but there's not much in the middle. What we really need is something like a Mini-ITX form factor 4 to 8 core system that can take 8 to 32GB of RAM, has a PCIe slot or two, and is readily available selling for well below $1000 US. > I am hopeing some of that PCIe WIP might include some of the > bits needed or do we already have PCIe slot on RockPro64 code that works? I don't think this will do anything for RockPro64, it's just a workaround for limitations in our current arm64 PCI code for some functionality unused by ThunderX* but required for eMAG. From owner-svn-src-all@freebsd.org Mon Apr 29 14:13:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F07EC158FF8E; Mon, 29 Apr 2019 14:13:54 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98C4D83810; Mon, 29 Apr 2019 14:13:54 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7373D231DC; Mon, 29 Apr 2019 14:13:54 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TEDs5m008473; Mon, 29 Apr 2019 14:13:54 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TEDrYi008469; Mon, 29 Apr 2019 14:13:53 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904291413.x3TEDrYi008469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 29 Apr 2019 14:13:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346889 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 98C4D83810 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 14:13:55 -0000 Author: bde Date: Mon Apr 29 14:13:53 2019 New Revision: 346889 URL: https://svnweb.freebsd.org/changeset/base/346889 Log: Refactor and simplify hiding the mouse cursor and fix bugs caused by complications in the previous methods. r346761 broke showing the mouse cursor after changing its state from off to on (including initially), since showing the cursor uses the state to decide whether to actually show and the state variable was not changed until after null showing. Moving the mouse or copying under the cursor fixed the problem. Fix this and similar problems for the on to off transition by changing the state variable before drawing the cursor. r346641 failed to turn off the mouse cursor on exit from vgl. It hid the cursor only temporarily for clearing. This doesn't change the state variable, so unhiding the cursor after clearing restored the cursor if its state was on. Fix this by changing its state to VGL_MOUSEHIDE using the application API for changing the state. Remove the VGLMouseVisible state variable and the extra states given by it. This was an optimization that was just an obfuscation in at least the previous version. Staticize VGLMouseAction(). Remove VGLMousePointerShow/Hide() except as internals in __VGLMouseMode(). __VGLMouseMouseMode() is the same as the application API VGLMouseMouseMode() except it returns the previous mode which callers need to know to restore it after hiding the cursor. Use the refactoring to make minor improvements in a simpler way than was possible: - in VGLMouseAction(), only hide and and unhide the mouse cursor if the mouse moved - in VGLClear(), only hide and and unhide the mouse cursor if the clearing method would otherwise clear the cursor. Modified: head/lib/libvgl/main.c head/lib/libvgl/mouse.c head/lib/libvgl/simple.c head/lib/libvgl/vgl.h Modified: head/lib/libvgl/main.c ============================================================================== --- head/lib/libvgl/main.c Mon Apr 29 13:23:32 2019 (r346888) +++ head/lib/libvgl/main.c Mon Apr 29 14:13:53 2019 (r346889) @@ -77,7 +77,7 @@ struct vt_mode smode; signal(SIGUSR2, SIG_IGN); VGLSwitchPending = 0; VGLAbortPending = 0; - VGLMousePointerHide(); + VGLMouseMode(VGL_MOUSEHIDE); if (VGLMem != MAP_FAILED) { VGLClear(VGLDisplay, 0); Modified: head/lib/libvgl/mouse.c ============================================================================== --- head/lib/libvgl/mouse.c Mon Apr 29 13:23:32 2019 (r346888) +++ head/lib/libvgl/mouse.c Mon Apr 29 14:13:53 2019 (r346889) @@ -39,6 +39,8 @@ __FBSDID("$FreeBSD$"); #include #include "vgl.h" +static void VGLMouseAction(int dummy); + #define BORDER 0xff /* default border -- light white in rgb 3:3:2 */ #define INTERIOR 0xa0 /* default interior -- red in rgb 3:3:2 */ #define X 0xff /* any nonzero in And mask means part of cursor */ @@ -88,7 +90,6 @@ static VGLBitmap VGLMouseStdAndMask = static VGLBitmap VGLMouseStdOrMask = VGLBITMAP_INITIALIZER(MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, StdOrMask); static VGLBitmap *VGLMouseAndMask, *VGLMouseOrMask; -static int VGLMouseVisible = 0; static int VGLMouseShown = VGL_MOUSEHIDE; static int VGLMouseXpos = 0; static int VGLMouseYpos = 0; @@ -102,51 +103,44 @@ static volatile sig_atomic_t VGLMsuppressint; VGLMouseAction(0); \ } while (0) -void -VGLMousePointerShow() +int +__VGLMouseMode(int mode) { - if (!VGLMouseVisible) { - INTOFF(); - VGLMouseVisible = 1; - __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, VGLDisplay, - VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, -MOUSE_IMG_SIZE); - INTON(); - } -} + int oldmode; -void -VGLMousePointerHide() -{ - if (VGLMouseVisible) { - INTOFF(); - VGLMouseVisible = 0; - __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, VGLDisplay, - VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE); - INTON(); - } -} - -void -VGLMouseMode(int mode) -{ + INTOFF(); + oldmode = VGLMouseShown; if (mode == VGL_MOUSESHOW) { if (VGLMouseShown == VGL_MOUSEHIDE) { - VGLMousePointerShow(); VGLMouseShown = VGL_MOUSESHOW; + __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, VGLDisplay, + VGLMouseXpos, VGLMouseYpos, + MOUSE_IMG_SIZE, -MOUSE_IMG_SIZE); } } else { if (VGLMouseShown == VGL_MOUSESHOW) { - VGLMousePointerHide(); VGLMouseShown = VGL_MOUSEHIDE; + __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, VGLDisplay, + VGLMouseXpos, VGLMouseYpos, + MOUSE_IMG_SIZE, MOUSE_IMG_SIZE); } } + INTON(); + return oldmode; } void +VGLMouseMode(int mode) +{ + __VGLMouseMode(mode); +} + +static void VGLMouseAction(int dummy) { struct mouse_info mouseinfo; + int mousemode; if (VGLMsuppressint) { VGLMintpending = 1; @@ -157,13 +151,14 @@ again: VGLMintpending = 0; mouseinfo.operation = MOUSE_GETINFO; ioctl(0, CONS_MOUSECTL, &mouseinfo); - if (VGLMouseShown == VGL_MOUSESHOW) - VGLMousePointerHide(); - VGLMouseXpos = mouseinfo.u.data.x; - VGLMouseYpos = mouseinfo.u.data.y; + if (VGLMouseXpos != mouseinfo.u.data.x || + VGLMouseYpos != mouseinfo.u.data.y) { + mousemode = __VGLMouseMode(VGL_MOUSEHIDE); + VGLMouseXpos = mouseinfo.u.data.x; + VGLMouseYpos = mouseinfo.u.data.y; + __VGLMouseMode(mousemode); + } VGLMouseButtons = mouseinfo.u.data.buttons; - if (VGLMouseShown == VGL_MOUSESHOW) - VGLMousePointerShow(); /* * Loop to handle any new (suppressed) signals. This is INTON() without @@ -178,9 +173,10 @@ again: void VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask) { - if (VGLMouseShown == VGL_MOUSESHOW) - VGLMousePointerHide(); + int mousemode; + mousemode = __VGLMouseMode(VGL_MOUSEHIDE); + VGLMouseAndMask = AndMask; if (VGLMouseOrMask != NULL) { @@ -191,8 +187,7 @@ VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask VGLBitmapAllocateBits(VGLMouseOrMask); VGLBitmapCvt(OrMask, VGLMouseOrMask); - if (VGLMouseShown == VGL_MOUSESHOW) - VGLMousePointerShow(); + __VGLMouseMode(mousemode); } void Modified: head/lib/libvgl/simple.c ============================================================================== --- head/lib/libvgl/simple.c Mon Apr 29 13:23:32 2019 (r346888) +++ head/lib/libvgl/simple.c Mon Apr 29 14:13:53 2019 (r346889) @@ -465,14 +465,11 @@ void VGLClear(VGLBitmap *object, u_long color) { VGLBitmap src; - int i, len, mouseoverlap, offset; + int i, len, mousemode, offset; VGLCheckSwitch(); if (object == VGLDisplay) { VGLMouseFreeze(); - mouseoverlap = VGLMouseOverlap(0, 0, object->VXsize, object->VYsize); - if (mouseoverlap) - VGLMousePointerHide(); VGLClear(&VGLVDisplay, color); } else if (object->Type != MEMBUF) return; /* invalid */ @@ -503,14 +500,17 @@ VGLClear(VGLBitmap *object, u_long color) break; case VIDBUF8X: + mousemode = __VGLMouseMode(VGL_MOUSEHIDE); /* XXX works only for Xsize % 4 = 0 */ outb(0x3c6, 0xff); outb(0x3c4, 0x02); outb(0x3c5, 0x0f); memset(object->Bitmap, (byte)color, VGLAdpInfo.va_line_width*object->VYsize); + __VGLMouseMode(mousemode); break; case VIDBUF4: case VIDBUF4S: + mousemode = __VGLMouseMode(VGL_MOUSEHIDE); /* XXX works only for Xsize % 8 = 0 */ outb(0x3c4, 0x02); outb(0x3c5, 0x0f); outb(0x3ce, 0x05); outb(0x3cf, 0x02); /* mode 2 */ @@ -524,13 +524,11 @@ VGLClear(VGLBitmap *object, u_long color) offset += len; } outb(0x3ce, 0x05); outb(0x3cf, 0x00); + __VGLMouseMode(mousemode); break; } - if (object == VGLDisplay) { - if (mouseoverlap) - VGLMousePointerShow(); + if (object == VGLDisplay) VGLMouseUnFreeze(); - } } static inline u_long Modified: head/lib/libvgl/vgl.h ============================================================================== --- head/lib/libvgl/vgl.h Mon Apr 29 13:23:32 2019 (r346888) +++ head/lib/libvgl/vgl.h Mon Apr 29 14:13:53 2019 (r346889) @@ -125,10 +125,8 @@ int VGLSetVScreenSize(VGLBitmap *object, int VXsize, i int VGLPanScreen(VGLBitmap *object, int x, int y); int VGLSetSegment(unsigned int offset); /* mouse.c */ -void VGLMousePointerShow(void); -void VGLMousePointerHide(void); +int __VGLMouseMode(int mode); void VGLMouseMode(int mode); -void VGLMouseAction(int dummy); void VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask); void VGLMouseSetStdImage(void); int VGLMouseInit(int mode); From owner-svn-src-all@freebsd.org Mon Apr 29 14:21:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B62151590704; Mon, 29 Apr 2019 14:21:03 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E7C9841C1; Mon, 29 Apr 2019 14:21:02 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x3TEL0sk072639; Mon, 29 Apr 2019 07:21:00 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x3TEL00P072638; Mon, 29 Apr 2019 07:21:00 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201904291421.x3TEL00P072638@gndrsh.dnsmgr.net> Subject: Re: svn commit: r346598 - head/sys/modules In-Reply-To: To: Ed Maste Date: Mon, 29 Apr 2019 07:21:00 -0700 (PDT) CC: "Rodney W. Grimes" , src-committers , svn-src-all , svn-src-head , Greg V Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 2E7C9841C1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 14:21:03 -0000 > On Tue, 23 Apr 2019 at 13:26, Rodney W. Grimes > wrote: > > > > Very cool, now how do I get a PCIe slot into a RPI3!!! lol :-) > > I know you're joking but the comment does highlight an issue in the > AArch64 world - there's a lack of good mid-range developer platforms. I may of been joking with respect to the RPI3, but at the same time I do know that the RockPro64 exists and does have that PCIe slot I want, I also know that Michael Dexter has one he would loan me should I wish to investigate our state of support. > FreeBSD runs on Cavium/Marvell ThunderX and ThunderX2 and now on > Ampere eMAG with the WIP discussed in PR 237055. These platforms have > room for lots of memory, very high core/thread counts (32 to 256), and > a good complement of PCIe interfaces. The specs go far beyond those of > a typical desktop software development platform, and the price does > too. We also run on small embedded boards like the RPi, Pine64, etc. > just fine, but there's not much in the middle. What we really need is > something like a Mini-ITX form factor 4 to 8 core system that can take > 8 to 32GB of RAM, has a PCIe slot or two, and is readily available > selling for well below $1000 US. > > > I am hopeing some of that PCIe WIP might include some of the > > bits needed or do we already have PCIe slot on RockPro64 code that works? > > I don't think this will do anything for RockPro64, it's just a > workaround for limitations in our current arm64 PCI code for some > functionality unused by ThunderX* but required for eMAG. Ok -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon Apr 29 14:49:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D497715925CE; Mon, 29 Apr 2019 14:49:09 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A42B862FA; Mon, 29 Apr 2019 14:49:09 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.4] (c-71-56-186-158.hsd1.va.comcast.net [71.56.186.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id 624642700187; Mon, 29 Apr 2019 10:49:02 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu 624642700187 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1556549342; bh=Zw9qhMiEn959FQEMRjRuPSLIaJ4Rh2sHVYZiEmgmtIs=; h=Subject:To:From:Date:From; b=aVdwuRLiMDyWBwCgAfFOfJhkHVQjbSwuJj+RO5c8CJSmogiDB3pO9GJ951gwlJU1K gZzlN4qdHM4dKZ5lFXrxevO+TAvm1PtaGIPWEpBh6e5V4NqXHDAz2WWoOHfky/PlDk Q/yG1T8Ce4rmJfujMdGCEr3Dh8oT7D3EjmrDWgZMY6pVxfnCJNfQSGF7dDNV7JdVq2 tEeLCaihjPpTsQer+8VCZjJnV5rWlb2JQe3DKPD0yiuQljQhUyz610aUoJPht7vKjd wBQ10p9TmwHvr7Qqa4IrPgQGXedpTq6Lm0vUYRI5iVqcU1Axy2hYYvxinF9JBCM1Xe AUEi2jUPbt4qg== Subject: Re: svn commit: r346598 - head/sys/modules To: rgrimes@freebsd.org, Ed Maste Cc: src-committers , svn-src-all , svn-src-head , Greg V References: <201904291421.x3TEL00P072638@gndrsh.dnsmgr.net> From: Andrew Gallatin Message-ID: <6e19943d-d680-9b83-dd8a-0da58a5f5d37@cs.duke.edu> Date: Mon, 29 Apr 2019 10:49:01 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201904291421.x3TEL00P072638@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 7A42B862FA X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.969,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 14:49:10 -0000 On 2019-04-29 10:21, Rodney W. Grimes wrote: >> On Tue, 23 Apr 2019 at 13:26, Rodney W. Grimes >> wrote: >>> >>> Very cool, now how do I get a PCIe slot into a RPI3!!! lol :-) >> >> I know you're joking but the comment does highlight an issue in the >> AArch64 world - there's a lack of good mid-range developer platforms. > > I may of been joking with respect to the RPI3, but at the same > time I do know that the RockPro64 exists and does have that > PCIe slot I want, I also know that Michael Dexter has one he would > loan me should I wish to investigate our state of support. Does anybody know what PCIe Generation / speed that slot runs at? All I can find them saying is "PCIe x4", which implies Gen 1, 2.5GT/s speeds, which is not terribly useful. Gen2 or better would be enough to run 10GbE, which would be fun :) Drew From owner-svn-src-all@freebsd.org Mon Apr 29 14:54:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3DFB1592D01; Mon, 29 Apr 2019 14:54:10 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0229B86C3C; Mon, 29 Apr 2019 14:54:09 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id fba4e1b6; Mon, 29 Apr 2019 16:54:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=T8fzYwXQ7zBykdt8KrRFM8suk5M=; b=Sshu6Ww0i/CJxVJgts/BSQ1HA4Hm BlQID+Sg4NcKnkc2uQpCoLBZ1EK5bz+ZNOl/UhZDwDX2YZ2bAkP2JCmlcI1erpOE 53mu+C+/YM3/T6k0964/XjlQujy0C9fd7tfVRJKptIcvDnxRh8fe4/QdVoo+2o+5 9JlBFtnILMI9Tl4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=QafXxe3+J+cGEIVeJpuURQH+6Z5vNAluvYAn5He3tyzboBRu32WiWFbF H70qwVVIIwiFb/csNNhXftR4My4FUUYWCuZBeJ1Cs6XpuJmdlUXu5jj7z+Sy99CG iqgHKb63cn/EBwvRhovSxXmjBz6rWGJzoJNV2A7V8Y4YKiTTw7E= Received: from skull.home.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 50c657ae TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Mon, 29 Apr 2019 16:54:08 +0200 (CEST) Date: Mon, 29 Apr 2019 16:54:07 +0200 From: Emmanuel Vadot To: Andrew Gallatin Cc: rgrimes@freebsd.org, Ed Maste , src-committers , svn-src-all , svn-src-head , Greg V Subject: Re: svn commit: r346598 - head/sys/modules Message-Id: <20190429165407.d18ef446d8adf141ee7f8c5a@bidouilliste.com> In-Reply-To: <6e19943d-d680-9b83-dd8a-0da58a5f5d37@cs.duke.edu> References: <201904291421.x3TEL00P072638@gndrsh.dnsmgr.net> <6e19943d-d680-9b83-dd8a-0da58a5f5d37@cs.duke.edu> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 0229B86C3C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 14:54:11 -0000 On Mon, 29 Apr 2019 10:49:01 -0400 Andrew Gallatin wrote: > On 2019-04-29 10:21, Rodney W. Grimes wrote: > >> On Tue, 23 Apr 2019 at 13:26, Rodney W. Grimes > >> wrote: > >>> > >>> Very cool, now how do I get a PCIe slot into a RPI3!!! lol :-) > >> > >> I know you're joking but the comment does highlight an issue in the > >> AArch64 world - there's a lack of good mid-range developer platforms. > > > > I may of been joking with respect to the RPI3, but at the same > > time I do know that the RockPro64 exists and does have that > > PCIe slot I want, I also know that Michael Dexter has one he would > > loan me should I wish to investigate our state of support. > > Does anybody know what PCIe Generation / speed that slot runs at? > All I can find them saying is "PCIe x4", which implies Gen 1, 2.5GT/s > speeds, which is not terribly useful. Gen2 or better would be enough > to run 10GbE, which would be fun :) > > Drew It/s PCIe 2.1 compatible. See http://rockchip.fr/Rockchip%20RK3399%20TRM%20V1.3%20Part2.pdf for more info. -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Mon Apr 29 15:15:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1A6E1593C97; Mon, 29 Apr 2019 15:15:59 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75F438848E; Mon, 29 Apr 2019 15:15:59 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.4] (c-71-56-186-158.hsd1.va.comcast.net [71.56.186.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id 1EE7027003A6; Mon, 29 Apr 2019 11:15:58 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu 1EE7027003A6 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1556550958; bh=FhupId9ORf+u1iJWT4R0F3crLN6N/iBwD1iWCjijdHU=; h=Subject:To:From:Date:From; b=O1TsFyY6CYkF5IAdrWsVyR1CTqgduc3CQ9H6RBx5x43Dvvaml6BzHeE+uaOP5iLDi VBlqK6JgHmeXt54aeM/X7BTOmXPZOmzRbOmIYZbvueKgnTzvOcE7n4ZUJcEan7wGE7 1BzKntOXUjb75mWHdf4BVIZii6Sd/TkWwchiDGaI1UcSNcYld0++UWfl7HOfJYtcTm gYKli6kEok1cmcZM32cF/kuwmvBiO3mzQ/eeTASl9j/O9lNgisupEB+bzopmSusXw6 rcBbcLe9BC4iQzZlc0UE4cEqBZYNZvERJs8NSsIQEgEzR/Gm/Gfr8KNTh9RjjEN0cp 8+sXe6iORKFcA== Subject: Re: svn commit: r346598 - head/sys/modules To: Emmanuel Vadot Cc: rgrimes@freebsd.org, Ed Maste , src-committers , svn-src-all , svn-src-head , Greg V References: <201904291421.x3TEL00P072638@gndrsh.dnsmgr.net> <6e19943d-d680-9b83-dd8a-0da58a5f5d37@cs.duke.edu> <20190429165407.d18ef446d8adf141ee7f8c5a@bidouilliste.com> From: Andrew Gallatin Message-ID: <48634242-4bb6-2d74-570c-4093179d9639@cs.duke.edu> Date: Mon, 29 Apr 2019 11:15:57 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190429165407.d18ef446d8adf141ee7f8c5a@bidouilliste.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 75F438848E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 15:16:00 -0000 On 2019-04-29 10:54, Emmanuel Vadot wrote: > On Mon, 29 Apr 2019 10:49:01 -0400 > Andrew Gallatin wrote: > >> On 2019-04-29 10:21, Rodney W. Grimes wrote: >>>> On Tue, 23 Apr 2019 at 13:26, Rodney W. Grimes >>>> wrote: >>>>> >>>>> Very cool, now how do I get a PCIe slot into a RPI3!!! lol :-) >>>> >>>> I know you're joking but the comment does highlight an issue in the >>>> AArch64 world - there's a lack of good mid-range developer platforms. >>> >>> I may of been joking with respect to the RPI3, but at the same >>> time I do know that the RockPro64 exists and does have that >>> PCIe slot I want, I also know that Michael Dexter has one he would >>> loan me should I wish to investigate our state of support. >> >> Does anybody know what PCIe Generation / speed that slot runs at? >> All I can find them saying is "PCIe x4", which implies Gen 1, 2.5GT/s >> speeds, which is not terribly useful. Gen2 or better would be enough >> to run 10GbE, which would be fun :) >> >> Drew > > It/s PCIe 2.1 compatible. See > http://rockchip.fr/Rockchip%20RK3399%20TRM%20V1.3%20Part2.pdf > Everything I'm seeing there says Gen1 vs Gen2 depends on "PCIE_GENERATION_SEL", and that if its set to 0, you get Gen1 2.5Gt/s and if it is set to 1, you get Gen2, 5.0Gt/s. But I don't see anything specifying this value for the RockPro64 board. Drew From owner-svn-src-all@freebsd.org Mon Apr 29 15:20:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 291B81593E73; Mon, 29 Apr 2019 15:20:40 +0000 (UTC) (envelope-from ganbold@gmail.com) Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 BB98288750; Mon, 29 Apr 2019 15:20:39 +0000 (UTC) (envelope-from ganbold@gmail.com) Received: by mail-qk1-x72a.google.com with SMTP id n68so6171265qka.1; Mon, 29 Apr 2019 08:20:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=e7KOnfgo4sp3cbEtlMTyVkgu2v6H1WqBZjKrZscUHJs=; b=RGvf/SaDAeXsBicIbMGkMzMpp5D08u6ZSTa/ChwHZSRY8s3jbCu4lOANDbSSYL3IM8 JvKd4voB60XHYYjlTsq8VNATRQkDEJvGVPaBqB8jgdfJzei7AqB6nsK5u8c7Nhg9CVaT amIPTn2yBZVOVfBymqfERjMn/jiteXxw/LdlGuE1JIjBgpHdJh7wDCBZxziaioOgeyiL p3yiyb9vksr+05kj4TOBBuI2WsmZKI0PskzK0sz8rs/Q1pNLsoOA518JyzrNXx34WwHn KldneWXnBcGgHuk6FXJWy5l77UnHdmc4/RaLobdIOfmCvMgtGrqFx5iq7XERR41ZO9Ft zCew== 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=e7KOnfgo4sp3cbEtlMTyVkgu2v6H1WqBZjKrZscUHJs=; b=h2ZrumS53FZ1Jbghb2RLF4SCba2sVcRT08uZxpL7csZcAHdkPd9+1C6TDRfVomRWAL cRjGnl3aKleuNFEvy3RjLG6WXCh8uMNXxzQX8DFvfS8zjx/tYZOFfhok81o+xmSGM7ZJ PveAZQN6+LzFcDdBVhquwMhQsbwiW4iDEN/QHMEM1MxFWAHVFmrk8rpAyrHiR6ZlLgcS qjyTmtBApF0QQpDOrDSLuT3mqgQLY+s7MIHMy4ohnlnHBzymJiDudnhAByd4CXQ0Y1ki Z+FYY3/m7Fz7Wi2QzplhphHF5Nf7MM+jymKtWrHqgboZnVuCalz2t7oSC1+csX3CfHiG ZSpw== X-Gm-Message-State: APjAAAWuvIxB81kYGQx+I8vV6vASW9wpOgi7LKrSo+lQlW9uZn3CTthD uHnzMWmuwLCt/kSAB/EKercenNVSkMwIOrgo2YTUBrzO1uA= X-Google-Smtp-Source: APXvYqyQGGoKY6TrEE1kbr4sXfJcRMGeY4tuIly+iJhpcwCOsMGgFbj4AqADslUr6qLrEiVKjIhap+RrbfonNMiLmFY= X-Received: by 2002:a37:7401:: with SMTP id p1mr7512228qkc.172.1556551239185; Mon, 29 Apr 2019 08:20:39 -0700 (PDT) MIME-Version: 1.0 References: <201904291421.x3TEL00P072638@gndrsh.dnsmgr.net> <6e19943d-d680-9b83-dd8a-0da58a5f5d37@cs.duke.edu> <20190429165407.d18ef446d8adf141ee7f8c5a@bidouilliste.com> <48634242-4bb6-2d74-570c-4093179d9639@cs.duke.edu> In-Reply-To: <48634242-4bb6-2d74-570c-4093179d9639@cs.duke.edu> From: Ganbold Tsagaankhuu Date: Mon, 29 Apr 2019 23:20:28 +0800 Message-ID: Subject: Re: svn commit: r346598 - head/sys/modules To: Andrew Gallatin Cc: Emmanuel Vadot , rgrimes@freebsd.org, Ed Maste , src-committers , svn-src-all , svn-src-head , Greg V X-Rspamd-Queue-Id: BB98288750 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 15:20:40 -0000 On Mon, Apr 29, 2019 at 11:16 PM Andrew Gallatin wrote: > On 2019-04-29 10:54, Emmanuel Vadot wrote: > > On Mon, 29 Apr 2019 10:49:01 -0400 > > Andrew Gallatin wrote: > > > >> On 2019-04-29 10:21, Rodney W. Grimes wrote: > >>>> On Tue, 23 Apr 2019 at 13:26, Rodney W. Grimes > >>>> wrote: > >>>>> > >>>>> Very cool, now how do I get a PCIe slot into a RPI3!!! lol :-) > >>>> > >>>> I know you're joking but the comment does highlight an issue in the > >>>> AArch64 world - there's a lack of good mid-range developer platforms. > >>> > >>> I may of been joking with respect to the RPI3, but at the same > >>> time I do know that the RockPro64 exists and does have that > >>> PCIe slot I want, I also know that Michael Dexter has one he would > >>> loan me should I wish to investigate our state of support. > >> > >> Does anybody know what PCIe Generation / speed that slot runs at? > >> All I can find them saying is "PCIe x4", which implies Gen 1, 2.5GT/s > >> speeds, which is not terribly useful. Gen2 or better would be enough > >> to run 10GbE, which would be fun :) > >> > >> Drew > > > > It/s PCIe 2.1 compatible. See > > http://rockchip.fr/Rockchip%20RK3399%20TRM%20V1.3%20Part2.pdf > > > > Everything I'm seeing there says Gen1 vs Gen2 depends on > "PCIE_GENERATION_SEL", and that if its set to 0, you get > Gen1 2.5Gt/s and if it is set to 1, you get Gen2, 5.0Gt/s. > But I don't see anything specifying this value for the > RockPro64 board. > If you check Rockchip RK3399 TRM V1.3 Part1.pdf you can see PCIe 2.1 in block diagram (Fig 1-1) Ganbold > > Drew > > From owner-svn-src-all@freebsd.org Mon Apr 29 15:23:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81F361594052 for ; Mon, 29 Apr 2019 15:23:10 +0000 (UTC) (envelope-from greg@unrelenting.technology) Received: from out.migadu.com (out.migadu.com [91.121.223.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.migadu.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07E5688B7E for ; Mon, 29 Apr 2019 15:23:09 +0000 (UTC) (envelope-from greg@unrelenting.technology) Received: (Migadu outbound); Mon, 29 Apr 2019 15:21:56 +0000 Received: from [192.168.1.141] ([62.122.208.146]) by out.migadu.com (Haraka/2.8.16) with ESMTPSA id DE48E6A2-35B1-4CA1-BF67-A0AFD6FB875C.1 envelope-from (authenticated bits=0) (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 verify=FAIL); Mon, 29 Apr 2019 15:21:55 +0000 Date: Mon, 29 Apr 2019 18:21:55 +0300 From: Greg V Subject: Re: svn commit: r346598 - head/sys/modules To: Ed Maste Cc: "Rodney W. Grimes" , src-committers , svn-src-all , svn-src-head Message-Id: <1556551315.5165.0@unrelenting.technology> In-Reply-To: References: <201904231511.x3NFB1tR032938@repo.freebsd.org> <201904231725.x3NHPqCt038790@gndrsh.dnsmgr.net> X-Mailer: geary/master~gaf931ab3 MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251; format=flowed Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; bh=J22WwXPhv8rlcXxrH1Szb1/CQH8VVwWYPFH6M6qtAYY=; c=relaxed/simple; d=unrelenting.technology; h=from:subject:date:to; s=default; b=cn+HUI5DEB/kYkpuUaKiYWax28cHGSswHWUOXDkIFBhF9JzkbD3p07dL8UOVYa2Lwfpg/swFPcFaQSIoW+0gikLpt02BY4QC2hiG7gII5Tb5Ux4HH4uzyCO9GnhzFH9crJpPi1bpqpcpRXyR1j6MK0yqRZtkOugWeddeKWgaSoM= X-Rspamd-Queue-Id: 07E5688B7E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 15:23:10 -0000 On Mon, Apr 29, 2019 at 10:08, Ed Maste wrote: > On Tue, 23 Apr 2019 at 13:26, Rodney W. Grimes > wrote: >>=20 >> Very cool, now how do I get a PCIe slot into a RPI3!!! lol :-) >=20 > I know you're joking but the comment does highlight an issue in the > AArch64 world - there's a lack of good mid-range developer platforms. > FreeBSD runs on Cavium/Marvell ThunderX and ThunderX2 and now on > Ampere eMAG with the WIP discussed in PR 237055. These platforms have > room for lots of memory, very high core/thread counts (32 to 256), and > a good complement of PCIe interfaces. The specs go far beyond those of > a typical desktop software development platform, and the price does > too. We also run on small embedded boards like the RPi, Pine64, etc. > just fine, but there's not much in the middle. What we really need is > something like a Mini-ITX form factor 4 to 8 core system that can take > 8 to 32GB of RAM, has a PCIe slot or two, and is readily available > selling for well below $1000 US. SolidRun/Marvell MACCHIATObin is probably the best option available=20 now, but SolidRun is working on new stuff: https://www.solid-run.com/nxp-lx2160a-family/clearfog-itx/ NXP LX2160A =97 SoC with 16 Cortex-A72 cores, dual-channel DDR4 (MCbin=20 is single channel), 18 lanes of PCIe Gen 4, and as usual a huge=20 built-in network card we don't have a driver for. Though NXP advertises=20 that it's possible to reconfigure the SFP+ ports to turn them into more=20 PCIe. They even confirmed that overclocking is possible for both CPU and RAM: https://www.phoronix.com/forums/forum/hardware/motherboards-chipsets/109010= 2-solidrun-clearfog-a-16-core-arm-itx-workstation-board-aiming-for-500~750-= usd?p=3D1090905#post1090905 Let's hope they implement ACPI fully and correctly :) >> I am hopeing some of that PCIe WIP might include some of the >> bits needed or do we already have PCIe slot on RockPro64 code that=20 >> works? >=20 > I don't think this will do anything for RockPro64, it's just a > workaround for limitations in our current arm64 PCI code for some > functionality unused by ThunderX* but required for eMAG. RK3399 seems to need a custom driver, OpenBSD has one: https://github.com/openbsd/src/blob/master/sys/dev/fdt/rkpcie.c And I've heard bad things about the controller, apparently no one has=20 got a GPU working on Linux because the controller doesn't support=20 enough address space or some other features. = From owner-svn-src-all@freebsd.org Mon Apr 29 15:58:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3CCA1594FAE; Mon, 29 Apr 2019 15:58:06 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55CB189F40; Mon, 29 Apr 2019 15:58:06 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BFFA242ED; Mon, 29 Apr 2019 15:58:06 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TFw5wr060651; Mon, 29 Apr 2019 15:58:05 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TFw5Zc060650; Mon, 29 Apr 2019 15:58:05 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904291558.x3TFw5Zc060650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 29 Apr 2019 15:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346890 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346890 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 55CB189F40 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 15:58:06 -0000 Author: bde Date: Mon Apr 29 15:58:05 2019 New Revision: 346890 URL: https://svnweb.freebsd.org/changeset/base/346890 Log: Oops, r346889 broke showing of the mouse cursor after clearing, by forgetting to tell the bitmap-copying clearing method to preserve the cursor. Modified: head/lib/libvgl/simple.c Modified: head/lib/libvgl/simple.c ============================================================================== --- head/lib/libvgl/simple.c Mon Apr 29 14:13:53 2019 (r346889) +++ head/lib/libvgl/simple.c Mon Apr 29 15:58:05 2019 (r346890) @@ -496,7 +496,7 @@ VGLClear(VGLBitmap *object, u_long color) for (i = 0; i < object->VXsize; i++) bcopy(&color, src.Bitmap + i * object->PixelBytes, object->PixelBytes); for (i = 0; i < object->VYsize; i++) - __VGLBitmapCopy(&src, 0, 0, object, 0, i, object->VXsize, 1); + __VGLBitmapCopy(&src, 0, 0, object, 0, i, object->VXsize, -1); break; case VIDBUF8X: From owner-svn-src-all@freebsd.org Mon Apr 29 16:14:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F33B115954C1; Mon, 29 Apr 2019 16:14:27 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9691A8A7A5; Mon, 29 Apr 2019 16:14:27 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 707BF24657; Mon, 29 Apr 2019 16:14:27 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TGERtD070698; Mon, 29 Apr 2019 16:14:27 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TGEPEY070688; Mon, 29 Apr 2019 16:14:25 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201904291614.x3TGEPEY070688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Mon, 29 Apr 2019 16:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346891 - in stable/11: lib/clang lib/clang/include/llvm/Config lib/clang/libllvm share/man/man5 share/mk tools/build/options X-SVN-Group: stable-11 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in stable/11: lib/clang lib/clang/include/llvm/Config lib/clang/libllvm share/man/man5 share/mk tools/build/options X-SVN-Commit-Revision: 346891 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9691A8A7A5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 16:14:28 -0000 Author: mhorne Date: Mon Apr 29 16:14:24 2019 New Revision: 346891 URL: https://svnweb.freebsd.org/changeset/base/346891 Log: MFC r346016: Add option to build LLVM RISC-V target Approved by: markj (mentor) Added: stable/11/tools/build/options/WITHOUT_LLVM_TARGET_RISCV - copied unchanged from r346016, head/tools/build/options/WITHOUT_LLVM_TARGET_RISCV stable/11/tools/build/options/WITH_LLVM_TARGET_RISCV - copied unchanged from r346016, head/tools/build/options/WITH_LLVM_TARGET_RISCV Modified: stable/11/lib/clang/include/llvm/Config/AsmParsers.def stable/11/lib/clang/include/llvm/Config/AsmPrinters.def stable/11/lib/clang/include/llvm/Config/Disassemblers.def stable/11/lib/clang/include/llvm/Config/Targets.def stable/11/lib/clang/libllvm/Makefile stable/11/lib/clang/llvm.build.mk stable/11/share/man/man5/src.conf.5 stable/11/share/mk/src.opts.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/clang/include/llvm/Config/AsmParsers.def ============================================================================== --- stable/11/lib/clang/include/llvm/Config/AsmParsers.def Mon Apr 29 15:58:05 2019 (r346890) +++ stable/11/lib/clang/include/llvm/Config/AsmParsers.def Mon Apr 29 16:14:24 2019 (r346891) @@ -19,6 +19,9 @@ LLVM_ASM_PARSER(Mips) #ifdef LLVM_TARGET_ENABLE_POWERPC LLVM_ASM_PARSER(PowerPC) #endif +#ifdef LLVM_TARGET_ENABLE_RISCV +LLVM_ASM_PARSER(RISCV) +#endif #ifdef LLVM_TARGET_ENABLE_SPARC LLVM_ASM_PARSER(Sparc) #endif Modified: stable/11/lib/clang/include/llvm/Config/AsmPrinters.def ============================================================================== --- stable/11/lib/clang/include/llvm/Config/AsmPrinters.def Mon Apr 29 15:58:05 2019 (r346890) +++ stable/11/lib/clang/include/llvm/Config/AsmPrinters.def Mon Apr 29 16:14:24 2019 (r346891) @@ -19,6 +19,9 @@ LLVM_ASM_PRINTER(Mips) #ifdef LLVM_TARGET_ENABLE_POWERPC LLVM_ASM_PRINTER(PowerPC) #endif +#ifdef LLVM_TARGET_ENABLE_RISCV +LLVM_ASM_PRINTER(RISCV) +#endif #ifdef LLVM_TARGET_ENABLE_SPARC LLVM_ASM_PRINTER(Sparc) #endif Modified: stable/11/lib/clang/include/llvm/Config/Disassemblers.def ============================================================================== --- stable/11/lib/clang/include/llvm/Config/Disassemblers.def Mon Apr 29 15:58:05 2019 (r346890) +++ stable/11/lib/clang/include/llvm/Config/Disassemblers.def Mon Apr 29 16:14:24 2019 (r346891) @@ -19,6 +19,9 @@ LLVM_DISASSEMBLER(Mips) #ifdef LLVM_TARGET_ENABLE_POWERPC LLVM_DISASSEMBLER(PowerPC) #endif +#ifdef LLVM_TARGET_ENABLE_RISCV +LLVM_DISASSEMBLER(RISCV) +#endif #ifdef LLVM_TARGET_ENABLE_SPARC LLVM_DISASSEMBLER(Sparc) #endif Modified: stable/11/lib/clang/include/llvm/Config/Targets.def ============================================================================== --- stable/11/lib/clang/include/llvm/Config/Targets.def Mon Apr 29 15:58:05 2019 (r346890) +++ stable/11/lib/clang/include/llvm/Config/Targets.def Mon Apr 29 16:14:24 2019 (r346891) @@ -19,6 +19,9 @@ LLVM_TARGET(Mips) #ifdef LLVM_TARGET_ENABLE_POWERPC LLVM_TARGET(PowerPC) #endif +#ifdef LLVM_TARGET_ENABLE_RISCV +LLVM_TARGET(RISCV) +#endif #ifdef LLVM_TARGET_ENABLE_SPARC LLVM_TARGET(Sparc) #endif Modified: stable/11/lib/clang/libllvm/Makefile ============================================================================== --- stable/11/lib/clang/libllvm/Makefile Mon Apr 29 15:58:05 2019 (r346890) +++ stable/11/lib/clang/libllvm/Makefile Mon Apr 29 16:14:24 2019 (r346891) @@ -10,14 +10,15 @@ CFLAGS+= -I${.OBJDIR} .if ${MK_LLVM_TARGET_AARCH64} == "no" && ${MK_LLVM_TARGET_ARM} == "no" && \ ${MK_LLVM_TARGET_BPF} == "no" && ${MK_LLVM_TARGET_MIPS} == "no" && \ - ${MK_LLVM_TARGET_POWERPC} == "no" && ${MK_LLVM_TARGET_SPARC} == "no" && \ - ${MK_LLVM_TARGET_X86} == "no" + ${MK_LLVM_TARGET_POWERPC} == "no" && ${MK_LLVM_TARGET_RISCV} == "no" && \ + ${MK_LLVM_TARGET_SPARC} == "no" && ${MK_LLVM_TARGET_X86} == "no" .error Please enable at least one of: MK_LLVM_TARGET_AARCH64,\ MK_LLVM_TARGET_ARM, MK_LLVM_TARGET_BPF, MK_LLVM_TARGET_MIPS, \ - MK_LLVM_TARGET_POWERPC, MK_LLVM_TARGET_SPARC, or MK_LLVM_TARGET_X86 + MK_LLVM_TARGET_POWERPC, MK_LLVM_TARGET_RISCV, MK_LLVM_TARGET_SPARC, \ + or MK_LLVM_TARGET_X86 .endif -.for arch in AArch64 ARM BPF Mips PowerPC Sparc X86 +.for arch in AArch64 ARM BPF Mips PowerPC RISCV Sparc X86 . if ${MK_LLVM_TARGET_${arch:tu}} != "no" CFLAGS+= -I${LLVM_SRCS}/lib/Target/${arch} . endif @@ -1128,6 +1129,34 @@ SRCS_MIN+= Target/PowerPC/PPCVSXFMAMutate.cpp SRCS_MIN+= Target/PowerPC/PPCVSXSwapRemoval.cpp SRCS_MIN+= Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp .endif # MK_LLVM_TARGET_POWERPC +.if ${MK_LLVM_TARGET_RISCV} != "no" +SRCS_MIN+= Target/RISCV/AsmParser/RISCVAsmParser.cpp +SRCS_MIN+= Target/RISCV/Disassembler/RISCVDisassembler.cpp +SRCS_MIN+= Target/RISCV/InstPrinter/RISCVInstPrinter.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVMCAsmInfo.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVMCTargetDesc.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVTargetStreamer.cpp +SRCS_MIN+= Target/RISCV/RISCVAsmPrinter.cpp +SRCS_MIN+= Target/RISCV/RISCVExpandPseudoInsts.cpp +SRCS_MIN+= Target/RISCV/RISCVFrameLowering.cpp +SRCS_MIN+= Target/RISCV/RISCVInstrInfo.cpp +SRCS_MIN+= Target/RISCV/RISCVISelDAGToDAG.cpp +SRCS_MIN+= Target/RISCV/RISCVISelLowering.cpp +SRCS_MIN+= Target/RISCV/RISCVMCInstLower.cpp +SRCS_MIN+= Target/RISCV/RISCVMergeBaseOffset.cpp +SRCS_MIN+= Target/RISCV/RISCVRegisterInfo.cpp +SRCS_MIN+= Target/RISCV/RISCVSubtarget.cpp +SRCS_MIN+= Target/RISCV/RISCVTargetMachine.cpp +SRCS_MIN+= Target/RISCV/RISCVTargetObjectFile.cpp +SRCS_MIN+= Target/RISCV/TargetInfo/RISCVTargetInfo.cpp +SRCS_MIN+= Target/RISCV/Utils/RISCVBaseInfo.cpp +SRCS_MIN+= Target/RISCV/Utils/RISCVMatInt.cpp +.endif # MK_LLVM_TARGET_RISCV .if ${MK_LLVM_TARGET_SPARC} != "no" SRCS_MIN+= Target/Sparc/AsmParser/SparcAsmParser.cpp SRCS_MIN+= Target/Sparc/DelaySlotFiller.cpp @@ -1542,13 +1571,15 @@ beforebuild: # Note: some rules are superfluous, not every combination is valid. .for arch in \ - AArch64/AArch64 ARM/ARM BPF/BPF Mips/Mips PowerPC/PPC Sparc/Sparc X86/X86 + AArch64/AArch64 ARM/ARM BPF/BPF Mips/Mips PowerPC/PPC Sparc/Sparc \ + RISCV/RISCV X86/X86 . for hdr in \ AsmMatcher/-gen-asm-matcher \ AsmWriter1/-gen-asm-writer,-asmwriternum=1 \ AsmWriter/-gen-asm-writer \ CallingConv/-gen-callingconv \ CodeEmitter/-gen-emitter \ + CompressInstEmitter/-gen-compress-inst-emitter \ DAGISel/-gen-dag-isel \ DisassemblerTables/-gen-disassembler \ EVEX2VEXTables/-gen-x86-EVEX2VEX-tables \ @@ -1640,6 +1671,21 @@ TGHDRS+= PPCGenMCCodeEmitter.inc TGHDRS+= PPCGenRegisterInfo.inc TGHDRS+= PPCGenSubtargetInfo.inc .endif # MK_LLVM_TARGET_POWERPC +.if ${MK_LLVM_TARGET_RISCV} != "no" +TGHDRS+= RISCVGenAsmMatcher.inc +TGHDRS+= RISCVGenAsmWriter.inc +TGHDRS+= RISCVGenCallingConv.inc +TGHDRS+= RISCVGenCompressInstEmitter.inc +TGHDRS+= RISCVGenDAGISel.inc +TGHDRS+= RISCVGenDisassemblerTables.inc +TGHDRS+= RISCVGenDAGISel.inc +TGHDRS+= RISCVGenInstrInfo.inc +TGHDRS+= RISCVGenMCCodeEmitter.inc +TGHDRS+= RISCVGenMCPseudoLowering.inc +TGHDRS+= RISCVGenRegisterInfo.inc +TGHDRS+= RISCVGenSubtargetInfo.inc +TGHDRS+= RISCVGenSystemOperands.inc +.endif # MK_LLVM_TARGET_RISCV .if ${MK_LLVM_TARGET_SPARC} != "no" TGHDRS+= SparcGenAsmMatcher.inc TGHDRS+= SparcGenAsmWriter.inc Modified: stable/11/lib/clang/llvm.build.mk ============================================================================== --- stable/11/lib/clang/llvm.build.mk Mon Apr 29 15:58:05 2019 (r346890) +++ stable/11/lib/clang/llvm.build.mk Mon Apr 29 16:14:24 2019 (r346891) @@ -69,6 +69,12 @@ CFLAGS+= -DLLVM_TARGET_ENABLE_POWERPC LLVM_NATIVE_ARCH= PowerPC . endif .endif +.if ${MK_LLVM_TARGET_RISCV} != "no" +CFLAGS+= -DLLVM_TARGET_ENABLE_RISCV +. if ${MACHINE_CPUARCH} == "riscv" +LLVM_NATIVE_ARCH= RISCV +. endif +.endif .if ${MK_LLVM_TARGET_SPARC} != "no" CFLAGS+= -DLLVM_TARGET_ENABLE_SPARC . if ${MACHINE_CPUARCH} == "sparc64" Modified: stable/11/share/man/man5/src.conf.5 ============================================================================== --- stable/11/share/man/man5/src.conf.5 Mon Apr 29 15:58:05 2019 (r346890) +++ stable/11/share/man/man5/src.conf.5 Mon Apr 29 16:14:24 2019 (r346891) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd April 17, 2019 +.Dd March 29, 2019 .Dt SRC.CONF 5 .Os .Sh NAME @@ -319,6 +319,43 @@ When set, it enforces these options: .It .Va WITHOUT_LLVM_COV .El +.Pp +When set, these options are also in effect: +.Pp +.Bl -inset -compact +.It Va WITHOUT_LLVM_TARGET_AARCH64 +(unless +.Va WITH_LLVM_TARGET_AARCH64 +is set explicitly) +.It Va WITHOUT_LLVM_TARGET_ALL +(unless +.Va WITH_LLVM_TARGET_ALL +is set explicitly) +.It Va WITHOUT_LLVM_TARGET_ARM +(unless +.Va WITH_LLVM_TARGET_ARM +is set explicitly) +.It Va WITHOUT_LLVM_TARGET_MIPS +(unless +.Va WITH_LLVM_TARGET_MIPS +is set explicitly) +.It Va WITHOUT_LLVM_TARGET_POWERPC +(unless +.Va WITH_LLVM_TARGET_POWERPC +is set explicitly) +.It Va WITHOUT_LLVM_TARGET_RISCV +(unless +.Va WITH_LLVM_TARGET_RISCV +is set explicitly) +.It Va WITHOUT_LLVM_TARGET_SPARC +(unless +.Va WITH_LLVM_TARGET_SPARC +is set explicitly) +.It Va WITHOUT_LLVM_TARGET_X86 +(unless +.Va WITH_LLVM_TARGET_X86 +is set explicitly) +.El .It Va WITH_CLANG Set to build the Clang C/C++ compiler during the normal phase of the build. .Pp @@ -1060,6 +1097,20 @@ Set to build LLVM target support for PowerPC. .Pp This is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc and powerpc/powerpc64. +.It Va WITHOUT_LLVM_TARGET_RISCV +Set to not build LLVM target support for RISC-V. +The +.Va LLVM_TARGET_ALL +option should be used rather than this in most cases. +.Pp +This is a default setting on +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, and sparc/sparc64. +.It Va WITH_LLVM_TARGET_RISCV +Set to build LLVM target support for RISC-V. +The +.Va LLVM_TARGET_ALL +option should be used rather than this in most cases. +.Pp .It Va WITHOUT_LLVM_TARGET_SPARC Set to not build LLVM target support for SPARC. .Pp Modified: stable/11/share/mk/src.opts.mk ============================================================================== --- stable/11/share/mk/src.opts.mk Mon Apr 29 15:58:05 2019 (r346890) +++ stable/11/share/mk/src.opts.mk Mon Apr 29 16:14:24 2019 (r346891) @@ -232,6 +232,7 @@ __TT=${MACHINE} .endif __DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF +__DEFAULT_NO_OPTIONS+=LLVM_TARGET_RISCV .include # If the compiler is not C++11 capable, disable Clang and use GCC instead. Copied: stable/11/tools/build/options/WITHOUT_LLVM_TARGET_RISCV (from r346016, head/tools/build/options/WITHOUT_LLVM_TARGET_RISCV) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/tools/build/options/WITHOUT_LLVM_TARGET_RISCV Mon Apr 29 16:14:24 2019 (r346891, copy of r346016, head/tools/build/options/WITHOUT_LLVM_TARGET_RISCV) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to not build LLVM target support for RISC-V. +The +.Va LLVM_TARGET_ALL +option should be used rather than this in most cases. Copied: stable/11/tools/build/options/WITH_LLVM_TARGET_RISCV (from r346016, head/tools/build/options/WITH_LLVM_TARGET_RISCV) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/tools/build/options/WITH_LLVM_TARGET_RISCV Mon Apr 29 16:14:24 2019 (r346891, copy of r346016, head/tools/build/options/WITH_LLVM_TARGET_RISCV) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to build LLVM target support for RISC-V. +The +.Va LLVM_TARGET_ALL +option should be used rather than this in most cases. From owner-svn-src-all@freebsd.org Mon Apr 29 16:16:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F200E1595551; Mon, 29 Apr 2019 16:16:02 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 989A58A90B; Mon, 29 Apr 2019 16:16:02 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72E5424658; Mon, 29 Apr 2019 16:16:02 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TGG2O1070824; Mon, 29 Apr 2019 16:16:02 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TGG0qt070814; Mon, 29 Apr 2019 16:16:00 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201904291616.x3TGG0qt070814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Mon, 29 Apr 2019 16:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346892 - in stable/12: lib/clang lib/clang/include/llvm/Config lib/clang/libllvm share/man/man5 share/mk tools/build/options X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in stable/12: lib/clang lib/clang/include/llvm/Config lib/clang/libllvm share/man/man5 share/mk tools/build/options X-SVN-Commit-Revision: 346892 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 989A58A90B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 16:16:03 -0000 Author: mhorne Date: Mon Apr 29 16:16:00 2019 New Revision: 346892 URL: https://svnweb.freebsd.org/changeset/base/346892 Log: MFC r346016: Add option to build LLVM RISC-V target Approved by: markj (mentor) Added: stable/12/tools/build/options/WITHOUT_LLVM_TARGET_RISCV - copied unchanged from r346016, head/tools/build/options/WITHOUT_LLVM_TARGET_RISCV stable/12/tools/build/options/WITH_LLVM_TARGET_RISCV - copied unchanged from r346016, head/tools/build/options/WITH_LLVM_TARGET_RISCV Modified: stable/12/lib/clang/include/llvm/Config/AsmParsers.def stable/12/lib/clang/include/llvm/Config/AsmPrinters.def stable/12/lib/clang/include/llvm/Config/Disassemblers.def stable/12/lib/clang/include/llvm/Config/Targets.def stable/12/lib/clang/libllvm/Makefile stable/12/lib/clang/llvm.build.mk stable/12/share/man/man5/src.conf.5 stable/12/share/mk/src.opts.mk Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/clang/include/llvm/Config/AsmParsers.def ============================================================================== --- stable/12/lib/clang/include/llvm/Config/AsmParsers.def Mon Apr 29 16:14:24 2019 (r346891) +++ stable/12/lib/clang/include/llvm/Config/AsmParsers.def Mon Apr 29 16:16:00 2019 (r346892) @@ -19,6 +19,9 @@ LLVM_ASM_PARSER(Mips) #ifdef LLVM_TARGET_ENABLE_POWERPC LLVM_ASM_PARSER(PowerPC) #endif +#ifdef LLVM_TARGET_ENABLE_RISCV +LLVM_ASM_PARSER(RISCV) +#endif #ifdef LLVM_TARGET_ENABLE_SPARC LLVM_ASM_PARSER(Sparc) #endif Modified: stable/12/lib/clang/include/llvm/Config/AsmPrinters.def ============================================================================== --- stable/12/lib/clang/include/llvm/Config/AsmPrinters.def Mon Apr 29 16:14:24 2019 (r346891) +++ stable/12/lib/clang/include/llvm/Config/AsmPrinters.def Mon Apr 29 16:16:00 2019 (r346892) @@ -19,6 +19,9 @@ LLVM_ASM_PRINTER(Mips) #ifdef LLVM_TARGET_ENABLE_POWERPC LLVM_ASM_PRINTER(PowerPC) #endif +#ifdef LLVM_TARGET_ENABLE_RISCV +LLVM_ASM_PRINTER(RISCV) +#endif #ifdef LLVM_TARGET_ENABLE_SPARC LLVM_ASM_PRINTER(Sparc) #endif Modified: stable/12/lib/clang/include/llvm/Config/Disassemblers.def ============================================================================== --- stable/12/lib/clang/include/llvm/Config/Disassemblers.def Mon Apr 29 16:14:24 2019 (r346891) +++ stable/12/lib/clang/include/llvm/Config/Disassemblers.def Mon Apr 29 16:16:00 2019 (r346892) @@ -19,6 +19,9 @@ LLVM_DISASSEMBLER(Mips) #ifdef LLVM_TARGET_ENABLE_POWERPC LLVM_DISASSEMBLER(PowerPC) #endif +#ifdef LLVM_TARGET_ENABLE_RISCV +LLVM_DISASSEMBLER(RISCV) +#endif #ifdef LLVM_TARGET_ENABLE_SPARC LLVM_DISASSEMBLER(Sparc) #endif Modified: stable/12/lib/clang/include/llvm/Config/Targets.def ============================================================================== --- stable/12/lib/clang/include/llvm/Config/Targets.def Mon Apr 29 16:14:24 2019 (r346891) +++ stable/12/lib/clang/include/llvm/Config/Targets.def Mon Apr 29 16:16:00 2019 (r346892) @@ -19,6 +19,9 @@ LLVM_TARGET(Mips) #ifdef LLVM_TARGET_ENABLE_POWERPC LLVM_TARGET(PowerPC) #endif +#ifdef LLVM_TARGET_ENABLE_RISCV +LLVM_TARGET(RISCV) +#endif #ifdef LLVM_TARGET_ENABLE_SPARC LLVM_TARGET(Sparc) #endif Modified: stable/12/lib/clang/libllvm/Makefile ============================================================================== --- stable/12/lib/clang/libllvm/Makefile Mon Apr 29 16:14:24 2019 (r346891) +++ stable/12/lib/clang/libllvm/Makefile Mon Apr 29 16:16:00 2019 (r346892) @@ -10,14 +10,15 @@ CFLAGS+= -I${.OBJDIR} .if ${MK_LLVM_TARGET_AARCH64} == "no" && ${MK_LLVM_TARGET_ARM} == "no" && \ ${MK_LLVM_TARGET_BPF} == "no" && ${MK_LLVM_TARGET_MIPS} == "no" && \ - ${MK_LLVM_TARGET_POWERPC} == "no" && ${MK_LLVM_TARGET_SPARC} == "no" && \ - ${MK_LLVM_TARGET_X86} == "no" + ${MK_LLVM_TARGET_POWERPC} == "no" && ${MK_LLVM_TARGET_RISCV} == "no" && \ + ${MK_LLVM_TARGET_SPARC} == "no" && ${MK_LLVM_TARGET_X86} == "no" .error Please enable at least one of: MK_LLVM_TARGET_AARCH64,\ MK_LLVM_TARGET_ARM, MK_LLVM_TARGET_BPF, MK_LLVM_TARGET_MIPS, \ - MK_LLVM_TARGET_POWERPC, MK_LLVM_TARGET_SPARC, or MK_LLVM_TARGET_X86 + MK_LLVM_TARGET_POWERPC, MK_LLVM_TARGET_RISCV, MK_LLVM_TARGET_SPARC, \ + or MK_LLVM_TARGET_X86 .endif -.for arch in AArch64 ARM BPF Mips PowerPC Sparc X86 +.for arch in AArch64 ARM BPF Mips PowerPC RISCV Sparc X86 . if ${MK_LLVM_TARGET_${arch:tu}} != "no" CFLAGS+= -I${LLVM_SRCS}/lib/Target/${arch} . endif @@ -1128,6 +1129,34 @@ SRCS_MIN+= Target/PowerPC/PPCVSXFMAMutate.cpp SRCS_MIN+= Target/PowerPC/PPCVSXSwapRemoval.cpp SRCS_MIN+= Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp .endif # MK_LLVM_TARGET_POWERPC +.if ${MK_LLVM_TARGET_RISCV} != "no" +SRCS_MIN+= Target/RISCV/AsmParser/RISCVAsmParser.cpp +SRCS_MIN+= Target/RISCV/Disassembler/RISCVDisassembler.cpp +SRCS_MIN+= Target/RISCV/InstPrinter/RISCVInstPrinter.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVMCAsmInfo.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVMCTargetDesc.cpp +SRCS_MIN+= Target/RISCV/MCTargetDesc/RISCVTargetStreamer.cpp +SRCS_MIN+= Target/RISCV/RISCVAsmPrinter.cpp +SRCS_MIN+= Target/RISCV/RISCVExpandPseudoInsts.cpp +SRCS_MIN+= Target/RISCV/RISCVFrameLowering.cpp +SRCS_MIN+= Target/RISCV/RISCVInstrInfo.cpp +SRCS_MIN+= Target/RISCV/RISCVISelDAGToDAG.cpp +SRCS_MIN+= Target/RISCV/RISCVISelLowering.cpp +SRCS_MIN+= Target/RISCV/RISCVMCInstLower.cpp +SRCS_MIN+= Target/RISCV/RISCVMergeBaseOffset.cpp +SRCS_MIN+= Target/RISCV/RISCVRegisterInfo.cpp +SRCS_MIN+= Target/RISCV/RISCVSubtarget.cpp +SRCS_MIN+= Target/RISCV/RISCVTargetMachine.cpp +SRCS_MIN+= Target/RISCV/RISCVTargetObjectFile.cpp +SRCS_MIN+= Target/RISCV/TargetInfo/RISCVTargetInfo.cpp +SRCS_MIN+= Target/RISCV/Utils/RISCVBaseInfo.cpp +SRCS_MIN+= Target/RISCV/Utils/RISCVMatInt.cpp +.endif # MK_LLVM_TARGET_RISCV .if ${MK_LLVM_TARGET_SPARC} != "no" SRCS_MIN+= Target/Sparc/AsmParser/SparcAsmParser.cpp SRCS_MIN+= Target/Sparc/DelaySlotFiller.cpp @@ -1545,13 +1574,15 @@ beforebuild: # Note: some rules are superfluous, not every combination is valid. .for arch in \ - AArch64/AArch64 ARM/ARM BPF/BPF Mips/Mips PowerPC/PPC Sparc/Sparc X86/X86 + AArch64/AArch64 ARM/ARM BPF/BPF Mips/Mips PowerPC/PPC Sparc/Sparc \ + RISCV/RISCV X86/X86 . for hdr in \ AsmMatcher/-gen-asm-matcher \ AsmWriter1/-gen-asm-writer,-asmwriternum=1 \ AsmWriter/-gen-asm-writer \ CallingConv/-gen-callingconv \ CodeEmitter/-gen-emitter \ + CompressInstEmitter/-gen-compress-inst-emitter \ DAGISel/-gen-dag-isel \ DisassemblerTables/-gen-disassembler \ EVEX2VEXTables/-gen-x86-EVEX2VEX-tables \ @@ -1643,6 +1674,21 @@ TGHDRS+= PPCGenMCCodeEmitter.inc TGHDRS+= PPCGenRegisterInfo.inc TGHDRS+= PPCGenSubtargetInfo.inc .endif # MK_LLVM_TARGET_POWERPC +.if ${MK_LLVM_TARGET_RISCV} != "no" +TGHDRS+= RISCVGenAsmMatcher.inc +TGHDRS+= RISCVGenAsmWriter.inc +TGHDRS+= RISCVGenCallingConv.inc +TGHDRS+= RISCVGenCompressInstEmitter.inc +TGHDRS+= RISCVGenDAGISel.inc +TGHDRS+= RISCVGenDisassemblerTables.inc +TGHDRS+= RISCVGenDAGISel.inc +TGHDRS+= RISCVGenInstrInfo.inc +TGHDRS+= RISCVGenMCCodeEmitter.inc +TGHDRS+= RISCVGenMCPseudoLowering.inc +TGHDRS+= RISCVGenRegisterInfo.inc +TGHDRS+= RISCVGenSubtargetInfo.inc +TGHDRS+= RISCVGenSystemOperands.inc +.endif # MK_LLVM_TARGET_RISCV .if ${MK_LLVM_TARGET_SPARC} != "no" TGHDRS+= SparcGenAsmMatcher.inc TGHDRS+= SparcGenAsmWriter.inc Modified: stable/12/lib/clang/llvm.build.mk ============================================================================== --- stable/12/lib/clang/llvm.build.mk Mon Apr 29 16:14:24 2019 (r346891) +++ stable/12/lib/clang/llvm.build.mk Mon Apr 29 16:16:00 2019 (r346892) @@ -69,6 +69,12 @@ CFLAGS+= -DLLVM_TARGET_ENABLE_POWERPC LLVM_NATIVE_ARCH= PowerPC . endif .endif +.if ${MK_LLVM_TARGET_RISCV} != "no" +CFLAGS+= -DLLVM_TARGET_ENABLE_RISCV +. if ${MACHINE_CPUARCH} == "riscv" +LLVM_NATIVE_ARCH= RISCV +. endif +.endif .if ${MK_LLVM_TARGET_SPARC} != "no" CFLAGS+= -DLLVM_TARGET_ENABLE_SPARC . if ${MACHINE_CPUARCH} == "sparc64" Modified: stable/12/share/man/man5/src.conf.5 ============================================================================== --- stable/12/share/man/man5/src.conf.5 Mon Apr 29 16:14:24 2019 (r346891) +++ stable/12/share/man/man5/src.conf.5 Mon Apr 29 16:16:00 2019 (r346892) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd April 17, 2019 +.Dd March 29, 2019 .Dt SRC.CONF 5 .Os .Sh NAME @@ -151,6 +151,10 @@ for Verified Exec and When set, these options are also in effect: .Pp .Bl -inset -compact +.It Va WITH_LOADER_EFI_SECUREBOOT +(unless +.Va WITHOUT_LOADER_EFI_SECUREBOOT +is set explicitly) .It Va WITH_LOADER_VERIEXEC (unless .Va WITHOUT_LOADER_VERIEXEC @@ -380,6 +384,10 @@ is set explicitly) (unless .Va WITH_LLVM_TARGET_POWERPC is set explicitly) +.It Va WITHOUT_LLVM_TARGET_RISCV +(unless +.Va WITH_LLVM_TARGET_RISCV +is set explicitly) .It Va WITHOUT_LLVM_TARGET_SPARC (unless .Va WITH_LLVM_TARGET_SPARC @@ -1190,6 +1198,20 @@ option should be used rather than this in most cases. .Pp This is a default setting on amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +.It Va WITHOUT_LLVM_TARGET_RISCV +Set to not build LLVM target support for RISC-V. +The +.Va LLVM_TARGET_ALL +option should be used rather than this in most cases. +.Pp +This is a default setting on +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, and sparc/sparc64. +.It Va WITH_LLVM_TARGET_RISCV +Set to build LLVM target support for RISC-V. +The +.Va LLVM_TARGET_ALL +option should be used rather than this in most cases. +.Pp .It Va WITHOUT_LLVM_TARGET_SPARC Set to not build LLVM target support for SPARC. The @@ -1222,6 +1244,11 @@ option should be used rather than this in most cases. .Pp This is a default setting on amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +.It Va WITH_LOADER_EFI_SECUREBOOT +Enable building +.Xr loader 8 +with support for verification based on certificates obtained from UEFI. +.Pp .It Va WITH_LOADER_FIREWIRE Enable firewire support in /boot/loader on x86. This option is a nop on all other platforms. @@ -1262,6 +1289,14 @@ with support for verifcation similar to Verified Exec. .Pp It depends on .Va WITH_BEARSSL +When set, these options are also in effect: +.Pp +.Bl -inset -compact +.It Va WITH_LOADER_EFI_SECUREBOOT +(unless +.Va WITHOUT_LOADER_EFI_SECUREBOOT +is set explicitly) +.El .It Va WITHOUT_LOADER_ZFS Set to not build ZFS file system boot loader support. .It Va WITHOUT_LOCALES Modified: stable/12/share/mk/src.opts.mk ============================================================================== --- stable/12/share/mk/src.opts.mk Mon Apr 29 16:14:24 2019 (r346891) +++ stable/12/share/mk/src.opts.mk Mon Apr 29 16:16:00 2019 (r346892) @@ -285,6 +285,7 @@ __DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__ .endfor __DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF +__DEFAULT_NO_OPTIONS+=LLVM_TARGET_RISCV .include # If the compiler is not C++11 capable, disable Clang and use GCC instead. Copied: stable/12/tools/build/options/WITHOUT_LLVM_TARGET_RISCV (from r346016, head/tools/build/options/WITHOUT_LLVM_TARGET_RISCV) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tools/build/options/WITHOUT_LLVM_TARGET_RISCV Mon Apr 29 16:16:00 2019 (r346892, copy of r346016, head/tools/build/options/WITHOUT_LLVM_TARGET_RISCV) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to not build LLVM target support for RISC-V. +The +.Va LLVM_TARGET_ALL +option should be used rather than this in most cases. Copied: stable/12/tools/build/options/WITH_LLVM_TARGET_RISCV (from r346016, head/tools/build/options/WITH_LLVM_TARGET_RISCV) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tools/build/options/WITH_LLVM_TARGET_RISCV Mon Apr 29 16:16:00 2019 (r346892, copy of r346016, head/tools/build/options/WITH_LLVM_TARGET_RISCV) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set to build LLVM target support for RISC-V. +The +.Va LLVM_TARGET_ALL +option should be used rather than this in most cases. From owner-svn-src-all@freebsd.org Mon Apr 29 16:26:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8599D1595C0E; Mon, 29 Apr 2019 16:26:30 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 296B58B51D; Mon, 29 Apr 2019 16:26:30 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05F6D2485D; Mon, 29 Apr 2019 16:26:30 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TGQTlx076465; Mon, 29 Apr 2019 16:26:29 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TGQTgY076464; Mon, 29 Apr 2019 16:26:29 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904291626.x3TGQTgY076464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 29 Apr 2019 16:26:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346895 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 296B58B51D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 16:26:30 -0000 Author: bde Date: Mon Apr 29 16:26:29 2019 New Revision: 346895 URL: https://svnweb.freebsd.org/changeset/base/346895 Log: Support all reasonable cursor sizes. Reduce the size of the standard cursor from 16x16 (with 6 columns unused) to 10x16 and rename it to the "small" cursor. Add a "large" 19x32 cursor and use it for screen widths larger than 800 pixels. Use libvgl's too-small indentation for the large data declarations. MOUSE_IMG_SIZE = 16 is still part of the API. If an application supplies invalid bitmaps for the cursor, then the results may be different from before. Modified: head/lib/libvgl/mouse.c Modified: head/lib/libvgl/mouse.c ============================================================================== --- head/lib/libvgl/mouse.c Mon Apr 29 16:24:51 2019 (r346894) +++ head/lib/libvgl/mouse.c Mon Apr 29 16:26:29 2019 (r346895) @@ -43,52 +43,132 @@ static void VGLMouseAction(int dummy); #define BORDER 0xff /* default border -- light white in rgb 3:3:2 */ #define INTERIOR 0xa0 /* default interior -- red in rgb 3:3:2 */ +#define LARGE_MOUSE_IMG_XSIZE 19 +#define LARGE_MOUSE_IMG_YSIZE 32 +#define SMALL_MOUSE_IMG_XSIZE 10 +#define SMALL_MOUSE_IMG_YSIZE 16 #define X 0xff /* any nonzero in And mask means part of cursor */ #define B BORDER #define I INTERIOR -static byte StdAndMask[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE] = { - X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - X,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0, - X,X,X,X,0,0,0,0,0,0,0,0,0,0,0,0, - X,X,X,X,X,0,0,0,0,0,0,0,0,0,0,0, - X,X,X,X,X,X,0,0,0,0,0,0,0,0,0,0, - X,X,X,X,X,X,X,0,0,0,0,0,0,0,0,0, - X,X,X,X,X,X,X,X,0,0,0,0,0,0,0,0, - X,X,X,X,X,X,X,X,X,0,0,0,0,0,0,0, - X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0, - X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0, - X,X,X,X,X,X,X,0,0,0,0,0,0,0,0,0, - X,X,X,0,X,X,X,X,0,0,0,0,0,0,0,0, - X,X,0,0,X,X,X,X,0,0,0,0,0,0,0,0, - 0,0,0,0,0,X,X,X,X,0,0,0,0,0,0,0, - 0,0,0,0,0,X,X,X,X,0,0,0,0,0,0,0, - 0,0,0,0,0,0,X,X,0,0,0,0,0,0,0,0, +static byte LargeAndMask[] = { + X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + X,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + X,X,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + X,X,X,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + X,X,X,X,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,0,0,0,0,0,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,0,0,0,0,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,0,0,0,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,X,X,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,0, + X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X, + X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X, + X,X,X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0,0, + X,X,X,X,X,X,0,X,X,X,X,X,X,0,0,0,0,0,0, + X,X,X,X,X,0,0,X,X,X,X,X,X,0,0,0,0,0,0, + X,X,X,X,0,0,0,0,X,X,X,X,X,X,0,0,0,0,0, + X,X,X,0,0,0,0,0,X,X,X,X,X,X,0,0,0,0,0, + X,X,0,0,0,0,0,0,0,X,X,X,X,X,X,0,0,0,0, + 0,0,0,0,0,0,0,0,0,X,X,X,X,X,X,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,X,X,X,X,X,X,0,0,0, + 0,0,0,0,0,0,0,0,0,0,X,X,X,X,X,X,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,X,X,X,X,X,X,0,0, + 0,0,0,0,0,0,0,0,0,0,0,X,X,X,X,X,X,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,X,X,X,X,0,0,0, }; -static byte StdOrMask[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE] = { - B,B,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - B,I,B,0,0,0,0,0,0,0,0,0,0,0,0,0, - B,I,I,B,0,0,0,0,0,0,0,0,0,0,0,0, - B,I,I,I,B,0,0,0,0,0,0,0,0,0,0,0, - B,I,I,I,I,B,0,0,0,0,0,0,0,0,0,0, - B,I,I,I,I,I,B,0,0,0,0,0,0,0,0,0, - B,I,I,I,I,I,I,B,0,0,0,0,0,0,0,0, - B,I,I,I,I,I,I,I,B,0,0,0,0,0,0,0, - B,I,I,I,I,I,I,I,I,B,0,0,0,0,0,0, - B,I,I,I,I,I,B,B,B,B,0,0,0,0,0,0, - B,I,I,B,I,I,B,0,0,0,0,0,0,0,0,0, - B,I,B,0,B,I,I,B,0,0,0,0,0,0,0,0, - B,B,0,0,B,I,I,B,0,0,0,0,0,0,0,0, - 0,0,0,0,0,B,I,I,B,0,0,0,0,0,0,0, - 0,0,0,0,0,B,I,I,B,0,0,0,0,0,0,0, - 0,0,0,0,0,0,B,B,0,0,0,0,0,0,0,0, +static byte LargeOrMask[] = { + B,B,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + B,I,B,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + B,I,I,B,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + B,I,I,I,B,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + B,I,I,I,I,B,0,0,0,0,0,0,0,0,0,0,0,0,0, + B,I,I,I,I,I,B,0,0,0,0,0,0,0,0,0,0,0,0, + B,I,I,I,I,I,I,B,0,0,0,0,0,0,0,0,0,0,0, + B,I,I,I,I,I,I,I,B,0,0,0,0,0,0,0,0,0,0, + B,I,I,I,I,I,I,I,I,B,0,0,0,0,0,0,0,0,0, + B,I,I,I,I,I,I,I,I,I,B,0,0,0,0,0,0,0,0, + B,I,I,I,I,I,I,I,I,I,I,B,0,0,0,0,0,0,0, + B,I,I,I,I,I,I,I,I,I,I,I,B,0,0,0,0,0,0, + B,I,I,I,I,I,I,I,I,I,I,I,I,B,0,0,0,0,0, + B,I,I,I,I,I,I,I,I,I,I,I,I,I,B,0,0,0,0, + B,I,I,I,I,I,I,I,I,I,I,I,I,I,I,B,0,0,0, + B,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,B,0,0, + B,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,B,0, + B,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,B, + B,I,I,I,I,I,I,I,I,I,I,B,B,B,B,B,B,B,B, + B,I,I,I,I,I,I,I,I,I,I,B,0,0,0,0,0,0,0, + B,I,I,I,I,I,B,I,I,I,I,B,0,0,0,0,0,0,0, + B,I,I,I,I,B,0,B,I,I,I,I,B,0,0,0,0,0,0, + B,I,I,I,B,0,0,B,I,I,I,I,B,0,0,0,0,0,0, + B,I,I,B,0,0,0,0,B,I,I,I,I,B,0,0,0,0,0, + B,I,B,0,0,0,0,0,B,I,I,I,I,B,0,0,0,0,0, + B,B,0,0,0,0,0,0,0,B,I,I,I,I,B,0,0,0,0, + 0,0,0,0,0,0,0,0,0,B,I,I,I,I,B,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,B,I,I,I,I,B,0,0,0, + 0,0,0,0,0,0,0,0,0,0,B,I,I,I,I,B,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,B,I,I,I,I,B,0,0, + 0,0,0,0,0,0,0,0,0,0,0,B,I,I,I,I,B,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,B,B,B,B,0,0,0, }; +static byte SmallAndMask[] = { + X,X,0,0,0,0,0,0,0,0, + X,X,X,0,0,0,0,0,0,0, + X,X,X,X,0,0,0,0,0,0, + X,X,X,X,X,0,0,0,0,0, + X,X,X,X,X,X,0,0,0,0, + X,X,X,X,X,X,X,0,0,0, + X,X,X,X,X,X,X,X,0,0, + X,X,X,X,X,X,X,X,X,0, + X,X,X,X,X,X,X,X,X,X, + X,X,X,X,X,X,X,X,X,X, + X,X,X,X,X,X,X,0,0,0, + X,X,X,0,X,X,X,X,0,0, + X,X,0,0,X,X,X,X,0,0, + 0,0,0,0,0,X,X,X,X,0, + 0,0,0,0,0,X,X,X,X,0, + 0,0,0,0,0,0,X,X,0,0, +}; +static byte SmallOrMask[] = { + B,B,0,0,0,0,0,0,0,0, + B,I,B,0,0,0,0,0,0,0, + B,I,I,B,0,0,0,0,0,0, + B,I,I,I,B,0,0,0,0,0, + B,I,I,I,I,B,0,0,0,0, + B,I,I,I,I,I,B,0,0,0, + B,I,I,I,I,I,I,B,0,0, + B,I,I,I,I,I,I,I,B,0, + B,I,I,I,I,I,I,I,I,B, + B,I,I,I,I,I,B,B,B,B, + B,I,I,B,I,I,B,0,0,0, + B,I,B,0,B,I,I,B,0,0, + B,B,0,0,B,I,I,B,0,0, + 0,0,0,0,0,B,I,I,B,0, + 0,0,0,0,0,B,I,I,B,0, + 0,0,0,0,0,0,B,B,0,0, +}; #undef X #undef B #undef I -static VGLBitmap VGLMouseStdAndMask = - VGLBITMAP_INITIALIZER(MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, StdAndMask); -static VGLBitmap VGLMouseStdOrMask = - VGLBITMAP_INITIALIZER(MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, StdOrMask); +static VGLBitmap VGLMouseLargeAndMask = + VGLBITMAP_INITIALIZER(MEMBUF, LARGE_MOUSE_IMG_XSIZE, LARGE_MOUSE_IMG_YSIZE, + LargeAndMask); +static VGLBitmap VGLMouseLargeOrMask = + VGLBITMAP_INITIALIZER(MEMBUF, LARGE_MOUSE_IMG_XSIZE, LARGE_MOUSE_IMG_YSIZE, + LargeOrMask); +static VGLBitmap VGLMouseSmallAndMask = + VGLBITMAP_INITIALIZER(MEMBUF, SMALL_MOUSE_IMG_XSIZE, SMALL_MOUSE_IMG_YSIZE, + SmallAndMask); +static VGLBitmap VGLMouseSmallOrMask = + VGLBITMAP_INITIALIZER(MEMBUF, SMALL_MOUSE_IMG_XSIZE, SMALL_MOUSE_IMG_YSIZE, + SmallOrMask); static VGLBitmap *VGLMouseAndMask, *VGLMouseOrMask; static int VGLMouseShown = VGL_MOUSEHIDE; static int VGLMouseXpos = 0; @@ -113,17 +193,17 @@ __VGLMouseMode(int mode) if (mode == VGL_MOUSESHOW) { if (VGLMouseShown == VGL_MOUSEHIDE) { VGLMouseShown = VGL_MOUSESHOW; - __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, VGLDisplay, - VGLMouseXpos, VGLMouseYpos, - MOUSE_IMG_SIZE, -MOUSE_IMG_SIZE); + __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, + VGLDisplay, VGLMouseXpos, VGLMouseYpos, + VGLMouseAndMask->VXsize, -VGLMouseAndMask->VYsize); } } else { if (VGLMouseShown == VGL_MOUSESHOW) { VGLMouseShown = VGL_MOUSEHIDE; - __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, VGLDisplay, - VGLMouseXpos, VGLMouseYpos, - MOUSE_IMG_SIZE, MOUSE_IMG_SIZE); + __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, + VGLDisplay, VGLMouseXpos, VGLMouseYpos, + VGLMouseAndMask->VXsize, VGLMouseAndMask->VYsize); } } INTON(); @@ -193,13 +273,17 @@ VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask void VGLMouseSetStdImage() { - VGLMouseSetImage(&VGLMouseStdAndMask, &VGLMouseStdOrMask); + if (VGLDisplay->VXsize > 800) + VGLMouseSetImage(&VGLMouseLargeAndMask, &VGLMouseLargeOrMask); + else + VGLMouseSetImage(&VGLMouseSmallAndMask, &VGLMouseSmallOrMask); } int VGLMouseInit(int mode) { struct mouse_info mouseinfo; + VGLBitmap *ormask; int andmask, border, error, i, interior; switch (VGLModeInfo.vi_mem_model) { @@ -226,9 +310,14 @@ VGLMouseInit(int mode) border = strtoul(getenv("VGLMOUSEBORDERCOLOR"), NULL, 0); if (getenv("VGLMOUSEINTERIORCOLOR") != NULL) interior = strtoul(getenv("VGLMOUSEINTERIORCOLOR"), NULL, 0); - for (i = 0; i < MOUSE_IMG_SIZE*MOUSE_IMG_SIZE; i++) - VGLMouseStdOrMask.Bitmap[i] = VGLMouseStdOrMask.Bitmap[i] == BORDER ? - border : VGLMouseStdOrMask.Bitmap[i] == INTERIOR ? interior : 0; + ormask = &VGLMouseLargeOrMask; + for (i = 0; i < ormask->VXsize * ormask->VYsize; i++) + ormask->Bitmap[i] = ormask->Bitmap[i] == BORDER ? border : + ormask->Bitmap[i] == INTERIOR ? interior : 0; + ormask = &VGLMouseSmallOrMask; + for (i = 0; i < ormask->VXsize * ormask->VYsize; i++) + ormask->Bitmap[i] = ormask->Bitmap[i] == BORDER ? border : + ormask->Bitmap[i] == INTERIOR ? interior : 0; VGLMouseSetStdImage(); mouseinfo.operation = MOUSE_MODE; mouseinfo.u.mode.signal = SIGUSR2; @@ -283,9 +372,10 @@ VGLMouseFreezeXY(int x, int y) INTOFF(); if (VGLMouseShown != VGL_MOUSESHOW) return 0; - if (x >= VGLMouseXpos && x < VGLMouseXpos + MOUSE_IMG_SIZE && - y >= VGLMouseYpos && y < VGLMouseYpos + MOUSE_IMG_SIZE && - VGLMouseAndMask->Bitmap[(y-VGLMouseYpos)*MOUSE_IMG_SIZE+(x-VGLMouseXpos)]) + if (x >= VGLMouseXpos && x < VGLMouseXpos + VGLMouseAndMask->VXsize && + y >= VGLMouseYpos && y < VGLMouseYpos + VGLMouseAndMask->VYsize && + VGLMouseAndMask->Bitmap[(y-VGLMouseYpos)*VGLMouseAndMask->VXsize+ + (x-VGLMouseXpos)]) return 1; return 0; } @@ -298,13 +388,13 @@ VGLMouseOverlap(int x, int y, int width, int hight) if (VGLMouseShown != VGL_MOUSESHOW) return 0; if (x > VGLMouseXpos) - overlap = (VGLMouseXpos + MOUSE_IMG_SIZE) - x; + overlap = (VGLMouseXpos + VGLMouseAndMask->VXsize) - x; else overlap = (x + width) - VGLMouseXpos; if (overlap <= 0) return 0; if (y > VGLMouseYpos) - overlap = (VGLMouseYpos + MOUSE_IMG_SIZE) - y; + overlap = (VGLMouseYpos + VGLMouseAndMask->VYsize) - y; else overlap = (y + hight) - VGLMouseYpos; return overlap > 0; @@ -319,10 +409,10 @@ VGLMouseMerge(int x, int y, int width, byte *line) if (xstart < VGLMouseXpos) xstart = VGLMouseXpos; xend = x + width; - if (xend > VGLMouseXpos + MOUSE_IMG_SIZE) - xend = VGLMouseXpos + MOUSE_IMG_SIZE; + if (xend > VGLMouseXpos + VGLMouseAndMask->VXsize) + xend = VGLMouseXpos + VGLMouseAndMask->VXsize; for (x1 = xstart; x1 < xend; x1++) { - pos = (y - VGLMouseYpos) * MOUSE_IMG_SIZE + x1 - VGLMouseXpos; + pos = (y - VGLMouseYpos) * VGLMouseAndMask->VXsize + x1 - VGLMouseXpos; if (VGLMouseAndMask->Bitmap[pos]) bcopy(&VGLMouseOrMask->Bitmap[pos * VGLDisplay->PixelBytes], &line[(x1 - x) * VGLDisplay->PixelBytes], VGLDisplay->PixelBytes); From owner-svn-src-all@freebsd.org Mon Apr 29 16:27:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A9CC1595CB8; Mon, 29 Apr 2019 16:27:17 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 307E78B694; Mon, 29 Apr 2019 16:27:17 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 01D052485E; Mon, 29 Apr 2019 16:27:17 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TGRGT3076548; Mon, 29 Apr 2019 16:27:16 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TGRGJp076543; Mon, 29 Apr 2019 16:27:16 GMT (envelope-from br@FreeBSD.org) Message-Id: <201904291627.x3TGRGJp076543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 29 Apr 2019 16:27:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346896 - in head/sys/dev: altera/atse altera/softdma xdma X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys/dev: altera/atse altera/softdma xdma X-SVN-Commit-Revision: 346896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 307E78B694 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 16:27:17 -0000 Author: br Date: Mon Apr 29 16:27:15 2019 New Revision: 346896 URL: https://svnweb.freebsd.org/changeset/base/346896 Log: o Rewrite softdma_process_tx() of Altera SoftDMA engine driver so it does not require a bounce buffer. The only need for this was to align the buffer address. Implement unaligned access and we don't need to copy data twice. o Remove contigmalloc-based bounce buffer from xDMA code since it is not suitable for arbitrary memory provided by platform, which is sometimes a dedicated piece of memory that is not managed by OS at all. Sponsored by: DARPA, AFRL Modified: head/sys/dev/altera/atse/if_atse.c head/sys/dev/altera/softdma/softdma.c head/sys/dev/xdma/xdma.h head/sys/dev/xdma/xdma_mbuf.c head/sys/dev/xdma/xdma_sg.c Modified: head/sys/dev/altera/atse/if_atse.c ============================================================================== --- head/sys/dev/altera/atse/if_atse.c Mon Apr 29 16:26:29 2019 (r346895) +++ head/sys/dev/altera/atse/if_atse.c Mon Apr 29 16:27:15 2019 (r346896) @@ -1290,7 +1290,7 @@ atse_attach(device_t dev) * Chapter 15. On-Chip FIFO Memory Core. * Embedded Peripherals IP User Guide. */ - caps = XCHAN_CAP_BUSDMA_NOSEG; + caps = XCHAN_CAP_NOSEG; /* Alloc xDMA virtual channel. */ sc->xchan_tx = xdma_channel_alloc(sc->xdma_tx, caps); @@ -1456,6 +1456,11 @@ atse_detach(device_t dev) } mtx_destroy(&sc->atse_mtx); + + xdma_channel_free(sc->xchan_tx); + xdma_channel_free(sc->xchan_rx); + xdma_put(sc->xdma_tx); + xdma_put(sc->xdma_rx); return (0); } Modified: head/sys/dev/altera/softdma/softdma.c ============================================================================== --- head/sys/dev/altera/softdma/softdma.c Mon Apr 29 16:26:29 2019 (r346895) +++ head/sys/dev/altera/softdma/softdma.c Mon Apr 29 16:27:15 2019 (r346896) @@ -190,6 +190,18 @@ softdma_fill_level(struct softdma_softc *sc) return (val); } +static uint32_t +fifo_fill_level_wait(struct softdma_softc *sc) +{ + uint32_t val; + + do + val = softdma_fill_level(sc); + while (val == AVALON_FIFO_TX_BASIC_OPTS_DEPTH); + + return (val); +} + static void softdma_intr(void *arg) { @@ -287,86 +299,96 @@ static int softdma_process_tx(struct softdma_channel *chan, struct softdma_desc *desc) { struct softdma_softc *sc; - uint32_t src_offs, dst_offs; + uint64_t addr; + uint64_t buf; + uint32_t word; + uint32_t missing; uint32_t reg; - uint32_t fill_level; - uint32_t leftm; - uint32_t tmp; - uint32_t val; - uint32_t c; + int got_bits; + int len; sc = chan->sc; - fill_level = softdma_fill_level(sc); - while (fill_level == AVALON_FIFO_TX_BASIC_OPTS_DEPTH) - fill_level = softdma_fill_level(sc); + fifo_fill_level_wait(sc); /* Set start of packet. */ - if (desc->control & CONTROL_GEN_SOP) { - reg = 0; - reg |= A_ONCHIP_FIFO_MEM_CORE_SOP; - softdma_mem_write(sc, A_ONCHIP_FIFO_MEM_CORE_METADATA, reg); - } + if (desc->control & CONTROL_GEN_SOP) + softdma_mem_write(sc, A_ONCHIP_FIFO_MEM_CORE_METADATA, + A_ONCHIP_FIFO_MEM_CORE_SOP); - src_offs = dst_offs = 0; - c = 0; - while ((desc->len - c) >= 4) { - val = *(uint32_t *)(desc->src_addr + src_offs); - bus_write_4(sc->res[0], A_ONCHIP_FIFO_MEM_CORE_DATA, val); - if (desc->src_incr) - src_offs += 4; - if (desc->dst_incr) - dst_offs += 4; - fill_level += 1; + got_bits = 0; + buf = 0; - while (fill_level == AVALON_FIFO_TX_BASIC_OPTS_DEPTH) { - fill_level = softdma_fill_level(sc); - } - c += 4; + addr = desc->src_addr; + len = desc->len; + + if (addr & 1) { + buf = (buf << 8) | *(uint8_t *)addr; + got_bits += 8; + addr += 1; + len -= 1; } - val = 0; - leftm = (desc->len - c); + if (len >= 2 && addr & 2) { + buf = (buf << 16) | *(uint16_t *)addr; + got_bits += 16; + addr += 2; + len -= 2; + } - switch (leftm) { - case 1: - val = *(uint8_t *)(desc->src_addr + src_offs); - val <<= 24; - src_offs += 1; - break; - case 2: - case 3: - val = *(uint16_t *)(desc->src_addr + src_offs); - val <<= 16; - src_offs += 2; + while (len >= 4) { + buf = (buf << 32) | (uint64_t)*(uint32_t *)addr; + addr += 4; + len -= 4; + word = (uint32_t)((buf >> got_bits) & 0xffffffff); - if (leftm == 3) { - tmp = *(uint8_t *)(desc->src_addr + src_offs); - val |= (tmp << 8); - src_offs += 1; - } - break; - case 0: - default: - break; + fifo_fill_level_wait(sc); + if (len == 0 && got_bits == 0 && + (desc->control & CONTROL_GEN_EOP) != 0) + softdma_mem_write(sc, A_ONCHIP_FIFO_MEM_CORE_METADATA, + A_ONCHIP_FIFO_MEM_CORE_EOP); + bus_write_4(sc->res[0], A_ONCHIP_FIFO_MEM_CORE_DATA, word); } - /* Set end of packet. */ - reg = 0; - if (desc->control & CONTROL_GEN_EOP) - reg |= A_ONCHIP_FIFO_MEM_CORE_EOP; - reg |= ((4 - leftm) << A_ONCHIP_FIFO_MEM_CORE_EMPTY_SHIFT); - softdma_mem_write(sc, A_ONCHIP_FIFO_MEM_CORE_METADATA, reg); + if (len & 2) { + buf = (buf << 16) | *(uint16_t *)addr; + got_bits += 16; + addr += 2; + len -= 2; + } - /* Ensure there is a FIFO entry available. */ - fill_level = softdma_fill_level(sc); - while (fill_level == AVALON_FIFO_TX_BASIC_OPTS_DEPTH) - fill_level = softdma_fill_level(sc); + if (len & 1) { + buf = (buf << 8) | *(uint8_t *)addr; + got_bits += 8; + addr += 1; + len -= 1; + } - /* Final write */ - bus_write_4(sc->res[0], A_ONCHIP_FIFO_MEM_CORE_DATA, val); + if (got_bits >= 32) { + got_bits -= 32; + word = (uint32_t)((buf >> got_bits) & 0xffffffff); - return (dst_offs); + fifo_fill_level_wait(sc); + if (len == 0 && got_bits == 0 && + (desc->control & CONTROL_GEN_EOP) != 0) + softdma_mem_write(sc, A_ONCHIP_FIFO_MEM_CORE_METADATA, + A_ONCHIP_FIFO_MEM_CORE_EOP); + bus_write_4(sc->res[0], A_ONCHIP_FIFO_MEM_CORE_DATA, word); + } + + if (got_bits) { + missing = 32 - got_bits; + got_bits /= 8; + + fifo_fill_level_wait(sc); + reg = A_ONCHIP_FIFO_MEM_CORE_EOP | + ((4 - got_bits) << A_ONCHIP_FIFO_MEM_CORE_EMPTY_SHIFT); + softdma_mem_write(sc, A_ONCHIP_FIFO_MEM_CORE_METADATA, reg); + word = (uint32_t)((buf << missing) & 0xffffffff); + bus_write_4(sc->res[0], A_ONCHIP_FIFO_MEM_CORE_DATA, word); + } + + return (desc->len); } static int @@ -594,6 +616,8 @@ softdma_channel_alloc(device_t dev, struct xdma_channe if (chan->used == 0) { chan->xchan = xchan; xchan->chan = (void *)chan; + xchan->caps |= XCHAN_CAP_NOBUFS; + xchan->caps |= XCHAN_CAP_NOSEG; chan->index = i; chan->idx_head = 0; chan->idx_tail = 0; Modified: head/sys/dev/xdma/xdma.h ============================================================================== --- head/sys/dev/xdma/xdma.h Mon Apr 29 16:26:29 2019 (r346895) +++ head/sys/dev/xdma/xdma.h Mon Apr 29 16:27:15 2019 (r346896) @@ -84,7 +84,6 @@ struct xchan_buf { bus_dmamap_t map; uint32_t nsegs; uint32_t nsegs_left; - void *cbuf; }; struct xdma_request { @@ -130,7 +129,8 @@ struct xdma_channel { uint32_t caps; #define XCHAN_CAP_BUSDMA (1 << 0) -#define XCHAN_CAP_BUSDMA_NOSEG (1 << 1) +#define XCHAN_CAP_NOSEG (1 << 1) +#define XCHAN_CAP_NOBUFS (1 << 2) /* A real hardware driver channel. */ void *chan; Modified: head/sys/dev/xdma/xdma_mbuf.c ============================================================================== --- head/sys/dev/xdma/xdma_mbuf.c Mon Apr 29 16:26:29 2019 (r346895) +++ head/sys/dev/xdma/xdma_mbuf.c Mon Apr 29 16:27:15 2019 (r346896) @@ -136,19 +136,15 @@ xdma_mbuf_defrag(xdma_channel_t *xchan, struct xdma_re if (c == 1) return (c); /* Nothing to do. */ - if (xchan->caps & XCHAN_CAP_BUSDMA) { - if ((xchan->caps & XCHAN_CAP_BUSDMA_NOSEG) || \ - (c > xchan->maxnsegs)) { - if ((m = m_defrag(xr->m, M_NOWAIT)) == NULL) { - device_printf(xdma->dma_dev, - "%s: Can't defrag mbuf\n", - __func__); - return (c); - } - xr->m = m; - c = 1; - } + if ((m = m_defrag(xr->m, M_NOWAIT)) == NULL) { + device_printf(xdma->dma_dev, + "%s: Can't defrag mbuf\n", + __func__); + return (c); } + + xr->m = m; + c = 1; return (c); } Modified: head/sys/dev/xdma/xdma_sg.c ============================================================================== --- head/sys/dev/xdma/xdma_sg.c Mon Apr 29 16:26:29 2019 (r346895) +++ head/sys/dev/xdma/xdma_sg.c Mon Apr 29 16:27:15 2019 (r346896) @@ -69,14 +69,7 @@ _xchan_bufs_alloc(xdma_channel_t *xchan) for (i = 0; i < xchan->xr_num; i++) { xr = &xchan->xr_mem[i]; - xr->buf.cbuf = contigmalloc(xchan->maxsegsize, - M_XDMA, 0, 0, ~0, PAGE_SIZE, 0); - if (xr->buf.cbuf == NULL) { - device_printf(xdma->dev, - "%s: Can't allocate contiguous kernel" - " physical memory\n", __func__); - return (-1); - } + /* TODO: bounce buffer */ } return (0); @@ -179,7 +172,7 @@ xchan_bufs_free(xdma_channel_t *xchan) } else { for (i = 0; i < xchan->xr_num; i++) { xr = &xchan->xr_mem[i]; - contigfree(xr->buf.cbuf, xchan->maxsegsize, M_XDMA); + /* TODO: bounce buffer */ } } @@ -245,17 +238,19 @@ xdma_prep_sg(xdma_channel_t *xchan, uint32_t xr_num, return (-1); } - /* Allocate bufs. */ - ret = xchan_bufs_alloc(xchan); - if (ret != 0) { - device_printf(xdma->dev, - "%s: Can't allocate bufs.\n", __func__); + /* Allocate buffers if required. */ + if ((xchan->caps & XCHAN_CAP_NOBUFS) == 0) { + ret = xchan_bufs_alloc(xchan); + if (ret != 0) { + device_printf(xdma->dev, + "%s: Can't allocate bufs.\n", __func__); - /* Cleanup */ - xchan_sglist_free(xchan); - xchan_bank_free(xchan); + /* Cleanup */ + xchan_sglist_free(xchan); + xchan_bank_free(xchan); - return (-1); + return (-1); + } } xchan->flags |= (XCHAN_CONFIGURED | XCHAN_TYPE_SG); @@ -442,14 +437,8 @@ _xdma_load_data(xdma_channel_t *xchan, struct xdma_req switch (xr->req_type) { case XR_TYPE_MBUF: - if (xr->direction == XDMA_MEM_TO_DEV) { - m_copydata(m, 0, m->m_pkthdr.len, xr->buf.cbuf); - seg[0].ds_addr = (bus_addr_t)xr->buf.cbuf; - seg[0].ds_len = m->m_pkthdr.len; - } else { - seg[0].ds_addr = mtod(m, bus_addr_t); - seg[0].ds_len = m->m_pkthdr.len; - } + seg[0].ds_addr = mtod(m, bus_addr_t); + seg[0].ds_len = m->m_pkthdr.len; break; case XR_TYPE_BIO: case XR_TYPE_VIRT: @@ -516,7 +505,9 @@ xdma_process(xdma_channel_t *xchan, TAILQ_FOREACH_SAFE(xr, &xchan->queue_in, xr_next, xr_tmp) { switch (xr->req_type) { case XR_TYPE_MBUF: - c = xdma_mbuf_defrag(xchan, xr); + if ((xchan->caps & XCHAN_CAP_NOSEG) || + (c > xchan->maxnsegs)) + c = xdma_mbuf_defrag(xchan, xr); break; case XR_TYPE_BIO: case XR_TYPE_VIRT: @@ -571,7 +562,8 @@ xdma_queue_submit_sg(xdma_channel_t *xchan) sg = xchan->sg; - if ((xchan->flags & XCHAN_BUFS_ALLOCATED) == 0) { + if ((xchan->caps & XCHAN_CAP_NOBUFS) == 0 && + (xchan->flags & XCHAN_BUFS_ALLOCATED) == 0) { device_printf(xdma->dev, "%s: Can't submit a transfer: no bufs\n", __func__); From owner-svn-src-all@freebsd.org Mon Apr 29 16:50:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9847E159633A; Mon, 29 Apr 2019 16:50:34 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3EDE58C014; Mon, 29 Apr 2019 16:50:34 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BDDE24BE4; Mon, 29 Apr 2019 16:50:34 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TGoXl9086938; Mon, 29 Apr 2019 16:50:33 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TGoXxB086936; Mon, 29 Apr 2019 16:50:33 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201904291650.x3TGoXxB086936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Mon, 29 Apr 2019 16:50:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346897 - in head/sys: conf powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: in head/sys: conf powerpc/conf X-SVN-Commit-Revision: 346897 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3EDE58C014 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 16:50:34 -0000 Author: luporl Date: Mon Apr 29 16:50:33 2019 New Revision: 346897 URL: https://svnweb.freebsd.org/changeset/base/346897 Log: [PPC64] Turn opal_flash.c into a device This change makes it easier to enable/disable the inclusion of OPAL flash in the kernel. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D20098 Modified: head/sys/conf/files.powerpc head/sys/powerpc/conf/GENERIC64 Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Mon Apr 29 16:27:15 2019 (r346896) +++ head/sys/conf/files.powerpc Mon Apr 29 16:50:33 2019 (r346897) @@ -191,7 +191,7 @@ powerpc/powernv/opal.c optional powernv powerpc/powernv/opal_async.c optional powernv powerpc/powernv/opal_console.c optional powernv powerpc/powernv/opal_dev.c optional powernv -powerpc/powernv/opal_flash.c optional powernv +powerpc/powernv/opal_flash.c optional powernv opalflash powerpc/powernv/opal_hmi.c optional powernv powerpc/powernv/opal_i2c.c optional iicbus fdt powernv powerpc/powernv/opal_i2cm.c optional iicbus fdt powernv Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Mon Apr 29 16:27:15 2019 (r346896) +++ head/sys/powerpc/conf/GENERIC64 Mon Apr 29 16:50:33 2019 (r346897) @@ -236,6 +236,7 @@ device powermac_nvram # Open Firmware configuration N device smu # Apple System Management Unit device atibl # ATI-based backlight driver for PowerBooks/iBooks device nvbl # nVidia-based backlight driver for PowerBooks/iBooks +device opalflash # PowerNV embedded flash memory # ADB support device adb From owner-svn-src-all@freebsd.org Mon Apr 29 18:09:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D32EE1597C5C; Mon, 29 Apr 2019 18:09:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 756E48E93D; Mon, 29 Apr 2019 18:09:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4821525A27; Mon, 29 Apr 2019 18:09:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TI9utx028539; Mon, 29 Apr 2019 18:09:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TI9uVc028538; Mon, 29 Apr 2019 18:09:56 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201904291809.x3TI9uVc028538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 29 Apr 2019 18:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346898 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 346898 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 756E48E93D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 18:09:57 -0000 Author: mav Date: Mon Apr 29 18:09:55 2019 New Revision: 346898 URL: https://svnweb.freebsd.org/changeset/base/346898 Log: ip multicast debug: fix strings vs defines Turning on multicast debug made multicast failure worse because the strings and #define values no longer matched up. Fix them, and make sure they stay matched-up. Submitted by: torek MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/netinet/in_mcast.c Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Mon Apr 29 16:50:33 2019 (r346897) +++ head/sys/netinet/in_mcast.c Mon Apr 29 18:09:55 2019 (r346898) @@ -3067,7 +3067,14 @@ sysctl_ip_mcast_filters(SYSCTL_HANDLER_ARGS) #if defined(KTR) && (KTR_COMPILE & KTR_IGMPV3) -static const char *inm_modestrs[] = { "un", "in", "ex" }; +static const char *inm_modestrs[] = { + [MCAST_UNDEFINED] = "un", + [MCAST_INCLUDE] = "in", + [MCAST_EXCLUDE] = "ex", +}; +_Static_assert(MCAST_UNDEFINED == 0 && + MCAST_EXCLUDE + 1 == nitems(inm_modestrs), + "inm_modestrs: no longer matches #defines"); static const char * inm_mode_str(const int mode) @@ -3079,16 +3086,20 @@ inm_mode_str(const int mode) } static const char *inm_statestrs[] = { - "not-member", - "silent", - "idle", - "lazy", - "sleeping", - "awakening", - "query-pending", - "sg-query-pending", - "leaving" + [IGMP_NOT_MEMBER] = "not-member", + [IGMP_SILENT_MEMBER] = "silent", + [IGMP_REPORTING_MEMBER] = "reporting", + [IGMP_IDLE_MEMBER] = "idle", + [IGMP_LAZY_MEMBER] = "lazy", + [IGMP_SLEEPING_MEMBER] = "sleeping", + [IGMP_AWAKENING_MEMBER] = "awakening", + [IGMP_G_QUERY_PENDING_MEMBER] = "query-pending", + [IGMP_SG_QUERY_PENDING_MEMBER] = "sg-query-pending", + [IGMP_LEAVING_MEMBER] = "leaving", }; +_Static_assert(IGMP_NOT_MEMBER == 0 && + IGMP_LEAVING_MEMBER + 1 == nitems(inm_statestrs), + "inm_statetrs: no longer matches #defines"); static const char * inm_state_str(const int state) From owner-svn-src-all@freebsd.org Mon Apr 29 18:20:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C332E1598643; Mon, 29 Apr 2019 18:20:52 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 652188F995; Mon, 29 Apr 2019 18:20:52 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EB0125BEE; Mon, 29 Apr 2019 18:20:52 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TIKqjx035235; Mon, 29 Apr 2019 18:20:52 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TIKqsx035234; Mon, 29 Apr 2019 18:20:52 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <201904291820.x3TIKqsx035234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Mon, 29 Apr 2019 18:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346899 - head X-SVN-Group: head X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 346899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 652188F995 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 18:20:52 -0000 Author: zeising (doc,ports committer) Date: Mon Apr 29 18:20:51 2019 New Revision: 346899 URL: https://svnweb.freebsd.org/changeset/base/346899 Log: Add a note to MAINTAINERS for lkpi for graphics Add a note to MAINTAINERS requesting pre-commit review from the graphics team, using phabricator, for changes to the lkpi subsystem. This is done in order to give us a chance to test the graphics drivers (drm drivers) for regressions, and to try to avoid breakage, errors and issues with the graphics drivers. The review is done via the #x11 group on phabricator. Please note that hselasky also want to review changes. Discussed with: hselasky, imp Approved by: imp Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Mon Apr 29 18:09:55 2019 (r346898) +++ head/MAINTAINERS Mon Apr 29 18:20:51 2019 (r346899) @@ -90,6 +90,10 @@ share/mk/*.test.mk freebsd-testing,ngie (same list as stand/forth dteske Pre-commit review requested. stand/lua kevans Pre-commit review requested sys/compat/linuxkpi hselasky If in doubt, ask. + zeising, johalun pre-commit review requested via + #x11 phabricator group. + (to avoid drm graphics drivers + inpact) sys/contrib/ipfilter cy Pre-commit review requested. sys/dev/e1000 erj Pre-commit phabricator review requested. sys/dev/ixgbe erj Pre-commit phabricator review requested. From owner-svn-src-all@freebsd.org Mon Apr 29 18:25:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED7EB1598751; Mon, 29 Apr 2019 18:25:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DD9D8FDB9; Mon, 29 Apr 2019 18:25:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15B3925D8B; Mon, 29 Apr 2019 18:25:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TIPdHr040243; Mon, 29 Apr 2019 18:25:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TIPd74040239; Mon, 29 Apr 2019 18:25:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904291825.x3TIPd74040239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 29 Apr 2019 18:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346900 - stable/12/usr.bin/ar X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/usr.bin/ar X-SVN-Commit-Revision: 346900 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3DD9D8FDB9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 18:25:41 -0000 Author: emaste Date: Mon Apr 29 18:25:39 2019 New Revision: 346900 URL: https://svnweb.freebsd.org/changeset/base/346900 Log: MFC r339648: ar: report errno on warning/error Previously ar would report an error like "ar: fatal: Write error" without including additional errno information. Change warnings and errors to include archive_errno() so that the user may have some idea of the reason for the failure. Sponsored by: The FreeBSD Foundation Modified: stable/12/usr.bin/ar/acpyacc.y stable/12/usr.bin/ar/ar.h stable/12/usr.bin/ar/read.c stable/12/usr.bin/ar/write.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/ar/acpyacc.y ============================================================================== --- stable/12/usr.bin/ar/acpyacc.y Mon Apr 29 18:20:51 2019 (r346899) +++ stable/12/usr.bin/ar/acpyacc.y Mon Apr 29 18:25:39 2019 (r346900) @@ -254,7 +254,8 @@ arscp_open(char *fname) archive_read_support_format_ar(a); AC(archive_read_open_filename(a, fname, DEF_BLKSZ)); if ((r = archive_read_next_header(a, &entry))) - bsdar_warnc(bsdar, 0, "%s", archive_error_string(a)); + bsdar_warnc(bsdar, archive_errno(a), "%s", + archive_error_string(a)); AC(archive_read_close(a)); AC(archive_read_free(a)); if (r != ARCHIVE_OK) Modified: stable/12/usr.bin/ar/ar.h ============================================================================== --- stable/12/usr.bin/ar/ar.h Mon Apr 29 18:20:51 2019 (r346899) +++ stable/12/usr.bin/ar/ar.h Mon Apr 29 18:25:39 2019 (r346900) @@ -52,10 +52,10 @@ /* * Convenient wrapper for general libarchive error handling. */ -#define AC(CALL) do { \ - if ((CALL)) \ - bsdar_errc(bsdar, EX_SOFTWARE, 0, "%s", \ - archive_error_string(a)); \ +#define AC(CALL) do { \ + if ((CALL)) \ + bsdar_errc(bsdar, EX_SOFTWARE, archive_errno(a), "%s", \ + archive_error_string(a)); \ } while (0) /* Modified: stable/12/usr.bin/ar/read.c ============================================================================== --- stable/12/usr.bin/ar/read.c Mon Apr 29 18:20:51 2019 (r346899) +++ stable/12/usr.bin/ar/read.c Mon Apr 29 18:25:39 2019 (r346900) @@ -96,7 +96,8 @@ read_archive(struct bsdar *bsdar, char mode) r = archive_read_next_header(a, &entry); if (r == ARCHIVE_WARN || r == ARCHIVE_RETRY || r == ARCHIVE_FATAL) - bsdar_warnc(bsdar, 0, "%s", archive_error_string(a)); + bsdar_warnc(bsdar, archive_errno(a), "%s", + archive_error_string(a)); if (r == ARCHIVE_EOF || r == ARCHIVE_FATAL) break; if (r == ARCHIVE_RETRY) { @@ -151,7 +152,7 @@ read_archive(struct bsdar *bsdar, char mode) if (r == ARCHIVE_WARN || r == ARCHIVE_RETRY || r == ARCHIVE_FATAL) { (void)fprintf(stdout, "\n"); - bsdar_warnc(bsdar, 0, "%s", + bsdar_warnc(bsdar, archive_errno(a), "%s", archive_error_string(a)); } @@ -205,7 +206,7 @@ read_archive(struct bsdar *bsdar, char mode) } if (r) - bsdar_warnc(bsdar, 0, "%s", + bsdar_warnc(bsdar, archive_errno(a), "%s", archive_error_string(a)); } } Modified: stable/12/usr.bin/ar/write.c ============================================================================== --- stable/12/usr.bin/ar/write.c Mon Apr 29 18:20:51 2019 (r346899) +++ stable/12/usr.bin/ar/write.c Mon Apr 29 18:25:39 2019 (r346900) @@ -291,12 +291,13 @@ read_objs(struct bsdar *bsdar, const char *archive, in for (;;) { r = archive_read_next_header(a, &entry); if (r == ARCHIVE_FATAL) - bsdar_errc(bsdar, EX_DATAERR, 0, "%s", + bsdar_errc(bsdar, EX_DATAERR, archive_errno(a), "%s", archive_error_string(a)); if (r == ARCHIVE_EOF) break; if (r == ARCHIVE_WARN || r == ARCHIVE_RETRY) - bsdar_warnc(bsdar, 0, "%s", archive_error_string(a)); + bsdar_warnc(bsdar, archive_errno(a), "%s", + archive_error_string(a)); if (r == ARCHIVE_RETRY) { bsdar_warnc(bsdar, 0, "Retrying..."); continue; @@ -341,7 +342,7 @@ read_objs(struct bsdar *bsdar, const char *archive, in bsdar_errc(bsdar, EX_SOFTWARE, errno, "malloc failed"); if (archive_read_data(a, buff, size) != (ssize_t)size) { - bsdar_warnc(bsdar, 0, "%s", + bsdar_warnc(bsdar, archive_errno(a), "%s", archive_error_string(a)); free(buff); continue; @@ -594,7 +595,7 @@ write_data(struct bsdar *bsdar, struct archive *a, con while (s > 0) { written = archive_write_data(a, buf, s); if (written < 0) - bsdar_errc(bsdar, EX_SOFTWARE, 0, "%s", + bsdar_errc(bsdar, EX_SOFTWARE, archive_errno(a), "%s", archive_error_string(a)); buf = (const char *)buf + written; s -= written; From owner-svn-src-all@freebsd.org Mon Apr 29 18:28:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37A741598875; Mon, 29 Apr 2019 18:28:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFABC8FFEA; Mon, 29 Apr 2019 18:28:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8C7125D8D; Mon, 29 Apr 2019 18:28:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TISZIH040414; Mon, 29 Apr 2019 18:28:35 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TISYpK040411; Mon, 29 Apr 2019 18:28:34 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904291828.x3TISYpK040411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 29 Apr 2019 18:28:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346901 - stable/11/usr.bin/ar X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/usr.bin/ar X-SVN-Commit-Revision: 346901 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CFABC8FFEA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 18:28:36 -0000 Author: emaste Date: Mon Apr 29 18:28:34 2019 New Revision: 346901 URL: https://svnweb.freebsd.org/changeset/base/346901 Log: MFC r339648: ar: report errno on warning/error Previously ar would report an error like "ar: fatal: Write error" without including additional errno information. Change warnings and errors to include archive_errno() so that the user may have some idea of the reason for the failure. Sponsored by: The FreeBSD Foundation Modified: stable/11/usr.bin/ar/acpyacc.y stable/11/usr.bin/ar/ar.h stable/11/usr.bin/ar/read.c stable/11/usr.bin/ar/write.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/ar/acpyacc.y ============================================================================== --- stable/11/usr.bin/ar/acpyacc.y Mon Apr 29 18:25:39 2019 (r346900) +++ stable/11/usr.bin/ar/acpyacc.y Mon Apr 29 18:28:34 2019 (r346901) @@ -254,7 +254,8 @@ arscp_open(char *fname) archive_read_support_format_ar(a); AC(archive_read_open_filename(a, fname, DEF_BLKSZ)); if ((r = archive_read_next_header(a, &entry))) - bsdar_warnc(bsdar, 0, "%s", archive_error_string(a)); + bsdar_warnc(bsdar, archive_errno(a), "%s", + archive_error_string(a)); AC(archive_read_close(a)); AC(archive_read_free(a)); if (r != ARCHIVE_OK) Modified: stable/11/usr.bin/ar/ar.h ============================================================================== --- stable/11/usr.bin/ar/ar.h Mon Apr 29 18:25:39 2019 (r346900) +++ stable/11/usr.bin/ar/ar.h Mon Apr 29 18:28:34 2019 (r346901) @@ -52,10 +52,10 @@ /* * Convenient wrapper for general libarchive error handling. */ -#define AC(CALL) do { \ - if ((CALL)) \ - bsdar_errc(bsdar, EX_SOFTWARE, 0, "%s", \ - archive_error_string(a)); \ +#define AC(CALL) do { \ + if ((CALL)) \ + bsdar_errc(bsdar, EX_SOFTWARE, archive_errno(a), "%s", \ + archive_error_string(a)); \ } while (0) /* Modified: stable/11/usr.bin/ar/read.c ============================================================================== --- stable/11/usr.bin/ar/read.c Mon Apr 29 18:25:39 2019 (r346900) +++ stable/11/usr.bin/ar/read.c Mon Apr 29 18:28:34 2019 (r346901) @@ -96,7 +96,8 @@ read_archive(struct bsdar *bsdar, char mode) r = archive_read_next_header(a, &entry); if (r == ARCHIVE_WARN || r == ARCHIVE_RETRY || r == ARCHIVE_FATAL) - bsdar_warnc(bsdar, 0, "%s", archive_error_string(a)); + bsdar_warnc(bsdar, archive_errno(a), "%s", + archive_error_string(a)); if (r == ARCHIVE_EOF || r == ARCHIVE_FATAL) break; if (r == ARCHIVE_RETRY) { @@ -151,7 +152,7 @@ read_archive(struct bsdar *bsdar, char mode) if (r == ARCHIVE_WARN || r == ARCHIVE_RETRY || r == ARCHIVE_FATAL) { (void)fprintf(stdout, "\n"); - bsdar_warnc(bsdar, 0, "%s", + bsdar_warnc(bsdar, archive_errno(a), "%s", archive_error_string(a)); } @@ -205,7 +206,7 @@ read_archive(struct bsdar *bsdar, char mode) } if (r) - bsdar_warnc(bsdar, 0, "%s", + bsdar_warnc(bsdar, archive_errno(a), "%s", archive_error_string(a)); } } Modified: stable/11/usr.bin/ar/write.c ============================================================================== --- stable/11/usr.bin/ar/write.c Mon Apr 29 18:25:39 2019 (r346900) +++ stable/11/usr.bin/ar/write.c Mon Apr 29 18:28:34 2019 (r346901) @@ -291,12 +291,13 @@ read_objs(struct bsdar *bsdar, const char *archive, in for (;;) { r = archive_read_next_header(a, &entry); if (r == ARCHIVE_FATAL) - bsdar_errc(bsdar, EX_DATAERR, 0, "%s", + bsdar_errc(bsdar, EX_DATAERR, archive_errno(a), "%s", archive_error_string(a)); if (r == ARCHIVE_EOF) break; if (r == ARCHIVE_WARN || r == ARCHIVE_RETRY) - bsdar_warnc(bsdar, 0, "%s", archive_error_string(a)); + bsdar_warnc(bsdar, archive_errno(a), "%s", + archive_error_string(a)); if (r == ARCHIVE_RETRY) { bsdar_warnc(bsdar, 0, "Retrying..."); continue; @@ -341,7 +342,7 @@ read_objs(struct bsdar *bsdar, const char *archive, in bsdar_errc(bsdar, EX_SOFTWARE, errno, "malloc failed"); if (archive_read_data(a, buff, size) != (ssize_t)size) { - bsdar_warnc(bsdar, 0, "%s", + bsdar_warnc(bsdar, archive_errno(a), "%s", archive_error_string(a)); free(buff); continue; @@ -594,7 +595,7 @@ write_data(struct bsdar *bsdar, struct archive *a, con while (s > 0) { written = archive_write_data(a, buf, s); if (written < 0) - bsdar_errc(bsdar, EX_SOFTWARE, 0, "%s", + bsdar_errc(bsdar, EX_SOFTWARE, archive_errno(a), "%s", archive_error_string(a)); buf = (const char *)buf + written; s -= written; From owner-svn-src-all@freebsd.org Mon Apr 29 18:34:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B69621598BBB; Mon, 29 Apr 2019 18:34:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B62368684; Mon, 29 Apr 2019 18:34:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2684A25F2E; Mon, 29 Apr 2019 18:34:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TIYB5r045410; Mon, 29 Apr 2019 18:34:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TIYBav045405; Mon, 29 Apr 2019 18:34:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904291834.x3TIYBav045405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 29 Apr 2019 18:34:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346902 - stable/12/usr.bin/ar X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/usr.bin/ar X-SVN-Commit-Revision: 346902 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5B62368684 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 18:34:13 -0000 Author: emaste Date: Mon Apr 29 18:34:11 2019 New Revision: 346902 URL: https://svnweb.freebsd.org/changeset/base/346902 Log: MFC ar: implement support for /SYM64/ 64-bit archives r346079: ar: implement support for /SYM64/ 64-bit archives Submitted by: Gerald Aryeetey Reviewed by: imp (earlier) r346568: ar: test for writing 64-bit format only if symbol count is nonzero This is a minor simplification; if we do not have any symbols the empty symbol table can be in 32-bit format. r346569: ar: use array notation to access s_so This is somewhat more readable than pointer arithmetic. Also remove an unnecessary cast while here. r346582: ar: shuffle symbol offsets during conversion for 32-bit ar archives During processing we maintain symbol offsets in the 64-bit s_so array, and when writing the archive convert to 32-bit if no offsets are greater than 4GB. However, this was somewhat inefficient as we looped over the array twice: first, converting to big endian and second, writing each 32-bit value one at a time (and incorrectly so on big-endian platforms). Instead, when writing a 32-bit archive shuffle convert symbol data to big endian (as required by the ar format) and shuffle to the beginning of the allocation at the same time. Also correct emission of the symbol count on big endian platforms. Further changes are planned, but this should fix powerpc64. Reported by: jhibbits, mlinimon Reviewed by: jhibbits, Gerald Aryeetey (earlier) Tested by: jhibbits PR: 234454 Sponsored by: The FreeBSD Foundation Modified: stable/12/usr.bin/ar/ar.h stable/12/usr.bin/ar/read.c stable/12/usr.bin/ar/write.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/ar/ar.h ============================================================================== --- stable/12/usr.bin/ar/ar.h Mon Apr 29 18:28:34 2019 (r346901) +++ stable/12/usr.bin/ar/ar.h Mon Apr 29 18:34:11 2019 (r346902) @@ -100,9 +100,11 @@ struct bsdar { /* * Fields for the archive symbol table. */ - uint32_t s_cnt; /* current number of symbols. */ - uint32_t *s_so; /* symbol offset table. */ + uint64_t s_cnt; /* current number of symbols. */ + uint64_t *s_so; /* symbol offset table. */ + uint64_t s_so_max; /* maximum symbol offset. */ size_t s_so_cap; /* capacity of so table buffer. */ + char *s_sn; /* symbol name table */ size_t s_sn_cap; /* capacity of sn table buffer. */ size_t s_sn_sz; /* current size of sn table. */ Modified: stable/12/usr.bin/ar/read.c ============================================================================== --- stable/12/usr.bin/ar/read.c Mon Apr 29 18:28:34 2019 (r346901) +++ stable/12/usr.bin/ar/read.c Mon Apr 29 18:34:11 2019 (r346902) @@ -109,7 +109,8 @@ read_archive(struct bsdar *bsdar, char mode) break; /* Skip pseudo members. */ - if (strcmp(name, "/") == 0 || strcmp(name, "//") == 0) + if (strcmp(name, "/") == 0 || strcmp(name, "//") == 0 || + strcmp(name, "/SYM64/") == 0) continue; if (bsdar->argc > 0) { Modified: stable/12/usr.bin/ar/write.c ============================================================================== --- stable/12/usr.bin/ar/write.c Mon Apr 29 18:28:34 2019 (r346901) +++ stable/12/usr.bin/ar/write.c Mon Apr 29 18:34:11 2019 (r346902) @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #define _ARMAG_LEN 8 /* length of ar magic string */ #define _ARHDR_LEN 60 /* length of ar header */ #define _INIT_AS_CAP 128 /* initial archive string table size */ -#define _INIT_SYMOFF_CAP (256*(sizeof(uint32_t))) /* initial so table size */ +#define _INIT_SYMOFF_CAP (256*(sizeof(uint64_t))) /* initial so table size */ #define _INIT_SYMNAME_CAP 1024 /* initial sn table size */ #define _MAXNAMELEN_SVR4 15 /* max member name length in svr4 variant */ #define _TRUNCATE_LEN 15 /* number of bytes to keep for member name */ @@ -557,6 +557,7 @@ write_cleanup(struct bsdar *bsdar) free(bsdar->s_sn); bsdar->as = NULL; bsdar->s_so = NULL; + bsdar->s_so_max = 0; bsdar->s_sn = NULL; } @@ -613,7 +614,10 @@ write_objs(struct bsdar *bsdar) struct archive_entry *entry; size_t s_sz; /* size of archive symbol table. */ size_t pm_sz; /* size of pseudo members */ - int i, nr; + size_t w_sz; /* size of words in symbol table */ + uint64_t nr; + uint32_t nr32; + int i; if (elf_version(EV_CURRENT) == EV_NONE) bsdar_errc(bsdar, EX_SOFTWARE, 0, @@ -628,9 +632,6 @@ write_objs(struct bsdar *bsdar) if (strlen(obj->name) > _MAXNAMELEN_SVR4) add_to_ar_str_table(bsdar, obj->name); bsdar->rela_off += _ARHDR_LEN + obj->size + obj->size % 2; - if (bsdar->rela_off > UINT32_MAX) - bsdar_errc(bsdar, EX_SOFTWARE, 0, - "Symbol table offset overflow"); } /* @@ -656,18 +657,31 @@ write_objs(struct bsdar *bsdar) * * absolute_offset = htobe32(relative_offset + size_of_pseudo_members) */ - + w_sz = sizeof(uint32_t); if (bsdar->s_cnt != 0) { s_sz = (bsdar->s_cnt + 1) * sizeof(uint32_t) + bsdar->s_sn_sz; pm_sz = _ARMAG_LEN + (_ARHDR_LEN + s_sz); if (bsdar->as != NULL) pm_sz += _ARHDR_LEN + bsdar->as_sz; - for (i = 0; (size_t)i < bsdar->s_cnt; i++) { - if (*(bsdar->s_so + i) > UINT32_MAX - pm_sz) - bsdar_errc(bsdar, EX_SOFTWARE, 0, - "Symbol table offset overflow"); - *(bsdar->s_so + i) = htobe32(*(bsdar->s_so + i) + - pm_sz); + /* Use the 64-bit word size format if necessary. */ + if (bsdar->s_so_max > UINT32_MAX - pm_sz) { + w_sz = sizeof(uint64_t); + pm_sz -= s_sz; + s_sz = (bsdar->s_cnt + 1) * sizeof(uint64_t) + + bsdar->s_sn_sz; + pm_sz += s_sz; + /* Convert to big-endian. */ + for (i = 0; (size_t)i < bsdar->s_cnt; i++) + bsdar->s_so[i] = + htobe64(bsdar->s_so[i] + pm_sz); + } else { + /* + * Convert to big-endian and shuffle in-place to + * the front of the allocation. XXX UB + */ + for (i = 0; (size_t)i < bsdar->s_cnt; i++) + ((uint32_t *)(bsdar->s_so))[i] = + htobe32(bsdar->s_so[i] + pm_sz); } } @@ -689,16 +703,23 @@ write_objs(struct bsdar *bsdar) if (entry == NULL) bsdar_errc(bsdar, EX_SOFTWARE, 0, "archive_entry_new failed"); - archive_entry_copy_pathname(entry, "/"); + if (w_sz == sizeof(uint64_t)) + archive_entry_copy_pathname(entry, "/SYM64/"); + else + archive_entry_copy_pathname(entry, "/"); if ((bsdar->options & AR_D) == 0) archive_entry_set_mtime(entry, time(NULL), 0); - archive_entry_set_size(entry, (bsdar->s_cnt + 1) * - sizeof(uint32_t) + bsdar->s_sn_sz); + archive_entry_set_size(entry, (bsdar->s_cnt + 1) * w_sz + + bsdar->s_sn_sz); AC(archive_write_header(a, entry)); - nr = htobe32(bsdar->s_cnt); - write_data(bsdar, a, &nr, sizeof(uint32_t)); - write_data(bsdar, a, bsdar->s_so, sizeof(uint32_t) * - bsdar->s_cnt); + if (w_sz == sizeof(uint64_t)) { + nr = htobe64(bsdar->s_cnt); + write_data(bsdar, a, &nr, sizeof(nr)); + } else { + nr32 = htobe32((uint32_t)bsdar->s_cnt); + write_data(bsdar, a, &nr32, sizeof(nr32)); + } + write_data(bsdar, a, bsdar->s_so, w_sz * bsdar->s_cnt); write_data(bsdar, a, bsdar->s_sn, bsdar->s_sn_sz); archive_entry_free(entry); } @@ -904,13 +925,15 @@ add_to_ar_sym_table(struct bsdar *bsdar, const char *n bsdar->s_sn_sz = 0; } - if (bsdar->s_cnt * sizeof(uint32_t) >= bsdar->s_so_cap) { + if (bsdar->s_cnt * sizeof(uint64_t) >= bsdar->s_so_cap) { bsdar->s_so_cap *= 2; bsdar->s_so = realloc(bsdar->s_so, bsdar->s_so_cap); if (bsdar->s_so == NULL) bsdar_errc(bsdar, EX_SOFTWARE, errno, "realloc failed"); } bsdar->s_so[bsdar->s_cnt] = bsdar->rela_off; + if ((uint64_t)bsdar->rela_off > bsdar->s_so_max) + bsdar->s_so_max = (uint64_t)bsdar->rela_off; bsdar->s_cnt++; /* From owner-svn-src-all@freebsd.org Mon Apr 29 18:37:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3FAB1598D34; Mon, 29 Apr 2019 18:37:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7876B69C68; Mon, 29 Apr 2019 18:37:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D90625F4E; Mon, 29 Apr 2019 18:37:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TIbext045634; Mon, 29 Apr 2019 18:37:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TIbdDC045631; Mon, 29 Apr 2019 18:37:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904291837.x3TIbdDC045631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 29 Apr 2019 18:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346903 - stable/11/usr.bin/ar X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/usr.bin/ar X-SVN-Commit-Revision: 346903 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7876B69C68 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 18:37:41 -0000 Author: emaste Date: Mon Apr 29 18:37:39 2019 New Revision: 346903 URL: https://svnweb.freebsd.org/changeset/base/346903 Log: MFC ar: implement support for /SYM64/ 64-bit archives r346079: ar: implement support for /SYM64/ 64-bit archives Submitted by: Gerald Aryeetey Reviewed by: imp (earlier) r346568: ar: test for writing 64-bit format only if symbol count is nonzero This is a minor simplification; if we do not have any symbols the empty symbol table can be in 32-bit format. r346569: ar: use array notation to access s_so This is somewhat more readable than pointer arithmetic. Also remove an unnecessary cast while here. r346582: ar: shuffle symbol offsets during conversion for 32-bit ar archives During processing we maintain symbol offsets in the 64-bit s_so array, and when writing the archive convert to 32-bit if no offsets are greater than 4GB. However, this was somewhat inefficient as we looped over the array twice: first, converting to big endian and second, writing each 32-bit value one at a time (and incorrectly so on big-endian platforms). Instead, when writing a 32-bit archive shuffle convert symbol data to big endian (as required by the ar format) and shuffle to the beginning of the allocation at the same time. Also correct emission of the symbol count on big endian platforms. Further changes are planned, but this should fix powerpc64. Reported by: jhibbits, mlinimon Reviewed by: jhibbits, Gerald Aryeetey (earlier) Tested by: jhibbits PR: 234454 Sponsored by: The FreeBSD Foundation Modified: stable/11/usr.bin/ar/ar.h stable/11/usr.bin/ar/read.c stable/11/usr.bin/ar/write.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/ar/ar.h ============================================================================== --- stable/11/usr.bin/ar/ar.h Mon Apr 29 18:34:11 2019 (r346902) +++ stable/11/usr.bin/ar/ar.h Mon Apr 29 18:37:39 2019 (r346903) @@ -100,9 +100,11 @@ struct bsdar { /* * Fields for the archive symbol table. */ - uint32_t s_cnt; /* current number of symbols. */ - uint32_t *s_so; /* symbol offset table. */ + uint64_t s_cnt; /* current number of symbols. */ + uint64_t *s_so; /* symbol offset table. */ + uint64_t s_so_max; /* maximum symbol offset. */ size_t s_so_cap; /* capacity of so table buffer. */ + char *s_sn; /* symbol name table */ size_t s_sn_cap; /* capacity of sn table buffer. */ size_t s_sn_sz; /* current size of sn table. */ Modified: stable/11/usr.bin/ar/read.c ============================================================================== --- stable/11/usr.bin/ar/read.c Mon Apr 29 18:34:11 2019 (r346902) +++ stable/11/usr.bin/ar/read.c Mon Apr 29 18:37:39 2019 (r346903) @@ -109,7 +109,8 @@ read_archive(struct bsdar *bsdar, char mode) break; /* Skip pseudo members. */ - if (strcmp(name, "/") == 0 || strcmp(name, "//") == 0) + if (strcmp(name, "/") == 0 || strcmp(name, "//") == 0 || + strcmp(name, "/SYM64/") == 0) continue; if (bsdar->argc > 0) { Modified: stable/11/usr.bin/ar/write.c ============================================================================== --- stable/11/usr.bin/ar/write.c Mon Apr 29 18:34:11 2019 (r346902) +++ stable/11/usr.bin/ar/write.c Mon Apr 29 18:37:39 2019 (r346903) @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #define _ARMAG_LEN 8 /* length of ar magic string */ #define _ARHDR_LEN 60 /* length of ar header */ #define _INIT_AS_CAP 128 /* initial archive string table size */ -#define _INIT_SYMOFF_CAP (256*(sizeof(uint32_t))) /* initial so table size */ +#define _INIT_SYMOFF_CAP (256*(sizeof(uint64_t))) /* initial so table size */ #define _INIT_SYMNAME_CAP 1024 /* initial sn table size */ #define _MAXNAMELEN_SVR4 15 /* max member name length in svr4 variant */ #define _TRUNCATE_LEN 15 /* number of bytes to keep for member name */ @@ -557,6 +557,7 @@ write_cleanup(struct bsdar *bsdar) free(bsdar->s_sn); bsdar->as = NULL; bsdar->s_so = NULL; + bsdar->s_so_max = 0; bsdar->s_sn = NULL; } @@ -613,7 +614,10 @@ write_objs(struct bsdar *bsdar) struct archive_entry *entry; size_t s_sz; /* size of archive symbol table. */ size_t pm_sz; /* size of pseudo members */ - int i, nr; + size_t w_sz; /* size of words in symbol table */ + uint64_t nr; + uint32_t nr32; + int i; if (elf_version(EV_CURRENT) == EV_NONE) bsdar_errc(bsdar, EX_SOFTWARE, 0, @@ -628,9 +632,6 @@ write_objs(struct bsdar *bsdar) if (strlen(obj->name) > _MAXNAMELEN_SVR4) add_to_ar_str_table(bsdar, obj->name); bsdar->rela_off += _ARHDR_LEN + obj->size + obj->size % 2; - if (bsdar->rela_off > UINT32_MAX) - bsdar_errc(bsdar, EX_SOFTWARE, 0, - "Symbol table offset overflow"); } /* @@ -656,18 +657,31 @@ write_objs(struct bsdar *bsdar) * * absolute_offset = htobe32(relative_offset + size_of_pseudo_members) */ - + w_sz = sizeof(uint32_t); if (bsdar->s_cnt != 0) { s_sz = (bsdar->s_cnt + 1) * sizeof(uint32_t) + bsdar->s_sn_sz; pm_sz = _ARMAG_LEN + (_ARHDR_LEN + s_sz); if (bsdar->as != NULL) pm_sz += _ARHDR_LEN + bsdar->as_sz; - for (i = 0; (size_t)i < bsdar->s_cnt; i++) { - if (*(bsdar->s_so + i) > UINT32_MAX - pm_sz) - bsdar_errc(bsdar, EX_SOFTWARE, 0, - "Symbol table offset overflow"); - *(bsdar->s_so + i) = htobe32(*(bsdar->s_so + i) + - pm_sz); + /* Use the 64-bit word size format if necessary. */ + if (bsdar->s_so_max > UINT32_MAX - pm_sz) { + w_sz = sizeof(uint64_t); + pm_sz -= s_sz; + s_sz = (bsdar->s_cnt + 1) * sizeof(uint64_t) + + bsdar->s_sn_sz; + pm_sz += s_sz; + /* Convert to big-endian. */ + for (i = 0; (size_t)i < bsdar->s_cnt; i++) + bsdar->s_so[i] = + htobe64(bsdar->s_so[i] + pm_sz); + } else { + /* + * Convert to big-endian and shuffle in-place to + * the front of the allocation. XXX UB + */ + for (i = 0; (size_t)i < bsdar->s_cnt; i++) + ((uint32_t *)(bsdar->s_so))[i] = + htobe32(bsdar->s_so[i] + pm_sz); } } @@ -689,16 +703,23 @@ write_objs(struct bsdar *bsdar) if (entry == NULL) bsdar_errc(bsdar, EX_SOFTWARE, 0, "archive_entry_new failed"); - archive_entry_copy_pathname(entry, "/"); + if (w_sz == sizeof(uint64_t)) + archive_entry_copy_pathname(entry, "/SYM64/"); + else + archive_entry_copy_pathname(entry, "/"); if ((bsdar->options & AR_D) == 0) archive_entry_set_mtime(entry, time(NULL), 0); - archive_entry_set_size(entry, (bsdar->s_cnt + 1) * - sizeof(uint32_t) + bsdar->s_sn_sz); + archive_entry_set_size(entry, (bsdar->s_cnt + 1) * w_sz + + bsdar->s_sn_sz); AC(archive_write_header(a, entry)); - nr = htobe32(bsdar->s_cnt); - write_data(bsdar, a, &nr, sizeof(uint32_t)); - write_data(bsdar, a, bsdar->s_so, sizeof(uint32_t) * - bsdar->s_cnt); + if (w_sz == sizeof(uint64_t)) { + nr = htobe64(bsdar->s_cnt); + write_data(bsdar, a, &nr, sizeof(nr)); + } else { + nr32 = htobe32((uint32_t)bsdar->s_cnt); + write_data(bsdar, a, &nr32, sizeof(nr32)); + } + write_data(bsdar, a, bsdar->s_so, w_sz * bsdar->s_cnt); write_data(bsdar, a, bsdar->s_sn, bsdar->s_sn_sz); archive_entry_free(entry); } @@ -904,13 +925,15 @@ add_to_ar_sym_table(struct bsdar *bsdar, const char *n bsdar->s_sn_sz = 0; } - if (bsdar->s_cnt * sizeof(uint32_t) >= bsdar->s_so_cap) { + if (bsdar->s_cnt * sizeof(uint64_t) >= bsdar->s_so_cap) { bsdar->s_so_cap *= 2; bsdar->s_so = realloc(bsdar->s_so, bsdar->s_so_cap); if (bsdar->s_so == NULL) bsdar_errc(bsdar, EX_SOFTWARE, errno, "realloc failed"); } bsdar->s_so[bsdar->s_cnt] = bsdar->rela_off; + if ((uint64_t)bsdar->rela_off > bsdar->s_so_max) + bsdar->s_so_max = (uint64_t)bsdar->rela_off; bsdar->s_cnt++; /* From owner-svn-src-all@freebsd.org Mon Apr 29 18:48:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 120C315991C2; Mon, 29 Apr 2019 18:48:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA76D6A4ED; Mon, 29 Apr 2019 18:48:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83849260FA; Mon, 29 Apr 2019 18:48:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TImhua050924; Mon, 29 Apr 2019 18:48:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TImhRl050923; Mon, 29 Apr 2019 18:48:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904291848.x3TImhRl050923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 29 Apr 2019 18:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346904 - head X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 346904 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AA76D6A4ED X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 18:48:44 -0000 Author: ngie Date: Mon Apr 29 18:48:43 2019 New Revision: 346904 URL: https://svnweb.freebsd.org/changeset/base/346904 Log: Update/reformat maintainer entries that I am a part of * Replace all instances of freebsd-testing with `#test`. `#test` is the Phabricator group that focuses on test-related reviews. * Replace `atf` with contrib/atf, as that's the actual location for the test framework. * Remove jmmv@ from the maintainers list for atf. He is the upstream project owner, but was moved to alumni status after r345787. * Fix a typo accidentally introduced in r346899 (inpact -> impact). Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Mon Apr 29 18:37:39 2019 (r346903) +++ head/MAINTAINERS Mon Apr 29 18:48:43 2019 (r346904) @@ -35,17 +35,19 @@ makes a commit to the specified subtree. subsystem login notes ----------------------------- -atf freebsd-testing,jmmv,ngie Pre-commit review requested. ath(4) adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org +contrib/atf ngie,#test Pre-commit review requested. +contrib/capsicum-test ngie,#capsicum,#test Pre-commit review requested. contrib/compiler-rt dim Pre-commit review preferred. +contrib/googletest ngie,#test Pre-commit review requested. contrib/ipfilter cy Pre-commit review requested. contrib/libc++ dim Pre-commit review preferred. contrib/libcxxrt dim Pre-commit review preferred. contrib/libunwind dim,emaste,jhb Pre-commit review preferred. contrib/llvm dim Pre-commit review preferred. contrib/llvm/tools/lldb dim,emaste Pre-commit review preferred. -contrib/netbsd-tests freebsd-testing,ngie Pre-commit review requested. -contrib/pjdfstest freebsd-testing,asomers,ngie,pjd Pre-commit review requested. +contrib/netbsd-tests ngie,#test Pre-commit review requested. +contrib/pjdfstest asomers,ngie,pjd,#test Pre-commit review requested. *env(3) secteam Due to the problematic security history of this code, please have patches reviewed by secteam. etc/mail gshapiro Pre-commit review requested. Keep in sync with -STABLE. @@ -86,14 +88,15 @@ sh(1) jilles Pre-commit review requested. This also to kill(1), printf(1) and test(1) which are compiled in as builtins. share/mk imp, bapt, bdrewery, emaste, sjg Make is hard. -share/mk/*.test.mk freebsd-testing,ngie (same list as share/mk too) Pre-commit review requested. +share/mk/*.test.mk imp,bapt,bdrewery, Pre-commit review requested. + emaste,ngie,sjg,#test stand/forth dteske Pre-commit review requested. stand/lua kevans Pre-commit review requested -sys/compat/linuxkpi hselasky If in doubt, ask. +sys/compat/linuxkpi hselasky If in doubt, ask. zeising, johalun pre-commit review requested via #x11 phabricator group. (to avoid drm graphics drivers - inpact) + impact) sys/contrib/ipfilter cy Pre-commit review requested. sys/dev/e1000 erj Pre-commit phabricator review requested. sys/dev/ixgbe erj Pre-commit phabricator review requested. @@ -105,7 +108,7 @@ sys/netinet/ip_carp.c glebius Pre-commit review recomm sys/netpfil/pf kp,glebius Pre-commit review recommended. sys/x86/xen royger Pre-commit review recommended. sys/xen royger Pre-commit review recommended. -tests freebsd-testing,ngie Pre-commit review requested. +tests ngie,#test Pre-commit review requested. tools/build imp Pre-commit review requested, especially to fix bootstrap issues. top(1) eadler Pre-commit review requested. usr.sbin/bsdconfig dteske Pre-commit phabricator review requested. From owner-svn-src-all@freebsd.org Mon Apr 29 18:50:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E12515992DF; Mon, 29 Apr 2019 18:50:38 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 89C416A703; Mon, 29 Apr 2019 18:50:37 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x632.google.com with SMTP id o5so5485197pls.12; Mon, 29 Apr 2019 11:50:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8T0ZIYzPcMUnYOs78qYwoFdRajm6401qH8h6cT1PMfw=; b=mj/W4I8cgnBnzA6D00xybiT7bJUODCKxQydZ+on56BaqGsVu848boSpGDNcqlAStz6 lfI8djbLumM6XxaJOg0PtU0iLENBEAFECL6gzG3bjgLzNCJEmbmBC6rV8Fpwcu/c0H3N IeI3nVFaCGfqxeKvDGcSW/UqGnodl8ghZjE2Zbi4b2o3YVoe94ist6LNPpiZsn8TS0Aw 31moKjDb0NW6wnsIWN4kS8Gzzh5etJkd8NojVJo2xfTKjzfsw90XjRG/aHONN16wmhBQ sFCAy54jhGkHIZpQ9SKOtZYMwvFCdK6GEAfHEz9RJHo6C/4lO2kGEebfRWVMpi1+hzSM VbgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8T0ZIYzPcMUnYOs78qYwoFdRajm6401qH8h6cT1PMfw=; b=g3ua1wfWgE3Fqgu8FSkn8h4olJgmUeOLaY8XQ/ya7+gMF+TfkS+b9OFnmggBhiZIw5 SunXLDId3uYxgbzjem7bh0fINgTwQnuWHcX0fVF/gRMT5Phb3eXZZTy6xv0hrvf8vCQZ Vxr0RLqmsSTQmQqJHkltGGLVQVk1pOeHF6SRcTkg1GZjhrbdp9/W0yHuhGvsOl14T9kX SGfG0cHRtxme1zLHS17vJTJmtuEI0UQFbUl1buvvGL3yF0RNFKU9QaFbT6UqHCk3WRv5 egfmqPHa400US/ny/ha55iDRXEhQeO2nEb95+U/xbh8bEwcHCMCkW5Lww2AwsGATMLiD jPPQ== X-Gm-Message-State: APjAAAV1bdkLD0Xl4dntwanGVSiQxpwG6yoAyB0WsluX7bO03fA1YZ1C e39E053k2BQV/deQfUUhLM+zP1K9AVI= X-Google-Smtp-Source: APXvYqyvW27z7ceK5XuM2TDZybTrmMKr5XcklNfkpAHxx98t0F5oHo3utur6uA/m/bUKdg4xwDRgyg== X-Received: by 2002:a17:902:bd92:: with SMTP id q18mr64517473pls.136.1556563836114; Mon, 29 Apr 2019 11:50:36 -0700 (PDT) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id i15sm46232564pfd.162.2019.04.29.11.50.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Apr 2019 11:50:35 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: svn commit: r346904 - head From: Enji Cooper In-Reply-To: <201904291848.x3TImhRl050923@repo.freebsd.org> Date: Mon, 29 Apr 2019 11:50:34 -0700 Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <0844616A-920B-4E53-A71D-8FFAE6455B3E@gmail.com> References: <201904291848.x3TImhRl050923@repo.freebsd.org> To: Enji Cooper X-Mailer: Apple Mail (2.3445.104.8) X-Rspamd-Queue-Id: 89C416A703 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 18:50:38 -0000 > On Apr 29, 2019, at 11:48 AM, Enji Cooper wrote: >=20 > Author: ngie > Date: Mon Apr 29 18:48:43 2019 > New Revision: 346904 > URL: https://svnweb.freebsd.org/changeset/base/346904 >=20 > Log: > Update/reformat maintainer entries that I am a part of >=20 > * Replace all instances of freebsd-testing with `#test`. `#test` is = the > Phabricator group that focuses on test-related reviews. > * Replace `atf` with contrib/atf, as that's the actual location for = the test > framework. > * Remove jmmv@ from the maintainers list for atf. He is the upstream = project > owner, but was moved to alumni status after r345787. > * Fix a typo accidentally introduced in r346899 (inpact -> impact). I failed to mention: * Add pre-commit maintainer entries for contrib/capsicum-test and = contrib/googletest . Cheers, -Enji= From owner-svn-src-all@freebsd.org Mon Apr 29 18:52:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5404B1599502; Mon, 29 Apr 2019 18:52:05 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE94C6AA9C; Mon, 29 Apr 2019 18:52:04 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD1502627D; Mon, 29 Apr 2019 18:52:04 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TIq4RP053402; Mon, 29 Apr 2019 18:52:04 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TIq4EG053401; Mon, 29 Apr 2019 18:52:04 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201904291852.x3TIq4EG053401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 29 Apr 2019 18:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346905 - stable/11/sys/contrib/libnv X-SVN-Group: stable-11 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/11/sys/contrib/libnv X-SVN-Commit-Revision: 346905 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EE94C6AA9C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 18:52:05 -0000 Author: oshogbo Date: Mon Apr 29 18:52:04 2019 New Revision: 346905 URL: https://svnweb.freebsd.org/changeset/base/346905 Log: MFC r346112: libnv: fix compilation warnings When building libnv without a debug those arguments are no longer used because assertions will be changed to NOP. Submitted by: Mindaugas Rasiukevicius MFC r346115: The nvlist_report_missing is also used by the cnvlist. It can't be a static one. Reported by: jenkins Modified: stable/11/sys/contrib/libnv/nvlist.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/contrib/libnv/nvlist.c ============================================================================== --- stable/11/sys/contrib/libnv/nvlist.c Mon Apr 29 18:48:43 2019 (r346904) +++ stable/11/sys/contrib/libnv/nvlist.c Mon Apr 29 18:52:04 2019 (r346905) @@ -1364,7 +1364,7 @@ nvlist_first_nvpair(const nvlist_t *nvl) } nvpair_t * -nvlist_next_nvpair(const nvlist_t *nvl, const nvpair_t *nvp) +nvlist_next_nvpair(const nvlist_t *nvl __unused, const nvpair_t *nvp) { nvpair_t *retnvp; @@ -1380,7 +1380,7 @@ nvlist_next_nvpair(const nvlist_t *nvl, const nvpair_t } nvpair_t * -nvlist_prev_nvpair(const nvlist_t *nvl, const nvpair_t *nvp) +nvlist_prev_nvpair(const nvlist_t *nvl __unused, const nvpair_t *nvp) { nvpair_t *retnvp; From owner-svn-src-all@freebsd.org Mon Apr 29 18:54:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F017159962F; Mon, 29 Apr 2019 18:54:40 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAE966ACF7; Mon, 29 Apr 2019 18:54:39 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFA0C2629C; Mon, 29 Apr 2019 18:54:39 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TIsdx5056021; Mon, 29 Apr 2019 18:54:39 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TIsdcP056020; Mon, 29 Apr 2019 18:54:39 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201904291854.x3TIsdcP056020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 29 Apr 2019 18:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346906 - stable/12/sys/contrib/libnv X-SVN-Group: stable-12 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/12/sys/contrib/libnv X-SVN-Commit-Revision: 346906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DAE966ACF7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 18:54:40 -0000 Author: oshogbo Date: Mon Apr 29 18:54:39 2019 New Revision: 346906 URL: https://svnweb.freebsd.org/changeset/base/346906 Log: MFC r346112: libnv: fix compilation warnings When building libnv without a debug those arguments are no longer used because assertions will be changed to NOP. Submitted by: Mindaugas Rasiukevicius MFC r346115: The nvlist_report_missing is also used by the cnvlist. It can't be a static one. Reported by: jenkins Modified: stable/12/sys/contrib/libnv/nvlist.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/contrib/libnv/nvlist.c ============================================================================== --- stable/12/sys/contrib/libnv/nvlist.c Mon Apr 29 18:52:04 2019 (r346905) +++ stable/12/sys/contrib/libnv/nvlist.c Mon Apr 29 18:54:39 2019 (r346906) @@ -1365,7 +1365,7 @@ nvlist_first_nvpair(const nvlist_t *nvl) } nvpair_t * -nvlist_next_nvpair(const nvlist_t *nvl, const nvpair_t *nvp) +nvlist_next_nvpair(const nvlist_t *nvl __unused, const nvpair_t *nvp) { nvpair_t *retnvp; @@ -1381,7 +1381,7 @@ nvlist_next_nvpair(const nvlist_t *nvl, const nvpair_t } nvpair_t * -nvlist_prev_nvpair(const nvlist_t *nvl, const nvpair_t *nvp) +nvlist_prev_nvpair(const nvlist_t *nvl __unused, const nvpair_t *nvp) { nvpair_t *retnvp; From owner-svn-src-all@freebsd.org Mon Apr 29 18:55:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92AC9159970D; Mon, 29 Apr 2019 18:55:50 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 361D56AE67; Mon, 29 Apr 2019 18:55:50 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 100CF2629E; Mon, 29 Apr 2019 18:55:50 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TItnTm056149; Mon, 29 Apr 2019 18:55:49 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TItnAY056148; Mon, 29 Apr 2019 18:55:49 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201904291855.x3TItnAY056148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 29 Apr 2019 18:55:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346907 - stable/11/sys/contrib/libnv X-SVN-Group: stable-11 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/11/sys/contrib/libnv X-SVN-Commit-Revision: 346907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 361D56AE67 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 18:55:50 -0000 Author: oshogbo Date: Mon Apr 29 18:55:49 2019 New Revision: 346907 URL: https://svnweb.freebsd.org/changeset/base/346907 Log: MFC r346113: libnv: fix compilation warnings When building libnv without a debug those arguments are no longer used because assertions will be changed to NOP. Submitted by: Mindaugas Rasiukevicius Modified: stable/11/sys/contrib/libnv/nvpair.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/contrib/libnv/nvpair.c ============================================================================== --- stable/11/sys/contrib/libnv/nvpair.c Mon Apr 29 18:54:39 2019 (r346906) +++ stable/11/sys/contrib/libnv/nvpair.c Mon Apr 29 18:55:49 2019 (r346907) @@ -106,7 +106,7 @@ struct nvpair_header { void -nvpair_assert(const nvpair_t *nvp) +nvpair_assert(const nvpair_t *nvp __unused) { NVPAIR_ASSERT(nvp); @@ -233,7 +233,8 @@ nvpair_remove_nvlist_array(nvpair_t *nvp) } void -nvpair_remove(struct nvl_head *head, nvpair_t *nvp, const nvlist_t *nvl) +nvpair_remove(struct nvl_head *head, nvpair_t *nvp, + const nvlist_t *nvl __unused) { NVPAIR_ASSERT(nvp); @@ -357,7 +358,7 @@ nvpair_pack_header(const nvpair_t *nvp, unsigned char } unsigned char * -nvpair_pack_null(const nvpair_t *nvp, unsigned char *ptr, +nvpair_pack_null(const nvpair_t *nvp __unused, unsigned char *ptr, size_t *leftp __unused) { From owner-svn-src-all@freebsd.org Mon Apr 29 18:56:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0807B1599785; Mon, 29 Apr 2019 18:56:40 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A449D6AFB1; Mon, 29 Apr 2019 18:56:39 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E7952629F; Mon, 29 Apr 2019 18:56:39 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TIudDA056232; Mon, 29 Apr 2019 18:56:39 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TIudSp056231; Mon, 29 Apr 2019 18:56:39 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201904291856.x3TIudSp056231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 29 Apr 2019 18:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346908 - stable/12/sys/contrib/libnv X-SVN-Group: stable-12 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/12/sys/contrib/libnv X-SVN-Commit-Revision: 346908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A449D6AFB1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 18:56:40 -0000 Author: oshogbo Date: Mon Apr 29 18:56:39 2019 New Revision: 346908 URL: https://svnweb.freebsd.org/changeset/base/346908 Log: MFC r346113: libnv: fix compilation warnings When building libnv without a debug those arguments are no longer used because assertions will be changed to NOP. Submitted by: Mindaugas Rasiukevicius Modified: stable/12/sys/contrib/libnv/nvpair.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/contrib/libnv/nvpair.c ============================================================================== --- stable/12/sys/contrib/libnv/nvpair.c Mon Apr 29 18:55:49 2019 (r346907) +++ stable/12/sys/contrib/libnv/nvpair.c Mon Apr 29 18:56:39 2019 (r346908) @@ -108,7 +108,7 @@ struct nvpair_header { void -nvpair_assert(const nvpair_t *nvp) +nvpair_assert(const nvpair_t *nvp __unused) { NVPAIR_ASSERT(nvp); @@ -235,7 +235,8 @@ nvpair_remove_nvlist_array(nvpair_t *nvp) } void -nvpair_remove(struct nvl_head *head, nvpair_t *nvp, const nvlist_t *nvl) +nvpair_remove(struct nvl_head *head, nvpair_t *nvp, + const nvlist_t *nvl __unused) { NVPAIR_ASSERT(nvp); @@ -359,7 +360,7 @@ nvpair_pack_header(const nvpair_t *nvp, unsigned char } unsigned char * -nvpair_pack_null(const nvpair_t *nvp, unsigned char *ptr, +nvpair_pack_null(const nvpair_t *nvp __unused, unsigned char *ptr, size_t *leftp __unused) { From owner-svn-src-all@freebsd.org Mon Apr 29 19:09:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C13FD1599E94; Mon, 29 Apr 2019 19:09:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6795C6BBA2; Mon, 29 Apr 2019 19:09:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CA5B2646C; Mon, 29 Apr 2019 19:09:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TJ9jjA061961; Mon, 29 Apr 2019 19:09:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TJ9jk6061960; Mon, 29 Apr 2019 19:09:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904291909.x3TJ9jk6061960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 29 Apr 2019 19:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346909 - stable/12/tests/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/12/tests/sys/kern X-SVN-Commit-Revision: 346909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6795C6BBA2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 19:09:45 -0000 Author: ngie Date: Mon Apr 29 19:09:44 2019 New Revision: 346909 URL: https://svnweb.freebsd.org/changeset/base/346909 Log: MFC r346542: Fix sys.kern.coredump_phnum_test.coredump_phnum on i386 The zero-padding when printing out the Size field is on 32-bit architectures is 5, not 15. Adjust the regular expression to work with both the 32-bit and 64-bit case. Modified: stable/12/tests/sys/kern/coredump_phnum_test.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/kern/coredump_phnum_test.sh ============================================================================== --- stable/12/tests/sys/kern/coredump_phnum_test.sh Mon Apr 29 18:56:39 2019 (r346908) +++ stable/12/tests/sys/kern/coredump_phnum_test.sh Mon Apr 29 19:09:44 2019 (r346909) @@ -65,7 +65,7 @@ EOF -x 'readelf -h coredump_phnum_helper.core | grep "Number of program headers:"' atf_check -o "match:There are 66[0-9]{3} program headers" \ -x 'readelf -l coredump_phnum_helper.core | grep -1 "program headers"' - atf_check -o "match: 0000000000000001 .* 66[0-9]{3} " \ + atf_check -o "match: 00000(0000000000)?1 .* 66[0-9]{3} " \ -x 'readelf -S coredump_phnum_helper.core | grep -A1 "^ \[ 0\] "' atf_check -o "match:66[0-9]{3}" \ From owner-svn-src-all@freebsd.org Mon Apr 29 19:10:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C059B1599EE6; Mon, 29 Apr 2019 19:10:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6225B6BCC7; Mon, 29 Apr 2019 19:10:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35BA226470; Mon, 29 Apr 2019 19:10:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TJAPfX062094; Mon, 29 Apr 2019 19:10:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TJAOCX062092; Mon, 29 Apr 2019 19:10:24 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201904291910.x3TJAOCX062092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 29 Apr 2019 19:10:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346910 - in stable/12: libexec/rc/rc.d usr.sbin/nfsd X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12: libexec/rc/rc.d usr.sbin/nfsd X-SVN-Commit-Revision: 346910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6225B6BCC7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 19:10:26 -0000 Author: mav Date: Mon Apr 29 19:10:24 2019 New Revision: 346910 URL: https://svnweb.freebsd.org/changeset/base/346910 Log: MFC r344192 (by sef): Add support for a virtual hostname to nfsd Specifically, this allows (via "-V vhostname") telling nfsd what principal to use, instead of the hostname. This is used at iXsystems for fail-over in HA systems. Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D19191 Modified: stable/12/libexec/rc/rc.d/nfsd stable/12/usr.sbin/nfsd/nfsd.8 stable/12/usr.sbin/nfsd/nfsd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.d/nfsd ============================================================================== --- stable/12/libexec/rc/rc.d/nfsd Mon Apr 29 19:09:44 2019 (r346909) +++ stable/12/libexec/rc/rc.d/nfsd Mon Apr 29 19:10:24 2019 (r346910) @@ -13,6 +13,7 @@ name="nfsd" desc="Remote NFS server" rcvar="nfs_server_enable" command="/usr/sbin/${name}" +nfs_server_vhost="" load_rc_config $name start_precmd="nfsd_precmd" @@ -20,6 +21,7 @@ sig_stop="USR1" nfsd_precmd() { + local _vhost rc_flags="${nfs_server_flags}" # Load the modules now, so that the vfs.nfsd sysctl @@ -46,6 +48,9 @@ nfsd_precmd() force_depend rpcbind || return 1 force_depend mountd || return 1 + if [ -n "${nfs_server_vhost}" ]; then + command_args="-V \"${nfs_server_vhost}\"" + fi } run_rc_command "$1" Modified: stable/12/usr.sbin/nfsd/nfsd.8 ============================================================================== --- stable/12/usr.sbin/nfsd/nfsd.8 Mon Apr 29 19:09:44 2019 (r346909) +++ stable/12/usr.sbin/nfsd/nfsd.8 Mon Apr 29 19:10:24 2019 (r346910) @@ -28,7 +28,7 @@ .\" @(#)nfsd.8 8.4 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd August 5, 2018 +.Dd February 14, 2019 .Dt NFSD 8 .Os .Sh NAME @@ -43,6 +43,7 @@ server .Op Fl h Ar bindip .Op Fl p Ar pnfs_setup .Op Fl m Ar mirror_level +.Op Fl V Ar virtual_hostname .Op Fl Fl maxthreads Ar max_threads .Op Fl Fl minthreads Ar min_threads .Sh DESCRIPTION @@ -78,6 +79,9 @@ Unregister the service with .Xr rpcbind 8 without creating any servers. +.It Fl V Ar virtual_hostname +Specifies a hostname to be used as a principal name, instead of +the default hostname. .It Fl n Ar threads Specifies how many servers to create. This option is equivalent to specifying .Fl Fl maxthreads Modified: stable/12/usr.sbin/nfsd/nfsd.c ============================================================================== --- stable/12/usr.sbin/nfsd/nfsd.c Mon Apr 29 19:09:44 2019 (r346909) +++ stable/12/usr.sbin/nfsd/nfsd.c Mon Apr 29 19:10:24 2019 (r346910) @@ -122,7 +122,7 @@ static void nonfs(int); static void reapchild(int); static int setbindhost(struct addrinfo **ia, const char *bindhost, struct addrinfo hints); -static void start_server(int, struct nfsd_nfsd_args *); +static void start_server(int, struct nfsd_nfsd_args *, const char *vhost); static void unregistration(void); static void usage(void); static void open_stable(int *, int *); @@ -176,6 +176,7 @@ main(int argc, char **argv) char **bindhost = NULL; pid_t pid; struct nfsd_nfsd_args nfsdargs; + const char *vhostname = NULL; nfsdargs.mirrorcnt = 1; nfsdargs.addr = NULL; @@ -183,16 +184,24 @@ main(int argc, char **argv) nfsdcnt = DEFNFSDCNT; unregister = reregister = tcpflag = maxsock = 0; bindanyflag = udpflag = connect_type_cnt = bindhostc = 0; - getopt_shortopts = "ah:n:rdtuep:m:"; + getopt_shortopts = "ah:n:rdtuep:m:V:"; getopt_usage = "usage:\n" " nfsd [-ardtue] [-h bindip]\n" " [-n numservers] [--minthreads #] [--maxthreads #]\n" - " [-p/--pnfs dsserver0:/dsserver0-mounted-on-dir,...," - "dsserverN:/dsserverN-mounted-on-dir] [-m mirrorlevel]\n"; + " [-p/--pnfs dsserver0:/dsserver0-mounted-on-dir,...,\n" + " [-V virtual_hostname]\n" + " dsserverN:/dsserverN-mounted-on-dir] [-m mirrorlevel]\n"; while ((ch = getopt_long(argc, argv, getopt_shortopts, longopts, &longindex)) != -1) switch (ch) { + case 'V': + if (strlen(optarg) <= MAXHOSTNAMELEN) + vhostname = optarg; + else + warnx("Virtual host name (%s) is too long", + optarg); + break; case 'a': bindanyflag = 1; break; @@ -473,7 +482,7 @@ main(int argc, char **argv) } else { (void)signal(SIGUSR1, child_cleanup); setproctitle("server"); - start_server(0, &nfsdargs); + start_server(0, &nfsdargs, vhostname); } } @@ -790,7 +799,7 @@ main(int argc, char **argv) * a "server" too. start_server will not return. */ if (!tcpflag) - start_server(1, &nfsdargs); + start_server(1, &nfsdargs, vhostname); /* * Loop forever accepting connections and passing the sockets @@ -987,7 +996,7 @@ get_tuned_nfsdcount(void) } static void -start_server(int master, struct nfsd_nfsd_args *nfsdargp) +start_server(int master, struct nfsd_nfsd_args *nfsdargp, const char *vhost) { char principal[MAXHOSTNAMELEN + 5]; int status, error; @@ -995,7 +1004,10 @@ start_server(int master, struct nfsd_nfsd_args *nfsdar struct addrinfo *aip, hints; status = 0; - gethostname(hostname, sizeof (hostname)); + if (vhost == NULL) + gethostname(hostname, sizeof (hostname)); + else + strlcpy(hostname, vhost, sizeof (hostname)); snprintf(principal, sizeof (principal), "nfs@%s", hostname); if ((cp = strchr(hostname, '.')) == NULL || *(cp + 1) == '\0') { From owner-svn-src-all@freebsd.org Mon Apr 29 19:11:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C20F159A0B0; Mon, 29 Apr 2019 19:11:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5E406C02D; Mon, 29 Apr 2019 19:11:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE942265DA; Mon, 29 Apr 2019 19:11:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TJBudq062289; Mon, 29 Apr 2019 19:11:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TJBuYV062288; Mon, 29 Apr 2019 19:11:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904291911.x3TJBuYV062288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 29 Apr 2019 19:11:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346911 - stable/11/lib/libc/tests/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/lib/libc/tests/sys X-SVN-Commit-Revision: 346911 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E5E406C02D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 19:11:57 -0000 Author: ngie Date: Mon Apr 29 19:11:56 2019 New Revision: 346911 URL: https://svnweb.freebsd.org/changeset/base/346911 Log: MFC r346539: Fix `get_int_via_sysctlbyname(..)` on Jenkins Initialize `oldlen` to the size of the value, instead of leaving the value unitialized. Leaving it unitialized seems to work by accident on amd64 when running 64-bit programs, but not on i386. This matches patterns in use in other programs. PR: 237458 Tested on: ^/head (amd64), ^/stable/11 (i386) Modified: stable/11/lib/libc/tests/sys/sendfile_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/tests/sys/sendfile_test.c ============================================================================== --- stable/11/lib/libc/tests/sys/sendfile_test.c Mon Apr 29 19:10:24 2019 (r346910) +++ stable/11/lib/libc/tests/sys/sendfile_test.c Mon Apr 29 19:11:56 2019 (r346911) @@ -62,6 +62,8 @@ get_int_via_sysctlbyname(const char *oidname) size_t oldlen; int int_value; + oldlen = sizeof(int_value); + ATF_REQUIRE_EQ_MSG(sysctlbyname(oidname, &int_value, &oldlen, NULL, 0), 0, "sysctlbyname(%s, ...) failed: %s", oidname, strerror(errno)); ATF_REQUIRE_EQ_MSG(sizeof(int_value), oldlen, "sanity check failed"); From owner-svn-src-all@freebsd.org Mon Apr 29 19:12:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA061159A132; Mon, 29 Apr 2019 19:12:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 810EB6C20F; Mon, 29 Apr 2019 19:12:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BDC026626; Mon, 29 Apr 2019 19:12:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TJCmOa067124; Mon, 29 Apr 2019 19:12:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TJCmUw067123; Mon, 29 Apr 2019 19:12:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904291912.x3TJCmUw067123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 29 Apr 2019 19:12:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346912 - stable/12/lib/libc/tests/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/12/lib/libc/tests/sys X-SVN-Commit-Revision: 346912 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 810EB6C20F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 19:12:49 -0000 Author: ngie Date: Mon Apr 29 19:12:47 2019 New Revision: 346912 URL: https://svnweb.freebsd.org/changeset/base/346912 Log: MFC r346539: Fix `get_int_via_sysctlbyname(..)` on Jenkins Initialize `oldlen` to the size of the value, instead of leaving the value unitialized. Leaving it unitialized seems to work by accident on amd64 when running 64-bit programs, but not on i386. This matches patterns in use in other programs. PR: 237458 Tested on: ^/head (amd64), ^/stable/11 (i386) Modified: stable/12/lib/libc/tests/sys/sendfile_test.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/tests/sys/sendfile_test.c ============================================================================== --- stable/12/lib/libc/tests/sys/sendfile_test.c Mon Apr 29 19:11:56 2019 (r346911) +++ stable/12/lib/libc/tests/sys/sendfile_test.c Mon Apr 29 19:12:47 2019 (r346912) @@ -62,6 +62,8 @@ get_int_via_sysctlbyname(const char *oidname) size_t oldlen; int int_value; + oldlen = sizeof(int_value); + ATF_REQUIRE_EQ_MSG(sysctlbyname(oidname, &int_value, &oldlen, NULL, 0), 0, "sysctlbyname(%s, ...) failed: %s", oidname, strerror(errno)); ATF_REQUIRE_EQ_MSG(sizeof(int_value), oldlen, "sanity check failed"); From owner-svn-src-all@freebsd.org Mon Apr 29 19:15:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACA5B159A221; Mon, 29 Apr 2019 19:15:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F0636C3CE; Mon, 29 Apr 2019 19:15:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2411226628; Mon, 29 Apr 2019 19:15:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TJFo2b067388; Mon, 29 Apr 2019 19:15:50 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TJFoj8067387; Mon, 29 Apr 2019 19:15:50 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904291915.x3TJFoj8067387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 19:15:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346913 - stable/11/sys/dev/cxgbe/tom X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 346913 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4F0636C3CE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 19:15:51 -0000 Author: np Date: Mon Apr 29 19:15:50 2019 New Revision: 346913 URL: https://svnweb.freebsd.org/changeset/base/346913 Log: MFC r338355: cxgbe/tom: Unregister shared CPL handlers on module unload. This fixes a panic with INVARIANTS that occurs when t4_tom is unloaded and reloaded. Modified: stable/11/sys/dev/cxgbe/tom/t4_ddp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_ddp.c Mon Apr 29 19:12:47 2019 (r346912) +++ stable/11/sys/dev/cxgbe/tom/t4_ddp.c Mon Apr 29 19:15:50 2019 (r346913) @@ -1975,6 +1975,8 @@ t4_ddp_mod_unload(void) taskqueue_drain(taskqueue_thread, &ddp_orphan_task); MPASS(TAILQ_EMPTY(&ddp_orphan_pagesets)); mtx_destroy(&ddp_orphan_pagesets_lock); + t4_register_shared_cpl_handler(CPL_SET_TCB_RPL, NULL, CPL_COOKIE_DDP0); + t4_register_shared_cpl_handler(CPL_SET_TCB_RPL, NULL, CPL_COOKIE_DDP1); t4_register_cpl_handler(CPL_RX_DATA_DDP, NULL); t4_register_cpl_handler(CPL_RX_DDP_COMPLETE, NULL); } From owner-svn-src-all@freebsd.org Mon Apr 29 19:16:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CE4D159A295; Mon, 29 Apr 2019 19:16:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FEE16C533; Mon, 29 Apr 2019 19:16:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A99A26629; Mon, 29 Apr 2019 19:16:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TJGT8x067494; Mon, 29 Apr 2019 19:16:29 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TJGTTf067493; Mon, 29 Apr 2019 19:16:29 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904291916.x3TJGTTf067493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 19:16:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346914 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346914 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2FEE16C533 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 19:16:30 -0000 Author: np Date: Mon Apr 29 19:16:29 2019 New Revision: 346914 URL: https://svnweb.freebsd.org/changeset/base/346914 Log: MFC r338669: cxgbe(4): Use the correct number of parameters when querying the tid range for hashfilters. Modified: stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 19:15:50 2019 (r346913) +++ stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 19:16:29 2019 (r346914) @@ -4026,7 +4026,7 @@ get_params__post_init(struct adapter *sc) sc->toecaps = 0; param[0] = FW_PARAM_DEV(NTID); - rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 6, param, val); + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 1, param, val); if (rc != 0) { device_printf(sc->dev, "failed to query HASHFILTER parameters: %d.\n", rc); From owner-svn-src-all@freebsd.org Mon Apr 29 19:23:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02781159A693; Mon, 29 Apr 2019 19:23:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EDA26D2DD; Mon, 29 Apr 2019 19:23:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D069267E2; Mon, 29 Apr 2019 19:23:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TJNSdF072429; Mon, 29 Apr 2019 19:23:28 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TJNRsM072424; Mon, 29 Apr 2019 19:23:27 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904291923.x3TJNRsM072424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 19:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346915 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346915 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8EDA26D2DD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 19:23:31 -0000 Author: np Date: Mon Apr 29 19:23:27 2019 New Revision: 346915 URL: https://svnweb.freebsd.org/changeset/base/346915 Log: MFC r338874: cxgbe(4): Reuse existing "switching" L2T entries when possible. Modified: stable/11/sys/dev/cxgbe/t4_filter.c stable/11/sys/dev/cxgbe/t4_l2t.c stable/11/sys/dev/cxgbe/t4_l2t.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_filter.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_filter.c Mon Apr 29 19:16:29 2019 (r346914) +++ stable/11/sys/dev/cxgbe/t4_filter.c Mon Apr 29 19:23:27 2019 (r346915) @@ -593,13 +593,8 @@ set_tcamfilter(struct adapter *sc, struct t4_filter *t } } mtx_unlock(&sc->tids.ftid_lock); - if (rc != 0) { - if (l2te) - t4_l2t_release(l2te); - if (smt) - t4_smt_release(smt); + if (rc != 0) return (rc); - } /* * Can't fail now. A set-filter WR will definitely be sent. @@ -817,8 +812,8 @@ int set_filter(struct adapter *sc, struct t4_filter *t) { struct tid_info *ti = &sc->tids; - struct l2t_entry *l2te; - struct smt_entry *smt; + struct l2t_entry *l2te = NULL; + struct smt_entry *smt = NULL; uint64_t ftuple; int rc; @@ -942,43 +937,41 @@ done: * Allocate L2T entry, SMT entry, etc. */ - l2te = NULL; if (t->fs.newdmac || t->fs.newvlan) { /* This filter needs an L2T entry; allocate one. */ - l2te = t4_l2t_alloc_switching(sc->l2t); - if (__predict_false(l2te == NULL)) - return (EAGAIN); - rc = t4_l2t_set_switching(sc, l2te, t->fs.vlan, t->fs.eport, + l2te = t4_l2t_alloc_switching(sc, t->fs.vlan, t->fs.eport, t->fs.dmac); - if (rc) { - t4_l2t_release(l2te); - return (ENOMEM); + if (__predict_false(l2te == NULL)) { + rc = EAGAIN; + goto error; } } - smt = NULL; if (t->fs.newsmac) { /* This filter needs an SMT entry; allocate one. */ smt = t4_smt_alloc_switching(sc->smt, t->fs.smac); if (__predict_false(smt == NULL)) { - if (l2te != NULL) - t4_l2t_release(l2te); - return (EAGAIN); + rc = EAGAIN; + goto error; } rc = t4_smt_set_switching(sc, smt, 0x0, t->fs.smac); - if (rc) { - t4_smt_release(smt); - if (l2te != NULL) - t4_l2t_release(l2te); - return (rc); - } + if (rc) + goto error; } if (t->fs.hash) - return (set_hashfilter(sc, t, ftuple, l2te, smt)); + rc = set_hashfilter(sc, t, ftuple, l2te, smt); else - return (set_tcamfilter(sc, t, l2te, smt)); + rc = set_tcamfilter(sc, t, l2te, smt); + if (rc != 0 && rc != EINPROGRESS) { +error: + if (l2te) + t4_l2t_release(l2te); + if (smt) + t4_smt_release(smt); + } + return (rc); } static int @@ -1552,10 +1545,6 @@ set_hashfilter(struct adapter *sc, struct t4_filter *t f = malloc(sizeof(*f), M_CXGBE, M_ZERO | M_NOWAIT); if (__predict_false(f == NULL)) { - if (l2te) - t4_l2t_release(l2te); - if (smt) - t4_smt_release(smt); rc = ENOMEM; goto done; } @@ -1565,10 +1554,6 @@ set_hashfilter(struct adapter *sc, struct t4_filter *t atid = alloc_atid(sc, f); if (__predict_false(atid) == -1) { - if (l2te) - t4_l2t_release(l2te); - if (smt) - t4_smt_release(smt); free(f, M_CXGBE); rc = EAGAIN; goto done; @@ -1579,10 +1564,6 @@ set_hashfilter(struct adapter *sc, struct t4_filter *t &cookie); if (wr == NULL) { free_atid(sc, atid); - if (l2te) - t4_l2t_release(l2te); - if (smt) - t4_smt_release(smt); free(f, M_CXGBE); rc = ENOMEM; goto done; Modified: stable/11/sys/dev/cxgbe/t4_l2t.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_l2t.c Mon Apr 29 19:16:29 2019 (r346914) +++ stable/11/sys/dev/cxgbe/t4_l2t.c Mon Apr 29 19:23:27 2019 (r346915) @@ -106,6 +106,44 @@ found: return (e); } +static struct l2t_entry * +find_or_alloc_l2e(struct l2t_data *d, uint16_t vlan, uint8_t port, uint8_t *dmac) +{ + struct l2t_entry *end, *e, **p; + struct l2t_entry *first_free = NULL; + + for (e = &d->l2tab[0], end = &d->l2tab[d->l2t_size]; e != end; ++e) { + if (atomic_load_acq_int(&e->refcnt) == 0) { + if (!first_free) + first_free = e; + } else if (e->state == L2T_STATE_SWITCHING && + memcmp(e->dmac, dmac, ETHER_ADDR_LEN) == 0 && + e->vlan == vlan && e->lport == port) + return (e); /* Found existing entry that matches. */ + } + + if (first_free == NULL) + return (NULL); /* No match and no room for a new entry. */ + + /* + * The entry we found may be an inactive entry that is + * presently in the hash table. We need to remove it. + */ + e = first_free; + if (e->state < L2T_STATE_SWITCHING) { + for (p = &d->l2tab[e->hash].first; *p; p = &(*p)->next) { + if (*p == e) { + *p = e->next; + e->next = NULL; + break; + } + } + } + e->state = L2T_STATE_UNUSED; + return (e); +} + + /* * Write an L2T entry. Must be called with the entry locked. * The write may be synchronous or asynchronous. @@ -152,41 +190,38 @@ t4_write_l2e(struct l2t_entry *e, int sync) * address resolution updates do not see them. */ struct l2t_entry * -t4_l2t_alloc_switching(struct l2t_data *d) +t4_l2t_alloc_switching(struct adapter *sc, uint16_t vlan, uint8_t port, + uint8_t *eth_addr) { + struct l2t_data *d = sc->l2t; struct l2t_entry *e; + int rc; rw_wlock(&d->lock); - e = t4_alloc_l2e(d); + e = find_or_alloc_l2e(d, vlan, port, eth_addr); if (e) { - mtx_lock(&e->lock); /* avoid race with t4_l2t_free */ - e->state = L2T_STATE_SWITCHING; - atomic_store_rel_int(&e->refcnt, 1); - mtx_unlock(&e->lock); + if (atomic_load_acq_int(&e->refcnt) == 0) { + mtx_lock(&e->lock); /* avoid race with t4_l2t_free */ + e->wrq = &sc->sge.ctrlq[0]; + e->iqid = sc->sge.fwq.abs_id; + e->state = L2T_STATE_SWITCHING; + e->vlan = vlan; + e->lport = port; + memcpy(e->dmac, eth_addr, ETHER_ADDR_LEN); + atomic_store_rel_int(&e->refcnt, 1); + atomic_subtract_int(&d->nfree, 1); + rc = t4_write_l2e(e, 0); + mtx_unlock(&e->lock); + if (rc != 0) + e = NULL; + } else { + MPASS(e->vlan == vlan); + MPASS(e->lport == port); + atomic_add_int(&e->refcnt, 1); + } } rw_wunlock(&d->lock); - return e; -} - -/* - * Sets/updates the contents of a switching L2T entry that has been allocated - * with an earlier call to @t4_l2t_alloc_switching. - */ -int -t4_l2t_set_switching(struct adapter *sc, struct l2t_entry *e, uint16_t vlan, - uint8_t port, uint8_t *eth_addr) -{ - int rc; - - e->vlan = vlan; - e->lport = port; - e->wrq = &sc->sge.ctrlq[0]; - e->iqid = sc->sge.fwq.abs_id; - memcpy(e->dmac, eth_addr, ETHER_ADDR_LEN); - mtx_lock(&e->lock); - rc = t4_write_l2e(e, 0); - mtx_unlock(&e->lock); - return (rc); + return (e); } int Modified: stable/11/sys/dev/cxgbe/t4_l2t.h ============================================================================== --- stable/11/sys/dev/cxgbe/t4_l2t.h Mon Apr 29 19:16:29 2019 (r346914) +++ stable/11/sys/dev/cxgbe/t4_l2t.h Mon Apr 29 19:23:27 2019 (r346915) @@ -89,7 +89,8 @@ struct l2t_data { int t4_init_l2t(struct adapter *, int); int t4_free_l2t(struct l2t_data *); struct l2t_entry *t4_alloc_l2e(struct l2t_data *); -struct l2t_entry *t4_l2t_alloc_switching(struct l2t_data *); +struct l2t_entry *t4_l2t_alloc_switching(struct adapter *, uint16_t, uint8_t, + uint8_t *); int t4_l2t_set_switching(struct adapter *, struct l2t_entry *, uint16_t, uint8_t, uint8_t *); int t4_write_l2e(struct l2t_entry *, int); From owner-svn-src-all@freebsd.org Mon Apr 29 19:25:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24AFB159A856; Mon, 29 Apr 2019 19:25:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A57496D9AF; Mon, 29 Apr 2019 19:25:06 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80451267E3; Mon, 29 Apr 2019 19:25:06 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TJP6lX072544; Mon, 29 Apr 2019 19:25:06 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TJP6G7072543; Mon, 29 Apr 2019 19:25:06 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904291925.x3TJP6G7072543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 19:25:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346916 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346916 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A57496D9AF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 19:25:20 -0000 Author: np Date: Mon Apr 29 19:25:06 2019 New Revision: 346916 URL: https://svnweb.freebsd.org/changeset/base/346916 Log: MFC r338940: cxgbe(4): Treat base/end of firmware parameters as signed integers when figuring out whether the range is valid or not. Modified: stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 19:23:27 2019 (r346915) +++ stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 19:25:06 2019 (r346916) @@ -3917,7 +3917,7 @@ get_params__post_init(struct adapter *sc) sc->sge.iq_start = val[0]; sc->sge.eq_start = val[1]; - if (val[3] > val[2]) { + if ((int)val[3] > (int)val[2]) { sc->tids.ftid_base = val[2]; sc->tids.ftid_end = val[3]; sc->tids.nftids = val[3] - val[2] + 1; @@ -4052,7 +4052,7 @@ get_params__post_init(struct adapter *sc) "failed to query NIC parameters: %d.\n", rc); return (rc); } - if (val[1] > val[0]) { + if ((int)val[1] > (int)val[0]) { sc->tids.etid_base = val[0]; sc->tids.etid_end = val[1]; sc->tids.netids = val[1] - val[0] + 1; @@ -4082,7 +4082,7 @@ get_params__post_init(struct adapter *sc) sc->tids.ntids -= sc->tids.nhpftids; } sc->tids.natids = min(sc->tids.ntids / 2, MAX_ATIDS); - if (val[2] > val[1]) { + if ((int)val[2] > (int)val[1]) { sc->tids.stid_base = val[1]; sc->tids.nstids = val[2] - val[1] + 1; } From owner-svn-src-all@freebsd.org Mon Apr 29 19:32:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9AEB159AC3E; Mon, 29 Apr 2019 19:32:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 790986E552; Mon, 29 Apr 2019 19:32:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6806726875; Mon, 29 Apr 2019 19:32:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TJWCPE077622; Mon, 29 Apr 2019 19:32:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TJWCn3077621; Mon, 29 Apr 2019 19:32:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904291932.x3TJWCn3077621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 29 Apr 2019 19:32:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346917 - stable/12/share/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/12/share/mk X-SVN-Commit-Revision: 346917 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 790986E552 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 19:32:13 -0000 Author: ngie Date: Mon Apr 29 19:32:11 2019 New Revision: 346917 URL: https://svnweb.freebsd.org/changeset/base/346917 Log: MFC r345723: PROG_OVERRIDE_VARS should override default values if specified The behavior prior to this change would not override default values if set in `bsd.own.mk`, or (in the more general case) globally before `bsd.progs.mk` was included. This affected `bsd.test.mk` as well, since it consumes `bsd.progs.mk`. Some examples of this failing behavior are as follows: * `BINMODE` defaults to 0555 per `bsd.own.mk`. If someone wanted to set the `BINMODE` to `NOBINMODE` (0444) for `prog`, for example, like `BINMODE.prog= ${NOBINMODE}`, `bsd.progs.mk` would not honor the per-PROG setting. * An application, `prog`, does not build at `WARNS?= 6`. Before this change, setting to a lower `WARNS` value, e.g., `WARNS.prog= 3`, would have been impossible, requiring that `prog` be built from another directory, the global `WARNS` be lowered, or a per-PROG value needing to be set across the board. None of the above workarounds is desirable. This change unbreaks variables defined in `PROG_OVERRIDE_VARS` which have defaults set before `bsd.progs.mk` is included, by setting them to their defined values if set on a per-PROG basis. Modified: stable/12/share/mk/bsd.progs.mk Directory Properties: stable/12/ (props changed) Modified: stable/12/share/mk/bsd.progs.mk ============================================================================== --- stable/12/share/mk/bsd.progs.mk Mon Apr 29 19:25:06 2019 (r346916) +++ stable/12/share/mk/bsd.progs.mk Mon Apr 29 19:32:11 2019 (r346917) @@ -34,6 +34,11 @@ $v += ${${v}.${PROG}} $v += ${${v}_${PROG}} .endif .else +.if defined(${v}.${PROG}) +$v = ${${v}.${PROG}} +.elif defined(${v}_${PROG}) +$v = ${${v}_${PROG}} +.endif $v ?= .endif .endfor From owner-svn-src-all@freebsd.org Mon Apr 29 19:34:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C16BB159AE1A; Mon, 29 Apr 2019 19:34:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E0176E937; Mon, 29 Apr 2019 19:34:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10E42269A9; Mon, 29 Apr 2019 19:34:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TJYDa0077884; Mon, 29 Apr 2019 19:34:13 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TJY9wD077859; Mon, 29 Apr 2019 19:34:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904291934.x3TJY9wD077859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 29 Apr 2019 19:34:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346918 - in stable/12: lib/libcam/tests lib/libkvm/tests lib/libsbuf/tests share/examples/tests/tests/tap share/man/man4 share/man/man5 share/zoneinfo/tests usr.bin/calendar/calendars ... X-SVN-Group: stable-12 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/12: lib/libcam/tests lib/libkvm/tests lib/libsbuf/tests share/examples/tests/tests/tap share/man/man4 share/man/man5 share/zoneinfo/tests usr.bin/calendar/calendars usr.bin/du/tests usr.bin/... X-SVN-Commit-Revision: 346918 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6E0176E937 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 19:34:15 -0000 Author: ngie Date: Mon Apr 29 19:34:09 2019 New Revision: 346918 URL: https://svnweb.freebsd.org/changeset/base/346918 Log: MFC r346571,r346572: Update the spelling of my name Previous spellings of my name (NGie, Ngie) weren't my legal spelling. Use Enji instead for clarity. While here, remove "All Rights Reserved" from copyrights I "own". Modified: stable/12/lib/libcam/tests/libcam_test.c stable/12/lib/libkvm/tests/kvm_close_test.c stable/12/lib/libkvm/tests/kvm_geterr_test.c stable/12/lib/libkvm/tests/kvm_open2_test.c stable/12/lib/libkvm/tests/kvm_open_test.c stable/12/lib/libkvm/tests/kvm_test_common.c stable/12/lib/libkvm/tests/kvm_test_common.h stable/12/lib/libsbuf/tests/sbuf_core_test.c stable/12/lib/libsbuf/tests/sbuf_stdio_test.c stable/12/lib/libsbuf/tests/sbuf_string_test.c stable/12/lib/libsbuf/tests/sbuf_test_common.h stable/12/share/examples/tests/tests/tap/cp_test.sh stable/12/share/man/man4/cfiscsi.4 stable/12/share/man/man5/cd9660.5 stable/12/share/zoneinfo/tests/backward_test.sh stable/12/share/zoneinfo/tests/zoneinfo_common.sh stable/12/usr.bin/calendar/calendars/calendar.freebsd stable/12/usr.bin/du/tests/du_test.sh stable/12/usr.bin/getconf/tests/arch_type.c stable/12/usr.bin/procstat/tests/procstat_test.sh stable/12/usr.bin/procstat/tests/while1.c stable/12/usr.sbin/sysrc/sysrc.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libcam/tests/libcam_test.c ============================================================================== --- stable/12/lib/libcam/tests/libcam_test.c Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/lib/libcam/tests/libcam_test.c Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libkvm/tests/kvm_close_test.c ============================================================================== --- stable/12/lib/libkvm/tests/kvm_close_test.c Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/lib/libkvm/tests/kvm_close_test.c Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libkvm/tests/kvm_geterr_test.c ============================================================================== --- stable/12/lib/libkvm/tests/kvm_geterr_test.c Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/lib/libkvm/tests/kvm_geterr_test.c Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libkvm/tests/kvm_open2_test.c ============================================================================== --- stable/12/lib/libkvm/tests/kvm_open2_test.c Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/lib/libkvm/tests/kvm_open2_test.c Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libkvm/tests/kvm_open_test.c ============================================================================== --- stable/12/lib/libkvm/tests/kvm_open_test.c Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/lib/libkvm/tests/kvm_open_test.c Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libkvm/tests/kvm_test_common.c ============================================================================== --- stable/12/lib/libkvm/tests/kvm_test_common.c Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/lib/libkvm/tests/kvm_test_common.c Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libkvm/tests/kvm_test_common.h ============================================================================== --- stable/12/lib/libkvm/tests/kvm_test_common.h Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/lib/libkvm/tests/kvm_test_common.h Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libsbuf/tests/sbuf_core_test.c ============================================================================== --- stable/12/lib/libsbuf/tests/sbuf_core_test.c Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/lib/libsbuf/tests/sbuf_core_test.c Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libsbuf/tests/sbuf_stdio_test.c ============================================================================== --- stable/12/lib/libsbuf/tests/sbuf_stdio_test.c Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/lib/libsbuf/tests/sbuf_stdio_test.c Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libsbuf/tests/sbuf_string_test.c ============================================================================== --- stable/12/lib/libsbuf/tests/sbuf_string_test.c Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/lib/libsbuf/tests/sbuf_string_test.c Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/lib/libsbuf/tests/sbuf_test_common.h ============================================================================== --- stable/12/lib/libsbuf/tests/sbuf_test_common.h Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/lib/libsbuf/tests/sbuf_test_common.h Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/share/examples/tests/tests/tap/cp_test.sh ============================================================================== --- stable/12/share/examples/tests/tests/tap/cp_test.sh Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/share/examples/tests/tests/tap/cp_test.sh Mon Apr 29 19:34:09 2019 (r346918) @@ -1,7 +1,6 @@ #!/bin/sh # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: stable/12/share/man/man4/cfiscsi.4 ============================================================================== --- stable/12/share/man/man4/cfiscsi.4 Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/share/man/man4/cfiscsi.4 Mon Apr 29 19:34:09 2019 (r346918) @@ -1,7 +1,6 @@ .\" Copyright (c) 2013 Edward Tomasz Napierala .\" Copyright (c) 2015-2017 Alexander Motin -.\" Copyright (c) 2017 Ngie Cooper -.\" All rights reserved. +.\" Copyright (c) 2017 Enji Cooper .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -109,4 +108,4 @@ subsystem was developed by .An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org under sponsorship from the FreeBSD Foundation. This manual page was written by -.An Ngie Cooper Aq Mt ngie@FreeBSD.org . +.An Enji Cooper Aq Mt ngie@FreeBSD.org . Modified: stable/12/share/man/man5/cd9660.5 ============================================================================== --- stable/12/share/man/man5/cd9660.5 Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/share/man/man5/cd9660.5 Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ .\" -.\" Copyright (c) 2017 Ngie Cooper -.\" All rights reserved. +.\" Copyright (c) 2017 Enji Cooper .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -79,4 +78,4 @@ and .An Atsushi Murai Aq Mt amurai@spec.co.jp . .Pp This manual page was written by -.An Ngie Cooper Aq Mt ngie@FreeBSD.org . +.An Enji Cooper Aq Mt ngie@FreeBSD.org . Modified: stable/12/share/zoneinfo/tests/backward_test.sh ============================================================================== --- stable/12/share/zoneinfo/tests/backward_test.sh Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/share/zoneinfo/tests/backward_test.sh Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: stable/12/share/zoneinfo/tests/zoneinfo_common.sh ============================================================================== --- stable/12/share/zoneinfo/tests/zoneinfo_common.sh Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/share/zoneinfo/tests/zoneinfo_common.sh Mon Apr 29 19:34:09 2019 (r346918) @@ -1,7 +1,6 @@ #!/bin/sh # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: stable/12/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- stable/12/usr.bin/calendar/calendars/calendar.freebsd Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/usr.bin/calendar/calendars/calendar.freebsd Mon Apr 29 19:34:09 2019 (r346918) @@ -44,7 +44,7 @@ 01/26 Andrew Gallatin born in Buffalo, New York, United States, 1970 01/27 Nick Sayer born in San Diego, California, United States, 1968 01/27 Jacques Anthony Vidrine born in Baton Rouge, Louisiana, United States, 1971 -01/27 Ngie Cooper born in Seattle, Washington, United States, 1984 +01/27 Enji Cooper born in Seattle, Washington, United States, 1984 01/31 Hidetoshi Shimokawa born in Yokohama, Kanagawa, Japan, 1970 02/01 Doug Rabson born in London, England, 1966 02/01 Nicola Vitale born in Busto Arsizio, Varese, Italy, 1976 Modified: stable/12/usr.bin/du/tests/du_test.sh ============================================================================== --- stable/12/usr.bin/du/tests/du_test.sh Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/usr.bin/du/tests/du_test.sh Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: stable/12/usr.bin/getconf/tests/arch_type.c ============================================================================== --- stable/12/usr.bin/getconf/tests/arch_type.c Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/usr.bin/getconf/tests/arch_type.c Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /* - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/usr.bin/procstat/tests/procstat_test.sh ============================================================================== --- stable/12/usr.bin/procstat/tests/procstat_test.sh Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/usr.bin/procstat/tests/procstat_test.sh Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: stable/12/usr.bin/procstat/tests/while1.c ============================================================================== --- stable/12/usr.bin/procstat/tests/while1.c Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/usr.bin/procstat/tests/while1.c Mon Apr 29 19:34:09 2019 (r346918) @@ -1,6 +1,5 @@ /* - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/12/usr.sbin/sysrc/sysrc.8 ============================================================================== --- stable/12/usr.sbin/sysrc/sysrc.8 Mon Apr 29 19:32:11 2019 (r346917) +++ stable/12/usr.sbin/sysrc/sysrc.8 Mon Apr 29 19:34:09 2019 (r346918) @@ -480,6 +480,6 @@ utility first appeared in .Sh AUTHORS .An Devin Teske Aq Mt dteske@FreeBSD.org .Sh THANKS TO -Brandon Gooch, Ngie Cooper, Julian Elischer, Pawel Jakub Dawidek, +Brandon Gooch, Enji Cooper, Julian Elischer, Pawel Jakub Dawidek, Cyrille Lefevre, Ross West, Stefan Esser, Marco Steinbach, Jilles Tjoelker, Allan Jude, and Lars Engels for suggestions, help, and testing. From owner-svn-src-all@freebsd.org Mon Apr 29 19:35:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A0BA159AEAE; Mon, 29 Apr 2019 19:35:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 098836EADE; Mon, 29 Apr 2019 19:35:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E67AF269BE; Mon, 29 Apr 2019 19:35:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TJZYhe078057; Mon, 29 Apr 2019 19:35:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TJZY6L078056; Mon, 29 Apr 2019 19:35:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904291935.x3TJZY6L078056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 29 Apr 2019 19:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346919 - stable/11/share/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/share/mk X-SVN-Commit-Revision: 346919 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 098836EADE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 19:35:35 -0000 Author: ngie Date: Mon Apr 29 19:35:34 2019 New Revision: 346919 URL: https://svnweb.freebsd.org/changeset/base/346919 Log: MFC r345723: PROG_OVERRIDE_VARS should override default values if specified The behavior prior to this change would not override default values if set in `bsd.own.mk`, or (in the more general case) globally before `bsd.progs.mk` was included. This affected `bsd.test.mk` as well, since it consumes `bsd.progs.mk`. Some examples of this failing behavior are as follows: * `BINMODE` defaults to 0555 per `bsd.own.mk`. If someone wanted to set the `BINMODE` to `NOBINMODE` (0444) for `prog`, for example, like `BINMODE.prog= ${NOBINMODE}`, `bsd.progs.mk` would not honor the per-PROG setting. * An application, `prog`, does not build at `WARNS?= 6`. Before this change, setting to a lower `WARNS` value, e.g., `WARNS.prog= 3`, would have been impossible, requiring that `prog` be built from another directory, the global `WARNS` be lowered, or a per-PROG value needing to be set across the board. None of the above workarounds is desirable. This change unbreaks variables defined in `PROG_OVERRIDE_VARS` which have defaults set before `bsd.progs.mk` is included, by setting them to their defined values if set on a per-PROG basis. Modified: stable/11/share/mk/bsd.progs.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/share/mk/bsd.progs.mk ============================================================================== --- stable/11/share/mk/bsd.progs.mk Mon Apr 29 19:34:09 2019 (r346918) +++ stable/11/share/mk/bsd.progs.mk Mon Apr 29 19:35:34 2019 (r346919) @@ -34,6 +34,11 @@ $v += ${${v}.${PROG}} $v += ${${v}_${PROG}} .endif .else +.if defined(${v}.${PROG}) +$v = ${${v}.${PROG}} +.elif defined(${v}_${PROG}) +$v = ${${v}_${PROG}} +.endif $v ?= .endif .endfor From owner-svn-src-all@freebsd.org Mon Apr 29 19:36:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97123159AF84; Mon, 29 Apr 2019 19:36:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0BE466EC89; Mon, 29 Apr 2019 19:36:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3900269BF; Mon, 29 Apr 2019 19:36:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TJapTN078249; Mon, 29 Apr 2019 19:36:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TJalw9078216; Mon, 29 Apr 2019 19:36:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904291936.x3TJalw9078216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 29 Apr 2019 19:36:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346920 - in stable/11: lib/libcam/tests lib/libkvm/tests lib/libsbuf/tests share/examples/tests/tests/tap share/man/man4 share/man/man5 share/zoneinfo/tests usr.bin/calendar/calendars ... X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/11: lib/libcam/tests lib/libkvm/tests lib/libsbuf/tests share/examples/tests/tests/tap share/man/man4 share/man/man5 share/zoneinfo/tests usr.bin/calendar/calendars usr.bin/du/tests usr.bin/... X-SVN-Commit-Revision: 346920 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0BE466EC89 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 19:36:52 -0000 Author: ngie Date: Mon Apr 29 19:36:46 2019 New Revision: 346920 URL: https://svnweb.freebsd.org/changeset/base/346920 Log: MFC r346571,r346572: Update the spelling of my name Previous spellings of my name (NGie, Ngie) weren't my legal spelling. Use Enji instead for clarity. While here, remove "All Rights Reserved" from copyrights I "own". Modified: stable/11/lib/libcam/tests/libcam_test.c stable/11/lib/libkvm/tests/kvm_close_test.c stable/11/lib/libkvm/tests/kvm_geterr_test.c stable/11/lib/libkvm/tests/kvm_open2_test.c stable/11/lib/libkvm/tests/kvm_open_test.c stable/11/lib/libkvm/tests/kvm_test_common.c stable/11/lib/libkvm/tests/kvm_test_common.h stable/11/lib/libsbuf/tests/sbuf_core_test.c stable/11/lib/libsbuf/tests/sbuf_stdio_test.c stable/11/lib/libsbuf/tests/sbuf_string_test.c stable/11/lib/libsbuf/tests/sbuf_test_common.h stable/11/share/examples/tests/tests/tap/cp_test.sh stable/11/share/man/man4/cfiscsi.4 stable/11/share/man/man5/cd9660.5 stable/11/share/zoneinfo/tests/backward_test.sh stable/11/share/zoneinfo/tests/zoneinfo_common.sh stable/11/usr.bin/calendar/calendars/calendar.freebsd stable/11/usr.bin/du/tests/du_test.sh stable/11/usr.bin/getconf/tests/arch_type.c stable/11/usr.bin/procstat/tests/procstat_test.sh stable/11/usr.bin/procstat/tests/while1.c stable/11/usr.sbin/sysrc/sysrc.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libcam/tests/libcam_test.c ============================================================================== --- stable/11/lib/libcam/tests/libcam_test.c Mon Apr 29 19:35:34 2019 (r346919) +++ stable/11/lib/libcam/tests/libcam_test.c Mon Apr 29 19:36:46 2019 (r346920) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/11/lib/libkvm/tests/kvm_close_test.c ============================================================================== --- stable/11/lib/libkvm/tests/kvm_close_test.c Mon Apr 29 19:35:34 2019 (r346919) +++ stable/11/lib/libkvm/tests/kvm_close_test.c Mon Apr 29 19:36:46 2019 (r346920) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/11/lib/libkvm/tests/kvm_geterr_test.c ============================================================================== --- stable/11/lib/libkvm/tests/kvm_geterr_test.c Mon Apr 29 19:35:34 2019 (r346919) +++ stable/11/lib/libkvm/tests/kvm_geterr_test.c Mon Apr 29 19:36:46 2019 (r346920) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/11/lib/libkvm/tests/kvm_open2_test.c ============================================================================== --- stable/11/lib/libkvm/tests/kvm_open2_test.c Mon Apr 29 19:35:34 2019 (r346919) +++ stable/11/lib/libkvm/tests/kvm_open2_test.c Mon Apr 29 19:36:46 2019 (r346920) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/11/lib/libkvm/tests/kvm_open_test.c ============================================================================== --- stable/11/lib/libkvm/tests/kvm_open_test.c Mon Apr 29 19:35:34 2019 (r346919) +++ stable/11/lib/libkvm/tests/kvm_open_test.c Mon Apr 29 19:36:46 2019 (r346920) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/11/lib/libkvm/tests/kvm_test_common.c ============================================================================== --- stable/11/lib/libkvm/tests/kvm_test_common.c Mon Apr 29 19:35:34 2019 (r346919) +++ stable/11/lib/libkvm/tests/kvm_test_common.c Mon Apr 29 19:36:46 2019 (r346920) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/11/lib/libkvm/tests/kvm_test_common.h ============================================================================== --- stable/11/lib/libkvm/tests/kvm_test_common.h Mon Apr 29 19:35:34 2019 (r346919) +++ stable/11/lib/libkvm/tests/kvm_test_common.h Mon Apr 29 19:36:46 2019 (r346920) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/11/lib/libsbuf/tests/sbuf_core_test.c ============================================================================== --- stable/11/lib/libsbuf/tests/sbuf_core_test.c Mon Apr 29 19:35:34 2019 (r346919) +++ stable/11/lib/libsbuf/tests/sbuf_core_test.c Mon Apr 29 19:36:46 2019 (r346920) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/11/lib/libsbuf/tests/sbuf_stdio_test.c ============================================================================== --- stable/11/lib/libsbuf/tests/sbuf_stdio_test.c Mon Apr 29 19:35:34 2019 (r346919) +++ stable/11/lib/libsbuf/tests/sbuf_stdio_test.c Mon Apr 29 19:36:46 2019 (r346920) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/11/lib/libsbuf/tests/sbuf_string_test.c ============================================================================== --- stable/11/lib/libsbuf/tests/sbuf_string_test.c Mon Apr 29 19:35:34 2019 (r346919) +++ stable/11/lib/libsbuf/tests/sbuf_string_test.c Mon Apr 29 19:36:46 2019 (r346920) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/11/lib/libsbuf/tests/sbuf_test_common.h ============================================================================== --- stable/11/lib/libsbuf/tests/sbuf_test_common.h Mon Apr 29 19:35:34 2019 (r346919) +++ stable/11/lib/libsbuf/tests/sbuf_test_common.h Mon Apr 29 19:36:46 2019 (r346920) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/11/share/examples/tests/tests/tap/cp_test.sh ============================================================================== --- stable/11/share/examples/tests/tests/tap/cp_test.sh Mon Apr 29 19:35:34 2019 (r346919) +++ stable/11/share/examples/tests/tests/tap/cp_test.sh Mon Apr 29 19:36:46 2019 (r346920) @@ -1,7 +1,6 @@ #!/bin/sh # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: stable/11/share/man/man4/cfiscsi.4 ============================================================================== --- stable/11/share/man/man4/cfiscsi.4 Mon Apr 29 19:35:34 2019 (r346919) +++ stable/11/share/man/man4/cfiscsi.4 Mon Apr 29 19:36:46 2019 (r346920) @@ -1,7 +1,6 @@ .\" Copyright (c) 2013 Edward Tomasz Napierala .\" Copyright (c) 2015-2017 Alexander Motin -.\" Copyright (c) 2017 Ngie Cooper -.\" All rights reserved. +.\" Copyright (c) 2017 Enji Cooper .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -109,4 +108,4 @@ subsystem was developed by .An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org under sponsorship from the FreeBSD Foundation. This manual page was written by -.An Ngie Cooper Aq Mt ngie@FreeBSD.org . +.An Enji Cooper Aq Mt ngie@FreeBSD.org . Modified: stable/11/share/man/man5/cd9660.5 ============================================================================== --- stable/11/share/man/man5/cd9660.5 Mon Apr 29 19:35:34 2019 (r346919) +++ stable/11/share/man/man5/cd9660.5 Mon Apr 29 19:36:46 2019 (r346920) @@ -1,6 +1,5 @@ .\" -.\" Copyright (c) 2017 Ngie Cooper -.\" All rights reserved. +.\" Copyright (c) 2017 Enji Cooper .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -79,4 +78,4 @@ and .An Atsushi Murai Aq Mt amurai@spec.co.jp . .Pp This manual page was written by -.An Ngie Cooper Aq Mt ngie@FreeBSD.org . +.An Enji Cooper Aq Mt ngie@FreeBSD.org . Modified: stable/11/share/zoneinfo/tests/backward_test.sh ============================================================================== --- stable/11/share/zoneinfo/tests/backward_test.sh Mon Apr 29 19:35:34 2019 (r346919) +++ stable/11/share/zoneinfo/tests/backward_test.sh Mon Apr 29 19:36:46 2019 (r346920) @@ -1,6 +1,5 @@ # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: stable/11/share/zoneinfo/tests/zoneinfo_common.sh ============================================================================== --- stable/11/share/zoneinfo/tests/zoneinfo_common.sh Mon Apr 29 19:35:34 2019 (r346919) +++ stable/11/share/zoneinfo/tests/zoneinfo_common.sh Mon Apr 29 19:36:46 2019 (r346920) @@ -1,7 +1,6 @@ #!/bin/sh # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: stable/11/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- stable/11/usr.bin/calendar/calendars/calendar.freebsd Mon Apr 29 19:35:34 2019 (r346919) +++ stable/11/usr.bin/calendar/calendars/calendar.freebsd Mon Apr 29 19:36:46 2019 (r346920) @@ -42,7 +42,7 @@ 01/26 Andrew Gallatin born in Buffalo, New York, United States, 1970 01/27 Nick Sayer born in San Diego, California, United States, 1968 01/27 Jacques Anthony Vidrine born in Baton Rouge, Louisiana, United States, 1971 -01/27 Ngie Cooper born in Seattle, Washington, United States, 1984 +01/27 Enji Cooper born in Seattle, Washington, United States, 1984 01/31 Hidetoshi Shimokawa born in Yokohama, Kanagawa, Japan, 1970 02/01 Doug Rabson born in London, England, 1966 02/01 Nicola Vitale born in Busto Arsizio, Varese, Italy, 1976 Modified: stable/11/usr.bin/du/tests/du_test.sh ============================================================================== --- stable/11/usr.bin/du/tests/du_test.sh Mon Apr 29 19:35:34 2019 (r346919) +++ stable/11/usr.bin/du/tests/du_test.sh Mon Apr 29 19:36:46 2019 (r346920) @@ -1,6 +1,5 @@ # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: stable/11/usr.bin/getconf/tests/arch_type.c ============================================================================== --- stable/11/usr.bin/getconf/tests/arch_type.c Mon Apr 29 19:35:34 2019 (r346919) +++ stable/11/usr.bin/getconf/tests/arch_type.c Mon Apr 29 19:36:46 2019 (r346920) @@ -1,6 +1,5 @@ /* - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/11/usr.bin/procstat/tests/procstat_test.sh ============================================================================== --- stable/11/usr.bin/procstat/tests/procstat_test.sh Mon Apr 29 19:35:34 2019 (r346919) +++ stable/11/usr.bin/procstat/tests/procstat_test.sh Mon Apr 29 19:36:46 2019 (r346920) @@ -1,6 +1,5 @@ # -# Copyright (c) 2017 Ngie Cooper -# All rights reserved. +# Copyright (c) 2017 Enji Cooper # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: stable/11/usr.bin/procstat/tests/while1.c ============================================================================== --- stable/11/usr.bin/procstat/tests/while1.c Mon Apr 29 19:35:34 2019 (r346919) +++ stable/11/usr.bin/procstat/tests/while1.c Mon Apr 29 19:36:46 2019 (r346920) @@ -1,6 +1,5 @@ /* - * Copyright (c) 2017 Ngie Cooper - * All rights reserved. + * Copyright (c) 2017 Enji Cooper * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/11/usr.sbin/sysrc/sysrc.8 ============================================================================== --- stable/11/usr.sbin/sysrc/sysrc.8 Mon Apr 29 19:35:34 2019 (r346919) +++ stable/11/usr.sbin/sysrc/sysrc.8 Mon Apr 29 19:36:46 2019 (r346920) @@ -480,6 +480,6 @@ utility first appeared in .Sh AUTHORS .An Devin Teske Aq Mt dteske@FreeBSD.org .Sh THANKS TO -Brandon Gooch, Ngie Cooper, Julian Elischer, Pawel Jakub Dawidek, +Brandon Gooch, Enji Cooper, Julian Elischer, Pawel Jakub Dawidek, Cyrille Lefevre, Ross West, Stefan Esser, Marco Steinbach, Jilles Tjoelker, Allan Jude, and Lars Engels for suggestions, help, and testing. From owner-svn-src-all@freebsd.org Mon Apr 29 19:37:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43399159AFE4; Mon, 29 Apr 2019 19:37:17 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD5196EDA1; Mon, 29 Apr 2019 19:37:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2B3A269C0; Mon, 29 Apr 2019 19:37:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TJbGTj078316; Mon, 29 Apr 2019 19:37:16 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TJbGnm078315; Mon, 29 Apr 2019 19:37:16 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904291937.x3TJbGnm078315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 19:37:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346921 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346921 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD5196EDA1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 19:37:17 -0000 Author: np Date: Mon Apr 29 19:37:16 2019 New Revision: 346921 URL: https://svnweb.freebsd.org/changeset/base/346921 Log: MFC r339626: cxgbe(4): Use automatic cidx updates with ofld and ctrl queues. The bits that explicitly request cidx updates do not work reliably with all possible WRs that can be sent over the queue. The F_FW_WR_EQUIQ requests that still remain may also have to be replaced with explicit credit flush WRs in the future. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 19:36:46 2019 (r346920) +++ stable/11/sys/dev/cxgbe/t4_sge.c Mon Apr 29 19:37:16 2019 (r346921) @@ -2044,12 +2044,13 @@ drain_wrq_wr_list(struct adapter *sc, struct sge_wrq * if (available < eq->sidx / 4 && atomic_cmpset_int(&eq->equiq, 0, 1)) { + /* + * XXX: This is not 100% reliable with some + * types of WRs. But this is a very unusual + * situation for an ofld/ctrl queue anyway. + */ dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUIQ | F_FW_WR_EQUEQ); - eq->equeqidx = eq->pidx; - } else if (IDXDIFF(eq->pidx, eq->equeqidx, eq->sidx) >= 32) { - dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUEQ); - eq->equeqidx = eq->pidx; } dbdiff += n; @@ -2476,12 +2477,13 @@ commit_wrq_wr(struct sge_wrq *wrq, void *w, struct wrq available = IDXDIFF(eq->cidx, eq->pidx, eq->sidx) - 1; if (available < eq->sidx / 4 && atomic_cmpset_int(&eq->equiq, 0, 1)) { + /* + * XXX: This is not 100% reliable with some + * types of WRs. But this is a very unusual + * situation for an ofld/ctrl queue anyway. + */ dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUIQ | F_FW_WR_EQUEQ); - eq->equeqidx = pidx; - } else if (IDXDIFF(eq->pidx, eq->equeqidx, eq->sidx) >= 32) { - dst->equiq_to_len16 |= htobe32(F_FW_WR_EQUEQ); - eq->equeqidx = pidx; } ring_eq_db(wrq->adapter, eq, ndesc); @@ -3404,6 +3406,23 @@ free_nm_txq(struct vi_info *vi, struct sge_nm_txq *nm_ } #endif +/* + * Returns a reasonable automatic cidx flush threshold for a given queue size. + */ +static u_int +qsize_to_fthresh(int qsize) +{ + u_int fthresh; + + while (!powerof2(qsize)) + qsize++; + fthresh = ilog2(qsize); + if (fthresh > X_CIDXFLUSHTHRESH_128) + fthresh = X_CIDXFLUSHTHRESH_128; + + return (fthresh); +} + static int ctrl_eq_alloc(struct adapter *sc, struct sge_eq *eq) { @@ -3427,7 +3446,7 @@ ctrl_eq_alloc(struct adapter *sc, struct sge_eq *eq) c.dcaen_to_eqsize = htobe32(V_FW_EQ_CTRL_CMD_FBMIN(X_FETCHBURSTMIN_64B) | V_FW_EQ_CTRL_CMD_FBMAX(X_FETCHBURSTMAX_512B) | - V_FW_EQ_CTRL_CMD_CIDXFTHRESH(X_CIDXFLUSHTHRESH_32) | + V_FW_EQ_CTRL_CMD_CIDXFTHRESH(qsize_to_fthresh(qsize)) | V_FW_EQ_CTRL_CMD_EQSIZE(qsize)); c.eqaddr = htobe64(eq->ba); @@ -3509,12 +3528,13 @@ ofld_eq_alloc(struct adapter *sc, struct vi_info *vi, c.alloc_to_len16 = htonl(F_FW_EQ_OFLD_CMD_ALLOC | F_FW_EQ_OFLD_CMD_EQSTART | FW_LEN16(c)); c.fetchszm_to_iqid = - htonl(V_FW_EQ_OFLD_CMD_HOSTFCMODE(X_HOSTFCMODE_NONE) | + htonl(V_FW_EQ_OFLD_CMD_HOSTFCMODE(X_HOSTFCMODE_STATUS_PAGE) | V_FW_EQ_OFLD_CMD_PCIECHN(eq->tx_chan) | F_FW_EQ_OFLD_CMD_FETCHRO | V_FW_EQ_OFLD_CMD_IQID(eq->iqid)); c.dcaen_to_eqsize = htobe32(V_FW_EQ_OFLD_CMD_FBMIN(X_FETCHBURSTMIN_64B) | V_FW_EQ_OFLD_CMD_FBMAX(X_FETCHBURSTMAX_512B) | + V_FW_EQ_OFLD_CMD_CIDXFTHRESH(qsize_to_fthresh(qsize)) | V_FW_EQ_OFLD_CMD_EQSIZE(qsize)); c.eqaddr = htobe64(eq->ba); @@ -3552,8 +3572,9 @@ alloc_eq(struct adapter *sc, struct vi_info *vi, struc if (rc) return (rc); - eq->pidx = eq->cidx = 0; - eq->equeqidx = eq->dbidx = 0; + eq->pidx = eq->cidx = eq->dbidx = 0; + /* Note that equeqidx is not used with sge_wrq (OFLD/CTRL) queues. */ + eq->equeqidx = 0; eq->doorbells = sc->doorbells; switch (eq->flags & EQ_TYPEMASK) { From owner-svn-src-all@freebsd.org Mon Apr 29 19:47:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D434159B469; Mon, 29 Apr 2019 19:47:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F187F6F615; Mon, 29 Apr 2019 19:47:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C692026B74; Mon, 29 Apr 2019 19:47:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TJlLFW084097; Mon, 29 Apr 2019 19:47:21 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TJlL0H084096; Mon, 29 Apr 2019 19:47:21 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904291947.x3TJlL0H084096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 19:47:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346922 - stable/11/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 346922 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F187F6F615 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 19:47:22 -0000 Author: np Date: Mon Apr 29 19:47:21 2019 New Revision: 346922 URL: https://svnweb.freebsd.org/changeset/base/346922 Log: MFC r339667: cxgbe/iw_cxgbe: save the ep in the driver-private provider_data field. Submitted By: Lily Wang @ Netapp Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c Mon Apr 29 19:37:16 2019 (r346921) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c Mon Apr 29 19:47:21 2019 (r346922) @@ -2531,6 +2531,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_ goto out; } ep = alloc_ep(sizeof(*ep), GFP_KERNEL); + cm_id->provider_data = ep; init_timer(&ep->timer); ep->plen = conn_param->private_data_len; From owner-svn-src-all@freebsd.org Mon Apr 29 20:10:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C71BE159C18F; Mon, 29 Apr 2019 20:10:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AC5970E21; Mon, 29 Apr 2019 20:10:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52F6426EDA; Mon, 29 Apr 2019 20:10:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TKAUep094698; Mon, 29 Apr 2019 20:10:30 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TKAS0X094690; Mon, 29 Apr 2019 20:10:28 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904292010.x3TKAS0X094690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 20:10:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346923 - in stable/11/sys/dev/cxgbe: . iw_cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys/dev/cxgbe: . iw_cxgbe X-SVN-Commit-Revision: 346923 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7AC5970E21 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 20:10:31 -0000 Author: np Date: Mon Apr 29 20:10:28 2019 New Revision: 346923 URL: https://svnweb.freebsd.org/changeset/base/346923 Log: MFC r339891, r340063, r342266, r342270, r342272, r342288-r342289 r339891: cxgbe/iw_cxgbe: Install the socket upcall before calling soconnect to ensure that it always runs when soisconnected does. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications r340063: cxgbe/iw_cxgbe: Suppress spurious "Unexpected streaming data ..." messages. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications r342266: cxgbe/iw_cxgbe: Use DSGLs to write to card's memory when appropriate. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications r342270: cxgbe/iw_cxgbe: Add a knob for testing that lets iWARP connections cycle through 4-tuples quickly. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications r342272: cxgbe/iw_cxgbe: Use -ve errno when interfacing with linuxkpi/OFED. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications r342288: cxgbe/iw_cxgbe: Do not terminate CTRx messages with \n. r342289: cxgbe/iw_cxgbe: Remove redundant CTRs from c4iw_alloc/c4iw_rdev_open. This information is readily available elsewhere. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c stable/11/sys/dev/cxgbe/iw_cxgbe/cq.c stable/11/sys/dev/cxgbe/iw_cxgbe/device.c stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h stable/11/sys/dev/cxgbe/iw_cxgbe/mem.c stable/11/sys/dev/cxgbe/iw_cxgbe/provider.c stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c stable/11/sys/dev/cxgbe/iw_cxgbe/t4.h stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c Mon Apr 29 19:47:21 2019 (r346922) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c Mon Apr 29 20:10:28 2019 (r346923) @@ -172,7 +172,6 @@ static void process_newconn(struct c4iw_listen_ep *mas free(__a, M_SONAME); \ } while (0) -#ifdef KTR static char *states[] = { "idle", "listen", @@ -188,7 +187,6 @@ static char *states[] = { "dead", NULL, }; -#endif static void deref_cm_id(struct c4iw_ep_common *epc) { @@ -429,7 +427,7 @@ static void process_timeout(struct c4iw_ep *ep) abort = 0; break; default: - CTR4(KTR_IW_CXGBE, "%s unexpected state ep %p tid %u state %u\n" + CTR4(KTR_IW_CXGBE, "%s unexpected state ep %p tid %u state %u" , __func__, ep, ep->hwtid, ep->com.state); abort = 0; } @@ -841,7 +839,7 @@ setiwsockopt(struct socket *so) sopt.sopt_val = (caddr_t)&on; sopt.sopt_valsize = sizeof on; sopt.sopt_td = NULL; - rc = sosetopt(so, &sopt); + rc = -sosetopt(so, &sopt); if (rc) { log(LOG_ERR, "%s: can't set TCP_NODELAY on so %p (%d)\n", __func__, so, rc); @@ -870,7 +868,9 @@ uninit_iwarp_socket(struct socket *so) static void process_data(struct c4iw_ep *ep) { + int ret = 0; int disconnect = 0; + struct c4iw_qp_attributes attrs = {0}; CTR5(KTR_IW_CXGBE, "%s: so %p, ep %p, state %s, sbused %d", __func__, ep->com.so, ep, states[ep->com.state], sbused(&ep->com.so->so_rcv)); @@ -885,9 +885,16 @@ process_data(struct c4iw_ep *ep) /* Refered in process_newconn() */ c4iw_put_ep(&ep->parent_ep->com); break; + case FPDU_MODE: + MPASS(ep->com.qp != NULL); + attrs.next_state = C4IW_QP_STATE_TERMINATE; + ret = c4iw_modify_qp(ep->com.dev, ep->com.qp, + C4IW_QP_ATTR_NEXT_STATE, &attrs, 1); + if (ret != -EINPROGRESS) + disconnect = 1; + break; default: - if (sbused(&ep->com.so->so_rcv)) - log(LOG_ERR, "%s: Unexpected streaming data. ep %p, " + log(LOG_ERR, "%s: Unexpected streaming data. ep %p, " "state %d, so %p, so_state 0x%x, sbused %u\n", __func__, ep, ep->com.state, ep->com.so, ep->com.so->so_state, sbused(&ep->com.so->so_rcv)); @@ -952,6 +959,7 @@ process_newconn(struct c4iw_listen_ep *master_lep, str { struct c4iw_listen_ep *real_lep = NULL; struct c4iw_ep *new_ep = NULL; + struct sockaddr_in *remote = NULL; int ret = 0; MPASS(new_so != NULL); @@ -996,6 +1004,20 @@ process_newconn(struct c4iw_listen_ep *master_lep, str START_EP_TIMER(new_ep); setiwsockopt(new_so); + ret = soaccept(new_so, (struct sockaddr **)&remote); + if (ret != 0) { + CTR4(KTR_IW_CXGBE, + "%s:listen sock:%p, new sock:%p, ret:%d", + __func__, master_lep->com.so, new_so, ret); + if (remote != NULL) + free(remote, M_SONAME); + uninit_iwarp_socket(new_so); + soclose(new_so); + c4iw_put_ep(&new_ep->com); + c4iw_put_ep(&real_lep->com); + return; + } + free(remote, M_SONAME); /* MPA request might have been queued up on the socket already, so we * initialize the socket/upcall_handler under lock to prevent processing @@ -1171,7 +1193,24 @@ process_socket_event(struct c4iw_ep *ep) } /* rx data */ - process_data(ep); + if (sbused(&ep->com.so->so_rcv)) { + process_data(ep); + return; + } + + /* Socket events for 'MPA Request Received' and 'Close Complete' + * were already processed earlier in their previous events handlers. + * Hence, these socket events are skipped. + * And any other socket events must have handled above. + */ + MPASS((ep->com.state == MPA_REQ_RCVD) || (ep->com.state == MORIBUND)); + + if ((ep->com.state != MPA_REQ_RCVD) && (ep->com.state != MORIBUND)) + log(LOG_ERR, "%s: Unprocessed socket event so %p, " + "so_state 0x%x, so_err %d, sb_state 0x%x, ep %p, ep_state %s\n", + __func__, so, so->so_state, so->so_error, so->so_rcv.sb_state, + ep, states[state]); + } SYSCTL_NODE(_hw, OID_AUTO, iw_cxgbe, CTLFLAG_RD, 0, "iw_cxgbe driver parameters"); @@ -1232,6 +1271,18 @@ static int snd_win = 128 * 1024; SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, snd_win, CTLFLAG_RWTUN, &snd_win, 0, "TCP send window in bytes (default = 128KB)"); +int use_dsgl = 1; +SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, use_dsgl, CTLFLAG_RWTUN, &use_dsgl, 0, + "Use DSGL for PBL/FastReg (default=1)"); + +int inline_threshold = 128; +SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, inline_threshold, CTLFLAG_RWTUN, &inline_threshold, 0, + "inline vs dsgl threshold (default=128)"); + +static int reuseaddr = 0; +SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, reuseaddr, CTLFLAG_RWTUN, &reuseaddr, 0, + "Enable SO_REUSEADDR & SO_REUSEPORT socket options on all iWARP client connections(default = 0)"); + static void start_ep_timer(struct c4iw_ep *ep) { @@ -1606,7 +1657,7 @@ send_abort(struct c4iw_ep *ep) sopt.sopt_val = (caddr_t)&l; sopt.sopt_valsize = sizeof l; sopt.sopt_td = NULL; - rc = sosetopt(so, &sopt); + rc = -sosetopt(so, &sopt); if (rc != 0) { log(LOG_ERR, "%s: sosetopt(%p, linger = 0) failed with %d.\n", __func__, so, rc); @@ -1624,6 +1675,7 @@ send_abort(struct c4iw_ep *ep) * handler(not yet implemented) of iw_cxgbe driver. */ release_ep_resources(ep); + ep->com.state = DEAD; return (0); } @@ -2263,7 +2315,7 @@ process_mpa_request(struct c4iw_ep *ep) MPA_V2_IRD_ORD_MASK; ep->ord = min_t(u32, ep->ord, cur_max_read_depth(ep->com.dev)); - CTR3(KTR_IW_CXGBE, "%s initiator ird %u ord %u\n", + CTR3(KTR_IW_CXGBE, "%s initiator ird %u ord %u", __func__, ep->ird, ep->ord); if (ntohs(mpa_v2_params->ird) & MPA_V2_PEER2PEER_MODEL) if (peer2peer) { @@ -2417,7 +2469,7 @@ int c4iw_accept_cr(struct iw_cm_id *cm_id, struct iw_c ep->ird = 1; } - CTR4(KTR_IW_CXGBE, "%s %d ird %d ord %d\n", __func__, __LINE__, + CTR4(KTR_IW_CXGBE, "%s %d ird %d ord %d", __func__, __LINE__, ep->ird, ep->ord); ep->com.cm_id = cm_id; @@ -2476,8 +2528,9 @@ static int c4iw_sock_create(struct sockaddr_storage *laddr, struct socket **so) { int ret; - int size; + int size, on; struct socket *sock = NULL; + struct sockopt sopt; ret = sock_create_kern(laddr->ss_family, SOCK_STREAM, IPPROTO_TCP, &sock); @@ -2487,7 +2540,34 @@ c4iw_sock_create(struct sockaddr_storage *laddr, struc return ret; } - ret = sobind(sock, (struct sockaddr *)laddr, curthread); + if (reuseaddr) { + bzero(&sopt, sizeof(struct sockopt)); + sopt.sopt_dir = SOPT_SET; + sopt.sopt_level = SOL_SOCKET; + sopt.sopt_name = SO_REUSEADDR; + on = 1; + sopt.sopt_val = &on; + sopt.sopt_valsize = sizeof(on); + ret = -sosetopt(sock, &sopt); + if (ret != 0) { + log(LOG_ERR, "%s: sosetopt(%p, SO_REUSEADDR) " + "failed with %d.\n", __func__, sock, ret); + } + bzero(&sopt, sizeof(struct sockopt)); + sopt.sopt_dir = SOPT_SET; + sopt.sopt_level = SOL_SOCKET; + sopt.sopt_name = SO_REUSEPORT; + on = 1; + sopt.sopt_val = &on; + sopt.sopt_valsize = sizeof(on); + ret = -sosetopt(sock, &sopt); + if (ret != 0) { + log(LOG_ERR, "%s: sosetopt(%p, SO_REUSEPORT) " + "failed with %d.\n", __func__, sock, ret); + } + } + + ret = -sobind(sock, (struct sockaddr *)laddr, curthread); if (ret) { CTR2(KTR_IW_CXGBE, "%s:Failed to bind socket. err %p", __func__, ret); @@ -2592,22 +2672,24 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_ goto fail; setiwsockopt(ep->com.so); + init_iwarp_socket(ep->com.so, &ep->com); err = -soconnect(ep->com.so, (struct sockaddr *)&ep->com.remote_addr, ep->com.thread); - if (!err) { - init_iwarp_socket(ep->com.so, &ep->com); - goto out; - } else + if (err) goto fail_free_so; + CTR2(KTR_IW_CXGBE, "%s:ccE, ep %p", __func__, ep); + return 0; fail_free_so: + uninit_iwarp_socket(ep->com.so); + ep->com.state = DEAD; sock_release(ep->com.so); fail: deref_cm_id(&ep->com); c4iw_put_ep(&ep->com); ep = NULL; out: - CTR2(KTR_IW_CXGBE, "%s:ccE ret:%d", __func__, err); + CTR2(KTR_IW_CXGBE, "%s:ccE Error %d", __func__, err); return err; } @@ -2669,7 +2751,7 @@ c4iw_create_listen(struct iw_cm_id *cm_id, int backlog goto fail; } - rc = solisten(lep->com.so, backlog, curthread); + rc = -solisten(lep->com.so, backlog, curthread); if (rc) { CTR3(KTR_IW_CXGBE, "%s:Failed to listen on sock:%p. err %d", __func__, lep->com.so, rc); Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/cq.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/cq.c Mon Apr 29 19:47:21 2019 (r346922) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/cq.c Mon Apr 29 20:10:28 2019 (r346923) @@ -669,7 +669,7 @@ proc_cqe: BUG_ON(wq->sq.in_use <= 0 && wq->sq.in_use >= wq->sq.size); wq->sq.cidx = (uint16_t)idx; - CTR2(KTR_IW_CXGBE, "%s completing sq idx %u\n", + CTR2(KTR_IW_CXGBE, "%s completing sq idx %u", __func__, wq->sq.cidx); *cookie = wq->sq.sw_sq[wq->sq.cidx].wr_id; t4_sq_consume(wq); Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/device.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/device.c Mon Apr 29 19:47:21 2019 (r346922) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/device.c Mon Apr 29 20:10:28 2019 (r346923) @@ -120,24 +120,7 @@ c4iw_rdev_open(struct c4iw_rdev *rdev) rdev->qpmask = udb_density - 1; rdev->cqshift = PAGE_SHIFT - sp->iq_s_qpp; rdev->cqmask = ucq_density - 1; - CTR5(KTR_IW_CXGBE, "%s dev %s stag start 0x%0x size 0x%0x num stags %d", - __func__, device_get_nameunit(sc->dev), sc->vres.stag.start, - sc->vres.stag.size, c4iw_num_stags(rdev)); - CTR5(KTR_IW_CXGBE, "%s pbl start 0x%0x size 0x%0x" - " rq start 0x%0x size 0x%0x", __func__, - sc->vres.pbl.start, sc->vres.pbl.size, - sc->vres.rq.start, sc->vres.rq.size); - CTR5(KTR_IW_CXGBE, "%s:qp qid start %u size %u cq qid start %u size %u", - __func__, sc->vres.qp.start, sc->vres.qp.size, - sc->vres.cq.start, sc->vres.cq.size); - /*TODO - CTR5(KTR_IW_CXGBE, "%s udb %pR db_reg %p gts_reg %p" - "qpmask 0x%x cqmask 0x%x", __func__, - db_reg,gts_reg,rdev->qpmask, rdev->cqmask); - */ - - if (c4iw_num_stags(rdev) == 0) { rc = -EINVAL; goto err1; @@ -233,11 +216,6 @@ c4iw_alloc(struct adapter *sc) iwsc->rdev.adap = sc; /* init various hw-queue params based on lld info */ - CTR3(KTR_IW_CXGBE, "%s: Ing. padding boundary is %d, " - "egrsstatuspagesize = %d", __func__, - sc->params.sge.pad_boundary, - sc->params.sge.spg_len); - iwsc->rdev.hw_queue.t4_eq_status_entries = sc->params.sge.spg_len / EQ_ESIZE; iwsc->rdev.hw_queue.t4_max_eq_size = 65520; Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Mon Apr 29 19:47:21 2019 (r346922) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Mon Apr 29 20:10:28 2019 (r346923) @@ -68,6 +68,9 @@ #define KTR_IW_CXGBE KTR_SPARE3 extern int c4iw_debug; +extern int use_dsgl; +extern int inline_threshold; + #define PDBG(fmt, args...) \ do { \ if (c4iw_debug) \ Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/mem.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/mem.c Mon Apr 29 19:47:21 2019 (r346922) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/mem.c Mon Apr 29 20:10:28 2019 (r346923) @@ -43,9 +43,9 @@ __FBSDID("$FreeBSD$"); #include #include "iw_cxgbe.h" -int use_dsgl = 1; #define T4_ULPTX_MIN_IO 32 #define C4IW_MAX_INLINE_SIZE 96 +#define T4_ULPTX_MAX_DMA 1024 static int mr_exceeds_hw_limits(struct c4iw_dev *dev, u64 length) @@ -55,10 +55,60 @@ mr_exceeds_hw_limits(struct c4iw_dev *dev, u64 length) } static int -write_adapter_mem(struct c4iw_rdev *rdev, u32 addr, u32 len, void *data) +_c4iw_write_mem_dma_aligned(struct c4iw_rdev *rdev, u32 addr, u32 len, + void *data, int wait) { struct adapter *sc = rdev->adap; struct ulp_mem_io *ulpmc; + struct ulptx_sgl *sgl; + u8 wr_len; + int ret = 0; + struct c4iw_wr_wait wr_wait; + struct wrqe *wr; + + addr &= 0x7FFFFFF; + + if (wait) + c4iw_init_wr_wait(&wr_wait); + wr_len = roundup(sizeof *ulpmc + sizeof *sgl, 16); + + wr = alloc_wrqe(wr_len, &sc->sge.ctrlq[0]); + if (wr == NULL) + return -ENOMEM; + ulpmc = wrtod(wr); + + memset(ulpmc, 0, wr_len); + INIT_ULPTX_WR(ulpmc, wr_len, 0, 0); + ulpmc->wr.wr_hi = cpu_to_be32(V_FW_WR_OP(FW_ULPTX_WR) | + (wait ? F_FW_WR_COMPL : 0)); + ulpmc->wr.wr_lo = wait ? (u64)(unsigned long)&wr_wait : 0; + ulpmc->wr.wr_mid = cpu_to_be32(V_FW_WR_LEN16(DIV_ROUND_UP(wr_len, 16))); + ulpmc->cmd = cpu_to_be32(V_ULPTX_CMD(ULP_TX_MEM_WRITE) | + V_T5_ULP_MEMIO_ORDER(1) | + V_T5_ULP_MEMIO_FID(sc->sge.ofld_rxq[0].iq.abs_id)); + ulpmc->dlen = cpu_to_be32(V_ULP_MEMIO_DATA_LEN(len>>5)); + ulpmc->len16 = cpu_to_be32(DIV_ROUND_UP(wr_len-sizeof(ulpmc->wr), 16)); + ulpmc->lock_addr = cpu_to_be32(V_ULP_MEMIO_ADDR(addr)); + + sgl = (struct ulptx_sgl *)(ulpmc + 1); + sgl->cmd_nsge = cpu_to_be32(V_ULPTX_CMD(ULP_TX_SC_DSGL) | + V_ULPTX_NSGE(1)); + sgl->len0 = cpu_to_be32(len); + sgl->addr0 = cpu_to_be64((u64)data); + + t4_wrq_tx(sc, wr); + + if (wait) + ret = c4iw_wait_for_reply(rdev, &wr_wait, 0, 0, NULL, __func__); + return ret; +} + + +static int +_c4iw_write_mem_inline(struct c4iw_rdev *rdev, u32 addr, u32 len, void *data) +{ + struct adapter *sc = rdev->adap; + struct ulp_mem_io *ulpmc; struct ulptx_idata *ulpsc; u8 wr_len, *to_dp, *from_dp; int copy_len, num_wqe, i, ret = 0; @@ -82,7 +132,7 @@ write_adapter_mem(struct c4iw_rdev *rdev, u32 addr, u3 wr = alloc_wrqe(wr_len, &sc->sge.ctrlq[0]); if (wr == NULL) - return (0); + return -ENOMEM; ulpmc = wrtod(wr); memset(ulpmc, 0, wr_len); @@ -91,7 +141,8 @@ write_adapter_mem(struct c4iw_rdev *rdev, u32 addr, u3 if (i == (num_wqe-1)) { ulpmc->wr.wr_hi = cpu_to_be32(V_FW_WR_OP(FW_ULPTX_WR) | F_FW_WR_COMPL); - ulpmc->wr.wr_lo = (__force __be64)(unsigned long) &wr_wait; + ulpmc->wr.wr_lo = + (__force __be64)(unsigned long) &wr_wait; } else ulpmc->wr.wr_hi = cpu_to_be32(V_FW_WR_OP(FW_ULPTX_WR)); ulpmc->wr.wr_mid = cpu_to_be32( @@ -124,6 +175,69 @@ write_adapter_mem(struct c4iw_rdev *rdev, u32 addr, u3 ret = c4iw_wait_for_reply(rdev, &wr_wait, 0, 0, NULL, __func__); return ret; } + +static int +_c4iw_write_mem_dma(struct c4iw_rdev *rdev, u32 addr, u32 len, void *data) +{ + struct c4iw_dev *rhp = rdev_to_c4iw_dev(rdev); + u32 remain = len; + u32 dmalen; + int ret = 0; + dma_addr_t daddr; + dma_addr_t save; + + daddr = dma_map_single(rhp->ibdev.dma_device, data, len, DMA_TO_DEVICE); + if (dma_mapping_error(rhp->ibdev.dma_device, daddr)) + return -1; + save = daddr; + + while (remain > inline_threshold) { + if (remain < T4_ULPTX_MAX_DMA) { + if (remain & ~T4_ULPTX_MIN_IO) + dmalen = remain & ~(T4_ULPTX_MIN_IO-1); + else + dmalen = remain; + } else + dmalen = T4_ULPTX_MAX_DMA; + remain -= dmalen; + ret = _c4iw_write_mem_dma_aligned(rdev, addr, dmalen, + (void *)daddr, !remain); + if (ret) + goto out; + addr += dmalen >> 5; + data = (u64 *)data + dmalen; + daddr = daddr + dmalen; + } + if (remain) + ret = _c4iw_write_mem_inline(rdev, addr, remain, data); +out: + dma_unmap_single(rhp->ibdev.dma_device, save, len, DMA_TO_DEVICE); + return ret; +} + +/* + * write len bytes of data into addr (32B aligned address) + * If data is NULL, clear len byte of memory to zero. + */ +static int +write_adapter_mem(struct c4iw_rdev *rdev, u32 addr, u32 len, + void *data) +{ + if (rdev->adap->params.ulptx_memwrite_dsgl && use_dsgl) { + if (len > inline_threshold) { + if (_c4iw_write_mem_dma(rdev, addr, len, data)) { + log(LOG_ERR, "%s: dma map " + "failure (non fatal)\n", __func__); + return _c4iw_write_mem_inline(rdev, addr, len, + data); + } else + return 0; + } else + return _c4iw_write_mem_inline(rdev, addr, len, data); + } else + return _c4iw_write_mem_inline(rdev, addr, len, data); +} + /* * Build and write a TPT entry. Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/provider.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/provider.c Mon Apr 29 19:47:21 2019 (r346922) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/provider.c Mon Apr 29 20:10:28 2019 (r346923) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include "iw_cxgbe.h" #include "user.h" -extern int use_dsgl; + static int fastreg_support = 1; module_param(fastreg_support, int, 0644); MODULE_PARM_DESC(fastreg_support, "Advertise fastreg support (default = 1)"); Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c Mon Apr 29 19:47:21 2019 (r346922) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c Mon Apr 29 20:10:28 2019 (r346923) @@ -63,7 +63,7 @@ struct cpl_set_tcb_rpl; #include "iw_cxgbe.h" #include "user.h" -extern int use_dsgl; + static int creds(struct toepcb *toep, struct inpcb *inp, size_t wrsize); static int max_fr_immd = T4_MAX_FR_IMMD;//SYSCTL parameter later... @@ -574,7 +574,7 @@ static void free_qp_work(struct work_struct *work) ucontext = qhp->ucontext; rhp = qhp->rhp; - CTR3(KTR_IW_CXGBE, "%s qhp %p ucontext %p\n", __func__, + CTR3(KTR_IW_CXGBE, "%s qhp %p ucontext %p", __func__, qhp, ucontext); destroy_qp(&rhp->rdev, &qhp->wq, ucontext ? &ucontext->uctx : &rhp->rdev.uctx); @@ -1473,6 +1473,22 @@ int c4iw_modify_qp(struct c4iw_dev *rhp, struct c4iw_q if (qhp->attr.state == attrs->next_state) goto out; + /* Return EINPROGRESS if QP is already in transition state. + * Eg: CLOSING->IDLE transition or *->ERROR transition. + * This can happen while connection is switching(due to rdma_fini) + * from iWARP/RDDP to TOE mode and any inflight RDMA RX data will + * reach TOE driver -> TCP stack -> iWARP driver. In this way + * iWARP driver keep receiving inflight RDMA RX data until socket + * is closed or aborted. And if iWARP CM is in FPDU sate, then + * it tries to put QP in TERM state and disconnects endpoint. + * But as QP is already in transition state, this event is ignored. + */ + if ((qhp->attr.state >= C4IW_QP_STATE_ERROR) && + (attrs->next_state == C4IW_QP_STATE_TERMINATE)) { + ret = -EINPROGRESS; + goto out; + } + switch (qhp->attr.state) { case C4IW_QP_STATE_IDLE: switch (attrs->next_state) { @@ -1860,10 +1876,10 @@ c4iw_create_qp(struct ib_pd *pd, struct ib_qp_init_att qhp->ibqp.qp_num = qhp->wq.sq.qid; init_timer(&(qhp->timer)); - CTR5(KTR_IW_CXGBE, "%s sq id %u size %u memsize %zu num_entries %u\n", + CTR5(KTR_IW_CXGBE, "%s sq id %u size %u memsize %zu num_entries %u", __func__, qhp->wq.sq.qid, qhp->wq.sq.size, qhp->wq.sq.memsize, attrs->cap.max_send_wr); - CTR5(KTR_IW_CXGBE, "%s rq id %u size %u memsize %zu num_entries %u\n", + CTR5(KTR_IW_CXGBE, "%s rq id %u size %u memsize %zu num_entries %u", __func__, qhp->wq.rq.qid, qhp->wq.rq.size, qhp->wq.rq.memsize, attrs->cap.max_recv_wr); return &qhp->ibqp; Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/t4.h ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/t4.h Mon Apr 29 19:47:21 2019 (r346922) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/t4.h Mon Apr 29 20:10:28 2019 (r346923) @@ -488,13 +488,13 @@ t4_ring_sq_db(struct t4_wq *wq, u16 inc, union t4_wr * /* Flush host queue memory writes. */ wmb(); if (wc && inc == 1 && wq->sq.bar2_qid == 0 && wqe) { - CTR2(KTR_IW_CXGBE, "%s: WC wq->sq.pidx = %d\n", + CTR2(KTR_IW_CXGBE, "%s: WC wq->sq.pidx = %d", __func__, wq->sq.pidx); pio_copy((u64 __iomem *) ((u64)wq->sq.bar2_va + SGE_UDB_WCDOORBELL), (u64 *)wqe); } else { - CTR2(KTR_IW_CXGBE, "%s: DB wq->sq.pidx = %d\n", + CTR2(KTR_IW_CXGBE, "%s: DB wq->sq.pidx = %d", __func__, wq->sq.pidx); writel(V_PIDX_T5(inc) | V_QID(wq->sq.bar2_qid), (void __iomem *)((u64)wq->sq.bar2_va + @@ -513,12 +513,12 @@ t4_ring_rq_db(struct t4_wq *wq, u16 inc, union t4_recv /* Flush host queue memory writes. */ wmb(); if (wc && inc == 1 && wq->rq.bar2_qid == 0 && wqe) { - CTR2(KTR_IW_CXGBE, "%s: WC wq->rq.pidx = %d\n", + CTR2(KTR_IW_CXGBE, "%s: WC wq->rq.pidx = %d", __func__, wq->rq.pidx); pio_copy((u64 __iomem *)((u64)wq->rq.bar2_va + SGE_UDB_WCDOORBELL), (u64 *)wqe); } else { - CTR2(KTR_IW_CXGBE, "%s: DB wq->rq.pidx = %d\n", + CTR2(KTR_IW_CXGBE, "%s: DB wq->rq.pidx = %d", __func__, wq->rq.pidx); writel(V_PIDX_T5(inc) | V_QID(wq->rq.bar2_qid), (void __iomem *)((u64)wq->rq.bar2_va + @@ -602,7 +602,7 @@ static inline void t4_swcq_produce(struct t4_cq *cq) { cq->sw_in_use++; if (cq->sw_in_use == cq->size) { - CTR2(KTR_IW_CXGBE, "%s cxgb4 sw cq overflow cqid %u\n", + CTR2(KTR_IW_CXGBE, "%s cxgb4 sw cq overflow cqid %u", __func__, cq->cqid); cq->error = 1; BUG_ON(1); @@ -674,7 +674,7 @@ static inline int t4_next_hw_cqe(struct t4_cq *cq, str static inline struct t4_cqe *t4_next_sw_cqe(struct t4_cq *cq) { if (cq->sw_in_use == cq->size) { - CTR2(KTR_IW_CXGBE, "%s cxgb4 sw cq overflow cqid %u\n", + CTR2(KTR_IW_CXGBE, "%s cxgb4 sw cq overflow cqid %u", __func__, cq->cqid); cq->error = 1; BUG_ON(1); Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 19:47:21 2019 (r346922) +++ stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 20:10:28 2019 (r346923) @@ -3995,6 +3995,18 @@ get_params__post_init(struct adapter *sc) else sc->params.filter2_wr_support = 0; + /* + * Find out whether we're allowed to use the ULPTX MEMWRITE DSGL. + * This is queried separately for the same reason as other params above. + */ + param[0] = FW_PARAM_DEV(ULPTX_MEMWRITE_DSGL); + val[0] = 0; + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 1, param, val); + if (rc == 0) + sc->params.ulptx_memwrite_dsgl = val[0] != 0; + else + sc->params.ulptx_memwrite_dsgl = false; + /* get capabilites */ bzero(&caps, sizeof(caps)); caps.op_to_write = htobe32(V_FW_CMD_OP(FW_CAPS_CONFIG_CMD) | From owner-svn-src-all@freebsd.org Mon Apr 29 20:53:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2538D159DF9F; Mon, 29 Apr 2019 20:53:21 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0E7E74F24; Mon, 29 Apr 2019 20:53:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BDBD27781; Mon, 29 Apr 2019 20:53:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TKrK4x021769; Mon, 29 Apr 2019 20:53:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TKrKL3021768; Mon, 29 Apr 2019 20:53:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904292053.x3TKrKL3021768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 29 Apr 2019 20:53:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346927 - stable/11/sys/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/sys/conf X-SVN-Commit-Revision: 346927 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C0E7E74F24 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 20:53:21 -0000 Author: ngie Date: Mon Apr 29 20:53:20 2019 New Revision: 346927 URL: https://svnweb.freebsd.org/changeset/base/346927 Log: MFC r345351: r345351 (by bdrewery): Build common kernel dependencies before modules. This ensures files like genassym.o and awk/mfiles are generated before descending into the modules build. It may also allow some module builds to not recreate files that are already present in the KERNBUILDDIR. This fixes a rare build race where genassym.o is missing and assym.inc is empty. More work is planned around this to reduce some redundant dependency generation in modules. PR: 233339 Modified: stable/11/sys/conf/kern.post.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/kern.post.mk ============================================================================== --- stable/11/sys/conf/kern.post.mk Mon Apr 29 20:21:38 2019 (r346926) +++ stable/11/sys/conf/kern.post.mk Mon Apr 29 20:53:20 2019 (r346927) @@ -111,6 +111,8 @@ kernel-obj: .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists($S/modules) modules: modules-all +modules-depend: beforebuild +modules-all: beforebuild .if !defined(NO_MODULES_OBJ) modules-all modules-depend: modules-obj From owner-svn-src-all@freebsd.org Mon Apr 29 21:14:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4802B159E443; Mon, 29 Apr 2019 21:14:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2C5275978; Mon, 29 Apr 2019 21:14:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id E82B411244; Mon, 29 Apr 2019 21:14:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en To: slavash@FreeBSD.org, Hans Petter Selasky , "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051425.wB5EP38T004562@repo.freebsd.org> <7cea5305-4136-a0b6-487b-51307b1c6db9@FreeBSD.org> <123654bf-59f7-1db8-55ce-36306bdac43d@FreeBSD.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <67b638e0-8e6f-f960-b263-62eed8ce28b7@FreeBSD.org> Date: Mon, 29 Apr 2019 14:14:19 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <123654bf-59f7-1db8-55ce-36306bdac43d@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: E2C5275978 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.92)[-0.918,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 21:14:23 -0000 On 4/25/19 12:10 AM, Slava Shwartsman wrote: > > > On 17-Apr-19 00:28, John Baldwin wrote: >> On 4/16/19 8:32 AM, Hans Petter Selasky wrote: >>> On 4/16/19 4:39 PM, Andrey V. Elsukov wrote: >>>> On 05.12.2018 17:25, Slava Shwartsman wrote: >>>>> Author: slavash >>>>> Date: Wed Dec 5 14:25:03 2018 >>>>> New Revision: 341586 >>>>> URL: https://svnweb.freebsd.org/changeset/base/341586 >>>>> >>>>> Log: >>>>> mlx5en: Implement backpressure indication. >>>>> >>>>> The backpressure indication is implemented using an unlimited rate type of >>>>> mbuf send tag. When the upper layers typically the socket layer has obtained such >>>>> a tag, it can then query the destination driver queue for the current >>>>> amount of space available in the send queue. >>>>> >>>>> A single mbuf send tag may be referenced multiple times and a refcount has been added >>>>> to the mlx5e_priv structure to track its usage. Because the send tag resides >>>>> in the mlx5e_channel structure, there is no need to wait for refcounts to reach >>>>> zero until the mlx4en(4) driver is detached. The channels structure is persistant >>>>> during the lifetime of the mlx5en(4) driver it belongs to and can so be accessed >>>>> without any need of synchronization. >>>>> >>>>> The mlx5e_snd_tag structure was extended to contain a type field, because there are now >>>>> two different tag types which end up in the driver which need to be distinguished. >>>>> >>>>> Submitted by: hselasky@ >>>>> Approved by: hselasky (mentor) >>>>> MFC after: 1 week >>>>> Sponsored by: Mellanox Technologies >>>>> @@ -587,27 +609,33 @@ mlx5e_xmit(struct ifnet *ifp, struct mbuf *mb) >>>>> struct mlx5e_sq *sq; >>>>> int ret; >>>>> >>>>> - sq = mlx5e_select_queue(ifp, mb); >>>>> - if (unlikely(sq == NULL)) { >>>>> -#ifdef RATELIMIT >>>>> - /* Check for route change */ >>>>> - if (mb->m_pkthdr.snd_tag != NULL && >>>>> - mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>> + if (mb->m_pkthdr.snd_tag != NULL) { >>>>> + sq = mlx5e_select_queue_by_send_tag(ifp, mb); >>>>> + if (unlikely(sq == NULL)) { >>>>> + /* Check for route change */ >>>>> + if (mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>> + /* Free mbuf */ >>>>> + m_freem(mb); >>>>> + >>>>> + /* >>>>> + * Tell upper layers about route >>>>> + * change and to re-transmit this >>>>> + * packet: >>>>> + */ >>>>> + return (EAGAIN); >>>>> + } >>>> >>>> Hi, >>>> >>>> I just discovered something strange and found that this commit is the >>>> cause. >>>> The test system has mlx5en 100G interface. It has two vlans: vlan500 and >>>> vlan100. >>>> Via vlan500 it receives some packets flows. Then it routes these packets >>>> into vlan100. >>>> But packets are dropped in mlx5e_xmit() with EAGAIN error code. >>>> >>>> # dtrace -n 'fbt::ip6_output:return {printf("%d", arg1);}' >>>> dtrace: description 'fbt::ip6_output:return ' matched 1 probe >>>> CPU ID FUNCTION:NAME >>>> 23 54338 ip6_output:return 35 >>>> 16 54338 ip6_output:return 35 >>>> 21 54338 ip6_output:return 35 >>>> 22 54338 ip6_output:return 35 >>>> 24 54338 ip6_output:return 35 >>>> 23 54338 ip6_output:return 35 >>>> 14 54338 ip6_output:return 35 >>>> ^C >>>> >>>> # dtrace -n 'fbt::mlx5e_xmit:return {printf("%d", arg1);}' >>>> dtrace: description 'fbt::mlx5e_xmit:return ' matched 1 probe >>>> CPU ID FUNCTION:NAME >>>> 16 69030 mlx5e_xmit:return 35 >>>> 23 69030 mlx5e_xmit:return 35 >>>> 26 69030 mlx5e_xmit:return 35 >>>> 25 69030 mlx5e_xmit:return 35 >>>> 24 69030 mlx5e_xmit:return 35 >>>> 21 69030 mlx5e_xmit:return 35 >>>> 26 69030 mlx5e_xmit:return 35 >>>> ^C >>>> >>>> The kernel config is GENERIC. >>>> 13.0-CURRENT #9 r345758+82f3d57(svn_head)-dirty >>>> >>> >>> Hi, >>> >>> This might be a case where rcvif in the mbuf's pktheader is not cleared >>> before the packet is fed back on the wire. >>> >>> John Baldwin is working on the send tags implementation, to eliminate >>> the EAGAIN handling in the network drivers. >> >> I will try to push this branch sooner then since it affects more than just >> TLS. Part of the change includes a new flag we can use to assert that we > Thanks John! >> aren't just getting a stale rcvif (though there are also now assertions in >> ip_output that should catch this case I think). >> > > > > Hi Andrey, > > Yes, we were able to reproduce this issue in house. If you don't mind, I > prefer to wait for John's update - where he eliminates the EAGAIN > handling in the network drivers. I have rebased the branch for this, but for now it will just panic sooner I believe by tripping an assertion. Can you grab the diff (or just the branch) from the 'send_tags' branch at github/bsdjhb/freebsd and reproduce under a kernel with INVARIANTS? I think we will have to explicitly clear the 'rcvif' pointer somewhere, but I want to see what the stack trace looks like so I can think about the "right" place to clear it. -- John Baldwin From owner-svn-src-all@freebsd.org Mon Apr 29 21:34:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 954AA159E9DB; Mon, 29 Apr 2019 21:34:25 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31A80767B8; Mon, 29 Apr 2019 21:34:25 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03BAA27E8F; Mon, 29 Apr 2019 21:34:25 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TLYOJ5043083; Mon, 29 Apr 2019 21:34:24 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TLYOcG043081; Mon, 29 Apr 2019 21:34:24 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904292134.x3TLYOcG043081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 21:34:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346928 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346928 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 31A80767B8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 21:34:25 -0000 Author: np Date: Mon Apr 29 21:34:24 2019 New Revision: 346928 URL: https://svnweb.freebsd.org/changeset/base/346928 Log: MFC r339628, r339965 r339628: cxgbe(4): improve the accuracy of various TSO limits reported to the kernel. Sponsored by: Chelsio Communications r339965: cxgbe(4): Report a reasonable non-zero if_hw_tsomaxsegsize to the kernel. This reverts an accidental change that snuck in with r339628. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 20:53:20 2019 (r346927) +++ stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 21:34:24 2019 (r346928) @@ -114,6 +114,7 @@ enum { SGE_MAX_WR_NDESC = SGE_MAX_WR_LEN / EQ_ESIZE, /* max WR size in desc */ TX_SGL_SEGS = 39, TX_SGL_SEGS_TSO = 38, + TX_SGL_SEGS_EO_TSO = 30, /* XXX: lower for IPv6. */ TX_WR_FLITS = SGE_MAX_WR_LEN / 8 }; Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 20:53:20 2019 (r346927) +++ stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 21:34:24 2019 (r346928) @@ -60,6 +60,8 @@ __FBSDID("$FreeBSD$"); #ifdef RSS #include #endif +#include +#include #if defined(__i386__) || defined(__amd64__) #include #include @@ -1607,8 +1609,12 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO | CSUM_UDP_IPV6 | CSUM_TCP_IPV6; - ifp->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); - ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS; + ifp->if_hw_tsomax = IP_MAXPACKET; + ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS_TSO; +#ifdef RATELIMIT + if (is_ethoffload(vi->pi->adapter) && vi->nofldtxq != 0) + ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS_EO_TSO; +#endif ifp->if_hw_tsomaxsegsize = 65536; ether_ifattach(ifp, vi->hw_addr); From owner-svn-src-all@freebsd.org Mon Apr 29 21:39:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00B1A159EAA5; Mon, 29 Apr 2019 21:39:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 978477695A; Mon, 29 Apr 2019 21:39:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FBA227E92; Mon, 29 Apr 2019 21:39:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TLd97A043333; Mon, 29 Apr 2019 21:39:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TLd9eP043332; Mon, 29 Apr 2019 21:39:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201904292139.x3TLd9eP043332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 29 Apr 2019 21:39:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346929 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 346929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 978477695A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 21:39:10 -0000 Author: jhb Date: Mon Apr 29 21:39:09 2019 New Revision: 346929 URL: https://svnweb.freebsd.org/changeset/base/346929 Log: MFC 345041: Update ccr(4) to note recent support for SHA2-224 and plain SHA hashes. Modified: stable/12/share/man/man4/ccr.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/ccr.4 ============================================================================== --- stable/12/share/man/man4/ccr.4 Mon Apr 29 21:34:24 2019 (r346928) +++ stable/12/share/man/man4/ccr.4 Mon Apr 29 21:39:09 2019 (r346929) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2017 +.Dd March 11, 2019 .Dt CCR 4 .Os .Sh NAME @@ -49,13 +49,14 @@ The .Nm driver provides support for the crypto accelerator engine included on PCI Express Ethernet adapters based on the Chelsio Terminator 6 ASIC (T6). -The driver accelerates AES-CBC, AES-CTR, AES-GCM, AES-XTS, SHA1-HMAC, +The driver accelerates AES-CBC, AES-CTR, AES-GCM, AES-XTS, SHA1, SHA2-224, +SHA2-256, SHA2-384, SHA2-512, SHA1-HMAC, SHA2-224-HMAC, SHA2-256-HMAC, SHA2-384-HMAC, and SHA2-512-HMAC operations for .Xr crypto 4 and .Xr ipsec 4 . The driver also supports chaining one of AES-CBC, AES-CTR, or AES-XTS with -SHA1-HMAC, SHA2-256-HMAC, SHA2-384-HMAC, or SHA2-512-HMAC for +SHA1-HMAC, SHA2-224-HMAC, SHA2-256-HMAC, SHA2-384-HMAC, or SHA2-512-HMAC for encrypt-then-authenticate operations. For further hardware information and questions related to hardware requirements, see From owner-svn-src-all@freebsd.org Mon Apr 29 21:55:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DFB9159F06A; Mon, 29 Apr 2019 21:55:40 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF94277280; Mon, 29 Apr 2019 21:55:39 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3BD3238; Mon, 29 Apr 2019 21:55:39 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TLtdl4053443; Mon, 29 Apr 2019 21:55:39 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TLtd0Z053442; Mon, 29 Apr 2019 21:55:39 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904292155.x3TLtd0Z053442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 21:55:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346930 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346930 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CF94277280 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 21:55:40 -0000 Author: np Date: Mon Apr 29 21:55:39 2019 New Revision: 346930 URL: https://svnweb.freebsd.org/changeset/base/346930 Log: MFC r339700: cxgbe(4): new sysctl to display the start of the RSS region for a VI. dev...rss_base For example: dev.cc.0.rss_base: 0 dev.cc.1.rss_base: 128 dev.vcc.0.rss_base: 256 dev.vcc.1.rss_base: 384 Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 21:39:09 2019 (r346929) +++ stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 21:55:39 2019 (r346930) @@ -6140,6 +6140,8 @@ vi_sysctls(struct vi_info *vi) &vi->first_rxq, 0, "index of first rx queue"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_txq", CTLFLAG_RD, &vi->first_txq, 0, "index of first tx queue"); + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "rss_base", CTLFLAG_RD, NULL, + vi->rss_base, "start of RSS indirection table"); SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "rss_size", CTLFLAG_RD, NULL, vi->rss_size, "size of RSS indirection table"); From owner-svn-src-all@freebsd.org Mon Apr 29 22:00:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD8A2159F100; Mon, 29 Apr 2019 22:00:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 817257741A; Mon, 29 Apr 2019 22:00:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E9EF25B; Mon, 29 Apr 2019 22:00:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TM0kTN054462; Mon, 29 Apr 2019 22:00:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TM0k6f054461; Mon, 29 Apr 2019 22:00:46 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201904292200.x3TM0k6f054461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 29 Apr 2019 22:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346931 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 346931 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 817257741A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 22:00:47 -0000 Author: jhb Date: Mon Apr 29 22:00:45 2019 New Revision: 346931 URL: https://svnweb.freebsd.org/changeset/base/346931 Log: Note that ccr(4) now supports AES-CCM. Modified: head/share/man/man4/ccr.4 Modified: head/share/man/man4/ccr.4 ============================================================================== --- head/share/man/man4/ccr.4 Mon Apr 29 21:55:39 2019 (r346930) +++ head/share/man/man4/ccr.4 Mon Apr 29 22:00:45 2019 (r346931) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 11, 2019 +.Dd April 29, 2019 .Dt CCR 4 .Os .Sh NAME @@ -34,7 +34,7 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: -.Bd -ragged -offset indeunt +.Bd -ragged -offset indent .Cd "device ccr" .Ed .Pp @@ -49,7 +49,7 @@ The .Nm driver provides support for the crypto accelerator engine included on PCI Express Ethernet adapters based on the Chelsio Terminator 6 ASIC (T6). -The driver accelerates AES-CBC, AES-CTR, AES-GCM, AES-XTS, SHA1, SHA2-224, +The driver accelerates AES-CBC, AES-CCM, AES-CTR, AES-GCM, AES-XTS, SHA1, SHA2-224, SHA2-256, SHA2-384, SHA2-512, SHA1-HMAC, SHA2-224-HMAC, SHA2-256-HMAC, SHA2-384-HMAC, and SHA2-512-HMAC operations for .Xr crypto 4 From owner-svn-src-all@freebsd.org Mon Apr 29 22:04:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26902159F2FF; Mon, 29 Apr 2019 22:04:56 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 A6483777E1; Mon, 29 Apr 2019 22:04:55 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x435.google.com with SMTP id 188so5999860pfd.8; Mon, 29 Apr 2019 15:04:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=sYPi+o9H/z0dwCOGvXwgCQloLsCgDU1ABb0IXTLTego=; b=ODRiZ4S+sZTCZ38VYXKANUoQmUUv1gXXtmjMYyPOtFBl6m8ywbvqBXKl1VT826lQVN 2iMCs9uHCYzyTH0LE95GSFDmh+owzNprF8v0He6kIJp4UmalLE+iNc5nXxg6liZVGRXG 9zljoulITDQUHg9YfYGXHptdppj34dYl5Y/A576hM9DI466TtzhH7eWBybww6jQYwPdp w4VBVLKm1a6bl9QyG1/4WmHOOOFWKwF/Rxf6XPTR4DzzMMxfgU203ZweUyPb3D2nxpAI qR0okp9ejVbavDUk1QXmbfFu6Ix9uxaohUrI06Bd2atqZQxDVnPBWoLPZSNb+LlvV6m/ 1UCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=sYPi+o9H/z0dwCOGvXwgCQloLsCgDU1ABb0IXTLTego=; b=tG/5wZlC7m2Q3pNmvgTdQqXoraIfMwDzU0arpUlcG41YmkdoayhUx5P3wakoro5+J0 I8+7OzfDyFi+UWFt+531zzykl1QlyzTQDJcSVoPP0+PVlb3YOeD9jN+yEjqWrfL3lVof xG94kNAjB0N8ByHLCMoYHmzN/e3/6hxL3P8cLyZGLppI+8QJAE7a29NbiMQVp3VqmYhc AOp/DdybxHi0P4IRzkZcDy9HvO6OxsbZuPT5odikRsRg2+sGOQvXxddj/Fd7BjipIuFO ohmudsP0gIudrIHh9BQIPKl1O7F46Df/kAgRm4Qjgd9asGuox64RDRZZDARFnB/b/45/ ZBdw== X-Gm-Message-State: APjAAAUKe6rWvyowkqO/6bLMggmqOH+aCJjlXS8Vav7pL49K7KjC8fZY Ur6ar9Cf5hs//weWx37hz73MsHOO X-Google-Smtp-Source: APXvYqxbrZjdFyiXde1YLHsCaKtcges6G1QJ2/SufetJ5+kDbjjLSheheDSUOQ9BeiplOD1Q18aY1g== X-Received: by 2002:a65:64d3:: with SMTP id t19mr27046719pgv.57.1556575494013; Mon, 29 Apr 2019 15:04:54 -0700 (PDT) Received: from ?IPv6:2607:fb90:f2b:4107:b84d:cfff:19c5:bfd1? ([2607:fb90:f2b:4107:b84d:cfff:19c5:bfd1]) by smtp.gmail.com with ESMTPSA id 71sm91560146pfs.36.2019.04.29.15.04.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Apr 2019 15:04:53 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r346931 - head/share/man/man4 From: Enji Cooper X-Mailer: iPhone Mail (16E227) In-Reply-To: <201904292200.x3TM0k6f054461@repo.freebsd.org> Date: Mon, 29 Apr 2019 15:04:52 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <101FAB41-1F64-479C-81F7-6F5A1D1A0811@gmail.com> References: <201904292200.x3TM0k6f054461@repo.freebsd.org> To: John Baldwin X-Rspamd-Queue-Id: A6483777E1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.962,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 22:04:56 -0000 > On Apr 29, 2019, at 15:00, John Baldwin wrote: >=20 > Author: jhb > Date: Mon Apr 29 22:00:45 2019 > New Revision: 346931 > URL: https://svnweb.freebsd.org/changeset/base/346931 >=20 > Log: > Note that ccr(4) now supports AES-CCM. Hi John, Should this change be MFCed (including, just maybe the typo you fixed in= the mdoc)? Thank you :)! -Enji= From owner-svn-src-all@freebsd.org Mon Apr 29 22:05:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE2F0159F355; Mon, 29 Apr 2019 22:05:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D02B77921; Mon, 29 Apr 2019 22:05:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45F013F7; Mon, 29 Apr 2019 22:05:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TM5Rhq058463; Mon, 29 Apr 2019 22:05:27 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TM5Q7Z058461; Mon, 29 Apr 2019 22:05:26 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201904292205.x3TM5Q7Z058461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 29 Apr 2019 22:05:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346932 - head/sys/ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/ufs/ufs X-SVN-Commit-Revision: 346932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6D02B77921 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 22:05:28 -0000 Author: markj Date: Mon Apr 29 22:05:26 2019 New Revision: 346932 URL: https://svnweb.freebsd.org/changeset/base/346932 Log: Optimize lseek(SEEK_DATA) on UFS. This version fixes the problems identified in r345244. Reviewed by: kib MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19598 Modified: head/sys/ufs/ufs/ufs_bmap.c head/sys/ufs/ufs/ufs_extern.h head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ufs/ufs_bmap.c ============================================================================== --- head/sys/ufs/ufs/ufs_bmap.c Mon Apr 29 22:00:45 2019 (r346931) +++ head/sys/ufs/ufs/ufs_bmap.c Mon Apr 29 22:05:26 2019 (r346932) @@ -56,6 +56,9 @@ __FBSDID("$FreeBSD$"); #include #include +static ufs_lbn_t lbn_count(struct ufsmount *, int); +static int readindir(struct vnode *, ufs_lbn_t, ufs2_daddr_t, struct buf **); + /* * Bmap converts the logical block number of a file to its physical block * number on the disk. The conversion is done by using the logical block @@ -90,6 +93,51 @@ ufs_bmap(ap) return (error); } +static int +readindir(vp, lbn, daddr, bpp) + struct vnode *vp; + ufs_lbn_t lbn; + ufs2_daddr_t daddr; + struct buf **bpp; +{ + struct buf *bp; + struct mount *mp; + struct ufsmount *ump; + int error; + + mp = vp->v_mount; + ump = VFSTOUFS(mp); + + bp = getblk(vp, lbn, mp->mnt_stat.f_iosize, 0, 0, 0); + if ((bp->b_flags & B_CACHE) == 0) { + KASSERT(daddr != 0, + ("readindir: indirect block not in cache")); + + bp->b_blkno = blkptrtodb(ump, daddr); + bp->b_iocmd = BIO_READ; + bp->b_flags &= ~B_INVAL; + bp->b_ioflags &= ~BIO_ERROR; + vfs_busy_pages(bp, 0); + bp->b_iooffset = dbtob(bp->b_blkno); + bstrategy(bp); +#ifdef RACCT + if (racct_enable) { + PROC_LOCK(curproc); + racct_add_buf(curproc, bp, 0); + PROC_UNLOCK(curproc); + } +#endif + curthread->td_ru.ru_inblock++; + error = bufwait(bp); + if (error != 0) { + brelse(bp); + return (error); + } + } + *bpp = bp; + return (0); +} + /* * Indirect blocks are now on the vnode for the file. They are given negative * logical block numbers. Indirect blocks are addressed by the negative @@ -212,35 +260,10 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb) */ if (bp) bqrelse(bp); + error = readindir(vp, metalbn, daddr, &bp); + if (error != 0) + return (error); - bp = getblk(vp, metalbn, mp->mnt_stat.f_iosize, 0, 0, 0); - if ((bp->b_flags & B_CACHE) == 0) { -#ifdef INVARIANTS - if (!daddr) - panic("ufs_bmaparray: indirect block not in cache"); -#endif - bp->b_blkno = blkptrtodb(ump, daddr); - bp->b_iocmd = BIO_READ; - bp->b_flags &= ~B_INVAL; - bp->b_ioflags &= ~BIO_ERROR; - vfs_busy_pages(bp, 0); - bp->b_iooffset = dbtob(bp->b_blkno); - bstrategy(bp); -#ifdef RACCT - if (racct_enable) { - PROC_LOCK(curproc); - racct_add_buf(curproc, bp, 0); - PROC_UNLOCK(curproc); - } -#endif /* RACCT */ - curthread->td_ru.ru_inblock++; - error = bufwait(bp); - if (error) { - brelse(bp); - return (error); - } - } - if (I_IS_UFS1(ip)) { daddr = ((ufs1_daddr_t *)bp->b_data)[ap->in_off]; if (num == 1 && daddr && runp) { @@ -301,6 +324,111 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb) *bnp = -1; } return (0); +} + +static ufs_lbn_t +lbn_count(ump, level) + struct ufsmount *ump; + int level; +{ + ufs_lbn_t blockcnt; + + for (blockcnt = 1; level > 0; level--) + blockcnt *= MNINDIR(ump); + return (blockcnt); +} + +int +ufs_bmap_seekdata(vp, offp) + struct vnode *vp; + off_t *offp; +{ + struct buf *bp; + struct indir a[UFS_NIADDR + 1], *ap; + struct inode *ip; + struct mount *mp; + struct ufsmount *ump; + ufs2_daddr_t bn, daddr, nextbn; + uint64_t bsize; + off_t numblks; + int error, num, num1, off; + + bp = NULL; + ip = VTOI(vp); + mp = vp->v_mount; + ump = VFSTOUFS(mp); + + if (vp->v_type != VREG || (ip->i_flags & SF_SNAPSHOT) != 0) + return (EINVAL); + if (*offp < 0 || *offp >= ip->i_size) + return (ENXIO); + + bsize = mp->mnt_stat.f_iosize; + for (bn = *offp / bsize, numblks = howmany(ip->i_size, bsize); + bn < numblks; bn = nextbn) { + if (bn < UFS_NDADDR) { + daddr = DIP(ip, i_db[bn]); + if (daddr != 0) + break; + nextbn = bn + 1; + continue; + } + + ap = a; + error = ufs_getlbns(vp, bn, ap, &num); + if (error != 0) + break; + MPASS(num >= 2); + daddr = DIP(ip, i_ib[ap->in_off]); + ap++, num--; + for (nextbn = UFS_NDADDR, num1 = num - 1; num1 > 0; num1--) + nextbn += lbn_count(ump, num1); + if (daddr == 0) { + nextbn += lbn_count(ump, num); + continue; + } + + for (; daddr != 0 && num > 0; ap++, num--) { + if (bp != NULL) + bqrelse(bp); + error = readindir(vp, ap->in_lbn, daddr, &bp); + if (error != 0) + return (error); + + /* + * Scan the indirect block until we find a non-zero + * pointer. + */ + off = ap->in_off; + do { + daddr = I_IS_UFS1(ip) ? + ((ufs1_daddr_t *)bp->b_data)[off] : + ((ufs2_daddr_t *)bp->b_data)[off]; + } while (daddr == 0 && ++off < MNINDIR(ump)); + nextbn += off * lbn_count(ump, num - 1); + + /* + * We need to recompute the LBNs of indirect + * blocks, so restart with the updated block offset. + */ + if (off != ap->in_off) + break; + } + if (num == 0) { + /* + * We found a data block. + */ + bn = nextbn; + break; + } + } + if (bp != NULL) + bqrelse(bp); + if (bn >= numblks) + error = ENXIO; + if (error == 0 && *offp < bn * bsize) + *offp = bn * bsize; + return (error); } /* Modified: head/sys/ufs/ufs/ufs_extern.h ============================================================================== --- head/sys/ufs/ufs/ufs_extern.h Mon Apr 29 22:00:45 2019 (r346931) +++ head/sys/ufs/ufs/ufs_extern.h Mon Apr 29 22:05:26 2019 (r346932) @@ -58,6 +58,7 @@ extern struct vop_vector ufs_vnodeops; int ufs_bmap(struct vop_bmap_args *); int ufs_bmaparray(struct vnode *, ufs2_daddr_t, ufs2_daddr_t *, struct buf *, int *, int *); +int ufs_bmap_seekdata(struct vnode *, off_t *); int ufs_fhtovp(struct mount *, struct ufid *, int, struct vnode **); int ufs_checkpath(ino_t, ino_t, struct inode *, struct ucred *, ino_t *); void ufs_dirbad(struct inode *, doff_t, char *); Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Mon Apr 29 22:00:45 2019 (r346931) +++ head/sys/ufs/ufs/ufs_vnops.c Mon Apr 29 22:05:26 2019 (r346932) @@ -2701,12 +2701,15 @@ bad: static int ufs_ioctl(struct vop_ioctl_args *ap) { + struct vnode *vp; + vp = ap->a_vp; switch (ap->a_command) { case FIOSEEKDATA: + return (ufs_bmap_seekdata(vp, (off_t *)ap->a_data)); case FIOSEEKHOLE: - return (vn_bmap_seekhole(ap->a_vp, ap->a_command, - (off_t *)ap->a_data, ap->a_cred)); + return (vn_bmap_seekhole(vp, ap->a_command, (off_t *)ap->a_data, + ap->a_cred)); default: return (ENOTTY); } From owner-svn-src-all@freebsd.org Mon Apr 29 22:14:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74A06159F736; Mon, 29 Apr 2019 22:14:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0EC0C80077; Mon, 29 Apr 2019 22:14:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4C392118F0; Mon, 29 Apr 2019 22:14:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r346931 - head/share/man/man4 To: Enji Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201904292200.x3TM0k6f054461@repo.freebsd.org> <101FAB41-1F64-479C-81F7-6F5A1D1A0811@gmail.com> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Mon, 29 Apr 2019 15:14:28 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <101FAB41-1F64-479C-81F7-6F5A1D1A0811@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 0EC0C80077 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.970,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 22:14:32 -0000 On 4/29/19 3:04 PM, Enji Cooper wrote: > >> On Apr 29, 2019, at 15:00, John Baldwin wrote: >> >> Author: jhb >> Date: Mon Apr 29 22:00:45 2019 >> New Revision: 346931 >> URL: https://svnweb.freebsd.org/changeset/base/346931 >> >> Log: >> Note that ccr(4) now supports AES-CCM. > > Hi John, > Should this change be MFCed (including, just maybe the typo you fixed in the mdoc)? > Thank you :)! Only when AES-CCM support is merged. -- John Baldwin From owner-svn-src-all@freebsd.org Mon Apr 29 22:15:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2EB8159F7BC; Mon, 29 Apr 2019 22:15:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88EC1801D7; Mon, 29 Apr 2019 22:15:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C3B85A4; Mon, 29 Apr 2019 22:15:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TMFqpO064157; Mon, 29 Apr 2019 22:15:52 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TMFqaF064156; Mon, 29 Apr 2019 22:15:52 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201904292215.x3TMFqaF064156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 29 Apr 2019 22:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346933 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 346933 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 88EC1801D7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 22:15:53 -0000 Author: jhb Date: Mon Apr 29 22:15:51 2019 New Revision: 346933 URL: https://svnweb.freebsd.org/changeset/base/346933 Log: Rewrap some long lines. Whitespace only change. Modified: head/share/man/man4/ccr.4 Modified: head/share/man/man4/ccr.4 ============================================================================== --- head/share/man/man4/ccr.4 Mon Apr 29 22:05:26 2019 (r346932) +++ head/share/man/man4/ccr.4 Mon Apr 29 22:15:51 2019 (r346933) @@ -49,9 +49,10 @@ The .Nm driver provides support for the crypto accelerator engine included on PCI Express Ethernet adapters based on the Chelsio Terminator 6 ASIC (T6). -The driver accelerates AES-CBC, AES-CCM, AES-CTR, AES-GCM, AES-XTS, SHA1, SHA2-224, -SHA2-256, SHA2-384, SHA2-512, SHA1-HMAC, SHA2-224-HMAC, -SHA2-256-HMAC, SHA2-384-HMAC, and SHA2-512-HMAC operations for +The driver accelerates AES-CBC, AES-CCM, AES-CTR, AES-GCM, AES-XTS, +SHA1, SHA2-224, SHA2-256, SHA2-384, SHA2-512, +SHA1-HMAC, SHA2-224-HMAC, SHA2-256-HMAC, SHA2-384-HMAC, and SHA2-512-HMAC +operations for .Xr crypto 4 and .Xr ipsec 4 . From owner-svn-src-all@freebsd.org Mon Apr 29 22:16:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8250159F826; Mon, 29 Apr 2019 22:16:35 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B02880320; Mon, 29 Apr 2019 22:16:35 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57E975A5; Mon, 29 Apr 2019 22:16:35 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TMGZVx064237; Mon, 29 Apr 2019 22:16:35 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TMGXZc064226; Mon, 29 Apr 2019 22:16:33 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904292216.x3TMGXZc064226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 29 Apr 2019 22:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346934 - in stable/11/sys: conf dev/cxgbe dev/cxgbe/tom modules/cxgbe/if_cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys: conf dev/cxgbe dev/cxgbe/tom modules/cxgbe/if_cxgbe X-SVN-Commit-Revision: 346934 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6B02880320 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 22:16:36 -0000 Author: np Date: Mon Apr 29 22:16:33 2019 New Revision: 346934 URL: https://svnweb.freebsd.org/changeset/base/346934 Log: MFC r341172, r341270. t4_clip.c had to be manually adjusted because Concurrency Kit is not available in stable/11. r341172: Move CLIP table handling out of TOM and into the base driver. - Store the clip table in 'struct adapter' instead of in the TOM softc. - Init the clip table during attach and teardown during detach. - While here, add a dev...misc.clip sysctl to dump the CLIP table. This does mean that we update the clip table even if TOE is not enabled, but non-TOE things need the CLIP table anyway. Reviewed by: np, Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D18010 r341270: Make most of the CLIP code conditional on #ifdef INET6. This fixes builds of kernels without INET6 such as LINT-NOINET6. Reported by: arybchik Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D18384 Added: stable/11/sys/dev/cxgbe/t4_clip.c - copied, changed from r341172, head/sys/dev/cxgbe/t4_clip.c stable/11/sys/dev/cxgbe/t4_clip.h - copied unchanged from r341172, head/sys/dev/cxgbe/t4_clip.h Modified: stable/11/sys/conf/files stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/cxgbe/tom/t4_connect.c stable/11/sys/dev/cxgbe/tom/t4_listen.c stable/11/sys/dev/cxgbe/tom/t4_tom.c stable/11/sys/dev/cxgbe/tom/t4_tom.h stable/11/sys/modules/cxgbe/if_cxgbe/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Mon Apr 29 22:15:51 2019 (r346933) +++ stable/11/sys/conf/files Mon Apr 29 22:16:33 2019 (r346934) @@ -1330,6 +1330,8 @@ dev/cxgb/sys/uipc_mvec.c optional cxgb pci \ compile-with "${NORMAL_C} -I$S/dev/cxgb" dev/cxgb/cxgb_t3fw.c optional cxgb cxgb_t3fw \ compile-with "${NORMAL_C} -I$S/dev/cxgb" +dev/cxgbe/t4_clip.c optional cxgbe pci \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/t4_filter.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/t4_if.m optional cxgbe pci Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 22:15:51 2019 (r346933) +++ stable/11/sys/dev/cxgbe/adapter.h Mon Apr 29 22:16:33 2019 (r346934) @@ -765,6 +765,8 @@ struct devnames { const char *vf_ifnet_name; }; +struct clip_entry; + struct adapter { SLIST_ENTRY(adapter) link; device_t dev; @@ -810,6 +812,10 @@ struct adapter { struct taskqueue *tq[MAX_NCHAN]; /* General purpose taskqueues */ struct port_info *port[MAX_NPORTS]; uint8_t chan_map[MAX_NCHAN]; /* channel -> port */ + + struct mtx clip_table_lock; + TAILQ_HEAD(, clip_entry) clip_table; + int clip_gen; void *tom_softc; /* (struct tom_data *) */ struct tom_tunables tt; Copied and modified: stable/11/sys/dev/cxgbe/t4_clip.c (from r341172, head/sys/dev/cxgbe/t4_clip.c) ============================================================================== --- head/sys/dev/cxgbe/t4_clip.c Thu Nov 29 01:15:53 2018 (r341172, copy source) +++ stable/11/sys/dev/cxgbe/t4_clip.c Mon Apr 29 22:16:33 2019 (r346934) @@ -30,8 +30,10 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet.h" +#include "opt_inet6.h" + #include -#include #include #include #include @@ -47,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include "common/common.h" #include "t4_clip.h" +#if defined(INET6) static int add_lip(struct adapter *, struct in6_addr *); static int delete_lip(struct adapter *, struct in6_addr *); static struct clip_entry *search_lip(struct adapter *, struct in6_addr *); @@ -108,11 +111,13 @@ search_lip(struct adapter *sc, struct in6_addr *lip) return (NULL); } +#endif struct clip_entry * t4_hold_lip(struct adapter *sc, struct in6_addr *lip, struct clip_entry *ce) { +#ifdef INET6 mtx_lock(&sc->clip_table_lock); if (ce == NULL) ce = search_lip(sc, lip); @@ -121,12 +126,16 @@ t4_hold_lip(struct adapter *sc, struct in6_addr *lip, mtx_unlock(&sc->clip_table_lock); return (ce); +#else + return (NULL); +#endif } void t4_release_lip(struct adapter *sc, struct clip_entry *ce) { +#ifdef INET6 mtx_lock(&sc->clip_table_lock); KASSERT(search_lip(sc, &ce->lip) == ce, ("%s: CLIP entry %p p not in CLIP table.", __func__, ce)); @@ -134,8 +143,10 @@ t4_release_lip(struct adapter *sc, struct clip_entry * ("%s: CLIP entry %p has refcount 0", __func__, ce)); --ce->refcount; mtx_unlock(&sc->clip_table_lock); +#endif } +#ifdef INET6 void t4_init_clip_table(struct adapter *sc) { @@ -208,7 +219,7 @@ update_clip_table(struct adapter *sc) /* XXX: races with if_vmove */ CURVNET_SET(vi->ifp->if_vnet); - CK_STAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { + TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { lip = &ia->ia_addr.sin6_addr; KASSERT(!IN6_IS_ADDR_MULTICAST(lip), @@ -380,3 +391,4 @@ t4_clip_modunload(void) EVENTHANDLER_DEREGISTER(ifaddr_event, ifaddr_evhandler); taskqueue_cancel_timeout(taskqueue_thread, &clip_task, NULL); } +#endif Copied: stable/11/sys/dev/cxgbe/t4_clip.h (from r341172, head/sys/dev/cxgbe/t4_clip.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/cxgbe/t4_clip.h Mon Apr 29 22:16:33 2019 (r346934, copy of r341172, head/sys/dev/cxgbe/t4_clip.h) @@ -0,0 +1,51 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2012 Chelsio Communications, Inc. + * All rights reserved. + * Written by: Navdeep Parhar + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __T4_CLIP_H +#define __T4_CLIP_H + +struct clip_entry { + TAILQ_ENTRY(clip_entry) link; + struct in6_addr lip; /* local IPv6 address */ + u_int refcount; +}; + +void t4_clip_modload(void); +void t4_clip_modunload(void); +void t4_init_clip_table(struct adapter *); +void t4_destroy_clip_table(struct adapter *); +struct clip_entry *t4_hold_lip(struct adapter *, struct in6_addr *, + struct clip_entry *); +void t4_release_lip(struct adapter *, struct clip_entry *); + +int sysctl_clip(SYSCTL_HANDLER_ARGS); + +#endif /* __T4_CLIP_H */ Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 22:15:51 2019 (r346933) +++ stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 22:16:33 2019 (r346934) @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include "common/t4_regs.h" #include "common/t4_regs_values.h" #include "cudbg/cudbg.h" +#include "t4_clip.h" #include "t4_ioctl.h" #include "t4_l2t.h" #include "t4_mp_ring.h" @@ -1202,6 +1203,9 @@ t4_attach(device_t dev) t4_init_l2t(sc, M_WAITOK); t4_init_smt(sc, M_WAITOK); t4_init_tx_sched(sc); +#ifdef INET6 + t4_init_clip_table(sc); +#endif if (sc->vres.key.size != 0) sc->key_map = vmem_create("T4TLS key map", sc->vres.key.start, sc->vres.key.size, 32, 0, M_FIRSTFIT | M_WAITOK); @@ -1493,6 +1497,9 @@ t4_detach_common(device_t dev) vmem_destroy(sc->key_map); if (sc->smt) t4_free_smt(sc->smt); +#ifdef INET6 + t4_destroy_clip_table(sc); +#endif #ifdef TCP_OFFLOAD free(sc->sge.ofld_rxq, M_CXGBE); @@ -5927,6 +5934,12 @@ t4_sysctls(struct adapter *sc) CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_smt, "A", "hardware source MAC table"); +#ifdef INET6 + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "clip", + CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + sysctl_clip, "A", "active CLIP table entries"); +#endif + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "lb_stats", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_lb_stats, "A", "loopback statistics"); @@ -10491,6 +10504,9 @@ mod_event(module_t mod, int cmd, void *arg) sx_init(&t4_uld_list_lock, "T4/T5 ULDs"); SLIST_INIT(&t4_uld_list); #endif +#ifdef INET6 + t4_clip_modload(); +#endif t4_tracer_modload(); tweak_tunables(); } @@ -10530,6 +10546,9 @@ mod_event(module_t mod, int cmd, void *arg) if (t4_sge_extfree_refs() == 0) { t4_tracer_modunload(); +#ifdef INET6 + t4_clip_modunload(); +#endif #ifdef TCP_OFFLOAD sx_destroy(&t4_uld_list_lock); #endif Modified: stable/11/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_connect.c Mon Apr 29 22:15:51 2019 (r346933) +++ stable/11/sys/dev/cxgbe/tom/t4_connect.c Mon Apr 29 22:16:33 2019 (r346934) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include "common/t4_msg.h" #include "common/t4_regs.h" #include "common/t4_regs_values.h" +#include "t4_clip.h" #include "tom/t4_tom_l2t.h" #include "tom/t4_tom.h" @@ -313,7 +314,6 @@ t4_connect(struct toedev *tod, struct socket *so, stru struct sockaddr *nam) { struct adapter *sc = tod->tod_softc; - struct tom_data *td = tod_td(tod); struct toepcb *toep = NULL; struct wrqe *wr = NULL; struct ifnet *rt_ifp = rt->rt_ifp; @@ -404,7 +404,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru if ((inp->inp_vflag & INP_IPV6) == 0) DONT_OFFLOAD_ACTIVE_OPEN(ENOTSUP); - toep->ce = hold_lip(td, &inp->in6p_laddr, NULL); + toep->ce = t4_hold_lip(sc, &inp->in6p_laddr, NULL); if (toep->ce == NULL) DONT_OFFLOAD_ACTIVE_OPEN(ENOENT); @@ -491,7 +491,7 @@ failed: if (toep->l2te) t4_l2t_release(toep->l2te); if (toep->ce) - release_lip(td, toep->ce); + t4_release_lip(sc, toep->ce); free_toepcb(toep); } Modified: stable/11/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_listen.c Mon Apr 29 22:15:51 2019 (r346933) +++ stable/11/sys/dev/cxgbe/tom/t4_listen.c Mon Apr 29 22:16:33 2019 (r346934) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include "common/common.h" #include "common/t4_msg.h" #include "common/t4_regs.h" +#include "t4_clip.h" #include "tom/t4_tom_l2t.h" #include "tom/t4_tom.h" @@ -210,9 +211,7 @@ alloc_lctx(struct adapter *sc, struct inpcb *inp, stru if (inp->inp_vflag & INP_IPV6 && !IN6_ARE_ADDR_EQUAL(&in6addr_any, &inp->in6p_laddr)) { - struct tom_data *td = sc->tom_softc; - - lctx->ce = hold_lip(td, &inp->in6p_laddr, NULL); + lctx->ce = t4_hold_lip(sc, &inp->in6p_laddr, NULL); if (lctx->ce == NULL) { free(lctx, M_CXGBE); return (NULL); @@ -236,7 +235,6 @@ static int free_lctx(struct adapter *sc, struct listen_ctx *lctx) { struct inpcb *inp = lctx->inp; - struct tom_data *td = sc->tom_softc; INP_WLOCK_ASSERT(inp); KASSERT(lctx->refcount == 0, @@ -249,7 +247,7 @@ free_lctx(struct adapter *sc, struct listen_ctx *lctx) __func__, lctx->stid, lctx, lctx->inp); if (lctx->ce) - release_lip(td, lctx->ce); + t4_release_lip(sc, lctx->ce); free_stid(sc, lctx); free(lctx, M_CXGBE); @@ -1669,7 +1667,7 @@ reset: MPASS(so->so_vnet == lctx->vnet); toep->vnet = lctx->vnet; if (inc.inc_flags & INC_ISIPV6) - toep->ce = hold_lip(sc->tom_softc, &inc.inc6_laddr, lctx->ce); + toep->ce = t4_hold_lip(sc, &inc.inc6_laddr, lctx->ce); /* * This is for the unlikely case where the syncache entry that we added Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.c Mon Apr 29 22:15:51 2019 (r346933) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.c Mon Apr 29 22:16:33 2019 (r346934) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include "common/t4_regs.h" #include "common/t4_regs_values.h" #include "common/t4_tcb.h" +#include "t4_clip.h" #include "tom/t4_tom_l2t.h" #include "tom/t4_tom.h" #include "tom/t4_tls.h" @@ -96,21 +97,9 @@ static struct uld_info tom_uld_info = { static void release_offload_resources(struct toepcb *); static int alloc_tid_tabs(struct tid_info *); static void free_tid_tabs(struct tid_info *); -static int add_lip(struct adapter *, struct in6_addr *); -static int delete_lip(struct adapter *, struct in6_addr *); -static struct clip_entry *search_lip(struct tom_data *, struct in6_addr *); -static void init_clip_table(struct adapter *, struct tom_data *); -static void update_clip(struct adapter *, void *); -static void t4_clip_task(void *, int); -static void update_clip_table(struct adapter *, struct tom_data *); -static void destroy_clip_table(struct adapter *, struct tom_data *); static void free_tom_data(struct adapter *, struct tom_data *); static void reclaim_wr_resources(void *, int); -static int in6_ifaddr_gen; -static eventhandler_tag ifaddr_evhandler; -static struct timeout_task clip_task; - struct toepcb * alloc_toepcb(struct vi_info *vi, int txqid, int rxqid, int flags) { @@ -312,7 +301,7 @@ release_offload_resources(struct toepcb *toep) } if (toep->ce) - release_lip(td, toep->ce); + t4_release_lip(sc, toep->ce); if (toep->tc_idx != -1) t4_release_cl_rl(sc, toep->vi->pi->port_id, toep->tc_idx); @@ -817,267 +806,7 @@ failed: return (rc); } -static int -add_lip(struct adapter *sc, struct in6_addr *lip) -{ - struct fw_clip_cmd c; - - ASSERT_SYNCHRONIZED_OP(sc); - /* mtx_assert(&td->clip_table_lock, MA_OWNED); */ - - memset(&c, 0, sizeof(c)); - c.op_to_write = htonl(V_FW_CMD_OP(FW_CLIP_CMD) | F_FW_CMD_REQUEST | - F_FW_CMD_WRITE); - c.alloc_to_len16 = htonl(F_FW_CLIP_CMD_ALLOC | FW_LEN16(c)); - c.ip_hi = *(uint64_t *)&lip->s6_addr[0]; - c.ip_lo = *(uint64_t *)&lip->s6_addr[8]; - - return (-t4_wr_mbox_ns(sc, sc->mbox, &c, sizeof(c), &c)); -} - -static int -delete_lip(struct adapter *sc, struct in6_addr *lip) -{ - struct fw_clip_cmd c; - - ASSERT_SYNCHRONIZED_OP(sc); - /* mtx_assert(&td->clip_table_lock, MA_OWNED); */ - - memset(&c, 0, sizeof(c)); - c.op_to_write = htonl(V_FW_CMD_OP(FW_CLIP_CMD) | F_FW_CMD_REQUEST | - F_FW_CMD_READ); - c.alloc_to_len16 = htonl(F_FW_CLIP_CMD_FREE | FW_LEN16(c)); - c.ip_hi = *(uint64_t *)&lip->s6_addr[0]; - c.ip_lo = *(uint64_t *)&lip->s6_addr[8]; - - return (-t4_wr_mbox_ns(sc, sc->mbox, &c, sizeof(c), &c)); -} - -static struct clip_entry * -search_lip(struct tom_data *td, struct in6_addr *lip) -{ - struct clip_entry *ce; - - mtx_assert(&td->clip_table_lock, MA_OWNED); - - TAILQ_FOREACH(ce, &td->clip_table, link) { - if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) - return (ce); - } - - return (NULL); -} - -struct clip_entry * -hold_lip(struct tom_data *td, struct in6_addr *lip, struct clip_entry *ce) -{ - - mtx_lock(&td->clip_table_lock); - if (ce == NULL) - ce = search_lip(td, lip); - if (ce != NULL) - ce->refcount++; - mtx_unlock(&td->clip_table_lock); - - return (ce); -} - -void -release_lip(struct tom_data *td, struct clip_entry *ce) -{ - - mtx_lock(&td->clip_table_lock); - KASSERT(search_lip(td, &ce->lip) == ce, - ("%s: CLIP entry %p p not in CLIP table.", __func__, ce)); - KASSERT(ce->refcount > 0, - ("%s: CLIP entry %p has refcount 0", __func__, ce)); - --ce->refcount; - mtx_unlock(&td->clip_table_lock); -} - static void -init_clip_table(struct adapter *sc, struct tom_data *td) -{ - - ASSERT_SYNCHRONIZED_OP(sc); - - mtx_init(&td->clip_table_lock, "CLIP table lock", NULL, MTX_DEF); - TAILQ_INIT(&td->clip_table); - td->clip_gen = -1; - - update_clip_table(sc, td); -} - -static void -update_clip(struct adapter *sc, void *arg __unused) -{ - - if (begin_synchronized_op(sc, NULL, HOLD_LOCK, "t4tomuc")) - return; - - if (uld_active(sc, ULD_TOM)) - update_clip_table(sc, sc->tom_softc); - - end_synchronized_op(sc, LOCK_HELD); -} - -static void -t4_clip_task(void *arg, int count) -{ - - t4_iterate(update_clip, NULL); -} - -static void -update_clip_table(struct adapter *sc, struct tom_data *td) -{ - struct rm_priotracker in6_ifa_tracker; - struct in6_ifaddr *ia; - struct in6_addr *lip, tlip; - struct clip_head stale; - struct clip_entry *ce, *ce_temp; - struct vi_info *vi; - int rc, gen, i, j; - uintptr_t last_vnet; - - ASSERT_SYNCHRONIZED_OP(sc); - - IN6_IFADDR_RLOCK(&in6_ifa_tracker); - mtx_lock(&td->clip_table_lock); - - gen = atomic_load_acq_int(&in6_ifaddr_gen); - if (gen == td->clip_gen) - goto done; - - TAILQ_INIT(&stale); - TAILQ_CONCAT(&stale, &td->clip_table, link); - - /* - * last_vnet optimizes the common cases where all if_vnet = NULL (no - * VIMAGE) or all if_vnet = vnet0. - */ - last_vnet = (uintptr_t)(-1); - for_each_port(sc, i) - for_each_vi(sc->port[i], j, vi) { - if (last_vnet == (uintptr_t)vi->ifp->if_vnet) - continue; - - /* XXX: races with if_vmove */ - CURVNET_SET(vi->ifp->if_vnet); - TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { - lip = &ia->ia_addr.sin6_addr; - - KASSERT(!IN6_IS_ADDR_MULTICAST(lip), - ("%s: mcast address in in6_ifaddr list", __func__)); - - if (IN6_IS_ADDR_LOOPBACK(lip)) - continue; - if (IN6_IS_SCOPE_EMBED(lip)) { - /* Remove the embedded scope */ - tlip = *lip; - lip = &tlip; - in6_clearscope(lip); - } - /* - * XXX: how to weed out the link local address for the - * loopback interface? It's fe80::1 usually (always?). - */ - - /* - * If it's in the main list then we already know it's - * not stale. - */ - TAILQ_FOREACH(ce, &td->clip_table, link) { - if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) - goto next; - } - - /* - * If it's in the stale list we should move it to the - * main list. - */ - TAILQ_FOREACH(ce, &stale, link) { - if (IN6_ARE_ADDR_EQUAL(&ce->lip, lip)) { - TAILQ_REMOVE(&stale, ce, link); - TAILQ_INSERT_TAIL(&td->clip_table, ce, - link); - goto next; - } - } - - /* A new IP6 address; add it to the CLIP table */ - ce = malloc(sizeof(*ce), M_CXGBE, M_NOWAIT); - memcpy(&ce->lip, lip, sizeof(ce->lip)); - ce->refcount = 0; - rc = add_lip(sc, lip); - if (rc == 0) - TAILQ_INSERT_TAIL(&td->clip_table, ce, link); - else { - char ip[INET6_ADDRSTRLEN]; - - inet_ntop(AF_INET6, &ce->lip, &ip[0], - sizeof(ip)); - log(LOG_ERR, "%s: could not add %s (%d)\n", - __func__, ip, rc); - free(ce, M_CXGBE); - } -next: - continue; - } - CURVNET_RESTORE(); - last_vnet = (uintptr_t)vi->ifp->if_vnet; - } - - /* - * Remove stale addresses (those no longer in V_in6_ifaddrhead) that are - * no longer referenced by the driver. - */ - TAILQ_FOREACH_SAFE(ce, &stale, link, ce_temp) { - if (ce->refcount == 0) { - rc = delete_lip(sc, &ce->lip); - if (rc == 0) { - TAILQ_REMOVE(&stale, ce, link); - free(ce, M_CXGBE); - } else { - char ip[INET6_ADDRSTRLEN]; - - inet_ntop(AF_INET6, &ce->lip, &ip[0], - sizeof(ip)); - log(LOG_ERR, "%s: could not delete %s (%d)\n", - __func__, ip, rc); - } - } - } - /* The ones that are still referenced need to stay in the CLIP table */ - TAILQ_CONCAT(&td->clip_table, &stale, link); - - td->clip_gen = gen; -done: - mtx_unlock(&td->clip_table_lock); - IN6_IFADDR_RUNLOCK(&in6_ifa_tracker); -} - -static void -destroy_clip_table(struct adapter *sc, struct tom_data *td) -{ - struct clip_entry *ce, *ce_temp; - - if (mtx_initialized(&td->clip_table_lock)) { - mtx_lock(&td->clip_table_lock); - TAILQ_FOREACH_SAFE(ce, &td->clip_table, link, ce_temp) { - KASSERT(ce->refcount == 0, - ("%s: CLIP entry %p still in use (%d)", __func__, - ce, ce->refcount)); - TAILQ_REMOVE(&td->clip_table, ce, link); - delete_lip(sc, &ce->lip); - free(ce, M_CXGBE); - } - mtx_unlock(&td->clip_table_lock); - mtx_destroy(&td->clip_table_lock); - } -} - -static void free_tom_data(struct adapter *sc, struct tom_data *td) { @@ -1089,7 +818,6 @@ free_tom_data(struct adapter *sc, struct tom_data *td) ("%s: lctx hash table is not empty.", __func__)); t4_free_ppod_region(&td->pr); - destroy_clip_table(sc, td); if (td->listen_mask != 0) hashdestroy(td->listen_hash, M_CXGBE, td->listen_mask); @@ -1364,9 +1092,6 @@ t4_tom_activate(struct adapter *sc) t4_set_reg_field(sc, A_ULP_RX_TDDP_TAGMASK, V_TDDPTAGMASK(M_TDDPTAGMASK), td->pr.pr_tag_mask); - /* CLIP table for IPv6 offload */ - init_clip_table(sc, td); - /* toedev ops */ tod = &td->tod; init_toedev(tod); @@ -1448,14 +1173,6 @@ t4_tom_deactivate(struct adapter *sc) return (rc); } -static void -t4_tom_ifaddr_event(void *arg __unused, struct ifnet *ifp) -{ - - atomic_add_rel_int(&in6_ifaddr_gen, 1); - taskqueue_enqueue_timeout(taskqueue_thread, &clip_task, -hz / 4); -} - static int t4_aio_queue_tom(struct socket *so, struct kaiocb *job) { @@ -1523,10 +1240,6 @@ t4_tom_mod_load(void) toe6_protosw.pr_ctloutput = t4_ctloutput_tom; toe6_protosw.pr_usrreqs = &toe6_usrreqs; - TIMEOUT_TASK_INIT(taskqueue_thread, &clip_task, 0, t4_clip_task, NULL); - ifaddr_evhandler = EVENTHANDLER_REGISTER(ifaddr_event, - t4_tom_ifaddr_event, NULL, EVENTHANDLER_PRI_ANY); - return (t4_register_uld(&tom_uld_info)); } @@ -1550,11 +1263,6 @@ t4_tom_mod_unload(void) if (t4_unregister_uld(&tom_uld_info) == EBUSY) return (EBUSY); - - if (ifaddr_evhandler) { - EVENTHANDLER_DEREGISTER(ifaddr_event, ifaddr_evhandler); - taskqueue_cancel_timeout(taskqueue_thread, &clip_task, NULL); - } t4_tls_mod_unload(); t4_ddp_mod_unload(); Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.h Mon Apr 29 22:15:51 2019 (r346933) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.h Mon Apr 29 22:16:33 2019 (r346934) @@ -257,13 +257,6 @@ struct listen_ctx { TAILQ_HEAD(, synq_entry) synq; }; -struct clip_entry { - TAILQ_ENTRY(clip_entry) link; - struct in6_addr lip; /* local IPv6 address */ - u_int refcount; -}; - -TAILQ_HEAD(clip_head, clip_entry); struct tom_data { struct toedev tod; @@ -278,10 +271,6 @@ struct tom_data { struct ppod_region pr; - struct mtx clip_table_lock; - struct clip_head clip_table; - int clip_gen; - /* WRs that will not be sent to the chip because L2 resolution failed */ struct mtx unsent_wr_lock; STAILQ_HEAD(, wrqe) unsent_wr_list; @@ -340,9 +329,6 @@ int select_ulp_mode(struct socket *, struct adapter *, struct offload_settings *); void set_ulp_mode(struct toepcb *, int); int negative_advice(int); -struct clip_entry *hold_lip(struct tom_data *, struct in6_addr *, - struct clip_entry *); -void release_lip(struct tom_data *, struct clip_entry *); /* t4_connect.c */ void t4_init_connect_cpl_handlers(void); Modified: stable/11/sys/modules/cxgbe/if_cxgbe/Makefile ============================================================================== --- stable/11/sys/modules/cxgbe/if_cxgbe/Makefile Mon Apr 29 22:15:51 2019 (r346933) +++ stable/11/sys/modules/cxgbe/if_cxgbe/Makefile Mon Apr 29 22:16:33 2019 (r346934) @@ -14,6 +14,7 @@ SRCS+= opt_inet6.h SRCS+= opt_ofed.h SRCS+= opt_rss.h SRCS+= pci_if.h pci_iov_if.h +SRCS+= t4_clip.c SRCS+= t4_filter.c SRCS+= t4_hw.c SRCS+= t4_if.c t4_if.h From owner-svn-src-all@freebsd.org Mon Apr 29 22:37:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 886AE159FD29; Mon, 29 Apr 2019 22:37:36 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D92880C7C; Mon, 29 Apr 2019 22:37:36 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05BE4902; Mon, 29 Apr 2019 22:37:36 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TMbZfO074615; Mon, 29 Apr 2019 22:37:35 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TMbZAW074614; Mon, 29 Apr 2019 22:37:35 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201904292237.x3TMbZAW074614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 29 Apr 2019 22:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346935 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 346935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2D92880C7C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 22:37:36 -0000 Author: jhibbits Date: Mon Apr 29 22:37:35 2019 New Revision: 346935 URL: https://svnweb.freebsd.org/changeset/base/346935 Log: powerpc64: Fix switch panic from cpu_throw() r18 is used to hold the old PCB flags, but cpu_throw doesn't populate r18 with PCB flags, since the old thread is gone. This can lead to panics on cores that don't have the registers guarded by these flags. Modified: head/sys/powerpc/powerpc/swtch64.S Modified: head/sys/powerpc/powerpc/swtch64.S ============================================================================== --- head/sys/powerpc/powerpc/swtch64.S Mon Apr 29 22:16:33 2019 (r346934) +++ head/sys/powerpc/powerpc/swtch64.S Mon Apr 29 22:37:35 2019 (r346935) @@ -78,6 +78,7 @@ TOC_ENTRY(blocked_lock) ENTRY(cpu_throw) mr %r13, %r4 li %r14,0 /* Tell cpu_switchin not to release a thread */ + li %r18,0 /* No old pcb flags. The old thread is extinguished. */ b cpu_switchin From owner-svn-src-all@freebsd.org Mon Apr 29 23:07:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAFD315A090D; Mon, 29 Apr 2019 23:07:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DCFA81E4B; Mon, 29 Apr 2019 23:07:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 391D5E16; Mon, 29 Apr 2019 23:07:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TN7K4c090315; Mon, 29 Apr 2019 23:07:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TN7Ju2090314; Mon, 29 Apr 2019 23:07:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904292307.x3TN7Ju2090314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 29 Apr 2019 23:07:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346936 - stable/12/sys/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/12/sys/conf X-SVN-Commit-Revision: 346936 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5DCFA81E4B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 23:07:21 -0000 Author: ngie Date: Mon Apr 29 23:07:19 2019 New Revision: 346936 URL: https://svnweb.freebsd.org/changeset/base/346936 Log: MFC r345351: r345351 (by bdrewery): Build common kernel dependencies before modules. This ensures files like genassym.o and awk/mfiles are generated before descending into the modules build. It may also allow some module builds to not recreate files that are already present in the KERNBUILDDIR. This fixes a rare build race where genassym.o is missing and assym.inc is empty. More work is planned around this to reduce some redundant dependency generation in modules. PR: 233339 Modified: stable/12/sys/conf/kern.post.mk Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/conf/kern.post.mk ============================================================================== --- stable/12/sys/conf/kern.post.mk Mon Apr 29 22:37:35 2019 (r346935) +++ stable/12/sys/conf/kern.post.mk Mon Apr 29 23:07:19 2019 (r346936) @@ -122,6 +122,8 @@ kernel-obj: .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists($S/modules) modules: modules-all +modules-depend: beforebuild +modules-all: beforebuild .if !defined(NO_MODULES_OBJ) modules-all modules-depend: modules-obj From owner-svn-src-all@freebsd.org Tue Apr 30 00:54:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5682015A2761; Tue, 30 Apr 2019 00:54:32 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF9E9850FE; Tue, 30 Apr 2019 00:54:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE3BE2082; Tue, 30 Apr 2019 00:54:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U0sV4Z048013; Tue, 30 Apr 2019 00:54:31 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U0sVev048012; Tue, 30 Apr 2019 00:54:31 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201904300054.x3U0sVev048012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 30 Apr 2019 00:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346937 - stable/12/sys/arm/broadcom/bcm2835 X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/12/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 346937 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EF9E9850FE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 00:54:32 -0000 Author: ian Date: Tue Apr 30 00:54:31 2019 New Revision: 346937 URL: https://svnweb.freebsd.org/changeset/base/346937 Log: MFC r346489: Move the reporting of spurious interrupts under bootverbose control, because occasional spurious interrupts are a normal thing on this hardware. Also, change the name of the cpu-local interrupt controller driver from local_intc to lintc, because the name gets built into interrupt names, which have to fit into a 19-byte field for stats reporting (so this allows 5 more bytes of the actual interrupt name to be displayed). Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_intr.c stable/12/sys/arm/broadcom/bcm2835/bcm2836.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_intr.c ============================================================================== --- stable/12/sys/arm/broadcom/bcm2835/bcm2835_intr.c Mon Apr 29 23:07:19 2019 (r346936) +++ stable/12/sys/arm/broadcom/bcm2835/bcm2835_intr.c Tue Apr 30 00:54:31 2019 (r346937) @@ -230,7 +230,7 @@ bcm2835_intc_intr(void *arg) } arm_irq_memory_barrier(0); /* XXX */ } - if (num == 0) + if (num == 0 && bootverbose) device_printf(sc->sc_dev, "Spurious interrupt detected\n"); return (FILTER_HANDLED); Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2836.c ============================================================================== --- stable/12/sys/arm/broadcom/bcm2835/bcm2836.c Mon Apr 29 23:07:19 2019 (r346936) +++ stable/12/sys/arm/broadcom/bcm2835/bcm2836.c Tue Apr 30 00:54:31 2019 (r346937) @@ -421,7 +421,7 @@ bcm_lintc_intr(void *arg) reg &= ~BCM_LINTC_PENDING_MASK; if (reg != 0) device_printf(sc->bls_dev, "Unknown interrupt(s) %x\n", reg); - else if (num == 0) + else if (num == 0 && bootverbose) device_printf(sc->bls_dev, "Spurious interrupt detected\n"); return (FILTER_HANDLED); @@ -730,12 +730,12 @@ static device_method_t bcm_lintc_methods[] = { }; static driver_t bcm_lintc_driver = { - "local_intc", + "lintc", bcm_lintc_methods, sizeof(struct bcm_lintc_softc), }; static devclass_t bcm_lintc_devclass; -EARLY_DRIVER_MODULE(local_intc, simplebus, bcm_lintc_driver, bcm_lintc_devclass, +EARLY_DRIVER_MODULE(lintc, simplebus, bcm_lintc_driver, bcm_lintc_devclass, 0, 0, BUS_PASS_INTERRUPT); From owner-svn-src-all@freebsd.org Tue Apr 30 00:58:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 631C215A2878; Tue, 30 Apr 2019 00:58:44 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05BB985289; Tue, 30 Apr 2019 00:58:44 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA17A2084; Tue, 30 Apr 2019 00:58:43 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U0whOP048245; Tue, 30 Apr 2019 00:58:43 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U0whD2048244; Tue, 30 Apr 2019 00:58:43 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201904300058.x3U0whD2048244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 30 Apr 2019 00:58:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346938 - stable/12/sys/dev/gpio X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/12/sys/dev/gpio X-SVN-Commit-Revision: 346938 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 05BB985289 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 00:58:44 -0000 Author: ian Date: Tue Apr 30 00:58:43 2019 New Revision: 346938 URL: https://svnweb.freebsd.org/changeset/base/346938 Log: MFC r346713: Fix typo: the 4th argument to GPIO_PIN_ACCESS_32 is the set of pins to change, not the variable used to return the original pin state. PR: 237378 Reported by: Mori Hiroki Modified: stable/12/sys/dev/gpio/gpioc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/gpio/gpioc.c ============================================================================== --- stable/12/sys/dev/gpio/gpioc.c Tue Apr 30 00:54:31 2019 (r346937) +++ stable/12/sys/dev/gpio/gpioc.c Tue Apr 30 00:58:43 2019 (r346938) @@ -192,7 +192,7 @@ gpioc_ioctl(struct cdev *cdev, u_long cmd, caddr_t arg case GPIOACCESS32: a32 = (struct gpio_access_32 *)arg; res = GPIO_PIN_ACCESS_32(sc->sc_pdev, a32->first_pin, - a32->clear_pins, a32->orig_pins, &a32->orig_pins); + a32->clear_pins, a32->change_pins, &a32->orig_pins); break; case GPIOCONFIG32: c32 = (struct gpio_config_32 *)arg; From owner-svn-src-all@freebsd.org Tue Apr 30 01:00:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B69F215A28FF; Tue, 30 Apr 2019 01:00:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 582EB853C3; Tue, 30 Apr 2019 01:00:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32324208A; Tue, 30 Apr 2019 01:00:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U100DV048413; Tue, 30 Apr 2019 01:00:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U0xxkn048349; Tue, 30 Apr 2019 00:59:59 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201904300059.x3U0xxkn048349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 30 Apr 2019 00:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346939 - stable/12/lib/libc/gen X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/12/lib/libc/gen X-SVN-Commit-Revision: 346939 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 582EB853C3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 01:00:01 -0000 Author: ian Date: Tue Apr 30 00:59:59 2019 New Revision: 346939 URL: https://svnweb.freebsd.org/changeset/base/346939 Log: MFC r346751: Add a manpage for elf_aux_info(3) Added: stable/12/lib/libc/gen/auxv.3 - copied unchanged from r346751, head/lib/libc/gen/auxv.3 Modified: stable/12/lib/libc/gen/Makefile.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/gen/Makefile.inc ============================================================================== --- stable/12/lib/libc/gen/Makefile.inc Tue Apr 30 00:58:43 2019 (r346938) +++ stable/12/lib/libc/gen/Makefile.inc Tue Apr 30 00:59:59 2019 (r346939) @@ -193,6 +193,7 @@ SYM_MAPS+=${LIBC_SRCTOP}/gen/Symbol.map MAN+= alarm.3 \ arc4random.3 \ + auxv.3 \ basename.3 \ cap_rights_get.3 \ cap_sandboxed.3 \ @@ -321,6 +322,7 @@ MAN+= alarm.3 \ MLINKS+=arc4random.3 arc4random_buf.3 \ arc4random.3 arc4random_uniform.3 +MLINKS+=auxv.3 elf_aux_info.3 MLINKS+=ctermid.3 ctermid_r.3 MLINKS+=devname.3 devname_r.3 MLINKS+=devname.3 fdevname.3 Copied: stable/12/lib/libc/gen/auxv.3 (from r346751, head/lib/libc/gen/auxv.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/lib/libc/gen/auxv.3 Tue Apr 30 00:59:59 2019 (r346939, copy of r346751, head/lib/libc/gen/auxv.3) @@ -0,0 +1,86 @@ +.\" +.\" Copyright (c) 2019 Ian Lepore +.\" +.\" 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 ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 25, 2019 +.Dt ELF_AUX_INFO 3 +.Os +.Sh NAME +.Nm elf_aux_info +.Nd extract data from the elf auxiliary vector of the current process +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/auxv.h +.Ft int +.Fn elf_aux_info "int aux" "void *buf" "int buflen" +.Sh DESCRIPTION +The +.Fn elf_aux_info +function retrieves the auxiliary info vector requested in +.Va aux . +The information is stored into the provided buffer if it will fit. +The following values, defined in +.In sys/elf_common.h +can be requested: +.Bl -tag -width AT_OSRELDATE +.It AT_CANARY +The canary value for SSP. +.It AT_HWCAP +CPU / hardware feature flags. +.It AT_HWCAP2 +CPU / hardware feature flags. +.It AT_NCPUS +Number of CPUs. +.It AT_OSRELDATE +Kernel OSRELDATE. +.It AT_PAGESIZES +Vector of page sizes. +.It AT_PAGESZ +Page size in bytes. +.It AT_TIMEKEEP +Pointer to VDSO timehands (for library internal use). +.El +.Sh RETURN VALUES +Returns zero on success, or an error number on failure. +.Sh ERRORS +.Bl -tag -width Er +.It Bq Er EINVAL +An unknown item was requested. +.It Bq Er EINVAL +The provided buffer was not the right size for the requested item. +.It Bq Er ENOENT +The requested item is not available. +.El +.Sh HISTORY +The +.Fn elf_aux_info +function appeared in +.Fx 12.0 . +.Sh BUGS +Only a small subset of available auxiliary info vector items are +accessible with this function. +Some items require a "right-sized" buffer while others just require a +"big enough" buffer. From owner-svn-src-all@freebsd.org Tue Apr 30 01:25:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E04EB15A38DA; Tue, 30 Apr 2019 01:25:03 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D8B0863C2; Tue, 30 Apr 2019 01:25:03 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BF3925AF; Tue, 30 Apr 2019 01:25:03 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U1P3uX063838; Tue, 30 Apr 2019 01:25:03 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U1P3XV063836; Tue, 30 Apr 2019 01:25:03 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904300125.x3U1P3XV063836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Apr 2019 01:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346940 - in stable/11/sys: conf dev/cxgbe dev/cxgbe/firmware modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware modules/cxgbe/t6_firmware X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys: conf dev/cxgbe dev/cxgbe/firmware modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware modules/cxgbe/t6_firmware X-SVN-Commit-Revision: 346940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8D8B0863C2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 01:25:04 -0000 Author: np Date: Tue Apr 30 01:25:02 2019 New Revision: 346940 URL: https://svnweb.freebsd.org/changeset/base/346940 Log: MFC r338954, r340651, r344524, r345083. r338954: cxgbe(4): Enable support for per-connection rate limiting in the default firmware configuration files. Approved by: re@ (gjb@) Sponsored by: Chelsio Communications r340651: cxgbe(4): Update T4/5/6 firmwares to 1.22.0.3. Obtained from: Chelsio Communications Sponsored by: Chelsio Communications r344524: cxgbe(4): Updates to the default and hashfilter configurations. - Do not use nvf = 4 as it is not really supported by the firmware. Firmwares 1.23.3.0 and above will ignore it silently. - Increase PF4's share of the VIs and let it use all of the RSS table. Sponsored by: Chelsio Communications r345083: cxgbe(4): Update T4/5/6 firmwares to 1.23.0.0. Obtained from: Chelsio Communications Sponsored by: Chelsio Communications Added: stable/11/sys/dev/cxgbe/firmware/t4fw-1.23.0.0.bin.uu - copied unchanged from r345083, head/sys/dev/cxgbe/firmware/t4fw-1.23.0.0.bin.uu stable/11/sys/dev/cxgbe/firmware/t5fw-1.23.0.0.bin.uu - copied unchanged from r345083, head/sys/dev/cxgbe/firmware/t5fw-1.23.0.0.bin.uu stable/11/sys/dev/cxgbe/firmware/t6fw-1.23.0.0.bin.uu - copied unchanged from r345083, head/sys/dev/cxgbe/firmware/t6fw-1.23.0.0.bin.uu Deleted: stable/11/sys/dev/cxgbe/firmware/t4fw-1.19.1.0.bin.uu stable/11/sys/dev/cxgbe/firmware/t5fw-1.19.1.0.bin.uu stable/11/sys/dev/cxgbe/firmware/t6fw-1.19.1.0.bin.uu Modified: stable/11/sys/conf/files stable/11/sys/dev/cxgbe/firmware/t4fw_cfg.txt stable/11/sys/dev/cxgbe/firmware/t4fw_interface.h stable/11/sys/dev/cxgbe/firmware/t5fw_cfg.txt stable/11/sys/dev/cxgbe/firmware/t5fw_cfg_hashfilter.txt stable/11/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt stable/11/sys/dev/cxgbe/firmware/t6fw_cfg.txt stable/11/sys/dev/cxgbe/firmware/t6fw_cfg_hashfilter.txt stable/11/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/modules/cxgbe/t4_firmware/Makefile stable/11/sys/modules/cxgbe/t5_firmware/Makefile stable/11/sys/modules/cxgbe/t6_firmware/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Tue Apr 30 00:59:59 2019 (r346939) +++ stable/11/sys/conf/files Tue Apr 30 01:25:02 2019 (r346940) @@ -1401,7 +1401,7 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.19.1.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.23.0.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t4fw.fw" @@ -1435,7 +1435,7 @@ t5fw.fwo optional cxgbe \ no-implicit-rule \ clean "t5fw.fwo" t5fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t5fw-1.19.1.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.23.0.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t5fw.fw" @@ -1469,7 +1469,7 @@ t6fw.fwo optional cxgbe \ no-implicit-rule \ clean "t6fw.fwo" t6fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t6fw-1.19.1.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t6fw-1.23.0.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t6fw.fw" Copied: stable/11/sys/dev/cxgbe/firmware/t4fw-1.23.0.0.bin.uu (from r345083, head/sys/dev/cxgbe/firmware/t4fw-1.23.0.0.bin.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/cxgbe/firmware/t4fw-1.23.0.0.bin.uu Tue Apr 30 01:25:02 2019 (r346940, copy of r345083, head/sys/dev/cxgbe/firmware/t4fw-1.23.0.0.bin.uu) @@ -0,0 +1,9944 @@ +/*- + * Copyright (c) 2018 Chelsio Communications, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY 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. + */ +begin-base64 644 t4fw +AAAEUAEXAAAAAQkEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAABDMEQgRKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAENoZWxzaW8gRlcgUlVOTUVNIERFQlVHPTAgKEJ1aWx0IFR1ZSBKYW4gMTUgMDc6 +NTM6NTUgUFNUIDIwMTkgb24gdm5jNC5hc2ljZGVzaWduZXJzLmNvbTovaG9tZS9maXJtd2FyZS9j +dnMvZnctcmVsZWFzZSksIFZlcnNpb24gVDR4eCAwMS4xNy4wMC4wMAAAAAAAAAAAAAAAABcsdBRg +AMgA4QB78AAQAADhADC4eP///x/84UCAAAAB4QB7cAAAEAAf//yo4QGUcCAAAADhAZwE4QB5AAAC +AEDhAHmAAAYAQAACAAoABgAK4QB5BAAMAACAAAEC4QB7POEAe0ThAHvk4gAAAAABAADhAHuQIAAA +AAAAgADhAHsAAABAAeEAe5wAAEAAREREQuAAAADjAARzREREQOMACAAgAAJcAAAAAB//jjAAAAAA +H/+ONAAAAAAf/444AAAAAB//jjwf/8AAAAAAAAAAAADAABL/zRP/zZMgEv/NE//NhCAEMwGTIBH/ +zBL/zJIQEf/MEv/MkhAR/8wB9DER/8siCv+SEADkMQAFMQECABL/yALnMQIWABH/x4EQAQFfwCEC +EQHJERH/xBL/xJIQEf/EEv/EkhBgAA8R/78S/8OSEBH/vxL/wpIQgRAR/8HAIJIREv/AkhLAIJIT +Ev+/khCCEALyUGUv9xH/vccvkhAR/7ySEBL/vBP/vJMgwDKTIRP/u5MigiIS/7oT/7qTICMiIRT/ +uQQzAck4E/+4gzADgxQIMxEU/7akM5MhE/+qkyJgAAjCMJMhE/+nkyIS/7GQIJAhkCKQI5AkkCWQ +JpAnkCiQKZAqkCuQLJAtkC6QLyAmECAmEYIiEv+kwDAtNzAtNzQtNzgtNzwjPQFyM+0AAgAS/6HA +MC83AC83EC83IC83MCM9AXIz7QACABL/l8AwKDcwKDc0KDc4KDc8Iz0BcjPtEv+VwDAnNwAnNxAn +NyAnNzAjPQFyM+0S/5AV/5AW/5HAMNcgBWYBYAAZAAAAAAAAAAQ2BQACANMP0w8FMwxuOxQHRxQH +BEN2MeYENgUFMwxvO+0AAgAS/4MV/4EjCgACJwIHBEMEPgUFMwwHRxRvO/ADAgAS/33JLoMghCGF +IrwidDsOhlC0VZYwtDN0M/Rj/+YAZT/iZV/fEv9xwDIDLgUDAgAS/2jAMCg3QCg3RCg3SCg3TCM9 +AXIz7QACABL/ay0nAMARAUkxAEgxAQIAwAAU/2gE0jEV/2eUUBT/ZwTTMRX/ZpRQFP9mBNQxFf9m +lFAU/2UE1TEV/2WUUBD/ZQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/AAA +H/wAAOMACfgf/AAAH/wAAOMACfgf/AAAH/wAAOMACfgf/4AAH/+FsOMACfgf/4WwH/+FsOMAD6gf +/4WwH/+FsOMAD6gf/4WwH/+HQOMAD6gf/4dAH/+OJOMAETgf/44wH/+zkOMAGCgf/7OQH/+zkOMA +PYgf/8AAH//96+MAPYggAAAAIAABauMAe3QgAAF4IAABfOMAfOAgAAF8IAABheMAfOQgAAGYIAAB +nOMAfPAgAAGcIAABpeMAfPQgAAG4IAABvOMAfQAgAAG8IAABxeMAfQQgAAHYIAAB2OMAfRAgAAHc +IAAB4uMAfRAgAAH4IAAB+OMAfRggAAH8IAAB/OMAfRggAAIYIAACGOMAfRggAAIcIAACHOMAfRgg +AAI4IAACOOMAfRggAAI8IAACPOMAfRggAAJYIAACWOMAfRggAAJcIAACYuMAfRggAAJ4IAACeOMA +fSAgAAJ8IAACguMAfSAgAAKYIAITy+MAfSggAwAAIAMXqOMCjlwgAxeoIAMXqOMCpgQgAxeoIAcp +TOMCpgQgBylQIAcswOMGt6wgCAAAIAgTEOMGuxwgCBMQIAkvuuMGziwgCS/AIAkwjOMH6twgCwAA +IAsAAOMH66ggCwAAIAsAAOMH66ggCwAAIAt5yOMH66gAAAAAAAAAAAAAAAAgABQWIAAUCCAAF/Ig +ABQIIAAXbSAAFAggABS6IAAXBSAAFoogABQIIAAWOSAAFfIgABWFIAAT9SAAFS8gABQIIAAUCCAA +FAggABTaAAAAAP///////w/8///w////APz///////8P/P//8P///wD8IADKDiAAy5QgAMvUIADL +iiAAyzUgAMsrIADK+iAAyvAgAMrmIADKkiAAy9IgAMqIIADKXCAAy9QgAMpSIADKQAEQGAEABAAA +AAAAIAAAAEAAAgIFBQgICwsODhERFBQXFxoaHR0gICMjJiYpKSwsLy8yMjU1ODg7OwAAAAAAAAAg +BSocIAHH1CAAPOAgAZLYIAHCuCABvOAgAXhYIARLiB//6TwgALKYIADMsB//3CAgAHWAIABnYAAA +AAAAAAAAIAGUkCAAnUQgAJVQAAAAAB//1KQf/8YoH//CWB//wDAgAFq4IABOFCAAS0AgAL44H//i +6CAG/pgAAAAAAAAAACAAUcggAF30AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIADGpCABrDggANdg +IADWXB//8CAf/89MH//MeCAAksggBbGwIAFDgCABK9ggARB4IAEH0CAA/NQgAO9MIADaWCAFLhAg +Ayk4IAE49CADWCAgAfnEIAB1QAAAAAAgANfIIAYpbCAAyYAgAZ6EIAACmCAAt/gAAAAAAAAAAB// +80ggANd8IAMr6AAAAAAAAAAAIAOxeCAAKjQgA6/AIAAotAAAAAAgADToIAAzHCAAMWQAAAAAIAA8 +hCABPLgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgBBfAIAUpvAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAA5/CADumAgADeYAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAACAAPOAgAK9AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsA +AAAgAxT8CAAAACADFQgIAAAAIAMVFAoAAAAgAxUgDAAAACADFSwSAAAAIAMVPA0AAAAgAxVQDgAA +ACADFWATAAAAIAMVcAoAAAAgAxWEDgAAACADFZAYAAAAIAMVoA0AAAAgAxW8DgAAACADFcwQAAAA +IAMV3BIAAAAgAxXwDgAAACADFgQQAAAAIAMWFBEAAAAgAxYoCgAAACADFjwLAAAAIAMWSA0AAAAg +AxZUFAAAACADFmQKAAAAIAMWfA8AAAAgAxaIBgAAACADFpgGAAAAIAMWoAYAAAAgAxaoBgAAACAD +FrAGAAAAIAMWuAkAAAAgAxbABgAAACADFswEAAAAIAMW1AYAAAAgAxbcCwAAACADFuQLAAAAIAMW +8AQAAAAgAxbUBAAAACADFvwJAAAAIAMXBAkAAAAgAxcQAAAAAAAAAAANAAAAIAMXHAoAAAAgAxcs +BgAAACADFzgCAAAAIAMXQAMAAAAgAxDMAQAAACADF0QAAAAAAAAAANdqpHjox7dWJCBw28G9zu71 +fA+vR4fGKqgwRhP9RpUBaYCY2ItE96///1uxiVzXvmuQESL9mHGTpnlDjkm0CCH2HiViwECzQCZe +WlHptseq1i8QXQJEFFPYoeaB59P7yCHhzebDNwfW9NUNh0VaFO2p4+kF/O+j+GdvAtmNKkyK//o5 +Qodx9oFtnWEi/eU4DKS+6kRL3s+p9rtLYL6/vHAom37G6qEn+tTvMIUEiB0F2dTQOebbmeUfonz4 +xKxWZfQpIkRDKv+Xq5Qjp/yToDllW1nDjwzMkv/v9H2FhF3Rb6h+T/4s5uCjAUMUTggRofdTfoK9 +OvI1KtfSu+uG05EHDBEWBwwRFgcMERYHDBEWBQkOFAUJDhQFCQ4UBQkOFAQLEBcECxAXBAsQFwQL +EBcGCg8VBgoPFQYKDxUGCg8VH//AAAAEACAgByzAIAcyMB/83gAf/6kkIAcs8B//qkQf/63QA4AA +AIEAAAAA//gAH/+oiAEAAAAAEAAAgQQBAIEEAAABBAAAAQQBAIAAAAAABf//H/+nzAYAAAAEAQAI +H/+AwAIAAACAEAAAQUAAAEFAAQCDAAAB//+//7////8f/5V4BAAACCADDsiBgAAADAAAAB//j8D/ +/wAA//8A/wABAAAAAP//H/+wwB//pXwP///////QdB//Yzwf/ODoIAcqfP//vwwf/2O8H/+rCB// +m4Qf/OIAAAAIyOD//gDhAZIAH/+V5AD///8f/5osH/+rJARBAAilAAAAwAAAAMAEAAAwAAAAH/+r +wAAA/4AgBylQIAtG4OEALgAf/6u0AAAd4B//p1wf/6xQH/+nwB//q6DgAACg4QAwuOAAAAAAAIAA +4QBgEAAAQADhAhAA4QIwAOECUADhAnAA4QAQCB/84UDhAHtwH/+zIB//sxgf/OAIH/+zHB//s0gf +/7NAH/+zRB//s3Af/7NoH/+zbB//qSQf/7DAIAcs8B/83gAf/6pEH/+pwB//quQf/5o8H/+wPB// +puggCwBgH/+sjAAA/4AAAB7AH/+PwB//rJgf/6yUH/+s+B//rcAqAAAAIAsEYCALBJAEAAAIBQAA +AIP/AACBAAAAABAAACALBNAgCwQwIAAJ+CADDdgf/4TwH/+AwB//rdBnRSMB782riZi63P4QMlR2 +H/+AAAAAPyggAxDMz////yALBfAQAAAAP////wIAAABAAAAAGgAAAB/84HQgoAAAH/+o3CAAHeAg +AB98gAAAAAAAgAD//v//AAAQAABAAAAgAc7YIAAjCCAAAAAgACNwIAsIwP//f///+///D/aAACAL +CPAgCwkgAAEAAAAEAAAf/6lQIAtTACALCbAgADToIAA2OCAAMxwgCwtQIAsKECALCqAgADFkIAsK +8FMAAAAA////UgAAAFEAAAAgAgMYH/+q+CAAOWAgBBOoH/+q8CALC3Af/5o0H/+qyCALDZAUAAAA +gAAAAnxQAACAAAAQgAAABoAAsAAAAAoAAP80kv//8A+AALEA4QGaAAACAAAgCw0gH/+XrAAAfkAg +Cw1gH/+rAAD/wAABAAAAKAAAAOAAAAAmAAAAAAD//x//kJAGAAAABYAAAB//pqgrAAAAIABVMCAL +VeAf/6h0A4AAAAf///8EAQAINQAAAAMAAAAAP///gEAAAAgP//8f////QUAAAEFAAQAABf//AQQB +AAEEAAAAAMAAPQAAAB//liAHAAAAgQQBAIEEAAAf/6q0AAA6mMMAAAAAAA//AEMAAB//qDwAAAgA +BAAAAB//mWwgC1ZAH/+ylB//sOAf/5V4AAYAAOEAegAf/5XgH/+awB//qugf/6skH/+aRB//mjAg +C1ZwAAMHgCALVuAIAAAAH/+YEAAgAAAAAAkAAAAwAv/8+H/AAAAAo/+7AKP/ugANAAAA4AMAAIP/ +tgAP////D//4AP8AAAAgC1cgIAsO0CALDwAgC1ewAA8AAAAKAAD//wAPH/+q7AP/wACD/8AAIAtY +MCALWKAf/6toH/+xUP9g8AAEgAAIH/+OQB//gFAARAAAH/+OgAGAwgAAAIEAH/+PgB//gGD/H/// +AMAAAPAAAACBgAAA/3///x//pXz/v/////8AAACAAAAAAIbdH/+bfB/84gAf/5CA7gAAAAAACcwf +/OIMDwAAACALD0Af/6t0AAAIzB//rIQf/5uEIAsRUCADCEDg//4AIAtMcB//nAAf/5c8H/+AcCAH +KvAAADAAAAAnEB//25AgC2XwIAtlwB//lhQf/6vkAAD//h//miTerb7vNAAAAD8AAAAf/7BYAJkA +AAAAiQYQAAcCAcCAAB//sDSZAAAAH/+xFACIAAiCgAABH/+wqP//8AADFQAAAxEAAAAPA/8f/6rE +IAEELCABCBgpAAAAAACJFCABDOwgAwuUAABAACADDsAMAAAAIAEX4B//sXAAACGwIAMLpB//q0Qf +/694H/+rBP8A/wDw8PDwqqqqqszMzMwf/6bwAAP//wAAJ/8gAwvoIAtmQCABKDgAD0JAIANfQB// +q5gACQAAAABIAIIAAAAgATzAH/+rVDsAAAgOAAAA0AAAAB//gLAAACKaAAAIUAAAH0Af/6sMIAsj +kCALI7AgCyPQ/9///wAJAAgf/7CkMAAAAH8AAAAf/6k4IAsm8AAAD/4gCyYgIAsmgCALJsAAAOAA +///3/yALJ4AgA2bIAACD/yAHMNgVoAAAIAcx0B//sGgAAAgGAACIzB//l8AABAP/CgAAACAHLWgg +By8IIActsIP/tiCD/7cAIAsnsOEAAAAzAAAAH/+xZAP/4AB///8AAD/2kB//sHAAACKoH/+pQAP/ +8AAf/5dgIAtJwCALSYAgC0ngH/+ycB//sGwAD///H/+rCCALaKAf/5pkIAB5qB//qVwgByp4IAAF +iB//pcAf/5WsH/+qNCALKDDABAAAH/+o9B//qOgf/6kAH/+vIB//rpQgA+vIIAsocB//qxwgAw+Q +H/+nACAAeojgAQAAH/+bgCALaWAgCyiwIADDEB//m3ggAMAQH/+RyCALaOAgC2kwH/+X4CALK0Af +/5BUH/+SDCALQKAgC0DQSAAAACAB1LAf/6iIIAHWuB//lmgf/6dcH/+mRB//qTQf/6YMAAAYUAAA +Fkwf/5f8H/+pWCAHLOQf/6acH/+V5OEALgAf/6lk4QBeAOECDgD//7//4QAOAOEBjgD//77/H/+n +MCAB3AAgAeg84AUAAAP/AAAf/6ZkIAMOyB/8v/88AAAAH/+AuIMAAAAf/6ZMDzwAACALSUCCgAAA +IAIKDCACDMAf/6v0IAIQeAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIGAAAAAAAAQAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAgYAAAAAAAAD/////////////////////H//7gB//+4Af//tI +H//7SB//+0gf//tIH//0wB//9/gf//ZQH//2UB//9lAgBwCIAAAAAAAAAAAAAAAAAAAAACAHA9Ag +BwPQAAAAAAAAAAAAAAAAAAAAACAHAIggBwCIH//49B//+PQf//j0H//49B//+PQf//j0AAAAACAB +3RgAAAAAAAAAAAAAAAAAAAAAAgEAAAAAAAAAAAAAAAAAAAEDEREICBAJAwEAAAAAAAAEAAAAAAAA +AIGAAAAAAAAQBQAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAgQAAAAAAABgFAAAAgAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAgCgAR8WsT8WvTDwPmMQECABbxaRfxandrBpBgtGZ3Y/hUDvFV +2hwPFABj//kAAABsEAgoIAWUFSQgB/ZgpBWgGUUA+QANjWFEAQCIIhrxXRfxXO3xXRwLDgAADEkR +p5krkp7A6f9gDPugDKUAKZKdCksKK7LDC5kB6RYEJIyZgACJ2PcgDPiSAJ0AL3KuZPFBH/FOKnKt +L/J/76sBBMP9AAD/QAl+YgCdAJjY/0AJhmIAnQCKFSkgFKqZCQlHKSQU9SALtdIAnQAb8UEvIhct +ISuJFBjxQK/dmJD6Q+gVoA4lAO6WAi7vwoAA/SBmFeAMZQDt8TkdVgKAAAyqAowUmpHrABUEyEEA +APiCaB3gSgUAncbqxgcmSIEAAOvjBQzQBIAACgJhCgJhCgJhCgJhwKTqajYBwEEAAG2pBQgAhgkC +YSghKx/xJfhFRBXgDBUA+QAgFaANBQD6IIgV74gBAAmILvpD6BWviAEA+EVkHaAGBQD2IAYVoB7l +AOYWAixFQoAA6BYBJdmBAABYiyH+gAAXN8UBAPfAAEdwDZUA7eadKAQKgAD5gATBUgCdAMAg0Q8A +AAAAAOokAAnYBIAA7BIFKugEgABYjOvSoNEPAAAAAMCwDJ8079YILfbGAAD6QGgdoBvFAPwAAh2g +DRUAWJNaY//BAADqJAAK2ASAAFiOmNKg0Q8A//m0DaAJBQDqJAACWGEAAPwAAh2gDZUAWJNOY/+R +wKBZ1FId8OeJ2Pk/8riQDKUAY/+k2iBYC1hj/oWKJ40VwMDqrCAu2ASAAFiGe9Kg0Q9sEAgvIhCU +FIYpJyEa/kDwFaAbhQD0IGYV4BzFAO94EQ4oBIAA/QHyDaHuAQAGCULIlAcIQmSCRykgBY0i/r4A +DfAaRQD7IBO9IgCdAObwxh6OlgAAFPDGH/DF5+QAD08CgAD1wA6aEAulAKaZKJKenhD3ABiTUgCd +ACmSnQ/qCiqiwwqZAekWASSSMYAAikj3QBKgkgCdAC5iru3wuxcPqYAALmKtL9LuD+gB6BYCJUv9 +AAD/wA8GYgCdAJlI/8APNmIAnQCLKYoqDAQ+C6oM9UAJ46IAnQAqISgtISaPFPugEMQiAJ0ALiAU +r+4ODkcuJBT1wBDN0gCdALGoKCUoKjAB80ARDpANFQAuIQkrIAcvIST4YCQVoAlVAPlABATwqxEA +4JkRDVKCgAAKmQIa8JcJiAIpIQcb8JYK/wL7BgAMOpkBAOohIizLAoAACe4CiRELqgIb8I+YkIgg +npOflJqS/QAAFDAKZQAKiAKYkS8iEJ+VLiA46PCIHtAEgAD9ISYV4E8VAPUhBhXg7hkADvo5/20A +DDAOBQCelwqIApiWKyIZ6vB0FfgFAAAvJhmem5ua6/BzFPkBAADqABUE0MEAAAoAipyfLjwQ+yHG +FeAKZQAOIIYPAmMOAIYPAmEMfBGmzOrGnSIAqYAAjiktIDik7p4p86AMH5IAnQCPEw8PR/ngCwlS +AJ0AwCDRDwDqJAAKWASAAFiPZP9LkA3gHMUA7BIEKVAEgADtEgMp2ASAAFiMO9Kg0Q+KSPdACoCS +AJ0ADHkRppkokp73AAtDUgCdAC2SnQ94CiiCwwjdAZ0SjRLp1AAGitGAALCvn0jpFgEs8NYAAP4g +BhWgAVIA8//toFIAnQAJdQz0vQAV7/amAADAkJkSjRILrjQPAgDuRggu8RYAAPpAaB2gG8UA/AAi +HaANFQBYkpJj/2QAAOsSAylQBIAAWI3Q0qDRDwCLEPpAaB2gDBUA+2MAFeANZQBYkohj/zrAoFnT +jIpIwcz5X+0YkAulAGP/q4wiwNQNzAL8QEYVr/xyAAAAAAAA6xICKVAEgABYCosqISj/92QNoBzF +AAAAGvAYKyIZiScqoSCJnguqAQpYFAmICv8AiBXkqgEA7iE9LQEKgAAA2RoJ/wLvhgQncAUAAC4l +PfpgMBWv9qIAAIonjRTAwOqsIC7YBIAAWIWc0qDRD9ogWIuuY/54AAAA//PoDaAJBQD+IAYVoAoF +AFnTYIpIjhD/3+YF4BzFAPlf9MiQC6UA//r0DaAJBQAAwND8IEYV7/qSAAuvNP6BBhXv+p4AAAAA +bBAOlRsoIhCOKSchNykgB5MdijL+YIgV4A0VAPxgaB2ntQEA4yEaJdv5AAAL2zn6IYYV4ZkBAOf/ +Ngm3woAA/sJSDeOqAQAODkLxwHAN4tMBAGTUGiYgBcHo+f4ADzAXRQD2wCHVYgCdAIciix304WwN +4A6FACuwAZ8R82Ae3xIAnQCZEJkZmhMY78Pt78QSKA0AAOUWCiyvAoAA6FUIDN+CgACtu+sWCCJw +BQAAiRmeF40a9SAGqhIAnQArUp6GGP1gChviAJ0AL1KdJmLDBv8BZPPwGe+yiZj3IAmYkgCdACqC +rmShUBrvryOCrSqifx3vqwo7AesWBCTb/QAA+mAJ1iIAnQCb2PpgHR4iAJ0AhymGKgwDPgdmDPLA +CZviAJ0AKRoA8yIyDeD69QArIBacEvtgCd0iAJ0AixGGwyogOPfg5hWgBgUA9+EmFaBHBQD74QYV +4KoZAAp2ORfvnJYVLSIYFu+ZnfotIhyd+4nECnY5lhb5YA/C4gCdAIscnh7sFgIljVGAAGABGxnv +hImYapEuixoqUp6PGHujSy1SnS/yww/dAZ0UhhTr730U0/0AAO9kAAMB6YAAmrhl/xNgAwGeHvwg +RhWgCgUAWdLfGe9ziZgY73CMEu4SDiSO2wAA//9cDaAPBQDAoPoghhWv/uYAHe9qwLoLmzT7oQYV +7/72AAAAAP/7GA2gDwUAAJ4enx/8IEYVoAoFAFnSyxnvYIwSjx+JmI4eGO9b+T/1gJIAnQBgAnbA +oJoUixQW71jA2g2dNO1mCC32NgAAYAJdnh6fH5wS6iQACdgEgABYjl6MEo8f7hIOJXXBgABgAhUq +IAeeHp8f+iAABTAMBQBYjjZko24qIAcrIBb8YGgdoaoBAFiOB4wSjx/+IcgVr/puAAAAAAAAixKI +E4wRhhWOFqzdCGYC98YADz+IBQAoJDsMlgyWtC0mHO0iEClQBIAAWIzcjh6MEhjvLypWnYopKSA4 +o6rqJgkk+ZaAACYhN4/EKyEaKSIQ5v82De/CgAB/2woKCkLIpAsNQmTQU/4gJhXgHYUA+f4ADvAK +FQD6IYYVoAY1APYhZhWv9goAiiefH4sd6qwgKmAEgABYiWCPH5oSLSIc+UCIFe/9dgDaIFiKxRjv +EIwSjh76QSgVr/4+AHGeqAq/DP/9ABXv/ooAixOKFS0iEBnvFguqAhvvFgpoAoYcGu8NCYgC6e8M +Gwp+AAAjFhAlFhEmIAeFwCMhB/ZBJBXgZhEA61UBCzKCgAD2pgAKujMBAOYhIimbAoAAA3cCClUC +IyEkCWYClfCFIJfzlvL94KYV45gBAOj2BizKAoAACTkC4xIQIlP5AADp9gQqrgKAAOXlAgZAgQAA +5fYBJ8jBAADlEhEiFDUAAG2pBQgAhgkCYSYgFKRmBgZHJiQU9MAHddIAnQCJFylWnSgiGLGI6CYY +IYCpgACLKSogOKO7mynzQAefkgCdAIwcZcDPwCDRDy0hKGTcIg54AvhARhWgAIYAAAAAAADzH98I +UgCdAA4/DP/9ABXv71oAAAAAAADrEg0pUASAAO0SCypgBIAAWIqt0qDRDwDrEgspUASAAFiMZNKg +0Q8A+kBoHaAbxQD8ACIdoA0VAFiRHGP/wYsQ+kBoHaAMFQDtEgol2GEAAFiRFmP/qQAAJiA7ZGBh +6iQADlgEgAD8ICgVr4kFAOkkOyxwBIAAWIxR+iDmFaALBQArJhz6R2Yd7/wuAAAAAADrEgQpUASA +AFgJFWP/B4on60QACmgEgAD7RAAVoAwFAFiEN9Kg0Q8A2iBYiklj/wgjFhCHwCMgByYhIvrgBAPw +MxEA4yEHKdqCgAALdwIKdwKLJyohCfjGAAt6MwEA6bEVKZsCgAADqgIjISSX8IcgmvOY9u32BSXY +gQAA9+BGFa/NBQD9YAQF82gBAOudCAsyAoAABjMC4/YEK74CgAAH5wLn9gEmYIEAAOMSECbpAQAA +7ctCfkAEgAAsTP4MxhGmhubTOnfIwQAA9J/xqRIAnQBtyQUIAIYJAmFj/iSLEPpAaB2gDBUA+2JA +FeANBQBYkMpj/nkAAPmPAAx//voACNwMDE0UbdkFCCCGCQJj78kIBcEBAADtTAwEyMEAAPWf7wES +AJ0AKsz+bakFCECGCQJlY/3MAABsEAYoIAUmIAf8QEgVoBlFAPkAE11v+zUA9CBGFaAHhQD9YBJY +oAlVAIQnHu5HLCE89IHIFaALFQD+YMgV4WYBAP4gJhXl3B0A5N0KC1cCgAD9oIgV5MwBAO6qCA4B +CoAA7iE9LaAKgAAE3QENvTnkop4uwASAAP1tAAxwDDUA+S0ADjALBQAIezmsu/qAEAPiAJ0AHO4u +KqKdDGwKLMLDDKoB6hYDJQ3JgACJJyQhPImeBFgUCYgK9wCIFeTEAQD7gAQA0AkVAACZGvcgBAfw +DBUAD885/88AD3/89QAMmQMf7iouJT0JdwGXhC/xfpsQ5+4bEiAFAAAE/wEvJTzk7hYWgwmAAPpA +CBXgDBUAWCP+ixCOES8hCS0gByghIikhJP3cNgWg3REA54gCDuqCgAANmQIMmQKZoIwgnqX/QGYV +4A0lAOimAi5mAoAADcwC7KYBJWhhAADkABUFUIEAAA0AiiggBxnuCwgoQAqIEAmIApigjiD3QEYV +4B+FAJ+j/cAAFzAPNQDv7gIFYEEAAO6mASHIIQAACUCIDAiKCSCIDASKCQCI7IMeBUihAAAEAIkJ +AIoa7eQMaRGqmSuWnQULR/lgBoFQCgUALCEoiyKwzPxExBXvzAEA7CUoJfAYgADIxH23aX3LZoon +x8MMuwHrJgIlUMEAAFiPjuPt5hUBEYAAKKAAA4gKiIzsoActWASAAPpAaB2gDUUAC4AAZa/hiSfK +lSqZFMqqipnJrCigAAOICoiM7KAHLVgEgAD6QGgdoA01AAuAAGWv4cAg0Q/SoNEPAAD//0gNoAoF +AIki+iAGFe/6NQB6kDpkv1AFC0doskrAINEPAAAAAAAA6iQACtgEgABYi1jSoNEPAP/4PA2gCgUA +iifqrDAp2ASAAFiPQ2P/I+okAANYYQAA/CAIFeAMFQBYkAqLEGP/rACKJ9sw7BICJVDBAABYh83A +INEPbBAILCIPLyAHKCE2hzf+Q0QVp9UBAPm/wBXgCxUA6bk5CbAEgADrIgkqUASAAPgghhXgBBUA +6Hc2D0/CgAD3IlIN4f8BAAsJQvEgcA3ijgEAZIJvwbTsex8OlHQAACwhKekhJyZgBQAADAxPLCUp +/SAVC6IAnQAsIAX7gBNlYgCdAI0i+iAGFa/7NQD9YA5A4gCdACgiGo4y+cAU/SIAnQApMggY7Xgc +7XTkkilv34KAAJoQmBGsu+jtbxVIDQAAmRPrFgIvpwKAAKhE9eANAhIAnQCLEypCnvtAGzviAJ0A +ihIpQp0qosMKmQHulAAEkqGAAIwpiyoMBT4Muwz1YAnb4gCdAC0aAPWh8g3g+PUAKyAW+WAZpSIA +nQAsISIZ7WooIQcqISQrIQn8QPAV6ogBAOmqAgxDAoAACLsCGe1jGO1VDS1A6cwCDuqCgAAI3QKd +4IkgnOKa5PvAZhXgClUA6+1bHM4CgAAKmQKZ4YgvmOUsIDj3wQYV4A0FAP3A5hXgCiUA/dqmBeBJ +JQD4wIgVoMwZAAyaOZjpDNs5jWWd6h3tTfzAyBWgCQUA7OYLI4fhgAAKnBANzAKc7IwRiWiX75nu +iGko5hCNai3mEewAFQdJIQAACQCKiGf44AvjogCdAB/tMwq9Ag/dAp3mwMX8k6YVoQkFAPUh8g3g ++PUAKyAW+WATxSIAnQAsIhqKKSshKSkgOOWqCAZgBQAA7CYaJdv9AAArJSmaKfMgD8eSAJ0AixRl +sfbAINEPnxWfFp4X6iQACtgEgABYjBuOF+8SBSV1kYAAjBRlz9uKJ9sw7BIAJVDBAABYhzHAINEP +Gu0Diqj3QBDAkgCdAIwTK0Ke/WARe6IAnQCLEilCnSuywx3s+guZAeSSG2Vj/QAAnNjulAAM8nYA +AGAAliggOfEf+A4SAJ0A//vkDaAJFQAAAAAA85/sYFIAnQAJ5wz2/YAV7/YGAIk3ZJ3V8ADYDaAK +FQAAAAAAAADBs3vJFCwgOpoQ/iDGFeAN9QD9gBC9YgCdAOokAArYBIAAWIqC0qDRDwDBrYw3KyEJ +jTiOMuuvEQ3dAoAAD7sC5LsCCVAEgABYimjAINEPAAAA//9YDaAahQDqJAAH2GEAAPwgaBXgDBUA +WI8uY/79AAAKuAKY5sDV/JOmFeEMBQB1yw0rIBYpCv/5YA41YgCdAIoUZKFdi2qMZ4ppq3sHzAyc +Z/dg0g3gDgUAsaqMZZtqi2aaaazqq3t3uwGxqo4pm2aaZS0gOKXuninzoAo3kgCdAIknKJkUyoGL +mcm9Gey+KLAAnxWfFgmICoiMLLAH+kBoHaANNQALgACPFYsix6P7X/JI4gCdACghNodnLiEaii+L +Keh3Ng9nwoAAd8sKCwlCyJQOC0JksLXB1Pr+AA6wDBUA/CCGFa/yogDaIFiIRmP+A4on6qwwK1gE +gABYjijSoNEPAAAA//KQDaAJBQCfFSogB58Wnhf6IAAFMAwFAFiLdo4X7xIFLWW2AADqJAAH2EkA +APwAIh2gDQUAWI7lY/3XKiAH/KBoHaGqAQBYi0Fj/XqfFf4gxhXgCgUAWc/jGux3iqiPFflf7qCS +AJ0A//fEDaAJBQDAkBzsccC6C6s0+4EGFe/3fgAAAAAAAPNf+jBSAJ0ACecM9v2AFe/87gCKJ58V +7xYGKdgEgADsEgAlUMEAAFiGj9ag/iCoFe/6FgCfFe8WBilQBIAAWIgO/iCoFe/6tgAAAMFT+kBo +HaALBQD8AAIdoA01AFiAkCsgBY8WihD1f9pdYgCdAGP9GSogB58Vnxb8oGgdoaoBAFiLEP4gqBXv ++KIAbBAOiC8nIAUuITYpIAeVHPIhZhXgBhUA8oBoHedFAQDtEgsie/kAAA9vOZ8dLyEajNScE+3Q +AS6oBIAA/4EADjGZAQDuIgkvt8KAAPzCUg2grTEADg5C8cBwDeJvAQBkZGnB9AjPjf7gJc1iAJ0A +jiIPAgD1xswN4A+FACwWAfOgIZcSAJ0AmRCZGZoS5uwkEcANAACYGujsIRz/goAApv/vFggs5wKA +AKjM7BYOIegFAACGGZ0Xih70wAYiEgCdAIsaKqKehhgvEg77QAlr4gCdACZiwy/ynQb/AWT0ahns +EYmY9yAI4JIAnQAqgq7k7A4VCbGAAC6CrSRCfxfsCQTrAesWBCSz/QAA9cAI9iIAnQCWePXAIN4i +AJ0AiimJKgwEPgqZDPUgCLuiAJ0AKxoA9WHyDaD89QArIBb9YAkFIgCdAI4RKiA4/AgCHaAHBQD3 +4OYV4QkFAPagiBWgqhkA6pc5C9gEgAAKyzmbFZcW98ASEqIAnQCLHWSx2WABARnr6ImYapEyih6L +GowYKqKeLMLDe6NGix4rsp0MuwGbFI4U6uvgFLP9AADv5AAHAcmAAJaoZf8lYAON/CHmFeAKBQBZ +z0IZ69eJmBjr1O0SDySO2wAA//9sDaAPBQDAoPoghhWv/vYAHOvOwLoLmzT7gQYV7/8GAAAAAP/7 +cA2gDwUAnR/+IgYV4AoFAFnPMBnrxC8SEImYjR8Y68D5P/ZQkgCdAGADCsCgmhSLFB7rvcDKDJw0 +7OYILfcWAABgAvGdHy8WEOokAApYBIAAWIrELxIQ7RIPJXaxgABgAn4AKiAHnR8vFhD6IAAFMAwF +AFiKmy8SEO0SDy12VgAAYAQMAJ0f/CAoFa+JBQDpJDsiuEEAAOcDHgewgQAABgJhjlec+IZUiVau +zgxmDJZUfOsH7RYPJMgFAACeV4YWjhWZVgbuAhbrrIwR7SIPKVAEgADm7gIK2ASAAFiJO40fGOuP +iR77M6YVoQcFAHR7DSsgFioK//tgBC0iAJ0AiikrIDikquomCSgECoAA82AEP5IAnQAvITaMVC4h +Gokv78w2D1/CgAB8uwoKCkLIpA4GQmRgdPwgJhWgH0UA+Z4AD/ALFQD6IaYV4Ao1APohhhWv9Y4A +AAAAAJ0fiicvFhCLG+qsICngBIAAWIW27xIQLSgEgAD8IegV7/wuAAAAKiAH/IBoHaGqAQBYiisY +62T8IegV7/2qANogWIcUGOtgjR/6QSgVr/2+AHGehwrsDP2dgBWv/gYAHOtjGOtnixKOFfoAIh2g +CQUAC6k4B+4CGutc99bSBeAGBQAJhjkG7gKGHRvrXun8ICLAQQAA5+4CCwueAAAmIAeFUAYmQOtV +AQsygoAABlUCClUCKiEHKyEiJyEJ9kHoFaqqAQDsuwINUwKAAAp3AiohJJXwhSCX85vy9+CmFaO+ +AQDu9gYt2gKAAAuqAur2BCquAoAA5dUCAdP9AADl9gEhjDUAAG2pBQgAhgkCYYgeJxIH9xOmFeEG +BQD0wfINoPn1ACsgFvlgCqViAJ0AKiAUo6oKCkcqJBT1QAh90gCdAMhPjCkrIDikzJwp82AJJ5IA +nQCNHWXRAMAg0Q8mIShka8sP6AL4QEYVoACKAAAAAAAAAPMf3JBSAJ0ADvwM/Z2AFa/uHgCEHAQE +R2hCFYYTiFTAkQaWOQhmKPaghhWgAgUA0Q+KJ4sb6qwgKeAEgABYhU6LE4ykwNEL2zkMuyj7QIYV +4AIFANEPAADrEgwpUASAAFiIpNKg0Q8A+kBoHaAbxQD8ACIdoA0VAFiNXGP/lIsQ+kBoHaAMFQDt +Egol2GEAAFiNVmP/fAAAJiA7DwIADwIAZGB4/CAoFa+KBQAqJDsIIIYJAmPs9ggq2ASAAO0iDylQ +BIAAWIiN+iDmFaALBQD6R2Yd7/saAOsSBClQBIAAWAVTY/7miifrNAAJ6ASAAPtEABWgDAUAWIB1 +0qDRDwDaIFiGh2P+1wAAKiAH/IBoHaGqAQBYiZVj/p4AACMWEichB4NQJSAH9kEkFap3AQDrMwEL +uwKAAPpA6BXgVREA52YCCqqCgAAFMwIKMwIqISKHLyWxFQyqAiwhJJPwgyCa8pf1lvPu9gYpngKA +APOmAAnz3gEA4/YBLuoCgADtzAIF2IEAAP3ghhWvzAUADLsBq13jEhIm6QEAAO2LQXxgBIAAsDgM +hhGmxnbTOvR/70iSAJ0AbYkFDECGCQJlY/3YAACLEPpAaB2gDBUA+2JAFeANBQBYjQVj/jcAAAAA +APUPAA5//v4ADN0MDUgUbYkFDGCGCQJn794IBckBAADoPAwHQIEAAPWf7HiSAJ0AsM9t+QUJgIYI +Amlj/XwAAABsEAYoIAUjIAckCgP9D0BEUTMBACggImSAbwIqAlh+MP1MwIDQDRUALCAhGOqBDwIA +7DMRBn1WgACoMykyng8CAG6TRSsynWSwP/pACBWg/uUADs4B/cYADvAPBQD8RCYd4AkFAPggBhXg +DAUA+CAmFeAOlQD4IEYV4A0FAFiEgfRzphWgAgUA0Q/AINEPAABsEAoqIAX4QPAV4AwVAPhgaB2n +tQEA6BYAJdv5AADryzkKGASAAOsWBSwgBIAA/UHABFGZAQDBw/1AH2UiAJ0AjSLv6lgem3YAAOvq +VRGwEQAA5hYELPeCgACv7u4WAyzXAoAAq6rqFgcswASAAIcX9QAEIhIAnQCKFCdynoYTjxf64Adb +ogCdACZiwy/ynQb/Ae8WBieZUYAAJSEbikKHKYYqBaU29U8ADnELBQB8swHVoJgaB2YM9MAF4+IA +nQAqGgD1QjIN4Pz1ACsgFpga/WAF9SIAnQCKQvqgDlKiAJ0AG+pJh0MLdwGLFegWCiWJCYAAYAC4 +ABrqLIqo6BYKJQzfgACLF4wUhhMrsp6PFyZiw3yzQy/ynRzqIwb/AeTwOWVb/QAAm8jvFgYv+24A +AGACiwAAAAD4IWYV4AoFAFnNhBrqGYqoiRvoEgolDt8AAP//TA2gDwUAwPAc6hPAugurNPuBBhXv +/wYAAAAAAP/8eA2gDwUAmRvqJAAK2ASAAFiJGIkb6BIKJXmpgABgAiEqIAeZG/ojAAUwDAUAWIjx +iRvoEgoteYYAAGADAADw4ARAUgCdAC0hGowplxj4IUYVou0BAOkWCy8DzgAAlxj4IUYVouwBAOkW +CycDOYAAmBrpFgsu/8KAAHX7VQ7VDPnUDAWgt+kA5kIDLdyCgAALeQKZGAhmAfaAZhWgAN4AiieZ +G4sQ6qwgKeAEgABYhCqJG/ghSBWgCyUA66QCLSAEgADqogIjhgKAAIwplxiYGpkbjhiPFuWtDApY +BIAA5cwICVAEgADtRgIq6ASAAOwmCSngBIAAWIRGiBqJG48X+/OmFaEOBQB16wgrIBYmCv92uQrA +ofogphWv944AACogB/ygaB2hqhkAWIiIiRv4IUgVr/+GAI8pGOnZiRal/58pjEOLQI0V58QABMiB +AAD8DgAFN+sBAO4WAS6ITgAAJyAHBwdBCHcKJ3Kh7q0QDVPCgADtqgICQEEAAOp3AQHT/QAA58cC +AYw9AABtqQUIAIYJAmGLQMCAmBIZ6cUa6cMvIRqGFh7pwCQhBxjpvfwgKBWh1zEA/6AARrpEAQDt +0IAqJwKAAOzMDyZwQQAA+IYACjTMHQDkZgAmYAUAAAw8DBTpmQ1dDIggn2aXZ55jnWUMpDkJiQLp +ZgQsRgKAAORmAiHQBQAACKgCmGEmIBTjZggNIASAAOYkFCWp+oAAiBf1E6YVoQcFAPTh8g3g+fUA +KyAW+WAExWIAnQCIEtKA0Q+KFWSgnMAg0Q8AAADqJAAE2GEAAPwgiBXgDBUAWIvaY//diif8ISYV +p9tBAOqsICgECoAA9aAEYdIAnQCMFisKAezMICnoBIAAWH8ImhL6gAgV7/waAACLFuxNEQlQBIAA +/WAARfAMFQBYfNr0gGAVr/22AGW8FPlf4IjSAJ0ALyAg8f/gN5IAnQBj/3cAKiAH/KBoHaGqGQBY +iBuIEtKA0Q+KJ9ww6xIAJVCBAABYg5nAsvtARh3gAgUA0Q8AAAAAAAAA6zQADjgEgAD8YGgd4AwF +AFh+5dtA7DQACugEgADqFgIr8ASAAO8SBilQBIAAWIO3+oAIFe/7SgArIAfaIPojAAXwDBUA+2JA +FeANBQBYi51j/ugAbBAIkhSTFRnpR4hA+CBGFa/LBQDrKgECcCEAAPogZhWniEEA5IG8YlARAACP +Ey0hBamMLMAAr98EzAvv/EAuWASAAP+ADWriAJ0A+iAmFaBoAQD+ACId4A0FAAb9OAvfC+vdCgfY +IQAAghWeEPkAAEVwDCUA8kEAFeAPBQDyQIAVoAIaAAAAAI0UDlUM/+AgFaADBQDv5AAEQAUAAPEN +8A3gfgEAhhMioAAt0QUEIgvm1ggJWASAAOIWBiMxAQAA9kAGQqIAnQAIBkDyACIdoA0FAAYtOAvS +C+vdCgFYIQAA9yAQFaACFQAHIziHFQdmCxfpGac3J3CgBjIKBjML7HwIAZghAACO0AsAiQXuNp4g +AwCLgtDqrAEkyAUAAPRf+zPiAJ0ABSkMDioM+6AGFaAHFQD1YCgV4AYFAAl2OKhogrCl5ZWxflsB +sSLitgAmfRKAABbpAosSHukB5rYBB5AFAAAGIgKGFe67AQxuAoAADbsCkmD6gAYV4SwdANEPixD8 +ICgV7/1uAAAA/E8ADf/84gCFFRno0wXFC/gAChXgAgUAsSLlgx4JD+gAAB3o64YSGujr7W0BB9gF +AAANuwKNFepmAQxOAoAACWYC69YAJhAFAAD2gAYVoSIdANEPAAAAAOoWAS1oBIAA+8BoHe/55gD9 +jwAN//lOAGwQDPhASBWgCgUA6yAHKcgEgADygGgd58UBAP2fwBWgBBUA7Ew5DLgEgAD8ISYVobsB +APMbXA3gDAUAmhacFZkTmxSbGxjoph3oyR/opBXoouboxR33goAAr+4uFgouIBbmFggtpwKAAPSA +AEJw//UAf+ETAioCWDKyGOiZHei76hYIJSohgABgABcAAGZjy/jAHyiQ+vUAKSAW+yAZTSIAnQCJ +iPcgBhCSAJ0AK1KuHOiNZLDRLMJ/K1KtDLsBZLDHsJmZiBzoqmSzSyzAgCzMN/4haBWkzB0ArDzr +FgImYB0AAPXABYISAJ0ALkKe/cAIK6IAnQCMGitCnSzCwwy7AesWACWZUYAAKnEMiXeZEf1ADqxi +AJ0ALHAQ63IDJglBgAD5n/so0gCdAC5yA2Tg0I8WZfGwhhGPGI0U7hIAKVAEgADm/zYL2ASAAO8W +ASngBIAAWDBmGOhiHeiE568ubTAEgABgAvIAAMCgWcvHGOhciYgd6H35P/mIkgCdAP/9CA2gCwUA +wLDAqgqZNPkBBhXv/M4AAGqRJCtCnnyzQYwaK0KdLMLDDLsB5LA1ZPP9AAD/AQYVr/0qAAAAAAD8 +IaYVoAoFAFnLsBjoRYmIHehn7BINJI8TAAD//IwNoAsFAMCwwPoPnzT/AQYV7/xSAAAAAAAAAP/8 +GA2gCwUAAAAAihjAsZsW+V/5KuIAnQDA4J4W+V/4yuIAnQDrdAAJUASAAO0SCSngBIAAWDCi/gAi +HeAHFQDnFgktOASAAP9AZhXv+7oAZLBJjxX+ACIdoAwFAA/sOGTAjIgRhhjqJAAL2ASAAO0SBCng +BIAA6GY2CPAEgADmFgEg+BEAAFgxMOjoFx0wBIAA/dBwBe/3/gAAAACLGA8CAA8CAPlhNg3gDAUA +eaMBwMH4ACId4A4FAAyeOOwWBSd8kYAA63QACVAEgADtEgkp4ASAAFgxzvdAaB3gCxUA+iEmFeAK +FQD64GYVr/2eAIsQFegaKiEHiXAc6Bb/z/wF6qoBAP9AABU4mQEA7KoCBMA9AAD8ISgVpIgdAOq2 +ACRACQAACDgMjiCZs+hfOQGz/QAA77YCL3YCgADubgIFqEEAAO62AS4O5gAAiBPojCAhlFUAAOo8 +/irIBIAAbakFCACGCQJhKzz+DLsRq1ubECggFCwgBKOI9YAImRIAnQAICUcpJBT1IAouUgCdAIhy +KCYZiXHoFgctqASAAPMgCjBSAJ0A8TX4DeAHBQCnZiZGnSogFisK/3uhCusSASlQBIAAWDWYjBll +wOPAINEP6xIBKVAEgABYNZMuIBYY58L9z8gF4P/1AP/f5RxiAJ0AY/yHiBllj9IqcBDbcPxgaB2g +CRUA+1/gFaANBQDqnTgJUASAAFgvf8Ag0Q8AAAD6QGgdoBvFAPwAIh2gDRUAWIoSY/+9AAAd59At +0IDrEgQm6N0AAPpAaB2k3R0A/GAARvAMFQDt3Acl2GEAAFiKB2P/jy4gFi8K///f+vRiAJ0A6xIB +KVAEgABYNWvAINEPixAMbBGsu/ogBhXv+5YAKCQUjXDxv/i6kgCdAPpAaB2gDAUAWHsI9sBgFa/8 +EgCKJ+s0AAnoBIAA+0QAFaAMBQBYfSfSoNEPAAAAAAAAAOsSAilQBIAAWAH5+iAIFe/6wgAAAAAA +AOokAAxgBIAAWAN1iBeJcZoc56QADV8CgADrVQgE9U2AAOtUAAlQBIAA/QBoHeAMBQBYAzn3QABD +//o6AIon/KBoHaALJQDqrCAp6ASAAFgxpStwEPl/8TjSAJ0AKXAVCQhFZI4ZK3EJHOeJKnEML3AR +jicMqgyr/w+ICf3CpBWvzQUA7uwgJHiJAADt7gEEQEkAAAr4Oah9rs7u7EAm6IEAAO7bYn7QBIAA +DuowG+d5LaEB/UAEFaH5MQAL/worIhTv8qEuZAKAAAzdAgvuDA/uLK7dqF79wCQd792BAP3ABB3v +9nYAAAArIAfaIPojAAXwDBUA+2JAFeANBQBYiaVj/ggAAAAAAP2vAA0//noAbBAEIyAAJArtdDEG +IiEDvCLRD4QhhiDyQGgVoAglAPdkAAKwlHEA+Q8ADHM2AQD0YABB82aBAOXnVBwBCoAAAGYa9mAB +Ab1EAQDlIgEBqDkAAOUiDAGYaQAABCQsBDMooyLRD2wQCIoiJyAHiTCVFfhC0BWhdwEA8V1MDeiZ +AQD4ICYV4Pz1AHyBHQULR/t/wBXgCRUA65s5CVAEgABYNQ/zUwAN4Pz1ABrnEYioFucO9wANmJIA +nQAuYq4Z5w5k4dspkn8lYq0JVQFkUdEojP8opgjpVAACjYGAABvnKSWwgO3nAhKo3QAA+CAGFeRV +HQDlRQgLzwKAAOaZCAKoDQAA9OAIkhIAnQAokp71ABM74gCdACWSnQ14CiiCwwhVAWRRiCkgFv0j +Jg2g69UAKjAQ+0ASVGIAnQArMQu8u9ogWDS7KCAULCAEpIj1gAxBF5gBACkkFPUgDi5SAJ0AihUe +5wCNESghBxzm5Rnm/P+h4BXqiAEA/wAAFDT/HQDpiAIH+AUAAA9PDJhQiyAP7Dn8oGYV56oBAOxW +Ai3eAoAA60sCAshBAADrVgEhwEEAAPlACXFSAJ0A6EENYlP9AABtqQUIAIYJAmHAgJgU6SAEIlv9 +AAAMuxGrW/UgCQkSAJ0AiDIoJhnpMgEl2EEAAJsTKBYC8yAJuFAFBQBmkVClTIgUDH0Rpt3s1p0s +EASAANEPAAAAAAD3AA6gkgCdAAx5EaaZLpKe9cAPE+IAnQAlkp0NeworssMLVQFkUdCwjZ2oZV7d +YABjAAAAAAAAAOokAAnYBIAA7RIFKmAEgABYgo/SoNEPAMCgWcoMGuagiKj5H/IYkPz1AP/5WA2g +BQUAAAAAAAAA+kBoHaAbxQD8ACIdoA0VAFiI+mP/scBQwOoOiDT5QQYVr/iuAB3mtC3QgC3cN/rj +ABXk3R0A7U0ICVAEgAD9oGAV4AwVAFiI7WP/ewAAAAD4QoYdr/oOAAAAAIon/SBoHaALFQDqrCAq +aASAAFh8HPoghhWv+0oAizDzYAi6kgCdAOISBCvnAoAApswkxp3RDwAAAAAAAADrEgApUASAAFgA +52P+MAAA6iQADGAEgABYAmWJMYsTiBLsrBENKASAAOy7CAT1nYAA2iD9AGgd4AwFAFgCK4gUpaWl +TAx9Eabd7NadLBAEgADRDwAAAAAA//aUDaAFBQCNNYw0HuaB+mDoFeAJJQD8cAAHsK1xAPsvAAy7 +jCEA+yAEANPMAQDozAgP+AqAAP+AAQZ93QEA7rsBBnA5AADuuwwGYGkAAA29LA3MKP1gAEW/9boA +KyAH2iD6IwAF8AwVAPtiQBXgDQUAWIimY/5fwKBZyaoa5j6IqB3mPPkf8PiQ/PUA//joDaAFBQAA +wFDA2g2NNP1BBhXv+KoAsEsMuxHrWwgJUASAAPtiABXgDAUAWHmns0ziEgQr7wKAAKbdLNad0Q8A +AGwQBIk3F+ZPKzAW+cyMBaMqBQAKKigLtgnoqAgLNwKAAKhm52cICQEKgAD0+GgVoAwVAODNGgMz +UwAA7nLEIzIBAADmQRZ0wCEAAIsymOCek5aSDbsCKHbEmzLRDx/mOq+vKfLBALEE7fLFLnAKgAAO +mQL5+CYV7/71AA7dAw2ZAR7mMuVyxClvAoAArt2Z0I8ymFDmhgApAQqAAOWGAS4gCoAABP8CKHbE +nzLRDwAAbBAKGeYnCSkKKJJ/4hYIKVAEgAD7AAQA0AYVAOYWCisoCoAA+CCGFeBVTQDi5h4RY7kA +ABvmEPnL3AWjLQUA7aooDT8CgAApkn+cFRzmF6h36HK5JMv9AAD9QABCM5kBAJkZ5EKhJmIRAACs +rJwXq6r6IMYVoGMFAPiABAIwAG4AAIoawLD9/+IdoGMFAOxVAwUDCYAAmxotcrgEXgEO3QGdEAEA +hwM2YGg+1YoYixeNFfggyBWv//UA4zkJAfKBAADuFgkszwKAAOmICA8BCoAA4ogIBGMLAADogqEr +SAqAAA+ZA+lEAQZiAQAAC4AAY/+kihmLFLGqCgpDKrZ/0Q8AAABsEAQb5ekqIgAPAgArsn8e5ef7 +TwANcy8FAA+vKA7+CCniwyjiwv3LxAXv+/UAC5kD6YsBDWcCgAD9gABGf/T1AP2ACBWgAxUA+Q7g +HeANBQAZ5dgY5cf5AABGfywBAOz8CAX9RIAAyykI6jApwsMv4sQJiAzo+xN+gQqAAC/iwgA4GgSI +Awj/AS/mwv2gIBXhux0A5LAsZmDBAAB/txRj/8QAAAnqMPmYZhXv/4YAAAAAAAD9oCAV4bsdAOW/ +3GZgwQAAWDVmwCDRDwBsEAQmIQn4QpAV7/gFACcgFeiYAQs2AoAA6JkMC7kCgAAHZgL4QoYd4AcF +ACc0APhgZh2gBBUABGYCljEV5XkkVq3RDwAAAABsEAQW5agV5YPTD6YiBTUCJSaAJCKAZ0ALbQgF +KCKAZ4ACY//z0Q8AbBAEE+WfIjaKY//8AAAAAGwQBCggBSUgB4o19f+iHaADJQD9AWAR0VUBAMAg +0Q8AAACIKRnllJor+wAH3CIAnQAJWQkpnQIrkQgpkQQa5Wf7IARj4gCdAIsiDwIAe6h/2iBYeOyL +Ig8CAAO6AWSvuoonBLsB6yYCJVDBAABYhwfj5WAVARGAACigAAOICoiM7KAHLVgEgAD6QGgdoA1F +AAuAAGWv4YknZJ9/KpkUyqaKmWSvdSigAAOICoiM7KAHLVgEgAD6QGgdoA01AAuAAGWv4WP/VAAA +//9YDaAKBQDaIFh43ysgIuq7DAlQBIAAWHor2lD6ACId4AwFAFh75IsiA7oB83/7JmIAnQAtIAcE +vAGcIvOf+JARvQEA67wfKVAEgAD8ACIdoA0FAFiHh8Ag0Q8AAAAA6yAiKVAEgABYehcqIAXB436h +DGioKYsi82AEBX/8ZgAvIDrAj3j56vpAaB2gCwUA/AACHaANJQBYeU1j/9cAAPpAaB2gCwUA/AAC +HaANJQBYeMVj/78AAGwQCogrHeUuLiAhizf8YMgVoP/lAA/uAS4kIQ3MAQy7DOuJCHjIBIAAwCDR +DwMAhgkCYZsVKCAFJSAHx034IQYV4AMlAP0cAEHRVQEAiimbK/tAB9xiAJ0AG+UmC1sJK70CLLEI +K7EEGuT9/WAES6IAnQCMInyof9ogWHiCiyIPAgADugFkr6CKJwS7AesmAiVQwQAAWIad4+T2FQER +gAAooAADiAqIjOygBy1YBIAA+kBoHaANRQALgABlr+GJJ2SfZSqZFMqmiplkr1sooAADiAqIjOyg +By1YBIAA+kBoHaANNQALgABlr+Fj/zoAAP//WA2gCgUA2iBYeHUrICLquwwJUASAAFh5wdpQ+gAi +HeAMBQBYe3qLIgO6AfN/+yZiAJ0ALSAHBLwBnCLzn/fAEb0BAOu8HylQBIAA/AAiHaANBQBYhx3A +INEPAAAAAOsgIilQBIAAWHmtKiAFweN+oQxoqCmLIvNgBAV//GYALyA6wI94+er6QGgdoAsFAPwA +Ah2gDSUAWHjjY//XAAD6QGgdoAsFAPwAAh2gDSUAWHhbY/+/AABsEAQc5NMrMgQpMBb9YAQFtZkd +APUgCACSAJ0A6uTOFIiBgAD/yZoFr/3lAOTkpxSktQAALKF+aZUdfLMKKswE+2AIo6IAnQArIAaw +uwsLR+skBiWCwYAAwCDRDwAsoX7sswx2eBEAAP9gB+PiAJ0AKCAGsIgICEfoJAYsfuYAAIkniyIq +mRQNuwGbIouZZKC2KLAABIgKiIzaIP1g8BWgDTUAC4AAwCDRDwAAiyKKJw27AesmAiVQwQAAWIYq +yawooAAEiAqIjOygBy1YBIAA+kBoHaANRQALgABlr+GJJ9MPZJ9yKpkUZKBkiplkr2cooAAEiAqI +jOygBy1YBIAA+kBoHaANNQALgABlr+Fj/0YAAAAAAAAA6iQACdgEgADsRAAK6ASAAFh5a8Ag0Q8A +6iQACdgEgADsRAAK6ASAAFv/RcAg0Q8A//0UDaALBQD//mQNoAoFAIg3IuJ/CYgR+EAAQT/7kgCI +NyLifwmIEfhAAEE/+/IAbBAEGuRgKKLfZIALCeowK6LgC5kMZ5AB0Q9Ye5PRDwBsEAQe5HAnIAcd +5Ej9yHYFoPcRAA/tOZ0wiSD+QQQV4AslAPxgRhWgGgUA6jYDLM4CgAD7JgAMcXcBAPhgJhWgLgUA +5iBsK7wCgAD35gAP8Ao1APsmAA4wDQUA6ORbE3EogAAb5FomIQidNZwxnjMc5FgHbwIL/wIrIQmc +Np80BLsCIiAHnTmVO/lmAA2xIgEA6zYKKRQCgAACYgIIIgLiNggtEASAANEPLiEJCP8CnTWVN580 +BO4CCO4C7jYGLZAEgADRDwAAAGwQBBjkKx7kPSwgBx3kFhnkP/pBBBXg/BEA/80ADvHMAQDtNgAu +ZAKAAAy7Agm7AuOAgCmwBIAAHeP+/EAIFaAOBQCeZe1mAiG43QAA+sCGFeR3HQDqfP8uZgKAAOx8 +Ag1XAoAA7GYBJVPhAACaYwIEiZlmk2cGIIvlIQkkQ/cAAPTBZhWkMx0A5WYKK5AEgADoAAUDKMEA +AG05AgUCYdEPAAAAAAAAAGwQBh3kGQsrEa2zKjJ/+UAIFaAEBQD5oEAl4AYVAOfd5CTLgQAA6bkI +BAGxgAAsMngvMnv5gAVsYgCdAGXxEiw2fCsyeSs2e91ADeQWAQIAlKAN5BYsCgn8QAXEIgCdAC8y +e8HA7eQBF4N5gAAiMnwqIQSOIPPh/g2mugEAJDZ89G9mFaAAHgAuNnztrwEFw/0AAAj/Au8lBCWM +WQAAIjJ8sMzvMnshAPGAAMnGY/+/2iBYe65loL8qIQT/QSAMFpoBAMiZ0Q8A2iBYe6HRDwDaIFh7 +Y9EPAPpAaB2gCwUAWHwz0Q8uLPjq0ogvAQqAAPzAAQXf/PUADLsDC6oBKtaIWcx8JDZ8JDZ7+m/o +Fa/86gAAABXjmS9QWGTwalnCYVh7Fihy39MPyIFYeuspUFhknyxYeuXIrhXjzixSa7DM7FZrJgLJ +gABYem5j/xEAAAAAHOPI/m+IFaAKVQD8b0gV4AtFAO0WACFr5QAAWcmQ+m/oFa/7OgAuMnviNnwv +ejYAACI2e9EPH+O8L/KucfaL9qsGHa/+IgAAAAAAWcIo+q1mFa/+kgBsEAQU47QZ47To45AZXsKA +AKS0I0J/qYjouAgBgiGAACoyAHipAipCexzjpisxBCpGfwy6Aeo1BCnQBIAAWHthzqkpMQT/IQAM +FtkBAMjX0Q/aMFh7VdEP2jBYexfRDwD6QGgdoAsFAFh759EPI0Z/0Q8AAGwQBPBg8A3v+fUAiCIJ +OQMJiAEoJgKKJw8CAA8CACqsMFiFB+PjYBUBEYAAKKAAA4gKiIzsoActWASAAPpAaB2gDUUAC4AA +Za/hiSfTD8uSKpkUyqWKmcmsKKAAA4gKiIzsoActWASAAPpAaB2gDTUAC4AAZa/h0Q8AAAD//1wN +oAoFANEPAABsEAgd41Mb43cU4zD3xuoFoBjFAOMs6CXTgQAA+EANzCczAQAMNRGkVehSnilmwoAA +psQpQH/5ABBT4gCdAChSnWSB/5sR6gseDUgEgACZEAoghgsCZQsCYw0AhwkCYQkCYe3HCAkBCoAA +/8a+BeAOFQDj4yofcAqAAJ4Tr8/+IIYV7//1AP/XAA9wBkUA/iBGFaAAwgAAAAAAipnJrCigAAOI +CoiM7KAHLVgEgAD6QGgdoA01AAuAAGWv4SlCIGSQ7y1AfCxAfR7jSQ3bCQe7Cu7eCAXYYwAAirIu +4IBkoTj9x/4NoAgVAC8KAA2POA//CQf/Ci/9GC/8nC/yGywKAQzcA/HhIA3nzAEADMsJB7sK7ER8 +JdhjAADA0PyPph3gDAUAjbDvUp4m8/8AAC7g///gBHuiAJ0AL1Kd9t/gFaD49QDx58AN52YBAHhh +dOoSBCZABQAA6ER9JuPhAABYeuSJE9Kg6xICJIBpgAAqogILqgEqJgKKJyqsMFiEjsmsKKAAA4gK +iIzsoActWASAAPpAaB2gDUUAC4AAZa/hiSdknxcqmRRlru//+7gNoAoFAIwRixAMgIYMYIYLAmkL +AmfRD48RjRAuRH8PwIYPoIYNAm0NAmvRD5sR6gceDUAEgACYEAoAhgsCYwsCYQ3ghwgCb+jsAAnQ +BIAAWcGJZK+v7eLTGa8CgADkVQgJZsKAAPeAAEI/+TIAwLH7twAN8AwFAPyPph2nuwEAK0R8C7sJ +92ABBfAMBQD7YwAl7/uaAAAAC2CGC0CGCgJnCgJl0Q8AAGwQBBjinQIDRwwzEagzKzKEGeKtKLAA +irEJiAoKIYwCCj6IjAMCPvxAaB2gDSUAC4AAIjaE0Q8AbBAEFOKPAgNHDDMRpDMkMoSKQSZAAChA +CPqYaB2gqSUAAgU+AwI+eYElGOKZCGgKiIzqVAAKWASAAPxAaB2gDSUAC4AAIjaE0Q8AAAAAAADr +JAAKUASAAFh6q/NAaB2v/y4AAAAAAABsEARZxQcS4nQT4pQMAgApIoIJGo4DqAqIhAuAAGP/62wQ +BBPipCMxfqIy0Q8AAAAS4rMD6DAE7jAFsTCTIJQhlSIS4q8T4nOEIAQzApMgEuKtwDqEIAQzApMg +EuKrwDAoN0AoN0QoN0goN0wjPQFyM+0S4qbAMJMgxy8T4qUDIwMS4qSEIAQ0AZQgEuKjhCAENAGU +IBLioYQgBDQBlCAS4qCEIAQ0AZQgxy/AMQMjAxLinYQgBDQBlCBj//wAAAAS4pqDIAMTFA8zEZMg +EuKXwDAjJgBX/9YQ4paRAJIBkwKUAwQCMJQEBAAwlAUEATCUBhHikIIQAeowohEB8DHAQATkFgAC +ABHijIIQIxoAAyICkhAR4orAIZIQBOQxhAYEATGEBQQAMYQEBAIxhAODAoIBgQAA0jABIwAAEOKB +kQCSAZMClAMEAjCUBAQAMJQFBAEwlAYR4nuCEAHqMKIRAfExwEAE5BYAAgAR4nOCECMqAAMiApIQ +EeJ0wCGSEATkMYQGBAExhAUEADGEBAQCMYQDgwKCAYEAANMwATMAABDia5EAkgGTApQDBAIwlAQE +ADCUBQQBMJQGEeJlghAB6jCiEQHyMcBABOQWAAIAEeJaghAjSgADIgKSEBHiXsAhkhAE5DGEBgQB +MYQFBAAxhAQEAjGEA4MCggGBAADUMAFDAAAAXJQBXZQCXpQDX5QAQwAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFyQAV2QAl6QA1+QAFMAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACclAAdkAGdlAKelAOflAQI +lAUJlAYKlAcLlABDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnJABnZACnpAH +HZADn5AEeJAFeZAGepAHe5AAUwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANyU +AB2QAd2UAt6UA9+UBASUBQWUBgaUBweUCAiUCQmUCgqUCwuUAEMAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAADckAHdkALekAsdkAPfkAS0kAW1kAa2kAe3kAi4kAm5kAq6kAu7kABTAAAAH//8wADSMRD/ +/goAAAAAAB///SQA0zEQ//4KAAAAAAAf//2IANQxEP/+CgAAAAAAAPQwCgAAAAAA9DAKAAAAAAD0 +MAoAAAAAbBAIJyAHiCIW4Sv7wk4F4XcBAOWA8WvXAoAAGOEkLoCA5qoIB3DdAAD9U8gVpO4dAK5O +7eEfF3AJAAD/gAhLoAmlACqinQt8CizCwwyqAeoWAiUH+YAAiNj3AAjwkgCdAC9iruzhFReFwYAA +KmKtLMJ/7KsBBHP9AAD9QAUmIgCdAJ7Y/UAFLiIAnQAvIBSk/w8PRy8kFPXgB65SAJ0A+CBIFeeF +AQD5AAdxUgCdAOg8ECIMPQAAsEptqQUIAIYJAmHAUIgSjTLtJhkiS/0AAOsyASzPAoAAqYiYE/Ng +CkBQCgUA6hYALYtKAACLEOtLCAvnAoAA5swIBdv9AADrxp0qkASAANEP6iQACdgEgADsRAAK6ASA +AFh8cdKg0Q8AwLAJjDTs1ggt+x4AAI0iZd/V+kBoHaAbxQD8ACIdoA0VAFiC4GP/v//8DA2gCgUA +AACOImXvsC2AgC3cN/rjABXk3R0A7U0ICVAEgAD9oEAV4AwVAFiC02P/jMCgWcPXHeDMiNj5H/bA +kAmlAGP/nNogW/rdY/8GAI4nnhGI6fvCpBXvyQUA5ekUJ2CBAAAJyQHpvQgKVwKAAOpVDARAQQAA +mOkIVTLl5RQm6QEAAP0ACDriAJ0AaKs9qKsrvPD7oATT4gCdAO8SAiIMdQAAsE5t6QUIAIYPAmEr +wgELqwjlyQQl28EAAP1gBsxiAJ0A68YBLcAEgABkUKn1AGgd7/qWAAAAAAAA6iQADuAEgADsFgQs +WASAAFv8NYsxiBONFOoWAC1nAoAA7IgIBfT9gADaIPsAaB3gDAUAW/v7jRDtrQgKkASAAO1NCAv3 +AoAA5u4IBuv9AAAt5p3RDwjdDPogSBXk/R0A0w9t+QUIIIYLAmMrEgLvTwwEwQEAAO27CAeMQQAA +Lvz/bekFCECGCwJlL8kEDagMqJgojDDoxgEv+tYAACqcQJrB+4AGFaAIBQD5gIQdr/0WAAuIDPnB +JhWv+9oAKJxA+YAmFa/8sgBsEAQd4HIa4HMc4HEt0rgqoX8swo+j3eo6DA7uQoAA/YAARnALBQAr +xAQrxAVZF2T6QGgdoAsFAFv8qtEPAAAAbBAEGOBlKYJ/KjAHLZECLpEE/SCkFaAPBQDrkgAmiRGA +AO7s/yaT/QAA4pUCL3cCgADuuwgOZwKAAP1vAA2wAMYAK5EFLZEEsbv/v+AVr7sBAOuVBS93AoAA +/WAGvGIAnQCMkO7MCA3fAoAAC8sMCwCHD99g6wAHBvMngAAe4EcpkQUr4n8JmRGp2e3ifSWGEYAA +jNGL0JvAi9CcsZ/Qn9Er4n+wuyvmf/WgBhwfuQEAjNn5owAVr8kFAPkABAR/EgUAotIrJjr/ogQd +5UkFAOnVESQhAQAA5NYHLS8CgADk1gYqWASAAPWABOQiAJ0AJdUQ6FgIBHgbAADsjEAn+gEAAP3g +BGOiAJ0AyTLpRAAFAIGAAG2pBQMAhgkCYSsiQqtY/wAFjGIAnQDoJkImk+EAANEPL5UF//yYDaAL +BQDApf3ALgWgOyUAWcW7wCDRDy3igIzRi9CbwIvQnLGf0J/RK+KCsLv70EYV7/z6AADAwPsP6BWg +DRUAWHTEwCDRDwAAAAAAAADv1gkmk+EAANEPAMsw+mBoHeBcxQDsrDYKcASAAG3JBQsghg4CY/hg +AEXwXkUAfqENL6ys0w9t+QULQIYEAmUpjfvpJkImk+EAANEPAAAAAOQmQiaT4QAA0Q8AAGwQBIIj +AgJB0Q8AAGwQBIUjgyAU3+v4QIQVoVUBAOrf6RquwoAA5FQIAYC5gAD7AAQENpg5AAmIAiglBCJC +f9EPHd/gE9/hH9/hJkJ+KyEELkJ/kmCWIaP//WAEBfbLOQAMuwKvX+8mACcoBQAAJUZ/IkZ+6yUE +KpAEgADRDwAAbBAEiiBloFAd39LqIgMp9sKAAK7d/a/oFeAMFQD8gEAGMaoBAAaqAg3ILAjdKCcl +Be3MDARYBQAA/W0ADD/7xQDrqgEMTkKAAAlZAgOqApojCYgCKCUE0Q+PIxvfvg8PQQv+EavrLbJ/ +Gd+4LLJ+ctkZ2cDzI94NoAwFAMDALLZ/LLZ++kAIFaAARgDYwPMMRg2gDAUActEcjSGa0I4gKbJ9 +neGcIOwmASTL/QAA+W+mFe/9WgAZ36QY36SpiKjoeKEg6rZ/L4EuAADNrSqyfWqiGC2ye/1v5hXg +AEoAAAAAAAAA7LZ/J/8pgAD6QAgVr/6mABzflYghrJmp6fkPAAzwDAUACcg4+W/GFa/+KgBsEAT1 +vyIF4AYVAPRAaB2gAjUA9oBAAzAAHgAAsCIoUn/oY/dyq4EAANEPAGwQBPRDqBWjIwEA8loACThT +HQAEIgqEJoIhBUQoCkQRpCLRD2wQBIgnG9999QKCFe/HBQDiggkpMASAAOmBFSQggQAA50QBAqkB +AADlhRQhEwEAAOKGCSIhAQAA9EFSDaAKRQACkggihgkLAIft320ZKASAAG2qAgUCYZ0gjGDA1OMm +Ai5mAoAADcwCnCHRD2wQCi4iAioiGA8CAPHdjA3nNQEAHN9hLiIA/UAIFeA7BQD/QLAV4ApVAFnE +9yoiEiQgB/o+AAQwBzUA9QAMWJFEAQAKyFH1AAxwkgCdABzfU/5NMBWgCxUA+H/AFeFqQQD8wGgd +4ApVAOm5OQ9HAoAA+MYACzA7BQDpFgAreASAAFnE4RzfMerfMxpIBIAA9IAHahIAnQAMSxGquy2y +nvegC+nSAJ0AK7KdDE0KLdLDDbsB6RYIJYpJgAAsIQcd3zgMDErv3zgeZwKAAA3MApywHN81/kAI +FaM9BQD9YOYV4AkFAJm46bYGK1cCgACauf1gphWgGoUAmrMZ3yzv7gIPRgKAAJ60KbYCB4gCKLYB +KBIIGd8Q798mHEcCgAAJiAgnhp0uIhIqIhAP7gLuJhIpWASAAFjl4vRgBFESAJ0AiicPAgAPAgCN +rPtGABWgCwUA6t4MBushAAAO2zlYgDT9vioFoDsFAO0kAA0YBIAA/mBoHaAKVQBZxKPSMNEPAB7e +9I3o5BYIKAQKgAD3oAS4kgCdAAybEaq7L7Ke9+AFSdIAnQArsp0Mnwov8sMPuwHksJdmw/0AAJjo +6RYILffmAABgADnAINEPKRoACaoC+kJGFa/5vgArKgALqgL6QkYVr/myAAAA+gCiHaA7BQDs3vIZ +aASAAFnEg2AAFAAA6iQAAlhhAAD8AAIdoA01AFiA1GgyQsAg0Q8AAAAAAAD/+jwNoAsFAMCgWcHU +Ht7IGt7Jjegc3sSJGPm/+riSAJ0A//3UDaALBQDAsMDKDNw0/cEGFa/9mgAf3s6fFI4g2iD9vawF +4AwVAO0WBi92AoAA7O4CANhBAADuFgUq6ASAAFh/zsAg0Q8AAABsEBiSEI4gFd7LiSOLIYoiKhYi +KxYk+CRmFeAEFQD0IOYVoAgFAPggphWgDEUA/CFGFaANNQCdGfQgxhXgDyUAnxj1vXoF4A+lAP4i +BhXgDbUA/CImFeAMxQD8IkYVoAiFAPghxhWgBJUA9CHmFaAJdQD4IaYV4AtVAPohZhXgCmUA+iGG +FaAL1QD6ImYV4ArlACoWFPW9UgWgCfUA+CKmFeAIRQCYFIYWKxIkiRUnYX4sEiIiYX8HmSgvUICp +KfidiBWjmQEAA5kK7pIAL1AEgAAmYj4tEiOo7gtgAI4XLBIkLRIiB+4oL1CBri74nagVo+4BAAPu +Co7gKhYW6hIjLVgEgACo7gtgAI4YLBIWLRIkB+4oL1CCri74ncgVo+4BAAPuCo7gKhYX6hIiLVgE +gAAI7ggLYACOGSwSFy0SFgfuKC9Qg64u+J3oFaPuAQAD7gqO4CoWGOoSJC1YBIAAqO4LYACOGiwS +GC0SFwfuKC9QhK4u+J4IFaPuAQAD7gqO4CoWGeoSFi1YBIAAqO4LYACOGywSGS0SGAfuKC9Qha4u ++J4oFaPuAQAD7gqO4CoWGuoSFy1YBIAACO4IC2AAjhwsEhotEhkH7igvUIauLvieSBWj7gEAA+4K +juAqFhvqEhgtWASAAKjuC2AAjh0sEhstEhoH7igvUIeuLvieaBWj7gEAA+4KjuAqFhzqEhktWASA +AKjuC2AAjh4sEhwtEhsH7igvUIiuLvieiBWj7gEAA+4KLuIAKhYd6hIaLVgEgACo7gtgAI4fLBId +LRIcB+4oL1CJri74nqgVo+4BAAPuCi7iACoWHuoSGy1YBIAAqO4LYAAuEhAsEh4tEh0H7igvUIqu +LvieyBWj7gEAA+4KLuIAKhYf6hIcLVgEgAAI7ggLYAAuEhEsEh8tEh4H7igvUIuuLvie6BWj7gEA +A+4KLuIAKhYg6hIdLVgEgAAI7ggLYAAuEhIsEiAtEh8H7igvUIyuLvifCBWj7gEAA+4KjuAqFiHq +Eh4tWASAAKjuC2AALBIhLhITLRIgL1CNB+4oKEL5ri76IGYVo+4BAAPuCo7g6hIfLVgEgACbEaju +C2AAjBEuEhQtEiEvUI4H7igoQvquLvogRhWj7gEAA+4KjuDqEiAtWASAACsWI6juC2AALhIVLBIj +jRMH7igvUI+uLvifaBWj7gEAA+4KjuDqEiEtOASAACcWIujuCAvYBIAAC2AAjhEqFiQpEhItEhWP +FSsSEywSFOgSESf4QQAA7xYFJdhBAADrFhMmYEEAAOwWFCRAQQAA6BYRJuhBAADtFhUkyEEAACkW +Eo0fiRyIG4weix3vEhAkQEEAAOgWCyZgQQAA7BYOJdhBAADrFg0n+EEAAO8WECTIQQAA6RYMJuhB +AACdH4kWjRmPGusSByIhAQAA7BIIJuhBAADtFgkn+EEAAO8WCiKoQQAA7xIEJmBBAADsFggl2EEA +AOsWByTIIQAA6RYGJ/v9AADvFgQv4iYAAIkQjxOLEo6QiJOMko2Rq4inzKrdr+6ekJ2RnJKYk9EP +AGwQBCkiFfigAATwOHUA6YwMASBBAADzIABFP4sFAOukECVQRQAA+QAF02IAnQArCgBZvZEsIhUr +IhTtzREJQASAAPxCRhXugD0A/WsADbAJNQD6QmYV4AolAG2qDI6EDg6O7oYEJEARAAAPAgDTD9MP +bZoh6YIEJEBBAACKgYuCjIMJCY4KCo4LC44MDI6ZgJqBm4Kcg+tEAAlQBIAAW/62iiCIIokhjyMI +CI4JCY4PD44KCo6aIJ8jKSYB6CYCKUAEgAAZ3X0CAIYDAmH4AAoV4Am1AG2aAggAitEPAAAAAAAA +AP2BABWgCwUAWb1i+EBoHaAJRQDTD22aIemCBCRAQQAAioGLgoyDCQmOCgqOCwuODAyOmYCagZuC +nIPqJAAKWASAAFv+lNpA//v8DaA8hQAAbBAGKSIV+EKIFaBGBQDTD/iAAEV1mQEACWYMdKsBsYgq +JhUGKgzoJhQlUUEAAPaAB7OiAJ0A6zQAC2AEgABZvTb4QGgdoAlFANMP0w9tmiHpggQkQEEAAIqB +i4KMgwkJjgoKjgsLjgwMjpmAmoGbgpyDJSwQ6iQACtgEgABb/nEGRwz24AWO0gCdAOY0CArQBIAA +9uBoHaADBQDkFgAqQASAAPjIaB2gCUUACgJnCECGCgJlCCCGCgJjCACG6gwACUAEgABtmiHpggQk +QEEAAIqBi4KMgwkJjgoKjgsLjgwMjpmAmoGbgpyD6iQACtgEgABb/lTqVAABmAUAAOZswCIhAQAA +722aakAEgACLEAo8EQvLCOx8DArQBIAAWbz+0Q8AAAAAAADrNAAKYASAAFm8+dEPAAAA9mAARjAD +BQD8IAYVr/8mAGwQBBjdERndDxrdDRPdEJMjmCKZIfpABhWgCwUAKyYVKyYU0Q8AAABsEAbeIOTi +ECpgBIAA50IHK9AEgAD7ufwF4Bg1AONCFSmQBIAA53IOIvvpAAB4+ycY3P4I+AqIgJoTnBLuFgEs +ACKAAACTECqynexUAAlYBIAAWb7PZKXH8oKmFeACBQDRDwAAAAAr4hILm1LuFgEl/0GAABrc5+MW +AClYBIAA6qK/KuAEgABZvsJkpXoa3ODbIOqiwSrgBIAAWb69I30F5KbPYZoBAAAa3NrbIOqiwyrg +BIAAWb6290fgDeOGBQAa3NTbIOqixSrgBIAAWb6wZKbEGtzP2yDqoscq4ASAAFm+q/tAQogSAJ0A +KzDlwVj1YCvgYgCdAGm3ISU05YsQ+oKmFeACBQDRD5MQKrKV7FQACVgEgABZvp5kpwKLEPqCphXg +AgUA0Q8AkxAqsqPsVAAJWASAAFm+lmWvGvogaB2gC7UAWOJc+gAiHeADBQDqszgFAOGAAOoSAitY +BIAAWb0CyKkc3LGNEQysNizWF2UzJY0Q/IKmFeACBQDRDy5AbmTu0pMQKrK57FQACVgEgABZvn9l +rr/6IGgdoBtlAFjiRfoAIh3gAgUA6rI4BQCpgADqEgIrWASAAFm87Cx9AyrFKGUi0Y0Q/IKmFeAC +BQDRDwAAkxAqsqvsVAAJWASAAFm+a2Sitxrcitsg0w/qopcq4ASAAFm+ZmWuWvogaB2gC1UAWOIs ++gAiHeACBQDqsjgFJ+mAAOoSAitYBIAAWbzSLEBv8YAnPtIAnQBkpN+KE/oAoh3gDNUAWOIJ0qDR +D5MQKrKx7FQACVgEgABZvlBlrsf6IGgdoBslAFjiFmSiNStAbmS3b+oSAitYBIAAWby+LEIWCsw2 +LEYWixD6gqYV4AIFANEPkxAqsq/sVAAJWASAAFm+PmSiMxrcXdsg6qKpKuAEgABZvjllrm36IGgd +oAvlAFjiAGSh2+oSAitYBIAAWbypK30CKrUUixD6gqYV4AIFANEPkxAqsqHsVAAJWASAAFm+KmSi +KhrcSNsg6qKtKuAEgABZviVko4ca3ETbINMP6qKbKuAEgABZviBlrgf6IGgdoAt1AFjh5mShdStA +bmS24xrcOYsS6qLnK2AEgABZvhZlpkYrQG/AyAy7AitEb4sQ+oKmFeACBQDRDwAAkxAqsrfsVAAJ +WASAAFm+C2Sh7xrcKtsg0w/qopkq4ASAAFm+BmWtn/ogaB2gC2UAWOHMZKENK0BuZLZqGtwfixLq +oucrYASAAFm9/GSmeStAbywK/Qy7AStEb4sQ+oKmFeACBQDRDwCTECqyn+xUAAlYBIAAWb3xZKG3 +GtwQ2yDTD+qikyrgBIAAWb3sZKLaGtwK2yDqorMq4ASAAFm952SsXxrcBtsg6qK7KuAEgABZveJl +rEwa3AGLEuqi1StgBIAAWb3dZaRSixErshILmVLImWiSB/kgD2HSAJ0AjBErxhLygqYV4AIFANEP +kxAqso/sVAAJWASAAFm90GShehrb7tsg6qKRKuAEgABZvctlrLT6IGgdoAslAFjhkcqiGtvmixLq +oucrYASAAFm9w2WslIoT+gBCHeAM1QBY4XPSoNEPwCDRDwAAAPogaB2gC/UAWOGDZK/q6hICK1gE +gABZvC3rEgAj4AsAACrFFfqCphXgAgUA0Q8AAPogaB2gGxUAWOF3ZK+6LUBuZNUGKUBv8T/hl5IA +nQDxP+FX0gCdAOoSAitYBIAAWbwbLkIXCu42LkYXixD6gqYV4AIFANEPAPogaB2gC6UAWOFlZK9y +L0Bu0w9k9HbqEgIrWASAAFm8DShBNPsADwKiAJ0AihP6AUId4AzVAFjhRNKg0Q8AAAD6IGgdoBtV +AFjhVWSvMuoSASpYBIAA7BICK2gEgABY4LSLEPqCphXgAgUA0Q8AAAD6IGgdoAuVAFjhSWSvAilA +bmSUGRrbnYsS6qLnK2AEgABZvXllolwrQG+NEPyCphXgDBUADLsC+o3mHeACBQDRDwAAAAAAAAD6 +IGgdoAsVAFjhN2SuuhrbjIsS0w/qoucrYASAAFm9aGWrKYoT+gAiHeAM1QBY4RjSoNEPAAAAAOoS +AitYBIAAWbvW9UAV8pIAnQDHL9EPAPogaB2gC4UAWOEj+gAiHeACBQDqsjgFAUmAACxAbg8CAGTD +gxrbe+sSAitgBIAAWb1QZaJuLUBvwOgO3QItRG9lLjWPEP6CphXgAgUA0Q8A6hIBKlgEgABY4Rll +r5wrMOVj+nMAAAAA+iBoHaAbBQBY4QlkrgIoQG7TD2SC9eoSAitYBIAAWbuxKUIYixArRhUKmTb4 +gwYV4AIFANEPAAD6IGgdoAs1AFjg+2StyhrbUIsS0w/qos0rYASAAFm9LOPbVR0HLgAAixErshIL +yVHImWiSB/k/+RHSAJ0AjhGMEAO9AS3mEvyCphWgAgUA0Q9lLYSPEP6CphXgAgUA0Q/qEgIrWASA +AFm7kCpFNIIQ8oKmFaACBQDRDyV9BPSwABXgCwUA+qBoHaCMBQBZuyHqEgIq2ASAAFjhFysw5cDE +DLsC+nwmHae7AQD6fKYd7+X+AC0w5fogSBWgDiUADt0C7TTlK1gEgABZu3grMOX6fIYdr+VuAACK +ElmuWy8w4n+pFIoSWa5Y3KDqEgIj2BMAAFm892Sht8Ci/bY+BaA7BQBZwKPHL9EPGtsRixLqos8r +YASAAFm87mWuPosRK7ISC8lRaJEKaJIH+T/xadIAnQAe2xIDvQEO3QKOEYwQLeYS/IKmFaACBQDR +D4oT+gEiHeAM1QBY4JLSoNEPAAAA+iBoHaALRQBY4KNkrGoa2viLEtMP6qLNK2AEgABZvNTj2wAd +BWYAAIsRK7ISC+lRyJlokgf5P+4R0gCdAI4RjBADvQEt5hL8gqYVoAIFANEPGtrnixLqotcrYASA +AFm8xGWtlosRK7ISC5lSaJEKaJIH+T/sKdIAnQAf2uqCEe+/AgPoFwAA7yYSJuoBAAAs0OXA4Q7M +AizU5fKCphXgAgUA0Q+KE/oBAh3gDNUAWOBk0qDRDyN9BSM8gCsw5cDBDLsCCwtH+nymHe/gEgAA +ABrayIsS6qLPK2AEgABZvKRlrReLESuyEgvpUWiRCmiSB/k/6DHSAJ0AHdrLA7wBDcwCjREs1hKL +EPqCphXgAgUA0Q8AAAAAAPbgAEMwCwUA+sBoHaCMBQBZuqLBUOoSAitYBIAAWOCYKzDlBbsC+nwm +Hae7AQD6fKYd794SAAAAKzDlwMgMuwILC0f6fKYd792+AIoT+gDiHeAM1QBY4DTSoNEPihP6AgId +4AzFAFjgMNKg0Q+KE/oBQh3gDMUAWOAs0qDRD4oT+gEiHeAMxQBY4CfSoNEPAIoT+gECHeAMxQBY +4CPSoNEPihP6AkId4AzFAFjgH9Kg0Q8AihP6AiId4AzFAFjgGtKg0Q+KE/oAwh3gDMUAWOAW0qDR +D4oT+gDiHeAMxQBY4BLSoNEPihP6AMId4AzVAFjgDdKg0Q8AbBAIIyAH2iDyIAAB8AuFAO0UAAng +BIAAWH0G7dqAFQbJgACMIA3MApygG9p9iifoEgApzwKAAAuZCOiWACUAkYAALqIML6ww/8AE5WIA +nQDxRcAN4AMFACOlFPtEABXvzAUADLsB6KIMJdkBAACbqeumCCVIwQAAeYlfHNpC/bTSBe/+9QCe +oJMn6tN6dVghAAAtwn0Z2mSb0ZmjKMJ9KKYCL8J/68Z9J/gFAAAvxn8jJAQjJAWTIiMkICMkISMk +IiMkI5MpkyqTK5MsIyUa8kNkHeACBQDRDwAA2iBY9JH6QOgVr/5eANogWPSO2iBY9IKKJ2P/WACO +ImTgUwUPR2jyaMAg0Q8ALsKA6+YBJmgLAACdoynCgJmiKMKC68aAJEAFAAAoxoIjJAQjJAWTIiMk +ICMkISMkIiMkI5MpkyqTK5MsIyUa8kNkHeACBQDRDysgB9og+iAABfAMBQD7YwAV4A0FAFh8BWP/ +kB/aEJ8UjiDaIP20WgXgDBUA7RYGL3YCgADs7gIA2EEAAO4WBSroBIAAWHsPwCDRD2wQBIgiZYCf +JiAHF9nxBgZB6jIFK0cCgACniCuCniSsH/mz0AXkRB0AdLN/KIKdCWsKK7LDC4gB7YQABAPBgAAc +2fMMAIdtSQIIAmGINB7Z857QKSIAHNn06tYDJthBAADs1gIszgKAAOlJAgHggQAA6dYBKVAEgAAL +gAAMaBH3AABEd/UBAOSGnSeUdQAAiif6AUId4AwFAPtEABWgDaUAWG8I0qDRD8Ag0Q///iANoAgF +AOokAApoBIAA+sMAFeAMBQBYe8bAINEPAGwQBIcnKnkUH9nO+OKkFe/NBQDocgglUAcAAOxyCyVS +gQAA6pN3c9iBAAANuwGrmejBdHTJAQAALo0B6nUUJ1KBAADqk3F8MASAAHmhfZp47wAFCzgEgAAH +AmEHAmEHAmEHAmEHAmEHAmEHAmEHAmEHAmEHAmEX2bOXYIUgk2WUZPOzogWgB6UA4mYCKq4CgAAH +VQLlZgErEASAANEPwCDRDwAAAAAAAPeAaB2gCAUA+OFmFa/+cgAImgwKugwqrQEqrOD64QYVr/4i +ACy8QPzhBhWv/fYAAGwQBMePCFgDCDgCCEgDqGjoIggLgQqAAAIiGKIy0Q8AbBAEBDgDCFgDqGjo +IggLgQqAAAIiGKIy0Q8AAGwQBAQ4AwhYAQhIA6ho6CIIC4EKgAACIhiiMtEPAAAAbBAEBUgDCDgB +CFgDqGjoIggLgQqAAAIiGKIy0Q8AAABsEAQT2Z0DIgLRDwBsEA4jIhAoMAUpCpJ5iRspIhL/IqAD +EIYFAOXZlRTgNoAAcJcKKjBuaKEZwCDRDwDr2ZEUvdiAAAubAfpCRhXgAgUA0Q8jIhge2YyNOowi +JAoB/6YADrC9UQDtNgomBtGAAAIqAljzvRjZhS8yEQj/Ai82EYkiZJDJGNlamBSOINog79l/ENhB +AADvFgYvdgKAAPXGAA8wDBUA/iCmFaANJQBYelrAINEPAI4+hDcb2W/kQg4ncAUAAOvrAgDgwQAA +/mHGFa/99QD8IaYV6JsdAOnEAilQBIAA+4BmHeiZHQD5gCYd6JkdAOnEACDYgQAAWPIrKCISDwIA +BYgC5ogCCdAEgADoJhIiWAsAAFj97vwkABWgDTUA/gACHaAPBQDp2VkdWASAAOkWAClQBIAAWb+Y +wCDRDwDaIFjcwGWvM2P+5ysgB9og+iAABfAMBQD7YwAV4A0FAFh7FmP/GgAAbBAEJTEN0w/TDwxV +EeokAArYBIAAWDyD66QABQI5gAAY2RgqMQ0IAIfotAAFAGmAAG2pAggCYSoxDW2pBQQAhgsCYdog +/KBoHaALBQBYPDopIhIq+n8KmQH4QkYV4AIFANEPxy/RDwBsEAgjIhgZ2S4oMhEJiALoNhEpUASA +AFjzpyQgB9og9CAAAjALhQDtFAAKYASAAFh7neykAAUKEYAAGdkUiCDpiAIJ0ASAAPmABhWgG6UA +Wb/zHdkPjD7qEgAqXwKAAK276rYAJgB5gADrMhApUASAAAvAAIon5KAOZXjBAACOrP/ABy1iAJ0A +8UZgDeAEBQAkpRT7RAAV78wFAAy7AeiiDCXZAQAAm6nrpgglSMEAAPkABUViAJ0AHNjP/bHsBe/+ +9QCeoOQmByVYIQAA+6AGI6IAnQAtwn0Z2PCb0ZmjKMJ9mKIvwn/rxn0n+AUAAC/Gf5QulC8kJhAk +JhEkJhIkJhMkJhQkJhUkJhYkJhckJhgkJhkkJhokJhwkJh0kJh4kJh8kJAQkJAWUIiQkICQkISQk +IiQkI5QplCqUK5QsJCUaJCUb+mBoHaALBQD8AAIdoA0lAFj3D8Ag0Q/aIFjzDfpA6BWv/U4A2iBY +8wraIFjy/YonY/8PGNjLLzIRjiII/wLvNhEnAZmAAAUJR2iSQ8Ag0Q8owoDrhgEmeAsAAJ+jLsKA +nqItwoLrxoAm6AUAAP2QRhXv/PIAKyAH2iD6IAAF8AwFAPtjABXgDQUAWHqHY/+1H9iRnxSOINog +/bFyBeAMFQDtFgYvdgKAAOzuAgDYQQAA7hYFKugEgABYeZHAINEPAAAAbBAGGdiEmRCIIPyAaB3g +DBUA4xYCLEYCgADsiAIJUASAAOgWASjYBIAAWHmE0Q8AbBAMKyIYK7IHK7IOKiIQKLAiLbAhLLAg +LrAcI7Ad77AeLmYCgADtzAIPdgKAAAPuAi2wAOOwHy92AoAAD+4C77AjLmYCgADozAIPdgKAAOPu +Ag5mAoAAD8wC/48ADDXdAQD9BEAgUDP1AC+iEn7xCA/oDGaAAi6mEi6iE3zhCA7JDGaQAiymE/2s +wAZQKjUA+6AMrCAsRQD9oA4EIC5lAP+gD2wgPyUA/6ARbGIAnQBz0RDAov2w7AWgOwUAWb3mxy/R +DyiwGCmwGeqwGixGAoAACYgC6bAbLEYCgAAKiAIIiBEJiAKxiPhCxhWgAgUA0Q8jIhBkMHEpsBAq +sBEtsBrssBIszgKAAAqZAuqwEyzOAoAADJkC7LAZLM4CgAAKmQLqsBgkhSkAAAiqEQyqAuywGy1W +AoAADaoCCKoRDKoCsarqJhYkhKUAACkiEuvYURTAKIAAC5sBKyYSLDAFLQqV/YALFGIAnQDAINEP +AAAssBQtsBXusBYuZgKAAA3MAu2wFy5mAoAADswCCMwRDcwC/ZagAFCFBQAtIhKEN+RCDibjHoAA +/CSAFejsHQD/oEYdr//1AO8WCClQBIAA/aBmHajOHQD9oCYdqMwdAOzUACXIIQAA6QYAAMBhAADo +gx4A2EEAAFjw7igiEuWIAgJYCwAA6CYSKVAEgABY/LL8IgAVoA01AP4AAh2gDwUA6dgdHVgEgADp +FgApUASAAFm+XGP/NQAAACqwGCywGe2wGi1WAoAADKoC7LAbLVYCgAANqgIIqhEMqgKxquomFilQ +BIAAWOEUwCDRDyywGC2wGe6wGi5mAoAADcwC7bAbLmYCgAAOzAIIzBENzAKxzOwmFilQBIAAWOCl +wCDRDwAALbAYLrAZ77AaLu4CgAAO3QLusBsu7gKAAA/dAgjdEQ7dArHd7SYWKVAEgABY4MvAINEP +AAAAAPpgaB2gC2UAWPyowCDRDwAALrAYL7AZ6LAaL3YCgAAP7gLvsBsvdgKAAAjuAgjuEQ/uArHu +7iYWKVAEgABY4ELAINEPbBAIKCAEJCIY96+wBaAZhQB5gQPAINEPikr/XsAM0IvlAC9AeHvx6ywg +BRjX2O7X2BZ/EYAAJSISKSITKzELCFUBJSYSjTmrmX3oNy4iESkmE/KgBd5SAJ0AZODmiux8p7GI +6/vAaB2gCwUA/AACHaANJQALgADAkOkmESyQBIAA0Q8A/a+IBaAKJQD+QAgVoDsFAFm9LSkiECmQ +BSoKlfs/+4QiAJ0AikrzX/s00gCdACMiGI06jCLAQfemAA6wvVEA7TYKJgSJgADaIFjx4B/XqC4y +EQ/uAi42EYgiZICCHdd9nRSJINog7NeiENhBAADsFgYszgKAAPUmAAywDSUA+CCmFeAMFQBYeH3A +INEPHNehjeD/wLAVoApVAPQgBhXgOwUAWb0JLiISwJD4QiYV77/1AA/uAe4mEiyQBIAA0Q8A2iBb +/utlr0rAkOkmESyQBIAA0Q/aIFja9WWve2P+sAArIAfaIPogAAXwDAUA+2MAFeANBQBYeUtj/2EA +bBAKKCAEKiIYKQoY6YEIfTgEgADAINEPi6r/fsAM0I3lACygeH3B6y0gBR7XfO/XfBb/EYAAKyIS +mhgOuwIrJhLzYCajUgCdAI4siDYlMCD6YUQVr/TFAP8ACw0lZQEACgpOKqzb9UAEBTCEtQD1gBRU +IgCdAA+7AvvAAESwPBUA+EGGFeAkJQD6QkYV4CoVAPrCRg2gL1UAf2EKfGEH9MArDSIAnQAuMDAo +MDEpIGjqMDIvdgKAAAjuAugwMy92AoAACu4C6O4RBMgZAADo7gIMggqAAPRGRBWhnp0A9SAjV1AM +BQD9MAAUNa4BAAiqAhnXTJ0ZmxaJkhvXSuUWBypuQoAABJks6LLcJINxgACXFSWy/Cuy9KqI5VIU +LEZCgAD5YABFsA8VAG2ZTClRBIdQ/yAAFLWKHQDpdwgMR4KAAAh3DCd9//bn6BXkmgEAAJEEAPga +6HcBDIIKgAD9gCAVoXedAOpKCAOAcYAAiLpyiQSJvn6Re6vb/a5WBaAKJQD8QAgV4DsFAFm8kCog +BSsiGJsVmhkc1yWPFYgZiSCO8O/weCtoBIAA+CAGFeAKJQD4ICYVoDsFAFm8hCgiECiABSkKlfkf +8lRiAJ0AiRiJmvM/8fTSAJ0A+kBoHaALBQD8AAIdoA0lAFhorsAg0Q8AAADvEggl/PmAAC/weC2w +BfpCJhXgirUA++AaRSCYpQD5oBoEIJm1APmgGcRiAJ0AKgqW+6AZbCIAnQAsCpn9oCCVIgCdAMLR +/MAIBGAOhQDC9f7AB7RiAJ0AKDBBLDBALTA8KTA97zA+LmYCgADozAIO7gKAAAndAigwP+kwQi7u +AoAAD90C7zBDLmYCgADpzAIO7gKAAOjdAg5mAoAAD8wCDcgM6iIQJASLgAAvohJ98QgP2AxmgAIt +phItohN80QgNyQxmkAIsphOMvA7MAv1hhhWgKlUA+sAEdCIAnQDD0fzACfRiAJ0AwuH+wBAUIgCd +AMLy/sAdRGIAnQAoEBBkjR1gAxUAAAD4AGId48vhAP0/63YiAJ0AKTAkLDAl6DAmLM4CgAAMmQLs +MCcszgKAAAiZAgiZEeyZAgVAEQAA+Q0ADX/0/gAAAAAtMCPA8Q39OS20QSywQfwiBh2gKlUA+t/3 +pSIAnQAoMCHxH/t/0gCdACgwQSwwQC0wPCkwPe8wPi5mAoAA6MwCDu4CgAAJ3QIoMD/pMEIu7gKA +AA/dAu8wQy5mAoAA6cwCDu4CgADo3QIOZgKAAA/MAg3JDOoiECSEi4AAL6ISffEID9gMZoACLaYS +LaITfNEIDckMZpACLKYTLTA4LzA5jLzoMDou7gKAAA/dAu8wOy7uAoAACN0C6taOHu4CgAAP3QLu +zAIG6AUAAC0mFpy8+2FmFa/7egAuMCQvMCUsMCHoMCYvdgKAAA/uAu8wJy92AoAACO4CCO4RD+4C +8YAVRhIAnQAvMEwoME3pME4v/gKAAAj/AugwTy/+AoAACf8CCP8R6P8CDxMeAAAqIhDqohgnkvGA +AP9AErPiAJ0AL7YSLTBIKDBJ6TBKLu4CgAAI3QLoMEsu7gKAAAndAu7WZh7uAoAACN0CLbYUKDA2 +LDA0KjA1/GbwFeAJBQDpthUuZgKAAArMAum2Ey5mAoAACMwC7rYLLmYCgAANzAL9YaYVr/hCAC8w +OCgwOekwOi/+AoAACP8C6DA7L/4CgAAJ/wII/xEI/wLu1kwX+AUAAC8mFv9hZhWv924AKiIR0w9k +oUWKpyuhHigKkPlgB+qiAJ0ALQpg/3oAFaAKJQD9rIAFoDsFAFm7oWP8cgAA/+6EDa/69QAAABzW +OukSBi7wBIAA/WAIFeAKVQD4IAYV4DsFAFm7li0iEvpCCBWgTgUADt0CLSYSLjBBKzBALDA8LzA9 +7TA+Ld4CgADuuwIOZgKAAA/MAi4wP+8wQi5mAoAADcwC7TBDLd4CgADvuwIOZgKAAO7MAg3eAoAA +DbsCDL0M97/SABIAnQAtohJ80QgNzwxm8AIsphIsohP7n9E0YgCdAAy4DGaKG/tCZhXgAgUA0Q8A +APohCBXgCQUAKSYRKrIHKTwg+0HIFaAMNQBtygUJAIYKAmHAINEPia7TD/kmABXgDGUAKjwgbckF +CiCGCQJjwCDRDxzV/+gSBy94BIAA/2AIFaAKJQD4IAYVoDsFAFm7WmP7VYoYLDELiqe/zPtDxBXr +zCEADM0RKdww+X/1k+IAnQCJruXPqmTIwQAAY/mAACwwOC0wOe4wOi5mAoAADcwC7TA7LmYCgAAO +zAIIzBENzALq1eQWYAUAACwmFvthZhWv/SoAKiIQKqIYw7D6IAYVp9wdAP2ruAWgCiUAWbs6Y/rV +LzBMKDBNKiIQ6TBOL/4CgAAI/wLoME8v/gKAAAn/AuqiGC/+AoAA+eYAD7/+9gAAAGwQBIknK5kU +6pIJJYBJgADIoVj46NEPAGwQBIgiIyAH8QCgDeEzAQDAINEPAACJJyiZFPchyBWnpQEA5JIJJAnp +gAAV1W8X1Wv5QAnRUgCdAPRgBjoSAJ0ADDkRpZkrkp4HPAoswsP3YAmKUgCdACuSnQy7AWSw1ikg +QPUgCCiQiiUA9SAEaRIAnQD1oAQqkAoFAN1A/oEEFeAMFQD6QGgdp+oBAFh3OST6lyb6aO4iEimf +AoAA9GAAQfAPRQDvNp0hGSEAAPPHRg3gBQUAKiISpqsssicktH0usiaewC2yJpzRJbYm5bYnJVOB +AABZvB4pIhLAgfMvAAzwDwUACY84ZP/J5CQFKVAEgABZvBbAINEPAPrAUBWv/e4AHNU4ishqoX8M +ORGlmSuSngc9Cu3SwygECoAA92AEGlIAnQArkp0NuwFksHewrp7IZb8oiEDrPBgpUASAAP+q7gXn +iMEA+EgGHaAMFQD+gAYV4A1FAFh3J8Ag0Q8AAAAA//sMDaAEBQBj/wspIEAImRD4gAYV7/sCAAAA +AAAAAAD/+1QNoAsFAMCgWbggHNUUisj5X/uQkgCdAP/+SA2gCwUAwLDA2g2tNP2BBhXv/g4AAAAA +bBAGiCIsIAfxAIAN4cwBAMAg0Q+JJy2ZFAUOR+aSCSaEoYAA+cAGaVIAnQAvIEEU1QDr1PweGASA +APHsbA3gBUUA9gACHeANBQDsyhEGJbkAAKSqKKKeC84KLuLD9QAJW+IAnQAqop0OqgHboOwWACUG +gYAALyBBZfDyBw5H72EIK2gEgAD6QGgdoAwVAFh2yww5EaSZ9TOmFe+YdQDoJAUpUASAAFm7vMAg +0Q8AAAAAAAAA//2wDaAGBQAf1NyO+PfABniSAJ0ADDoRpKooop71AAdD4gCdACqinQs4CiiCwwiq +AeSg1mdL/QAA+eEGFe/96gAqIEAIqhD6wAYVr/y2AACPni3wBCfwBR7VGOXwBi7uAoAAB90C7/AH +Lu4CgAAF3QII3REP3QIO3QEl3Gf0jgAK8IeVAPSggBXv/DYAjWCLEOzVChlQBIAA+2MAFefdwQDt +JEAq6ASAAPzABhWgDBUAWHa2wCDRDwAALNxI69xnKXAEgAD+wGgd5LsdAFm6tvtAaB3v+84A//ts +DaAKBQCdEfwgBhWgCgUAWbeuH9SijBCO+I0RG9Se+d/4wJIAnQD/+sgNoAoFAMCgwIoI6DT54QYV +r/qOAGwQBIgiIyAH8QCADeEzAQDAINEPiScomRTmkgkkBxmAAPWpIAWnlQEA+SAG2VIAnQDl1IkR +pZkAAAw5EaSZKpKe90AG2lIAnQArkp0FPAoswsMMuwFksH0tIEHxq5wN4AoFAN1g/sEEFefqAQD6 +QGgdoAwVAFh2Xgw4EfUAAEQwD0UA/xOmFe+edQDuJAUpUASAAFm7TsAg0Q8AF9Rxinj3QAQgkgCd +AAw5EaSZK5KeBTwK7MLDKAQKgAD3YAQKUgCdACuSnQy7AeSwdWVr/QAAnXhlv4GPYOs8GClQBIAA +/6lkBaf/wQD+SAYd4AwVAP7ABhWgDUUAWHZewCDRDwD//HQNoAYFACggQAiIEPjABhWv/H4AAAD6 +ESIdr/0eAP/8xA2gCwUAwKBZt1iKePlf+6iSAJ0A//5gDaALBQAAwLDAmgmpNPjhBhXv/iIAAGwQ +BIoqKKIYKIAFKQpzeYEmiScrmRTskgklgLGAANsg/gBCHaCN5QBYdQ/AINEPAP//qA2gDAUAiK8b +1IjrJgsheIEAAP8ABhXgDAUA6CYJJUjhAAD4QQYV4A0lAP9B5hXvnoUA7iQFKVgEgABYcxzAINEP +bBAEiCLIh8Ag0Q8AAAAAAIk3JCAHKpkU9ahEBeFEAQDtkgklBUGAAOrUGxpPAoAApZkrkp4KTArs +wsMoBAqAAPdgBIJSAJ0AK5KdDLsBZLCC+kBoHaAMVQD+YQQV4I7lAFh18vhhCBXgDwUA6DIJKncC +gAD1wABHcA1FAO3mnSSAgYAAnzuZgIo4mKGfOJ85izwkMEX/ZWAH35y1ACw0BY0uLiw4/7/69SIA +nQD4n/qw0gCdAPpCCBWgCzUAWPjswCDRD9owWbrQY//T//1gDaANBQDrTBgpUASAAPwAIh2gDUUA +WHXywCDRDwBsEAQpMBPxISAN4PWFAPUgBniSAJ0AwCDRDwAAhCeIMCowEYRO4jwYJC18gAD6AAId +4EwFAOpEBCIoDwAA6DASIqixAADoRAUq0ASAAFmz5yRNA/SNgBWgCwUA+oBoHaEMBQBZs+LaUOww +ESlYBIAAWPiN2kDsMBIh2WEAAFj4isAg0Q8AAAAA/BwCHaALBQDqRAIiMAsAAOgwEiMzMQAA6EQD +K1AEgABZs9AkTQP0lYAVoAsFAPqAaB2gjAUAWbPL2mDsMBEpWASAAFj4d6U77DASKlAEgABY+HPA +INEPAACEJ4ROwLDqMBEiSBcAAPssRh2g7AUA6DASIjgTAADolGMr0ASAAFmzuSZNBfbcABWgCwUA ++sBoHaCMBQBZs7PacOwwESHYYQAAWPhfpTvsMBIrUASAAFj4XOokAApYBIAAWPnOwCDRDwAAAAAA +AABsEAQX05oW0+oncsMmYoqkdwl3EadmhG3yQGAlqIMdAPCCQA3nxMEALCRSi20LC18rJFOKbQqK +FCokVIltKSRVKCRWIyRX0Q/ySuYd6IMdAPhKxh2gRQUA9EpGHeAPBQD+SmYd4C6FAP5Khh2v/YUA +LSRV0Q8AAABsEAaIIvEBcA3nNQEA2iBY7eWJIsuVaDJOwCDRDwAAAOoiEClYBIAAWNdraDJpiieM +rPtGABWgCwUA6s0MBmMhAAANyzlYdKDSoNEPACsgB9og+iAABfAMBQD7YwAV4A0FAFh1ZmkysB/T +cZ8QjiDaIP2nZAXgDBUA7RYCL3YCgADs7gII2ASAAO4WASroBIAAWHRwwCDRD8Ag0Q9sEDaJNYUw +96dOBaAEBQD3p0wF4AiFAPkIsg3iVQkA2zD6JgAVoVwFAFmzTPomABXgGGUA6LQRKlAEgABY+A2W +EPwmABWgDSUA+0BoHeAOBQD6QGgdoA8VAFm5ucAg0Q8pMBBokU/1IAYREgCdAGiUBsAg0Q8AAACI +NiRyjAmIEahEJBZghEqESetUAApQBIAAWPrr6RJgLXw+AAApkAUqCpV6mcv6LAgVoAslAFj4HMAg +0Q8AACoyE1j65+SkAArYBIAAWPreZa9U2jBY+klkr56Lp4u+LLKO/NkABzANdQD/oAcOIgCdAPwA +Yh3o7LkA/6AGjiIAnQAY0xf9YEAloA4FAC7EESiCvytyjPigAEQwDSUA5hYALEZCgAD5YABFsA8F +AFm5hsAg0Q8U01+HNiRCjAl3EadEJBZghEqHSIRJ61QAClAEgABY+r1lrs4qEmCKp4quKaKAx7gL +mQEppoCLMAsbQg+7EQuZAimmgCgyABLTB/8CAAfQAxUAKxJgK7AFLAqSfLFDjHJkwKTacFjtXY1y +ZNCqkhiOcNpw79NAENiBAADvFgovdgKAAPPGAA9wDBUA/iEmFaANJQBYc/7AINEPWPkUwCDRDwBk +fp8kchga0xSJSohy+yYADLC5UQDpRgokA8GAANpwWO1GHNMOK0IRDLsCK0YRjXJk0GqSFI5w2nDv +0wkQ2EEAAO8WBi92AoAA88YAD3AMFQD+IKYVoA0lAFhz5MAg0Q8AAAAAAADqchAr2ASAAFjWv8Ag +0Q8AK3AH2nD6IAAF8AwFAPtjABXgDQUAWHTBY/852nBY1mFlr5Rj/gYAACtwB9pw+iAABfAMBQD7 +YwAV4A0FAFh0t2P/eQBsEASILiMsOHOBLSkiEnqfMosuiLPqJAAKYASAAOu84CroBIAAC4AAjCLt +IAUuAF4AAMjTji5z6dfAINEPAAAAAAAAAPxACBXgClUA/aXsBaA7BQBZuEnAINEPAGwQGCUWGZQe +KyAHIxYehzXoMgQp+ASAAP/h5BXgAxUA8iIGFeG7AQD6IwYV4MhRACwWGvwjyBWg2FkA/COmFeC/ +eQArFhUqwAD/g7AVo/b1AP2HpBXgd/kA/CJmFew4HQD+IAYdoHt1AOzCHyRUQoAADwhJ+CHmFaAA +HgAAlh8Z0tMoEhn8IiYVoA8FAPkv5BXgBAUA+0ARvGeIAQAvFhQJOQz4IuYVr5kBACkWFvUASDES +AJ0AiiL7QFRgkgCdAPDnEA3gDgUA7hYSI4BRgAADOgJZAzLAUPKFQA3gBgUALRIeLdCDDV1CLxId +KxIa/gBiHaAMJQDv7DkL0ASAAFkDEaam8IEADeAK9QApEh4pkioobDAJhjl2oGz0IaYVpLYdAOMW +DCXYBQAA+iNmFeABmgAAACwSE9MPDwIA+4BGGBIAnQAtEh4PAgCN1fG/+7tSAJ0A6xITKdAEgAD8 +IigVoA4VAO4WEijoBIAAWQM9+0BN4FIAnQD+AGId4AUFAAr1OmRRocNglB3yIYYV5IYdACgWGykS +GBPSNR7SMezSMhygBIAA9SAJ4hIAnQDrEhsstwKAAKNmKmKe+0BSS+IAnQAmYp0OmAoogsMIZgEG +awLvwggtsASAAPtgTmASAJ0AKxYF9+BO0JIAnQApMq4a0nj7IExIEgCdAC4yrS2iXu3rAQfT/QAA +/cBLrmIAnQCayP3AS9ZiAJ0AjR4sIBStzAwMRywkFPWATWZSAJ0ALhIdyOspEhbAg/kATqjiAJ0A +ZFDyKhIaDwIAyKFkUGPrZAAJUASAAPwAYh2gHYUAWQMu7hIPLXgEgADmEgwiudmAABzSWC0SFfmk +IAXgCgUAmvKa85r0mvXpaQIPRAKAAOn2AC7ogoAA6N0CCvbCgAD/pgAOsBvFAP3gJhXgClUAWbeb +KxIX+WBJKVIAnQDAIOwSGypvAoAAo90s1p3RDy4SHi7gg/5FAAcwBBUA/iKGFa/2+gCPyPfgSiCS +AJ0A6RIbKjcCgACjZihinvkASnviAJ0AK2KdDk0KLdLDDbsB1rD7YEoIEgCdALD+nsj6wGgd7/q+ +AAD8m0wN4DYFAP/21A2gDQUALxISZPB26xIFKVAEgAD8AGIdoB2FAFkC8xnSIRbSH44cKBAAJmKh +Ce4CGdH0CB8U5oYLD/sCgADp/wIEfJyAACwSEe0SEyNb/wAAKLI/K7F9nqCfoZ2inKObpPlAphWg +AG4ALBIRLRITK2EFiGOeoJ+hm6KYo52knKUmrBgtEhWMHwLdEO0WCC5kAoAA7BYJK7A+AAAuEh0Y +0bv+IYgV4AoFAOoWBi9xgoAAnhcI/wL+IUYV4A8lAJ8b62QACVAEgAD8AGIdoB2FAFkCxosdLxIe +iRbmEh4lkUGAACZgg+/yBSSReYAAiB0GTkDkghhvcwKAACgSHiiAgggGQApmEIwXBu0C/YYADnDf +oQDzqAAWsI+RAP2GAA5w34kA44gQDuiCgAD5pgAOsI+ZAASIEAjMAigSHosaDcwCiIT7QAYV4/31 +AJ2inKUc0df9QGYVqYgBAJikGNHTmKEuEgvpnAElMGEAAOkWBidz/QAA7hYLL3pGAAAvEhT14Cz4 +kgCdAPXgLbESAJ0A9eAucZIAnQD14C8yEgCdAPXgL/KSAJ0A9eAwsxIAnQD14DFzkgCdAI4d0w9k +4E8vEh4v8ipk8EbrZAAJUASAAPwAYh2gHYUAWQKEKBIeG9G1jBr5BUgVo/31AJ2i/UAGFawJBQCZ +o/tAJhXpmLEA6aYELEWCgADopgUlMGEAAOtkAAlQBIAA/ABiHaAdhQBZAnId0aWPGIwZ9iFIFaAJ +BQCZEZkSmROZFJmk+UCmFe/79QCbopujlqDvzAIK9sKAAA7MAu4SHiUwYQAA7cwCANghAADspgEg +6EEAAOocBCDgMQAAWQCM+UBoHeAIFQDqiTkNKASAAOkWISUjOYAAJBYi+gAiHeAKBQAJujjlFiMl +Y5mAABPRhY0ZhBwY0VUf0YTlEh0qJ4KAAPiGAAo2DAUA+CEIFaAKFQDlpTkK8MKAAAX8OfnGAA8w +CTUA/cYADvAIJQAFmDkoFiAOzgIuFhz9hgAOcAUFAPwj5hWgBH4AAAAAAAAA//dsDaAGBQDA4P/3 +yA2gBgUAiB38I8gV5AwFAPZgAAcytikA8QsADeAGBQAt0irtxjkN24KAACwQAP9gAARw38kA690Q +DmICgADs7gIMRQKAAPnGAA8wz8EA9ZAAFjCPeQD9hgAOcN+pAP9AphWg77EA4O4RDuvCgAD/pgAO +sO+BAOyIEQ92QoAA/wYADDHvaQAE7hH/BgAMMO+5AO2IAg9yQoAADr4CDIgCjRqdoBzRE5yhCO4C +/sYADzAIJQAI7gKepBjRPpiiHtE9/0BmFa/2LgAAAAAA+gACHeAGBQD//UwNoA4FAAAAAAAAAJmh +lKCeop6jnqSepZ2mnaedqJ2pLxIg5VwBJTChAAD+oBGcYgCdAOtkAAlQBIAA/ACCHaAthQBZAe/k +UFFqzsKAAPSgCmCSAJ0AKxIfx+/7JgAM8A0FAOOZAgv9LgAAjRMsEh6OEo8Ri8wswhCZoZup9UAG +FaAIBQCYopimn6OepJ2nnKWMFP1BBhWv/iYALRIdLBIcG9EQDJkC65kCBoQZgADw4kAN7/71AJmh +lKCeop6jnqT/QKYVoA0FAJ2mnaedqP1BJhXv/TYALxIeIhYlK/IWJvE4IvE6LPIV6PE5KzQCgAAG +IgIm8Tst8hvu8hosRAKAAAhmAijyFy/yGZ+inqOdpJymm6eYqJalmaGUoJKp8iSoFa/79gAAAAAA +AAAA8OJADe/79QCZoZSgm6Kbo5uk+0CmFeAIBQCYppinmKj5QSYVr/s6ACwSHo0SL8E7JsE5KME4 +LsE668IYKzQCgADm/wIMRAKAAAjuAibCFIjMLMIQm6SYp5aomaGdopSgnKOfpZ6pjBT9QMYVr/oa +ACsSHewSHCWDUYAAG9DOx+/9JgAMsA0FAOuZAgOA8YAAmaGUoJ6inqOepJ6lnaadp52o/UEmFe/5 +MgAuEh4iFiUt4hIs4hMr4hiI7YbuL+IUgu8u4hGeop2jnKSbpZimlqefqZmhlKCSqPIkqBWv+FYA +KxIfx9/7JgAM8AwFAOOZAgOA8YAAmaGUoJ2inaOdpJ2lnKacp5yo/UEmFa/3mgCZoZSgjhP+ICgV +4AgFAJiimKOYpJimmKeYqJ+l/0EmFa/3CgAqEh4Z0KCKpRPQOiUSI+QSIiVMMIAA49A2E4PhgAAc +0JqLHAy7Avs/RhXv4n4AJRIQwNL3rQAK/+MCAADApf2hJgWgG8UA7j4RCegEgABZtdVj9uX6IsgV +oA4FAJ4RnhKeE54UWP94JBYi5RYjJV9hgAD6IsgVoAsFAFj/ayQWIvQkZhXv71oALxIR+/+50JIA +nQBj9rUa0FeIHAqIAvk/RhWv4J4AAMCgWXiEyKcb0HgrsH1ksSwqEhZY/2PpEiEtXB4AAPoiyBWg +CxUAWP9W+CQoFe/twgDcYOoSDClYBIAA/CPIFeAOFQBZAAj3QGgdr+nyAAAA3GDqEgwpWASAAPwj +yBXgDjUAWQAA90BoHa/pdgAAAADcYOoSDClYBIAA/CPIFeAOdQBY//j3QGgdr+j2AAAAANxg6hIM +KVgEgAD8I8gV4A61AFj/8PdAaB2v6HYAAAAA3GDqEgwpWASAAPwjyBXgDsUAWP/o90BoHa/n9gAA +AADcYOoSDClYBIAA/CPIFeAO1QBY/+D3QGgdr+d2AAAAANxg6hIMKVgEgAD8I8gV4A71AFj/2PdA +aB2v5vYA6xITKdAEgADsEhEo6ASAAFkApmP2MQAAKxIejB7tEhkpUASAAFhrUNKg0Q8AAAAA+6BY +BaFLFQBZn7ssGgAMrAL7oE4FoUsVAFmfu2P+swDAsMDaDf00ncj7f7RwkgCdAPpAaB2gG8UA/AAC +HaANFQBYcbZj/6AAAAArEhj6QGgdoAwFAO0SGyXYYQAAWHGvY/+EwKBZsrMcz6iPyPn/sOCSAJ0A +Y/+42iBb6blj9k+KJ40ewMDqrCAu2ASAAFhk3NKg6xIbKmcCgACjzCvGndEPAAAAAAAA/9cMDaAG +BQAAAADdkP2f/gWgCkUA+gMCHeAORQBZtT7/2GQNoAVFAMCgWbKYHM+Mj8gez4n5/7V4kgCdAP/b +WA2gBgUAAAAA/9r0DaALBQDA2g39NP2BBhXv2voAAAAAbBAEFM/rgiAkQn8Tz+oEIgwDIgLRDwAA +bBAOJCIU2yDsFAAKUASAAFkQI9Wg9UAIFCIAnQAYz4LoAAUAyEEAAAkCYQkCYQkCYQkCYR/P3B7P +3B3P2YwgnRb+IUYVoAhFAO8WBC5mAoAACMgCmBUvUActEQD7n6gFof8BAOPMAg/8AoAAD90CDt0C +nRgpID38IeYVoAslAJsdCpkC6RYMKAQKgAD0YAVRkgCdAIlHKJkU5ICTZPCBAACLmYzg//gCHeAk +hQDv7wEFgjmAAG0ILnvBPCiwAC2wB3SBMyrhBe+pCA7vAoAA7bsIBMkBAADpuxV96ASAAOvUAAaA +qYAAY//KAAAAAAAA+28ADr//rgD7jwAMcAkFAAibOGWwROscECrQBIAA/ACCHaANJQBYHwvRDxrP +pSlBKfs/98UiAJ0AY//sAAAAAP/9vA2gCwUAAAAqHEr6R8AV4AxlAFmvLGP/SMJ2irgKjVd30WIq +4QWvpua6enXpAQAA69QABoGRgAB7wSoosADTD9MPdIEgLbAHDwIADN0R7bsIA0kBAADpuyR96ASA +AOvUAA7+tgAA+48ADPAIBQAJizhkv19j/6MAAAAAAAAA+28ADr//cgAtID0KCEN42ZMpsC9ok42K +IAiqEQo6Apq70Q8AAAAAAPuvAA6//hoAbBAGKCAFLCAHwZQPAgD5ABB1YcwBACkiAmWRwy0wARbO +++vO9x44BIAA/6FABtAPpQAuIShl4lfuzvQeTwKAAPWACtISAJ0Appkokp6cEAvLCvcAEZTSAJ0A +K7LDKpKdC6sB6xYBJY5JgACK6PdADriSAJ0AKGKu7c7mFAv5gAAsYq0t0n/tywEFQ/0AAP2AC15i +AJ0AmOj9gAtmYgCdACkgFKSZCQlHKSQU9SANddIAnQAezuobzuCMIPggKBXgCgUAKrY27swCDm4C +gAD9Z4YVoA5FAA7dAi22NRvPPtyQ6w8eDdAEgAAMAmcLQIYMAmULIIYMAmMLAIbsDAAE2QEAAArg +hgsCbwrAhgsCbQqghgsCawqAhgsCaS4xASghCS0gBywwARvPLCohJPwgAAYw3REA6t0QDmQCgAAN +zAIMqgIdzyYsISILqgIqliANzAKLIB3OzCiWIy6WJCyWIv1gABWwDCUADLsCK5YhijPqliUkyAcA +AO0AFQTKYQAACQCKDHgRpoj/E6YV5+UBAPnABrlSAJ0AwCDRDwAAiuj3QAfgkgCdAAx5EaaZLZKe +C3sKK7LD96AIZNIAnQAtkp0L2wFksQCwrZ3o6xYBLfTmAAD8IAYVoAFmAAAAAAAA6iQACdgEgADs +RAAK6ASAAFhqEdKg0Q8AAAAAwLAPqTTp5ggt9OYAAPpAaB2gG8UA/AAiHaANFQBYcIBj/8EAAOok +AArYBIAAWGu+0qDRDwCLEPpAaB2gDBUA+2MAFeANpQBYcHZj/5fAoFmxeh7Oboro+V/w+JAPpQBj +/6raIFvogP/5NA2gD6UAAIon60QACmgEgAD7RAAVoAwFAFhjoNKg0Q8AAAAA//dcDaALBQDAuAub +AvpARhXv/R4AAAAA/CAGFaAKBQBZsWIezleK6IwQG85T+V/3eJAPpQD//CgNoAsFAADAsA+tNP3B +BhXv+/IAAGwQBiggBSYgB+c0AArYBIAA+AKCHeAFNQD5AA+dYWYBAAsIR2iCFIoiF85DGM5A5GQA +BQPJgADAINEPACshPWWx4Ygng4j7AqQV78wFAOmCCyRwgQAADOwB7LsICn8CgADsFgAl2QEAAPMg +DfxiAJ0ALYkUo/qv3S2FFPtgDeuiAJ0AyXXJQ9kwbUkFBwCGCQJhiuAPAgAPAgCvqvtAEKxiAJ0A ++8AGFa/9/gDsahEDJPEAAAeqCCuing8CAPdgCtnSAJ0AKqKdCGsKK7LDC6oBZaBP62wYKVAEgAD8 +ACIdoA01AFhwGMAg0Q8AG84Sibj3IAygkgCdAAxKEQeqCCyinveADQHSAJ0AKqKdCEwKLMLDDKoB +5KGOZOv9AAAttghkr68Zzi+ZoIgg/5zwBeALFQDrpgIsRgKAAAWIApihiDMv8n//nDQFqIgdAKj/ +n6PuABUFSEEAAP+cGgXgCAUAsYjpgx4MD+gAAJ+mGc5o+UEGFeAYBQCYp44gCO4RBe4CnqkMTRGn +3SXWnY4iLCAGiScL7gLrzl8WYAUAAOwkBiTIgQAAiJH9IIIV78wFAAycAe4mAiRDQQAA6JYBJujB +AADtlQQmYQEAAHyLIiqRBR3N6aiomJGdgIwg64YCLmYCgAAFzAL9ACYVoAIFANEPHc3hnYCMIBvO +R+uGAi5mAoAABcwC/QAmFaACBQDRD9ogWGsP0qDRDwAAAP/6xA2gCgUAWAAnY/4XAADzIGgd4A4F +AP8BZhWv974A47oMA4G5gAAKSxTsvAgrwASAAOxMNgnIBIAA0w9tyQUIAIYJAmGJEKp4600MBMkB +AABt2QUIIIYJAmOLEAr8DKy7K7xA+8AGFe/2igDAoFmwtRvNqYm4GM2m+T/y+JIAnQD/+fwNoAoF +AMCgwNoNnTT9YQYV7/nCAI8QL/xA/8AGFe/1pgAAAGwQBhLNnBfOE/WbSgWgE5UA+FDIFaCmJQAq +IoJ/pyArIoJ/txgqIoQsoAgloAd2wTeIRMCgC4AABTMMZT/a0Q8tIoQpIocqIof5YAAE+6qBAHqZ +MArqMCtCRcPCDLsoq6r6nAYVr/7qAC6hCy7s+A4OQ+7s/CLr/QAA/6IACr/+zgAAAAAMAgAvIoJ/ +/8Ul0AduW7/ccPoAoh2gCwUA/qAAFzD/BQBZsyAlXPHKWygKcZgRwKFZqKf6ICgV4An1AAlZNpkQ +CbsM+iAmFeAKBQBZiqKKEApVDGVf18ChWaid+g4iHeAKBQBZipxj/2UAAGwQBiggBS8gB8GU+QAU +zWH/AQD0ICYVp4UBAJgS9QAPuRIAnQCJIhbNV+vNUx+gBIAA7c1THJGWAAD14A9CEAe1AO8WAC/X +AoAApqosop4L+worssP3gBW74gCdACyinQvLAee0AAWSiYAAjtj3wBL4kgCdACxirurNvBYQKYAA +L2KtK6Lz6/wBB0P9AAD74A+OYgCdAJjY++APpmIAnQArIBQpMAermQkJRykkFPUgEbXSAJ0AH82t +n3CJIPwAgh3gBRUA5XYCLM4CgAANmQKZcYg2Gc2njK7/mpAFoogdAAmIAajM/OBmFaArBQDuABUD +yEEAAAkAipt3Gc046XYGIeDBAADsBx4DwIEAAAgCY+7jBQPgwQAADAJhL3YQiCDldhIsRgKAAA2I +Aih2EYwziqwMjBSsqup2EyP5gQAA7gAVA9FBAAAKAIopdhbrdhch0EEAAApghg8CZwpAhg8CZS0w +AY8zGM2D8aAFF9AchQAtIAcVzYD6RIQVoN0RAOMxAS7qgoAACN0CLXYgiyApdiIsdiP9YAAVsAw1 +AAy7Aut2ISPIBwAA7uMFBMpBAAAJAmEJAmEuIAcoIQny5SYV4BmlAP7lBhXgCwUA63YlLEUCgAD5 +BgAMce4BAOh2Ji90AoAADq4CBe4C/uSGFaAJtQDsEgIqbwKAAKbdKdad+YAHuVIAnQDAINEPAAAA +AP//fA2gCYUALiE9ZO4G/iAGFeAD7gCO2PfAB+CSAJ0ADEoRpqooop73AAij4gCdACyinQtICiiC +wwjMAevEAAYIQYAAsOmZ2Oe0AA3wfgAA/iAGFeABUgDqJAAJ2ASAAOwSASroBIAAWGhN0qDRDwAA +wMDAugvrNOvWCC5wpgAA+kBoHaAbxQD8ACIdoA0VAFhuvGP/wQAA6iQACtgEgABYafrSoNEPAIsQ ++kBoHaAMFQD7YwAV4A21AFhusmP/l8CgWa+2Hcyqjtj53+y4kgCdAGP/qgAAAOvEAAlQBIAAW+a5 ++5o6Ba/2/gCKJ40RwMDqrCAu2ASAAFhh29Kg0Q//9TwNoAsFAAAAAAAAW/78/iAIFe/0BgD+IAYV +4AoFAFmvnh3Mk47YjxAbzI/53/d4kgCdAP/8PA2gCwUAAAAA//vgDaAMBQDAygzsNP2hBhWv+94A +AAAAbBAK5CIHKlAEgACIIv5A8BWvzwUA5UEVLWcCgADsPAgCIIEAAA9EAaRU5ExALlgEgAD1gCXS +oe4BAC2wB+zc/i2wBIAA5IAIZugNAADAINEPH8xx7RYAJcCBAACYEx3MbPUAJJqiAJ0A5cxsHyAE +gAD1wB9iEgCdAAzrEaW7KbKe7hYBJkAhAAD5ICWbogCdACuynQ3oCiiCwwi7Aee0AAWgGYAAjfia +FNMP96AiyJIAnQApUq7rzNIUoEGAAC5SrS+y8xvMVQ/oAegWAibL/QAA/8AfhmIAnQCZuP/AH8Zi +AJ0ALiAULWAHrt36IIYVp90BAC0kFPWgIW3SAJ0AGczDH8zDjiCINO3MWhpfAoAA5bsID3YCgADx +AAT6UAU1AINjKiEkBewCKCAHLmEB/OBGFeAUhQCUc/zgJhWgiBEA7MxFHEKCgAD5BgAMcAQFAPjg +BhWgCCUA7AAFA+BBAABtigIMAmEtIQksIAeUdf7hJhWgOKUA43YILu0CgAD5pgAOscwBAO12Bi5k +AoAADKoCD6oCmnQpIQkCKgL+wCQVoAwFAOW2nSzdAoAA+WYADbANBQBYaU7AINEPiBOIgPWAIBWg +iRUA9cYACjeIwQB5iRmUce/MixZL/QAA/uAGFeGZHQD44EYV4ABSAJRxiBMZzIiZcIiBCFgUmHKP *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Apr 30 03:45:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8EA11581919; Tue, 30 Apr 2019 03:45:47 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 501358A437; Tue, 30 Apr 2019 03:45:47 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD3DE4081; Tue, 30 Apr 2019 03:45:46 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U3jkSm037564; Tue, 30 Apr 2019 03:45:46 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U3jkFC037560; Tue, 30 Apr 2019 03:45:46 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201904300345.x3U3jkFC037560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 30 Apr 2019 03:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346941 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 346941 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 501358A437 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 03:45:48 -0000 Author: jhibbits Date: Tue Apr 30 03:45:46 2019 New Revision: 346941 URL: https://svnweb.freebsd.org/changeset/base/346941 Log: powerpc: Stop pretending we run on e500v1 cores Unconditional writing to MAS7, which doesn't exist on the e500v1 core, in a TLB miss handler has been in the code for several years now. Since this has gone unnoticed for so long, it's easily concluded that e500v1 is not in use with FreeBSD. Simplify the code path a bit, by unconditionally zeroing MAS7 instead of calling a subroutine to do it. Modified: head/sys/powerpc/booke/locore.S head/sys/powerpc/booke/trap_subr.S Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Tue Apr 30 01:25:02 2019 (r346940) +++ head/sys/powerpc/booke/locore.S Tue Apr 30 03:45:46 2019 (r346941) @@ -250,7 +250,8 @@ __start: ori %r4, %r4, (MAS3_SX | MAS3_SW | MAS3_SR)@l mtspr SPR_MAS3, %r4 /* Set RPN and protection */ isync - bl zero_mas7 + li %r4, 0 + mtspr SPR_MAS7, %r4 bl zero_mas8 isync tlbwe @@ -505,7 +506,8 @@ bp_kernload: ori %r3, %r3, (MAS3_SX | MAS3_SW | MAS3_SR)@l mtspr SPR_MAS3, %r3 isync - bl zero_mas7 + li %r4, 0 + mtspr SPR_MAS7, %r4 bl zero_mas8 isync tlbwe @@ -696,7 +698,8 @@ tlb1_temp_mapping_as1: mtspr SPR_MAS1, %r5 isync mflr %r3 - bl zero_mas7 + li %r4, 0 + mtspr SPR_MAS7, %r4 bl zero_mas8 mtlr %r3 isync @@ -736,20 +739,8 @@ tlb1_inval_all_but_current: blr /* - * MAS7 and MAS8 conditional zeroing. + * MAS8 conditional zeroing. */ -.globl zero_mas7 -zero_mas7: - mfpvr %r20 - rlwinm %r20, %r20, 16, 16, 31 - cmpli 0, 0, %r20, FSL_E500v1 - beq 1f - - li %r20, 0 - mtspr SPR_MAS7, %r20 -1: - blr - .globl zero_mas8 zero_mas8: mfpvr %r20 Modified: head/sys/powerpc/booke/trap_subr.S ============================================================================== --- head/sys/powerpc/booke/trap_subr.S Tue Apr 30 01:25:02 2019 (r346940) +++ head/sys/powerpc/booke/trap_subr.S Tue Apr 30 03:45:46 2019 (r346941) @@ -765,7 +765,8 @@ search_failed: mtspr SPR_MAS2, %r27 mtspr SPR_MAS3, %r23 - bl zero_mas7 + li %r23, 0 + mtspr SPR_MAS7, %r23 bl zero_mas8 isync From owner-svn-src-all@freebsd.org Tue Apr 30 06:04:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7638C158481A; Tue, 30 Apr 2019 06:04:31 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E68A68DC53; Tue, 30 Apr 2019 06:04:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9D635800; Tue, 30 Apr 2019 06:04:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U64UKW010570; Tue, 30 Apr 2019 06:04:30 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U64TZt010566; Tue, 30 Apr 2019 06:04:29 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904300604.x3U64TZt010566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Apr 2019 06:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346942 - in stable/11/sys/dev/cxgbe: . common X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 346942 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E68A68DC53 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 06:04:31 -0000 Author: np Date: Tue Apr 30 06:04:29 2019 New Revision: 346942 URL: https://svnweb.freebsd.org/changeset/base/346942 Log: MFC r341620: cxgbe(4): Fall back to a basic configuration in case of any error during card initialization. This is an expanded version of r333682. Break up prep_firmware into simpler routines while here. Load the firmware/config KLD only if needed. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/common/common.h stable/11/sys/dev/cxgbe/common/t4_hw.c stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Tue Apr 30 03:45:46 2019 (r346941) +++ stable/11/sys/dev/cxgbe/adapter.h Tue Apr 30 06:04:29 2019 (r346942) @@ -172,6 +172,7 @@ enum { DF_DUMP_MBOX = (1 << 0), /* Log all mbox cmd/rpl. */ DF_LOAD_FW_ANYTIME = (1 << 1), /* Allow LOAD_FW after init */ DF_DISABLE_TCB_CACHE = (1 << 2), /* Disable TCB cache (T6+) */ + DF_DISABLE_CFG_RETRY = (1 << 3), /* Disable fallback config */ }; #define IS_DOOMED(vi) ((vi)->flags & DOOMED) Modified: stable/11/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/11/sys/dev/cxgbe/common/common.h Tue Apr 30 03:45:46 2019 (r346941) +++ stable/11/sys/dev/cxgbe/common/common.h Tue Apr 30 06:04:29 2019 (r346942) @@ -603,6 +603,7 @@ int t4_flash_erase_sectors(struct adapter *adapter, in int t4_flash_cfg_addr(struct adapter *adapter); int t4_load_cfg(struct adapter *adapter, const u8 *cfg_data, unsigned int size); int t4_get_fw_version(struct adapter *adapter, u32 *vers); +int t4_get_fw_hdr(struct adapter *adapter, struct fw_hdr *hdr); int t4_get_bs_version(struct adapter *adapter, u32 *vers); int t4_get_tp_version(struct adapter *adapter, u32 *vers); int t4_get_exprom_version(struct adapter *adapter, u32 *vers); @@ -734,11 +735,9 @@ int t4_fw_hello(struct adapter *adap, unsigned int mbo int t4_fw_bye(struct adapter *adap, unsigned int mbox); int t4_fw_reset(struct adapter *adap, unsigned int mbox, int reset); int t4_fw_halt(struct adapter *adap, unsigned int mbox, int force); -int t4_fw_restart(struct adapter *adap, unsigned int mbox, int reset); +int t4_fw_restart(struct adapter *adap, unsigned int mbox); int t4_fw_upgrade(struct adapter *adap, unsigned int mbox, const u8 *fw_data, unsigned int size, int force); -int t4_fw_forceinstall(struct adapter *adap, const u8 *fw_data, - unsigned int size); int t4_fw_initialize(struct adapter *adap, unsigned int mbox); int t4_query_params(struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int nparams, const u32 *params, Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/11/sys/dev/cxgbe/common/t4_hw.c Tue Apr 30 03:45:46 2019 (r346941) +++ stable/11/sys/dev/cxgbe/common/t4_hw.c Tue Apr 30 06:04:29 2019 (r346942) @@ -3319,6 +3319,19 @@ int t4_get_fw_version(struct adapter *adapter, u32 *ve } /** + * t4_get_fw_hdr - read the firmware header + * @adapter: the adapter + * @hdr: where to place the version + * + * Reads the FW header from flash into caller provided buffer. + */ +int t4_get_fw_hdr(struct adapter *adapter, struct fw_hdr *hdr) +{ + return t4_read_flash(adapter, FLASH_FW_START, + sizeof (*hdr) / sizeof (uint32_t), (uint32_t *)hdr, 1); +} + +/** * t4_get_bs_version - read the firmware bootstrap version * @adapter: the adapter * @vers: where to place the version @@ -6898,7 +6911,7 @@ int t4_fw_halt(struct adapter *adap, unsigned int mbox * If a legitimate mailbox is provided, issue a RESET command * with a HALT indication. */ - if (mbox <= M_PCIE_FW_MASTER) { + if (adap->flags & FW_OK && mbox <= M_PCIE_FW_MASTER) { struct fw_reset_cmd c; memset(&c, 0, sizeof(c)); @@ -6937,64 +6950,24 @@ int t4_fw_halt(struct adapter *adap, unsigned int mbox /** * t4_fw_restart - restart the firmware by taking the uP out of RESET * @adap: the adapter - * @reset: if we want to do a RESET to restart things * * Restart firmware previously halted by t4_fw_halt(). On successful * return the previous PF Master remains as the new PF Master and there * is no need to issue a new HELLO command, etc. - * - * We do this in two ways: - * - * 1. If we're dealing with newer firmware we'll simply want to take - * the chip's microprocessor out of RESET. This will cause the - * firmware to start up from its start vector. And then we'll loop - * until the firmware indicates it's started again (PCIE_FW.HALT - * reset to 0) or we timeout. - * - * 2. If we're dealing with older firmware then we'll need to RESET - * the chip since older firmware won't recognize the PCIE_FW.HALT - * flag and automatically RESET itself on startup. */ -int t4_fw_restart(struct adapter *adap, unsigned int mbox, int reset) +int t4_fw_restart(struct adapter *adap, unsigned int mbox) { - if (reset) { - /* - * Since we're directing the RESET instead of the firmware - * doing it automatically, we need to clear the PCIE_FW.HALT - * bit. - */ - t4_set_reg_field(adap, A_PCIE_FW, F_PCIE_FW_HALT, 0); + int ms; - /* - * If we've been given a valid mailbox, first try to get the - * firmware to do the RESET. If that works, great and we can - * return success. Otherwise, if we haven't been given a - * valid mailbox or the RESET command failed, fall back to - * hitting the chip with a hammer. - */ - if (mbox <= M_PCIE_FW_MASTER) { - t4_set_reg_field(adap, A_CIM_BOOT_CFG, F_UPCRST, 0); - msleep(100); - if (t4_fw_reset(adap, mbox, - F_PIORST | F_PIORSTMODE) == 0) - return 0; - } - - t4_write_reg(adap, A_PL_RST, F_PIORST | F_PIORSTMODE); - msleep(2000); - } else { - int ms; - - t4_set_reg_field(adap, A_CIM_BOOT_CFG, F_UPCRST, 0); - for (ms = 0; ms < FW_CMD_MAX_TIMEOUT; ) { - if (!(t4_read_reg(adap, A_PCIE_FW) & F_PCIE_FW_HALT)) - return FW_SUCCESS; - msleep(100); - ms += 100; - } - return -ETIMEDOUT; + t4_set_reg_field(adap, A_CIM_BOOT_CFG, F_UPCRST, 0); + for (ms = 0; ms < FW_CMD_MAX_TIMEOUT; ) { + if (!(t4_read_reg(adap, A_PCIE_FW) & F_PCIE_FW_HALT)) + return FW_SUCCESS; + msleep(100); + ms += 100; } - return 0; + + return -ETIMEDOUT; } /** @@ -7024,7 +6997,7 @@ int t4_fw_upgrade(struct adapter *adap, unsigned int m const struct fw_hdr *fw_hdr = (const struct fw_hdr *)fw_data; unsigned int bootstrap = be32_to_cpu(fw_hdr->magic) == FW_HDR_MAGIC_BOOTSTRAP; - int reset, ret; + int ret; if (!t4_fw_matches_chip(adap, fw_hdr)) return -EINVAL; @@ -7039,41 +7012,7 @@ int t4_fw_upgrade(struct adapter *adap, unsigned int m if (ret < 0 || bootstrap) return ret; - /* - * Older versions of the firmware don't understand the new - * PCIE_FW.HALT flag and so won't know to perform a RESET when they - * restart. So for newly loaded older firmware we'll have to do the - * RESET for it so it starts up on a clean slate. We can tell if - * the newly loaded firmware will handle this right by checking - * its header flags to see if it advertises the capability. - */ - reset = ((be32_to_cpu(fw_hdr->flags) & FW_HDR_FLAGS_RESET_HALT) == 0); - return t4_fw_restart(adap, mbox, reset); -} - -/* - * Card doesn't have a firmware, install one. - */ -int t4_fw_forceinstall(struct adapter *adap, const u8 *fw_data, - unsigned int size) -{ - const struct fw_hdr *fw_hdr = (const struct fw_hdr *)fw_data; - unsigned int bootstrap = - be32_to_cpu(fw_hdr->magic) == FW_HDR_MAGIC_BOOTSTRAP; - int ret; - - if (!t4_fw_matches_chip(adap, fw_hdr) || bootstrap) - return -EINVAL; - - t4_set_reg_field(adap, A_CIM_BOOT_CFG, F_UPCRST, F_UPCRST); - t4_write_reg(adap, A_PCIE_FW, 0); /* Clobber internal state */ - ret = t4_load_fw(adap, fw_data, size); - if (ret < 0) - return ret; - t4_write_reg(adap, A_PL_RST, F_PIORST | F_PIORSTMODE); - msleep(1000); - - return (0); + return t4_fw_restart(adap, mbox); } /** Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Tue Apr 30 03:45:46 2019 (r346941) +++ stable/11/sys/dev/cxgbe/t4_main.c Tue Apr 30 06:04:29 2019 (r346942) @@ -598,9 +598,8 @@ static int validate_mt_off_len(struct adapter *, int, uint32_t *); static int fixup_devlog_params(struct adapter *); static int cfg_itype_and_nqueues(struct adapter *, struct intrs_and_queues *); -static int prep_firmware(struct adapter *); -static int partition_resources(struct adapter *, const struct firmware *, - const char *); +static int contact_firmware(struct adapter *); +static int partition_resources(struct adapter *); static int get_params__pre_init(struct adapter *); static int get_params__post_init(struct adapter *); static int set_params__post_init(struct adapter *); @@ -1054,11 +1053,22 @@ t4_attach(device_t dev) } #endif - /* Prepare the firmware for operation */ - rc = prep_firmware(sc); + /* Contact the firmware and try to become the master driver. */ + rc = contact_firmware(sc); if (rc != 0) goto done; /* error message displayed already */ + MPASS(sc->flags & FW_OK); + rc = get_params__pre_init(sc); + if (rc != 0) + goto done; /* error message displayed already */ + + if (sc->flags & MASTER_PF) { + rc = partition_resources(sc); + if (rc != 0) + goto done; /* error message displayed already */ + } + rc = get_params__post_init(sc); if (rc != 0) goto done; /* error message displayed already */ @@ -3366,27 +3376,85 @@ fw_compatible(const struct fw_hdr *hdr1, const struct return (0); } +static int +load_fw_module(struct adapter *sc, const struct firmware **dcfg, + const struct firmware **fw) +{ + struct fw_info *fw_info; + + *dcfg = NULL; + if (fw != NULL) + *fw = NULL; + + fw_info = find_fw_info(chip_id(sc)); + if (fw_info == NULL) { + device_printf(sc->dev, + "unable to look up firmware information for chip %d.\n", + chip_id(sc)); + return (EINVAL); + } + + *dcfg = firmware_get(fw_info->kld_name); + if (*dcfg != NULL) { + if (fw != NULL) + *fw = firmware_get(fw_info->fw_mod_name); + return (0); + } + + return (ENOENT); +} + +static void +unload_fw_module(struct adapter *sc, const struct firmware *dcfg, + const struct firmware *fw) +{ + + if (fw != NULL) + firmware_put(fw, FIRMWARE_UNLOAD); + if (dcfg != NULL) + firmware_put(dcfg, FIRMWARE_UNLOAD); +} + /* - * The firmware in the KLD is usable, but should it be installed? This routine - * explains itself in detail if it indicates the KLD firmware should be - * installed. + * Return values: + * 0 means no firmware install attempted. + * ERESTART means a firmware install was attempted and was successful. + * +ve errno means a firmware install was attempted but failed. */ static int -should_install_kld_fw(struct adapter *sc, int card_fw_usable, int k, int c) +install_kld_firmware(struct adapter *sc, struct fw_hdr *card_fw, + const struct fw_hdr *drv_fw, const char *reason, int *already) { - const char *reason; + const struct firmware *cfg, *fw; + const uint32_t c = be32toh(card_fw->fw_ver); + const uint32_t d = be32toh(drv_fw->fw_ver); + uint32_t k; + int rc; - if (!card_fw_usable) { + if (reason != NULL) + goto install; + + if ((sc->flags & FW_OK) == 0) { + + if (c == 0xffffffff) { + reason = "missing"; + goto install; + } + + return (0); + } + + if (!fw_compatible(card_fw, drv_fw)) { reason = "incompatible or unusable"; goto install; } - if (k > c) { + if (d > c) { reason = "older than the version bundled with this driver"; goto install; } - if (t4_fw_install == 2 && k != c) { + if (t4_fw_install == 2 && d != c) { reason = "different than the version bundled with this driver"; goto install; } @@ -3394,10 +3462,13 @@ should_install_kld_fw(struct adapter *sc, int card_fw_ return (0); install: + if ((*already)++) + return (0); + if (t4_fw_install == 0) { device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, " - "but the driver is prohibited from installing a different " - "firmware on the card.\n", + "but the driver is prohibited from installing a firmware " + "on the card.\n", G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c), G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), reason); @@ -3408,29 +3479,57 @@ install: "installing firmware %u.%u.%u.%u on card.\n", G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c), G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), reason, - G_FW_HDR_FW_VER_MAJOR(k), G_FW_HDR_FW_VER_MINOR(k), - G_FW_HDR_FW_VER_MICRO(k), G_FW_HDR_FW_VER_BUILD(k)); + G_FW_HDR_FW_VER_MAJOR(d), G_FW_HDR_FW_VER_MINOR(d), + G_FW_HDR_FW_VER_MICRO(d), G_FW_HDR_FW_VER_BUILD(d)); - return (1); + rc = load_fw_module(sc, &cfg, &fw); + if (rc != 0 || fw == NULL) { + device_printf(sc->dev, + "failed to load firmware module: %d. cfg %p, fw %p\n", rc, + cfg, fw); + rc = sc->flags & FW_OK ? 0 : ENOENT; + goto done; + } + k = be32toh(((const struct fw_hdr *)fw->data)->fw_ver); + if (k != d) { + device_printf(sc->dev, + "firmware in KLD (%u.%u.%u.%u) is not what the driver was " + "compiled with and will not be used.\n", + G_FW_HDR_FW_VER_MAJOR(k), G_FW_HDR_FW_VER_MINOR(k), + G_FW_HDR_FW_VER_MICRO(k), G_FW_HDR_FW_VER_BUILD(k)); + rc = sc->flags & FW_OK ? 0 : EINVAL; + goto done; + } + + rc = -t4_fw_upgrade(sc, sc->mbox, fw->data, fw->datasize, 0); + if (rc != 0) { + device_printf(sc->dev, "failed to install firmware: %d\n", rc); + } else { + /* Installed successfully, update the cached header too. */ + rc = ERESTART; + memcpy(card_fw, fw->data, sizeof(*card_fw)); + } +done: + unload_fw_module(sc, cfg, fw); + + return (rc); } /* - * Establish contact with the firmware and determine if we are the master driver - * or not, and whether we are responsible for chip initialization. + * Establish contact with the firmware and attempt to become the master driver. + * + * A firmware will be installed to the card if needed (if the driver is allowed + * to do so). */ static int -prep_firmware(struct adapter *sc) +contact_firmware(struct adapter *sc) { - const struct firmware *fw = NULL, *default_cfg; - int rc, pf, card_fw_usable, kld_fw_usable, need_fw_reset = 1; + int rc, already = 0; enum dev_state state; struct fw_info *fw_info; struct fw_hdr *card_fw; /* fw on the card */ - const struct fw_hdr *kld_fw; /* fw in the KLD */ - const struct fw_hdr *drv_fw; /* fw header the driver was compiled - against */ + const struct fw_hdr *drv_fw; /* fw bundled with the driver */ - /* This is the firmware whose headers the driver was compiled against */ fw_info = find_fw_info(chip_id(sc)); if (fw_info == NULL) { device_printf(sc->dev, @@ -3440,186 +3539,167 @@ prep_firmware(struct adapter *sc) } drv_fw = &fw_info->fw_hdr; - /* - * The firmware KLD contains many modules. The KLD name is also the - * name of the module that contains the default config file. - */ - default_cfg = firmware_get(fw_info->kld_name); - - /* This is the firmware in the KLD */ - fw = firmware_get(fw_info->fw_mod_name); - if (fw != NULL) { - kld_fw = (const void *)fw->data; - kld_fw_usable = fw_compatible(drv_fw, kld_fw); - } else { - kld_fw = NULL; - kld_fw_usable = 0; - } - /* Read the header of the firmware on the card */ card_fw = malloc(sizeof(*card_fw), M_CXGBE, M_ZERO | M_WAITOK); - rc = -t4_read_flash(sc, FLASH_FW_START, - sizeof (*card_fw) / sizeof (uint32_t), (uint32_t *)card_fw, 1); - if (rc == 0) { - card_fw_usable = fw_compatible(drv_fw, (const void*)card_fw); - if (card_fw->fw_ver == be32toh(0xffffffff)) { - uint32_t d = be32toh(kld_fw->fw_ver); - - if (!kld_fw_usable) { - device_printf(sc->dev, - "no firmware on the card and no usable " - "firmware bundled with the driver.\n"); - rc = EIO; - goto done; - } else if (t4_fw_install == 0) { - device_printf(sc->dev, - "no firmware on the card and the driver " - "is prohibited from installing new " - "firmware.\n"); - rc = EIO; - goto done; - } - - device_printf(sc->dev, "no firmware on the card, " - "installing firmware %d.%d.%d.%d\n", - G_FW_HDR_FW_VER_MAJOR(d), G_FW_HDR_FW_VER_MINOR(d), - G_FW_HDR_FW_VER_MICRO(d), G_FW_HDR_FW_VER_BUILD(d)); - rc = t4_fw_forceinstall(sc, fw->data, fw->datasize); - if (rc < 0) { - rc = -rc; - device_printf(sc->dev, - "firmware install failed: %d.\n", rc); - goto done; - } - memcpy(card_fw, kld_fw, sizeof(*card_fw)); - card_fw_usable = 1; - need_fw_reset = 0; - } - } else { +restart: + rc = -t4_get_fw_hdr(sc, card_fw); + if (rc != 0) { device_printf(sc->dev, - "Unable to read card's firmware header: %d\n", rc); - card_fw_usable = 0; + "unable to read firmware header from card's flash: %d\n", + rc); + goto done; } - /* Contact firmware. */ + rc = install_kld_firmware(sc, card_fw, drv_fw, NULL, &already); + if (rc == ERESTART) + goto restart; + if (rc != 0) + goto done; + rc = t4_fw_hello(sc, sc->mbox, sc->mbox, MASTER_MAY, &state); if (rc < 0 || state == DEV_STATE_ERR) { rc = -rc; device_printf(sc->dev, - "failed to connect to the firmware: %d, %d.\n", rc, state); + "failed to connect to the firmware: %d, %d. " + "PCIE_FW 0x%08x\n", rc, state, t4_read_reg(sc, A_PCIE_FW)); +#if 0 + if (install_kld_firmware(sc, card_fw, drv_fw, + "not responding properly to HELLO", &already) == ERESTART) + goto restart; +#endif goto done; } - pf = rc; - if (pf == sc->mbox) + MPASS(be32toh(card_fw->flags) & FW_HDR_FLAGS_RESET_HALT); + sc->flags |= FW_OK; /* The firmware responded to the FW_HELLO. */ + + if (rc == sc->pf) { sc->flags |= MASTER_PF; - else if (state == DEV_STATE_UNINIT) { + rc = install_kld_firmware(sc, card_fw, drv_fw, NULL, &already); + if (rc == ERESTART) + rc = 0; + else if (rc != 0) + goto done; + } else if (state == DEV_STATE_UNINIT) { /* * We didn't get to be the master so we definitely won't be * configuring the chip. It's a bug if someone else hasn't * configured it already. */ device_printf(sc->dev, "couldn't be master(%d), " - "device not already initialized either(%d).\n", rc, state); + "device not already initialized either(%d). " + "PCIE_FW 0x%08x\n", rc, state, t4_read_reg(sc, A_PCIE_FW)); rc = EPROTO; goto done; - } - - if (card_fw_usable && card_fw->fw_ver == drv_fw->fw_ver && - (!kld_fw_usable || kld_fw->fw_ver == drv_fw->fw_ver)) { + } else { /* - * Common case: the firmware on the card is an exact match and - * the KLD is an exact match too, or the KLD is - * absent/incompatible. Note that t4_fw_install = 2 is ignored - * here -- use cxgbetool loadfw if you want to reinstall the - * same firmware as the one on the card. + * Some other PF is the master and has configured the chip. + * This is allowed but untested. */ - } else if (kld_fw_usable && state == DEV_STATE_UNINIT && - should_install_kld_fw(sc, card_fw_usable, be32toh(kld_fw->fw_ver), - be32toh(card_fw->fw_ver))) { + device_printf(sc->dev, "PF%d is master, device state %d. " + "PCIE_FW 0x%08x\n", rc, state, t4_read_reg(sc, A_PCIE_FW)); + snprintf(sc->cfg_file, sizeof(sc->cfg_file), "pf%d", rc); + sc->cfcsum = 0; + rc = 0; + } +done: + if (rc != 0 && sc->flags & FW_OK) { + t4_fw_bye(sc, sc->mbox); + sc->flags &= ~FW_OK; + } + free(card_fw, M_CXGBE); + return (rc); +} - rc = -t4_fw_upgrade(sc, sc->mbox, fw->data, fw->datasize, 0); - if (rc != 0) { +static int +copy_cfg_file_to_card(struct adapter *sc, char *cfg_file, + uint32_t mtype, uint32_t moff) +{ + struct fw_info *fw_info; + const struct firmware *dcfg, *rcfg = NULL; + const uint32_t *cfdata; + uint32_t cflen, addr; + int rc; + + load_fw_module(sc, &dcfg, NULL); + + /* Card specific interpretation of "default". */ + if (strncmp(cfg_file, DEFAULT_CF, sizeof(t4_cfg_file)) == 0) { + if (pci_get_device(sc->dev) == 0x440a) + snprintf(cfg_file, sizeof(t4_cfg_file), UWIRE_CF); + if (is_fpga(sc)) + snprintf(cfg_file, sizeof(t4_cfg_file), FPGA_CF); + } + + if (strncmp(cfg_file, DEFAULT_CF, sizeof(t4_cfg_file)) == 0) { + if (dcfg == NULL) { device_printf(sc->dev, - "failed to install firmware: %d\n", rc); + "KLD with default config is not available.\n"); + rc = ENOENT; goto done; } + cfdata = dcfg->data; + cflen = dcfg->datasize & ~3; + } else { + char s[32]; - /* Installed successfully, update the cached header too. */ - memcpy(card_fw, kld_fw, sizeof(*card_fw)); - card_fw_usable = 1; - need_fw_reset = 0; /* already reset as part of load_fw */ + fw_info = find_fw_info(chip_id(sc)); + if (fw_info == NULL) { + device_printf(sc->dev, + "unable to look up firmware information for chip %d.\n", + chip_id(sc)); + rc = EINVAL; + goto done; + } + snprintf(s, sizeof(s), "%s_%s", fw_info->kld_name, cfg_file); + + rcfg = firmware_get(s); + if (rcfg == NULL) { + device_printf(sc->dev, + "unable to load module \"%s\" for configuration " + "profile \"%s\".\n", s, cfg_file); + rc = ENOENT; + goto done; + } + cfdata = rcfg->data; + cflen = rcfg->datasize & ~3; } - if (!card_fw_usable) { - uint32_t d, c, k; - - d = ntohl(drv_fw->fw_ver); - c = ntohl(card_fw->fw_ver); - k = kld_fw ? ntohl(kld_fw->fw_ver) : 0; - - device_printf(sc->dev, "Cannot find a usable firmware: " - "fw_install %d, chip state %d, " - "driver compiled with %d.%d.%d.%d, " - "card has %d.%d.%d.%d, KLD has %d.%d.%d.%d\n", - t4_fw_install, state, - G_FW_HDR_FW_VER_MAJOR(d), G_FW_HDR_FW_VER_MINOR(d), - G_FW_HDR_FW_VER_MICRO(d), G_FW_HDR_FW_VER_BUILD(d), - G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c), - G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), - G_FW_HDR_FW_VER_MAJOR(k), G_FW_HDR_FW_VER_MINOR(k), - G_FW_HDR_FW_VER_MICRO(k), G_FW_HDR_FW_VER_BUILD(k)); + if (cflen > FLASH_CFG_MAX_SIZE) { + device_printf(sc->dev, + "config file too long (%d, max allowed is %d).\n", + cflen, FLASH_CFG_MAX_SIZE); rc = EINVAL; goto done; } - /* Reset device */ - if (need_fw_reset && - (rc = -t4_fw_reset(sc, sc->mbox, F_PIORSTMODE | F_PIORST)) != 0) { - device_printf(sc->dev, "firmware reset failed: %d.\n", rc); - if (rc != ETIMEDOUT && rc != EIO) - t4_fw_bye(sc, sc->mbox); + rc = validate_mt_off_len(sc, mtype, moff, cflen, &addr); + if (rc != 0) { + device_printf(sc->dev, + "%s: addr (%d/0x%x) or len %d is not valid: %d.\n", + __func__, mtype, moff, cflen, rc); + rc = EINVAL; goto done; } - sc->flags |= FW_OK; - - rc = get_params__pre_init(sc); - if (rc != 0) - goto done; /* error message displayed already */ - - /* Partition adapter resources as specified in the config file. */ - if (state == DEV_STATE_UNINIT) { - - KASSERT(sc->flags & MASTER_PF, - ("%s: trying to change chip settings when not master.", - __func__)); - - rc = partition_resources(sc, default_cfg, fw_info->kld_name); - if (rc != 0) - goto done; /* error message displayed already */ - - t4_tweak_chip_settings(sc); - - /* get basic stuff going */ - rc = -t4_fw_initialize(sc, sc->mbox); - if (rc != 0) { - device_printf(sc->dev, "fw init failed: %d.\n", rc); - goto done; - } - } else { - snprintf(sc->cfg_file, sizeof(sc->cfg_file), "pf%d", pf); - sc->cfcsum = 0; - } - + write_via_memwin(sc, 2, addr, cfdata, cflen); done: - free(card_fw, M_CXGBE); - if (fw != NULL) - firmware_put(fw, FIRMWARE_UNLOAD); - if (default_cfg != NULL) - firmware_put(default_cfg, FIRMWARE_UNLOAD); - + if (rcfg != NULL) + firmware_put(rcfg, FIRMWARE_UNLOAD); + unload_fw_module(sc, dcfg, NULL); return (rc); } +struct caps_allowed { + uint16_t nbmcaps; + uint16_t linkcaps; + uint16_t switchcaps; + uint16_t niccaps; + uint16_t toecaps; + uint16_t rdmacaps; + uint16_t cryptocaps; + uint16_t iscsicaps; + uint16_t fcoecaps; +}; + #define FW_PARAM_DEV(param) \ (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | \ V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_##param)) @@ -3628,78 +3708,39 @@ done: V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_PFVF_##param)) /* - * Partition chip resources for use between various PFs, VFs, etc. + * Provide a configuration profile to the firmware and have it initialize the + * chip accordingly. This may involve uploading a configuration file to the + * card. */ static int -partition_resources(struct adapter *sc, const struct firmware *default_cfg, - const char *name_prefix) +apply_cfg_and_initialize(struct adapter *sc, char *cfg_file, + const struct caps_allowed *caps_allowed) { - const struct firmware *cfg = NULL; - int rc = 0; + int rc; struct fw_caps_config_cmd caps; - uint32_t mtype, moff, finicsum, cfcsum; + uint32_t mtype, moff, finicsum, cfcsum, param, val; - /* - * Figure out what configuration file to use. Pick the default config - * file for the card if the user hasn't specified one explicitly. - */ - snprintf(sc->cfg_file, sizeof(sc->cfg_file), "%s", t4_cfg_file); - if (strncmp(t4_cfg_file, DEFAULT_CF, sizeof(t4_cfg_file)) == 0) { - /* Card specific overrides go here. */ - if (pci_get_device(sc->dev) == 0x440a) - snprintf(sc->cfg_file, sizeof(sc->cfg_file), UWIRE_CF); - if (is_fpga(sc)) - snprintf(sc->cfg_file, sizeof(sc->cfg_file), FPGA_CF); - } else if (strncmp(t4_cfg_file, BUILTIN_CF, sizeof(t4_cfg_file)) == 0) - goto use_built_in_config; /* go straight to config. */ - - /* - * We need to load another module if the profile is anything except - * "default" or "flash". - */ - if (strncmp(sc->cfg_file, DEFAULT_CF, sizeof(sc->cfg_file)) != 0 && - strncmp(sc->cfg_file, FLASH_CF, sizeof(sc->cfg_file)) != 0) { - char s[32]; - - snprintf(s, sizeof(s), "%s_%s", name_prefix, sc->cfg_file); - cfg = firmware_get(s); - if (cfg == NULL) { - if (default_cfg != NULL) { - device_printf(sc->dev, - "unable to load module \"%s\" for " - "configuration profile \"%s\", will use " - "the default config file instead.\n", - s, sc->cfg_file); - snprintf(sc->cfg_file, sizeof(sc->cfg_file), - "%s", DEFAULT_CF); - } else { - device_printf(sc->dev, - "unable to load module \"%s\" for " - "configuration profile \"%s\", will use " - "the config file on the card's flash " - "instead.\n", s, sc->cfg_file); - snprintf(sc->cfg_file, sizeof(sc->cfg_file), - "%s", FLASH_CF); - } - } + rc = -t4_fw_reset(sc, sc->mbox, F_PIORSTMODE | F_PIORST); + if (rc != 0) { + device_printf(sc->dev, "firmware reset failed: %d.\n", rc); + return (rc); } - if (strncmp(sc->cfg_file, DEFAULT_CF, sizeof(sc->cfg_file)) == 0 && - default_cfg == NULL) { - device_printf(sc->dev, - "default config file not available, will use the config " - "file on the card's flash instead.\n"); - snprintf(sc->cfg_file, sizeof(sc->cfg_file), "%s", FLASH_CF); - } - - if (strncmp(sc->cfg_file, FLASH_CF, sizeof(sc->cfg_file)) != 0) { - u_int cflen; - const uint32_t *cfdata; - uint32_t param, val, addr; - - KASSERT(cfg != NULL || default_cfg != NULL, - ("%s: no config to upload", __func__)); - + bzero(&caps, sizeof(caps)); + caps.op_to_write = htobe32(V_FW_CMD_OP(FW_CAPS_CONFIG_CMD) | + F_FW_CMD_REQUEST | F_FW_CMD_READ); + if (strncmp(cfg_file, BUILTIN_CF, sizeof(t4_cfg_file)) == 0) { + mtype = 0; + moff = 0; + caps.cfvalid_to_len16 = htobe32(FW_LEN16(caps)); + } else if (strncmp(cfg_file, FLASH_CF, sizeof(t4_cfg_file)) == 0) { + mtype = FW_MEMTYPE_FLASH; + moff = t4_flash_cfg_addr(sc); + caps.cfvalid_to_len16 = htobe32(F_FW_CAPS_CONFIG_CMD_CFVALID | + V_FW_CAPS_CONFIG_CMD_MEMTYPE_CF(mtype) | + V_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF(moff >> 16) | + FW_LEN16(caps)); + } else { /* * Ask the firmware where it wants us to upload the config file. */ @@ -3713,110 +3754,52 @@ partition_resources(struct adapter *sc, const struct f } mtype = G_FW_PARAMS_PARAM_Y(val); moff = G_FW_PARAMS_PARAM_Z(val) << 16; + caps.cfvalid_to_len16 = htobe32(F_FW_CAPS_CONFIG_CMD_CFVALID | + V_FW_CAPS_CONFIG_CMD_MEMTYPE_CF(mtype) | + V_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF(moff >> 16) | + FW_LEN16(caps)); - /* - * XXX: sheer laziness. We deliberately added 4 bytes of - * useless stuffing/comments at the end of the config file so - * it's ok to simply throw away the last remaining bytes when - * the config file is not an exact multiple of 4. This also - * helps with the validate_mt_off_len check. - */ - if (cfg != NULL) { - cflen = cfg->datasize & ~3; - cfdata = cfg->data; - } else { - cflen = default_cfg->datasize & ~3; - cfdata = default_cfg->data; - } - - if (cflen > FLASH_CFG_MAX_SIZE) { - device_printf(sc->dev, - "config file too long (%d, max allowed is %d). " - "Will try to use the config on the card, if any.\n", - cflen, FLASH_CFG_MAX_SIZE); - goto use_config_on_flash; - } - - rc = validate_mt_off_len(sc, mtype, moff, cflen, &addr); + rc = copy_cfg_file_to_card(sc, cfg_file, mtype, moff); if (rc != 0) { device_printf(sc->dev, - "%s: addr (%d/0x%x) or len %d is not valid: %d. " - "Will try to use the config on the card, if any.\n", - __func__, mtype, moff, cflen, rc); - goto use_config_on_flash; + "failed to upload config file to card: %d.\n", rc); + goto done; } - write_via_memwin(sc, 2, addr, cfdata, cflen); - } else { -use_config_on_flash: - mtype = FW_MEMTYPE_FLASH; - moff = t4_flash_cfg_addr(sc); } - - bzero(&caps, sizeof(caps)); - caps.op_to_write = htobe32(V_FW_CMD_OP(FW_CAPS_CONFIG_CMD) | - F_FW_CMD_REQUEST | F_FW_CMD_READ); - caps.cfvalid_to_len16 = htobe32(F_FW_CAPS_CONFIG_CMD_CFVALID | - V_FW_CAPS_CONFIG_CMD_MEMTYPE_CF(mtype) | - V_FW_CAPS_CONFIG_CMD_MEMADDR64K_CF(moff >> 16) | FW_LEN16(caps)); rc = -t4_wr_mbox(sc, sc->mbox, &caps, sizeof(caps), &caps); if (rc != 0) { - device_printf(sc->dev, - "failed to pre-process config file: %d " - "(mtype %d, moff 0x%x). Will reset the firmware and retry " - "with the built-in configuration.\n", rc, mtype, moff); - - rc = -t4_fw_reset(sc, sc->mbox, F_PIORSTMODE | F_PIORST); - if (rc != 0) { - device_printf(sc->dev, - "firmware reset failed: %d.\n", rc); - if (rc != ETIMEDOUT && rc != EIO) { - t4_fw_bye(sc, sc->mbox); - sc->flags &= ~FW_OK; - } - goto done; - } - snprintf(sc->cfg_file, sizeof(sc->cfg_file), "%s", "built-in"); -use_built_in_config: - bzero(&caps, sizeof(caps)); - caps.op_to_write = htobe32(V_FW_CMD_OP(FW_CAPS_CONFIG_CMD) | - F_FW_CMD_REQUEST | F_FW_CMD_READ); - caps.cfvalid_to_len16 = htobe32(FW_LEN16(caps)); - rc = t4_wr_mbox(sc, sc->mbox, &caps, sizeof(caps), &caps); - if (rc != 0) { - device_printf(sc->dev, - "built-in configuration failed: %d.\n", rc); - goto done; - } + device_printf(sc->dev, "failed to pre-process config file: %d " + "(mtype %d, moff 0x%x).\n", rc, mtype, moff); + goto done; } finicsum = be32toh(caps.finicsum); - cfcsum = be32toh(caps.cfcsum); + cfcsum = be32toh(caps.cfcsum); /* actual */ if (finicsum != cfcsum) { device_printf(sc->dev, "WARNING: config file checksum mismatch: %08x %08x\n", finicsum, cfcsum); } sc->cfcsum = cfcsum; + snprintf(sc->cfg_file, sizeof(sc->cfg_file), "%s", cfg_file); -#define LIMIT_CAPS(x) do { \ - caps.x &= htobe16(t4_##x##_allowed); \ -} while (0) - /* * Let the firmware know what features will (not) be used so it can tune * things accordingly. */ - LIMIT_CAPS(nbmcaps); - LIMIT_CAPS(linkcaps); - LIMIT_CAPS(switchcaps); - LIMIT_CAPS(niccaps); - LIMIT_CAPS(toecaps); - LIMIT_CAPS(rdmacaps); - LIMIT_CAPS(cryptocaps); - LIMIT_CAPS(iscsicaps); - LIMIT_CAPS(fcoecaps); +#define LIMIT_CAPS(x) do { \ + caps.x##caps &= htobe16(caps_allowed->x##caps); \ +} while (0) + LIMIT_CAPS(nbm); + LIMIT_CAPS(link); + LIMIT_CAPS(switch); + LIMIT_CAPS(nic); + LIMIT_CAPS(toe); + LIMIT_CAPS(rdma); + LIMIT_CAPS(crypto); + LIMIT_CAPS(iscsi); + LIMIT_CAPS(fcoe); #undef LIMIT_CAPS - if (caps.niccaps & htobe16(FW_CAPS_CONFIG_NIC_HASHFILTER)) { /* * TOE and hashfilters are mutually exclusive. It is a config @@ -3838,10 +3821,67 @@ use_built_in_config: if (rc != 0) { device_printf(sc->dev, "failed to process config file: %d.\n", rc); + goto done; } + + t4_tweak_chip_settings(sc); + + /* get basic stuff going */ + rc = -t4_fw_initialize(sc, sc->mbox); + if (rc != 0) { + device_printf(sc->dev, "fw_initialize failed: %d.\n", rc); + goto done; + } done: - if (cfg != NULL) - firmware_put(cfg, FIRMWARE_UNLOAD); + return (rc); +} + +/* + * Partition chip resources for use between various PFs, VFs, etc. + */ +static int +partition_resources(struct adapter *sc) +{ + char cfg_file[sizeof(t4_cfg_file)]; + struct caps_allowed caps_allowed; + int rc; + bool fallback; + + /* Only the master driver gets to configure the chip resources. */ + MPASS(sc->flags & MASTER_PF); + +#define COPY_CAPS(x) do { \ + caps_allowed.x##caps = t4_##x##caps_allowed; \ +} while (0) + bzero(&caps_allowed, sizeof(caps_allowed)); + COPY_CAPS(nbm); + COPY_CAPS(link); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Apr 30 06:08:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D9731584AD6; Tue, 30 Apr 2019 06:08:50 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 107928DF2F; Tue, 30 Apr 2019 06:08:50 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id F38CA119B3; Tue, 30 Apr 2019 06:08:49 +0000 (UTC) Date: Tue, 30 Apr 2019 06:08:49 +0000 From: Alexey Dokuchaev To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346932 - head/sys/ufs/ufs Message-ID: <20190430060849.GB97846@FreeBSD.org> References: <201904292205.x3TM5Q7Z058461@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201904292205.x3TM5Q7Z058461@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 107928DF2F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.92)[-0.916,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 06:08:50 -0000 On Mon, Apr 29, 2019 at 10:05:26PM +0000, Mark Johnston wrote: > New Revision: 346932 > URL: https://svnweb.freebsd.org/changeset/base/346932 > > Log: > Optimize lseek(SEEK_DATA) on UFS. > > This version fixes the problems identified in r345244. > > Reviewed by: kib > @@ -56,6 +56,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +static ufs_lbn_t lbn_count(struct ufsmount *, int); > +static int readindir(struct vnode *, ufs_lbn_t, ufs2_daddr_t, struct buf **); Is the prototype for static readindir() really needed here? > +static int > +readindir(vp, lbn, daddr, bpp) > + struct vnode *vp; > + ufs_lbn_t lbn; > + ufs2_daddr_t daddr; > + struct buf **bpp; Don't we prefer ASNI declarations over K&R these days? > +static ufs_lbn_t > +lbn_count(ump, level) > + struct ufsmount *ump; > + int level; Ditto. > +int > +ufs_bmap_seekdata(vp, offp) > + struct vnode *vp; > + off_t *offp; ./danfe From owner-svn-src-all@freebsd.org Tue Apr 30 06:54:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4DD7158565F; Tue, 30 Apr 2019 06:54:19 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FF758F59A; Tue, 30 Apr 2019 06:54:19 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback3j.mail.yandex.net (mxback3j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10c]) by forward101p.mail.yandex.net (Yandex) with ESMTP id 9FB4C32812E6; Tue, 30 Apr 2019 09:54:15 +0300 (MSK) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback3j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id nCXHvL0oZh-sFLCNRJ3; Tue, 30 Apr 2019 09:54:15 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1556607255; bh=+KkWyt3ffbZ0W5MkeKMAEMmvAGxVeimHPcRCm+NUnFg=; h=In-Reply-To:From:Date:References:To:Subject:Message-ID; b=h4hW0fGknIg45aAvYqyhH1DDSCPnwnulLGULsapcAtPqKkWOcJ73Z0c/xHpWul0p9 O2pd6AB7KjIUMHal7F7ydnTvVhNmKUkhOXjQ4cL/4zFhrPxMKZe73IdQjXa1k4Y43F lb2zO/a7axn8ZYw+HcbqoTxZykWlJaV64/SpKrP4= Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id m6AihFwrNM-sBR4VCCh; Tue, 30 Apr 2019 09:54:14 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en To: John Baldwin , slavash@FreeBSD.org, Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051425.wB5EP38T004562@repo.freebsd.org> <7cea5305-4136-a0b6-487b-51307b1c6db9@FreeBSD.org> <123654bf-59f7-1db8-55ce-36306bdac43d@FreeBSD.org> <67b638e0-8e6f-f960-b263-62eed8ce28b7@FreeBSD.org> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= mQENBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAG0JUFuZHJleSBWLiBFbHN1a292IDxidTdjaGVyQHlhbmRleC5ydT6JATgEEwECACIFAkwB F1kCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEAHF6gQQyKF6qmYIAI6ekfm1VA4T vqankI1ISE6ku4jV7UlpIQlEbE7/8n3Zd6teJ+pGOQhN5qk8QE7utdPdbktAzi+x7LIJVzUw 4TywZLXGrkP7VKYkfg6oyCGyzITghefQeJtr2TN4hYCkzPWpylkue8MtmqfZv/6royqwTbN+ +E09FQNvTgRUYJYTeQ1qOsxNRycwvw3dr2rOfuxShbzaHBB1pBIjGrMg8fC5pd65ACH5zuFV A0CoTNGMDrEZSfBkTW604UUHFFXeCoC3dwDZRKOWJ3GmMXns65Ai5YkA63BSHEE1Qle3VBhd cG1w0CB5FBV3pB27UVnf0jEbysrDqW4qN7XMRFSWNAy5AQ0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAYkBHwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <17b96a6c-ece6-86e9-426d-84e04248818b@yandex.ru> Date: Tue, 30 Apr 2019 09:52:50 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <67b638e0-8e6f-f960-b263-62eed8ce28b7@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 5FF758F59A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 06:54:20 -0000 On 30.04.2019 00:14, John Baldwin wrote: >> Yes, we were able to reproduce this issue in house. If you don't mind, I >> prefer to wait for John's update - where he eliminates the EAGAIN >> handling in the network drivers. > > I have rebased the branch for this, but for now it will just panic sooner > I believe by tripping an assertion. Can you grab the diff (or just the branch) > from the 'send_tags' branch at github/bsdjhb/freebsd and reproduce under a > kernel with INVARIANTS? I think we will have to explicitly clear the 'rcvif' > pointer somewhere, but I want to see what the stack trace looks like so I can > think about the "right" place to clear it. Hi, please note, that rcvif is used by firewall to track inbound interface and clearing it can be unexpected in some cases, and can break firewall rules. -- WBR, Andrey V. Elsukov From owner-svn-src-all@freebsd.org Tue Apr 30 07:10:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 148C415859C4; Tue, 30 Apr 2019 07:10:13 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A96F28FBB0; Tue, 30 Apr 2019 07:10:12 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EBB5620D; Tue, 30 Apr 2019 07:10:12 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U7ACr4042020; Tue, 30 Apr 2019 07:10:12 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U7AB1K042017; Tue, 30 Apr 2019 07:10:11 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201904300710.x3U7AB1K042017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 30 Apr 2019 07:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346943 - stable/12/sys/dev/mrsas X-SVN-Group: stable-12 X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: stable/12/sys/dev/mrsas X-SVN-Commit-Revision: 346943 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A96F28FBB0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 07:10:13 -0000 Author: kadesai Date: Tue Apr 30 07:10:11 2019 New Revision: 346943 URL: https://svnweb.freebsd.org/changeset/base/346943 Log: MFC r345056, r345058, r345059 r345056 fw_outstanding"(outstanding IOs at firmware level) counter gets screwed up when R1 fastpath writes are running. Some of the cases which are not handled properly in driver are: 1. With R1 fastpath supported, single write from CAM layer can consume 2 MPT frames at driver/firmware level for fastpath qualification(if fw_outstanding < controller Queue Depth). Due to this driver has to throttle IOs coming from CAM layer as well as second fastpath write(of R1 write) against Adapter Queue Depth. If "fw_outstanding" reaches to adapter queue depth, driver should return IOs from CAM layer with device busy status.While allocating second MPT frame(corresponding to R1 FP write) also, driver should ensure fw_outstanding should not exceed adapter QD. 2. For R1 fastpath writes completion, driver decrements "fw_oustanding" counter without really returning MPT frame to free pool. It may cause IOs(with heavy IOs running, consuming whole adapter Queue Depth) consuming MPT frames reserved for DCMDs(management commands) and DCMDs(internal and sent by application) not getting MPT frame will start failing. Below is one test case to hit the issue described above- 1. Run heavy IOs (outstanding IOs should hit adapter Queue Depth). 2. Run management tool (Broadcom's storcli tool) querying adapter in loop (run command- "storcli64 /c0 show" in loop). 3. Management tool's requests would start failing due to non-availability of free MPT frames as all frames would be consumed by IOs. Fix: Increment/decrement of "fw_outstanding" counter should be in sync with MPT frame get/return. r345058 Allocated MFI frames should be same as MPT frames reserved for DCMDs r345059 Update driver version to 07.709.04.00-fbsd Modified: stable/12/sys/dev/mrsas/mrsas.c stable/12/sys/dev/mrsas/mrsas.h stable/12/sys/dev/mrsas/mrsas_cam.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mrsas/mrsas.c ============================================================================== --- stable/12/sys/dev/mrsas/mrsas.c Tue Apr 30 06:04:29 2019 (r346942) +++ stable/12/sys/dev/mrsas/mrsas.c Tue Apr 30 07:10:11 2019 (r346943) @@ -1712,6 +1712,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M mrsas_map_mpt_cmd_status(cmd_mpt, cmd_mpt->ccb_ptr, status, extStatus, data_length, sense); mrsas_cmd_done(sc, cmd_mpt); + mrsas_atomic_dec(&sc->fw_outstanding); } else { /* * If the peer Raid 1/10 fast path failed, @@ -1735,12 +1736,13 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M r1_cmd->callout_owner = false; } mrsas_release_mpt_cmd(r1_cmd); + mrsas_atomic_dec(&sc->fw_outstanding); mrsas_map_mpt_cmd_status(cmd_mpt, cmd_mpt->ccb_ptr, status, extStatus, data_length, sense); mrsas_cmd_done(sc, cmd_mpt); + mrsas_atomic_dec(&sc->fw_outstanding); } } - mrsas_atomic_dec(&sc->fw_outstanding); break; case MRSAS_MPI2_FUNCTION_PASSTHRU_IO_REQUEST: /* MFI command */ cmd_mfi = sc->mfi_cmd_list[cmd_mpt->sync_cmd_idx]; @@ -2526,6 +2528,9 @@ mrsas_init_fw(struct mrsas_softc *sc) else sc->fast_path_io = 0; } + + device_printf(sc->mrsas_dev, "max_fw_cmds: %u max_scsi_cmds: %u\n", + sc->max_fw_cmds, sc->max_scsi_cmds); return (0); } @@ -2553,8 +2558,7 @@ mrsas_init_adapter(struct mrsas_softc *sc) /* Decrement the max supported by 1, to correlate with FW */ sc->max_fw_cmds = sc->max_fw_cmds - 1; - sc->max_scsi_cmds = sc->max_fw_cmds - - (MRSAS_FUSION_INT_CMDS + MRSAS_MAX_IOCTL_CMDS); + sc->max_scsi_cmds = sc->max_fw_cmds - MRSAS_MAX_MFI_CMDS; /* Determine allocation size of command frames */ sc->reply_q_depth = ((sc->max_fw_cmds + 1 + 15) / 16 * 16) * 2; Modified: stable/12/sys/dev/mrsas/mrsas.h ============================================================================== --- stable/12/sys/dev/mrsas/mrsas.h Tue Apr 30 06:04:29 2019 (r346942) +++ stable/12/sys/dev/mrsas/mrsas.h Tue Apr 30 07:10:11 2019 (r346943) @@ -119,7 +119,7 @@ __FBSDID("$FreeBSD$"); */ #define BYTE_ALIGNMENT 1 #define MRSAS_MAX_NAME_LENGTH 32 -#define MRSAS_VERSION "07.709.01.00-fbsd" +#define MRSAS_VERSION "07.709.04.00-fbsd" #define MRSAS_ULONG_MAX 0xFFFFFFFFFFFFFFFF #define MRSAS_DEFAULT_TIMEOUT 0x14 /* Temporarily set */ #define DONE 0 Modified: stable/12/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- stable/12/sys/dev/mrsas/mrsas_cam.c Tue Apr 30 06:04:29 2019 (r346942) +++ stable/12/sys/dev/mrsas/mrsas_cam.c Tue Apr 30 07:10:11 2019 (r346943) @@ -467,11 +467,20 @@ mrsas_startio(struct mrsas_softc *sc, struct cam_sim * return (0); } ccb_h->status |= CAM_SIM_QUEUED; + + if (mrsas_atomic_inc_return(&sc->fw_outstanding) > sc->max_scsi_cmds) { + ccb_h->status |= CAM_REQUEUE_REQ; + xpt_done(ccb); + mrsas_atomic_dec(&sc->fw_outstanding); + return (0); + } + cmd = mrsas_get_mpt_cmd(sc); if (!cmd) { ccb_h->status |= CAM_REQUEUE_REQ; xpt_done(ccb); + mrsas_atomic_dec(&sc->fw_outstanding); return (0); } @@ -638,7 +647,7 @@ mrsas_startio(struct mrsas_softc *sc, struct cam_sim * mrsas_scsiio_timeout, cmd); #endif - if (mrsas_atomic_inc_return(&sc->fw_outstanding) > sc->io_cmds_highwater) + if (mrsas_atomic_read(&sc->fw_outstanding) > sc->io_cmds_highwater) sc->io_cmds_highwater++; /* @@ -653,7 +662,6 @@ mrsas_startio(struct mrsas_softc *sc, struct cam_sim * * new command */ if (cmd->r1_alt_dev_handle != MR_DEVHANDLE_INVALID) { - mrsas_atomic_inc(&sc->fw_outstanding); mrsas_prepare_secondRaid1_IO(sc, cmd); mrsas_fire_cmd(sc, req_desc->addr.u.low, req_desc->addr.u.high); @@ -669,6 +677,7 @@ mrsas_startio(struct mrsas_softc *sc, struct cam_sim * done: xpt_done(ccb); + mrsas_atomic_dec(&sc->fw_outstanding); return (0); } @@ -1092,14 +1101,20 @@ mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mp (io_info.r1_alt_dev_handle != MR_DEVHANDLE_INVALID) && (raid->level == 1) && !io_info.isRead) { r1_cmd = mrsas_get_mpt_cmd(sc); - if (!r1_cmd) { + if (mrsas_atomic_inc_return(&sc->fw_outstanding) > sc->max_scsi_cmds) { fp_possible = FALSE; - printf("Avago debug fp disable from %s %d \n", - __func__, __LINE__); + mrsas_atomic_dec(&sc->fw_outstanding); } else { - cmd->peer_cmd = r1_cmd; - r1_cmd->peer_cmd = cmd; - } + r1_cmd = mrsas_get_mpt_cmd(sc); + if (!r1_cmd) { + fp_possible = FALSE; + mrsas_atomic_dec(&sc->fw_outstanding); + } + else { + cmd->peer_cmd = r1_cmd; + r1_cmd->peer_cmd = cmd; + } + } } } From owner-svn-src-all@freebsd.org Tue Apr 30 07:12:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 680191585C6A; Tue, 30 Apr 2019 07:12:31 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C956900B3; Tue, 30 Apr 2019 07:12:31 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D826F63BE; Tue, 30 Apr 2019 07:12:30 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U7CUnq047047; Tue, 30 Apr 2019 07:12:30 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U7CUhH047045; Tue, 30 Apr 2019 07:12:30 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201904300712.x3U7CUhH047045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 30 Apr 2019 07:12:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346944 - stable/11/sys/dev/mrsas X-SVN-Group: stable-11 X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: stable/11/sys/dev/mrsas X-SVN-Commit-Revision: 346944 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0C956900B3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 07:12:31 -0000 Author: kadesai Date: Tue Apr 30 07:12:30 2019 New Revision: 346944 URL: https://svnweb.freebsd.org/changeset/base/346944 Log: MFC r345056, r345058, r345059 r345056 fw_outstanding"(outstanding IOs at firmware level) counter gets screwed up when R1 fastpath writes are running. Some of the cases which are not handled properly in driver are: 1. With R1 fastpath supported, single write from CAM layer can consume 2 MPT frames at driver/firmware level for fastpath qualification(if fw_outstanding < controller Queue Depth). Due to this driver has to throttle IOs coming from CAM layer as well as second fastpath write(of R1 write) against Adapter Queue Depth. If "fw_outstanding" reaches to adapter queue depth, driver should return IOs from CAM layer with device busy status.While allocating second MPT frame(corresponding to R1 FP write) also, driver should ensure fw_outstanding should not exceed adapter QD. 2. For R1 fastpath writes completion, driver decrements "fw_oustanding" counter without really returning MPT frame to free pool. It may cause IOs(with heavy IOs running, consuming whole adapter Queue Depth) consuming MPT frames reserved for DCMDs(management commands) and DCMDs(internal and sent by application) not getting MPT frame will start failing. Below is one test case to hit the issue described above- 1. Run heavy IOs (outstanding IOs should hit adapter Queue Depth). 2. Run management tool (Broadcom's storcli tool) querying adapter in loop (run command- "storcli64 /c0 show" in loop). 3. Management tool's requests would start failing due to non-availability of free MPT frames as all frames would be consumed by IOs. Fix: Increment/decrement of "fw_outstanding" counter should be in sync with MPT frame get/return. r345058 Allocated MFI frames should be same as MPT frames reserved for DCMDs r345059 Update driver version to 07.709.04.00-fbsd Modified: stable/11/sys/dev/mrsas/mrsas.c stable/11/sys/dev/mrsas/mrsas.h stable/11/sys/dev/mrsas/mrsas_cam.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mrsas/mrsas.c ============================================================================== --- stable/11/sys/dev/mrsas/mrsas.c Tue Apr 30 07:10:11 2019 (r346943) +++ stable/11/sys/dev/mrsas/mrsas.c Tue Apr 30 07:12:30 2019 (r346944) @@ -1712,6 +1712,7 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M mrsas_map_mpt_cmd_status(cmd_mpt, cmd_mpt->ccb_ptr, status, extStatus, data_length, sense); mrsas_cmd_done(sc, cmd_mpt); + mrsas_atomic_dec(&sc->fw_outstanding); } else { /* * If the peer Raid 1/10 fast path failed, @@ -1735,12 +1736,13 @@ mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t M r1_cmd->callout_owner = false; } mrsas_release_mpt_cmd(r1_cmd); + mrsas_atomic_dec(&sc->fw_outstanding); mrsas_map_mpt_cmd_status(cmd_mpt, cmd_mpt->ccb_ptr, status, extStatus, data_length, sense); mrsas_cmd_done(sc, cmd_mpt); + mrsas_atomic_dec(&sc->fw_outstanding); } } - mrsas_atomic_dec(&sc->fw_outstanding); break; case MRSAS_MPI2_FUNCTION_PASSTHRU_IO_REQUEST: /* MFI command */ cmd_mfi = sc->mfi_cmd_list[cmd_mpt->sync_cmd_idx]; @@ -2526,6 +2528,9 @@ mrsas_init_fw(struct mrsas_softc *sc) else sc->fast_path_io = 0; } + + device_printf(sc->mrsas_dev, "max_fw_cmds: %u max_scsi_cmds: %u\n", + sc->max_fw_cmds, sc->max_scsi_cmds); return (0); } @@ -2553,8 +2558,7 @@ mrsas_init_adapter(struct mrsas_softc *sc) /* Decrement the max supported by 1, to correlate with FW */ sc->max_fw_cmds = sc->max_fw_cmds - 1; - sc->max_scsi_cmds = sc->max_fw_cmds - - (MRSAS_FUSION_INT_CMDS + MRSAS_MAX_IOCTL_CMDS); + sc->max_scsi_cmds = sc->max_fw_cmds - MRSAS_MAX_MFI_CMDS; /* Determine allocation size of command frames */ sc->reply_q_depth = ((sc->max_fw_cmds + 1 + 15) / 16 * 16) * 2; Modified: stable/11/sys/dev/mrsas/mrsas.h ============================================================================== --- stable/11/sys/dev/mrsas/mrsas.h Tue Apr 30 07:10:11 2019 (r346943) +++ stable/11/sys/dev/mrsas/mrsas.h Tue Apr 30 07:12:30 2019 (r346944) @@ -119,7 +119,7 @@ __FBSDID("$FreeBSD$"); */ #define BYTE_ALIGNMENT 1 #define MRSAS_MAX_NAME_LENGTH 32 -#define MRSAS_VERSION "07.709.01.00-fbsd" +#define MRSAS_VERSION "07.709.04.00-fbsd" #define MRSAS_ULONG_MAX 0xFFFFFFFFFFFFFFFF #define MRSAS_DEFAULT_TIMEOUT 0x14 /* Temporarily set */ #define DONE 0 Modified: stable/11/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- stable/11/sys/dev/mrsas/mrsas_cam.c Tue Apr 30 07:10:11 2019 (r346943) +++ stable/11/sys/dev/mrsas/mrsas_cam.c Tue Apr 30 07:12:30 2019 (r346944) @@ -468,11 +468,20 @@ mrsas_startio(struct mrsas_softc *sc, struct cam_sim * return (0); } ccb_h->status |= CAM_SIM_QUEUED; + + if (mrsas_atomic_inc_return(&sc->fw_outstanding) > sc->max_scsi_cmds) { + ccb_h->status |= CAM_REQUEUE_REQ; + xpt_done(ccb); + mrsas_atomic_dec(&sc->fw_outstanding); + return (0); + } + cmd = mrsas_get_mpt_cmd(sc); if (!cmd) { ccb_h->status |= CAM_REQUEUE_REQ; xpt_done(ccb); + mrsas_atomic_dec(&sc->fw_outstanding); return (0); } @@ -639,7 +648,7 @@ mrsas_startio(struct mrsas_softc *sc, struct cam_sim * mrsas_scsiio_timeout, cmd); #endif - if (mrsas_atomic_inc_return(&sc->fw_outstanding) > sc->io_cmds_highwater) + if (mrsas_atomic_read(&sc->fw_outstanding) > sc->io_cmds_highwater) sc->io_cmds_highwater++; /* @@ -654,7 +663,6 @@ mrsas_startio(struct mrsas_softc *sc, struct cam_sim * * new command */ if (cmd->r1_alt_dev_handle != MR_DEVHANDLE_INVALID) { - mrsas_atomic_inc(&sc->fw_outstanding); mrsas_prepare_secondRaid1_IO(sc, cmd); mrsas_fire_cmd(sc, req_desc->addr.u.low, req_desc->addr.u.high); @@ -670,6 +678,7 @@ mrsas_startio(struct mrsas_softc *sc, struct cam_sim * done: xpt_done(ccb); + mrsas_atomic_dec(&sc->fw_outstanding); return (0); } @@ -1093,14 +1102,20 @@ mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mp (io_info.r1_alt_dev_handle != MR_DEVHANDLE_INVALID) && (raid->level == 1) && !io_info.isRead) { r1_cmd = mrsas_get_mpt_cmd(sc); - if (!r1_cmd) { + if (mrsas_atomic_inc_return(&sc->fw_outstanding) > sc->max_scsi_cmds) { fp_possible = FALSE; - printf("Avago debug fp disable from %s %d \n", - __func__, __LINE__); + mrsas_atomic_dec(&sc->fw_outstanding); } else { - cmd->peer_cmd = r1_cmd; - r1_cmd->peer_cmd = cmd; - } + r1_cmd = mrsas_get_mpt_cmd(sc); + if (!r1_cmd) { + fp_possible = FALSE; + mrsas_atomic_dec(&sc->fw_outstanding); + } + else { + cmd->peer_cmd = r1_cmd; + r1_cmd->peer_cmd = cmd; + } + } } } From owner-svn-src-all@freebsd.org Tue Apr 30 07:32:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C801815866E7; Tue, 30 Apr 2019 07:32:03 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D2E890D46; Tue, 30 Apr 2019 07:32:03 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C7E06709; Tue, 30 Apr 2019 07:32:03 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U7W38J055353; Tue, 30 Apr 2019 07:32:03 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U7W317055352; Tue, 30 Apr 2019 07:32:03 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904300732.x3U7W317055352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Apr 2019 07:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346945 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346945 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6D2E890D46 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 07:32:04 -0000 Author: np Date: Tue Apr 30 07:32:02 2019 New Revision: 346945 URL: https://svnweb.freebsd.org/changeset/base/346945 Log: MFC r341654: cxgbe(4): Get Linux cxgb4vf working in bhyve VMs with VFs passed through. cxgb4vf doesn't own the buffer size list but still expects the first two entries to be 4K and some power of 2 respectively. The BSD cxgbe doesn't care where its preferred buffer sizes are as long as they're in the list somewhere, so just move its entries towards the end as a workaround. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Tue Apr 30 07:12:30 2019 (r346944) +++ stable/11/sys/dev/cxgbe/t4_sge.c Tue Apr 30 07:32:02 2019 (r346945) @@ -665,8 +665,10 @@ t4_tweak_chip_settings(struct adapter *sc) KASSERT(nitems(sge_flbuf_sizes) <= SGE_FLBUF_SIZES, ("%s: hw buffer size table too big", __func__)); + t4_write_reg(sc, A_SGE_FL_BUFFER_SIZE0, 4096); + t4_write_reg(sc, A_SGE_FL_BUFFER_SIZE1, 65536); for (i = 0; i < min(nitems(sge_flbuf_sizes), SGE_FLBUF_SIZES); i++) { - t4_write_reg(sc, A_SGE_FL_BUFFER_SIZE0 + (4 * i), + t4_write_reg(sc, A_SGE_FL_BUFFER_SIZE15 - (4 * i), sge_flbuf_sizes[i]); } From owner-svn-src-all@freebsd.org Tue Apr 30 07:34:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7655015867B0; Tue, 30 Apr 2019 07:34:35 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B0DB90EFF; Tue, 30 Apr 2019 07:34:35 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 022EA6734; Tue, 30 Apr 2019 07:34:35 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U7YY6r057759; Tue, 30 Apr 2019 07:34:34 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U7YYYM057758; Tue, 30 Apr 2019 07:34:34 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904300734.x3U7YYYM057758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Apr 2019 07:34:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346946 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1B0DB90EFF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 07:34:35 -0000 Author: np Date: Tue Apr 30 07:34:34 2019 New Revision: 346946 URL: https://svnweb.freebsd.org/changeset/base/346946 Log: MFC r342234: cxgbe(4): Do not issue mbox commands after t4_fw_bye. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/t4_clip.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_clip.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_clip.c Tue Apr 30 07:32:02 2019 (r346945) +++ stable/11/sys/dev/cxgbe/t4_clip.c Tue Apr 30 07:34:34 2019 (r346946) @@ -324,7 +324,9 @@ t4_destroy_clip_table(struct adapter *sc) ("%s: CLIP entry %p still in use (%d)", __func__, ce, ce->refcount)); TAILQ_REMOVE(&sc->clip_table, ce, link); +#if 0 delete_lip(sc, &ce->lip); +#endif free(ce, M_CXGBE); } mtx_unlock(&sc->clip_table_lock); From owner-svn-src-all@freebsd.org Tue Apr 30 07:37:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0F0915868A9; Tue, 30 Apr 2019 07:37:03 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96A7391088; Tue, 30 Apr 2019 07:37:03 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 822906738; Tue, 30 Apr 2019 07:37:03 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U7b3op057913; Tue, 30 Apr 2019 07:37:03 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U7b39e057912; Tue, 30 Apr 2019 07:37:03 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904300737.x3U7b39e057912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Apr 2019 07:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346947 - stable/11/sys/dev/cxgbe/tom X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 346947 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 96A7391088 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 07:37:04 -0000 Author: np Date: Tue Apr 30 07:37:03 2019 New Revision: 346947 URL: https://svnweb.freebsd.org/changeset/base/346947 Log: MFC r342356: Remove unused macros from t4_tom.h. Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.h Tue Apr 30 07:34:34 2019 (r346946) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.h Tue Apr 30 07:37:03 2019 (r346947) @@ -218,10 +218,6 @@ struct flowc_tx_params { unsigned int mss; }; -#define DDP_RETRY_WAIT 5 /* seconds to wait before re-enabling DDP */ -#define DDP_LOW_SCORE 1 -#define DDP_HIGH_SCORE 3 - /* * Compressed state for embryonic connections for a listener. Barely fits in * 64B, try not to grow it further. From owner-svn-src-all@freebsd.org Tue Apr 30 07:40:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CBDE1586999; Tue, 30 Apr 2019 07:40:02 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22B64912BF; Tue, 30 Apr 2019 07:40:02 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBFAA673D; Tue, 30 Apr 2019 07:40:01 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U7e1ho058220; Tue, 30 Apr 2019 07:40:01 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U7e14b058219; Tue, 30 Apr 2019 07:40:01 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904300740.x3U7e14b058219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Apr 2019 07:40:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346948 - stable/11/sys/dev/cxgbe/common X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe/common X-SVN-Commit-Revision: 346948 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 22B64912BF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 07:40:02 -0000 Author: np Date: Tue Apr 30 07:40:01 2019 New Revision: 346948 URL: https://svnweb.freebsd.org/changeset/base/346948 Log: MFC r342758: cxgbe(4): Clear FW_OK if the firmware reports an error. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/11/sys/dev/cxgbe/common/t4_hw.c Tue Apr 30 07:37:03 2019 (r346947) +++ stable/11/sys/dev/cxgbe/common/t4_hw.c Tue Apr 30 07:40:01 2019 (r346948) @@ -209,9 +209,11 @@ static void t4_report_fw_error(struct adapter *adap) u32 pcie_fw; pcie_fw = t4_read_reg(adap, A_PCIE_FW); - if (pcie_fw & F_PCIE_FW_ERR) + if (pcie_fw & F_PCIE_FW_ERR) { CH_ERR(adap, "Firmware reports adapter error: %s\n", reason[G_PCIE_FW_EVAL(pcie_fw)]); + adap->flags &= ~FW_OK; + } } /* From owner-svn-src-all@freebsd.org Tue Apr 30 07:45:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C1A81586D9A; Tue, 30 Apr 2019 07:45:08 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21F85917B1; Tue, 30 Apr 2019 07:45:08 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE79C68DE; Tue, 30 Apr 2019 07:45:07 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U7j75G063429; Tue, 30 Apr 2019 07:45:07 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U7j7YH063428; Tue, 30 Apr 2019 07:45:07 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904300745.x3U7j7YH063428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Apr 2019 07:45:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346949 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346949 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 21F85917B1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 07:45:08 -0000 Author: np Date: Tue Apr 30 07:45:07 2019 New Revision: 346949 URL: https://svnweb.freebsd.org/changeset/base/346949 Log: MFC r342954: cxgbe(4): Move some INTx specific code to a more appropriate place. Modified: stable/11/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Tue Apr 30 07:40:01 2019 (r346948) +++ stable/11/sys/dev/cxgbe/t4_sge.c Tue Apr 30 07:45:07 2019 (r346949) @@ -1325,6 +1325,9 @@ t4_intr_all(void *arg) MPASS(sc->intr_count == 1); + if (sc->intr_type == INTR_INTX) + t4_write_reg(sc, MYPF_REG(A_PCIE_PF_CLI), 0); + t4_intr_err(arg); t4_intr_evt(fwq); } @@ -1338,7 +1341,6 @@ t4_intr_err(void *arg) { struct adapter *sc = arg; - t4_write_reg(sc, MYPF_REG(A_PCIE_PF_CLI), 0); t4_slow_intr_handler(sc); } From owner-svn-src-all@freebsd.org Tue Apr 30 07:53:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9B631587044; Tue, 30 Apr 2019 07:53:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C62191BFB; Tue, 30 Apr 2019 07:53:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 449136A95; Tue, 30 Apr 2019 07:53:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U7rGtY068312; Tue, 30 Apr 2019 07:53:16 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U7rFEh068310; Tue, 30 Apr 2019 07:53:15 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904300753.x3U7rFEh068310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Apr 2019 07:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346950 - stable/11/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 346950 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C62191BFB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 07:53:17 -0000 Author: np Date: Tue Apr 30 07:53:15 2019 New Revision: 346950 URL: https://svnweb.freebsd.org/changeset/base/346950 Log: MFC r343569, r345307 r343569: cxgbe/iw_cxgbe: Fix an address calculation in the memory registration code that was added in r342266. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications r345307: iw_cxgbe: Remove unused smac_idx from the ep structure. Submitted by: Krishnamraju Eraparaju @ Chelsio Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h stable/11/sys/dev/cxgbe/iw_cxgbe/mem.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Tue Apr 30 07:45:07 2019 (r346949) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Tue Apr 30 07:53:15 2019 (r346950) @@ -857,7 +857,6 @@ struct c4iw_ep { unsigned int mpa_pkt_len; u32 ird; u32 ord; - u32 smac_idx; u32 tx_chan; u32 mtu; u16 mss; Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/mem.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/mem.c Tue Apr 30 07:45:07 2019 (r346949) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/mem.c Tue Apr 30 07:53:15 2019 (r346950) @@ -205,7 +205,7 @@ _c4iw_write_mem_dma(struct c4iw_rdev *rdev, u32 addr, if (ret) goto out; addr += dmalen >> 5; - data = (u64 *)data + dmalen; + data = (u8 *)data + dmalen; daddr = daddr + dmalen; } if (remain) From owner-svn-src-all@freebsd.org Tue Apr 30 08:02:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6B0915874B9; Tue, 30 Apr 2019 08:02:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59CD092014; Tue, 30 Apr 2019 08:02:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 01E3F6C16; Tue, 30 Apr 2019 08:02:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U81x6B072704; Tue, 30 Apr 2019 08:01:59 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U81xB2072703; Tue, 30 Apr 2019 08:01:59 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904300801.x3U81xB2072703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Apr 2019 08:01:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346951 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346951 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 59CD092014 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 08:02:00 -0000 Author: np Date: Tue Apr 30 08:01:59 2019 New Revision: 346951 URL: https://svnweb.freebsd.org/changeset/base/346951 Log: MFC r343233: cxgbe(4): Clear the reply-pending status of a hashfilter when the reply indicates an error. Also, do not remove it twice from the hf list in this case. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communicatons Modified: stable/11/sys/dev/cxgbe/t4_filter.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_filter.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_filter.c Tue Apr 30 07:53:15 2019 (r346950) +++ stable/11/sys/dev/cxgbe/t4_filter.c Tue Apr 30 08:01:59 2019 (r346951) @@ -1229,6 +1229,7 @@ t4_hashfilter_ao_rpl(struct sge_iq *iq, const struct r /* provide errno instead of tid to ioctl */ f->tid = act_open_rpl_status_to_errno(status); f->valid = 0; + f->pending = 0; if (act_open_has_tid(status)) release_tid(sc, GET_TID(cpl), &sc->sge.ctrlq[0]); free_filter_resources(f); @@ -1587,7 +1588,6 @@ set_hashfilter(struct adapter *sc, struct t4_filter *t f->locked = 0; t->idx = f->tid; } else { - remove_hf(sc, f); rc = f->tid; free(f, M_CXGBE); } From owner-svn-src-all@freebsd.org Tue Apr 30 08:08:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 989101587A94; Tue, 30 Apr 2019 08:08:07 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3AB6C92402; Tue, 30 Apr 2019 08:08:07 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 11E356C51; Tue, 30 Apr 2019 08:08:07 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U886sp073907; Tue, 30 Apr 2019 08:08:06 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U886Ub073906; Tue, 30 Apr 2019 08:08:06 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904300808.x3U886Ub073906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Apr 2019 08:08:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346952 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346952 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3AB6C92402 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 08:08:07 -0000 Author: np Date: Tue Apr 30 08:08:06 2019 New Revision: 346952 URL: https://svnweb.freebsd.org/changeset/base/346952 Log: MFC r343264: cxgbe(4): Use a truncated firmware header for version checks. All the version numbers are towards the begining of the header. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Tue Apr 30 08:01:59 2019 (r346951) +++ stable/11/sys/dev/cxgbe/t4_main.c Tue Apr 30 08:08:06 2019 (r346952) @@ -3281,17 +3281,38 @@ restart: V_FW_HDR_FW_VER_BUILD(chip##FW_VERSION_BUILD)) #define FW_INTFVER(chip, intf) (chip##FW_HDR_INTFVER_##intf) +/* Just enough of fw_hdr to cover all version info. */ +struct fw_h { + __u8 ver; + __u8 chip; + __be16 len512; + __be32 fw_ver; + __be32 tp_microcode_ver; + __u8 intfver_nic; + __u8 intfver_vnic; + __u8 intfver_ofld; + __u8 intfver_ri; + __u8 intfver_iscsipdu; + __u8 intfver_iscsi; + __u8 intfver_fcoepdu; + __u8 intfver_fcoe; +}; +/* Spot check a couple of fields. */ +CTASSERT(offsetof(struct fw_h, fw_ver) == offsetof(struct fw_hdr, fw_ver)); +CTASSERT(offsetof(struct fw_h, intfver_nic) == offsetof(struct fw_hdr, intfver_nic)); +CTASSERT(offsetof(struct fw_h, intfver_fcoe) == offsetof(struct fw_hdr, intfver_fcoe)); + struct fw_info { uint8_t chip; char *kld_name; char *fw_mod_name; - struct fw_hdr fw_hdr; /* XXX: waste of space, need a sparse struct */ + struct fw_h fw_h; } fw_info[] = { { .chip = CHELSIO_T4, .kld_name = "t4fw_cfg", .fw_mod_name = "t4fw", - .fw_hdr = { + .fw_h = { .chip = FW_HDR_CHIP_T4, .fw_ver = htobe32(FW_VERSION(T4)), .intfver_nic = FW_INTFVER(T4, NIC), @@ -3307,7 +3328,7 @@ struct fw_info { .chip = CHELSIO_T5, .kld_name = "t5fw_cfg", .fw_mod_name = "t5fw", - .fw_hdr = { + .fw_h = { .chip = FW_HDR_CHIP_T5, .fw_ver = htobe32(FW_VERSION(T5)), .intfver_nic = FW_INTFVER(T5, NIC), @@ -3323,7 +3344,7 @@ struct fw_info { .chip = CHELSIO_T6, .kld_name = "t6fw_cfg", .fw_mod_name = "t6fw", - .fw_hdr = { + .fw_h = { .chip = FW_HDR_CHIP_T6, .fw_ver = htobe32(FW_VERSION(T6)), .intfver_nic = FW_INTFVER(T6, NIC), @@ -3355,7 +3376,7 @@ find_fw_info(int chip) * with? */ static int -fw_compatible(const struct fw_hdr *hdr1, const struct fw_hdr *hdr2) +fw_compatible(const struct fw_h *hdr1, const struct fw_h *hdr2) { /* short circuit if it's the exact same firmware version */ @@ -3422,8 +3443,8 @@ unload_fw_module(struct adapter *sc, const struct firm * +ve errno means a firmware install was attempted but failed. */ static int -install_kld_firmware(struct adapter *sc, struct fw_hdr *card_fw, - const struct fw_hdr *drv_fw, const char *reason, int *already) +install_kld_firmware(struct adapter *sc, struct fw_h *card_fw, + const struct fw_h *drv_fw, const char *reason, int *already) { const struct firmware *cfg, *fw; const uint32_t c = be32toh(card_fw->fw_ver); @@ -3528,7 +3549,7 @@ contact_firmware(struct adapter *sc) enum dev_state state; struct fw_info *fw_info; struct fw_hdr *card_fw; /* fw on the card */ - const struct fw_hdr *drv_fw; /* fw bundled with the driver */ + const struct fw_h *drv_fw; fw_info = find_fw_info(chip_id(sc)); if (fw_info == NULL) { @@ -3537,7 +3558,7 @@ contact_firmware(struct adapter *sc) chip_id(sc)); return (EINVAL); } - drv_fw = &fw_info->fw_hdr; + drv_fw = &fw_info->fw_h; /* Read the header of the firmware on the card */ card_fw = malloc(sizeof(*card_fw), M_CXGBE, M_ZERO | M_WAITOK); @@ -3550,7 +3571,8 @@ restart: goto done; } - rc = install_kld_firmware(sc, card_fw, drv_fw, NULL, &already); + rc = install_kld_firmware(sc, (struct fw_h *)card_fw, drv_fw, NULL, + &already); if (rc == ERESTART) goto restart; if (rc != 0) @@ -3563,7 +3585,7 @@ restart: "failed to connect to the firmware: %d, %d. " "PCIE_FW 0x%08x\n", rc, state, t4_read_reg(sc, A_PCIE_FW)); #if 0 - if (install_kld_firmware(sc, card_fw, drv_fw, + if (install_kld_firmware(sc, (struct fw_h *)card_fw, drv_fw, "not responding properly to HELLO", &already) == ERESTART) goto restart; #endif @@ -3574,7 +3596,8 @@ restart: if (rc == sc->pf) { sc->flags |= MASTER_PF; - rc = install_kld_firmware(sc, card_fw, drv_fw, NULL, &already); + rc = install_kld_firmware(sc, (struct fw_h *)card_fw, drv_fw, + NULL, &already); if (rc == ERESTART) rc = 0; else if (rc != 0) From owner-svn-src-all@freebsd.org Tue Apr 30 08:17:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A8A2158834C; Tue, 30 Apr 2019 08:17:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3169692CAE; Tue, 30 Apr 2019 08:17:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09DD06E19; Tue, 30 Apr 2019 08:17:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U8HBrf079354; Tue, 30 Apr 2019 08:17:11 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U8HB5l079353; Tue, 30 Apr 2019 08:17:11 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904300817.x3U8HB5l079353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Apr 2019 08:17:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346954 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346954 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3169692CAE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 08:17:12 -0000 Author: np Date: Tue Apr 30 08:17:11 2019 New Revision: 346954 URL: https://svnweb.freebsd.org/changeset/base/346954 Log: MFC r343269, r346567 r343269: cxgbe(4): Allow negative values in hw.cxgbe.fw_install and take them to mean that the driver should taste the firmware in the KLD and use that firmware's version for all its fw_install checks. The driver gets firmware version information from compiled-in values by default and this change allows custom (or older/newer) firmware modules to be used with the stock driver. There is no change in default behavior. Sponsored by: Chelsio Communications r346567: cxgbe(4): Make sure bundled_fw is always initialized before use. This fixes a bug that prevented the driver from auto-flashing the firmware when it didn't see one on the card. This feature was introduced in r321390 and this bug was introduced in r343269. Reported by: gallatin@ Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Tue Apr 30 08:09:32 2019 (r346953) +++ stable/11/sys/dev/cxgbe/t4_main.c Tue Apr 30 08:17:11 2019 (r346954) @@ -477,9 +477,10 @@ SYSCTL_INT(_hw_cxgbe, OID_AUTO, autoneg, CTLFLAG_RDTUN /* * Firmware auto-install by driver during attach (0, 1, 2 = prohibited, allowed, - * encouraged respectively). + * encouraged respectively). '-n' is the same as 'n' except the firmware + * version used in the checks is read from the firmware bundled with the driver. */ -static unsigned int t4_fw_install = 1; +static int t4_fw_install = 1; SYSCTL_INT(_hw_cxgbe, OID_AUTO, fw_install, CTLFLAG_RDTUN, &t4_fw_install, 0, "Firmware auto-install (0 = prohibited, 1 = allowed, 2 = encouraged)"); @@ -3448,10 +3449,31 @@ install_kld_firmware(struct adapter *sc, struct fw_h * { const struct firmware *cfg, *fw; const uint32_t c = be32toh(card_fw->fw_ver); - const uint32_t d = be32toh(drv_fw->fw_ver); - uint32_t k; - int rc; + uint32_t d, k; + int rc, fw_install; + struct fw_h bundled_fw; + bool load_attempted; + cfg = fw = NULL; + load_attempted = false; + fw_install = t4_fw_install < 0 ? -t4_fw_install : t4_fw_install; + + memcpy(&bundled_fw, drv_fw, sizeof(bundled_fw)); + if (t4_fw_install < 0) { + rc = load_fw_module(sc, &cfg, &fw); + if (rc != 0 || fw == NULL) { + device_printf(sc->dev, + "failed to load firmware module: %d. cfg %p, fw %p;" + " will use compiled-in firmware version for" + "hw.cxgbe.fw_install checks.\n", + rc, cfg, fw); + } else { + memcpy(&bundled_fw, fw->data, sizeof(bundled_fw)); + } + load_attempted = true; + } + d = be32toh(bundled_fw.fw_ver); + if (reason != NULL) goto install; @@ -3462,10 +3484,11 @@ install_kld_firmware(struct adapter *sc, struct fw_h * goto install; } - return (0); + rc = 0; + goto done; } - if (!fw_compatible(card_fw, drv_fw)) { + if (!fw_compatible(card_fw, &bundled_fw)) { reason = "incompatible or unusable"; goto install; } @@ -3475,52 +3498,72 @@ install_kld_firmware(struct adapter *sc, struct fw_h * goto install; } - if (t4_fw_install == 2 && d != c) { + if (fw_install == 2 && d != c) { reason = "different than the version bundled with this driver"; goto install; } - return (0); + /* No reason to do anything to the firmware already on the card. */ + rc = 0; + goto done; install: + rc = 0; if ((*already)++) - return (0); + goto done; - if (t4_fw_install == 0) { + if (fw_install == 0) { device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, " "but the driver is prohibited from installing a firmware " "on the card.\n", G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c), G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), reason); - return (0); + goto done; } - device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, " - "installing firmware %u.%u.%u.%u on card.\n", - G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c), - G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), reason, - G_FW_HDR_FW_VER_MAJOR(d), G_FW_HDR_FW_VER_MINOR(d), - G_FW_HDR_FW_VER_MICRO(d), G_FW_HDR_FW_VER_BUILD(d)); - - rc = load_fw_module(sc, &cfg, &fw); - if (rc != 0 || fw == NULL) { - device_printf(sc->dev, - "failed to load firmware module: %d. cfg %p, fw %p\n", rc, - cfg, fw); + /* + * We'll attempt to install a firmware. Load the module first (if it + * hasn't been loaded already). + */ + if (!load_attempted) { + rc = load_fw_module(sc, &cfg, &fw); + if (rc != 0 || fw == NULL) { + device_printf(sc->dev, + "failed to load firmware module: %d. cfg %p, fw %p\n", + rc, cfg, fw); + /* carry on */ + } + } + if (fw == NULL) { + device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, " + "but the driver cannot take corrective action because it " + "is unable to load the firmware module.\n", + G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c), + G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), reason); rc = sc->flags & FW_OK ? 0 : ENOENT; goto done; } k = be32toh(((const struct fw_hdr *)fw->data)->fw_ver); if (k != d) { + MPASS(t4_fw_install > 0); device_printf(sc->dev, "firmware in KLD (%u.%u.%u.%u) is not what the driver was " - "compiled with and will not be used.\n", + "expecting (%u.%u.%u.%u) and will not be used.\n", G_FW_HDR_FW_VER_MAJOR(k), G_FW_HDR_FW_VER_MINOR(k), - G_FW_HDR_FW_VER_MICRO(k), G_FW_HDR_FW_VER_BUILD(k)); + G_FW_HDR_FW_VER_MICRO(k), G_FW_HDR_FW_VER_BUILD(k), + G_FW_HDR_FW_VER_MAJOR(d), G_FW_HDR_FW_VER_MINOR(d), + G_FW_HDR_FW_VER_MICRO(d), G_FW_HDR_FW_VER_BUILD(d)); rc = sc->flags & FW_OK ? 0 : EINVAL; goto done; } + + device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, " + "installing firmware %u.%u.%u.%u on card.\n", + G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c), + G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), reason, + G_FW_HDR_FW_VER_MAJOR(d), G_FW_HDR_FW_VER_MINOR(d), + G_FW_HDR_FW_VER_MICRO(d), G_FW_HDR_FW_VER_BUILD(d)); rc = -t4_fw_upgrade(sc, sc->mbox, fw->data, fw->datasize, 0); if (rc != 0) { From owner-svn-src-all@freebsd.org Tue Apr 30 09:10:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0AEE1589C96; Tue, 30 Apr 2019 09:10:48 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 928AC94F8A; Tue, 30 Apr 2019 09:10:48 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69EBA76A3; Tue, 30 Apr 2019 09:10:48 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U9AmGT006682; Tue, 30 Apr 2019 09:10:48 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U9AjUP006664; Tue, 30 Apr 2019 09:10:45 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201904300910.x3U9AjUP006664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Tue, 30 Apr 2019 09:10:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346955 - stable/12/sys/fs/ext2fs X-SVN-Group: stable-12 X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: stable/12/sys/fs/ext2fs X-SVN-Commit-Revision: 346955 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 928AC94F8A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 09:10:49 -0000 Author: fsu Date: Tue Apr 30 09:10:45 2019 New Revision: 346955 URL: https://svnweb.freebsd.org/changeset/base/346955 Log: MFC r346267, 346269: ext2fs: Initial version of DTrace support. Reviewed by: pfg, gnn Differential Revision: https://reviews.freebsd.org/D19848 Modified: stable/12/sys/fs/ext2fs/ext2_alloc.c stable/12/sys/fs/ext2fs/ext2_csum.c stable/12/sys/fs/ext2fs/ext2_extattr.c stable/12/sys/fs/ext2fs/ext2_extents.c stable/12/sys/fs/ext2fs/ext2_extents.h stable/12/sys/fs/ext2fs/ext2_extern.h stable/12/sys/fs/ext2fs/ext2_hash.c stable/12/sys/fs/ext2fs/ext2_htree.c stable/12/sys/fs/ext2fs/ext2_inode.c stable/12/sys/fs/ext2fs/ext2_inode_cnv.c stable/12/sys/fs/ext2fs/ext2_lookup.c stable/12/sys/fs/ext2fs/ext2_subr.c stable/12/sys/fs/ext2fs/ext2_vfsops.c stable/12/sys/fs/ext2fs/ext2_vnops.c stable/12/sys/fs/ext2fs/fs.h Modified: stable/12/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_alloc.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_alloc.c Tue Apr 30 09:10:45 2019 (r346955) @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -55,6 +56,23 @@ #include #include +SDT_PROVIDER_DEFINE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , alloc, trace, "int", "char*"); +SDT_PROBE_DEFINE3(ext2fs, , alloc, ext2_reallocblks_realloc, + "ino_t", "e2fs_lbn_t", "e2fs_lbn_t"); +SDT_PROBE_DEFINE1(ext2fs, , alloc, ext2_reallocblks_bap, "uint32_t"); +SDT_PROBE_DEFINE1(ext2fs, , alloc, ext2_reallocblks_blkno, "e2fs_daddr_t"); +SDT_PROBE_DEFINE2(ext2fs, , alloc, ext2_b_bitmap_validate_error, "char*", "int"); +SDT_PROBE_DEFINE3(ext2fs, , alloc, ext2_nodealloccg_bmap_corrupted, + "int", "daddr_t", "char*"); +SDT_PROBE_DEFINE2(ext2fs, , alloc, ext2_blkfree_bad_block, "ino_t", "e4fs_daddr_t"); +SDT_PROBE_DEFINE2(ext2fs, , alloc, ext2_vfree_doublefree, "char*", "ino_t"); + static daddr_t ext2_alloccg(struct inode *, int, daddr_t, int); static daddr_t ext2_clusteralloc(struct inode *, int, daddr_t, int); static u_long ext2_dirpref(struct inode *); @@ -128,8 +146,7 @@ ext2_alloc(struct inode *ip, daddr_t lbn, e4fs_daddr_t } nospace: EXT2_UNLOCK(ump); - ext2_fserr(fs, cred->cr_uid, "filesystem full"); - uprintf("\n%s: write failed, filesystem is full\n", fs->e2fs_fsmnt); + SDT_PROBE2(ext2fs, , alloc, trace, 1, "cannot allocate data block"); return (ENOSPC); } @@ -147,8 +164,10 @@ ext2_alloc_meta(struct inode *ip) EXT2_LOCK(ip->i_ump); blk = ext2_hashalloc(ip, ino_to_cg(fs, ip->i_number), 0, fs->e2fs_bsize, ext2_alloccg); - if (0 == blk) + if (0 == blk) { EXT2_UNLOCK(ip->i_ump); + SDT_PROBE2(ext2fs, , alloc, trace, 1, "cannot allocate meta block"); + } return (blk); } @@ -289,10 +308,8 @@ ext2_reallocblks(struct vop_reallocblks_args *ap) * block pointers in the inode and indirect blocks associated * with the file. */ -#ifdef DEBUG - printf("realloc: ino %ju, lbns %jd-%jd\n\told:", - (uintmax_t)ip->i_number, (intmax_t)start_lbn, (intmax_t)end_lbn); -#endif /* DEBUG */ + SDT_PROBE3(ext2fs, , alloc, ext2_reallocblks_realloc, + ip->i_number, start_lbn, end_lbn); blkno = newblk; for (bap = &sbap[soff], i = 0; i < len; i++, blkno += fs->e2fs_fpb) { if (i == ssize) { @@ -303,9 +320,7 @@ ext2_reallocblks(struct vop_reallocblks_args *ap) if (buflist->bs_children[i]->b_blkno != fsbtodb(fs, *bap)) panic("ext2_reallocblks: alloc mismatch"); #endif -#ifdef DEBUG - printf(" %d,", *bap); -#endif /* DEBUG */ + SDT_PROBE1(ext2fs, , alloc, ext2_reallocblks_bap, *bap); *bap++ = blkno; } /* @@ -341,20 +356,13 @@ ext2_reallocblks(struct vop_reallocblks_args *ap) /* * Last, free the old blocks and assign the new blocks to the buffers. */ -#ifdef DEBUG - printf("\n\tnew:"); -#endif /* DEBUG */ for (blkno = newblk, i = 0; i < len; i++, blkno += fs->e2fs_fpb) { ext2_blkfree(ip, dbtofsb(fs, buflist->bs_children[i]->b_blkno), fs->e2fs_bsize); buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno); -#ifdef DEBUG - printf(" %d,", blkno); -#endif /* DEBUG */ + SDT_PROBE1(ext2fs, , alloc, ext2_reallocblks_blkno, blkno); } -#ifdef DEBUG - printf("\n"); -#endif /* DEBUG */ + return (0); fail: @@ -481,8 +489,7 @@ ext2_valloc(struct vnode *pvp, int mode, struct ucred noinodes: EXT2_UNLOCK(ump); - ext2_fserr(fs, cred->cr_uid, "out of inodes"); - uprintf("\n%s: create/symlink failed, no inodes free\n", fs->e2fs_fsmnt); + SDT_PROBE2(ext2fs, , alloc, trace, 1, "out of inodes"); return (ENOSPC); } @@ -959,21 +966,24 @@ ext2_b_bitmap_validate(struct m_ext2fs *fs, struct buf /* Check block bitmap block number */ offset = e2fs_gd_get_b_bitmap(gd) - group_first_block; if (offset >= max_bit || !isset(bp->b_data, offset)) { - printf("ext2fs: bad block bitmap, group %d\n", cg); + SDT_PROBE2(ext2fs, , alloc, ext2_b_bitmap_validate_error, + "bad block bitmap, group", cg); return (EINVAL); } /* Check inode bitmap block number */ offset = e2fs_gd_get_i_bitmap(gd) - group_first_block; if (offset >= max_bit || !isset(bp->b_data, offset)) { - printf("ext2fs: bad inode bitmap, group %d\n", cg); + SDT_PROBE2(ext2fs, , alloc, ext2_b_bitmap_validate_error, + "bad inode bitmap", cg); return (EINVAL); } /* Check inode table */ offset = e2fs_gd_get_i_tables(gd) - group_first_block; if (offset >= max_bit || offset + fs->e2fs_itpg >= max_bit) { - printf("ext2fs: bad inode table, group %d\n", cg); + SDT_PROBE2(ext2fs, , alloc, ext2_b_bitmap_validate_error, + "bad inode table, group", cg); return (EINVAL); } @@ -1350,9 +1360,8 @@ ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipr start = 0; loc = memcchr(&ibp[start], 0xff, len); if (loc == NULL) { - printf("ext2fs: inode bitmap corrupted: " - "cg = %d, ipref = %lld, fs = %s - run fsck\n", - cg, (long long)ipref, fs->e2fs_fsmnt); + SDT_PROBE3(ext2fs, , alloc, ext2_nodealloccg_bmap_corrupted, + cg, ipref, fs->e2fs_fsmnt); brelse(bp); EXT2_LOCK(ump); return (0); @@ -1401,9 +1410,7 @@ ext2_blkfree(struct inode *ip, e4fs_daddr_t bno, long ump = ip->i_ump; cg = dtog(fs, bno); if (bno >= fs->e2fs_bcount) { - printf("bad block %lld, ino %ju\n", (long long)bno, - (uintmax_t)ip->i_number); - ext2_fserr(fs, ip->i_uid, "bad block"); + SDT_PROBE2(ext2fs, , alloc, ext2_blkfree_bad_block, ip->i_number, bno); return; } error = bread(ip->i_devvp, @@ -1416,9 +1423,8 @@ ext2_blkfree(struct inode *ip, e4fs_daddr_t bno, long bbp = (char *)bp->b_data; bno = dtogd(fs, bno); if (isclr(bbp, bno)) { - printf("block = %lld, fs = %s\n", + panic("ext2_blkfree: freeing free block %lld, fs=%s", (long long)bno, fs->e2fs_fsmnt); - panic("ext2_blkfree: freeing free block"); } clrbit(bbp, bno); EXT2_LOCK(ump); @@ -1464,8 +1470,8 @@ ext2_vfree(struct vnode *pvp, ino_t ino, int mode) ibp = (char *)bp->b_data; ino = (ino - 1) % fs->e2fs->e2fs_ipg; if (isclr(ibp, ino)) { - printf("ino = %ju, fs = %s\n", - ino, fs->e2fs_fsmnt); + SDT_PROBE2(ext2fs, , alloc, ext2_vfree_doublefree, + fs->e2fs_fsmnt, ino); if (fs->e2fs_ronly == 0) panic("ext2_vfree: freeing free inode"); } @@ -1513,26 +1519,12 @@ ext2_mapsearch(struct m_ext2fs *fs, char *bbp, daddr_t start = 0; loc = memcchr(&bbp[start], 0xff, len); if (loc == NULL) { - printf("start = %d, len = %d, fs = %s\n", + panic("ext2_mapsearch: map corrupted: start=%d, len=%d, fs=%s", start, len, fs->e2fs_fsmnt); - panic("ext2_mapsearch: map corrupted"); /* NOTREACHED */ } } return ((loc - bbp) * NBBY + ffs(~*loc) - 1); -} - -/* - * Fserr prints the name of a filesystem with an error diagnostic. - * - * The form of the error message is: - * fs: error message - */ -void -ext2_fserr(struct m_ext2fs *fs, uid_t uid, char *cp) -{ - - log(LOG_ERR, "uid %u on %s: %s\n", uid, fs->e2fs_fsmnt, cp); } int Modified: stable/12/sys/fs/ext2fs/ext2_csum.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_csum.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_csum.c Tue Apr 30 09:10:45 2019 (r346955) @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -50,6 +51,14 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , trace, csum, "int", "char*"); + #define EXT2_BG_INODE_BITMAP_CSUM_HI_END \ (offsetof(struct ext2_gd, ext4bgd_i_bmap_csum_hi) + \ sizeof(uint16_t)) @@ -134,8 +143,7 @@ ext2_extattr_blk_csum_verify(struct inode *ip, struct if (EXT2_HAS_RO_COMPAT_FEATURE(ip->i_e2fs, EXT2F_ROCOMPAT_METADATA_CKSUM) && (header->h_checksum != ext2_extattr_blk_csum(ip, ip->i_facl, header))) { - printf("WARNING: bad extattr csum detected, ip=%lu - run fsck\n", - (unsigned long)ip->i_number); + SDT_PROBE2(ext2fs, , trace, csum, 1, "bad extattr csum detected"); return (EIO); } @@ -351,8 +359,7 @@ ext2_dir_blk_csum_verify(struct inode *ip, struct buf error = ext2_dx_csum_verify(ip, ep); if (error) - printf("WARNING: bad directory csum detected, ip=%lu" - " - run fsck\n", (unsigned long)ip->i_number); + SDT_PROBE2(ext2fs, , trace, csum, 1, "bad directory csum detected"); return (error); } @@ -445,8 +452,7 @@ ext2_extent_blk_csum_verify(struct inode *ip, void *da calculated = ext2_extent_blk_csum(ip, ehp); if (provided != calculated) { - printf("WARNING: bad extent csum detected, ip=%lu - run fsck\n", - (unsigned long)ip->i_number); + SDT_PROBE2(ext2fs, , trace, csum, 1, "bad extent csum detected"); return (EIO); } @@ -491,8 +497,7 @@ ext2_gd_i_bitmap_csum_verify(struct m_ext2fs *fs, int calculated &= 0xFFFF; if (provided != calculated) { - printf("WARNING: bad inode bitmap csum detected, " - "cg=%d - run fsck\n", cg); + SDT_PROBE2(ext2fs, , trace, csum, 1, "bad inode bitmap csum detected"); return (EIO); } @@ -532,8 +537,7 @@ ext2_gd_b_bitmap_csum_verify(struct m_ext2fs *fs, int calculated &= 0xFFFF; if (provided != calculated) { - printf("WARNING: bad block bitmap csum detected, " - "cg=%d - run fsck\n", cg); + SDT_PROBE2(ext2fs, , trace, csum, 1, "bad block bitmap csum detected"); return (EIO); } @@ -629,7 +633,7 @@ ext2_ei_csum_verify(struct inode *ip, struct ext2fs_di if (!memcmp(ei, &ei_zero, sizeof(struct ext2fs_dinode))) return (0); - printf("WARNING: Bad inode %ju csum - run fsck\n", ip->i_number); + SDT_PROBE2(ext2fs, , trace, csum, 1, "bad inode csum"); return (EIO); } Modified: stable/12/sys/fs/ext2fs/ext2_extattr.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_extattr.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_extattr.c Tue Apr 30 09:10:45 2019 (r346955) @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -48,6 +49,14 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , trace, extattr, "int", "char*"); + static int ext2_extattr_attrnamespace_to_bsd(int attrnamespace) { @@ -89,9 +98,8 @@ ext2_extattr_name_to_bsd(int attrnamespace, const char * XXX: Not all linux namespaces are mapped to bsd for now, * return NULL, which will be converted to ENOTSUP on upper layer. */ -#ifdef EXT2FS_DEBUG - printf("can not convert ext2fs name to bsd: namespace=%d\n", attrnamespace); -#endif + SDT_PROBE2(ext2fs, , trace, extattr, 1, + "can not convert ext2fs name to bsd namespace"); return (NULL); } Modified: stable/12/sys/fs/ext2fs/ext2_extents.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_extents.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_extents.c Tue Apr 30 09:10:45 2019 (r346955) @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -46,9 +47,17 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , trace, extents, "int", "char*"); + static MALLOC_DEFINE(M_EXT2EXTENTS, "ext2_extents", "EXT2 extents"); -#ifdef EXT2FS_DEBUG +#ifdef EXT2FS_PRINT_EXTENTS static void ext4_ext_print_extent(struct ext4_extent *ep) { @@ -230,22 +239,22 @@ ext4_ext_check_header(struct inode *ip, struct ext4_ex fs = ip->i_e2fs; if (eh->eh_magic != EXT4_EXT_MAGIC) { - error_msg = "invalid magic"; + error_msg = "header: invalid magic"; goto corrupted; } if (eh->eh_max == 0) { - error_msg = "invalid eh_max"; + error_msg = "header: invalid eh_max"; goto corrupted; } if (eh->eh_ecount > eh->eh_max) { - error_msg = "invalid eh_entries"; + error_msg = "header: invalid eh_entries"; goto corrupted; } return (0); corrupted: - ext2_fserr(fs, ip->i_uid, error_msg); + SDT_PROBE2(ext2fs, , trace, extents, 1, error_msg); return (EIO); } @@ -412,7 +421,7 @@ ext4_ext_find_extent(struct inode *ip, daddr_t block, ppos++; if (ppos > depth) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "ppos > depth => extent corrupted"); error = EIO; brelse(bp); @@ -643,13 +652,13 @@ ext4_ext_insert_index(struct inode *ip, struct ext4_ex fs = ip->i_e2fs; if (lblk == path->ep_index->ei_blk) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "lblk == index blk => extent corrupted"); return (EIO); } if (path->ep_header->eh_ecount >= path->ep_header->eh_max) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "ecout > maxcount => extent corrupted"); return (EIO); } @@ -667,7 +676,7 @@ ext4_ext_insert_index(struct inode *ip, struct ext4_ex memmove(idx + 1, idx, len * sizeof(struct ext4_extent_index)); if (idx > EXT_MAX_INDEX(path->ep_header)) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "index is out of range => extent corrupted"); return (EIO); } @@ -736,7 +745,7 @@ ext4_ext_split(struct inode *ip, struct ext4_extent_pa * We will split at current extent for now. */ if (path[depth].ep_ext > EXT_MAX_EXTENT(path[depth].ep_header)) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "extent is out of range => extent corrupted"); return (EIO); } @@ -773,7 +782,7 @@ ext4_ext_split(struct inode *ip, struct ext4_extent_pa ex = EXT_FIRST_EXTENT(neh); if (path[depth].ep_header->eh_ecount != path[depth].ep_header->eh_max) { - ext2_fserr(fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "extents count out of range => extent corrupted"); error = EIO; goto cleanup; @@ -1362,7 +1371,7 @@ ext4_ext_rm_leaf(struct inode *ip, struct ext4_extent_ eh = path[depth].ep_header; if (!eh) { - ext2_fserr(ip->i_e2fs, ip->i_uid, + SDT_PROBE2(ext2fs, , trace, extents, 1, "bad header => extent corrupted"); return (EIO); } @@ -1449,7 +1458,8 @@ ext4_read_extent_tree_block(struct inode *ip, e4fs_dad eh = ext4_ext_block_header(bp->b_data); if (eh->eh_depth != depth) { - ext2_fserr(fs, ip->i_uid, "unexpected eh_depth"); + SDT_PROBE2(ext2fs, , trace, extents, 1, + "unexpected eh_depth"); goto err; } Modified: stable/12/sys/fs/ext2fs/ext2_extents.h ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_extents.h Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_extents.h Tue Apr 30 09:10:45 2019 (r346955) @@ -129,7 +129,7 @@ int ext4_ext_remove_space(struct inode *ip, off_t leng int ext4_ext_get_blocks(struct inode *ip, int64_t iblock, unsigned long max_blocks, struct ucred *cred, struct buf **bpp, int *allocate, daddr_t *); -#ifdef EXT2FS_DEBUG +#ifdef EXT2FS_PRINT_EXTENTS void ext4_ext_print_extent_tree_status(struct inode *ip); #endif Modified: stable/12/sys/fs/ext2fs/ext2_extern.h ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_extern.h Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_extern.h Tue Apr 30 09:10:45 2019 (r346955) @@ -66,7 +66,6 @@ int ext2_bmaparray(struct vnode *, daddr_t, daddr_t *, int ext4_bmapext(struct vnode *, int32_t, int64_t *, int *, int *); void ext2_clusteracct(struct m_ext2fs *, char *, int, e4fs_daddr_t, int); void ext2_dirbad(struct inode *ip, doff_t offset, char *how); -void ext2_fserr(struct m_ext2fs *, uid_t, char *); int ext2_ei2i(struct ext2fs_dinode *, struct inode *); int ext2_getlbns(struct vnode *, daddr_t, struct indir *, int *); int ext2_i2ei(struct inode *, struct ext2fs_dinode *); @@ -80,7 +79,7 @@ int ext2_vfree(struct vnode *, ino_t, int); int ext2_vinit(struct mount *, struct vop_vector *, struct vnode **vpp); int ext2_lookup(struct vop_cachedlookup_args *); int ext2_readdir(struct vop_readdir_args *); -#ifdef EXT2FS_DEBUG +#ifdef EXT2FS_PRINT_EXTENTS void ext2_print_inode(struct inode *); #endif int ext2_direnter(struct inode *, Modified: stable/12/sys/fs/ext2fs/ext2_hash.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_hash.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_hash.c Tue Apr 30 09:10:45 2019 (r346955) @@ -57,6 +57,7 @@ #include #include #include +#include #include #include @@ -67,6 +68,14 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , trace, hash, "int", "char*"); + /* F, G, and H are MD4 functions */ #define F(x, y, z) (((x) & (y)) | ((~x) & (z))) #define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) @@ -300,6 +309,7 @@ ext2_htree_hash(const char *name, int len, minor = hash[2]; break; default: + SDT_PROBE2(ext2fs, , trace, hash, 1, "unexpected hash version"); goto error; } Modified: stable/12/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_htree.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_htree.c Tue Apr 30 09:10:45 2019 (r346955) @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -54,6 +55,14 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , trace, htree, "int", "char*"); + static void ext2_append_entry(char *block, uint32_t blksize, struct ext2fs_direct_2 *last_entry, struct ext2fs_direct_2 *new_entry, int csum_size); @@ -816,7 +825,8 @@ ext2_htree_add_entry(struct vnode *dvp, struct ext2fs_ if (ext2_htree_get_count(root_entires) == ext2_htree_get_limit(root_entires)) { - /* Directory index is full */ + SDT_PROBE2(ext2fs, , trace, htree, 1, + "directory index is full"); error = EIO; goto finish; } Modified: stable/12/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_inode.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_inode.c Tue Apr 30 09:10:45 2019 (r346955) @@ -46,6 +46,7 @@ #include #include #include +#include #include #include Modified: stable/12/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_inode_cnv.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_inode_cnv.c Tue Apr 30 09:10:45 2019 (r346955) @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -40,10 +41,18 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , trace, inode_cnv, "int", "char*"); + #define XTIME_TO_NSEC(x) ((x & EXT3_NSEC_MASK) >> 2) #define NSEC_TO_XTIME(t) (le32toh(t << 2) & EXT3_NSEC_MASK) -#ifdef EXT2FS_DEBUG +#ifdef EXT2FS_PRINT_EXTENTS void ext2_print_inode(struct inode *in) { @@ -83,7 +92,7 @@ ext2_print_inode(struct inode *in) printf("\n"); } } -#endif /* EXT2FS_DEBUG */ +#endif /* EXT2FS_PRINT_EXTENTS */ /* * raw ext2 inode to inode @@ -96,12 +105,12 @@ ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip) if ((ip->i_number < EXT2_FIRST_INO(fs) && ip->i_number != EXT2_ROOTINO) || (ip->i_number < EXT2_ROOTINO) || (ip->i_number > fs->e2fs->e2fs_icount)) { - printf("ext2fs: bad inode number %ju\n", ip->i_number); + SDT_PROBE2(ext2fs, , trace, inode_cnv, 1, "bad inode number"); return (EINVAL); } if (ip->i_number == EXT2_ROOTINO && ei->e2di_nlink == 0) { - printf("ext2fs: root inode unallocated\n"); + SDT_PROBE2(ext2fs, , trace, inode_cnv, 1, "root inode unallocated"); return (EINVAL); } ip->i_nlink = ei->e2di_nlink; @@ -110,8 +119,8 @@ ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip) if (EXT2_INODE_SIZE(fs) > E2FS_REV0_INODE_SIZE) { if (E2FS_REV0_INODE_SIZE + ei->e2di_extra_isize > EXT2_INODE_SIZE(fs) || (ei->e2di_extra_isize & 3)) { - printf("ext2fs: bad extra inode size %u, inode size=%u\n", - ei->e2di_extra_isize, EXT2_INODE_SIZE(fs)); + SDT_PROBE2(ext2fs, , trace, inode_cnv, 1, + "bad extra inode size"); return (EINVAL); } } @@ -199,7 +208,7 @@ ext2_i2ei(struct inode *ip, struct ext2fs_dinode *ei) ei->e2di_flags |= (ip->i_flag & IN_E4EXTENTS) ? EXT4_EXTENTS : 0; if (ip->i_blocks > ~0U && !EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_HUGE_FILE)) { - ext2_fserr(fs, ip->i_uid, "i_blocks value is out of range"); + SDT_PROBE2(ext2fs, , trace, inode_cnv, 1, "i_blocks value is out of range"); return (EIO); } if (ip->i_blocks <= 0xffffffffffffULL) { Modified: stable/12/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_lookup.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_lookup.c Tue Apr 30 09:10:45 2019 (r346955) @@ -53,6 +53,7 @@ #include #include #include +#include #include #include @@ -66,6 +67,18 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , lookup, trace, "int", "char*"); +SDT_PROBE_DEFINE4(ext2fs, , trace, ext2_dirbad_error, + "char*", "ino_t", "doff_t", "char*"); +SDT_PROBE_DEFINE5(ext2fs, , trace, ext2_dirbadentry_error, + "char*", "int", "uint32_t", "uint16_t", "uint8_t"); + #ifdef INVARIANTS static int dirchk = 1; #else @@ -810,10 +823,8 @@ ext2_dirbad(struct inode *ip, doff_t offset, char *how mp->mnt_stat.f_mntonname, (uintmax_t)ip->i_number, (long)offset, how); else - (void)printf("%s: bad dir ino %ju at offset %ld: %s\n", - mp->mnt_stat.f_mntonname, (uintmax_t)ip->i_number, - (long)offset, how); - + SDT_PROBE4(ext2fs, , trace, ext2_dirbad_error, + mp->mnt_stat.f_mntonname, ip->i_number, offset, how); } /* @@ -849,10 +860,9 @@ ext2_dirbadentry(struct vnode *dp, struct ext2fs_direc */ if (error_msg != NULL) { - printf("bad directory entry: %s\n", error_msg); - printf("offset=%d, inode=%lu, rec_len=%u, name_len=%u\n", - entryoffsetinblock, (unsigned long)de->e2d_ino, - de->e2d_reclen, de->e2d_namlen); + SDT_PROBE5(ext2fs, , trace, ext2_dirbadentry_error, + error_msg, entryoffsetinblock, + de->e2d_ino, de->e2d_reclen, de->e2d_namlen); } return error_msg == NULL ? 0 : 1; } @@ -1276,7 +1286,8 @@ ext2_checkpath(struct inode *source, struct inode *tar out: if (error == ENOTDIR) - printf("checkpath: .. not a directory\n"); + SDT_PROBE2(ext2fs, , lookup, trace, 1, + "checkpath: .. not a directory"); if (vp != NULL) vput(vp); return (error); Modified: stable/12/sys/fs/ext2fs/ext2_subr.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_subr.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_subr.c Tue Apr 30 09:10:45 2019 (r346955) @@ -41,6 +41,7 @@ #include #include +#include #include #include #include Modified: stable/12/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_vfsops.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_vfsops.c Tue Apr 30 09:10:45 2019 (r346955) @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -67,7 +68,17 @@ #include #include +SDT_PROVIDER_DECLARE(ext2fs); +/* + * ext2fs trace probe: + * arg0: verbosity. Higher numbers give more verbose messages + * arg1: Textual message + */ +SDT_PROBE_DEFINE2(ext2fs, , vfsops, trace, "int", "char*"); +SDT_PROBE_DEFINE2(ext2fs, , vfsops, ext2_cg_validate_error, "char*", "int"); +SDT_PROBE_DEFINE1(ext2fs, , vfsops, ext2_compute_sb_data_error, "char*"); + static int ext2_flushfiles(struct mount *mp, int flags, struct thread *td); static int ext2_mountfs(struct vnode *, struct mount *); static int ext2_reload(struct mount *mp, struct thread *td); @@ -381,48 +392,54 @@ ext2_cg_validate(struct m_ext2fs *fs) b_bitmap = e2fs_gd_get_b_bitmap(gd); if (b_bitmap == 0) { - printf("ext2fs: cg %u: block bitmap is zero\n", i); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "block bitmap is zero", i); return (EINVAL); } if (b_bitmap <= last_cg_block) { - printf("ext2fs: cg %u: block bitmap overlaps gds\n", i); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "block bitmap overlaps gds", i); return (EINVAL); } if (b_bitmap < first_block || b_bitmap > last_block) { - printf("ext2fs: cg %u: block bitmap not in group, blk=%ju\n", - i, b_bitmap); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "block bitmap not in group", i); return (EINVAL); } i_bitmap = e2fs_gd_get_i_bitmap(gd); if (i_bitmap == 0) { - printf("ext2fs: cg %u: inode bitmap is zero\n", i); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "inode bitmap is zero", i); return (EINVAL); } if (i_bitmap <= last_cg_block) { - printf("ext2fs: cg %u: inode bitmap overlaps gds\n", i); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "inode bitmap overlaps gds", i); return (EINVAL); } if (i_bitmap < first_block || i_bitmap > last_block) { - printf("ext2fs: cg %u: inode bitmap not in group blk=%ju\n", - i, i_bitmap); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "inode bitmap not in group blk", i); return (EINVAL); } i_tables = e2fs_gd_get_i_tables(gd); if (i_tables == 0) { - printf("ext2fs: cg %u: inode table is zero\n", i); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "inode table is zero", i); return (EINVAL); } if (i_tables <= last_cg_block) { - printf("ext2fs: cg %u: inode talbes overlaps gds\n", i); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "inode talbes overlaps gds", i); return (EINVAL); } if (i_tables < first_block || i_tables + fs->e2fs_itpg - 1 > last_block) { - printf("ext2fs: cg %u: inode tables not in group blk=%ju\n", - i, i_tables); + SDT_PROBE2(ext2fs, , vfsops, ext2_cg_validate_error, + "inode tables not in group blk", i); return (EINVAL); } @@ -450,7 +467,8 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f /* Check checksum features */ if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM) && EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) { - printf("ext2fs: incorrect checksum features combination\n"); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "incorrect checksum features combination"); return (EINVAL); } @@ -467,7 +485,8 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f /* Check for block size = 1K|2K|4K */ if (es->e2fs_log_bsize > 2) { - printf("ext2fs: bad block size: %d\n", es->e2fs_log_bsize); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "bad block size"); return (EINVAL); } @@ -479,15 +498,15 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f /* Check for fragment size */ if (es->e2fs_log_fsize > (EXT2_MAX_FRAG_LOG_SIZE - EXT2_MIN_BLOCK_LOG_SIZE)) { - printf("ext2fs: invalid log cluster size: %u\n", - es->e2fs_log_fsize); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "invalid log cluster size"); return (EINVAL); } fs->e2fs_fsize = EXT2_MIN_FRAG_SIZE << es->e2fs_log_fsize; if (fs->e2fs_fsize != fs->e2fs_bsize) { - printf("ext2fs: fragment size (%u) != block size %u\n", - fs->e2fs_fsize, fs->e2fs_bsize); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "fragment size != block size"); return (EINVAL); } @@ -495,8 +514,8 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f /* Check reserved gdt blocks for future filesystem expansion */ if (es->e2fs_reserved_ngdb > (fs->e2fs_bsize / 4)) { - printf("ext2fs: number of reserved GDT blocks too large: %u\n", - es->e2fs_reserved_ngdb); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "number of reserved GDT blocks too large"); return (EINVAL); } @@ -509,8 +528,8 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f * Check first ino. */ if (es->e2fs_first_ino < EXT2_FIRSTINO) { - printf("ext2fs: invalid first ino: %u\n", - es->e2fs_first_ino); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "invalid first ino"); return (EINVAL); } @@ -520,8 +539,8 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f if (EXT2_INODE_SIZE(fs) < E2FS_REV0_INODE_SIZE || EXT2_INODE_SIZE(fs) > fs->e2fs_bsize || (fs->e2fs_isize & (fs->e2fs_isize - 1)) != 0) { - printf("ext2fs: invalid inode size %u\n", - fs->e2fs_isize); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "invalid inode size"); return (EINVAL); } } @@ -529,33 +548,36 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f /* Check group descriptors */ if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_64BIT) && es->e3fs_desc_size != E2FS_64BIT_GD_SIZE) { - printf("ext2fs: unsupported 64bit descriptor size %u\n", - es->e3fs_desc_size); - return (EINVAL); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "unsupported 64bit descriptor size"); + return (EINVAL); } fs->e2fs_bpg = es->e2fs_bpg; fs->e2fs_fpg = es->e2fs_fpg; if (fs->e2fs_bpg == 0 || fs->e2fs_fpg == 0) { - printf("ext2fs: zero blocks/fragments per group\n"); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "zero blocks/fragments per group"); return (EINVAL); } if (fs->e2fs_bpg != fs->e2fs_bsize * 8) { - printf("ext2fs: non-standard group size unsupported %d\n", - fs->e2fs_bpg); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "non-standard group size unsupported"); return (EINVAL); } fs->e2fs_ipb = fs->e2fs_bsize / EXT2_INODE_SIZE(fs); if (fs->e2fs_ipb == 0 || fs->e2fs_ipb > fs->e2fs_bsize / E2FS_REV0_INODE_SIZE) { - printf("ext2fs: bad inodes per block size\n"); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "bad inodes per block size"); return (EINVAL); } fs->e2fs_ipg = es->e2fs_ipg; if (fs->e2fs_ipg < fs->e2fs_ipb || fs->e2fs_ipg > fs->e2fs_bsize * 8) { - printf("ext2fs: invalid inodes per group: %u\n", fs->e2fs_ipb); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "invalid inodes per group"); return (EINVAL); } @@ -571,25 +593,29 @@ ext2_compute_sb_data(struct vnode *devvp, struct ext2f } if (fs->e2fs_rbcount > fs->e2fs_bcount || fs->e2fs_fbcount > fs->e2fs_bcount) { - printf("ext2fs: invalid block count\n"); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "invalid block count"); return (EINVAL); } if (es->e2fs_first_dblock >= fs->e2fs_bcount) { - printf("ext2fs: first data block out of range\n"); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "first data block out of range"); return (EINVAL); } fs->e2fs_gcount = howmany(fs->e2fs_bcount - es->e2fs_first_dblock, EXT2_BLOCKS_PER_GROUP(fs)); if (fs->e2fs_gcount > ((uint64_t)1 << 32) - EXT2_DESCS_PER_BLOCK(fs)) { - printf("ext2fs: groups count too large: %u\n", fs->e2fs_gcount); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "groups count too large"); return (EINVAL); } /* Check for extra isize in big inodes. */ if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_EXTRA_ISIZE) && EXT2_INODE_SIZE(fs) < sizeof(struct ext2fs_dinode)) { - printf("ext2fs: no space for extra inode timestamps\n"); + SDT_PROBE1(ext2fs, , vfsops, ext2_compute_sb_data_error, + "no space for extra inode timestamps"); return (EINVAL); } @@ -1095,8 +1121,7 @@ ext2_sync(struct mount *mp, int waitfor) td = curthread; fs = ump->um_e2fs; if (fs->e2fs_fmod != 0 && fs->e2fs_ronly != 0) { /* XXX */ - printf("fs = %s\n", fs->e2fs_fsmnt); - panic("ext2_sync: rofs mod"); + panic("ext2_sync: rofs mod fs=%s", fs->e2fs_fsmnt); } /* @@ -1242,7 +1267,7 @@ ext2_vget(struct mount *mp, ino_t ino, int flags, stru for (i = used_blocks; i < EXT2_NDIR_BLOCKS; i++) ip->i_db[i] = 0; } -#ifdef EXT2FS_DEBUG +#ifdef EXT2FS_PRINT_EXTENTS ext2_print_inode(ip); ext4_ext_print_extent_tree_status(ip); #endif Modified: stable/12/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_vnops.c Tue Apr 30 08:17:11 2019 (r346954) +++ stable/12/sys/fs/ext2fs/ext2_vnops.c Tue Apr 30 09:10:45 2019 (r346955) @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -92,6 +93,14 @@ #include #include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Apr 30 09:26:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5ECA158A53C; Tue, 30 Apr 2019 09:26:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2DA5D9598F; Tue, 30 Apr 2019 09:26:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09C8179D0; Tue, 30 Apr 2019 09:26:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U9QB9E016772; Tue, 30 Apr 2019 09:26:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U9QBfM016770; Tue, 30 Apr 2019 09:26:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904300926.x3U9QBfM016770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 30 Apr 2019 09:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346956 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 346956 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2DA5D9598F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 09:26:13 -0000 Author: hselasky Date: Tue Apr 30 09:26:11 2019 New Revision: 346956 URL: https://svnweb.freebsd.org/changeset/base/346956 Log: Store a pointer to the device instead of the PCI device in the DMA pool implementation in the LinuxKPI. This avoids use of container_of(). No functional change. Discussed with: kib @ Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/dmapool.h head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/include/linux/dmapool.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/dmapool.h Tue Apr 30 09:10:45 2019 (r346955) +++ head/sys/compat/linuxkpi/common/include/linux/dmapool.h Tue Apr 30 09:26:11 2019 (r346956) @@ -46,7 +46,7 @@ void linux_dma_pool_free(struct dma_pool *pool, void * dma_addr_t dma_addr); struct dma_pool { - struct pci_dev *pool_pdev; + struct device *pool_device; uma_zone_t pool_zone; struct mtx pool_dma_lock; bus_dma_tag_t pool_dmat; Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Tue Apr 30 09:10:45 2019 (r346955) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Tue Apr 30 09:26:11 2019 (r346956) @@ -701,7 +701,7 @@ dma_pool_obj_import(void *arg, void **store, int count struct linux_dma_obj *obj; int error, i; - priv = pool->pool_pdev->dev.dma_priv; + priv = pool->pool_device->dma_priv; for (i = 0; i < count; i++) { obj = uma_zalloc(linux_dma_obj_zone, flags); if (obj == NULL) @@ -728,7 +728,7 @@ dma_pool_obj_release(void *arg, void **store, int coun struct linux_dma_obj *obj; int i; - priv = pool->pool_pdev->dev.dma_priv; + priv = pool->pool_device->dma_priv; for (i = 0; i < count; i++) { obj = store[i]; bus_dmamem_free(pool->pool_dmat, obj->vaddr, obj->dmamap); @@ -746,7 +746,7 @@ linux_dma_pool_create(char *name, struct device *dev, priv = dev->dma_priv; pool = kzalloc(sizeof(*pool), GFP_KERNEL); - pool->pool_pdev = to_pci_dev(dev); + pool->pool_device = dev; pool->pool_entry_size = size; if (bus_dma_tag_create(bus_get_dma_tag(dev->bsddev), From owner-svn-src-all@freebsd.org Tue Apr 30 09:38:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD9C5158A921; Tue, 30 Apr 2019 09:38:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54D0D9627A; Tue, 30 Apr 2019 09:38:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3045B7BBA; Tue, 30 Apr 2019 09:38:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U9cNcv022162; Tue, 30 Apr 2019 09:38:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U9cMcI022160; Tue, 30 Apr 2019 09:38:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904300938.x3U9cMcI022160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 30 Apr 2019 09:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346957 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 346957 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 54D0D9627A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 09:38:23 -0000 Author: hselasky Date: Tue Apr 30 09:38:22 2019 New Revision: 346957 URL: https://svnweb.freebsd.org/changeset/base/346957 Log: Make the dma_pool structure private to the LinuxKPI similar to Linux. No functional change. Discussed with: kib @ Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/dmapool.h head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/include/linux/dmapool.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/dmapool.h Tue Apr 30 09:26:11 2019 (r346956) +++ head/sys/compat/linuxkpi/common/include/linux/dmapool.h Tue Apr 30 09:38:22 2019 (r346957) @@ -37,6 +37,7 @@ #include #include +struct dma_pool; struct dma_pool *linux_dma_pool_create(char *name, struct device *dev, size_t size, size_t align, size_t boundary); void linux_dma_pool_destroy(struct dma_pool *pool); @@ -44,16 +45,6 @@ void *linux_dma_pool_alloc(struct dma_pool *pool, gfp_ dma_addr_t *handle); void linux_dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t dma_addr); - -struct dma_pool { - struct device *pool_device; - uma_zone_t pool_zone; - struct mtx pool_dma_lock; - bus_dma_tag_t pool_dmat; - size_t pool_entry_size; - struct mtx pool_ptree_lock; - struct pctrie pool_ptree; -}; static inline struct dma_pool * dma_pool_create(char *name, struct device *dev, size_t size, Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Tue Apr 30 09:26:11 2019 (r346956) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Tue Apr 30 09:38:22 2019 (r346957) @@ -658,6 +658,16 @@ linux_dma_unmap_sg_attrs(struct device *dev, struct sc uma_zfree(linux_dma_obj_zone, obj); } +struct dma_pool { + struct device *pool_device; + uma_zone_t pool_zone; + struct mtx pool_dma_lock; + bus_dma_tag_t pool_dmat; + size_t pool_entry_size; + struct mtx pool_ptree_lock; + struct pctrie pool_ptree; +}; + static inline int dma_pool_obj_ctor(void *mem, int size, void *arg, int flags) { From owner-svn-src-all@freebsd.org Tue Apr 30 10:41:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E97B8158C69E; Tue, 30 Apr 2019 10:41:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DAF469A68; Tue, 30 Apr 2019 10:41:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68D2A8604; Tue, 30 Apr 2019 10:41:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UAfLZq054369; Tue, 30 Apr 2019 10:41:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UAfLvj054368; Tue, 30 Apr 2019 10:41:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904301041.x3UAfLvj054368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 30 Apr 2019 10:41:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346958 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 346958 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8DAF469A68 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 10:41:22 -0000 Author: hselasky Date: Tue Apr 30 10:41:20 2019 New Revision: 346958 URL: https://svnweb.freebsd.org/changeset/base/346958 Log: Reduce the number of mutexes after r346645 in the LinuxKPI. Make function macro wrappers for locking and unlocking to ease readability. No functional change. Discussed with: kib@, tychon@ and zeising@ Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Tue Apr 30 09:38:22 2019 (r346957) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Tue Apr 30 10:41:20 2019 (r346958) @@ -78,11 +78,12 @@ static device_method_t pci_methods[] = { struct linux_dma_priv { uint64_t dma_mask; - struct mtx dma_lock; + struct mtx lock; bus_dma_tag_t dmat; - struct mtx ptree_lock; struct pctrie ptree; }; +#define DMA_PRIV_LOCK(priv) mtx_lock(&(priv)->lock) +#define DMA_PRIV_UNLOCK(priv) mtx_unlock(&(priv)->lock) static int linux_pdev_dma_init(struct pci_dev *pdev) @@ -92,9 +93,8 @@ linux_pdev_dma_init(struct pci_dev *pdev) priv = malloc(sizeof(*priv), M_DEVBUF, M_WAITOK | M_ZERO); pdev->dev.dma_priv = priv; - mtx_init(&priv->dma_lock, "linux_dma", NULL, MTX_DEF); + mtx_init(&priv->lock, "lkpi-priv-dma", NULL, MTX_DEF); - mtx_init(&priv->ptree_lock, "linux_dma_ptree", NULL, MTX_DEF); pctrie_init(&priv->ptree); return (0); @@ -108,8 +108,7 @@ linux_pdev_dma_uninit(struct pci_dev *pdev) priv = pdev->dev.dma_priv; if (priv->dmat) bus_dma_tag_destroy(priv->dmat); - mtx_destroy(&priv->dma_lock); - mtx_destroy(&priv->ptree_lock); + mtx_destroy(&priv->lock); free(priv, M_DEVBUF); pdev->dev.dma_priv = NULL; return (0); @@ -500,37 +499,34 @@ linux_dma_map_phys(struct device *dev, vm_paddr_t phys obj = uma_zalloc(linux_dma_obj_zone, 0); + DMA_PRIV_LOCK(priv); if (bus_dmamap_create(priv->dmat, 0, &obj->dmamap) != 0) { + DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); return (0); } nseg = -1; - mtx_lock(&priv->dma_lock); if (_bus_dmamap_load_phys(priv->dmat, obj->dmamap, phys, len, BUS_DMA_NOWAIT, &seg, &nseg) != 0) { bus_dmamap_destroy(priv->dmat, obj->dmamap); - mtx_unlock(&priv->dma_lock); + DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); return (0); } - mtx_unlock(&priv->dma_lock); KASSERT(++nseg == 1, ("More than one segment (nseg=%d)", nseg)); obj->dma_addr = seg.ds_addr; - mtx_lock(&priv->ptree_lock); error = LINUX_DMA_PCTRIE_INSERT(&priv->ptree, obj); - mtx_unlock(&priv->ptree_lock); if (error != 0) { - mtx_lock(&priv->dma_lock); bus_dmamap_unload(priv->dmat, obj->dmamap); bus_dmamap_destroy(priv->dmat, obj->dmamap); - mtx_unlock(&priv->dma_lock); + DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); return (0); } - + DMA_PRIV_UNLOCK(priv); return (obj->dma_addr); } @@ -542,19 +538,16 @@ linux_dma_unmap(struct device *dev, dma_addr_t dma_add priv = dev->dma_priv; - mtx_lock(&priv->ptree_lock); + DMA_PRIV_LOCK(priv); obj = LINUX_DMA_PCTRIE_LOOKUP(&priv->ptree, dma_addr); if (obj == NULL) { - mtx_unlock(&priv->ptree_lock); + DMA_PRIV_UNLOCK(priv); return; } LINUX_DMA_PCTRIE_REMOVE(&priv->ptree, dma_addr); - mtx_unlock(&priv->ptree_lock); - - mtx_lock(&priv->dma_lock); bus_dmamap_unload(priv->dmat, obj->dmamap); bus_dmamap_destroy(priv->dmat, obj->dmamap); - mtx_unlock(&priv->dma_lock); + DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); } @@ -575,7 +568,9 @@ linux_dma_map_sg_attrs(struct device *dev, struct scat obj = uma_zalloc(linux_dma_obj_zone, 0); + DMA_PRIV_LOCK(priv); if (bus_dmamap_create(priv->dmat, 0, &obj->dmamap) != 0) { + DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); return (0); } @@ -583,6 +578,7 @@ linux_dma_map_sg_attrs(struct device *dev, struct scat sg = sgl; dma_sg = sg; dma_nents = 0; + while (nents > 0) { seg_phys = sg_phys(sg); seg_len = sg->length; @@ -595,17 +591,15 @@ linux_dma_map_sg_attrs(struct device *dev, struct scat } nseg = -1; - mtx_lock(&priv->dma_lock); if (_bus_dmamap_load_phys(priv->dmat, obj->dmamap, seg_phys, seg_len, BUS_DMA_NOWAIT, &seg, &nseg) != 0) { bus_dmamap_unload(priv->dmat, obj->dmamap); bus_dmamap_destroy(priv->dmat, obj->dmamap); - mtx_unlock(&priv->dma_lock); + DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); return (0); } - mtx_unlock(&priv->dma_lock); KASSERT(++nseg == 1, ("More than one segment (nseg=%d)", nseg)); sg_dma_address(dma_sg) = seg.ds_addr; @@ -617,18 +611,15 @@ linux_dma_map_sg_attrs(struct device *dev, struct scat obj->dma_addr = sg_dma_address(sgl); - mtx_lock(&priv->ptree_lock); error = LINUX_DMA_PCTRIE_INSERT(&priv->ptree, obj); - mtx_unlock(&priv->ptree_lock); if (error != 0) { - mtx_lock(&priv->dma_lock); bus_dmamap_unload(priv->dmat, obj->dmamap); bus_dmamap_destroy(priv->dmat, obj->dmamap); - mtx_unlock(&priv->dma_lock); + DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); return (0); } - + DMA_PRIV_UNLOCK(priv); return (dma_nents); } @@ -641,19 +632,16 @@ linux_dma_unmap_sg_attrs(struct device *dev, struct sc priv = dev->dma_priv; - mtx_lock(&priv->ptree_lock); + DMA_PRIV_LOCK(priv); obj = LINUX_DMA_PCTRIE_LOOKUP(&priv->ptree, sg_dma_address(sgl)); if (obj == NULL) { - mtx_unlock(&priv->ptree_lock); + DMA_PRIV_UNLOCK(priv); return; } LINUX_DMA_PCTRIE_REMOVE(&priv->ptree, sg_dma_address(sgl)); - mtx_unlock(&priv->ptree_lock); - - mtx_lock(&priv->dma_lock); bus_dmamap_unload(priv->dmat, obj->dmamap); bus_dmamap_destroy(priv->dmat, obj->dmamap); - mtx_unlock(&priv->dma_lock); + DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); } @@ -661,13 +649,15 @@ linux_dma_unmap_sg_attrs(struct device *dev, struct sc struct dma_pool { struct device *pool_device; uma_zone_t pool_zone; - struct mtx pool_dma_lock; + struct mtx pool_lock; bus_dma_tag_t pool_dmat; size_t pool_entry_size; - struct mtx pool_ptree_lock; struct pctrie pool_ptree; }; +#define DMA_POOL_LOCK(pool) mtx_lock(&(pool)->pool_lock) +#define DMA_POOL_UNLOCK(pool) mtx_unlock(&(pool)->pool_lock) + static inline int dma_pool_obj_ctor(void *mem, int size, void *arg, int flags) { @@ -677,11 +667,11 @@ dma_pool_obj_ctor(void *mem, int size, void *arg, int bus_dma_segment_t seg; nseg = -1; - mtx_lock(&pool->pool_dma_lock); + DMA_POOL_LOCK(pool); error = _bus_dmamap_load_phys(pool->pool_dmat, obj->dmamap, vtophys(obj->vaddr), pool->pool_entry_size, BUS_DMA_NOWAIT, &seg, &nseg); - mtx_unlock(&pool->pool_dma_lock); + DMA_POOL_UNLOCK(pool); if (error != 0) { return (error); } @@ -697,9 +687,9 @@ dma_pool_obj_dtor(void *mem, int size, void *arg) struct linux_dma_obj *obj = mem; struct dma_pool *pool = arg; - mtx_lock(&pool->pool_dma_lock); + DMA_POOL_LOCK(pool); bus_dmamap_unload(pool->pool_dmat, obj->dmamap); - mtx_unlock(&pool->pool_dma_lock); + DMA_POOL_UNLOCK(pool); } static int @@ -778,10 +768,7 @@ linux_dma_pool_create(char *name, struct device *dev, dma_pool_obj_dtor, NULL, NULL, dma_pool_obj_import, dma_pool_obj_release, pool, 0); - mtx_init(&pool->pool_dma_lock, "linux_dma_pool", NULL, MTX_DEF); - - mtx_init(&pool->pool_ptree_lock, "linux_dma_pool_ptree", NULL, - MTX_DEF); + mtx_init(&pool->pool_lock, "lkpi-dma-pool", NULL, MTX_DEF); pctrie_init(&pool->pool_ptree); return (pool); @@ -793,8 +780,7 @@ linux_dma_pool_destroy(struct dma_pool *pool) uma_zdestroy(pool->pool_zone); bus_dma_tag_destroy(pool->pool_dmat); - mtx_destroy(&pool->pool_ptree_lock); - mtx_destroy(&pool->pool_dma_lock); + mtx_destroy(&pool->pool_lock); kfree(pool); } @@ -808,13 +794,13 @@ linux_dma_pool_alloc(struct dma_pool *pool, gfp_t mem_ if (obj == NULL) return (NULL); - mtx_lock(&pool->pool_ptree_lock); + DMA_POOL_LOCK(pool); if (LINUX_DMA_PCTRIE_INSERT(&pool->pool_ptree, obj) != 0) { - mtx_unlock(&pool->pool_ptree_lock); + DMA_POOL_UNLOCK(pool); uma_zfree_arg(pool->pool_zone, obj, pool); return (NULL); } - mtx_unlock(&pool->pool_ptree_lock); + DMA_POOL_UNLOCK(pool); *handle = obj->dma_addr; return (obj->vaddr); @@ -825,14 +811,14 @@ linux_dma_pool_free(struct dma_pool *pool, void *vaddr { struct linux_dma_obj *obj; - mtx_lock(&pool->pool_ptree_lock); + DMA_POOL_LOCK(pool); obj = LINUX_DMA_PCTRIE_LOOKUP(&pool->pool_ptree, dma_addr); if (obj == NULL) { - mtx_unlock(&pool->pool_ptree_lock); + DMA_POOL_UNLOCK(pool); return; } LINUX_DMA_PCTRIE_REMOVE(&pool->pool_ptree, dma_addr); - mtx_unlock(&pool->pool_ptree_lock); + DMA_POOL_UNLOCK(pool); uma_zfree_arg(pool->pool_zone, obj, pool); } From owner-svn-src-all@freebsd.org Tue Apr 30 13:10:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30B3615909A4; Tue, 30 Apr 2019 13:10:12 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [176.58.89.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C199F6F937; Tue, 30 Apr 2019 13:10:11 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 44thhf1CXZzDjs5; Tue, 30 Apr 2019 13:10:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([127.0.0.1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [127.0.0.1]) (amavisd-new, port 10587) with ESMTPS id zjJolTN-WpJO; Tue, 30 Apr 2019 13:10:09 +0000 (UTC) Received: from garnet.daemonic.se (host-95-192-79-116.mobileonline.telia.com [95.192.79.116]) by mail.daemonic.se (Postfix) with ESMTPSA id 44thhd33m2zDjp8; Tue, 30 Apr 2019 13:10:09 +0000 (UTC) Subject: Re: svn commit: r346958 - head/sys/compat/linuxkpi/common/src To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201904301041.x3UAfLvj054368@repo.freebsd.org> From: Niclas Zeising Message-ID: <8f360678-2df1-fe7b-cb83-f47923534826@freebsd.org> Date: Tue, 30 Apr 2019 15:10:08 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201904301041.x3UAfLvj054368@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: C199F6F937 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 13:10:12 -0000 On 2019-04-30 12:41, Hans Petter Selasky wrote: > Author: hselasky > Date: Tue Apr 30 10:41:20 2019 > New Revision: 346958 > URL: https://svnweb.freebsd.org/changeset/base/346958 > > Log: > Reduce the number of mutexes after r346645 in the LinuxKPI. > Make function macro wrappers for locking and unlocking to ease readability. > > No functional change. > > Discussed with: kib@, tychon@ and zeising@ I was not part of any discussion regarding this. If this is related to https://reviews.freebsd.org/D20097 I explicitly asked you on gitter to hold of for a bit, while we try to figure out why we are seeing regressions in graphics with the latest dmar changes. Can you please revert this since it colludes the dmar graphics issue, and it makes the suggested patch not apply cleanly, which makes it harder to get people to help test. Thank you! Regards -- Niclas Zeising From owner-svn-src-all@freebsd.org Tue Apr 30 14:26:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51DCA15933BC; Tue, 30 Apr 2019 14:26:49 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it1-x136.google.com (mail-it1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 E043B73C66; Tue, 30 Apr 2019 14:26:48 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it1-x136.google.com with SMTP id q14so4981561itk.0; Tue, 30 Apr 2019 07:26:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=AWfwmAgJHxypDflhfBcVHSclA2QkjF7Sfhx13+hiZ4Y=; b=YgVJWdgjT2LR+RzCQXNYuSER6Q5ea+1bSRm3P5gi+bO8qSTW7LUV/XOpBjE3yJpZWx MEL/HtIGbgCu1spw29tqkKLt8UQS63A9OjA2wAsMElAS5a3krEqlw+YYar3zVKbv1ACo J2LKdnhfg4RzWMsSxu6lIMNOTrYl9+mH85GO5Q1mxUuEaOcZfTNmJQgyyKO48e5TF6C3 HGBnWk2H3u8DczyNCYQ0n4+6iq0xp8EJz/+xTjnLTpzc69hbph/djxAmDD3zis+vdE4U MGgdUQfiiFGKVHON4Kf372lEXaRNDBaHKwTaoXCc9wGEpRVjSNHOWkgu0niRWEt2vu1D NNng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=AWfwmAgJHxypDflhfBcVHSclA2QkjF7Sfhx13+hiZ4Y=; b=A6nQjwVEuEqW1nnguprIya/NuiJM+ckbSgjXFHwWHj0zX50gv6JPZnGOlPh2RtlbLU 5neDqeDgBO9pyl2Xt8IKUWiJG8I9yy3kfxu6EY4FA5BPHC0+dw1NHFyft//mEEPcgWHP WTguoUngPNvkxS8UxAGTIicrZcBq3564uzNVmtEEJt4vKfNSEiA6vuJO/it+UJU1wxlU v3BT16AmsuNnsnPeSY+DzZkVnQZCcjHcnTqwLYYpx21YpQsl2cLHOkaUu0CV7q34quHr o+kE7s3g4pHHXdJ+stsXnpAp9k9mwm43wpYSLssWJr+8ypz+jDxOZgonXodhzhTIXFTL /Rqg== X-Gm-Message-State: APjAAAVCG69Ap4JP8+SK1VZ5r4CgFce4C67SaxwLiG2aVoGwnwvIbUdt h0VmWYyGj6Re5IFs05yGpHFKR5IDfU8= X-Google-Smtp-Source: APXvYqyEiKq3UPiVWtkEZFNkI+MV5WhuxaPGXC2BcrMlIw8cYIK85cfaQ44RczfmAaz9x8GB9g65vg== X-Received: by 2002:a02:cc8d:: with SMTP id s13mr1947927jap.115.1556634407790; Tue, 30 Apr 2019 07:26:47 -0700 (PDT) Received: from raichu (toroon0560w-lp140-01-69-159-36-31.dsl.bell.ca. [69.159.36.31]) by smtp.gmail.com with ESMTPSA id s15sm2733951iob.70.2019.04.30.07.26.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Apr 2019 07:26:46 -0700 (PDT) Sender: Mark Johnston Date: Tue, 30 Apr 2019 10:26:41 -0400 From: Mark Johnston To: Alexey Dokuchaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346932 - head/sys/ufs/ufs Message-ID: <20190430142641.GA34567@raichu> References: <201904292205.x3TM5Q7Z058461@repo.freebsd.org> <20190430060849.GB97846@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190430060849.GB97846@FreeBSD.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: E043B73C66 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 14:26:49 -0000 On Tue, Apr 30, 2019 at 06:08:49AM +0000, Alexey Dokuchaev wrote: > On Mon, Apr 29, 2019 at 10:05:26PM +0000, Mark Johnston wrote: > > New Revision: 346932 > > URL: https://svnweb.freebsd.org/changeset/base/346932 > > > > Log: > > Optimize lseek(SEEK_DATA) on UFS. > > > > This version fixes the problems identified in r345244. > > > > Reviewed by: kib > > @@ -56,6 +56,9 @@ __FBSDID("$FreeBSD$"); > > #include > > #include > > > > +static ufs_lbn_t lbn_count(struct ufsmount *, int); > > +static int readindir(struct vnode *, ufs_lbn_t, ufs2_daddr_t, struct buf **); > > Is the prototype for static readindir() really needed here? Yes, when using a K&R definition. > > +static int > > +readindir(vp, lbn, daddr, bpp) > > + struct vnode *vp; > > + ufs_lbn_t lbn; > > + ufs2_daddr_t daddr; > > + struct buf **bpp; > > Don't we prefer ASNI declarations over K&R these days? Yes, I was just staying consistent with the rest of the file. > > +static ufs_lbn_t > > +lbn_count(ump, level) > > + struct ufsmount *ump; > > + int level; > > Ditto. > > > +int > > +ufs_bmap_seekdata(vp, offp) > > + struct vnode *vp; > > + off_t *offp; > > ./danfe From owner-svn-src-all@freebsd.org Tue Apr 30 14:29:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 773071593564; Tue, 30 Apr 2019 14:29:10 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1CC6274317; Tue, 30 Apr 2019 14:29:10 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE569AD72; Tue, 30 Apr 2019 14:29:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UET9ch077744; Tue, 30 Apr 2019 14:29:09 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UET9ia077742; Tue, 30 Apr 2019 14:29:09 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201904301429.x3UET9ia077742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 30 Apr 2019 14:29:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346959 - in head/release: . tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in head/release: . tools X-SVN-Commit-Revision: 346959 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1CC6274317 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 14:29:10 -0000 Author: gjb Date: Tue Apr 30 14:29:09 2019 New Revision: 346959 URL: https://svnweb.freebsd.org/changeset/base/346959 Log: Reduce the default image size for virtual machine disk images from 30GB to 3GB. The raw images can be resized using truncate(1), and other formats can be resized with tools included with other tools included with other hypervisors. Enable the growfs(8) rc(8) at firstboot if the disk was resized prior to booting the virtual machine for the first time. Discussed with: several PR: 232313 (requested in other context) MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.vm head/release/tools/gce.conf head/release/tools/vmimage.subr Modified: head/release/Makefile.vm ============================================================================== --- head/release/Makefile.vm Tue Apr 30 10:41:20 2019 (r346958) +++ head/release/Makefile.vm Tue Apr 30 14:29:09 2019 (r346959) @@ -7,7 +7,7 @@ VMTARGETS= vm-image VMFORMATS?= vhd vmdk qcow2 raw -VMSIZE?= 30G +VMSIZE?= 3072M SWAPSIZE?= 1G VMBASE?= vm Modified: head/release/tools/gce.conf ============================================================================== --- head/release/tools/gce.conf Tue Apr 30 10:41:20 2019 (r346958) +++ head/release/tools/gce.conf Tue Apr 30 14:29:09 2019 (r346959) @@ -3,9 +3,6 @@ # $FreeBSD$ # -# Reduce VMSIZE to be below the free quota limit. -export VMSIZE=27G - # Set to a list of packages to install. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \ google-cloud-sdk panicmail sudo sysutils/py-google-compute-engine \ Modified: head/release/tools/vmimage.subr ============================================================================== --- head/release/tools/vmimage.subr Tue Apr 30 10:41:20 2019 (r346958) +++ head/release/tools/vmimage.subr Tue Apr 30 14:29:09 2019 (r346959) @@ -182,6 +182,9 @@ vm_extra_enable_services() { if [ -z "${VMCONFIG}" -o -c "${VMCONFIG}" ]; then echo 'ifconfig_DEFAULT="DHCP inet6 accept_rtadv"' >> \ ${DESTDIR}/etc/rc.conf + # Expand the filesystem to fill the disk. + echo 'growfs_enable="YES"' >> ${DESTDIR}/etc/rc.conf + touch ${DESTDIR}/firstboot fi return 0 From owner-svn-src-all@freebsd.org Tue Apr 30 14:44:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91F411593FBE; Tue, 30 Apr 2019 14:44:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3991A751DA; Tue, 30 Apr 2019 14:44:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29F48B0EF; Tue, 30 Apr 2019 14:44:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UEieB5088108; Tue, 30 Apr 2019 14:44:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UEieAU088107; Tue, 30 Apr 2019 14:44:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201904301444.x3UEieAU088107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 30 Apr 2019 14:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346960 - head/usr.sbin/rtadvd X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.sbin/rtadvd X-SVN-Commit-Revision: 346960 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3991A751DA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 14:44:40 -0000 Author: markj Date: Tue Apr 30 14:44:39 2019 New Revision: 346960 URL: https://svnweb.freebsd.org/changeset/base/346960 Log: Retry upon NET_RT_IFLIST sysctl failure. Port the logic used by getifaddrs(3) to handle the case where NET_RT_IFLIST returns ENOMEM, which can occur if the list size changes between the buffer allocation and sysctl read. PR: 195191 Submitted by: Guy Yur (original version) MFC after: 1 week Modified: head/usr.sbin/rtadvd/if.c Modified: head/usr.sbin/rtadvd/if.c ============================================================================== --- head/usr.sbin/rtadvd/if.c Tue Apr 30 14:29:09 2019 (r346959) +++ head/usr.sbin/rtadvd/if.c Tue Apr 30 14:44:39 2019 (r346960) @@ -408,6 +408,8 @@ update_ifinfo_nd_flags(struct ifinfo *ifi) return (0); } +#define MAX_SYSCTL_TRY 5 + struct ifinfo * update_ifinfo(struct ifilist_head_t *ifi_head, int ifindex) { @@ -419,26 +421,43 @@ update_ifinfo(struct ifilist_head_t *ifi_head, int ifi size_t len; char *lim; int mib[] = { CTL_NET, PF_ROUTE, 0, AF_INET6, NET_RT_IFLIST, 0 }; - int error; + int error, ntry; syslog(LOG_DEBUG, "<%s> enter", __func__); - if (sysctl(mib, sizeof(mib)/sizeof(mib[0]), NULL, &len, NULL, 0) < - 0) { - syslog(LOG_ERR, - "<%s> sysctl: NET_RT_IFLIST size get failed", __func__); - exit(1); - } - if ((msg = malloc(len)) == NULL) { - syslog(LOG_ERR, "<%s> malloc failed", __func__); - exit(1); - } - if (sysctl(mib, sizeof(mib)/sizeof(mib[0]), msg, &len, NULL, 0) < - 0) { - syslog(LOG_ERR, - "<%s> sysctl: NET_RT_IFLIST get failed", __func__); - exit(1); - } + ntry = 0; + do { + /* + * We'll try to get addresses several times in case that + * the number of addresses is unexpectedly increased during + * the two sysctl calls. This should rarely happen. + * Portability note: since FreeBSD does not add margin of + * memory at the first sysctl, the possibility of failure on + * the second sysctl call is a bit higher. + */ + + if (sysctl(mib, nitems(mib), NULL, &len, NULL, 0) < 0) { + syslog(LOG_ERR, + "<%s> sysctl: NET_RT_IFLIST size get failed", + __func__); + exit(1); + } + if ((msg = malloc(len)) == NULL) { + syslog(LOG_ERR, "<%s> malloc failed", __func__); + exit(1); + } + if (sysctl(mib, nitems(mib), msg, &len, NULL, 0) < 0) { + if (errno != ENOMEM || ++ntry >= MAX_SYSCTL_TRY) { + free(msg); + syslog(LOG_ERR, + "<%s> sysctl: NET_RT_IFLIST get failed", + __func__); + exit(1); + } + free(msg); + msg = NULL; + } + } while (msg == NULL); lim = msg + len; for (ifm = (struct if_msghdr *)msg; From owner-svn-src-all@freebsd.org Tue Apr 30 14:46:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DAD71594106 for ; Tue, 30 Apr 2019 14:46:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 115A97545C for ; Tue, 30 Apr 2019 14:46:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72e.google.com with SMTP id c190so8277337qke.9 for ; Tue, 30 Apr 2019 07:46:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uOXalQIAh8UZo3dnH20BOfxLQJOx9pKBtjX6uDphisA=; b=F7W7MJ4tkTp70vmIFw91w7ZgT845c7vL279+neDTGjB4jGd+PgXmpL1CBesXn7tmpj yrirl4dbhWbvPJXUH1pw9v9QdPxXsESkYeON6khILjChCNayjpZE+mZqjw0MEaHS0XCl xE5dhK5ejb+5G99OmOCs7I5FqjcWZwYMZOCV8xCPxMczssaaaM7fGFTznyV0a9Virfp+ GLEfHZ681G7P1El+qTwmrZu79IEjHvcqm5LNCtjiP+qBTBncctPVnvIKG0bf4O8DjoK2 cim46Q9eTAypFH15m61Mi8j5my+Re99npJ3drQogufn5zYO1rDdRI8ERU1wE26GsGquw ruOA== 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=uOXalQIAh8UZo3dnH20BOfxLQJOx9pKBtjX6uDphisA=; b=pxyfvWTNvTTQF2yIwQFUn9kFgyD1v35OJgNkESSSiBFtJJcvG82fqHny/VD4l/BP11 UPzMGq2b4e95aIYO9HeF2cbmkIdkanpWRD70TFaAv8Lxxj7Y4PLZWlH6a5W86MTk2n68 s1nWV5fkfV0QV+jn8Ytrci8mh4qb3XfDRhyUl4F+P+Z/KsZh2IKiXazm6f9Ek/mfzJBG f91OTFomFkbumuVJUG7KMkqSee0fy70aLvXwlegTbXDuOD7l+nFFKqLhWEx7+/HFQldO GmjXe9qO7tXglYn5nN3BOkjPNoLVQ36w5OrtYF4Yx9O+D3G4tJFAOSMqGY+5PgB8PQ6S ZpjA== X-Gm-Message-State: APjAAAXE8vJiLwyjqClQirHnziYMEsS1eJVGqfHeNvqesk6Vk5evBAKW Jw/a6udNDiU3HY9gbtQR8qwlggPe9nq4qYBwl9sY2Q== X-Google-Smtp-Source: APXvYqw95v1HJNjFq6NxXANx2HJSYKFAedxbUN0WCX2cuyCFXTfg1tbtGGA16U2DXAE83wwuKEXXZ3z9oML/lvNewuM= X-Received: by 2002:a05:620a:1014:: with SMTP id z20mr21135229qkj.258.1556635577124; Tue, 30 Apr 2019 07:46:17 -0700 (PDT) MIME-Version: 1.0 References: <201904292205.x3TM5Q7Z058461@repo.freebsd.org> <20190430060849.GB97846@FreeBSD.org> <20190430142641.GA34567@raichu> In-Reply-To: <20190430142641.GA34567@raichu> From: Warner Losh Date: Tue, 30 Apr 2019 08:46:05 -0600 Message-ID: Subject: Re: svn commit: r346932 - head/sys/ufs/ufs To: Mark Johnston Cc: Alexey Dokuchaev , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 115A97545C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.994,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 14:46:18 -0000 On Tue, Apr 30, 2019 at 8:27 AM Mark Johnston wrote: > On Tue, Apr 30, 2019 at 06:08:49AM +0000, Alexey Dokuchaev wrote: > > On Mon, Apr 29, 2019 at 10:05:26PM +0000, Mark Johnston wrote: > > > New Revision: 346932 > > > URL: https://svnweb.freebsd.org/changeset/base/346932 > > > > > > Log: > > > Optimize lseek(SEEK_DATA) on UFS. > > > > > > This version fixes the problems identified in r345244. > > > > > > Reviewed by: kib > > > @@ -56,6 +56,9 @@ __FBSDID("$FreeBSD$"); > > > #include > > > #include > > > > > > +static ufs_lbn_t lbn_count(struct ufsmount *, int); > > > +static int readindir(struct vnode *, ufs_lbn_t, ufs2_daddr_t, struct > buf **); > > > > Is the prototype for static readindir() really needed here? > > Yes, when using a K&R definition. > > > > +static int > > > +readindir(vp, lbn, daddr, bpp) > > > + struct vnode *vp; > > > + ufs_lbn_t lbn; > > > + ufs2_daddr_t daddr; > > > + struct buf **bpp; > > > > Don't we prefer ASNI declarations over K&R these days? > > Yes, I was just staying consistent with the rest of the file. For new code, we do prefer ANSI prototypes and function definitions. But for ufs and friends, we're still using K&R for a variety of reasons. Warner From owner-svn-src-all@freebsd.org Tue Apr 30 15:17:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01C4B1595299; Tue, 30 Apr 2019 15:17:05 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9551076AFE; Tue, 30 Apr 2019 15:17:04 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [176.74.212.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id E983326026E; Tue, 30 Apr 2019 17:17:02 +0200 (CEST) Subject: Re: svn commit: r346958 - head/sys/compat/linuxkpi/common/src To: Niclas Zeising , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201904301041.x3UAfLvj054368@repo.freebsd.org> <8f360678-2df1-fe7b-cb83-f47923534826@freebsd.org> From: Hans Petter Selasky Message-ID: <2f77d9f2-833d-f614-e193-a369086c01cf@selasky.org> Date: Tue, 30 Apr 2019 17:16:34 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <8f360678-2df1-fe7b-cb83-f47923534826@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9551076AFE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.966,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 15:17:05 -0000 On 4/30/19 3:10 PM, Niclas Zeising wrote: > On 2019-04-30 12:41, Hans Petter Selasky wrote: >> Author: hselasky >> Date: Tue Apr 30 10:41:20 2019 >> New Revision: 346958 >> URL: https://svnweb.freebsd.org/changeset/base/346958 >> >> Log: >>    Reduce the number of mutexes after r346645 in the LinuxKPI. >>    Make function macro wrappers for locking and unlocking to ease >> readability. >>    No functional change. >>    Discussed with:        kib@, tychon@ and zeising@ > > I was not part of any discussion regarding this.  If this is related to > https://reviews.freebsd.org/D20097 I explicitly asked you on gitter to > hold of for a bit, while we try to figure out why we are seeing > regressions in graphics with the latest dmar changes. > > Can you please revert this since it colludes the dmar graphics issue, > and it makes the suggested patch not apply cleanly, which makes it > harder to get people to help test. > Thank you! > Regards In response to your request I've collected fixes for all the known LinuxKPI+DMA issues at: https://reviews.freebsd.org/D20097 It is based on top of the latest -current. --HPS From owner-svn-src-all@freebsd.org Tue Apr 30 15:24:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C3931595659 for ; Tue, 30 Apr 2019 15:24:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 290EA771BB for ; Tue, 30 Apr 2019 15:24:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x832.google.com with SMTP id d13so16573201qth.5 for ; Tue, 30 Apr 2019 08:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Yl2EMt15elu4oxf2JGGS6wqU0GrIaki3oQhxCPfnaow=; b=MtPKNmISxOGeOcuDPlil+B6yJsGxfVkO8FPRorYRJdzbPpyg3Xp/fTmlO4mhotBvr4 NCQeVBB/gLXghn4ocxuiaIR1WUm2MdV1ClEAmfGJcZT5w4E6L4NtG1Qk4cF/8PxE/MM5 sF0Vdkw1Kr65wD3XrUeRjr2Zwq99z4zbyVZ20f5GlPyWOeRyTDvbIISZjzRYxTvquXDn NmaC0KajhMnUiQdLNaa3NmQtdO1VhrlXC/m+XtXjGoSfYMnS4qMk+vmuX7grIxUoHbws KyqM9jd18XHBSbr9IiZTy6GLB2AZBEVL31W1jWrt38JgDsWZ/SIh4OtC19Gqi/crDeKN YNKg== 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=Yl2EMt15elu4oxf2JGGS6wqU0GrIaki3oQhxCPfnaow=; b=lqSd78DwoPlqxE1ZZS+XDPoz5CDmKW9nAWmEcvzl0jVIx9wrXvtX1LrlmW/xRWlYWf repkaY1NoPr14Wqd+ZHdMQR/B/1EXmCvgLcD12N+jqT2km8OncJGo89iXljHoNnRU39g hqujYrSkjmMRmtOFs4zYK9n7C2kpyTMltYAX3WUJvBi8gU9Gme+B7bLzWzPz0mrCPwqk xmKcB9hkcRKM7gDpMd/UuFyiYHxBEl7sjbBBBwax3Hui9rNW33bYHcaAYRpLLmOQOz6B WVdyx4cxbK41opMDp54uSmT+zOymaspq3XaSEANsREQmA576fnP2aI1uKGD1wmLTOZPQ NLsA== X-Gm-Message-State: APjAAAUWPyvKWc/wrX+n6nAxTC0bfkaX54pFBEMhPGEDc4BaS9h1flSH Bl+hwDVbeh4l652UQ1UaLWVjz97084jssKo4Vk3v7w== X-Google-Smtp-Source: APXvYqwJvBMy+IdPrcmd61rB/pbSY8DYqM1V/8kxT8czKKEens8rgG93UxxQnkxzputbAzJCYukco++7lceOyVWEXVg= X-Received: by 2002:ac8:28d0:: with SMTP id j16mr56190135qtj.15.1556637877357; Tue, 30 Apr 2019 08:24:37 -0700 (PDT) MIME-Version: 1.0 References: <201904301041.x3UAfLvj054368@repo.freebsd.org> <8f360678-2df1-fe7b-cb83-f47923534826@freebsd.org> <2f77d9f2-833d-f614-e193-a369086c01cf@selasky.org> In-Reply-To: <2f77d9f2-833d-f614-e193-a369086c01cf@selasky.org> From: Warner Losh Date: Tue, 30 Apr 2019 09:24:25 -0600 Message-ID: Subject: Re: svn commit: r346958 - head/sys/compat/linuxkpi/common/src To: Hans Petter Selasky Cc: Niclas Zeising , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 290EA771BB X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 15:24:38 -0000 On Tue, Apr 30, 2019 at 9:17 AM Hans Petter Selasky wrote: > On 4/30/19 3:10 PM, Niclas Zeising wrote: > > On 2019-04-30 12:41, Hans Petter Selasky wrote: > >> Author: hselasky > >> Date: Tue Apr 30 10:41:20 2019 > >> New Revision: 346958 > >> URL: https://svnweb.freebsd.org/changeset/base/346958 > >> > >> Log: > >> Reduce the number of mutexes after r346645 in the LinuxKPI. > >> Make function macro wrappers for locking and unlocking to ease > >> readability. > >> No functional change. > >> Discussed with: kib@, tychon@ and zeising@ > > > > I was not part of any discussion regarding this. If this is related to > > https://reviews.freebsd.org/D20097 I explicitly asked you on gitter to > > hold of for a bit, while we try to figure out why we are seeing > > regressions in graphics with the latest dmar changes. > > > > Can you please revert this since it colludes the dmar graphics issue, > > and it makes the suggested patch not apply cleanly, which makes it > > harder to get people to help test. > > Thank you! > > Regards > > In response to your request I've collected fixes for all the known > LinuxKPI+DMA issues at: > https://reviews.freebsd.org/D20097 > > It is based on top of the latest -current. > Hopefully this will solve the problem. Do you have any idea of when we might see resolution of this issue? I'd like to see it fixed by Friday either with fixes or a revert. Do you think that's a reasonable time frame? If not, what do you think a reasonable time frame will be? I know we have a number of unknowns to factor in, so my queries are based on our best guesses. Warner From owner-svn-src-all@freebsd.org Tue Apr 30 15:28:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7813F1595721; Tue, 30 Apr 2019 15:28:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B173777E4; Tue, 30 Apr 2019 15:28:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E52E2B83E; Tue, 30 Apr 2019 15:28:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UFSqpd009425; Tue, 30 Apr 2019 15:28:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UFSqX0009424; Tue, 30 Apr 2019 15:28:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904301528.x3UFSqX0009424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 30 Apr 2019 15:28:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346961 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 346961 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1B173777E4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 15:28:53 -0000 Author: emaste Date: Tue Apr 30 15:28:52 2019 New Revision: 346961 URL: https://svnweb.freebsd.org/changeset/base/346961 Log: revert QEMU q35 platform use from r346748 It seems to be incompatible with the OVMF.fd (of unknown provenance) in use by the Cirrus-CI config. We will soon have a known OVMF build via a port/package (see review D19869) and we can switch back to q35 once packages are available. Discussed with: bcran Modified: head/tools/boot/ci-qemu-test.sh Modified: head/tools/boot/ci-qemu-test.sh ============================================================================== --- head/tools/boot/ci-qemu-test.sh Tue Apr 30 14:44:39 2019 (r346960) +++ head/tools/boot/ci-qemu-test.sh Tue Apr 30 15:28:52 2019 (r346961) @@ -97,7 +97,7 @@ trap tempdir_cleanup EXIT SIGINT SIGHUP SIGTERM SIGQUI # And, boot in QEMU. : ${BOOTLOG:=${TMPDIR:-/tmp}/ci-qemu-test-boot.log} timeout 300 \ - qemu-system-x86_64 -M q35 -m 256M -nodefaults \ + qemu-system-x86_64 -m 256M -nodefaults \ -drive if=pflash,format=raw,readonly,file=${OVMF} \ -serial stdio -vga none -nographic -monitor none \ -snapshot -hda fat:${ROOTDIR} 2>&1 | tee ${BOOTLOG} From owner-svn-src-all@freebsd.org Tue Apr 30 15:53:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFB811595FD6; Tue, 30 Apr 2019 15:53:54 +0000 (UTC) (envelope-from tycho@pobox.com) Received: from pb-smtp21.pobox.com (pb-smtp21.pobox.com [173.228.157.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4758E8079C; Tue, 30 Apr 2019 15:53:54 +0000 (UTC) (envelope-from tycho@pobox.com) Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 5EA1D20A78; Tue, 30 Apr 2019 11:53:47 -0400 (EDT) (envelope-from tycho@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from :message-id:content-type:mime-version:subject:date:in-reply-to :cc:to:references; s=sasl; bh=ZDMjYYOjZyfXiakzrJlI0UxG/X4=; b=fA yzI12zwU0J8+pQFBuD3kW3F0HczQWrIpqBJN6cRvgu3R1duqPOpT5jza+7AGUOu/ OTiaanCka0KCdD2nnlijoUjVLpme20mVkGa/8nLQHc0wcUPUgpwzAZyPw/VZS0Pp oxuUNtJoLM458rs9qiApbWyZNHLWcJYySuBvdcikw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:message-id :content-type:mime-version:subject:date:in-reply-to:cc:to :references; q=dns; s=sasl; b=K082JJ7me3AAw8YqCGR0aQIKXf2ITSQok+ YmvpMyFboGi9BIBADaEUFdVEbT9UN3csIea3kaeoyj5Q5RtjiZQpqKmMkD2mNIWF yKUJrglTzHJ1DV8793MJWG1DUk4Hy5jsYQAVm3YumG69YQVYl8FlkM2GdzPHwiG2 RpRS4c5IE= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 567BB20A77; Tue, 30 Apr 2019 11:53:47 -0400 (EDT) (envelope-from tycho@pobox.com) Received: from [10.0.1.195] (unknown [146.115.68.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 1566520A76; Tue, 30 Apr 2019 11:53:44 -0400 (EDT) (envelope-from tycho@pobox.com) From: Tycho Nightingale Message-Id: <7927F561-6922-4960-90EC-BD36E0190A6F@pobox.com> Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r346958 - head/sys/compat/linuxkpi/common/src Date: Tue, 30 Apr 2019 11:53:42 -0400 In-Reply-To: Cc: Hans Petter Selasky , Niclas Zeising , src-committers , svn-src-all , svn-src-head To: Warner Losh References: <201904301041.x3UAfLvj054368@repo.freebsd.org> <8f360678-2df1-fe7b-cb83-f47923534826@freebsd.org> <2f77d9f2-833d-f614-e193-a369086c01cf@selasky.org> X-Mailer: Apple Mail (2.3445.9.1) X-Pobox-Relay-ID: 222F23C0-6B60-11E9-A01B-EE24A11ADF13-09779102!pb-smtp21.pobox.com X-Rspamd-Queue-Id: 4758E8079C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.952,0] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 15:53:55 -0000 > On Apr 30, 2019, at 11:24 AM, Warner Losh wrote: >=20 >=20 > On Tue, Apr 30, 2019 at 9:17 AM Hans Petter Selasky > wrote: > On 4/30/19 3:10 PM, Niclas Zeising wrote: > > On 2019-04-30 12:41, Hans Petter Selasky wrote: > >> Author: hselasky > >> Date: Tue Apr 30 10:41:20 2019 > >> New Revision: 346958 > >> URL: https://svnweb.freebsd.org/changeset/base/346958 = > >> > >> Log: > >> Reduce the number of mutexes after r346645 in the LinuxKPI. > >> Make function macro wrappers for locking and unlocking to ease=20= > >> readability. > >> No functional change. > >> Discussed with: kib@, tychon@ and zeising@ > >=20 > > I was not part of any discussion regarding this. If this is related = to=20 > > https://reviews.freebsd.org/D20097 = I explicitly asked you on gitter to=20= > > hold of for a bit, while we try to figure out why we are seeing=20 > > regressions in graphics with the latest dmar changes. > >=20 > > Can you please revert this since it colludes the dmar graphics = issue,=20 > > and it makes the suggested patch not apply cleanly, which makes it=20= > > harder to get people to help test. > > Thank you! > > Regards >=20 > In response to your request I've collected fixes for all the known=20 > LinuxKPI+DMA issues at: > https://reviews.freebsd.org/D20097 = >=20 > It is based on top of the latest -current. >=20 > Hopefully this will solve the problem. Do you have any idea of when we = might see resolution of this issue? I'd like to see it fixed by Friday = either with fixes or a revert. Do you think that's a reasonable time = frame? If not, what do you think a reasonable time frame will be? I know = we have a number of unknowns to factor in, so my queries are based on = our best guesses. Friday seems reasonable. The issues that have been exposed are that several callers of the Linux = API are not compliant with the documented API. For example according to = the documentation, dma_map_sg() may coalesce entries and our current = implementation does that. This broke some graphics drivers. To support = these drivers, going back to the non-coalesced version is the only path = forward as the callee bugs redefine this API de facto; this is included = in D20097. Also included in D20097 is a fix to ensure sg_dma_len() is equal to = sg->length =E2=80=94 again to address assumptions in drivers. Finally, apparently some drivers load the same DMA address multiple = times without any prior unload. Those drivers need to work too; D20097 = contains a fix. Thanks hps@ for helping out! Tycho= From owner-svn-src-all@freebsd.org Tue Apr 30 16:30:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40DB215971E2; Tue, 30 Apr 2019 16:30:17 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD62A822D1; Tue, 30 Apr 2019 16:30:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76E24C4A2; Tue, 30 Apr 2019 16:30:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UGUG5u041922; Tue, 30 Apr 2019 16:30:16 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UGUGVh041921; Tue, 30 Apr 2019 16:30:16 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904301630.x3UGUGVh041921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Apr 2019 16:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346962 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346962 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD62A822D1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 16:30:17 -0000 Author: np Date: Tue Apr 30 16:30:16 2019 New Revision: 346962 URL: https://svnweb.freebsd.org/changeset/base/346962 Log: MFC r343539: cxgbe(4): Add adapter information to messages logged by the OS-agnostic code in t4_hw.c. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/osdep.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/osdep.h ============================================================================== --- stable/11/sys/dev/cxgbe/osdep.h Tue Apr 30 15:28:52 2019 (r346961) +++ stable/11/sys/dev/cxgbe/osdep.h Tue Apr 30 16:30:16 2019 (r346962) @@ -40,10 +40,14 @@ #include #include -#define CH_ERR(adap, fmt, ...) log(LOG_ERR, fmt, ##__VA_ARGS__) -#define CH_WARN(adap, fmt, ...) log(LOG_WARNING, fmt, ##__VA_ARGS__) -#define CH_ALERT(adap, fmt, ...) log(LOG_ALERT, fmt, ##__VA_ARGS__) -#define CH_WARN_RATELIMIT(adap, fmt, ...) log(LOG_WARNING, fmt, ##__VA_ARGS__) +#define CH_ERR(adap, fmt, ...) log(LOG_ERR, "%s: " fmt, \ + device_get_nameunit(adap->dev), ##__VA_ARGS__) +#define CH_WARN(adap, fmt, ...) log(LOG_WARNING, "%s: " fmt, \ + device_get_nameunit(adap->dev), ##__VA_ARGS__) +#define CH_ALERT(adap, fmt, ...) log(LOG_ALERT, "%s: " fmt, \ + device_get_nameunit(adap->dev), ##__VA_ARGS__) +#define CH_WARN_RATELIMIT(adap, fmt, ...) log(LOG_WARNING, "%s: " fmt, \ + device_get_nameunit(adap->dev), ##__VA_ARGS__) #ifndef LINUX_TYPES_DEFINED typedef int8_t s8; From owner-svn-src-all@freebsd.org Tue Apr 30 16:41:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F47B159781C; Tue, 30 Apr 2019 16:41:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B9AD82CA6; Tue, 30 Apr 2019 16:41:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9396C7C9; Tue, 30 Apr 2019 16:41:27 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UGfRNR051069; Tue, 30 Apr 2019 16:41:27 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UGfRZ8051065; Tue, 30 Apr 2019 16:41:27 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904301641.x3UGfRZ8051065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Apr 2019 16:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346963 - in stable/11/sys/dev/cxgbe: . common X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 346963 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B9AD82CA6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 16:41:28 -0000 Author: np Date: Tue Apr 30 16:41:27 2019 New Revision: 346963 URL: https://svnweb.freebsd.org/changeset/base/346963 Log: MFC r343666, r343861-r343862, r343923, r343968, r345660, r345810 r343666: cxgbe(4): Improved error reporting and diagnostics. "slow" interrupt handler: - Expand the list of INT_CAUSE registers known to the driver. - Add decode information for many more bits but decouple it from the rest of intr_info so that it is entirely optional. - Call t4_fatal_err exactly once, and from the top level PL intr handler. t4_fatal_err: - Use t4_shutdown_adapter from the common code to stop the adapter. - Stop servicing slow interrupts after the first fatal one. Driver/firmware interaction: - CH_DUMP_MBOX: note whether the mailbox being dumped is a command or a reply or something else. - Log the raw value of pcie_fw for some errors. - Use correct log levels (debug vs. error). Sponsored by: Chelsio Communications r343861: cxgbe(4): Auto-dump the device log on a mailbox timeout or when the firmware reports an error in pcie_fw. Sponsored by: Chelsio Communications r343862: cxgbe(4): Auto-dump the CIM block's logic analyzer on a TIMER0 interrupt. Sponsored by: Chelsio Communications r343923: cxgbe(4): Delay the panic due to a fatal error by 30s. This lets information logged by the interrupt handler reach the system log before the system goes down. r343968: cxgbe(4): Ignore unused interrupts. Sponsored by: Chelsio Communications r345660: cxgbe(4): Count and clear interrupts generated at the software's request. An interrupt can be requested by setting the F_SWINT bit in PL_PF_CTL. Sponsored by: Chelsio Communications r345810: cxgbe(4): Add a flag to indicate that bits in interrupt cause but not in interrupt enable are not fatal. The firmware sets up all the interrupt enables based on run time configuration, which means the information in the enables is more accurate than what's compiled into the driver. This change also allows the fatal bits to be updated without any changes in the driver in some cases. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/common/common.h stable/11/sys/dev/cxgbe/common/t4_hw.c stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Tue Apr 30 16:30:16 2019 (r346962) +++ stable/11/sys/dev/cxgbe/adapter.h Tue Apr 30 16:41:27 2019 (r346963) @@ -153,7 +153,7 @@ enum { CHK_MBOX_ACCESS = (1 << 2), MASTER_PF = (1 << 3), ADAP_SYSCTL_CTX = (1 << 4), - /* TOM_INIT_DONE= (1 << 5), No longer used */ + ADAP_ERR = (1 << 5), BUF_PACKING_OK = (1 << 6), IS_VF = (1 << 7), @@ -173,6 +173,7 @@ enum { DF_LOAD_FW_ANYTIME = (1 << 1), /* Allow LOAD_FW after init */ DF_DISABLE_TCB_CACHE = (1 << 2), /* Disable TCB cache (T6+) */ DF_DISABLE_CFG_RETRY = (1 << 3), /* Disable fallback config */ + DF_VERBOSE_SLOWINTR = (1 << 4), /* Chatty slow intr handler */ }; #define IS_DOOMED(vi) ((vi)->flags & DOOMED) @@ -886,6 +887,8 @@ struct adapter { const char *last_op; const void *last_op_thr; int last_op_flags; + + int swintr; }; #define ADAPTER_LOCK(sc) mtx_lock(&(sc)->sc_lock) @@ -926,24 +929,6 @@ struct adapter { #define TXQ_LOCK_ASSERT_OWNED(txq) EQ_LOCK_ASSERT_OWNED(&(txq)->eq) #define TXQ_LOCK_ASSERT_NOTOWNED(txq) EQ_LOCK_ASSERT_NOTOWNED(&(txq)->eq) -#define CH_DUMP_MBOX(sc, mbox, data_reg) \ - do { \ - if (sc->debug_flags & DF_DUMP_MBOX) { \ - log(LOG_NOTICE, \ - "%s mbox %u: %016llx %016llx %016llx %016llx " \ - "%016llx %016llx %016llx %016llx\n", \ - device_get_nameunit(sc->dev), mbox, \ - (unsigned long long)t4_read_reg64(sc, data_reg), \ - (unsigned long long)t4_read_reg64(sc, data_reg + 8), \ - (unsigned long long)t4_read_reg64(sc, data_reg + 16), \ - (unsigned long long)t4_read_reg64(sc, data_reg + 24), \ - (unsigned long long)t4_read_reg64(sc, data_reg + 32), \ - (unsigned long long)t4_read_reg64(sc, data_reg + 40), \ - (unsigned long long)t4_read_reg64(sc, data_reg + 48), \ - (unsigned long long)t4_read_reg64(sc, data_reg + 56)); \ - } \ - } while (0) - #define for_each_txq(vi, iter, q) \ for (q = &vi->pi->adapter->sge.txq[vi->first_txq], iter = 0; \ iter < vi->ntxq; ++iter, ++q) @@ -1099,6 +1084,38 @@ t4_use_ldst(struct adapter *sc) #endif } +static inline void +CH_DUMP_MBOX(struct adapter *sc, int mbox, const int reg, + const char *msg, const __be64 *const p, const bool err) +{ + + if (!(sc->debug_flags & DF_DUMP_MBOX) && !err) + return; + if (p != NULL) { + log(err ? LOG_ERR : LOG_DEBUG, + "%s: mbox %u %s %016llx %016llx %016llx %016llx " + "%016llx %016llx %016llx %016llx\n", + device_get_nameunit(sc->dev), mbox, msg, + (long long)be64_to_cpu(p[0]), (long long)be64_to_cpu(p[1]), + (long long)be64_to_cpu(p[2]), (long long)be64_to_cpu(p[3]), + (long long)be64_to_cpu(p[4]), (long long)be64_to_cpu(p[5]), + (long long)be64_to_cpu(p[6]), (long long)be64_to_cpu(p[7])); + } else { + log(err ? LOG_ERR : LOG_DEBUG, + "%s: mbox %u %s %016llx %016llx %016llx %016llx " + "%016llx %016llx %016llx %016llx\n", + device_get_nameunit(sc->dev), mbox, msg, + (long long)t4_read_reg64(sc, reg), + (long long)t4_read_reg64(sc, reg + 8), + (long long)t4_read_reg64(sc, reg + 16), + (long long)t4_read_reg64(sc, reg + 24), + (long long)t4_read_reg64(sc, reg + 32), + (long long)t4_read_reg64(sc, reg + 40), + (long long)t4_read_reg64(sc, reg + 48), + (long long)t4_read_reg64(sc, reg + 56)); + } +} + /* t4_main.c */ extern int t4_ntxq; extern int t4_nrxq; @@ -1143,6 +1160,8 @@ void free_atid(struct adapter *, int); void release_tid(struct adapter *, int, struct sge_wrq *); int cxgbe_media_change(struct ifnet *); void cxgbe_media_status(struct ifnet *, struct ifmediareq *); +bool t4_os_dump_cimla(struct adapter *, int, bool); +void t4_os_dump_devlog(struct adapter *); #ifdef DEV_NETMAP /* t4_netmap.c */ Modified: stable/11/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/11/sys/dev/cxgbe/common/common.h Tue Apr 30 16:30:16 2019 (r346962) +++ stable/11/sys/dev/cxgbe/common/common.h Tue Apr 30 16:41:27 2019 (r346963) @@ -32,10 +32,6 @@ #include "t4_hw.h" -#define GLBL_INTR_MASK (F_CIM | F_MPS | F_PL | F_PCIE | F_MC0 | F_EDC0 | \ - F_EDC1 | F_LE | F_TP | F_MA | F_PM_TX | F_PM_RX | F_ULP_RX | \ - F_CPL_SWITCH | F_SGE | F_ULP_TX) - enum { MAX_NPORTS = 4, /* max # of ports */ SERNUM_LEN = 24, /* Serial # length */ @@ -579,7 +575,7 @@ struct fw_filter_wr; void t4_intr_enable(struct adapter *adapter); void t4_intr_disable(struct adapter *adapter); void t4_intr_clear(struct adapter *adapter); -int t4_slow_intr_handler(struct adapter *adapter); +int t4_slow_intr_handler(struct adapter *adapter, bool verbose); int t4_hash_mac_addr(const u8 *addr); int t4_link_l1cfg(struct adapter *adap, unsigned int mbox, unsigned int port, @@ -619,9 +615,7 @@ int t4_init_sge_params(struct adapter *adapter); int t4_init_tp_params(struct adapter *adap, bool sleep_ok); int t4_filter_field_shift(const struct adapter *adap, int filter_sel); int t4_port_init(struct adapter *adap, int mbox, int pf, int vf, int port_id); -void t4_fatal_err(struct adapter *adapter); -void t4_db_full(struct adapter *adapter); -void t4_db_dropped(struct adapter *adapter); +void t4_fatal_err(struct adapter *adapter, bool fw_error); int t4_set_trace_filter(struct adapter *adapter, const struct trace_params *tp, int filter_index, int enable); void t4_get_trace_filter(struct adapter *adapter, struct trace_params *tp, Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/11/sys/dev/cxgbe/common/t4_hw.c Tue Apr 30 16:30:16 2019 (r346962) +++ stable/11/sys/dev/cxgbe/common/t4_hw.c Tue Apr 30 16:41:27 2019 (r346963) @@ -210,9 +210,11 @@ static void t4_report_fw_error(struct adapter *adap) pcie_fw = t4_read_reg(adap, A_PCIE_FW); if (pcie_fw & F_PCIE_FW_ERR) { - CH_ERR(adap, "Firmware reports adapter error: %s\n", - reason[G_PCIE_FW_EVAL(pcie_fw)]); adap->flags &= ~FW_OK; + CH_ERR(adap, "firmware reports adapter error: %s (0x%08x)\n", + reason[G_PCIE_FW_EVAL(pcie_fw)], pcie_fw); + if (pcie_fw != 0xffffffff) + t4_os_dump_devlog(adap); } } @@ -338,7 +340,6 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int u32 v; u64 res; int i, ms, delay_idx, ret, next_tx_check; - const __be64 *p = cmd; u32 data_reg = PF_REG(mbox, A_CIM_PF_MAILBOX_DATA); u32 ctl_reg = PF_REG(mbox, A_CIM_PF_MAILBOX_CTRL); u32 ctl; @@ -349,7 +350,7 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int if (adap->flags & CHK_MBOX_ACCESS) ASSERT_SYNCHRONIZED_OP(adap); - if ((size & 15) || size > MBOX_LEN) + if (size <= 0 || (size & 15) || size > MBOX_LEN) return -EINVAL; if (adap->flags & IS_VF) { @@ -379,8 +380,7 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int } /* - * If we were unable to gain access, dequeue ourselves from the - * mailbox atomic access list and report the error to our caller. + * If we were unable to gain access, report the error to our caller. */ if (v != X_MBOWNER_PL) { t4_report_fw_error(adap); @@ -396,23 +396,17 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int * presaged the firmware crashing ... */ if (ctl & F_MBMSGVALID) { - CH_ERR(adap, "found VALID command in mbox %u: %016llx %016llx " - "%016llx %016llx %016llx %016llx %016llx %016llx\n", - mbox, (unsigned long long)t4_read_reg64(adap, data_reg), - (unsigned long long)t4_read_reg64(adap, data_reg + 8), - (unsigned long long)t4_read_reg64(adap, data_reg + 16), - (unsigned long long)t4_read_reg64(adap, data_reg + 24), - (unsigned long long)t4_read_reg64(adap, data_reg + 32), - (unsigned long long)t4_read_reg64(adap, data_reg + 40), - (unsigned long long)t4_read_reg64(adap, data_reg + 48), - (unsigned long long)t4_read_reg64(adap, data_reg + 56)); + CH_DUMP_MBOX(adap, mbox, data_reg, "VLD", NULL, true); } /* * Copy in the new mailbox command and send it on its way ... */ - for (i = 0; i < size; i += 8, p++) - t4_write_reg64(adap, data_reg + i, be64_to_cpu(*p)); + memset(cmd_rpl, 0, sizeof(cmd_rpl)); + memcpy(cmd_rpl, cmd, size); + CH_DUMP_MBOX(adap, mbox, 0, "cmd", cmd_rpl, false); + for (i = 0; i < ARRAY_SIZE(cmd_rpl); i++) + t4_write_reg64(adap, data_reg + i * 8, be64_to_cpu(cmd_rpl[i])); if (adap->flags & IS_VF) { /* @@ -430,8 +424,6 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int t4_read_reg(adap, data_reg); } - CH_DUMP_MBOX(adap, mbox, data_reg); - t4_write_reg(adap, ctl_reg, F_MBMSGVALID | V_MBOWNER(X_MBOWNER_FW)); read_tx_state(adap, &tx_state[0]); /* also flushes the write_reg */ next_tx_check = 1000; @@ -478,10 +470,9 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int * Retrieve the command reply and release the mailbox. */ get_mbox_rpl(adap, cmd_rpl, MBOX_LEN/8, data_reg); + CH_DUMP_MBOX(adap, mbox, 0, "rpl", cmd_rpl, false); t4_write_reg(adap, ctl_reg, V_MBOWNER(X_MBOWNER_NONE)); - CH_DUMP_MBOX(adap, mbox, data_reg); - res = be64_to_cpu(cmd_rpl[0]); if (G_FW_CMD_OP(res >> 32) == FW_DEBUG_CMD) { fw_asrt(adap, (struct fw_debug_cmd *)cmd_rpl); @@ -497,27 +488,20 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int * the error and also check to see if the firmware reported any * errors ... */ - ret = (pcie_fw & F_PCIE_FW_ERR) ? -ENXIO : -ETIMEDOUT; - CH_ERR(adap, "command %#x in mailbox %d timed out\n", - *(const u8 *)cmd, mbox); + CH_ERR(adap, "command %#x in mbox %d timed out (0x%08x).\n", + *(const u8 *)cmd, mbox, pcie_fw); + CH_DUMP_MBOX(adap, mbox, 0, "cmdsent", cmd_rpl, true); + CH_DUMP_MBOX(adap, mbox, data_reg, "current", NULL, true); - /* If DUMP_MBOX is set the mbox has already been dumped */ - if ((adap->debug_flags & DF_DUMP_MBOX) == 0) { - p = cmd; - CH_ERR(adap, "mbox: %016llx %016llx %016llx %016llx " - "%016llx %016llx %016llx %016llx\n", - (unsigned long long)be64_to_cpu(p[0]), - (unsigned long long)be64_to_cpu(p[1]), - (unsigned long long)be64_to_cpu(p[2]), - (unsigned long long)be64_to_cpu(p[3]), - (unsigned long long)be64_to_cpu(p[4]), - (unsigned long long)be64_to_cpu(p[5]), - (unsigned long long)be64_to_cpu(p[6]), - (unsigned long long)be64_to_cpu(p[7])); + if (pcie_fw & F_PCIE_FW_ERR) { + ret = -ENXIO; + t4_report_fw_error(adap); + } else { + ret = -ETIMEDOUT; + t4_os_dump_devlog(adap); } - t4_report_fw_error(adap); - t4_fatal_err(adap); + t4_fatal_err(adap, true); return ret; } @@ -3963,785 +3947,1369 @@ int t4_restart_aneg(struct adapter *adap, unsigned int return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); } -typedef void (*int_handler_t)(struct adapter *adap); +struct intr_details { + u32 mask; + const char *msg; +}; +struct intr_action { + u32 mask; + int arg; + bool (*action)(struct adapter *, int, bool); +}; + +#define NONFATAL_IF_DISABLED 1 struct intr_info { - unsigned int mask; /* bits to check in interrupt status */ - const char *msg; /* message to print or NULL */ - short stat_idx; /* stat counter to increment or -1 */ - unsigned short fatal; /* whether the condition reported is fatal */ - int_handler_t int_handler; /* platform-specific int handler */ + const char *name; /* name of the INT_CAUSE register */ + int cause_reg; /* INT_CAUSE register */ + int enable_reg; /* INT_ENABLE register */ + u32 fatal; /* bits that are fatal */ + int flags; /* hints */ + const struct intr_details *details; + const struct intr_action *actions; }; -/** - * t4_handle_intr_status - table driven interrupt handler - * @adapter: the adapter that generated the interrupt - * @reg: the interrupt status register to process - * @acts: table of interrupt actions - * - * A table driven interrupt handler that applies a set of masks to an - * interrupt status word and performs the corresponding actions if the - * interrupts described by the mask have occurred. The actions include - * optionally emitting a warning or alert message. The table is terminated - * by an entry specifying mask 0. Returns the number of fatal interrupt - * conditions. +static inline char +intr_alert_char(u32 cause, u32 enable, u32 fatal) +{ + + if (cause & fatal) + return ('!'); + if (cause & enable) + return ('*'); + return ('-'); +} + +static void +t4_show_intr_info(struct adapter *adap, const struct intr_info *ii, u32 cause) +{ + u32 enable, fatal, leftover; + const struct intr_details *details; + char alert; + + enable = t4_read_reg(adap, ii->enable_reg); + if (ii->flags & NONFATAL_IF_DISABLED) + fatal = ii->fatal & t4_read_reg(adap, ii->enable_reg); + else + fatal = ii->fatal; + alert = intr_alert_char(cause, enable, fatal); + CH_ALERT(adap, "%c %s 0x%x = 0x%08x, E 0x%08x, F 0x%08x\n", + alert, ii->name, ii->cause_reg, cause, enable, fatal); + + leftover = cause; + for (details = ii->details; details && details->mask != 0; details++) { + u32 msgbits = details->mask & cause; + if (msgbits == 0) + continue; + alert = intr_alert_char(msgbits, enable, ii->fatal); + CH_ALERT(adap, " %c [0x%08x] %s\n", alert, msgbits, + details->msg); + leftover &= ~msgbits; + } + if (leftover != 0 && leftover != cause) + CH_ALERT(adap, " ? [0x%08x]\n", leftover); +} + +/* + * Returns true for fatal error. */ -static int t4_handle_intr_status(struct adapter *adapter, unsigned int reg, - const struct intr_info *acts) +static bool +t4_handle_intr(struct adapter *adap, const struct intr_info *ii, + u32 additional_cause, bool verbose) { - int fatal = 0; - unsigned int mask = 0; - unsigned int status = t4_read_reg(adapter, reg); + u32 cause, fatal; + bool rc; + const struct intr_action *action; - for ( ; acts->mask; ++acts) { - if (!(status & acts->mask)) + /* read and display cause. */ + cause = t4_read_reg(adap, ii->cause_reg); + if (verbose || cause != 0) + t4_show_intr_info(adap, ii, cause); + /* + * The top level interrupt cause is a bit special and we need to ignore + * the bits that are not in the enable. Note that we did display them + * above in t4_show_intr_info but will not clear them. + */ + if (ii->cause_reg == A_PL_INT_CAUSE) + cause &= t4_read_reg(adap, ii->enable_reg); + fatal = cause & ii->fatal; + if (fatal != 0 && ii->flags & NONFATAL_IF_DISABLED) + fatal &= t4_read_reg(adap, ii->enable_reg); + cause |= additional_cause; + if (cause == 0) + return (false); + + rc = fatal != 0; + for (action = ii->actions; action && action->mask != 0; action++) { + if (!(action->mask & cause)) continue; - if (acts->fatal) { - fatal++; - CH_ALERT(adapter, "%s (0x%x)\n", acts->msg, - status & acts->mask); - } else if (acts->msg) - CH_WARN_RATELIMIT(adapter, "%s (0x%x)\n", acts->msg, - status & acts->mask); - if (acts->int_handler) - acts->int_handler(adapter); - mask |= acts->mask; + rc |= (action->action)(adap, action->arg, verbose); } - status &= mask; - if (status) /* clear processed interrupts */ - t4_write_reg(adapter, reg, status); - return fatal; + + /* clear */ + t4_write_reg(adap, ii->cause_reg, cause); + (void)t4_read_reg(adap, ii->cause_reg); + + return (rc); } /* * Interrupt handler for the PCIE module. */ -static void pcie_intr_handler(struct adapter *adapter) +static bool pcie_intr_handler(struct adapter *adap, int arg, bool verbose) { - static const struct intr_info sysbus_intr_info[] = { - { F_RNPP, "RXNP array parity error", -1, 1 }, - { F_RPCP, "RXPC array parity error", -1, 1 }, - { F_RCIP, "RXCIF array parity error", -1, 1 }, - { F_RCCP, "Rx completions control array parity error", -1, 1 }, - { F_RFTP, "RXFT array parity error", -1, 1 }, + static const struct intr_details sysbus_intr_details[] = { + { F_RNPP, "RXNP array parity error" }, + { F_RPCP, "RXPC array parity error" }, + { F_RCIP, "RXCIF array parity error" }, + { F_RCCP, "Rx completions control array parity error" }, + { F_RFTP, "RXFT array parity error" }, { 0 } }; - static const struct intr_info pcie_port_intr_info[] = { - { F_TPCP, "TXPC array parity error", -1, 1 }, - { F_TNPP, "TXNP array parity error", -1, 1 }, - { F_TFTP, "TXFT array parity error", -1, 1 }, - { F_TCAP, "TXCA array parity error", -1, 1 }, - { F_TCIP, "TXCIF array parity error", -1, 1 }, - { F_RCAP, "RXCA array parity error", -1, 1 }, - { F_OTDD, "outbound request TLP discarded", -1, 1 }, - { F_RDPE, "Rx data parity error", -1, 1 }, - { F_TDUE, "Tx uncorrectable data error", -1, 1 }, + static const struct intr_info sysbus_intr_info = { + .name = "PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS", + .cause_reg = A_PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS, + .enable_reg = A_PCIE_CORE_UTL_SYSTEM_BUS_AGENT_INTERRUPT_ENABLE, + .fatal = F_RFTP | F_RCCP | F_RCIP | F_RPCP | F_RNPP, + .flags = 0, + .details = sysbus_intr_details, + .actions = NULL, + }; + static const struct intr_details pcie_port_intr_details[] = { + { F_TPCP, "TXPC array parity error" }, + { F_TNPP, "TXNP array parity error" }, + { F_TFTP, "TXFT array parity error" }, + { F_TCAP, "TXCA array parity error" }, + { F_TCIP, "TXCIF array parity error" }, + { F_RCAP, "RXCA array parity error" }, + { F_OTDD, "outbound request TLP discarded" }, + { F_RDPE, "Rx data parity error" }, + { F_TDUE, "Tx uncorrectable data error" }, { 0 } }; - static const struct intr_info pcie_intr_info[] = { - { F_MSIADDRLPERR, "MSI AddrL parity error", -1, 1 }, - { F_MSIADDRHPERR, "MSI AddrH parity error", -1, 1 }, - { F_MSIDATAPERR, "MSI data parity error", -1, 1 }, - { F_MSIXADDRLPERR, "MSI-X AddrL parity error", -1, 1 }, - { F_MSIXADDRHPERR, "MSI-X AddrH parity error", -1, 1 }, - { F_MSIXDATAPERR, "MSI-X data parity error", -1, 1 }, - { F_MSIXDIPERR, "MSI-X DI parity error", -1, 1 }, - { F_PIOCPLPERR, "PCI PIO completion FIFO parity error", -1, 1 }, - { F_PIOREQPERR, "PCI PIO request FIFO parity error", -1, 1 }, - { F_TARTAGPERR, "PCI PCI target tag FIFO parity error", -1, 1 }, - { F_CCNTPERR, "PCI CMD channel count parity error", -1, 1 }, - { F_CREQPERR, "PCI CMD channel request parity error", -1, 1 }, - { F_CRSPPERR, "PCI CMD channel response parity error", -1, 1 }, - { F_DCNTPERR, "PCI DMA channel count parity error", -1, 1 }, - { F_DREQPERR, "PCI DMA channel request parity error", -1, 1 }, - { F_DRSPPERR, "PCI DMA channel response parity error", -1, 1 }, - { F_HCNTPERR, "PCI HMA channel count parity error", -1, 1 }, - { F_HREQPERR, "PCI HMA channel request parity error", -1, 1 }, - { F_HRSPPERR, "PCI HMA channel response parity error", -1, 1 }, - { F_CFGSNPPERR, "PCI config snoop FIFO parity error", -1, 1 }, - { F_FIDPERR, "PCI FID parity error", -1, 1 }, - { F_INTXCLRPERR, "PCI INTx clear parity error", -1, 1 }, - { F_MATAGPERR, "PCI MA tag parity error", -1, 1 }, - { F_PIOTAGPERR, "PCI PIO tag parity error", -1, 1 }, - { F_RXCPLPERR, "PCI Rx completion parity error", -1, 1 }, - { F_RXWRPERR, "PCI Rx write parity error", -1, 1 }, - { F_RPLPERR, "PCI replay buffer parity error", -1, 1 }, - { F_PCIESINT, "PCI core secondary fault", -1, 1 }, - { F_PCIEPINT, "PCI core primary fault", -1, 1 }, - { F_UNXSPLCPLERR, "PCI unexpected split completion error", -1, - 0 }, + static const struct intr_info pcie_port_intr_info = { + .name = "PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS", + .cause_reg = A_PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS, + .enable_reg = A_PCIE_CORE_UTL_PCI_EXPRESS_PORT_INTERRUPT_ENABLE, + .fatal = F_TPCP | F_TNPP | F_TFTP | F_TCAP | F_TCIP | F_RCAP | + F_OTDD | F_RDPE | F_TDUE, + .flags = 0, + .details = pcie_port_intr_details, + .actions = NULL, + }; + static const struct intr_details pcie_intr_details[] = { + { F_MSIADDRLPERR, "MSI AddrL parity error" }, + { F_MSIADDRHPERR, "MSI AddrH parity error" }, + { F_MSIDATAPERR, "MSI data parity error" }, + { F_MSIXADDRLPERR, "MSI-X AddrL parity error" }, + { F_MSIXADDRHPERR, "MSI-X AddrH parity error" }, + { F_MSIXDATAPERR, "MSI-X data parity error" }, + { F_MSIXDIPERR, "MSI-X DI parity error" }, + { F_PIOCPLPERR, "PCIe PIO completion FIFO parity error" }, + { F_PIOREQPERR, "PCIe PIO request FIFO parity error" }, + { F_TARTAGPERR, "PCIe target tag FIFO parity error" }, + { F_CCNTPERR, "PCIe CMD channel count parity error" }, + { F_CREQPERR, "PCIe CMD channel request parity error" }, + { F_CRSPPERR, "PCIe CMD channel response parity error" }, + { F_DCNTPERR, "PCIe DMA channel count parity error" }, + { F_DREQPERR, "PCIe DMA channel request parity error" }, + { F_DRSPPERR, "PCIe DMA channel response parity error" }, + { F_HCNTPERR, "PCIe HMA channel count parity error" }, + { F_HREQPERR, "PCIe HMA channel request parity error" }, + { F_HRSPPERR, "PCIe HMA channel response parity error" }, + { F_CFGSNPPERR, "PCIe config snoop FIFO parity error" }, + { F_FIDPERR, "PCIe FID parity error" }, + { F_INTXCLRPERR, "PCIe INTx clear parity error" }, + { F_MATAGPERR, "PCIe MA tag parity error" }, + { F_PIOTAGPERR, "PCIe PIO tag parity error" }, + { F_RXCPLPERR, "PCIe Rx completion parity error" }, + { F_RXWRPERR, "PCIe Rx write parity error" }, + { F_RPLPERR, "PCIe replay buffer parity error" }, + { F_PCIESINT, "PCIe core secondary fault" }, + { F_PCIEPINT, "PCIe core primary fault" }, + { F_UNXSPLCPLERR, "PCIe unexpected split completion error" }, { 0 } }; - - static const struct intr_info t5_pcie_intr_info[] = { - { F_MSTGRPPERR, "Master Response Read Queue parity error", - -1, 1 }, - { F_MSTTIMEOUTPERR, "Master Timeout FIFO parity error", -1, 1 }, - { F_MSIXSTIPERR, "MSI-X STI SRAM parity error", -1, 1 }, - { F_MSIXADDRLPERR, "MSI-X AddrL parity error", -1, 1 }, - { F_MSIXADDRHPERR, "MSI-X AddrH parity error", -1, 1 }, - { F_MSIXDATAPERR, "MSI-X data parity error", -1, 1 }, - { F_MSIXDIPERR, "MSI-X DI parity error", -1, 1 }, - { F_PIOCPLGRPPERR, "PCI PIO completion Group FIFO parity error", - -1, 1 }, - { F_PIOREQGRPPERR, "PCI PIO request Group FIFO parity error", - -1, 1 }, - { F_TARTAGPERR, "PCI PCI target tag FIFO parity error", -1, 1 }, - { F_MSTTAGQPERR, "PCI master tag queue parity error", -1, 1 }, - { F_CREQPERR, "PCI CMD channel request parity error", -1, 1 }, - { F_CRSPPERR, "PCI CMD channel response parity error", -1, 1 }, - { F_DREQWRPERR, "PCI DMA channel write request parity error", - -1, 1 }, - { F_DREQPERR, "PCI DMA channel request parity error", -1, 1 }, - { F_DRSPPERR, "PCI DMA channel response parity error", -1, 1 }, - { F_HREQWRPERR, "PCI HMA channel count parity error", -1, 1 }, - { F_HREQPERR, "PCI HMA channel request parity error", -1, 1 }, - { F_HRSPPERR, "PCI HMA channel response parity error", -1, 1 }, - { F_CFGSNPPERR, "PCI config snoop FIFO parity error", -1, 1 }, - { F_FIDPERR, "PCI FID parity error", -1, 1 }, - { F_VFIDPERR, "PCI INTx clear parity error", -1, 1 }, - { F_MAGRPPERR, "PCI MA group FIFO parity error", -1, 1 }, - { F_PIOTAGPERR, "PCI PIO tag parity error", -1, 1 }, - { F_IPRXHDRGRPPERR, "PCI IP Rx header group parity error", - -1, 1 }, - { F_IPRXDATAGRPPERR, "PCI IP Rx data group parity error", - -1, 1 }, - { F_RPLPERR, "PCI IP replay buffer parity error", -1, 1 }, - { F_IPSOTPERR, "PCI IP SOT buffer parity error", -1, 1 }, - { F_TRGT1GRPPERR, "PCI TRGT1 group FIFOs parity error", -1, 1 }, - { F_READRSPERR, "Outbound read error", -1, - 0 }, + static const struct intr_details t5_pcie_intr_details[] = { + { F_IPGRPPERR, "Parity errors observed by IP" }, + { F_NONFATALERR, "PCIe non-fatal error" }, + { F_READRSPERR, "Outbound read error" }, + { F_TRGT1GRPPERR, "PCIe TRGT1 group FIFOs parity error" }, + { F_IPSOTPERR, "PCIe IP SOT buffer SRAM parity error" }, + { F_IPRETRYPERR, "PCIe IP replay buffer parity error" }, + { F_IPRXDATAGRPPERR, "PCIe IP Rx data group SRAMs parity error" }, + { F_IPRXHDRGRPPERR, "PCIe IP Rx header group SRAMs parity error" }, + { F_PIOTAGQPERR, "PIO tag queue FIFO parity error" }, + { F_MAGRPPERR, "MA group FIFO parity error" }, + { F_VFIDPERR, "VFID SRAM parity error" }, + { F_FIDPERR, "FID SRAM parity error" }, + { F_CFGSNPPERR, "config snoop FIFO parity error" }, + { F_HRSPPERR, "HMA channel response data SRAM parity error" }, + { F_HREQRDPERR, "HMA channel read request SRAM parity error" }, + { F_HREQWRPERR, "HMA channel write request SRAM parity error" }, + { F_DRSPPERR, "DMA channel response data SRAM parity error" }, + { F_DREQRDPERR, "DMA channel write request SRAM parity error" }, + { F_CRSPPERR, "CMD channel response data SRAM parity error" }, + { F_CREQRDPERR, "CMD channel read request SRAM parity error" }, + { F_MSTTAGQPERR, "PCIe master tag queue SRAM parity error" }, + { F_TGTTAGQPERR, "PCIe target tag queue FIFO parity error" }, + { F_PIOREQGRPPERR, "PIO request group FIFOs parity error" }, + { F_PIOCPLGRPPERR, "PIO completion group FIFOs parity error" }, + { F_MSIXDIPERR, "MSI-X DI SRAM parity error" }, + { F_MSIXDATAPERR, "MSI-X data SRAM parity error" }, + { F_MSIXADDRHPERR, "MSI-X AddrH SRAM parity error" }, + { F_MSIXADDRLPERR, "MSI-X AddrL SRAM parity error" }, + { F_MSIXSTIPERR, "MSI-X STI SRAM parity error" }, + { F_MSTTIMEOUTPERR, "Master timeout FIFO parity error" }, + { F_MSTGRPPERR, "Master response read queue SRAM parity error" }, { 0 } }; + struct intr_info pcie_intr_info = { + .name = "PCIE_INT_CAUSE", + .cause_reg = A_PCIE_INT_CAUSE, + .enable_reg = A_PCIE_INT_ENABLE, + .fatal = 0xffffffff, + .flags = NONFATAL_IF_DISABLED, + .details = NULL, + .actions = NULL, + }; + bool fatal = false; - int fat; + if (is_t4(adap)) { + fatal |= t4_handle_intr(adap, &sysbus_intr_info, 0, verbose); + fatal |= t4_handle_intr(adap, &pcie_port_intr_info, 0, verbose); - if (is_t4(adapter)) - fat = t4_handle_intr_status(adapter, - A_PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS, - sysbus_intr_info) + - t4_handle_intr_status(adapter, - A_PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS, - pcie_port_intr_info) + - t4_handle_intr_status(adapter, A_PCIE_INT_CAUSE, - pcie_intr_info); - else - fat = t4_handle_intr_status(adapter, A_PCIE_INT_CAUSE, - t5_pcie_intr_info); - if (fat) - t4_fatal_err(adapter); + pcie_intr_info.details = pcie_intr_details; + } else { + pcie_intr_info.details = t5_pcie_intr_details; + } + fatal |= t4_handle_intr(adap, &pcie_intr_info, 0, verbose); + + return (fatal); } /* * TP interrupt handler. */ -static void tp_intr_handler(struct adapter *adapter) +static bool tp_intr_handler(struct adapter *adap, int arg, bool verbose) { - static const struct intr_info tp_intr_info[] = { - { 0x3fffffff, "TP parity error", -1, 1 }, - { F_FLMTXFLSTEMPTY, "TP out of Tx pages", -1, 1 }, + static const struct intr_details tp_intr_details[] = { + { 0x3fffffff, "TP parity error" }, + { F_FLMTXFLSTEMPTY, "TP out of Tx pages" }, { 0 } }; + static const struct intr_info tp_intr_info = { + .name = "TP_INT_CAUSE", + .cause_reg = A_TP_INT_CAUSE, + .enable_reg = A_TP_INT_ENABLE, + .fatal = 0x7fffffff, + .flags = NONFATAL_IF_DISABLED, + .details = tp_intr_details, + .actions = NULL, + }; - if (t4_handle_intr_status(adapter, A_TP_INT_CAUSE, tp_intr_info)) - t4_fatal_err(adapter); + return (t4_handle_intr(adap, &tp_intr_info, 0, verbose)); } /* * SGE interrupt handler. */ -static void sge_intr_handler(struct adapter *adapter) +static bool sge_intr_handler(struct adapter *adap, int arg, bool verbose) { - u64 v; - u32 err; - - static const struct intr_info sge_intr_info[] = { + static const struct intr_info sge_int1_info = { + .name = "SGE_INT_CAUSE1", + .cause_reg = A_SGE_INT_CAUSE1, + .enable_reg = A_SGE_INT_ENABLE1, + .fatal = 0xffffffff, + .flags = NONFATAL_IF_DISABLED, + .details = NULL, + .actions = NULL, + }; + static const struct intr_info sge_int2_info = { + .name = "SGE_INT_CAUSE2", + .cause_reg = A_SGE_INT_CAUSE2, + .enable_reg = A_SGE_INT_ENABLE2, + .fatal = 0xffffffff, + .flags = NONFATAL_IF_DISABLED, + .details = NULL, + .actions = NULL, + }; + static const struct intr_details sge_int3_details[] = { + { F_ERR_FLM_DBP, + "DBP pointer delivery for invalid context or QID" }, + { F_ERR_FLM_IDMA1 | F_ERR_FLM_IDMA0, + "Invalid QID or header request by IDMA" }, + { F_ERR_FLM_HINT, "FLM hint is for invalid context or QID" }, + { F_ERR_PCIE_ERROR3, "SGE PCIe error for DBP thread 3" }, + { F_ERR_PCIE_ERROR2, "SGE PCIe error for DBP thread 2" }, + { F_ERR_PCIE_ERROR1, "SGE PCIe error for DBP thread 1" }, + { F_ERR_PCIE_ERROR0, "SGE PCIe error for DBP thread 0" }, + { F_ERR_TIMER_ABOVE_MAX_QID, + "SGE GTS with timer 0-5 for IQID > 1023" }, { F_ERR_CPL_EXCEED_IQE_SIZE, - "SGE received CPL exceeding IQE size", -1, 1 }, - { F_ERR_INVALID_CIDX_INC, - "SGE GTS CIDX increment too large", -1, 0 }, - { F_ERR_CPL_OPCODE_0, "SGE received 0-length CPL", -1, 0 }, - { F_DBFIFO_LP_INT, NULL, -1, 0, t4_db_full }, + "SGE received CPL exceeding IQE size" }, + { F_ERR_INVALID_CIDX_INC, "SGE GTS CIDX increment too large" }, + { F_ERR_ITP_TIME_PAUSED, "SGE ITP error" }, + { F_ERR_CPL_OPCODE_0, "SGE received 0-length CPL" }, + { F_ERR_DROPPED_DB, "SGE DB dropped" }, { F_ERR_DATA_CPL_ON_HIGH_QID1 | F_ERR_DATA_CPL_ON_HIGH_QID0, - "SGE IQID > 1023 received CPL for FL", -1, 0 }, - { F_ERR_BAD_DB_PIDX3, "SGE DBP 3 pidx increment too large", -1, - 0 }, - { F_ERR_BAD_DB_PIDX2, "SGE DBP 2 pidx increment too large", -1, - 0 }, - { F_ERR_BAD_DB_PIDX1, "SGE DBP 1 pidx increment too large", -1, - 0 }, - { F_ERR_BAD_DB_PIDX0, "SGE DBP 0 pidx increment too large", -1, - 0 }, + "SGE IQID > 1023 received CPL for FL" }, + { F_ERR_BAD_DB_PIDX3 | F_ERR_BAD_DB_PIDX2 | F_ERR_BAD_DB_PIDX1 | + F_ERR_BAD_DB_PIDX0, "SGE DBP pidx increment too large" }, + { F_ERR_ING_PCIE_CHAN, "SGE Ingress PCIe channel mismatch" }, { F_ERR_ING_CTXT_PRIO, - "SGE too many priority ingress contexts", -1, 0 }, - { F_INGRESS_SIZE_ERR, "SGE illegal ingress QID", -1, 0 }, - { F_EGRESS_SIZE_ERR, "SGE illegal egress QID", -1, 0 }, - { F_ERR_PCIE_ERROR0 | F_ERR_PCIE_ERROR1 | - F_ERR_PCIE_ERROR2 | F_ERR_PCIE_ERROR3, - "SGE PCIe error for a DBP thread", -1, 0 }, - { 0 } - }; - - static const struct intr_info t4t5_sge_intr_info[] = { - { F_ERR_DROPPED_DB, NULL, -1, 0, t4_db_dropped }, - { F_DBFIFO_HP_INT, NULL, -1, 0, t4_db_full }, + "Ingress context manager priority user error" }, { F_ERR_EGR_CTXT_PRIO, - "SGE too many priority egress contexts", -1, 0 }, + "Egress context manager priority user error" }, + { F_DBFIFO_HP_INT, "High priority DB FIFO threshold reached" }, + { F_DBFIFO_LP_INT, "Low priority DB FIFO threshold reached" }, + { F_REG_ADDRESS_ERR, "Undefined SGE register accessed" }, + { F_INGRESS_SIZE_ERR, "SGE illegal ingress QID" }, + { F_EGRESS_SIZE_ERR, "SGE illegal egress QID" }, + { 0x0000000f, "SGE context access for invalid queue" }, { 0 } }; - - /* - * For now, treat below interrupts as fatal so that we disable SGE and - * get better debug */ - static const struct intr_info t6_sge_intr_info[] = { + static const struct intr_details t6_sge_int3_details[] = { + { F_ERR_FLM_DBP, + "DBP pointer delivery for invalid context or QID" }, + { F_ERR_FLM_IDMA1 | F_ERR_FLM_IDMA0, + "Invalid QID or header request by IDMA" }, + { F_ERR_FLM_HINT, "FLM hint is for invalid context or QID" }, + { F_ERR_PCIE_ERROR3, "SGE PCIe error for DBP thread 3" }, + { F_ERR_PCIE_ERROR2, "SGE PCIe error for DBP thread 2" }, + { F_ERR_PCIE_ERROR1, "SGE PCIe error for DBP thread 1" }, + { F_ERR_PCIE_ERROR0, "SGE PCIe error for DBP thread 0" }, + { F_ERR_TIMER_ABOVE_MAX_QID, + "SGE GTS with timer 0-5 for IQID > 1023" }, + { F_ERR_CPL_EXCEED_IQE_SIZE, + "SGE received CPL exceeding IQE size" }, + { F_ERR_INVALID_CIDX_INC, "SGE GTS CIDX increment too large" }, + { F_ERR_ITP_TIME_PAUSED, "SGE ITP error" }, + { F_ERR_CPL_OPCODE_0, "SGE received 0-length CPL" }, + { F_ERR_DROPPED_DB, "SGE DB dropped" }, + { F_ERR_DATA_CPL_ON_HIGH_QID1 | F_ERR_DATA_CPL_ON_HIGH_QID0, + "SGE IQID > 1023 received CPL for FL" }, + { F_ERR_BAD_DB_PIDX3 | F_ERR_BAD_DB_PIDX2 | F_ERR_BAD_DB_PIDX1 | + F_ERR_BAD_DB_PIDX0, "SGE DBP pidx increment too large" }, + { F_ERR_ING_PCIE_CHAN, "SGE Ingress PCIe channel mismatch" }, + { F_ERR_ING_CTXT_PRIO, + "Ingress context manager priority user error" }, + { F_ERR_EGR_CTXT_PRIO, + "Egress context manager priority user error" }, + { F_DBP_TBUF_FULL, "SGE DBP tbuf full" }, { F_FATAL_WRE_LEN, - "SGE Actual WRE packet is less than advertized length", - -1, 1 }, + "SGE WRE packet less than advertized length" }, + { F_REG_ADDRESS_ERR, "Undefined SGE register accessed" }, + { F_INGRESS_SIZE_ERR, "SGE illegal ingress QID" }, + { F_EGRESS_SIZE_ERR, "SGE illegal egress QID" }, + { 0x0000000f, "SGE context access for invalid queue" }, { 0 } }; + struct intr_info sge_int3_info = { + .name = "SGE_INT_CAUSE3", + .cause_reg = A_SGE_INT_CAUSE3, + .enable_reg = A_SGE_INT_ENABLE3, + .fatal = F_ERR_CPL_EXCEED_IQE_SIZE, + .flags = 0, + .details = NULL, + .actions = NULL, + }; + static const struct intr_info sge_int4_info = { + .name = "SGE_INT_CAUSE4", + .cause_reg = A_SGE_INT_CAUSE4, + .enable_reg = A_SGE_INT_ENABLE4, + .fatal = 0, + .flags = 0, + .details = NULL, + .actions = NULL, + }; + static const struct intr_info sge_int5_info = { + .name = "SGE_INT_CAUSE5", + .cause_reg = A_SGE_INT_CAUSE5, + .enable_reg = A_SGE_INT_ENABLE5, + .fatal = 0xffffffff, + .flags = NONFATAL_IF_DISABLED, + .details = NULL, + .actions = NULL, + }; + static const struct intr_info sge_int6_info = { + .name = "SGE_INT_CAUSE6", + .cause_reg = A_SGE_INT_CAUSE6, + .enable_reg = A_SGE_INT_ENABLE6, + .fatal = 0, + .flags = 0, + .details = NULL, + .actions = NULL, + }; - v = (u64)t4_read_reg(adapter, A_SGE_INT_CAUSE1) | - ((u64)t4_read_reg(adapter, A_SGE_INT_CAUSE2) << 32); - if (v) { - CH_ALERT(adapter, "SGE parity error (%#llx)\n", - (unsigned long long)v); - t4_write_reg(adapter, A_SGE_INT_CAUSE1, v); - t4_write_reg(adapter, A_SGE_INT_CAUSE2, v >> 32); + bool fatal; + u32 v; + + if (chip_id(adap) <= CHELSIO_T5) { + sge_int3_info.details = sge_int3_details; + } else { + sge_int3_info.details = t6_sge_int3_details; } - v |= t4_handle_intr_status(adapter, A_SGE_INT_CAUSE3, sge_intr_info); - if (chip_id(adapter) <= CHELSIO_T5) - v |= t4_handle_intr_status(adapter, A_SGE_INT_CAUSE3, - t4t5_sge_intr_info); - else - v |= t4_handle_intr_status(adapter, A_SGE_INT_CAUSE3, - t6_sge_intr_info); + fatal = false; + fatal |= t4_handle_intr(adap, &sge_int1_info, 0, verbose); + fatal |= t4_handle_intr(adap, &sge_int2_info, 0, verbose); + fatal |= t4_handle_intr(adap, &sge_int3_info, 0, verbose); + fatal |= t4_handle_intr(adap, &sge_int4_info, 0, verbose); + if (chip_id(adap) >= CHELSIO_T5) + fatal |= t4_handle_intr(adap, &sge_int5_info, 0, verbose); + if (chip_id(adap) >= CHELSIO_T6) + fatal |= t4_handle_intr(adap, &sge_int6_info, 0, verbose); - err = t4_read_reg(adapter, A_SGE_ERROR_STATS); - if (err & F_ERROR_QID_VALID) { - CH_ERR(adapter, "SGE error for queue %u\n", G_ERROR_QID(err)); - if (err & F_UNCAPTURED_ERROR) - CH_ERR(adapter, "SGE UNCAPTURED_ERROR set (clearing)\n"); - t4_write_reg(adapter, A_SGE_ERROR_STATS, F_ERROR_QID_VALID | - F_UNCAPTURED_ERROR); + v = t4_read_reg(adap, A_SGE_ERROR_STATS); + if (v & F_ERROR_QID_VALID) { + CH_ERR(adap, "SGE error for QID %u\n", G_ERROR_QID(v)); + if (v & F_UNCAPTURED_ERROR) + CH_ERR(adap, "SGE UNCAPTURED_ERROR set (clearing)\n"); + t4_write_reg(adap, A_SGE_ERROR_STATS, + F_ERROR_QID_VALID | F_UNCAPTURED_ERROR); } - if (v != 0) - t4_fatal_err(adapter); + return (fatal); } -#define CIM_OBQ_INTR (F_OBQULP0PARERR | F_OBQULP1PARERR | F_OBQULP2PARERR |\ - F_OBQULP3PARERR | F_OBQSGEPARERR | F_OBQNCSIPARERR) -#define CIM_IBQ_INTR (F_IBQTP0PARERR | F_IBQTP1PARERR | F_IBQULPPARERR |\ - F_IBQSGEHIPARERR | F_IBQSGELOPARERR | F_IBQNCSIPARERR) - /* * CIM interrupt handler. */ -static void cim_intr_handler(struct adapter *adapter) +static bool cim_intr_handler(struct adapter *adap, int arg, bool verbose) { - static const struct intr_info cim_intr_info[] = { - { F_PREFDROPINT, "CIM control register prefetch drop", -1, 1 }, - { CIM_OBQ_INTR, "CIM OBQ parity error", -1, 1 }, - { CIM_IBQ_INTR, "CIM IBQ parity error", -1, 1 }, - { F_MBUPPARERR, "CIM mailbox uP parity error", -1, 1 }, - { F_MBHOSTPARERR, "CIM mailbox host parity error", -1, 1 }, - { F_TIEQINPARERRINT, "CIM TIEQ outgoing parity error", -1, 1 }, - { F_TIEQOUTPARERRINT, "CIM TIEQ incoming parity error", -1, 1 }, - { F_TIMER0INT, "CIM TIMER0 interrupt", -1, 1 }, - { 0 } + static const struct intr_action cim_host_intr_actions[] = { + { F_TIMER0INT, 0, t4_os_dump_cimla }, + { 0 }, }; - static const struct intr_info cim_upintr_info[] = { - { F_RSVDSPACEINT, "CIM reserved space access", -1, 1 }, - { F_ILLTRANSINT, "CIM illegal transaction", -1, 1 }, - { F_ILLWRINT, "CIM illegal write", -1, 1 }, - { F_ILLRDINT, "CIM illegal read", -1, 1 }, - { F_ILLRDBEINT, "CIM illegal read BE", -1, 1 }, - { F_ILLWRBEINT, "CIM illegal write BE", -1, 1 }, - { F_SGLRDBOOTINT, "CIM single read from boot space", -1, 1 }, - { F_SGLWRBOOTINT, "CIM single write to boot space", -1, 1 }, - { F_BLKWRBOOTINT, "CIM block write to boot space", -1, 1 }, - { F_SGLRDFLASHINT, "CIM single read from flash space", -1, 1 }, - { F_SGLWRFLASHINT, "CIM single write to flash space", -1, 1 }, - { F_BLKWRFLASHINT, "CIM block write to flash space", -1, 1 }, - { F_SGLRDEEPROMINT, "CIM single EEPROM read", -1, 1 }, - { F_SGLWREEPROMINT, "CIM single EEPROM write", -1, 1 }, - { F_BLKRDEEPROMINT, "CIM block EEPROM read", -1, 1 }, - { F_BLKWREEPROMINT, "CIM block EEPROM write", -1, 1 }, - { F_SGLRDCTLINT , "CIM single read from CTL space", -1, 1 }, - { F_SGLWRCTLINT , "CIM single write to CTL space", -1, 1 }, - { F_BLKRDCTLINT , "CIM block read from CTL space", -1, 1 }, - { F_BLKWRCTLINT , "CIM block write to CTL space", -1, 1 }, - { F_SGLRDPLINT , "CIM single read from PL space", -1, 1 }, - { F_SGLWRPLINT , "CIM single write to PL space", -1, 1 }, - { F_BLKRDPLINT , "CIM block read from PL space", -1, 1 }, - { F_BLKWRPLINT , "CIM block write to PL space", -1, 1 }, - { F_REQOVRLOOKUPINT , "CIM request FIFO overwrite", -1, 1 }, - { F_RSPOVRLOOKUPINT , "CIM response FIFO overwrite", -1, 1 }, - { F_TIMEOUTINT , "CIM PIF timeout", -1, 1 }, - { F_TIMEOUTMAINT , "CIM PIF MA timeout", -1, 1 }, - { 0 } + static const struct intr_details cim_host_intr_details[] = { + /* T6+ */ + { F_PCIE2CIMINTFPARERR, "CIM IBQ PCIe interface parity error" }, + + /* T5+ */ + { F_MA_CIM_INTFPERR, "MA2CIM interface parity error" }, + { F_PLCIM_MSTRSPDATAPARERR, + "PL2CIM master response data parity error" }, + { F_NCSI2CIMINTFPARERR, "CIM IBQ NC-SI interface parity error" }, + { F_SGE2CIMINTFPARERR, "CIM IBQ SGE interface parity error" }, + { F_ULP2CIMINTFPARERR, "CIM IBQ ULP_TX interface parity error" }, + { F_TP2CIMINTFPARERR, "CIM IBQ TP interface parity error" }, + { F_OBQSGERX1PARERR, "CIM OBQ SGE1_RX parity error" }, + { F_OBQSGERX0PARERR, "CIM OBQ SGE0_RX parity error" }, + + /* T4+ */ + { F_TIEQOUTPARERRINT, "CIM TIEQ outgoing FIFO parity error" }, + { F_TIEQINPARERRINT, "CIM TIEQ incoming FIFO parity error" }, + { F_MBHOSTPARERR, "CIM mailbox host read parity error" }, + { F_MBUPPARERR, "CIM mailbox uP parity error" }, + { F_IBQTP0PARERR, "CIM IBQ TP0 parity error" }, + { F_IBQTP1PARERR, "CIM IBQ TP1 parity error" }, + { F_IBQULPPARERR, "CIM IBQ ULP parity error" }, + { F_IBQSGELOPARERR, "CIM IBQ SGE_LO parity error" }, + { F_IBQSGEHIPARERR | F_IBQPCIEPARERR, /* same bit */ + "CIM IBQ PCIe/SGE_HI parity error" }, + { F_IBQNCSIPARERR, "CIM IBQ NC-SI parity error" }, + { F_OBQULP0PARERR, "CIM OBQ ULP0 parity error" }, + { F_OBQULP1PARERR, "CIM OBQ ULP1 parity error" }, + { F_OBQULP2PARERR, "CIM OBQ ULP2 parity error" }, + { F_OBQULP3PARERR, "CIM OBQ ULP3 parity error" }, + { F_OBQSGEPARERR, "CIM OBQ SGE parity error" }, + { F_OBQNCSIPARERR, "CIM OBQ NC-SI parity error" }, + { F_TIMER1INT, "CIM TIMER0 interrupt" }, + { F_TIMER0INT, "CIM TIMER0 interrupt" }, + { F_PREFDROPINT, "CIM control register prefetch drop" }, + { 0} }; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Apr 30 16:52:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BB001597CCD; Tue, 30 Apr 2019 16:52:52 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 021A183453; Tue, 30 Apr 2019 16:52:52 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDE5CC9CF; Tue, 30 Apr 2019 16:52:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UGqpmg057756; Tue, 30 Apr 2019 16:52:51 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UGqpBP057753; Tue, 30 Apr 2019 16:52:51 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904301652.x3UGqpBP057753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Apr 2019 16:52:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346964 - in stable/11/sys/dev/cxgbe: . common X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 346964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 021A183453 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 16:52:52 -0000 Author: np Date: Tue Apr 30 16:52:50 2019 New Revision: 346964 URL: https://svnweb.freebsd.org/changeset/base/346964 Log: MFC r343889, r344519, r344682, r344719 r343889: cxgbev(4): Initialize debug_flags from the environment like in the PF driver. r344519: cxgbe(4): Use correct port_info in the call to is_bt(). This fixes a panic during configuration if the tx channel of a port isn't the same as its port id. Reported by: Fabrice Bruel Sponsored by: Chelsio Communications r344682: cxgbe(4): Don't forget to report link state to the kernel if the link is already up at attach. Reported by: Fabrice Bruel @ Orange Business Service Sponsored by: Chelsio Communications r344719: cxgbev(4): Enable 32b port capabilities in the VF driver. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/cxgbe/t4_vf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/11/sys/dev/cxgbe/common/t4_hw.c Tue Apr 30 16:41:27 2019 (r346963) +++ stable/11/sys/dev/cxgbe/common/t4_hw.c Tue Apr 30 16:52:50 2019 (r346964) @@ -3892,7 +3892,7 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m speed = fwcap_top_speed(lc->supported); /* Force AN on for BT cards. */ - if (is_bt(adap->port[port])) + if (is_bt(adap->port[adap->chan_map[port]])) aneg = lc->supported & FW_PORT_CAP32_ANEG; rcap = aneg | speed | fc | fec; Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Tue Apr 30 16:41:27 2019 (r346963) +++ stable/11/sys/dev/cxgbe/t4_main.c Tue Apr 30 16:52:50 2019 (r346964) @@ -5002,6 +5002,8 @@ cxgbe_init_synchronized(struct vi_info *vi) callout_reset(&vi->tick, hz, vi_tick, vi); else callout_reset(&pi->tick, hz, cxgbe_tick, pi); + if (pi->link_cfg.link_ok) + t4_os_link_changed(pi); PORT_UNLOCK(pi); done: if (rc != 0) Modified: stable/11/sys/dev/cxgbe/t4_vf.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_vf.c Tue Apr 30 16:41:27 2019 (r346963) +++ stable/11/sys/dev/cxgbe/t4_vf.c Tue Apr 30 16:52:50 2019 (r346964) @@ -295,6 +295,12 @@ set_params__post_init(struct adapter *sc) val = 1; (void)t4vf_set_params(sc, 1, ¶m, &val); + /* Enable 32b port caps if the firmware supports it. */ + param = FW_PARAM_PFVF(PORT_CAPS32); + val = 1; + if (t4vf_set_params(sc, 1, ¶m, &val) == 0) + sc->params.port_caps32 = 1; + return (0); } @@ -479,6 +485,7 @@ t4vf_attach(device_t dev) sc->params.pci.mps = pci_get_max_payload(dev); sc->flags |= IS_VF; + TUNABLE_INT_FETCH("hw.cxgbe.dflags", &sc->debug_flags); sc->sge_gts_reg = VF_SGE_REG(A_SGE_VF_GTS); sc->sge_kdoorbell_reg = VF_SGE_REG(A_SGE_VF_KDOORBELL); From owner-svn-src-all@freebsd.org Tue Apr 30 17:18:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 560A71598412; Tue, 30 Apr 2019 17:18:07 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F061C84152; Tue, 30 Apr 2019 17:18:06 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9836CD59; Tue, 30 Apr 2019 17:18:06 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UHI67O068403; Tue, 30 Apr 2019 17:18:06 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UHI60P068400; Tue, 30 Apr 2019 17:18:06 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904301718.x3UHI60P068400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Tue, 30 Apr 2019 17:18:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346965 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 346965 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F061C84152 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 17:18:07 -0000 Author: dchagin Date: Tue Apr 30 17:18:05 2019 New Revision: 346965 URL: https://svnweb.freebsd.org/changeset/base/346965 Log: Follow the FreeBSD and implement PDEATH_SIG prctl ops in the Linuxulator. It was first introduced in r163734 and missied by me in r283383. MFC after: 1 week Modified: head/sys/compat/linux/linux_emul.c head/sys/compat/linux/linux_emul.h head/sys/compat/linux/linux_misc.c Modified: head/sys/compat/linux/linux_emul.c ============================================================================== --- head/sys/compat/linux/linux_emul.c Tue Apr 30 16:52:50 2019 (r346964) +++ head/sys/compat/linux/linux_emul.c Tue Apr 30 17:18:05 2019 (r346965) @@ -127,7 +127,6 @@ linux_proc_init(struct thread *td, struct thread *newt em->em_tid = p->p_pid; em->flags = 0; - em->pdeath_signal = 0; em->robust_futexes = NULL; em->child_clear_tid = NULL; em->child_set_tid = NULL; Modified: head/sys/compat/linux/linux_emul.h ============================================================================== --- head/sys/compat/linux/linux_emul.h Tue Apr 30 16:52:50 2019 (r346964) +++ head/sys/compat/linux/linux_emul.h Tue Apr 30 17:18:05 2019 (r346965) @@ -40,7 +40,6 @@ struct linux_emuldata { int *child_set_tid; /* in clone(): Child's TID to set on clone */ int *child_clear_tid;/* in clone(): Child's TID to clear on exit */ - int pdeath_signal; /* parent death signal */ int flags; /* thread emuldata flags */ int em_tid; /* thread id */ Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Tue Apr 30 16:52:50 2019 (r346964) +++ head/sys/compat/linux/linux_misc.c Tue Apr 30 17:18:05 2019 (r346965) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1993,7 +1994,6 @@ linux_prctl(struct thread *td, struct linux_prctl_args int error = 0, max_size; struct proc *p = td->td_proc; char comm[LINUX_MAX_COMM_LEN]; - struct linux_emuldata *em; int pdeath_signal; #ifdef DEBUG @@ -2007,17 +2007,18 @@ linux_prctl(struct thread *td, struct linux_prctl_args case LINUX_PR_SET_PDEATHSIG: if (!LINUX_SIG_VALID(args->arg2)) return (EINVAL); - em = em_find(td); - KASSERT(em != NULL, ("prctl: emuldata not found.\n")); - em->pdeath_signal = args->arg2; - break; + pdeath_signal = linux_to_bsd_signal(args->arg2); + return (kern_procctl(td, P_PID, 0, PROC_PDEATHSIG_CTL, + &pdeath_signal)); case LINUX_PR_GET_PDEATHSIG: - em = em_find(td); - KASSERT(em != NULL, ("prctl: emuldata not found.\n")); - pdeath_signal = em->pdeath_signal; - error = copyout(&pdeath_signal, + error = kern_procctl(td, P_PID, 0, PROC_PDEATHSIG_STATUS, + &pdeath_signal); + if (error != 0) + return (error); + pdeath_signal = bsd_to_linux_signal(pdeath_signal); + return (copyout(&pdeath_signal, (void *)(register_t)args->arg2, - sizeof(pdeath_signal)); + sizeof(pdeath_signal))); break; case LINUX_PR_GET_KEEPCAPS: /* From owner-svn-src-all@freebsd.org Tue Apr 30 17:20:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F44A15984FB; Tue, 30 Apr 2019 17:20:40 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9DD9843C8; Tue, 30 Apr 2019 17:20:39 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 797CFCD63; Tue, 30 Apr 2019 17:20:39 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UHKda0068703; Tue, 30 Apr 2019 17:20:39 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UHKdgm068702; Tue, 30 Apr 2019 17:20:39 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904301720.x3UHKdgm068702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Apr 2019 17:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346966 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 346966 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B9DD9843C8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 17:20:40 -0000 Author: np Date: Tue Apr 30 17:20:38 2019 New Revision: 346966 URL: https://svnweb.freebsd.org/changeset/base/346966 Log: MFC r344654: cxgbe(4): Request high priority filter support explicitly, as required by recent firmwares. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Tue Apr 30 17:18:05 2019 (r346965) +++ stable/11/sys/dev/cxgbe/t4_main.c Tue Apr 30 17:20:38 2019 (r346966) @@ -603,6 +603,7 @@ static int cfg_itype_and_nqueues(struct adapter *, str static int contact_firmware(struct adapter *); static int partition_resources(struct adapter *); static int get_params__pre_init(struct adapter *); +static int set_params__pre_init(struct adapter *); static int get_params__post_init(struct adapter *); static int set_params__post_init(struct adapter *); static void t4_set_desc(struct adapter *); @@ -3914,6 +3915,7 @@ apply_cfg_and_initialize(struct adapter *sc, char *cfg } t4_tweak_chip_settings(sc); + set_params__pre_init(sc); /* get basic stuff going */ rc = -t4_fw_initialize(sc, sc->mbox); @@ -4036,6 +4038,35 @@ get_params__pre_init(struct adapter *sc) } /* + * Any params that need to be set before FW_INITIALIZE. + */ +static int +set_params__pre_init(struct adapter *sc) +{ + int rc = 0; + uint32_t param, val; + + if (chip_id(sc) >= CHELSIO_T6) { + param = FW_PARAM_DEV(HPFILTER_REGION_SUPPORT); + val = 1; + rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, ¶m, &val); + /* firmwares < 1.20.1.0 do not have this param. */ + if (rc == FW_EINVAL && sc->params.fw_vers < + (V_FW_HDR_FW_VER_MAJOR(1) | V_FW_HDR_FW_VER_MINOR(20) | + V_FW_HDR_FW_VER_MICRO(1) | V_FW_HDR_FW_VER_BUILD(0))) { + rc = 0; + } + if (rc != 0) { + device_printf(sc->dev, + "failed to enable high priority filters :%d.\n", + rc); + } + } + + return (rc); +} + +/* * Retrieve various parameters that are of interest to the driver. The device * has been initialized by the firmware at this point. */ @@ -4077,20 +4108,6 @@ get_params__post_init(struct adapter *sc) sc->params.core_vdd = val[6]; if (chip_id(sc) >= CHELSIO_T6) { - -#ifdef INVARIANTS - if (sc->params.fw_vers >= - (V_FW_HDR_FW_VER_MAJOR(1) | V_FW_HDR_FW_VER_MINOR(20) | - V_FW_HDR_FW_VER_MICRO(1) | V_FW_HDR_FW_VER_BUILD(0))) { - /* - * Note that the code to enable the region should run - * before t4_fw_initialize and not here. This is just a - * reminder to add said code. - */ - device_printf(sc->dev, - "hpfilter region not enabled.\n"); - } -#endif sc->tids.tid_base = t4_read_reg(sc, A_LE_DB_ACTIVE_TABLE_START_INDEX); From owner-svn-src-all@freebsd.org Tue Apr 30 17:30:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C31DB15989F7; Tue, 30 Apr 2019 17:30:39 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7674A84A78; Tue, 30 Apr 2019 17:30:39 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ED97CF0A; Tue, 30 Apr 2019 17:30:39 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UHUdAZ074372; Tue, 30 Apr 2019 17:30:39 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UHUb2Q074363; Tue, 30 Apr 2019 17:30:37 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904301730.x3UHUb2Q074363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Apr 2019 17:30:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346967 - in stable/11/sys/dev/cxgbe: . common firmware tom X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys/dev/cxgbe: . common firmware tom X-SVN-Commit-Revision: 346967 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7674A84A78 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 17:30:40 -0000 Author: np Date: Tue Apr 30 17:30:37 2019 New Revision: 346967 URL: https://svnweb.freebsd.org/changeset/base/346967 Log: MFC r345334: cxgbe(4): Treat the viid as an opaque identifier. Recent firmwares prefer to use a different format for viid internally and this change allows them to do so. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/common/common.h stable/11/sys/dev/cxgbe/common/t4_hw.c stable/11/sys/dev/cxgbe/firmware/t4fw_interface.h stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/cxgbe/t4_sge.c stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c stable/11/sys/dev/cxgbe/tom/t4_listen.c stable/11/sys/dev/cxgbe/tom/t4_tom.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Tue Apr 30 17:20:38 2019 (r346966) +++ stable/11/sys/dev/cxgbe/adapter.h Tue Apr 30 17:30:37 2019 (r346967) @@ -192,8 +192,10 @@ struct vi_info { int if_flags; uint16_t *rss, *nm_rss; - int smt_idx; /* for convenience */ - uint16_t viid; + uint16_t viid; /* opaque VI identifier */ + uint16_t smt_idx; + uint16_t vin; + uint8_t vfvld; int16_t xact_addr_filt;/* index of exact MAC address filter */ uint16_t rss_size; /* size of VI's RSS table slice */ uint16_t rss_base; /* start of VI's RSS table slice */ Modified: stable/11/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/11/sys/dev/cxgbe/common/common.h Tue Apr 30 17:20:38 2019 (r346966) +++ stable/11/sys/dev/cxgbe/common/common.h Tue Apr 30 17:30:37 2019 (r346967) @@ -373,8 +373,9 @@ struct adapter_params { uint32_t mps_bg_map; /* rx buffer group map for all ports (upto 4) */ - bool ulptx_memwrite_dsgl; /* use of T5 DSGL allowed */ - bool fr_nsmr_tpte_wr_support; /* FW support for FR_NSMR_TPTE_WR */ + bool ulptx_memwrite_dsgl; /* use of T5 DSGL allowed */ + bool fr_nsmr_tpte_wr_support; /* FW support for FR_NSMR_TPTE_WR */ + bool viid_smt_extn_support; /* FW returns vin, vfvld & smt index? */ }; #define CHELSIO_T4 0x4 @@ -754,10 +755,11 @@ int t4_cfg_pfvf(struct adapter *adap, unsigned int mbo int t4_alloc_vi_func(struct adapter *adap, unsigned int mbox, unsigned int port, unsigned int pf, unsigned int vf, unsigned int nmac, u8 *mac, u16 *rss_size, + uint8_t *vfvld, uint16_t *vin, unsigned int portfunc, unsigned int idstype); int t4_alloc_vi(struct adapter *adap, unsigned int mbox, unsigned int port, unsigned int pf, unsigned int vf, unsigned int nmac, u8 *mac, - u16 *rss_size); + u16 *rss_size, uint8_t *vfvld, uint16_t *vin); int t4_free_vi(struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int viid); @@ -768,7 +770,7 @@ int t4_alloc_mac_filt(struct adapter *adap, unsigned i bool free, unsigned int naddr, const u8 **addr, u16 *idx, u64 *hash, bool sleep_ok); int t4_change_mac(struct adapter *adap, unsigned int mbox, unsigned int viid, - int idx, const u8 *addr, bool persist, bool add_smt); + int idx, const u8 *addr, bool persist, uint16_t *smt_idx); int t4_set_addr_hash(struct adapter *adap, unsigned int mbox, unsigned int viid, bool ucast, u64 vec, bool sleep_ok); int t4_enable_vi_params(struct adapter *adap, unsigned int mbox, Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/11/sys/dev/cxgbe/common/t4_hw.c Tue Apr 30 17:20:38 2019 (r346966) +++ stable/11/sys/dev/cxgbe/common/t4_hw.c Tue Apr 30 17:30:37 2019 (r346967) @@ -7827,6 +7827,7 @@ int t4_cfg_pfvf(struct adapter *adap, unsigned int mbo int t4_alloc_vi_func(struct adapter *adap, unsigned int mbox, unsigned int port, unsigned int pf, unsigned int vf, unsigned int nmac, u8 *mac, u16 *rss_size, + uint8_t *vfvld, uint16_t *vin, unsigned int portfunc, unsigned int idstype) { int ret; @@ -7847,6 +7848,7 @@ int t4_alloc_vi_func(struct adapter *adap, unsigned in ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); if (ret) return ret; + ret = G_FW_VI_CMD_VIID(be16_to_cpu(c.type_to_viid)); if (mac) { memcpy(mac, c.mac, sizeof(c.mac)); @@ -7863,7 +7865,18 @@ int t4_alloc_vi_func(struct adapter *adap, unsigned in } if (rss_size) *rss_size = G_FW_VI_CMD_RSSSIZE(be16_to_cpu(c.norss_rsssize)); - return G_FW_VI_CMD_VIID(be16_to_cpu(c.type_to_viid)); + if (vfvld) { + *vfvld = adap->params.viid_smt_extn_support ? + G_FW_VI_CMD_VFVLD(be32_to_cpu(c.alloc_to_len16)) : + G_FW_VIID_VIVLD(ret); + } + if (vin) { + *vin = adap->params.viid_smt_extn_support ? + G_FW_VI_CMD_VIN(be32_to_cpu(c.alloc_to_len16)) : + G_FW_VIID_VIN(ret); + } + + return ret; } /** @@ -7883,10 +7896,10 @@ int t4_alloc_vi_func(struct adapter *adap, unsigned in */ int t4_alloc_vi(struct adapter *adap, unsigned int mbox, unsigned int port, unsigned int pf, unsigned int vf, unsigned int nmac, u8 *mac, - u16 *rss_size) + u16 *rss_size, uint8_t *vfvld, uint16_t *vin) { return t4_alloc_vi_func(adap, mbox, port, pf, vf, nmac, mac, rss_size, - FW_VI_FUNC_ETH, 0); + vfvld, vin, FW_VI_FUNC_ETH, 0); } /** @@ -8063,7 +8076,7 @@ int t4_alloc_mac_filt(struct adapter *adap, unsigned i * @idx: index of existing filter for old value of MAC address, or -1 * @addr: the new MAC address value * @persist: whether a new MAC allocation should be persistent - * @add_smt: if true also add the address to the HW SMT + * @smt_idx: add MAC to SMT and return its index, or NULL * * Modifies an exact-match filter and sets it to the new MAC address if * @idx >= 0, or adds the MAC address to a new filter if @idx < 0. In the @@ -8078,7 +8091,7 @@ int t4_alloc_mac_filt(struct adapter *adap, unsigned i * MAC value. Note that this index may differ from @idx. */ int t4_change_mac(struct adapter *adap, unsigned int mbox, unsigned int viid, - int idx, const u8 *addr, bool persist, bool add_smt) + int idx, const u8 *addr, bool persist, uint16_t *smt_idx) { int ret, mode; struct fw_vi_mac_cmd c; @@ -8087,7 +8100,7 @@ int t4_change_mac(struct adapter *adap, unsigned int m if (idx < 0) /* new allocation */ idx = persist ? FW_VI_MAC_ADD_PERSIST_MAC : FW_VI_MAC_ADD_MAC; - mode = add_smt ? FW_VI_MAC_SMT_AND_MPSTCAM : FW_VI_MAC_MPS_TCAM_ENTRY; + mode = smt_idx ? FW_VI_MAC_SMT_AND_MPSTCAM : FW_VI_MAC_MPS_TCAM_ENTRY; memset(&c, 0, sizeof(c)); c.op_to_viid = cpu_to_be32(V_FW_CMD_OP(FW_VI_MAC_CMD) | @@ -8104,6 +8117,16 @@ int t4_change_mac(struct adapter *adap, unsigned int m ret = G_FW_VI_MAC_CMD_IDX(be16_to_cpu(p->valid_to_idx)); if (ret >= max_mac_addr) ret = -ENOMEM; + if (smt_idx) { + if (adap->params.viid_smt_extn_support) + *smt_idx = G_FW_VI_MAC_CMD_SMTID(be32_to_cpu(c.op_to_viid)); + else { + if (chip_id(adap) <= CHELSIO_T5) + *smt_idx = (viid & M_FW_VIID_VIN) << 1; + else + *smt_idx = viid & M_FW_VIID_VIN; + } + } } return ret; } @@ -9364,9 +9387,9 @@ int t4_port_init(struct adapter *adap, int mbox, int p { u8 addr[6]; int ret, i, j; - u16 rss_size; struct port_info *p = adap2pinfo(adap, port_id); u32 param, val; + struct vi_info *vi = &p->vi[0]; for (i = 0, j = -1; i <= p->port_id; i++) { do { @@ -9384,27 +9407,23 @@ int t4_port_init(struct adapter *adap, int mbox, int p t4_update_port_info(p); } - ret = t4_alloc_vi(adap, mbox, j, pf, vf, 1, addr, &rss_size); + ret = t4_alloc_vi(adap, mbox, j, pf, vf, 1, addr, &vi->rss_size, + &vi->vfvld, &vi->vin); if (ret < 0) return ret; - p->vi[0].viid = ret; - if (chip_id(adap) <= CHELSIO_T5) - p->vi[0].smt_idx = (ret & 0x7f) << 1; - else - p->vi[0].smt_idx = (ret & 0x7f); - p->vi[0].rss_size = rss_size; + vi->viid = ret; t4_os_set_hw_addr(p, addr); param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_RSSINFO) | - V_FW_PARAMS_PARAM_YZ(p->vi[0].viid); + V_FW_PARAMS_PARAM_YZ(vi->viid); ret = t4_query_params(adap, mbox, pf, vf, 1, ¶m, &val); if (ret) - p->vi[0].rss_base = 0xffff; + vi->rss_base = 0xffff; else { /* MPASS((val >> 16) == rss_size); */ - p->vi[0].rss_base = val & 0xffff; + vi->rss_base = val & 0xffff; } return 0; Modified: stable/11/sys/dev/cxgbe/firmware/t4fw_interface.h ============================================================================== --- stable/11/sys/dev/cxgbe/firmware/t4fw_interface.h Tue Apr 30 17:20:38 2019 (r346966) +++ stable/11/sys/dev/cxgbe/firmware/t4fw_interface.h Tue Apr 30 17:30:37 2019 (r346967) @@ -4798,6 +4798,7 @@ enum fw_params_param_dev { FW_PARAMS_PARAM_DEV_RI_WRITE_CMPL_WR = 0x24, FW_PARAMS_PARAM_DEV_ADD_SMAC = 0x25, FW_PARAMS_PARAM_DEV_HPFILTER_REGION_SUPPORT = 0x26, + FW_PARAMS_PARAM_DEV_OPAQUE_VIID_SMT_EXTN = 0x27, }; /* @@ -6502,6 +6503,19 @@ struct fw_vi_cmd { (((x) >> S_FW_VI_CMD_FREE) & M_FW_VI_CMD_FREE) #define F_FW_VI_CMD_FREE V_FW_VI_CMD_FREE(1U) +#define S_FW_VI_CMD_VFVLD 24 +#define M_FW_VI_CMD_VFVLD 0x1 +#define V_FW_VI_CMD_VFVLD(x) ((x) << S_FW_VI_CMD_VFVLD) +#define G_FW_VI_CMD_VFVLD(x) \ + (((x) >> S_FW_VI_CMD_VFVLD) & M_FW_VI_CMD_VFVLD) +#define F_FW_VI_CMD_VFVLD V_FW_VI_CMD_VFVLD(1U) + +#define S_FW_VI_CMD_VIN 16 +#define M_FW_VI_CMD_VIN 0xff +#define V_FW_VI_CMD_VIN(x) ((x) << S_FW_VI_CMD_VIN) +#define G_FW_VI_CMD_VIN(x) \ + (((x) >> S_FW_VI_CMD_VIN) & M_FW_VI_CMD_VIN) + #define S_FW_VI_CMD_TYPE 15 #define M_FW_VI_CMD_TYPE 0x1 #define V_FW_VI_CMD_TYPE(x) ((x) << S_FW_VI_CMD_TYPE) @@ -6607,6 +6621,12 @@ struct fw_vi_mac_cmd { } exact_vni[2]; } u; }; + +#define S_FW_VI_MAC_CMD_SMTID 12 +#define M_FW_VI_MAC_CMD_SMTID 0xff +#define V_FW_VI_MAC_CMD_SMTID(x) ((x) << S_FW_VI_MAC_CMD_SMTID) +#define G_FW_VI_MAC_CMD_SMTID(x) \ + (((x) >> S_FW_VI_MAC_CMD_SMTID) & M_FW_VI_MAC_CMD_SMTID) #define S_FW_VI_MAC_CMD_VIID 0 #define M_FW_VI_MAC_CMD_VIID 0xfff Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Tue Apr 30 17:20:38 2019 (r346966) +++ stable/11/sys/dev/cxgbe/t4_main.c Tue Apr 30 17:30:37 2019 (r346967) @@ -2439,17 +2439,13 @@ alloc_extra_vi(struct adapter *sc, struct port_info *p device_get_nameunit(vi->dev))); func = vi_mac_funcs[index]; rc = t4_alloc_vi_func(sc, sc->mbox, pi->tx_chan, sc->pf, 0, 1, - vi->hw_addr, &vi->rss_size, func, 0); + vi->hw_addr, &vi->rss_size, &vi->vfvld, &vi->vin, func, 0); if (rc < 0) { device_printf(vi->dev, "failed to allocate virtual interface %d" "for port %d: %d\n", index, pi->port_id, -rc); return (-rc); } vi->viid = rc; - if (chip_id(sc) <= CHELSIO_T5) - vi->smt_idx = (rc & 0x7f) << 1; - else - vi->smt_idx = (rc & 0x7f); if (vi->rss_size == 1) { /* @@ -4063,6 +4059,15 @@ set_params__pre_init(struct adapter *sc) } } + /* Enable opaque VIIDs with firmwares that support it. */ + param = FW_PARAM_DEV(OPAQUE_VIID_SMT_EXTN); + val = 1; + rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, ¶m, &val); + if (rc == 0 && val == 1) + sc->params.viid_smt_extn_support = true; + else + sc->params.viid_smt_extn_support = false; + return (rc); } @@ -4770,7 +4775,7 @@ update_mac_settings(struct ifnet *ifp, int flags) bcopy(IF_LLADDR(ifp), ucaddr, sizeof(ucaddr)); rc = t4_change_mac(sc, sc->mbox, vi->viid, vi->xact_addr_filt, - ucaddr, true, true); + ucaddr, true, &vi->smt_idx); if (rc < 0) { rc = -rc; if_printf(ifp, "change_mac failed: %d\n", rc); @@ -5689,7 +5694,7 @@ get_regs(struct adapter *sc, struct t4_regdump *regs, #define A_PL_INDIR_DATA 0x1fc static uint64_t -read_vf_stat(struct adapter *sc, unsigned int viid, int reg) +read_vf_stat(struct adapter *sc, u_int vin, int reg) { u32 stats[2]; @@ -5699,8 +5704,7 @@ read_vf_stat(struct adapter *sc, unsigned int viid, in stats[1] = t4_read_reg(sc, VF_MPS_REG(reg + 4)); } else { t4_write_reg(sc, A_PL_INDIR_CMD, V_PL_AUTOINC(1) | - V_PL_VFID(G_FW_VIID_VIN(viid)) | - V_PL_ADDR(VF_MPS_REG(reg))); + V_PL_VFID(vin) | V_PL_ADDR(VF_MPS_REG(reg))); stats[0] = t4_read_reg(sc, A_PL_INDIR_DATA); stats[1] = t4_read_reg(sc, A_PL_INDIR_DATA); } @@ -5708,12 +5712,11 @@ read_vf_stat(struct adapter *sc, unsigned int viid, in } static void -t4_get_vi_stats(struct adapter *sc, unsigned int viid, - struct fw_vi_stats_vf *stats) +t4_get_vi_stats(struct adapter *sc, u_int vin, struct fw_vi_stats_vf *stats) { #define GET_STAT(name) \ - read_vf_stat(sc, viid, A_MPS_VF_STAT_##name##_L) + read_vf_stat(sc, vin, A_MPS_VF_STAT_##name##_L) stats->tx_bcast_bytes = GET_STAT(TX_VF_BCAST_BYTES); stats->tx_bcast_frames = GET_STAT(TX_VF_BCAST_FRAMES); @@ -5736,12 +5739,11 @@ t4_get_vi_stats(struct adapter *sc, unsigned int viid, } static void -t4_clr_vi_stats(struct adapter *sc, unsigned int viid) +t4_clr_vi_stats(struct adapter *sc, u_int vin) { int reg; - t4_write_reg(sc, A_PL_INDIR_CMD, V_PL_AUTOINC(1) | - V_PL_VFID(G_FW_VIID_VIN(viid)) | + t4_write_reg(sc, A_PL_INDIR_CMD, V_PL_AUTOINC(1) | V_PL_VFID(vin) | V_PL_ADDR(VF_MPS_REG(A_MPS_VF_STAT_TX_VF_BCAST_BYTES_L))); for (reg = A_MPS_VF_STAT_TX_VF_BCAST_BYTES_L; reg <= A_MPS_VF_STAT_RX_VF_ERR_FRAMES_H; reg += 4) @@ -5763,7 +5765,7 @@ vi_refresh_stats(struct adapter *sc, struct vi_info *v return; mtx_lock(&sc->reg_lock); - t4_get_vi_stats(sc, vi->viid, &vi->stats); + t4_get_vi_stats(sc, vi->vin, &vi->stats); getmicrotime(&vi->last_refreshed); mtx_unlock(&sc->reg_lock); } @@ -9998,7 +10000,7 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t mtx_lock(&sc->reg_lock); for_each_vi(pi, v, vi) { if (vi->flags & VI_INIT_DONE) - t4_clr_vi_stats(sc, vi->viid); + t4_clr_vi_stats(sc, vi->vin); } bg_map = pi->mps_bg_map; v = 0; /* reuse */ Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Tue Apr 30 17:20:38 2019 (r346966) +++ stable/11/sys/dev/cxgbe/t4_sge.c Tue Apr 30 17:30:37 2019 (r346967) @@ -3388,9 +3388,8 @@ alloc_nm_txq(struct vi_info *vi, struct sge_nm_txq *nm nm_txq->nid = idx; nm_txq->iqidx = iqidx; nm_txq->cpl_ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT) | - V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_PF(G_FW_VIID_PFN(vi->viid)) | - V_TXPKT_VF(G_FW_VIID_VIN(vi->viid)) | - V_TXPKT_VF_VLD(G_FW_VIID_VIVLD(vi->viid))); + V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_PF(sc->pf) | + V_TXPKT_VF(vi->vin) | V_TXPKT_VF_VLD(vi->vfvld)); snprintf(name, sizeof(name), "%d", idx); oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, CTLFLAG_RD, @@ -3785,10 +3784,8 @@ alloc_txq(struct vi_info *vi, struct sge_txq *txq, int V_TXPKT_INTF(pi->tx_chan)); else txq->cpl_ctrl0 = htobe32(V_TXPKT_OPCODE(CPL_TX_PKT) | - V_TXPKT_INTF(pi->tx_chan) | - V_TXPKT_PF(G_FW_VIID_PFN(vi->viid)) | - V_TXPKT_VF(G_FW_VIID_VIN(vi->viid)) | - V_TXPKT_VF_VLD(G_FW_VIID_VIVLD(vi->viid))); + V_TXPKT_INTF(pi->tx_chan) | V_TXPKT_PF(sc->pf) | + V_TXPKT_VF(vi->vin) | V_TXPKT_VF_VLD(vi->vfvld)); txq->tc_idx = -1; txq->sdesc = malloc(eq->sidx * sizeof(struct tx_sdesc), M_CXGBE, M_ZERO | M_WAITOK); Modified: stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Apr 30 17:20:38 2019 (r346966) +++ stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Apr 30 17:30:37 2019 (r346967) @@ -117,7 +117,7 @@ send_flowc_wr(struct toepcb *toep, struct flowc_tx_par struct vi_info *vi = toep->vi; struct port_info *pi = vi->pi; struct adapter *sc = pi->adapter; - unsigned int pfvf = G_FW_VIID_PFN(vi->viid) << S_FW_VIID_PFN; + unsigned int pfvf = sc->pf << S_FW_VIID_PFN; struct ofld_tx_sdesc *txsd = &toep->txsd[toep->txsd_pidx]; KASSERT(!(toep->flags & TPF_FLOWC_WR_SENT), Modified: stable/11/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_listen.c Tue Apr 30 17:20:38 2019 (r346966) +++ stable/11/sys/dev/cxgbe/tom/t4_listen.c Tue Apr 30 17:30:37 2019 (r346967) @@ -360,7 +360,7 @@ send_reset_synqe(struct toedev *tod, struct synq_entry struct sge_wrq *ofld_txq; struct sge_ofld_rxq *ofld_rxq; const int nparams = 6; - unsigned int pfvf = G_FW_VIID_PFN(vi->viid) << S_FW_VIID_PFN; + const u_int pfvf = sc->pf << S_FW_VIID_PFN; INP_WLOCK_ASSERT(synqe->lctx->inp); Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.c Tue Apr 30 17:20:38 2019 (r346966) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.c Tue Apr 30 17:30:37 2019 (r346967) @@ -628,7 +628,6 @@ select_ntuple(struct vi_info *vi, struct l2t_entry *e) { struct adapter *sc = vi->pi->adapter; struct tp_params *tp = &sc->params.tp; - uint16_t viid = vi->viid; uint64_t ntuple = 0; /* @@ -645,12 +644,9 @@ select_ntuple(struct vi_info *vi, struct l2t_entry *e) ntuple |= (uint64_t)IPPROTO_TCP << tp->protocol_shift; if (tp->vnic_shift >= 0 && tp->ingress_config & F_VNIC) { - uint32_t vf = G_FW_VIID_VIN(viid); - uint32_t pf = G_FW_VIID_PFN(viid); - uint32_t vld = G_FW_VIID_VIVLD(viid); - - ntuple |= (uint64_t)(V_FT_VNID_ID_VF(vf) | V_FT_VNID_ID_PF(pf) | - V_FT_VNID_ID_VLD(vld)) << tp->vnic_shift; + ntuple |= (uint64_t)(V_FT_VNID_ID_VF(vi->vin) | + V_FT_VNID_ID_PF(sc->pf) | V_FT_VNID_ID_VLD(vi->vfvld)) << + tp->vnic_shift; } if (is_t4(sc)) From owner-svn-src-all@freebsd.org Tue Apr 30 17:42:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFBCC1598F71; Tue, 30 Apr 2019 17:42:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FB2C852DF; Tue, 30 Apr 2019 17:42:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B104D246; Tue, 30 Apr 2019 17:42:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UHg6pR083917; Tue, 30 Apr 2019 17:42:06 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UHg62b083916; Tue, 30 Apr 2019 17:42:06 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201904301742.x3UHg62b083916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 30 Apr 2019 17:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346968 - head/sbin/reboot X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sbin/reboot X-SVN-Commit-Revision: 346968 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6FB2C852DF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 17:42:07 -0000 Author: ian Date: Tue Apr 30 17:42:05 2019 New Revision: 346968 URL: https://svnweb.freebsd.org/changeset/base/346968 Log: Update the manpage text to show the output generated by the first-stage bootloader these days (x86 instead of i386). Modified: head/sbin/reboot/boot_i386.8 Modified: head/sbin/reboot/boot_i386.8 ============================================================================== --- head/sbin/reboot/boot_i386.8 Tue Apr 30 17:30:37 2019 (r346967) +++ head/sbin/reboot/boot_i386.8 Tue Apr 30 17:42:05 2019 (r346968) @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 15, 2018 +.Dd April 30, 2019 .Dt BOOT 8 i386 .Os .Sh NAME @@ -95,7 +95,7 @@ program is documented separately. After the boot blocks have been loaded, you should see a prompt similar to the following: .Bd -literal ->> FreeBSD/i386 BOOT +>> FreeBSD/x86 BOOT Default: 0:ad(0,a)/boot/loader boot: .Ed From owner-svn-src-all@freebsd.org Tue Apr 30 17:44:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E54C15990BC; Tue, 30 Apr 2019 17:44:43 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f172.google.com (mail-it1-f172.google.com [209.85.166.172]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 9D05A85552; Tue, 30 Apr 2019 17:44:42 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f172.google.com with SMTP id v143so6145211itc.1; Tue, 30 Apr 2019 10:44:42 -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:reply-to :from:date:message-id:subject:to:cc; bh=yoJmsV10x1BRW8nTQUkTBeFHXZa3vBRnpTyYgBZmLrk=; b=BlNk+BednTjPvUJGoj1XKOG38XD93snByL+sx3lXN4vx/IKZopsaAJPIRwOXdBf/qB iJXc1e5H6jln1mqQE8c4J5lbbg2HppdHmDjw+SW01OV3GWUo3ECMPOgSoPap0Dr8bEvH /VBHIohW3myvjq2sHxPjQRE3v98WlfdOJtpsVB01/HhRwZ7Eta2+VnHyq4DZyaYYeCJh TQXXZF2RtJf6NmRk0tO6XAD1J6MBcy4dKL9/+jRuxn3XCV9Xu/EzS60sKl/+ND88Yq6d cb+THhx+x18Zi9yqSKXIPfdSylbpF0zwkpR0yWi1++mRrAJAajYya19mcT1sqkijbr/T Jh9Q== X-Gm-Message-State: APjAAAXNf3bgYj3VWqtsbxp+0MJlo8PE1tPR70Tt7B61iuWg1B3qcbMh I05ZoC4+0dnANs/vvyl5hpytvoLO X-Google-Smtp-Source: APXvYqwNKeeI31N4wCEZbVOnlQDslikl6p574cmgnF2ggqk6Uh1BjN84j4IfK9XfBFSOStiPzsDoNg== X-Received: by 2002:a24:6a8b:: with SMTP id l133mr4626161itc.92.1556646275643; Tue, 30 Apr 2019 10:44:35 -0700 (PDT) Received: from mail-it1-f179.google.com (mail-it1-f179.google.com. [209.85.166.179]) by smtp.gmail.com with ESMTPSA id 1sm1875154ity.9.2019.04.30.10.44.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Apr 2019 10:44:35 -0700 (PDT) Received: by mail-it1-f179.google.com with SMTP id q14so6113470itk.0; Tue, 30 Apr 2019 10:44:35 -0700 (PDT) X-Received: by 2002:a05:660c:130f:: with SMTP id f15mr1223669itb.166.1556646275090; Tue, 30 Apr 2019 10:44:35 -0700 (PDT) MIME-Version: 1.0 References: <201904301429.x3UET9ia077742@repo.freebsd.org> In-Reply-To: <201904301429.x3UET9ia077742@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 30 Apr 2019 10:44:24 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346959 - in head/release: . tools To: Glen Barber Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 9D05A85552 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 17:44:43 -0000 Thanks, Glen! On Tue, Apr 30, 2019 at 7:29 AM Glen Barber wrote: > > Author: gjb > Date: Tue Apr 30 14:29:09 2019 > New Revision: 346959 > URL: https://svnweb.freebsd.org/changeset/base/346959 > > Log: > Reduce the default image size for virtual machine disk images from > 30GB to 3GB. The raw images can be resized using truncate(1), and > other formats can be resized with tools included with other tools > included with other hypervisors. > > Enable the growfs(8) rc(8) at firstboot if the disk was resized > prior to booting the virtual machine for the first time. > > Discussed with: several > PR: 232313 (requested in other context) > MFC after: 3 days > Sponsored by: The FreeBSD Foundation From owner-svn-src-all@freebsd.org Tue Apr 30 17:45:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D87B715990FD; Tue, 30 Apr 2019 17:45:23 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80BB985666; Tue, 30 Apr 2019 17:45:23 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CA97D27A; Tue, 30 Apr 2019 17:45:23 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UHjNPS084123; Tue, 30 Apr 2019 17:45:23 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UHjNJR084122; Tue, 30 Apr 2019 17:45:23 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201904301745.x3UHjNJR084122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 30 Apr 2019 17:45:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346969 - head/stand/i386/zfsboot X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/zfsboot X-SVN-Commit-Revision: 346969 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 80BB985666 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 17:45:24 -0000 Author: tsoome Date: Tue Apr 30 17:45:22 2019 New Revision: 346969 URL: https://svnweb.freebsd.org/changeset/base/346969 Log: zfsboot: to detect disk size, use GPT information first If we do have GPT on disk, read the disk size from it and do not call int13. Since int13 does report bogus informatiopn too often, rather trust the partition table. We are using the same strategy with loader. MFC after: 1 month Modified: head/stand/i386/zfsboot/zfsboot.c Modified: head/stand/i386/zfsboot/zfsboot.c ============================================================================== --- head/stand/i386/zfsboot/zfsboot.c Tue Apr 30 17:42:05 2019 (r346968) +++ head/stand/i386/zfsboot/zfsboot.c Tue Apr 30 17:45:22 2019 (r346969) @@ -460,6 +460,33 @@ copy_dsk(struct zfsdsk *zdsk) } /* + * Get disk size from GPT. + */ +static uint64_t +drvsize_gpt(struct dsk *dskp) +{ +#ifdef GPT + struct gpt_hdr hdr; + char *sec; + + sec = dmadat->secbuf; + if (drvread(dskp, sec, 1, 1)) + return (0); + + memcpy(&hdr, sec, sizeof(hdr)); + if (memcmp(hdr.hdr_sig, GPT_HDR_SIG, sizeof(hdr.hdr_sig)) != 0 || + hdr.hdr_lba_self != 1 || hdr.hdr_revision < 0x00010000 || + hdr.hdr_entsz < sizeof(struct gpt_ent) || + DEV_BSIZE % hdr.hdr_entsz != 0) { + return (0); + } + return (hdr.hdr_lba_alt + 1); +#else + return (0); +#endif +} + +/* * Get disk size from eax=0x800 and 0x4800. We need to probe both * because 0x4800 may not be available and we would like to get more * or less correct disk size - if it is possible at all. @@ -474,6 +501,11 @@ drvsize_ext(struct zfsdsk *zdsk) int cyl, hds, sec; dskp = &zdsk->dsk; + + /* Try to read disk size from GPT */ + size = drvsize_gpt(dskp); + if (size != 0) + return (size); v86.ctl = V86_FLAGS; v86.addr = 0x13; From owner-svn-src-all@freebsd.org Tue Apr 30 18:03:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEDE2159970C; Tue, 30 Apr 2019 18:03:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EADD8614A; Tue, 30 Apr 2019 18:03:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62EEDD746; Tue, 30 Apr 2019 18:03:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UI3IqR095129; Tue, 30 Apr 2019 18:03:18 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UI3HOI095124; Tue, 30 Apr 2019 18:03:17 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904301803.x3UI3HOI095124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Apr 2019 18:03:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346970 - stable/11/sys/dev/cxgbe/tom X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 346970 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8EADD8614A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 18:03:19 -0000 Author: np Date: Tue Apr 30 18:03:17 2019 New Revision: 346970 URL: https://svnweb.freebsd.org/changeset/base/346970 Log: MFC r342208: cxgbe/t4_tom: fixes for issues on the passive open side. - Fix PR 227760 by getting the TOE to respond to the SYN after the call to toe_syncache_add, not during it. The kernel syncache code calls syncache_respond just before syncache_insert. If the ACK to the syncache_respond is processed in another thread it may run before the syncache_insert and won't find the entry. Note that this affects only t4_tom because it's the only driver trying to insert and expand syncache entries from different threads. - Do not leak resources if an embryonic connection terminates at SYN_RCVD because of L2 lookup failures. - Retire lctx->synq and associated code because there is never a need to walk the list of embryonic connections associated with a listener. The per-tid state is still called a synq entry in the driver even though the synq itself is now gone. PR: 227760 Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/tom/t4_connect.c stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c stable/11/sys/dev/cxgbe/tom/t4_listen.c stable/11/sys/dev/cxgbe/tom/t4_tom.c stable/11/sys/dev/cxgbe/tom/t4_tom.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_connect.c Tue Apr 30 17:45:22 2019 (r346969) +++ stable/11/sys/dev/cxgbe/tom/t4_connect.c Tue Apr 30 18:03:17 2019 (r346970) @@ -97,7 +97,8 @@ do_act_establish(struct sge_iq *iq, const struct rss_h goto done; } - make_established(toep, cpl->snd_isn, cpl->rcv_isn, cpl->tcp_opt); + make_established(toep, be32toh(cpl->snd_isn) - 1, + be32toh(cpl->rcv_isn) - 1, cpl->tcp_opt); if (toep->ulp_mode == ULP_MODE_TLS) tls_establish(toep); Modified: stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Apr 30 17:45:22 2019 (r346969) +++ stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Apr 30 18:03:17 2019 (r346970) @@ -383,18 +383,15 @@ assign_rxopt(struct tcpcb *tp, unsigned int opt) * Completes some final bits of initialization for just established connections * and changes their state to TCPS_ESTABLISHED. * - * The ISNs are from after the exchange of SYNs. i.e., the true ISN + 1. + * The ISNs are from the exchange of SYNs. */ void -make_established(struct toepcb *toep, uint32_t snd_isn, uint32_t rcv_isn, - uint16_t opt) +make_established(struct toepcb *toep, uint32_t iss, uint32_t irs, uint16_t opt) { struct inpcb *inp = toep->inp; struct socket *so = inp->inp_socket; struct tcpcb *tp = intotcpcb(inp); long bufsize; - uint32_t iss = be32toh(snd_isn) - 1; /* true ISS */ - uint32_t irs = be32toh(rcv_isn) - 1; /* true IRS */ uint16_t tcpopt = be16toh(opt); struct flowc_tx_params ftxp; @@ -1254,22 +1251,12 @@ do_peer_close(struct sge_iq *iq, const struct rss_head KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); if (__predict_false(toep->flags & TPF_SYNQE)) { -#ifdef INVARIANTS - struct synq_entry *synqe = (void *)toep; - - INP_WLOCK(synqe->lctx->inp); - if (synqe->flags & TPF_SYNQE_HAS_L2TE) { - KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN, - ("%s: listen socket closed but tid %u not aborted.", - __func__, tid)); - } else { - /* - * do_pass_accept_req is still running and will - * eventually take care of this tid. - */ - } - INP_WUNLOCK(synqe->lctx->inp); -#endif + /* + * do_pass_establish must have run before do_peer_close and if + * this is still a synqe instead of a toepcb then the connection + * must be getting aborted. + */ + MPASS(toep->flags & TPF_ABORT_SHUTDOWN); CTR4(KTR_CXGBE, "%s: tid %u, synqe %p (0x%x)", __func__, tid, toep, toep->flags); return (0); @@ -1574,22 +1561,12 @@ do_rx_data(struct sge_iq *iq, const struct rss_header uint32_t ddp_placed = 0; if (__predict_false(toep->flags & TPF_SYNQE)) { -#ifdef INVARIANTS - struct synq_entry *synqe = (void *)toep; - - INP_WLOCK(synqe->lctx->inp); - if (synqe->flags & TPF_SYNQE_HAS_L2TE) { - KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN, - ("%s: listen socket closed but tid %u not aborted.", - __func__, tid)); - } else { - /* - * do_pass_accept_req is still running and will - * eventually take care of this tid. - */ - } - INP_WUNLOCK(synqe->lctx->inp); -#endif + /* + * do_pass_establish must have run before do_rx_data and if this + * is still a synqe instead of a toepcb then the connection must + * be getting aborted. + */ + MPASS(toep->flags & TPF_ABORT_SHUTDOWN); CTR4(KTR_CXGBE, "%s: tid %u, synqe %p (0x%x)", __func__, tid, toep, toep->flags); m_freem(m); Modified: stable/11/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_listen.c Tue Apr 30 17:45:22 2019 (r346969) +++ stable/11/sys/dev/cxgbe/tom/t4_listen.c Tue Apr 30 18:03:17 2019 (r346970) @@ -85,9 +85,6 @@ static struct listen_ctx *listen_hash_find(struct adap static struct listen_ctx *listen_hash_del(struct adapter *, struct inpcb *); static struct inpcb *release_lctx(struct adapter *, struct listen_ctx *); -static inline void save_qids_in_mbuf(struct mbuf *, struct vi_info *, - struct offload_settings *); -static inline void get_qids_from_mbuf(struct mbuf *m, int *, int *); static void send_reset_synqe(struct toedev *, struct synq_entry *); static int @@ -221,7 +218,6 @@ alloc_lctx(struct adapter *sc, struct inpcb *inp, stru lctx->ctrlq = &sc->sge.ctrlq[vi->pi->port_id]; lctx->ofld_rxq = &sc->sge.ofld_rxq[vi->first_ofld_rxq]; refcount_init(&lctx->refcount, 1); - TAILQ_INIT(&lctx->synq); lctx->inp = inp; lctx->vnet = inp->inp_socket->so_vnet; @@ -239,8 +235,6 @@ free_lctx(struct adapter *sc, struct listen_ctx *lctx) INP_WLOCK_ASSERT(inp); KASSERT(lctx->refcount == 0, ("%s: refcount %d", __func__, lctx->refcount)); - KASSERT(TAILQ_EMPTY(&lctx->synq), - ("%s: synq not empty.", __func__)); KASSERT(lctx->stid >= 0, ("%s: bad stid %d.", __func__, lctx->stid)); CTR4(KTR_CXGBE, "%s: stid %u, lctx %p, inp %p", @@ -356,7 +350,7 @@ send_reset_synqe(struct toedev *tod, struct synq_entry struct wrqe *wr; struct fw_flowc_wr *flowc; struct cpl_abort_req *req; - int txqid, rxqid, flowclen; + int flowclen; struct sge_wrq *ofld_txq; struct sge_ofld_rxq *ofld_rxq; const int nparams = 6; @@ -372,9 +366,8 @@ send_reset_synqe(struct toedev *tod, struct synq_entry return; /* abort already in progress */ synqe->flags |= TPF_ABORT_SHUTDOWN; - get_qids_from_mbuf(m, &txqid, &rxqid); - ofld_txq = &sc->sge.ofld_txq[txqid]; - ofld_rxq = &sc->sge.ofld_rxq[rxqid]; + ofld_txq = &sc->sge.ofld_txq[synqe->txqid]; + ofld_rxq = &sc->sge.ofld_rxq[synqe->rxqid]; /* The wrqe will have two WRs - a flowc followed by an abort_req */ flowclen = sizeof(*flowc) + nparams * sizeof(struct fw_flowc_mnemval); @@ -604,7 +597,6 @@ t4_listen_stop(struct toedev *tod, struct tcpcb *tp) struct listen_ctx *lctx; struct adapter *sc = tod->tod_softc; struct inpcb *inp = tp->t_inpcb; - struct synq_entry *synqe; INP_WLOCK_ASSERT(inp); @@ -620,25 +612,33 @@ t4_listen_stop(struct toedev *tod, struct tcpcb *tp) * arrive and clean up when it does. */ if (lctx->flags & LCTX_RPL_PENDING) { - KASSERT(TAILQ_EMPTY(&lctx->synq), - ("%s: synq not empty.", __func__)); return (EINPROGRESS); } - /* - * The host stack will abort all the connections on the listening - * socket's so_comp. It doesn't know about the connections on the synq - * so we need to take care of those. - */ - TAILQ_FOREACH(synqe, &lctx->synq, link) { - if (synqe->flags & TPF_SYNQE_HAS_L2TE) - send_reset_synqe(tod, synqe); - } - destroy_server(sc, lctx); return (0); } +static inline struct synq_entry * +alloc_synqe(struct adapter *sc __unused, struct listen_ctx *lctx, int flags) +{ + struct synq_entry *synqe; + + INP_WLOCK_ASSERT(lctx->inp); + MPASS(flags == M_WAITOK || flags == M_NOWAIT); + + synqe = malloc(sizeof(*synqe), M_CXGBE, flags); + if (__predict_true(synqe != NULL)) { + synqe->flags = TPF_SYNQE; + refcount_init(&synqe->refcnt, 1); + synqe->lctx = lctx; + hold_lctx(lctx); /* Every synqe has a ref on its lctx. */ + synqe->syn = NULL; + } + + return (synqe); +} + static inline void hold_synqe(struct synq_entry *synqe) { @@ -646,17 +646,25 @@ hold_synqe(struct synq_entry *synqe) refcount_acquire(&synqe->refcnt); } -static inline void -release_synqe(struct synq_entry *synqe) +static inline struct inpcb * +release_synqe(struct adapter *sc, struct synq_entry *synqe) { + struct inpcb *inp; - if (refcount_release(&synqe->refcnt)) { - int needfree = synqe->flags & TPF_SYNQE_NEEDFREE; + MPASS(synqe->flags & TPF_SYNQE); + MPASS(synqe->lctx != NULL); + inp = synqe->lctx->inp; + MPASS(inp != NULL); + INP_WLOCK_ASSERT(inp); + + if (refcount_release(&synqe->refcnt)) { + inp = release_lctx(sc, synqe->lctx); m_freem(synqe->syn); - if (needfree) - free(synqe, M_CXGBE); + free(synqe, M_CXGBE); } + + return (inp); } void @@ -668,51 +676,45 @@ t4_syncache_added(struct toedev *tod __unused, void *a } void -t4_syncache_removed(struct toedev *tod __unused, void *arg) +t4_syncache_removed(struct toedev *tod, void *arg) { + struct adapter *sc = tod->tod_softc; struct synq_entry *synqe = arg; + struct inpcb *inp = synqe->lctx->inp; - release_synqe(synqe); + /* + * XXX: this is a LOR but harmless when running from the softclock. + */ + INP_WLOCK(inp); + inp = release_synqe(sc, synqe); + if (inp != NULL) + INP_WUNLOCK(inp); } int t4_syncache_respond(struct toedev *tod, void *arg, struct mbuf *m) { - struct adapter *sc = tod->tod_softc; struct synq_entry *synqe = arg; - struct wrqe *wr; - struct l2t_entry *e; - struct tcpopt to; - struct ip *ip = mtod(m, struct ip *); - struct tcphdr *th; - wr = (struct wrqe *)atomic_readandclear_ptr(&synqe->wr); - if (wr == NULL) { - m_freem(m); - return (EALREADY); - } + if (atomic_fetchadd_int(&synqe->ok_to_respond, 1) == 0) { + struct tcpopt to; + struct ip *ip = mtod(m, struct ip *); + struct tcphdr *th; - if (ip->ip_v == IPVERSION) - th = (void *)(ip + 1); - else - th = (void *)((struct ip6_hdr *)ip + 1); - bzero(&to, sizeof(to)); - tcp_dooptions(&to, (void *)(th + 1), (th->th_off << 2) - sizeof(*th), - TO_SYN); + if (ip->ip_v == IPVERSION) + th = (void *)(ip + 1); + else + th = (void *)((struct ip6_hdr *)ip + 1); + bzero(&to, sizeof(to)); + tcp_dooptions(&to, (void *)(th + 1), + (th->th_off << 2) - sizeof(*th), TO_SYN); - /* save these for later */ - synqe->iss = be32toh(th->th_seq); - synqe->ts = to.to_tsval; - - if (chip_id(sc) >= CHELSIO_T5) { - struct cpl_t5_pass_accept_rpl *rpl5 = wrtod(wr); - - rpl5->iss = th->th_seq; + /* save these for later */ + synqe->iss = be32toh(th->th_seq); + synqe->irs = be32toh(th->th_ack) - 1; + synqe->ts = to.to_tsval; } - e = &sc->l2t->l2tab[synqe->l2e_idx]; - t4_l2t_send(sc, wr, e); - m_freem(m); /* don't need this any more */ return (0); } @@ -832,23 +834,29 @@ done_with_synqe(struct adapter *sc, struct synq_entry { struct listen_ctx *lctx = synqe->lctx; struct inpcb *inp = lctx->inp; - struct vi_info *vi = synqe->syn->m_pkthdr.rcvif->if_softc; struct l2t_entry *e = &sc->l2t->l2tab[synqe->l2e_idx]; int ntids; INP_WLOCK_ASSERT(inp); ntids = inp->inp_vflag & INP_IPV6 ? 2 : 1; - TAILQ_REMOVE(&lctx->synq, synqe, link); - inp = release_lctx(sc, lctx); - if (inp) - INP_WUNLOCK(inp); remove_tid(sc, synqe->tid, ntids); - release_tid(sc, synqe->tid, &sc->sge.ctrlq[vi->pi->port_id]); + release_tid(sc, synqe->tid, lctx->ctrlq); t4_l2t_release(e); - release_synqe(synqe); /* removed from synq list */ + inp = release_synqe(sc, synqe); + if (inp) + INP_WUNLOCK(inp); } +void +synack_failure_cleanup(struct adapter *sc, int tid) +{ + struct synq_entry *synqe = lookup_tid(sc, tid); + + INP_WLOCK(synqe->lctx->inp); + done_with_synqe(sc, synqe); +} + int do_abort_req_synqe(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) @@ -859,7 +867,6 @@ do_abort_req_synqe(struct sge_iq *iq, const struct rss struct synq_entry *synqe = lookup_tid(sc, tid); struct listen_ctx *lctx = synqe->lctx; struct inpcb *inp = lctx->inp; - int txqid; struct sge_wrq *ofld_txq; #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); @@ -878,8 +885,7 @@ do_abort_req_synqe(struct sge_iq *iq, const struct rss INP_WLOCK(inp); - get_qids_from_mbuf(synqe->syn, &txqid, NULL); - ofld_txq = &sc->sge.ofld_txq[txqid]; + ofld_txq = &sc->sge.ofld_txq[synqe->txqid]; /* * If we'd initiated an abort earlier the reply to it is responsible for @@ -939,23 +945,23 @@ t4_offload_socket(struct toedev *tod, void *arg, struc #ifdef INVARIANTS struct inpcb *inp = sotoinpcb(so); #endif - struct cpl_pass_establish *cpl = mtod(synqe->syn, void *); - struct toepcb *toep = *(struct toepcb **)(cpl + 1); + struct toepcb *toep = synqe->toep; INP_INFO_RLOCK_ASSERT(&V_tcbinfo); /* prevents bad race with accept() */ INP_WLOCK_ASSERT(inp); KASSERT(synqe->flags & TPF_SYNQE, ("%s: %p not a synq_entry?", __func__, arg)); + MPASS(toep->tid == synqe->tid); offload_socket(so, toep); - make_established(toep, cpl->snd_isn, cpl->rcv_isn, cpl->tcp_opt); + make_established(toep, synqe->iss, synqe->irs, synqe->tcp_opt); toep->flags |= TPF_CPL_PENDING; update_tid(sc, synqe->tid, toep); synqe->flags |= TPF_SYNQE_EXPANDED; } static inline void -save_qids_in_mbuf(struct mbuf *m, struct vi_info *vi, +save_qids_in_synqe(struct synq_entry *synqe, struct vi_info *vi, struct offload_settings *s) { uint32_t txqid, rxqid; @@ -972,43 +978,10 @@ save_qids_in_mbuf(struct mbuf *m, struct vi_info *vi, rxqid = arc4random() % vi->nofldrxq; rxqid += vi->first_ofld_rxq; - m->m_pkthdr.flowid = (txqid << 16) | (rxqid & 0xffff); + synqe->txqid = txqid; + synqe->rxqid = rxqid; } -static inline void -get_qids_from_mbuf(struct mbuf *m, int *txqid, int *rxqid) -{ - - if (txqid) - *txqid = m->m_pkthdr.flowid >> 16; - if (rxqid) - *rxqid = m->m_pkthdr.flowid & 0xffff; -} - -/* - * Use the trailing space in the mbuf in which the PASS_ACCEPT_REQ arrived to - * store some state temporarily. - */ -static struct synq_entry * -mbuf_to_synqe(struct mbuf *m) -{ - int len = roundup2(sizeof (struct synq_entry), 8); - int tspace = M_TRAILINGSPACE(m); - struct synq_entry *synqe = NULL; - - if (tspace < len) { - synqe = malloc(sizeof(*synqe), M_CXGBE, M_NOWAIT); - if (synqe == NULL) - return (NULL); - synqe->flags = TPF_SYNQE | TPF_SYNQE_NEEDFREE; - } else { - synqe = (void *)(m->m_data + m->m_len + tspace - len); - synqe->flags = TPF_SYNQE; - } - - return (synqe); -} - static void t4opt_to_tcpopt(const struct tcp_options *t4opt, struct tcpopt *to) { @@ -1208,7 +1181,39 @@ get_l2te_for_nexthop(struct port_info *pi, struct ifne return (e); } -#define REJECT_PASS_ACCEPT() do { \ +static int +send_synack(struct adapter *sc, struct synq_entry *synqe, uint64_t opt0, + uint32_t opt2, int tid) +{ + struct wrqe *wr; + struct cpl_pass_accept_rpl *rpl; + struct l2t_entry *e = &sc->l2t->l2tab[synqe->l2e_idx]; + + wr = alloc_wrqe(is_t4(sc) ? sizeof(struct cpl_pass_accept_rpl) : + sizeof(struct cpl_t5_pass_accept_rpl), &sc->sge.ctrlq[0]); + if (wr == NULL) + return (ENOMEM); + rpl = wrtod(wr); + + if (is_t4(sc)) + INIT_TP_WR_MIT_CPL(rpl, CPL_PASS_ACCEPT_RPL, tid); + else { + struct cpl_t5_pass_accept_rpl *rpl5 = (void *)rpl; + + INIT_TP_WR_MIT_CPL(rpl5, CPL_PASS_ACCEPT_RPL, tid); + rpl5->iss = htobe32(synqe->iss); + } + rpl->opt0 = opt0; + rpl->opt2 = opt2; + + return (t4_l2t_send(sc, wr, e)); +} + +#define REJECT_PASS_ACCEPT_REQ(tunnel) do { \ + if (!tunnel) { \ + m_freem(m); \ + m = NULL; \ + } \ reject_reason = __LINE__; \ goto reject; \ } while (0) @@ -1232,8 +1237,6 @@ do_pass_accept_req(struct sge_iq *iq, const struct rss struct adapter *sc = iq->adapter; struct toedev *tod; const struct cpl_pass_accept_req *cpl = mtod(m, const void *); - struct cpl_pass_accept_rpl *rpl; - struct wrqe *wr; unsigned int stid = G_PASS_OPEN_TID(be32toh(cpl->tos_stid)); unsigned int tid = GET_TID(cpl); struct listen_ctx *lctx = lookup_stid(sc, stid); @@ -1246,10 +1249,9 @@ do_pass_accept_req(struct sge_iq *iq, const struct rss struct vi_info *vi; struct ifnet *hw_ifp, *ifp; struct l2t_entry *e = NULL; - int rscale, mtu_idx, rx_credits, rxqid, ulp_mode; struct synq_entry *synqe = NULL; int reject_reason, v, ntids; - uint16_t vid; + uint16_t vid, l2info; #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); #endif @@ -1262,36 +1264,35 @@ do_pass_accept_req(struct sge_iq *iq, const struct rss CTR4(KTR_CXGBE, "%s: stid %u, tid %u, lctx %p", __func__, stid, tid, lctx); - pass_accept_req_to_protohdrs(sc, m, &inc, &th); - t4opt_to_tcpopt(&cpl->tcpopt, &to); + CURVNET_SET(lctx->vnet); /* before any potential REJECT */ - pi = sc->port[G_SYN_INTF(be16toh(cpl->l2info))]; - - CURVNET_SET(lctx->vnet); - /* - * Use the MAC index to lookup the associated VI. If this SYN - * didn't match a perfect MAC filter, punt. + * Use the MAC index to lookup the associated VI. If this SYN didn't + * match a perfect MAC filter, punt. */ - if (!(be16toh(cpl->l2info) & F_SYN_XACT_MATCH)) { - m_freem(m); - m = NULL; - REJECT_PASS_ACCEPT(); + l2info = be16toh(cpl->l2info); + pi = sc->port[G_SYN_INTF(l2info)]; + if (!(l2info & F_SYN_XACT_MATCH)) { + REJECT_PASS_ACCEPT_REQ(false); } for_each_vi(pi, v, vi) { - if (vi->xact_addr_filt == G_SYN_MAC_IDX(be16toh(cpl->l2info))) + if (vi->xact_addr_filt == G_SYN_MAC_IDX(l2info)) goto found; } - m_freem(m); - m = NULL; - REJECT_PASS_ACCEPT(); - + REJECT_PASS_ACCEPT_REQ(false); found: - hw_ifp = vi->ifp; /* the (v)cxgbeX ifnet */ + hw_ifp = vi->ifp; /* the cxgbe ifnet */ m->m_pkthdr.rcvif = hw_ifp; tod = TOEDEV(hw_ifp); /* + * Don't offload if the peer requested a TCP option that's not known to + * the silicon. Send the SYN to the kernel instead. + */ + if (__predict_false(cpl->tcpopt.unknown)) + REJECT_PASS_ACCEPT_REQ(true); + + /* * Figure out if there is a pseudo interface (vlan, lagg, etc.) * involved. Don't offload if the SYN had a VLAN tag and the vid * doesn't match anything on this interface. @@ -1302,75 +1303,57 @@ found: if (vid != 0xfff) { ifp = VLAN_DEVAT(hw_ifp, vid); if (ifp == NULL) - REJECT_PASS_ACCEPT(); + REJECT_PASS_ACCEPT_REQ(true); } else ifp = hw_ifp; /* - * Don't offload if the peer requested a TCP option that's not known to - * the silicon. + * Don't offload if the ifnet that the SYN came in on is not in the same + * vnet as the listening socket. */ - if (cpl->tcpopt.unknown) - REJECT_PASS_ACCEPT(); + if (lctx->vnet != ifp->if_vnet) + REJECT_PASS_ACCEPT_REQ(true); + pass_accept_req_to_protohdrs(sc, m, &inc, &th); if (inc.inc_flags & INC_ISIPV6) { /* Don't offload if the ifcap isn't enabled */ if ((ifp->if_capenable & IFCAP_TOE6) == 0) - REJECT_PASS_ACCEPT(); + REJECT_PASS_ACCEPT_REQ(true); /* * SYN must be directed to an IP6 address on this ifnet. This * is more restrictive than in6_localip. */ if (!in6_ifhasaddr(ifp, &inc.inc6_laddr)) - REJECT_PASS_ACCEPT(); + REJECT_PASS_ACCEPT_REQ(true); ntids = 2; } else { /* Don't offload if the ifcap isn't enabled */ if ((ifp->if_capenable & IFCAP_TOE4) == 0) - REJECT_PASS_ACCEPT(); + REJECT_PASS_ACCEPT_REQ(true); /* * SYN must be directed to an IP address on this ifnet. This * is more restrictive than in_localip. */ if (!in_ifhasaddr(ifp, inc.inc_laddr)) - REJECT_PASS_ACCEPT(); + REJECT_PASS_ACCEPT_REQ(true); ntids = 1; } - /* - * Don't offload if the ifnet that the SYN came in on is not in the same - * vnet as the listening socket. - */ - if (lctx->vnet != ifp->if_vnet) - REJECT_PASS_ACCEPT(); - e = get_l2te_for_nexthop(pi, ifp, &inc); if (e == NULL) - REJECT_PASS_ACCEPT(); + REJECT_PASS_ACCEPT_REQ(true); - synqe = mbuf_to_synqe(m); - if (synqe == NULL) - REJECT_PASS_ACCEPT(); - - wr = alloc_wrqe(is_t4(sc) ? sizeof(struct cpl_pass_accept_rpl) : - sizeof(struct cpl_t5_pass_accept_rpl), &sc->sge.ctrlq[pi->port_id]); - if (wr == NULL) - REJECT_PASS_ACCEPT(); - rpl = wrtod(wr); - - INP_INFO_RLOCK(&V_tcbinfo); /* for 4-tuple check */ - /* Don't offload if the 4-tuple is already in use */ + INP_INFO_RLOCK(&V_tcbinfo); /* for 4-tuple check */ if (toe_4tuple_check(&inc, &th, ifp) != 0) { INP_INFO_RUNLOCK(&V_tcbinfo); - free(wr, M_CXGBE); - REJECT_PASS_ACCEPT(); + REJECT_PASS_ACCEPT_REQ(false); } INP_INFO_RUNLOCK(&V_tcbinfo); @@ -1379,14 +1362,8 @@ found: /* Don't offload if the listening socket has closed */ if (__predict_false(inp->inp_flags & INP_DROPPED)) { - /* - * The listening socket has closed. The reply from the TOE to - * our CPL_CLOSE_LISTSRV_REQ will ultimately release all - * resources tied to this listen context. - */ INP_WUNLOCK(inp); - free(wr, M_CXGBE); - REJECT_PASS_ACCEPT(); + REJECT_PASS_ACCEPT_REQ(false); } so = inp->inp_socket; rw_rlock(&sc->policy_lock); @@ -1394,119 +1371,62 @@ found: rw_runlock(&sc->policy_lock); if (!settings.offload) { INP_WUNLOCK(inp); - free(wr, M_CXGBE); - REJECT_PASS_ACCEPT(); + REJECT_PASS_ACCEPT_REQ(true); /* Rejected by COP. */ } - mtu_idx = find_best_mtu_idx(sc, &inc, &settings); - rscale = cpl->tcpopt.wsf && V_tcp_do_rfc1323 ? select_rcv_wscale() : 0; - SOCKBUF_LOCK(&so->so_rcv); - /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ - rx_credits = min(select_rcv_wnd(so) >> 10, M_RCV_BUFSIZ); - SOCKBUF_UNLOCK(&so->so_rcv); - - save_qids_in_mbuf(m, vi, &settings); - get_qids_from_mbuf(m, NULL, &rxqid); - - if (is_t4(sc)) - INIT_TP_WR_MIT_CPL(rpl, CPL_PASS_ACCEPT_RPL, tid); - else { - struct cpl_t5_pass_accept_rpl *rpl5 = (void *)rpl; - - INIT_TP_WR_MIT_CPL(rpl5, CPL_PASS_ACCEPT_RPL, tid); + synqe = alloc_synqe(sc, lctx, M_NOWAIT); + if (synqe == NULL) { + INP_WUNLOCK(inp); + REJECT_PASS_ACCEPT_REQ(true); } - ulp_mode = select_ulp_mode(so, sc, &settings); - switch (ulp_mode) { - case ULP_MODE_TCPDDP: - synqe->flags |= TPF_SYNQE_TCPDDP; - break; - case ULP_MODE_TLS: - synqe->flags |= TPF_SYNQE_TLS; - break; - } - rpl->opt0 = calc_opt0(so, vi, e, mtu_idx, rscale, rx_credits, ulp_mode, - &settings); - rpl->opt2 = calc_opt2p(sc, pi, rxqid, &cpl->tcpopt, &th, ulp_mode, - CC_ALGO(intotcpcb(inp)), &settings); + atomic_store_int(&synqe->ok_to_respond, 0); - synqe->tid = tid; - synqe->lctx = lctx; - synqe->syn = m; - m = NULL; - refcount_init(&synqe->refcnt, 1); /* 1 means extra hold */ - synqe->l2e_idx = e->idx; - synqe->rcv_bufsize = rx_credits; - atomic_store_rel_ptr(&synqe->wr, (uintptr_t)wr); - - insert_tid(sc, tid, synqe, ntids); - TAILQ_INSERT_TAIL(&lctx->synq, synqe, link); - hold_synqe(synqe); /* hold for the duration it's in the synq */ - hold_lctx(lctx); /* A synqe on the list has a ref on its lctx */ - /* * If all goes well t4_syncache_respond will get called during * syncache_add. Note that syncache_add releases the pcb lock. */ + t4opt_to_tcpopt(&cpl->tcpopt, &to); toe_syncache_add(&inc, &to, &th, inp, tod, synqe); - INP_UNLOCK_ASSERT(inp); /* ok to assert, we have a ref on the inp */ - /* - * If we replied during syncache_add (synqe->wr has been consumed), - * good. Otherwise, set it to 0 so that further syncache_respond - * attempts by the kernel will be ignored. - */ - if (atomic_cmpset_ptr(&synqe->wr, (uintptr_t)wr, 0)) { + if (atomic_load_int(&synqe->ok_to_respond) > 0) { + uint64_t opt0; + uint32_t opt2; + int rscale, mtu_idx, rx_credits; - /* - * syncache may or may not have a hold on the synqe, which may - * or may not be stashed in the original SYN mbuf passed to us. - * Just copy it over instead of dealing with all possibilities. - */ - m = m_dup(synqe->syn, M_NOWAIT); - if (m) - m->m_pkthdr.rcvif = hw_ifp; + mtu_idx = find_best_mtu_idx(sc, &inc, &settings); + rscale = cpl->tcpopt.wsf && V_tcp_do_rfc1323 ? select_rcv_wscale() : 0; + /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ + rx_credits = min(select_rcv_wnd(so) >> 10, M_RCV_BUFSIZ); - remove_tid(sc, synqe->tid, ntids); - free(wr, M_CXGBE); + save_qids_in_synqe(synqe, vi, &settings); + synqe->ulp_mode = select_ulp_mode(so, sc, &settings); - /* Yank the synqe out of the lctx synq. */ - INP_WLOCK(inp); - TAILQ_REMOVE(&lctx->synq, synqe, link); - release_synqe(synqe); /* removed from synq list */ - inp = release_lctx(sc, lctx); - if (inp) - INP_WUNLOCK(inp); + opt0 = calc_opt0(so, vi, e, mtu_idx, rscale, rx_credits, + synqe->ulp_mode, &settings); + opt2 = calc_opt2p(sc, pi, synqe->rxqid, &cpl->tcpopt, &th, + synqe->ulp_mode, CC_ALGO(intotcpcb(inp)), &settings); - release_synqe(synqe); /* extra hold */ - REJECT_PASS_ACCEPT(); - } + insert_tid(sc, tid, synqe, ntids); + synqe->tid = tid; + synqe->l2e_idx = e->idx; + synqe->rcv_bufsize = rx_credits; + synqe->syn = m; + m = NULL; - CTR6(KTR_CXGBE, "%s: stid %u, tid %u, lctx %p, synqe %p, SYNACK mode %d", - __func__, stid, tid, lctx, synqe, ulp_mode); + if (send_synack(sc, synqe, opt0, opt2, tid) != 0) { + remove_tid(sc, tid, ntids); + m = synqe->syn; + synqe->syn = NULL; + REJECT_PASS_ACCEPT_REQ(true); + } - INP_WLOCK(inp); - synqe->flags |= TPF_SYNQE_HAS_L2TE; - if (__predict_false(inp->inp_flags & INP_DROPPED)) { - /* - * Listening socket closed but tod_listen_stop did not abort - * this tid because there was no L2T entry for the tid at that - * time. Abort it now. The reply to the abort will clean up. - */ CTR6(KTR_CXGBE, - "%s: stid %u, tid %u, lctx %p, synqe %p (0x%x), ABORT", - __func__, stid, tid, lctx, synqe, synqe->flags); - if (!(synqe->flags & TPF_SYNQE_EXPANDED)) - send_reset_synqe(tod, synqe); - INP_WUNLOCK(inp); - CURVNET_RESTORE(); + "%s: stid %u, tid %u, lctx %p, synqe %p, mode %d, SYNACK", + __func__, stid, tid, lctx, synqe, synqe->ulp_mode); + } else + REJECT_PASS_ACCEPT_REQ(false); - release_synqe(synqe); /* extra hold */ - return (__LINE__); - } - INP_WUNLOCK(inp); CURVNET_RESTORE(); - - release_synqe(synqe); /* extra hold */ return (0); reject: CURVNET_RESTORE(); @@ -1516,8 +1436,19 @@ reject: if (e) t4_l2t_release(e); release_tid(sc, tid, lctx->ctrlq); + if (synqe) { + inp = synqe->lctx->inp; + INP_WLOCK(inp); + inp = release_synqe(sc, synqe); + if (inp) + INP_WUNLOCK(inp); + } - if (__predict_true(m != NULL)) { + if (m) { + /* + * The connection request hit a TOE listener but is being passed + * on to the kernel sw stack instead of getting offloaded. + */ m_adj(m, sizeof(*cpl)); m->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID | CSUM_DATA_VALID | CSUM_PSEUDO_HDR); @@ -1569,7 +1500,6 @@ do_pass_establish(struct sge_iq *iq, const struct rss_ struct tcpopt to; struct in_conninfo inc; struct toepcb *toep; - u_int txqid, rxqid; #ifdef INVARIANTS unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl))); #endif @@ -1589,73 +1519,46 @@ do_pass_establish(struct sge_iq *iq, const struct rss_ "%s: stid %u, tid %u, synqe %p (0x%x), inp_flags 0x%x", __func__, stid, tid, synqe, synqe->flags, inp->inp_flags); - if (__predict_false(inp->inp_flags & INP_DROPPED)) { - - if (synqe->flags & TPF_SYNQE_HAS_L2TE) { - KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN, - ("%s: listen socket closed but tid %u not aborted.", - __func__, tid)); - } - - INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); - CURVNET_RESTORE(); - return (0); - } - ifp = synqe->syn->m_pkthdr.rcvif; vi = ifp->if_softc; KASSERT(vi->pi->adapter == sc, ("%s: vi %p, sc %p mismatch", __func__, vi, sc)); - get_qids_from_mbuf(synqe->syn, &txqid, &rxqid); - KASSERT(rxqid == iq_to_ofld_rxq(iq) - &sc->sge.ofld_rxq[0], - ("%s: CPL arrived on unexpected rxq. %d %d", __func__, rxqid, - (int)(iq_to_ofld_rxq(iq) - &sc->sge.ofld_rxq[0]))); - - toep = alloc_toepcb(vi, txqid, rxqid, M_NOWAIT); - if (toep == NULL) { + if (__predict_false(inp->inp_flags & INP_DROPPED)) { reset: - /* - * The reply to this abort will perform final cleanup. There is - * no need to check for HAS_L2TE here. We can be here only if - * we responded to the PASS_ACCEPT_REQ, and our response had the - * L2T idx. - */ send_reset_synqe(TOEDEV(ifp), synqe); INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return (0); } + + KASSERT(synqe->rxqid == iq_to_ofld_rxq(iq) - &sc->sge.ofld_rxq[0], + ("%s: CPL arrived on unexpected rxq. %d %d", __func__, + synqe->rxqid, (int)(iq_to_ofld_rxq(iq) - &sc->sge.ofld_rxq[0]))); + + toep = alloc_toepcb(vi, synqe->txqid, synqe->rxqid, M_NOWAIT); + if (toep == NULL) + goto reset; toep->tid = tid; toep->l2te = &sc->l2t->l2tab[synqe->l2e_idx]; - if (synqe->flags & TPF_SYNQE_TCPDDP) - set_ulp_mode(toep, ULP_MODE_TCPDDP); - else if (synqe->flags & TPF_SYNQE_TLS) - set_ulp_mode(toep, ULP_MODE_TLS); - else - set_ulp_mode(toep, ULP_MODE_NONE); + toep->vnet = lctx->vnet; + set_ulp_mode(toep, synqe->ulp_mode); /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ toep->rx_credits = synqe->rcv_bufsize; - so = inp->inp_socket; - KASSERT(so != NULL, ("%s: socket is NULL", __func__)); + MPASS(be32toh(cpl->snd_isn) - 1 == synqe->iss); + MPASS(be32toh(cpl->rcv_isn) - 1 == synqe->irs); + synqe->tcp_opt = cpl->tcp_opt; + synqe->toep = toep; /* Come up with something that syncache_expand should be ok with. */ synqe_to_protohdrs(sc, synqe, cpl, &inc, &th, &to); + if (inc.inc_flags & INC_ISIPV6) + toep->ce = t4_hold_lip(sc, &inc.inc6_laddr, lctx->ce); + so = inp->inp_socket; + KASSERT(so != NULL, ("%s: socket is NULL", __func__)); - /* - * No more need for anything in the mbuf that carried the - * CPL_PASS_ACCEPT_REQ. Drop the CPL_PASS_ESTABLISH and toep pointer - * there. XXX: bad form but I don't want to increase the size of synqe. - */ - m = synqe->syn; - KASSERT(sizeof(*cpl) + sizeof(toep) <= m->m_len, - ("%s: no room in mbuf %p (m_len %d)", __func__, m, m->m_len)); - bcopy(cpl, mtod(m, void *), sizeof(*cpl)); - *(struct toepcb **)(mtod(m, struct cpl_pass_establish *) + 1) = toep; - if (!toe_syncache_expand(&inc, &to, &th, &so) || so == NULL) { free_toepcb(toep); goto reset; @@ -1665,14 +1568,9 @@ reset: new_inp = sotoinpcb(so); INP_WLOCK_ASSERT(new_inp); MPASS(so->so_vnet == lctx->vnet); - toep->vnet = lctx->vnet; - if (inc.inc_flags & INC_ISIPV6) - toep->ce = t4_hold_lip(sc, &inc.inc6_laddr, lctx->ce); /* - * This is for the unlikely case where the syncache entry that we added - * has been evicted from the syncache, but the syncache_expand above - * works because of syncookies. + * This is for expansion from syncookies. * * XXX: we've held the tcbinfo lock throughout so there's no risk of * anyone accept'ing a connection before we've installed our hooks, but @@ -1686,13 +1584,11 @@ reset: INP_WUNLOCK(new_inp); /* Done with the synqe */ - TAILQ_REMOVE(&lctx->synq, synqe, link); - inp = release_lctx(sc, lctx); + inp = release_synqe(sc, synqe); if (inp != NULL) INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); - release_synqe(synqe); return (0); } Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.c Tue Apr 30 17:45:22 2019 (r346969) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.c Tue Apr 30 18:03:17 2019 (r346970) @@ -1011,9 +1011,9 @@ reclaim_wr_resources(void *arg, int count) struct tom_data *td = arg; STAILQ_HEAD(, wrqe) twr_list = STAILQ_HEAD_INITIALIZER(twr_list); struct cpl_act_open_req *cpl; - u_int opcode, atid; + u_int opcode, atid, tid; struct wrqe *wr; - struct adapter *sc; + struct adapter *sc = td_adapter(td); mtx_lock(&td->unsent_wr_lock); STAILQ_SWAP(&td->unsent_wr_list, &twr_list, wrqe); @@ -1029,10 +1029,14 @@ reclaim_wr_resources(void *arg, int count) case CPL_ACT_OPEN_REQ: case CPL_ACT_OPEN_REQ6: atid = G_TID_TID(be32toh(OPCODE_TID(cpl))); - sc = td_adapter(td); - CTR2(KTR_CXGBE, "%s: atid %u ", __func__, atid); act_open_failure_cleanup(sc, atid, EHOSTUNREACH); + free(wr, M_CXGBE); + break; + case CPL_PASS_ACCEPT_RPL: + tid = GET_TID(cpl); + CTR2(KTR_CXGBE, "%s: tid %u ", __func__, tid); + synack_failure_cleanup(sc, tid); free(wr, M_CXGBE); break; default: Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.h Tue Apr 30 17:45:22 2019 (r346969) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.h Tue Apr 30 18:03:17 2019 (r346970) @@ -66,12 +66,8 @@ enum { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Apr 30 18:36:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CE1A159A6F8; Tue, 30 Apr 2019 18:36:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5D6E87797; Tue, 30 Apr 2019 18:36:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6DCEDCCD; Tue, 30 Apr 2019 18:36:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UIauUG011420; Tue, 30 Apr 2019 18:36:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UIauaO011419; Tue, 30 Apr 2019 18:36:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201904301836.x3UIauaO011419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 30 Apr 2019 18:36:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346971 - stable/12/sys/netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/netinet6 X-SVN-Commit-Revision: 346971 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E5D6E87797 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 18:36:57 -0000 Author: kib Date: Tue Apr 30 18:36:56 2019 New Revision: 346971 URL: https://svnweb.freebsd.org/changeset/base/346971 Log: MFC r346596: ipoib: assign link-local address according to RFC. Modified: stable/12/sys/netinet6/in6_ifattach.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet6/in6_ifattach.c ============================================================================== --- stable/12/sys/netinet6/in6_ifattach.c Tue Apr 30 18:03:17 2019 (r346970) +++ stable/12/sys/netinet6/in6_ifattach.c Tue Apr 30 18:36:56 2019 (r346971) @@ -327,6 +327,14 @@ found: IF_ADDR_RUNLOCK(ifp); return -1; + case IFT_INFINIBAND: + if (addrlen != 20) { + IF_ADDR_RUNLOCK(ifp); + return -1; + } + bcopy(addr + 12, &in6->s6_addr[8], 8); + break; + default: IF_ADDR_RUNLOCK(ifp); return -1; From owner-svn-src-all@freebsd.org Tue Apr 30 18:42:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FFAC159A9E2; Tue, 30 Apr 2019 18:42:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E94E587EAA; Tue, 30 Apr 2019 18:42:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C394FDE8C; Tue, 30 Apr 2019 18:42:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UIggkQ016845; Tue, 30 Apr 2019 18:42:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UIggqX016844; Tue, 30 Apr 2019 18:42:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201904301842.x3UIggqX016844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 30 Apr 2019 18:42:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346972 - stable/11/sys/netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/netinet6 X-SVN-Commit-Revision: 346972 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E94E587EAA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 18:42:43 -0000 Author: kib Date: Tue Apr 30 18:42:42 2019 New Revision: 346972 URL: https://svnweb.freebsd.org/changeset/base/346972 Log: MFC r346596: ipoib: assign link-local address according to RFC. Modified: stable/11/sys/netinet6/in6_ifattach.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet6/in6_ifattach.c ============================================================================== --- stable/11/sys/netinet6/in6_ifattach.c Tue Apr 30 18:36:56 2019 (r346971) +++ stable/11/sys/netinet6/in6_ifattach.c Tue Apr 30 18:42:42 2019 (r346972) @@ -348,6 +348,14 @@ found: IF_ADDR_RUNLOCK(ifp); return -1; + case IFT_INFINIBAND: + if (addrlen != 20) { + IF_ADDR_RUNLOCK(ifp); + return -1; + } + bcopy(addr + 12, &in6->s6_addr[8], 8); + break; + default: IF_ADDR_RUNLOCK(ifp); return -1; From owner-svn-src-all@freebsd.org Tue Apr 30 18:48:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B38D159AB3F; Tue, 30 Apr 2019 18:48:21 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 329748823E; Tue, 30 Apr 2019 18:48:21 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CB5BDE9B; Tue, 30 Apr 2019 18:48:21 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UImKrp017407; Tue, 30 Apr 2019 18:48:20 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UImKTS017406; Tue, 30 Apr 2019 18:48:20 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201904301848.x3UImKTS017406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 30 Apr 2019 18:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346973 - head/stand/i386/gptboot X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/i386/gptboot X-SVN-Commit-Revision: 346973 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 329748823E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 18:48:21 -0000 Author: ian Date: Tue Apr 30 18:48:20 2019 New Revision: 346973 URL: https://svnweb.freebsd.org/changeset/base/346973 Log: Add a paragraph that mentions gptboot having an interactive mode, and direct the user to the boot(8) manpage, which provides the details on that. Modified: head/stand/i386/gptboot/gptboot.8 Modified: head/stand/i386/gptboot/gptboot.8 ============================================================================== --- head/stand/i386/gptboot/gptboot.8 Tue Apr 30 18:42:42 2019 (r346972) +++ head/stand/i386/gptboot/gptboot.8 Tue Apr 30 18:48:20 2019 (r346973) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 5, 2014 +.Dd April 30, 2019 .Dt GPTBOOT 8 .Os .Sh NAME @@ -39,6 +39,20 @@ is installed in a .Cm freebsd-boot partition with .Xr gpart 8 . +.Pp +When it starts, +.Nm +first reads the GPT and determines which drive and partition to +boot from, as described under +.Sx BOOTING , +below. +If it does not find an eligible partition, or if the user hits a +key within three seconds, +.Nm +switches from auto-boot to interactive mode. +Interactive mode allows manual selection of the disk, partition, +filename, and boot option flags, as described in +.Xr boot 8 . .Sh IMPLEMENTATION NOTES The GPT standard allows a variable number of partitions, but .Nm From owner-svn-src-all@freebsd.org Tue Apr 30 21:24:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CA82159EED0; Tue, 30 Apr 2019 21:24:45 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4283A8F6D3; Tue, 30 Apr 2019 21:24:45 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B3C3FA75; Tue, 30 Apr 2019 21:24:45 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3ULOiB3006396; Tue, 30 Apr 2019 21:24:44 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3ULOi5w006395; Tue, 30 Apr 2019 21:24:44 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904302124.x3ULOi5w006395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Apr 2019 21:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346974 - stable/12/sys/dev/cxgbe X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe X-SVN-Commit-Revision: 346974 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4283A8F6D3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 21:24:45 -0000 Author: np Date: Tue Apr 30 21:24:44 2019 New Revision: 346974 URL: https://svnweb.freebsd.org/changeset/base/346974 Log: MFC r340375 (by jch@): cxgbe/netmap: Fix cxgbe netmap when interface is DOWN A kernel panic can occur if the cxgbe interface is DOWN when activating netmap. This patch prevents the driver from freeing up cxgbe netmap resources when they have not been allocated. Submitted by: Nicolas Witkowski Reviewed by: np Sponsored by: Verisign, Inc. Differential Revision: https://reviews.freebsd.org/D17802 Modified: stable/12/sys/dev/cxgbe/t4_netmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_netmap.c Tue Apr 30 18:48:20 2019 (r346973) +++ stable/12/sys/dev/cxgbe/t4_netmap.c Tue Apr 30 21:24:44 2019 (r346974) @@ -492,6 +492,9 @@ cxgbe_netmap_off(struct adapter *sc, struct vi_info *v ASSERT_SYNCHRONIZED_OP(sc); + if (!nm_netmap_on(na)) + return (0); + if ((vi->flags & VI_INIT_DONE) == 0) return (0); From owner-svn-src-all@freebsd.org Tue Apr 30 21:27:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5A46159EFB6; Tue, 30 Apr 2019 21:27:33 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B3208F858; Tue, 30 Apr 2019 21:27:33 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61E6FFA78; Tue, 30 Apr 2019 21:27:33 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3ULRX0W006552; Tue, 30 Apr 2019 21:27:33 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3ULRXUd006551; Tue, 30 Apr 2019 21:27:33 GMT (envelope-from np@FreeBSD.org) Message-Id: <201904302127.x3ULRXUd006551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 30 Apr 2019 21:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346975 - stable/12/sys/dev/cxgbe X-SVN-Group: stable-12 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe X-SVN-Commit-Revision: 346975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7B3208F858 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 21:27:34 -0000 Author: np Date: Tue Apr 30 21:27:32 2019 New Revision: 346975 URL: https://svnweb.freebsd.org/changeset/base/346975 Log: MFC r346567: cxgbe(4): Make sure bundled_fw is always initialized before use. This fixes a bug that prevented the driver from auto-flashing the firmware when it didn't see one on the card. This feature was introduced in r321390 and this bug was introduced in r343269. Reported by: gallatin@ Sponsored by: Chelsio Communications Modified: stable/12/sys/dev/cxgbe/t4_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_main.c Tue Apr 30 21:24:44 2019 (r346974) +++ stable/12/sys/dev/cxgbe/t4_main.c Tue Apr 30 21:27:32 2019 (r346975) @@ -3529,19 +3529,6 @@ install_kld_firmware(struct adapter *sc, struct fw_h * load_attempted = false; fw_install = t4_fw_install < 0 ? -t4_fw_install : t4_fw_install; - if (reason != NULL) - goto install; - - if ((sc->flags & FW_OK) == 0) { - - if (c == 0xffffffff) { - reason = "missing"; - goto install; - } - - return (0); - } - memcpy(&bundled_fw, drv_fw, sizeof(bundled_fw)); if (t4_fw_install < 0) { rc = load_fw_module(sc, &cfg, &fw); @@ -3557,6 +3544,20 @@ install_kld_firmware(struct adapter *sc, struct fw_h * load_attempted = true; } d = be32toh(bundled_fw.fw_ver); + + if (reason != NULL) + goto install; + + if ((sc->flags & FW_OK) == 0) { + + if (c == 0xffffffff) { + reason = "missing"; + goto install; + } + + rc = 0; + goto done; + } if (!fw_compatible(card_fw, &bundled_fw)) { reason = "incompatible or unusable"; From owner-svn-src-all@freebsd.org Tue Apr 30 21:38:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6A86159F294; Tue, 30 Apr 2019 21:38:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CADF8FDE4; Tue, 30 Apr 2019 21:38:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DABBFC23; Tue, 30 Apr 2019 21:38:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3ULcdfY011998; Tue, 30 Apr 2019 21:38:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3ULcdQR011997; Tue, 30 Apr 2019 21:38:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201904302138.x3ULcdQR011997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 30 Apr 2019 21:38:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346976 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 346976 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7CADF8FDE4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 21:38:40 -0000 Author: mav Date: Tue Apr 30 21:38:38 2019 New Revision: 346976 URL: https://svnweb.freebsd.org/changeset/base/346976 Log: Respect quotes and escapes when splitting exports fields. Without this r293305 was still unable to handle names with spaces. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Tue Apr 30 21:27:32 2019 (r346975) +++ head/usr.sbin/mountd/mountd.c Tue Apr 30 21:38:38 2019 (r346976) @@ -2824,18 +2824,27 @@ static void nextfield(char **cp, char **endcp) { char *p; + char quot = 0; p = *cp; while (*p == ' ' || *p == '\t') p++; - if (*p == '\n' || *p == '\0') - *cp = *endcp = p; - else { - *cp = p++; - while (*p != ' ' && *p != '\t' && *p != '\n' && *p != '\0') - p++; - *endcp = p; - } + *cp = p; + while (*p != '\0') { + if (quot) { + if (*p == quot) + quot = 0; + } else { + if (*p == '\\' && *(p + 1) != '\0') + p++; + else if (*p == '\'' || *p == '"') + quot = *p; + else if (*p == ' ' || *p == '\t') + break; + } + p++; + }; + *endcp = p; } /* @@ -2907,8 +2916,8 @@ parsecred(char *namelist, struct xucred *cr) /* * Get the user's password table entry. */ - names = strsep_quote(&namelist, " \t\n"); - name = strsep(&names, ":"); + names = namelist; + name = strsep_quote(&names, ":"); /* Bug? name could be NULL here */ if (isdigit(*name) || *name == '-') pw = getpwuid(atoi(name)); @@ -2952,7 +2961,7 @@ parsecred(char *namelist, struct xucred *cr) } cr->cr_ngroups = 0; while (names != NULL && *names != '\0' && cr->cr_ngroups < XU_NGROUPS) { - name = strsep(&names, ":"); + name = strsep_quote(&names, ":"); if (isdigit(*name) || *name == '-') { cr->cr_groups[cr->cr_ngroups++] = atoi(name); } else { From owner-svn-src-all@freebsd.org Tue Apr 30 23:01:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2260F15A0EF8; Tue, 30 Apr 2019 23:01:15 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB1386BE72; Tue, 30 Apr 2019 23:01:14 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F2CF18A0A; Tue, 30 Apr 2019 23:01:14 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UN1Es9053919; Tue, 30 Apr 2019 23:01:14 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UN1DXS053915; Tue, 30 Apr 2019 23:01:13 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201904302301.x3UN1DXS053915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Tue, 30 Apr 2019 23:01:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346977 - in stable/12/lib/libsecureboot: . h X-SVN-Group: stable-12 X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in stable/12/lib/libsecureboot: . h X-SVN-Commit-Revision: 346977 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BB1386BE72 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 23:01:15 -0000 Author: sjg Date: Tue Apr 30 23:01:13 2019 New Revision: 346977 URL: https://svnweb.freebsd.org/changeset/base/346977 Log: Allow no_hash to appear in manifest. sbin/veriexec will ignore entries that have no hash anyway, but loader needs to be explicitly told that such files are ok to ignore (not verify). We will report as Unverified depending on verbose level, but with no reason - because we are not rejecting the file. MFC r346604 Modified: stable/12/lib/libsecureboot/h/libsecureboot.h stable/12/lib/libsecureboot/vectx.c stable/12/lib/libsecureboot/veopen.c stable/12/lib/libsecureboot/verify_file.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libsecureboot/h/libsecureboot.h ============================================================================== --- stable/12/lib/libsecureboot/h/libsecureboot.h Tue Apr 30 21:38:38 2019 (r346976) +++ stable/12/lib/libsecureboot/h/libsecureboot.h Tue Apr 30 23:01:13 2019 (r346977) @@ -86,6 +86,7 @@ ssize_t ve_pcr_get(unsigned char *, size_t); #define VEF_VERBOSE 1 #define VE_FINGERPRINT_OK 1 +#define VE_FINGERPRINT_IGNORE 2 /* errors from verify_fd */ #define VE_FINGERPRINT_NONE -2 #define VE_FINGERPRINT_WRONG -3 Modified: stable/12/lib/libsecureboot/vectx.c ============================================================================== --- stable/12/lib/libsecureboot/vectx.c Tue Apr 30 21:38:38 2019 (r346976) +++ stable/12/lib/libsecureboot/vectx.c Tue Apr 30 23:01:13 2019 (r346977) @@ -120,7 +120,10 @@ vectx_open(int fd, const char *path, off_t off, struct ctx->vec_status = VE_FINGERPRINT_NONE; ve_error_set("%s: no entry", path); } else { - if (strncmp(cp, "sha256=", 7) == 0) { + if (strncmp(cp, "no_hash", 7) == 0) { + ctx->vec_status = VE_FINGERPRINT_IGNORE; + hashsz = 0; + } else if (strncmp(cp, "sha256=", 7) == 0) { ctx->vec_md = &br_sha256_vtable; hashsz = br_sha256_SIZE; cp += 7; @@ -150,11 +153,13 @@ vectx_open(int fd, const char *path, off_t off, struct *error = ctx->vec_status; ctx->vec_hashsz = hashsz; ctx->vec_want = cp; - ctx->vec_md->init(&ctx->vec_ctx.vtable); + if (hashsz > 0) { + ctx->vec_md->init(&ctx->vec_ctx.vtable); - if (hashsz > 0 && off > 0) { - lseek(fd, 0, SEEK_SET); - vectx_lseek(ctx, off, SEEK_SET); + if (off > 0) { + lseek(fd, 0, SEEK_SET); + vectx_lseek(ctx, off, SEEK_SET); + } } return (ctx); Modified: stable/12/lib/libsecureboot/veopen.c ============================================================================== --- stable/12/lib/libsecureboot/veopen.c Tue Apr 30 21:38:38 2019 (r346976) +++ stable/12/lib/libsecureboot/veopen.c Tue Apr 30 23:01:13 2019 (r346977) @@ -345,7 +345,9 @@ verify_fingerprint(int fd, const char *path, const cha size_t hlen; int n; - if (strncmp(cp, "sha256=", 7) == 0) { + if (strncmp(cp, "no_hash", 7) == 0) { + return (VE_FINGERPRINT_IGNORE); + } else if (strncmp(cp, "sha256=", 7) == 0) { md = &br_sha256_vtable; hlen = br_sha256_SIZE; cp += 7; @@ -423,6 +425,7 @@ verify_fd(int fd, const char *path, off_t off, struct rc = verify_fingerprint(fd, path, cp, off); switch (rc) { case VE_FINGERPRINT_OK: + case VE_FINGERPRINT_IGNORE: case VE_FINGERPRINT_UNKNOWN: return (rc); default: Modified: stable/12/lib/libsecureboot/verify_file.c ============================================================================== --- stable/12/lib/libsecureboot/verify_file.c Tue Apr 30 21:38:38 2019 (r346976) +++ stable/12/lib/libsecureboot/verify_file.c Tue Apr 30 23:01:13 2019 (r346977) @@ -343,10 +343,14 @@ verify_file(int fd, const char *filename, off_t off, i if ((rc = verify_fd(fd, filename, off, &st)) >= 0) { if (verbose || severity > VE_WANT) { #if defined(VE_DEBUG_LEVEL) && VE_DEBUG_LEVEL > 0 - printf("Verified %s %llu,%llu\n", filename, + printf("%serified %s %llu,%llu\n", + (rc == VE_FINGERPRINT_IGNORE) ? "Unv" : "V", + filename, (long long)st.st_dev, (long long)st.st_ino); #else - printf("Verified %s\n", filename); + printf("%serified %s\n", + (rc == VE_FINGERPRINT_IGNORE) ? "Unv" : "V", + filename); #endif } if (severity < VE_MUST) { /* not a kernel or module */ From owner-svn-src-all@freebsd.org Tue Apr 30 23:53:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EB5215A1DEA; Tue, 30 Apr 2019 23:53:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 26E226D66B; Tue, 30 Apr 2019 23:53:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6636193DF; Tue, 30 Apr 2019 23:53:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UNrs5Q084672; Tue, 30 Apr 2019 23:53:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UNrswv084671; Tue, 30 Apr 2019 23:53:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201904302353.x3UNrswv084671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 30 Apr 2019 23:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346978 - in stable: 11/sys/amd64/vmm/intel 12/sys/amd64/vmm/intel X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/amd64/vmm/intel 12/sys/amd64/vmm/intel X-SVN-Commit-Revision: 346978 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 26E226D66B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 23:53:55 -0000 Author: jhb Date: Tue Apr 30 23:53:54 2019 New Revision: 346978 URL: https://svnweb.freebsd.org/changeset/base/346978 Log: MFC 344711: Fix missed posted interrupts in VT-x in bhyve. When a vCPU is HLTed, interrupts with a priority below the processor priority (PPR) should not resume the vCPU while interrupts at or above the PPR should. With posted interrupts, bhyve maintains a bitmap of pending interrupts in PIR descriptor along with a single 'pending' bit. This bit is checked by a CPU running in guest mode at various places to determine if it should be checked. In addition, another CPU can force a CPU in guest mode to check for pending interrupts by sending an IPI to a special IDT vector reserved for this purpose. bhyve had a bug in that it would only notify a guest vCPU of an interrupt (e.g. by sending the special IPI or by resuming it if it was idle due to HLT) if an interrupt arrived that was higher priority than PPR and no interrupts were currently pending. This assumed that if the 'pending' bit was set, any needed notification was already in progress. However, if the first interrupt sent to a HLTed vCPU was lower priority than PPR and the second was higher than PPR, the first interrupt would set 'pending' but not notify the vCPU, and the second interrupt would not notify the vCPU because 'pending' was already set. To fix this, track the priority of pending interrupts in a separate per-vCPU bitmask and notify a vCPU anytime an interrupt arrives that is above PPR and higher than any previously-received interrupt. This was found and debugged in the bhyve port to SmartOS maintained by Joyent. Relevant SmartOS bugs with more background: https://smartos.org/bugview/OS-6829 https://smartos.org/bugview/OS-6930 https://smartos.org/bugview/OS-7354 Modified: stable/12/sys/amd64/vmm/intel/vmx.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/amd64/vmm/intel/vmx.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/12/sys/amd64/vmm/intel/vmx.c Tue Apr 30 23:01:13 2019 (r346977) +++ stable/12/sys/amd64/vmm/intel/vmx.c Tue Apr 30 23:53:54 2019 (r346978) @@ -3,6 +3,7 @@ * * Copyright (c) 2011 NetApp, Inc. * All rights reserved. + * Copyright (c) 2018 Joyent, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -3402,8 +3403,11 @@ struct vlapic_vtx { struct vlapic vlapic; struct pir_desc *pir_desc; struct vmx *vmx; + u_int pending_prio; }; +#define VPR_PRIO_BIT(vpr) (1 << ((vpr) >> 4)) + #define VMX_CTR_PIR(vm, vcpuid, pir_desc, notify, vector, level, msg) \ do { \ VCPU_CTR2(vm, vcpuid, msg " assert %s-triggered vector %d", \ @@ -3425,7 +3429,7 @@ vmx_set_intr_ready(struct vlapic *vlapic, int vector, struct vlapic_vtx *vlapic_vtx; struct pir_desc *pir_desc; uint64_t mask; - int idx, notify; + int idx, notify = 0; vlapic_vtx = (struct vlapic_vtx *)vlapic; pir_desc = vlapic_vtx->pir_desc; @@ -3438,8 +3442,38 @@ vmx_set_intr_ready(struct vlapic *vlapic, int vector, idx = vector / 64; mask = 1UL << (vector % 64); atomic_set_long(&pir_desc->pir[idx], mask); - notify = atomic_cmpset_long(&pir_desc->pending, 0, 1); + /* + * A notification is required whenever the 'pending' bit makes a + * transition from 0->1. + * + * Even if the 'pending' bit is already asserted, notification about + * the incoming interrupt may still be necessary. For example, if a + * vCPU is HLTed with a high PPR, a low priority interrupt would cause + * the 0->1 'pending' transition with a notification, but the vCPU + * would ignore the interrupt for the time being. The same vCPU would + * need to then be notified if a high-priority interrupt arrived which + * satisfied the PPR. + * + * The priorities of interrupts injected while 'pending' is asserted + * are tracked in a custom bitfield 'pending_prio'. Should the + * to-be-injected interrupt exceed the priorities already present, the + * notification is sent. The priorities recorded in 'pending_prio' are + * cleared whenever the 'pending' bit makes another 0->1 transition. + */ + if (atomic_cmpset_long(&pir_desc->pending, 0, 1) != 0) { + notify = 1; + vlapic_vtx->pending_prio = 0; + } else { + const u_int old_prio = vlapic_vtx->pending_prio; + const u_int prio_bit = VPR_PRIO_BIT(vector & APIC_TPR_INT); + + if ((old_prio & prio_bit) == 0 && prio_bit > old_prio) { + atomic_set_int(&vlapic_vtx->pending_prio, prio_bit); + notify = 1; + } + } + VMX_CTR_PIR(vlapic->vm, vlapic->vcpuid, pir_desc, notify, vector, level, "vmx_set_intr_ready"); return (notify); @@ -3504,14 +3538,31 @@ vmx_pending_intr(struct vlapic *vlapic, int *vecptr) VCPU_CTR1(vlapic->vm, vlapic->vcpuid, "HLT with non-zero PPR %d", lapic->ppr); + vpr = 0; for (i = 3; i >= 0; i--) { pirval = pir_desc->pir[i]; if (pirval != 0) { vpr = (i * 64 + flsl(pirval) - 1) & APIC_TPR_INT; - return (vpr > ppr); + break; } } - return (0); + + /* + * If the highest-priority pending interrupt falls short of the + * processor priority of this vCPU, ensure that 'pending_prio' does not + * have any stale bits which would preclude a higher-priority interrupt + * from incurring a notification later. + */ + if (vpr <= ppr) { + const u_int prio_bit = VPR_PRIO_BIT(vpr); + const u_int old = vlapic_vtx->pending_prio; + + if (old > prio_bit && (old & prio_bit) == 0) { + vlapic_vtx->pending_prio = prio_bit; + } + return (0); + } + return (1); } static void From owner-svn-src-all@freebsd.org Tue Apr 30 23:53:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E68A315A1DEE; Tue, 30 Apr 2019 23:53:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 884D36D66C; Tue, 30 Apr 2019 23:53:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43FE9193E0; Tue, 30 Apr 2019 23:53:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UNrtPA084678; Tue, 30 Apr 2019 23:53:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UNrtUH084677; Tue, 30 Apr 2019 23:53:55 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201904302353.x3UNrtUH084677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 30 Apr 2019 23:53:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346978 - in stable: 11/sys/amd64/vmm/intel 12/sys/amd64/vmm/intel X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/amd64/vmm/intel 12/sys/amd64/vmm/intel X-SVN-Commit-Revision: 346978 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 884D36D66C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 23:53:56 -0000 Author: jhb Date: Tue Apr 30 23:53:54 2019 New Revision: 346978 URL: https://svnweb.freebsd.org/changeset/base/346978 Log: MFC 344711: Fix missed posted interrupts in VT-x in bhyve. When a vCPU is HLTed, interrupts with a priority below the processor priority (PPR) should not resume the vCPU while interrupts at or above the PPR should. With posted interrupts, bhyve maintains a bitmap of pending interrupts in PIR descriptor along with a single 'pending' bit. This bit is checked by a CPU running in guest mode at various places to determine if it should be checked. In addition, another CPU can force a CPU in guest mode to check for pending interrupts by sending an IPI to a special IDT vector reserved for this purpose. bhyve had a bug in that it would only notify a guest vCPU of an interrupt (e.g. by sending the special IPI or by resuming it if it was idle due to HLT) if an interrupt arrived that was higher priority than PPR and no interrupts were currently pending. This assumed that if the 'pending' bit was set, any needed notification was already in progress. However, if the first interrupt sent to a HLTed vCPU was lower priority than PPR and the second was higher than PPR, the first interrupt would set 'pending' but not notify the vCPU, and the second interrupt would not notify the vCPU because 'pending' was already set. To fix this, track the priority of pending interrupts in a separate per-vCPU bitmask and notify a vCPU anytime an interrupt arrives that is above PPR and higher than any previously-received interrupt. This was found and debugged in the bhyve port to SmartOS maintained by Joyent. Relevant SmartOS bugs with more background: https://smartos.org/bugview/OS-6829 https://smartos.org/bugview/OS-6930 https://smartos.org/bugview/OS-7354 Modified: stable/11/sys/amd64/vmm/intel/vmx.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/amd64/vmm/intel/vmx.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/11/sys/amd64/vmm/intel/vmx.c Tue Apr 30 23:01:13 2019 (r346977) +++ stable/11/sys/amd64/vmm/intel/vmx.c Tue Apr 30 23:53:54 2019 (r346978) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2011 NetApp, Inc. * All rights reserved. + * Copyright (c) 2018 Joyent, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -3264,8 +3265,11 @@ struct vlapic_vtx { struct vlapic vlapic; struct pir_desc *pir_desc; struct vmx *vmx; + u_int pending_prio; }; +#define VPR_PRIO_BIT(vpr) (1 << ((vpr) >> 4)) + #define VMX_CTR_PIR(vm, vcpuid, pir_desc, notify, vector, level, msg) \ do { \ VCPU_CTR2(vm, vcpuid, msg " assert %s-triggered vector %d", \ @@ -3287,7 +3291,7 @@ vmx_set_intr_ready(struct vlapic *vlapic, int vector, struct vlapic_vtx *vlapic_vtx; struct pir_desc *pir_desc; uint64_t mask; - int idx, notify; + int idx, notify = 0; vlapic_vtx = (struct vlapic_vtx *)vlapic; pir_desc = vlapic_vtx->pir_desc; @@ -3300,8 +3304,38 @@ vmx_set_intr_ready(struct vlapic *vlapic, int vector, idx = vector / 64; mask = 1UL << (vector % 64); atomic_set_long(&pir_desc->pir[idx], mask); - notify = atomic_cmpset_long(&pir_desc->pending, 0, 1); + /* + * A notification is required whenever the 'pending' bit makes a + * transition from 0->1. + * + * Even if the 'pending' bit is already asserted, notification about + * the incoming interrupt may still be necessary. For example, if a + * vCPU is HLTed with a high PPR, a low priority interrupt would cause + * the 0->1 'pending' transition with a notification, but the vCPU + * would ignore the interrupt for the time being. The same vCPU would + * need to then be notified if a high-priority interrupt arrived which + * satisfied the PPR. + * + * The priorities of interrupts injected while 'pending' is asserted + * are tracked in a custom bitfield 'pending_prio'. Should the + * to-be-injected interrupt exceed the priorities already present, the + * notification is sent. The priorities recorded in 'pending_prio' are + * cleared whenever the 'pending' bit makes another 0->1 transition. + */ + if (atomic_cmpset_long(&pir_desc->pending, 0, 1) != 0) { + notify = 1; + vlapic_vtx->pending_prio = 0; + } else { + const u_int old_prio = vlapic_vtx->pending_prio; + const u_int prio_bit = VPR_PRIO_BIT(vector & APIC_TPR_INT); + + if ((old_prio & prio_bit) == 0 && prio_bit > old_prio) { + atomic_set_int(&vlapic_vtx->pending_prio, prio_bit); + notify = 1; + } + } + VMX_CTR_PIR(vlapic->vm, vlapic->vcpuid, pir_desc, notify, vector, level, "vmx_set_intr_ready"); return (notify); @@ -3345,14 +3379,31 @@ vmx_pending_intr(struct vlapic *vlapic, int *vecptr) VCPU_CTR1(vlapic->vm, vlapic->vcpuid, "HLT with non-zero PPR %d", lapic->ppr); + vpr = 0; for (i = 3; i >= 0; i--) { pirval = pir_desc->pir[i]; if (pirval != 0) { vpr = (i * 64 + flsl(pirval) - 1) & 0xf0; - return (vpr > ppr); + break; } } - return (0); + + /* + * If the highest-priority pending interrupt falls short of the + * processor priority of this vCPU, ensure that 'pending_prio' does not + * have any stale bits which would preclude a higher-priority interrupt + * from incurring a notification later. + */ + if (vpr <= ppr) { + const u_int prio_bit = VPR_PRIO_BIT(vpr); + const u_int old = vlapic_vtx->pending_prio; + + if (old > prio_bit && (old & prio_bit) == 0) { + vlapic_vtx->pending_prio = prio_bit; + } + return (0); + } + return (1); } static void From owner-svn-src-all@freebsd.org Wed May 1 00:06:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B06AB15A22DB; Wed, 1 May 2019 00:06:30 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from mail03.asahi-net.or.jp (mail03.asahi-net.or.jp [202.224.55.15]) by mx1.freebsd.org (Postfix) with ESMTP id 8DDDD6DCFB; Wed, 1 May 2019 00:06:24 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from rv515.advok.com (pool-72-76-119-135.nwrknj.fios.verizon.net [72.76.119.135]) (Authenticated sender: NR2Y-OOT) by mail03.asahi-net.or.jp (Postfix) with ESMTPSA id A23824017F; Wed, 1 May 2019 09:06:11 +0900 (JST) Date: Tue, 30 Apr 2019 20:05:34 -0400 From: Yoshihiro Ota To: Yoshihiro Ota Cc: Ed Maste , svn-src-head , svn-src-all , src-committers Subject: Re: svn commit: r346315 - head/lib/libcasper/services/cap_fileargs Message-Id: <20190430200534.f7eb9da6d4ba113d77ed61d9@j.email.ne.jp> In-Reply-To: <20190424002434.06aad79f1135a3f2e7248da6@j.email.ne.jp> References: <201904171602.x3HG2wQq054372@repo.freebsd.org> <20190423000625.d051ac725a82186d1736858b@j.email.ne.jp> <20190424002434.06aad79f1135a3f2e7248da6@j.email.ne.jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; i386-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 8DDDD6DCFB X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of ota@j.email.ne.jp designates 202.224.55.15 as permitted sender) smtp.mailfrom=ota@j.email.ne.jp X-Spamd-Result: default: False [-1.19 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:202.224.55.0/24]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[email.ne.jp]; NEURAL_HAM_LONG(-0.60)[-0.596,0]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[sbmx.asahi-net.or.jp]; NEURAL_SPAM_SHORT(0.04)[0.041,0]; NEURAL_HAM_MEDIUM(-0.94)[-0.944,0]; IP_SCORE(0.11)[asn: 4685(0.63), country: JP(-0.06)]; RCVD_NO_TLS_LAST(0.10)[]; RCVD_IN_DNSWL_LOW(-0.10)[15.55.224.202.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:4685, ipnet:202.224.32.0/19, country:JP]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[135.119.76.72.zen.spamhaus.org : 127.0.0.10] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 00:06:30 -0000 I looked into this more. I started wondering if "xdev" has been obsolete after /usr/obj/. dir chaneg. Both of these commands worked okay: % make kernel-toolchain kernel TARGET_ARCH=mips KERNCONF=PB92 -C /usr/src % make buildworld TARGET_ARCH=arm -C /usr/src While I kept getting compile errors by: % make xdev-build TARGET_ARCH=mips TARGET=mips -C /usr/src In other words, if I don't run explict xdev command, buildworld and buildkernel compile okay. Hiro On Wed, 24 Apr 2019 00:24:34 -0400 Yoshihiro Ota wrote: > Hi Ed and thank you for taking a look. > > my svn info says 346593 which is after few other fixes were commited. > > I'm on i386 arch. > I haven't done installworld yet after picking up libcasper changes. > 'make buildworld' works fine. > 'make xdev-build' fails and I tried with both "arm" and "mips" for TARGET and TARGET_ARCH. > Both fail same way. > Please check your /usr/include/casper/ca_fileargs.h and I suspect that's where you pick up > FA_OPEN. > > I attached a log file this time. > > Regards, > Hiro > > On Tue, 23 Apr 2019 09:49:00 -0400 > Ed Maste wrote: > > > On Tue, 23 Apr 2019 at 00:07, Yoshihiro Ota wrote: > > > > > > It looks this change is causing 'make xdev TARGET=mips TARGET_ARCH=mips' to fail as the > > > following with HEAD checked out under "/usr/obj/freebsd": > > > > Hello Hiro-san, sorry about that. > > > > I tried `make xdev TARGET=mips TARGET_ARCH=mips` on HEAD just now (but > > it failed on the install as DESTDIR wasn't set and I ran as non-root). > > Just `make xdev-build` was successful though. > > > > What version were you trying to build? There were (several) followup > > commits to address issues with the initial commit of cap_fileargs > > lstat support. From owner-svn-src-all@freebsd.org Wed May 1 01:42:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE53515A3E20; Wed, 1 May 2019 01:42:41 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B8E708FE; Wed, 1 May 2019 01:42:41 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05AF81A6EE; Wed, 1 May 2019 01:42:41 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x411gekh041819; Wed, 1 May 2019 01:42:40 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x411gde2041811; Wed, 1 May 2019 01:42:39 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905010142.x411gde2041811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 1 May 2019 01:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346980 - in stable/12: . contrib/wpa contrib/wpa/hostapd contrib/wpa/hs20/client contrib/wpa/src/ap contrib/wpa/src/common contrib/wpa/src/crypto contrib/wpa/src/drivers contrib/wpa/sr... X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable/12: . contrib/wpa contrib/wpa/hostapd contrib/wpa/hs20/client contrib/wpa/src/ap contrib/wpa/src/common contrib/wpa/src/crypto contrib/wpa/src/drivers contrib/wpa/src/eap_common contrib/wpa/... X-SVN-Commit-Revision: 346980 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 48B8E708FE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 01:42:42 -0000 Author: cy Date: Wed May 1 01:42:38 2019 New Revision: 346980 URL: https://svnweb.freebsd.org/changeset/base/346980 Log: MFC r341759, r341796, r341839, r341989, r346591: The following five MFCs update wpa 2.6 --> 2.8. r341759: MFV r341618: Update wpa 2.6 --> 2.7. r341796: Clean stale wpa dependencies and objects after r341759 The wpa update added some source files with the same name as a file in another directory (found via .PATH in the previous version). Having a stale entry in a .depend file means the new file won't be built, so test for this case and if found remove all of wpa's dependency files. Sponsored by: The FreeBSD Foundation r341839: Set default ciphers. Submitted by: jkim@ r341989: Makefile.inc1: update stale wpa dependency removal statement Only stale .depend files are removed; do not mention object files. r346591: Update wpa_supplicant/hostapd 2.7 --> 2.8 Upstream documents the following advisories: - https://w1.fi/security/2019-1/sae-side-channel-attacks.txt - https://w1.fi/security/2019-2/eap-pwd-side-channel-attack.txt - https://w1.fi/security/2019-3/sae-confirm-missing-state-validation.txt - https://w1.fi/security/2019-4/eap-pwd-missing-commit-validation.txt - https://w1.fi/security/2019-5/eap-pwd-message-reassembly-issue-\ with-unexpected-fragment.txt Security: CVE-2019-9494, VU#871675, CVE-2019-9495, CVE-2019-9496, CVE-2019-9497, CVE-2019-9498, CVE-2019-9499 Relnotes: yes Added: stable/12/contrib/wpa/hostapd/README-MULTI-AP - copied unchanged from r346591, head/contrib/wpa/hostapd/README-MULTI-AP stable/12/contrib/wpa/src/ap/dpp_hostapd.c - copied, changed from r341759, head/contrib/wpa/src/ap/dpp_hostapd.c stable/12/contrib/wpa/src/ap/dpp_hostapd.h - copied, changed from r341759, head/contrib/wpa/src/ap/dpp_hostapd.h stable/12/contrib/wpa/src/ap/eth_p_oui.c - copied unchanged from r341759, head/contrib/wpa/src/ap/eth_p_oui.c stable/12/contrib/wpa/src/ap/eth_p_oui.h - copied unchanged from r341759, head/contrib/wpa/src/ap/eth_p_oui.h stable/12/contrib/wpa/src/ap/fils_hlp.c - copied, changed from r341759, head/contrib/wpa/src/ap/fils_hlp.c stable/12/contrib/wpa/src/ap/fils_hlp.h - copied unchanged from r341759, head/contrib/wpa/src/ap/fils_hlp.h stable/12/contrib/wpa/src/ap/gas_query_ap.c - copied unchanged from r341759, head/contrib/wpa/src/ap/gas_query_ap.c stable/12/contrib/wpa/src/ap/gas_query_ap.h - copied unchanged from r341759, head/contrib/wpa/src/ap/gas_query_ap.h stable/12/contrib/wpa/src/ap/ieee802_11_he.c - copied, changed from r341759, head/contrib/wpa/src/ap/ieee802_11_he.c stable/12/contrib/wpa/src/common/dhcp.h - copied unchanged from r341759, head/contrib/wpa/src/common/dhcp.h stable/12/contrib/wpa/src/common/dpp.c - copied, changed from r341759, head/contrib/wpa/src/common/dpp.c stable/12/contrib/wpa/src/common/dpp.h - copied, changed from r341759, head/contrib/wpa/src/common/dpp.h stable/12/contrib/wpa/src/common/gas_server.c - copied unchanged from r341759, head/contrib/wpa/src/common/gas_server.c stable/12/contrib/wpa/src/common/gas_server.h - copied unchanged from r341759, head/contrib/wpa/src/common/gas_server.h stable/12/contrib/wpa/src/common/ocv.c - copied unchanged from r346591, head/contrib/wpa/src/common/ocv.c stable/12/contrib/wpa/src/common/ocv.h - copied unchanged from r346591, head/contrib/wpa/src/common/ocv.h stable/12/contrib/wpa/src/crypto/crypto_linux.c - copied, changed from r341759, head/contrib/wpa/src/crypto/crypto_linux.c stable/12/contrib/wpa/src/crypto/crypto_nettle.c - copied, changed from r341759, head/contrib/wpa/src/crypto/crypto_nettle.c stable/12/contrib/wpa/src/crypto/crypto_wolfssl.c - copied, changed from r341759, head/contrib/wpa/src/crypto/crypto_wolfssl.c stable/12/contrib/wpa/src/crypto/fips_prf_wolfssl.c - copied unchanged from r341759, head/contrib/wpa/src/crypto/fips_prf_wolfssl.c stable/12/contrib/wpa/src/crypto/sha384-kdf.c - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha384-kdf.c stable/12/contrib/wpa/src/crypto/sha384.c - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha384.c stable/12/contrib/wpa/src/crypto/sha512-kdf.c - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha512-kdf.c stable/12/contrib/wpa/src/crypto/sha512-prf.c - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha512-prf.c stable/12/contrib/wpa/src/crypto/sha512.c - copied unchanged from r346591, head/contrib/wpa/src/crypto/sha512.c stable/12/contrib/wpa/src/crypto/sha512.h - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha512.h stable/12/contrib/wpa/src/crypto/tls_wolfssl.c - copied, changed from r341759, head/contrib/wpa/src/crypto/tls_wolfssl.c stable/12/contrib/wpa/src/drivers/driver_macsec_linux.c - copied, changed from r341759, head/contrib/wpa/src/drivers/driver_macsec_linux.c stable/12/contrib/wpa/src/drivers/driver_wired_common.c - copied unchanged from r341759, head/contrib/wpa/src/drivers/driver_wired_common.c stable/12/contrib/wpa/src/drivers/driver_wired_common.h - copied unchanged from r341759, head/contrib/wpa/src/drivers/driver_wired_common.h stable/12/contrib/wpa/src/utils/const_time.h - copied unchanged from r346591, head/contrib/wpa/src/utils/const_time.h stable/12/contrib/wpa/src/utils/crc32.c - copied unchanged from r341759, head/contrib/wpa/src/utils/crc32.c stable/12/contrib/wpa/src/utils/crc32.h - copied unchanged from r341759, head/contrib/wpa/src/utils/crc32.h stable/12/contrib/wpa/src/utils/json.c - copied, changed from r341759, head/contrib/wpa/src/utils/json.c stable/12/contrib/wpa/src/utils/json.h - copied unchanged from r341759, head/contrib/wpa/src/utils/json.h stable/12/contrib/wpa/wpa_supplicant/README-DPP - copied unchanged from r346591, head/contrib/wpa/wpa_supplicant/README-DPP stable/12/contrib/wpa/wpa_supplicant/dpp_supplicant.c - copied, changed from r341759, head/contrib/wpa/wpa_supplicant/dpp_supplicant.c stable/12/contrib/wpa/wpa_supplicant/dpp_supplicant.h - copied, changed from r341759, head/contrib/wpa/wpa_supplicant/dpp_supplicant.h stable/12/contrib/wpa/wpa_supplicant/examples/dpp-qrcode.py - copied, changed from r341759, head/contrib/wpa/wpa_supplicant/examples/dpp-qrcode.py stable/12/contrib/wpa/wpa_supplicant/op_classes.c - copied, changed from r341759, head/contrib/wpa/wpa_supplicant/op_classes.c stable/12/contrib/wpa/wpa_supplicant/rrm.c - copied, changed from r341759, head/contrib/wpa/wpa_supplicant/rrm.c Deleted: stable/12/contrib/wpa/src/ap/peerkey_auth.c stable/12/contrib/wpa/src/rsn_supp/peerkey.c stable/12/contrib/wpa/src/rsn_supp/peerkey.h stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_old.c stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_old.h stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_old_handlers.c stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_old_handlers.h stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_old_handlers_wps.c stable/12/contrib/wpa/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in stable/12/contrib/wpa/wpa_supplicant/examples/wpas-test.py Modified: stable/12/Makefile.inc1 stable/12/contrib/wpa/CONTRIBUTIONS stable/12/contrib/wpa/COPYING stable/12/contrib/wpa/README stable/12/contrib/wpa/hostapd/ChangeLog stable/12/contrib/wpa/hostapd/README stable/12/contrib/wpa/hostapd/config_file.c stable/12/contrib/wpa/hostapd/config_file.h stable/12/contrib/wpa/hostapd/ctrl_iface.c stable/12/contrib/wpa/hostapd/defconfig stable/12/contrib/wpa/hostapd/hlr_auc_gw.c stable/12/contrib/wpa/hostapd/hostapd.conf stable/12/contrib/wpa/hostapd/hostapd.eap_user_sqlite stable/12/contrib/wpa/hostapd/hostapd.wpa_psk stable/12/contrib/wpa/hostapd/hostapd_cli.c stable/12/contrib/wpa/hostapd/main.c stable/12/contrib/wpa/hostapd/wps-ap-nfc.py stable/12/contrib/wpa/hs20/client/Makefile stable/12/contrib/wpa/hs20/client/est.c stable/12/contrib/wpa/hs20/client/oma_dm_client.c stable/12/contrib/wpa/hs20/client/osu_client.c stable/12/contrib/wpa/hs20/client/osu_client.h stable/12/contrib/wpa/src/ap/acs.c stable/12/contrib/wpa/src/ap/acs.h stable/12/contrib/wpa/src/ap/ap_config.c stable/12/contrib/wpa/src/ap/ap_config.h stable/12/contrib/wpa/src/ap/ap_drv_ops.c stable/12/contrib/wpa/src/ap/ap_drv_ops.h stable/12/contrib/wpa/src/ap/ap_mlme.c stable/12/contrib/wpa/src/ap/authsrv.c stable/12/contrib/wpa/src/ap/beacon.c stable/12/contrib/wpa/src/ap/beacon.h stable/12/contrib/wpa/src/ap/bss_load.c stable/12/contrib/wpa/src/ap/ctrl_iface_ap.c stable/12/contrib/wpa/src/ap/ctrl_iface_ap.h stable/12/contrib/wpa/src/ap/dfs.c stable/12/contrib/wpa/src/ap/dfs.h stable/12/contrib/wpa/src/ap/dhcp_snoop.c stable/12/contrib/wpa/src/ap/drv_callbacks.c stable/12/contrib/wpa/src/ap/eap_user_db.c stable/12/contrib/wpa/src/ap/gas_serv.c stable/12/contrib/wpa/src/ap/gas_serv.h stable/12/contrib/wpa/src/ap/hostapd.c stable/12/contrib/wpa/src/ap/hostapd.h stable/12/contrib/wpa/src/ap/hs20.c stable/12/contrib/wpa/src/ap/hs20.h stable/12/contrib/wpa/src/ap/hw_features.c stable/12/contrib/wpa/src/ap/ieee802_11.c stable/12/contrib/wpa/src/ap/ieee802_11.h stable/12/contrib/wpa/src/ap/ieee802_11_auth.c stable/12/contrib/wpa/src/ap/ieee802_11_auth.h stable/12/contrib/wpa/src/ap/ieee802_11_ht.c stable/12/contrib/wpa/src/ap/ieee802_11_shared.c stable/12/contrib/wpa/src/ap/ieee802_11_vht.c stable/12/contrib/wpa/src/ap/ieee802_1x.c stable/12/contrib/wpa/src/ap/ieee802_1x.h stable/12/contrib/wpa/src/ap/ndisc_snoop.c stable/12/contrib/wpa/src/ap/neighbor_db.c stable/12/contrib/wpa/src/ap/neighbor_db.h stable/12/contrib/wpa/src/ap/pmksa_cache_auth.c stable/12/contrib/wpa/src/ap/pmksa_cache_auth.h stable/12/contrib/wpa/src/ap/rrm.c stable/12/contrib/wpa/src/ap/rrm.h stable/12/contrib/wpa/src/ap/sta_info.c stable/12/contrib/wpa/src/ap/sta_info.h stable/12/contrib/wpa/src/ap/taxonomy.c stable/12/contrib/wpa/src/ap/tkip_countermeasures.c stable/12/contrib/wpa/src/ap/vlan_full.c stable/12/contrib/wpa/src/ap/vlan_init.c stable/12/contrib/wpa/src/ap/wmm.c stable/12/contrib/wpa/src/ap/wnm_ap.c stable/12/contrib/wpa/src/ap/wnm_ap.h stable/12/contrib/wpa/src/ap/wpa_auth.c stable/12/contrib/wpa/src/ap/wpa_auth.h stable/12/contrib/wpa/src/ap/wpa_auth_ft.c stable/12/contrib/wpa/src/ap/wpa_auth_glue.c stable/12/contrib/wpa/src/ap/wpa_auth_i.h stable/12/contrib/wpa/src/ap/wpa_auth_ie.c stable/12/contrib/wpa/src/ap/wpa_auth_ie.h stable/12/contrib/wpa/src/ap/wps_hostapd.c stable/12/contrib/wpa/src/common/common_module_tests.c stable/12/contrib/wpa/src/common/ctrl_iface_common.c stable/12/contrib/wpa/src/common/ctrl_iface_common.h stable/12/contrib/wpa/src/common/defs.h stable/12/contrib/wpa/src/common/gas.c stable/12/contrib/wpa/src/common/gas.h stable/12/contrib/wpa/src/common/hw_features_common.c stable/12/contrib/wpa/src/common/hw_features_common.h stable/12/contrib/wpa/src/common/ieee802_11_common.c stable/12/contrib/wpa/src/common/ieee802_11_common.h stable/12/contrib/wpa/src/common/ieee802_11_defs.h stable/12/contrib/wpa/src/common/ieee802_1x_defs.h stable/12/contrib/wpa/src/common/privsep_commands.h stable/12/contrib/wpa/src/common/qca-vendor.h stable/12/contrib/wpa/src/common/sae.c stable/12/contrib/wpa/src/common/sae.h stable/12/contrib/wpa/src/common/version.h stable/12/contrib/wpa/src/common/wpa_common.c stable/12/contrib/wpa/src/common/wpa_common.h stable/12/contrib/wpa/src/common/wpa_ctrl.c stable/12/contrib/wpa/src/common/wpa_ctrl.h stable/12/contrib/wpa/src/common/wpa_helpers.c stable/12/contrib/wpa/src/crypto/aes-ctr.c stable/12/contrib/wpa/src/crypto/aes-internal-dec.c stable/12/contrib/wpa/src/crypto/aes-internal-enc.c stable/12/contrib/wpa/src/crypto/aes-siv.c stable/12/contrib/wpa/src/crypto/aes.h stable/12/contrib/wpa/src/crypto/aes_siv.h stable/12/contrib/wpa/src/crypto/aes_wrap.h stable/12/contrib/wpa/src/crypto/crypto.h stable/12/contrib/wpa/src/crypto/crypto_gnutls.c stable/12/contrib/wpa/src/crypto/crypto_internal-modexp.c stable/12/contrib/wpa/src/crypto/crypto_internal.c stable/12/contrib/wpa/src/crypto/crypto_libtomcrypt.c stable/12/contrib/wpa/src/crypto/crypto_module_tests.c stable/12/contrib/wpa/src/crypto/crypto_none.c stable/12/contrib/wpa/src/crypto/crypto_openssl.c stable/12/contrib/wpa/src/crypto/des-internal.c stable/12/contrib/wpa/src/crypto/dh_groups.c stable/12/contrib/wpa/src/crypto/md4-internal.c stable/12/contrib/wpa/src/crypto/ms_funcs.c stable/12/contrib/wpa/src/crypto/ms_funcs.h stable/12/contrib/wpa/src/crypto/random.c stable/12/contrib/wpa/src/crypto/sha1-internal.c stable/12/contrib/wpa/src/crypto/sha1-tlsprf.c stable/12/contrib/wpa/src/crypto/sha256-internal.c stable/12/contrib/wpa/src/crypto/sha256-kdf.c stable/12/contrib/wpa/src/crypto/sha384-prf.c stable/12/contrib/wpa/src/crypto/sha384.h stable/12/contrib/wpa/src/crypto/sha512-internal.c stable/12/contrib/wpa/src/crypto/tls.h stable/12/contrib/wpa/src/crypto/tls_gnutls.c stable/12/contrib/wpa/src/crypto/tls_internal.c stable/12/contrib/wpa/src/crypto/tls_none.c stable/12/contrib/wpa/src/crypto/tls_openssl.c stable/12/contrib/wpa/src/drivers/driver.h stable/12/contrib/wpa/src/drivers/driver_bsd.c stable/12/contrib/wpa/src/drivers/driver_common.c stable/12/contrib/wpa/src/drivers/driver_macsec_qca.c stable/12/contrib/wpa/src/drivers/driver_ndis.c stable/12/contrib/wpa/src/drivers/driver_nl80211.h stable/12/contrib/wpa/src/drivers/driver_nl80211_capa.c stable/12/contrib/wpa/src/drivers/driver_nl80211_event.c stable/12/contrib/wpa/src/drivers/driver_nl80211_monitor.c stable/12/contrib/wpa/src/drivers/driver_nl80211_scan.c stable/12/contrib/wpa/src/drivers/driver_openbsd.c stable/12/contrib/wpa/src/drivers/driver_privsep.c stable/12/contrib/wpa/src/drivers/driver_wired.c stable/12/contrib/wpa/src/drivers/drivers.c stable/12/contrib/wpa/src/eap_common/eap_eke_common.c stable/12/contrib/wpa/src/eap_common/eap_fast_common.c stable/12/contrib/wpa/src/eap_common/eap_pwd_common.c stable/12/contrib/wpa/src/eap_common/eap_pwd_common.h stable/12/contrib/wpa/src/eap_common/eap_sake_common.c stable/12/contrib/wpa/src/eap_common/eap_sake_common.h stable/12/contrib/wpa/src/eap_common/eap_sim_common.c stable/12/contrib/wpa/src/eap_peer/eap.c stable/12/contrib/wpa/src/eap_peer/eap.h stable/12/contrib/wpa/src/eap_peer/eap_aka.c stable/12/contrib/wpa/src/eap_peer/eap_config.h stable/12/contrib/wpa/src/eap_peer/eap_eke.c stable/12/contrib/wpa/src/eap_peer/eap_fast.c stable/12/contrib/wpa/src/eap_peer/eap_fast_pac.c stable/12/contrib/wpa/src/eap_peer/eap_gpsk.c stable/12/contrib/wpa/src/eap_peer/eap_i.h stable/12/contrib/wpa/src/eap_peer/eap_ikev2.c stable/12/contrib/wpa/src/eap_peer/eap_leap.c stable/12/contrib/wpa/src/eap_peer/eap_mschapv2.c stable/12/contrib/wpa/src/eap_peer/eap_pax.c stable/12/contrib/wpa/src/eap_peer/eap_peap.c stable/12/contrib/wpa/src/eap_peer/eap_proxy.h stable/12/contrib/wpa/src/eap_peer/eap_proxy_dummy.c stable/12/contrib/wpa/src/eap_peer/eap_psk.c stable/12/contrib/wpa/src/eap_peer/eap_pwd.c stable/12/contrib/wpa/src/eap_peer/eap_sake.c stable/12/contrib/wpa/src/eap_peer/eap_sim.c stable/12/contrib/wpa/src/eap_peer/eap_tls.c stable/12/contrib/wpa/src/eap_peer/eap_tls_common.c stable/12/contrib/wpa/src/eap_peer/eap_tls_common.h stable/12/contrib/wpa/src/eap_peer/eap_ttls.c stable/12/contrib/wpa/src/eap_peer/eap_wsc.c stable/12/contrib/wpa/src/eap_peer/ikev2.c stable/12/contrib/wpa/src/eap_peer/tncc.c stable/12/contrib/wpa/src/eap_server/eap.h stable/12/contrib/wpa/src/eap_server/eap_i.h stable/12/contrib/wpa/src/eap_server/eap_server.c stable/12/contrib/wpa/src/eap_server/eap_server_aka.c stable/12/contrib/wpa/src/eap_server/eap_server_eke.c stable/12/contrib/wpa/src/eap_server/eap_server_fast.c stable/12/contrib/wpa/src/eap_server/eap_server_gpsk.c stable/12/contrib/wpa/src/eap_server/eap_server_gtc.c stable/12/contrib/wpa/src/eap_server/eap_server_ikev2.c stable/12/contrib/wpa/src/eap_server/eap_server_mschapv2.c stable/12/contrib/wpa/src/eap_server/eap_server_pax.c stable/12/contrib/wpa/src/eap_server/eap_server_peap.c stable/12/contrib/wpa/src/eap_server/eap_server_psk.c stable/12/contrib/wpa/src/eap_server/eap_server_pwd.c stable/12/contrib/wpa/src/eap_server/eap_server_sake.c stable/12/contrib/wpa/src/eap_server/eap_server_sim.c stable/12/contrib/wpa/src/eap_server/eap_server_tls.c stable/12/contrib/wpa/src/eap_server/eap_server_tls_common.c stable/12/contrib/wpa/src/eap_server/eap_server_ttls.c stable/12/contrib/wpa/src/eap_server/eap_server_wsc.c stable/12/contrib/wpa/src/eap_server/eap_tls_common.h stable/12/contrib/wpa/src/eap_server/ikev2.c stable/12/contrib/wpa/src/eap_server/tncs.c stable/12/contrib/wpa/src/eapol_auth/eapol_auth_sm.c stable/12/contrib/wpa/src/eapol_auth/eapol_auth_sm.h stable/12/contrib/wpa/src/eapol_supp/eapol_supp_sm.c stable/12/contrib/wpa/src/eapol_supp/eapol_supp_sm.h stable/12/contrib/wpa/src/fst/fst.h stable/12/contrib/wpa/src/fst/fst_ctrl_aux.h stable/12/contrib/wpa/src/fst/fst_ctrl_iface.c stable/12/contrib/wpa/src/fst/fst_group.c stable/12/contrib/wpa/src/fst/fst_iface.h stable/12/contrib/wpa/src/fst/fst_session.c stable/12/contrib/wpa/src/l2_packet/l2_packet.h stable/12/contrib/wpa/src/l2_packet/l2_packet_privsep.c stable/12/contrib/wpa/src/p2p/p2p.c stable/12/contrib/wpa/src/p2p/p2p.h stable/12/contrib/wpa/src/p2p/p2p_build.c stable/12/contrib/wpa/src/p2p/p2p_go_neg.c stable/12/contrib/wpa/src/p2p/p2p_group.c stable/12/contrib/wpa/src/p2p/p2p_i.h stable/12/contrib/wpa/src/p2p/p2p_invitation.c stable/12/contrib/wpa/src/p2p/p2p_pd.c stable/12/contrib/wpa/src/p2p/p2p_sd.c stable/12/contrib/wpa/src/p2p/p2p_utils.c stable/12/contrib/wpa/src/pae/ieee802_1x_cp.c stable/12/contrib/wpa/src/pae/ieee802_1x_cp.h stable/12/contrib/wpa/src/pae/ieee802_1x_kay.c stable/12/contrib/wpa/src/pae/ieee802_1x_kay.h stable/12/contrib/wpa/src/pae/ieee802_1x_kay_i.h stable/12/contrib/wpa/src/pae/ieee802_1x_key.c stable/12/contrib/wpa/src/pae/ieee802_1x_key.h stable/12/contrib/wpa/src/pae/ieee802_1x_secy_ops.c stable/12/contrib/wpa/src/pae/ieee802_1x_secy_ops.h stable/12/contrib/wpa/src/radius/radius.c stable/12/contrib/wpa/src/radius/radius.h stable/12/contrib/wpa/src/radius/radius_client.c stable/12/contrib/wpa/src/radius/radius_das.c stable/12/contrib/wpa/src/radius/radius_das.h stable/12/contrib/wpa/src/radius/radius_server.c stable/12/contrib/wpa/src/radius/radius_server.h stable/12/contrib/wpa/src/rsn_supp/pmksa_cache.c stable/12/contrib/wpa/src/rsn_supp/pmksa_cache.h stable/12/contrib/wpa/src/rsn_supp/preauth.c stable/12/contrib/wpa/src/rsn_supp/tdls.c stable/12/contrib/wpa/src/rsn_supp/wpa.c stable/12/contrib/wpa/src/rsn_supp/wpa.h stable/12/contrib/wpa/src/rsn_supp/wpa_ft.c stable/12/contrib/wpa/src/rsn_supp/wpa_i.h stable/12/contrib/wpa/src/rsn_supp/wpa_ie.c stable/12/contrib/wpa/src/rsn_supp/wpa_ie.h stable/12/contrib/wpa/src/tls/asn1.c stable/12/contrib/wpa/src/tls/bignum.c stable/12/contrib/wpa/src/tls/libtommath.c stable/12/contrib/wpa/src/tls/rsa.c stable/12/contrib/wpa/src/tls/tlsv1_client.c stable/12/contrib/wpa/src/tls/tlsv1_client.h stable/12/contrib/wpa/src/tls/tlsv1_client_read.c stable/12/contrib/wpa/src/tls/tlsv1_client_write.c stable/12/contrib/wpa/src/tls/tlsv1_common.c stable/12/contrib/wpa/src/tls/tlsv1_cred.c stable/12/contrib/wpa/src/tls/tlsv1_server.c stable/12/contrib/wpa/src/tls/tlsv1_server.h stable/12/contrib/wpa/src/tls/tlsv1_server_i.h stable/12/contrib/wpa/src/tls/tlsv1_server_read.c stable/12/contrib/wpa/src/tls/tlsv1_server_write.c stable/12/contrib/wpa/src/tls/x509v3.c stable/12/contrib/wpa/src/utils/base64.c stable/12/contrib/wpa/src/utils/base64.h stable/12/contrib/wpa/src/utils/browser-wpadebug.c stable/12/contrib/wpa/src/utils/browser.c stable/12/contrib/wpa/src/utils/common.c stable/12/contrib/wpa/src/utils/common.h stable/12/contrib/wpa/src/utils/eloop.c stable/12/contrib/wpa/src/utils/eloop.h stable/12/contrib/wpa/src/utils/http_curl.c stable/12/contrib/wpa/src/utils/list.h stable/12/contrib/wpa/src/utils/os.h stable/12/contrib/wpa/src/utils/os_internal.c stable/12/contrib/wpa/src/utils/os_none.c stable/12/contrib/wpa/src/utils/os_unix.c stable/12/contrib/wpa/src/utils/os_win32.c stable/12/contrib/wpa/src/utils/trace.c stable/12/contrib/wpa/src/utils/utils_module_tests.c stable/12/contrib/wpa/src/utils/uuid.c stable/12/contrib/wpa/src/utils/uuid.h stable/12/contrib/wpa/src/utils/wpa_debug.c stable/12/contrib/wpa/src/utils/wpa_debug.h stable/12/contrib/wpa/src/utils/wpabuf.c stable/12/contrib/wpa/src/utils/xml-utils.c stable/12/contrib/wpa/src/wps/wps.c stable/12/contrib/wpa/src/wps/wps.h stable/12/contrib/wpa/src/wps/wps_attr_build.c stable/12/contrib/wpa/src/wps/wps_attr_parse.c stable/12/contrib/wpa/src/wps/wps_attr_parse.h stable/12/contrib/wpa/src/wps/wps_common.c stable/12/contrib/wpa/src/wps/wps_defs.h stable/12/contrib/wpa/src/wps/wps_dev_attr.c stable/12/contrib/wpa/src/wps/wps_dev_attr.h stable/12/contrib/wpa/src/wps/wps_enrollee.c stable/12/contrib/wpa/src/wps/wps_er.c stable/12/contrib/wpa/src/wps/wps_i.h stable/12/contrib/wpa/src/wps/wps_registrar.c stable/12/contrib/wpa/src/wps/wps_upnp.c stable/12/contrib/wpa/src/wps/wps_validate.c stable/12/contrib/wpa/wpa_supplicant/Android.mk stable/12/contrib/wpa/wpa_supplicant/ChangeLog stable/12/contrib/wpa/wpa_supplicant/README stable/12/contrib/wpa/wpa_supplicant/README-HS20 stable/12/contrib/wpa/wpa_supplicant/README-P2P stable/12/contrib/wpa/wpa_supplicant/android.config stable/12/contrib/wpa/wpa_supplicant/ap.c stable/12/contrib/wpa/wpa_supplicant/ap.h stable/12/contrib/wpa/wpa_supplicant/autoscan.c stable/12/contrib/wpa/wpa_supplicant/bgscan.c stable/12/contrib/wpa/wpa_supplicant/bgscan_learn.c stable/12/contrib/wpa/wpa_supplicant/bgscan_simple.c stable/12/contrib/wpa/wpa_supplicant/bss.c stable/12/contrib/wpa/wpa_supplicant/bss.h stable/12/contrib/wpa/wpa_supplicant/config.c stable/12/contrib/wpa/wpa_supplicant/config.h stable/12/contrib/wpa/wpa_supplicant/config_file.c stable/12/contrib/wpa/wpa_supplicant/config_ssid.h stable/12/contrib/wpa/wpa_supplicant/ctrl_iface.c stable/12/contrib/wpa/wpa_supplicant/ctrl_iface_named_pipe.c stable/12/contrib/wpa/wpa_supplicant/ctrl_iface_udp.c stable/12/contrib/wpa/wpa_supplicant/ctrl_iface_unix.c stable/12/contrib/wpa/wpa_supplicant/dbus/Makefile stable/12/contrib/wpa/wpa_supplicant/dbus/dbus-wpa_supplicant.conf stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_common.c stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_new.c stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_new.h stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers.c stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers.h stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers_p2p.c stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers_p2p.h stable/12/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers_wps.c stable/12/contrib/wpa/wpa_supplicant/defconfig stable/12/contrib/wpa/wpa_supplicant/driver_i.h stable/12/contrib/wpa/wpa_supplicant/eapol_test.c stable/12/contrib/wpa/wpa_supplicant/eapol_test.py stable/12/contrib/wpa/wpa_supplicant/events.c stable/12/contrib/wpa/wpa_supplicant/examples/dbus-listen-preq.py stable/12/contrib/wpa/wpa_supplicant/examples/p2p-nfc.py stable/12/contrib/wpa/wpa_supplicant/examples/p2p/p2p_connect.py stable/12/contrib/wpa/wpa_supplicant/examples/p2p/p2p_disconnect.py stable/12/contrib/wpa/wpa_supplicant/examples/p2p/p2p_find.py stable/12/contrib/wpa/wpa_supplicant/examples/p2p/p2p_flush.py stable/12/contrib/wpa/wpa_supplicant/examples/p2p/p2p_group_add.py stable/12/contrib/wpa/wpa_supplicant/examples/p2p/p2p_invite.py stable/12/contrib/wpa/wpa_supplicant/examples/p2p/p2p_listen.py stable/12/contrib/wpa/wpa_supplicant/examples/p2p/p2p_stop_find.py stable/12/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new-getall.py stable/12/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new-signals.py stable/12/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new-wps.py stable/12/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new.py stable/12/contrib/wpa/wpa_supplicant/examples/wps-ap-cli stable/12/contrib/wpa/wpa_supplicant/examples/wps-nfc.py stable/12/contrib/wpa/wpa_supplicant/gas_query.c stable/12/contrib/wpa/wpa_supplicant/gas_query.h stable/12/contrib/wpa/wpa_supplicant/hs20_supplicant.c stable/12/contrib/wpa/wpa_supplicant/hs20_supplicant.h stable/12/contrib/wpa/wpa_supplicant/ibss_rsn.c stable/12/contrib/wpa/wpa_supplicant/interworking.c stable/12/contrib/wpa/wpa_supplicant/interworking.h stable/12/contrib/wpa/wpa_supplicant/main.c stable/12/contrib/wpa/wpa_supplicant/mbo.c stable/12/contrib/wpa/wpa_supplicant/mesh.c stable/12/contrib/wpa/wpa_supplicant/mesh_mpm.c stable/12/contrib/wpa/wpa_supplicant/mesh_rsn.c stable/12/contrib/wpa/wpa_supplicant/notify.c stable/12/contrib/wpa/wpa_supplicant/notify.h stable/12/contrib/wpa/wpa_supplicant/offchannel.c stable/12/contrib/wpa/wpa_supplicant/p2p_supplicant.c stable/12/contrib/wpa/wpa_supplicant/p2p_supplicant.h stable/12/contrib/wpa/wpa_supplicant/preauth_test.c stable/12/contrib/wpa/wpa_supplicant/scan.c stable/12/contrib/wpa/wpa_supplicant/sme.c stable/12/contrib/wpa/wpa_supplicant/sme.h stable/12/contrib/wpa/wpa_supplicant/systemd/wpa_supplicant.service.in stable/12/contrib/wpa/wpa_supplicant/utils/log2pcap.py stable/12/contrib/wpa/wpa_supplicant/wifi_display.c stable/12/contrib/wpa/wpa_supplicant/wmm_ac.c stable/12/contrib/wpa/wpa_supplicant/wnm_sta.c stable/12/contrib/wpa/wpa_supplicant/wnm_sta.h stable/12/contrib/wpa/wpa_supplicant/wpa_cli.c stable/12/contrib/wpa/wpa_supplicant/wpa_passphrase.c stable/12/contrib/wpa/wpa_supplicant/wpa_priv.c stable/12/contrib/wpa/wpa_supplicant/wpa_supplicant.c stable/12/contrib/wpa/wpa_supplicant/wpa_supplicant.conf stable/12/contrib/wpa/wpa_supplicant/wpa_supplicant_i.h stable/12/contrib/wpa/wpa_supplicant/wpa_supplicant_template.conf stable/12/contrib/wpa/wpa_supplicant/wpas_glue.c stable/12/contrib/wpa/wpa_supplicant/wpas_kay.c stable/12/contrib/wpa/wpa_supplicant/wpas_kay.h stable/12/contrib/wpa/wpa_supplicant/wps_supplicant.c stable/12/contrib/wpa/wpa_supplicant/wps_supplicant.h stable/12/usr.sbin/wpa/Makefile.crypto stable/12/usr.sbin/wpa/Makefile.inc stable/12/usr.sbin/wpa/hostapd/Makefile stable/12/usr.sbin/wpa/wpa_cli/Makefile stable/12/usr.sbin/wpa/wpa_supplicant/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/Makefile.inc1 ============================================================================== --- stable/12/Makefile.inc1 Wed May 1 00:00:49 2019 (r346979) +++ stable/12/Makefile.inc1 Wed May 1 01:42:38 2019 (r346980) @@ -963,6 +963,14 @@ _cleanobj_fast_depend_hack: .PHONY rm -f ${OBJTOP}/usr.sbin/ntp/libntpevent/.depend.*; \ fi +# 20181209 r341759 track migration across wpa update + @if [ -e "${OBJTOP}/usr.sbin/wpa/wpa_supplicant/.depend.rrm.o" ] && \ + egrep -q 'src/ap/rrm.c' \ + ${OBJTOP}/usr.sbin/wpa/wpa_supplicant/.depend.rrm.o; then \ + echo "Removing stale wpa dependencies"; \ + rm -f ${OBJTOP}/usr.sbin/wpa/*/.depend*; \ + fi + _worldtmp: .PHONY @echo @echo "--------------------------------------------------------------" Modified: stable/12/contrib/wpa/CONTRIBUTIONS ============================================================================== --- stable/12/contrib/wpa/CONTRIBUTIONS Wed May 1 00:00:49 2019 (r346979) +++ stable/12/contrib/wpa/CONTRIBUTIONS Wed May 1 01:42:38 2019 (r346980) @@ -140,7 +140,7 @@ The license terms used for hostap.git files Modified BSD license (no advertisement clause): -Copyright (c) 2002-2016, Jouni Malinen and contributors +Copyright (c) 2002-2019, Jouni Malinen and contributors All Rights Reserved. Redistribution and use in source and binary forms, with or without Modified: stable/12/contrib/wpa/COPYING ============================================================================== --- stable/12/contrib/wpa/COPYING Wed May 1 00:00:49 2019 (r346979) +++ stable/12/contrib/wpa/COPYING Wed May 1 01:42:38 2019 (r346980) @@ -1,7 +1,7 @@ wpa_supplicant and hostapd -------------------------- -Copyright (c) 2002-2016, Jouni Malinen and contributors +Copyright (c) 2002-2019, Jouni Malinen and contributors All Rights Reserved. Modified: stable/12/contrib/wpa/README ============================================================================== --- stable/12/contrib/wpa/README Wed May 1 00:00:49 2019 (r346979) +++ stable/12/contrib/wpa/README Wed May 1 01:42:38 2019 (r346980) @@ -1,7 +1,7 @@ wpa_supplicant and hostapd -------------------------- -Copyright (c) 2002-2016, Jouni Malinen and contributors +Copyright (c) 2002-2019, Jouni Malinen and contributors All Rights Reserved. These programs are licensed under the BSD license (the one with Modified: stable/12/contrib/wpa/hostapd/ChangeLog ============================================================================== --- stable/12/contrib/wpa/hostapd/ChangeLog Wed May 1 00:00:49 2019 (r346979) +++ stable/12/contrib/wpa/hostapd/ChangeLog Wed May 1 01:42:38 2019 (r346980) @@ -1,5 +1,115 @@ ChangeLog for hostapd +2019-04-21 - v2.8 + * SAE changes + - added support for SAE Password Identifier + - changed default configuration to enable only group 19 + (i.e., disable groups 20, 21, 25, 26 from default configuration) and + disable all unsuitable groups completely based on REVmd changes + - improved anti-clogging token mechanism and SAE authentication + frame processing during heavy CPU load; this mitigates some issues + with potential DoS attacks trying to flood an AP with large number + of SAE messages + - added Finite Cyclic Group field in status code 77 responses + - reject use of unsuitable groups based on new implementation guidance + in REVmd (allow only FFC groups with prime >= 3072 bits and ECC + groups with prime >= 256) + - minimize timing and memory use differences in PWE derivation + [https://w1.fi/security/2019-1/] (CVE-2019-9494) + - fixed confirm message validation in error cases + [https://w1.fi/security/2019-3/] (CVE-2019-9496) + * EAP-pwd changes + - minimize timing and memory use differences in PWE derivation + [https://w1.fi/security/2019-2/] (CVE-2019-9495) + - verify peer scalar/element + [https://w1.fi/security/2019-4/] (CVE-2019-9497 and CVE-2019-9498) + - fix message reassembly issue with unexpected fragment + [https://w1.fi/security/2019-5/] + - enforce rand,mask generation rules more strictly + - fix a memory leak in PWE derivation + - disallow ECC groups with a prime under 256 bits (groups 25, 26, and + 27) + * Hotspot 2.0 changes + - added support for release number 3 + - reject release 2 or newer association without PMF + * added support for RSN operating channel validation + (CONFIG_OCV=y and configuration parameter ocv=1) + * added Multi-AP protocol support + * added FTM responder configuration + * fixed build with LibreSSL + * added FT/RRB workaround for short Ethernet frame padding + * fixed KEK2 derivation for FILS+FT + * added RSSI-based association rejection from OCE + * extended beacon reporting functionality + * VLAN changes + - allow local VLAN management with remote RADIUS authentication + - add WPA/WPA2 passphrase/PSK -based VLAN assignment + * OpenSSL: allow systemwide policies to be overridden + * extended PEAP to derive EMSK to enable use with ERP/FILS + * extended WPS to allow SAE configuration to be added automatically + for PSK (wps_cred_add_sae=1) + * fixed FT and SA Query Action frame with AP-MLME-in-driver cases + * OWE: allow Diffie-Hellman Parameter element to be included with DPP + in preparation for DPP protocol extension + * RADIUS server: started to accept ERP keyName-NAI as user identity + automatically without matching EAP database entry + * fixed PTK rekeying with FILS and FT + +2018-12-02 - v2.7 + * fixed WPA packet number reuse with replayed messages and key + reinstallation + [http://w1.fi/security/2017-1/] (CVE-2017-13082) + * added support for FILS (IEEE 802.11ai) shared key authentication + * added support for OWE (Opportunistic Wireless Encryption, RFC 8110; + and transition mode defined by WFA) + * added support for DPP (Wi-Fi Device Provisioning Protocol) + * FT: + - added local generation of PMK-R0/PMK-R1 for FT-PSK + (ft_psk_generate_local=1) + - replaced inter-AP protocol with a cleaner design that is more + easily extensible; this breaks backward compatibility and requires + all APs in the ESS to be updated at the same time to maintain FT + functionality + - added support for wildcard R0KH/R1KH + - replaced r0_key_lifetime (minutes) parameter with + ft_r0_key_lifetime (seconds) + - fixed wpa_psk_file use for FT-PSK + - fixed FT-SAE PMKID matching + - added expiration to PMK-R0 and PMK-R1 cache + - added IEEE VLAN support (including tagged VLANs) + - added support for SHA384 based AKM + * SAE + - fixed some PMKSA caching cases with SAE + - added support for configuring SAE password separately of the + WPA2 PSK/passphrase + - added option to require MFP for SAE associations + (sae_require_pmf=1) + - fixed PTK and EAPOL-Key integrity and key-wrap algorithm selection + for SAE; + note: this is not backwards compatible, i.e., both the AP and + station side implementations will need to be update at the same + time to maintain interoperability + - added support for Password Identifier + * hostapd_cli: added support for command history and completion + * added support for requesting beacon report + * large number of other fixes, cleanup, and extensions + * added option to configure EAPOL-Key retry limits + (wpa_group_update_count and wpa_pairwise_update_count) + * removed all PeerKey functionality + * fixed nl80211 AP mode configuration regression with Linux 4.15 and + newer + * added support for using wolfSSL cryptographic library + * fixed some 20/40 MHz coexistence cases where the BSS could drop to + 20 MHz even when 40 MHz would be allowed + * Hotspot 2.0 + - added support for setting Venue URL ANQP-element (venue_url) + - added support for advertising Hotspot 2.0 operator icons + - added support for Roaming Consortium Selection element + - added support for Terms and Conditions + - added support for OSEN connection in a shared RSN BSS + * added support for using OpenSSL 1.1.1 + * added EAP-pwd server support for salted passwords + 2016-10-02 - v2.6 * fixed EAP-pwd last fragment validation [http://w1.fi/security/2015-7/] (CVE-2015-5314) Modified: stable/12/contrib/wpa/hostapd/README ============================================================================== --- stable/12/contrib/wpa/hostapd/README Wed May 1 00:00:49 2019 (r346979) +++ stable/12/contrib/wpa/hostapd/README Wed May 1 01:42:38 2019 (r346980) @@ -2,7 +2,7 @@ hostapd - user space IEEE 802.11 AP and IEEE 802.1X/WP Authenticator and RADIUS authentication server ================================================================ -Copyright (c) 2002-2016, Jouni Malinen and contributors +Copyright (c) 2002-2019, Jouni Malinen and contributors All Rights Reserved. This program is licensed under the BSD license (the one with @@ -70,7 +70,7 @@ Requirements Current hardware/software requirements: - drivers: Host AP driver for Prism2/2.5/3. - (http://hostap.epitest.fi/) + (http://w1.fi/hostap-driver.html) Please note that station firmware version needs to be 1.7.0 or newer to work in WPA mode. @@ -81,8 +81,7 @@ Current hardware/software requirements: Any wired Ethernet driver for wired IEEE 802.1X authentication (experimental code) - FreeBSD -current (with some kernel mods that have not yet been - committed when hostapd v0.3.0 was released) + FreeBSD -current BSD net80211 layer (e.g., Atheros driver) @@ -186,24 +185,14 @@ Authenticator and RADIUS encapsulation between the Aut the Authentication Server. Other than this, the functionality is similar to the case with the co-located Authentication Server. -Authentication Server and Supplicant ------------------------------------- +Authentication Server +--------------------- Any RADIUS server supporting EAP should be usable as an IEEE 802.1X Authentication Server with hostapd Authenticator. FreeRADIUS (http://www.freeradius.org/) has been successfully tested with hostapd -Authenticator and both Xsupplicant (http://www.open1x.org) and Windows -XP Supplicants. EAP/TLS was used with Xsupplicant and -EAP/MD5-Challenge with Windows XP. +Authenticator. -http://www.missl.cs.umd.edu/wireless/eaptls/ has useful information -about using EAP/TLS with FreeRADIUS and Xsupplicant (just replace -Cisco access point with Host AP driver, hostapd daemon, and a Prism2 -card ;-). http://www.freeradius.org/doc/EAP-MD5.html has information -about using EAP/MD5 with FreeRADIUS, including instructions for WinXP -configuration. http://www.denobula.com/EAPTLS.pdf has a HOWTO on -EAP/TLS use with WinXP Supplicant. - Automatic WEP key configuration ------------------------------- @@ -243,16 +232,15 @@ networks that require some kind of security. Task grou of IEEE 802.11 working group (http://www.ieee802.org/11/) has worked to address the flaws of the base standard and has in practice completed its work in May 2004. The IEEE 802.11i amendment to the IEEE -802.11 standard was approved in June 2004 and this amendment is likely -to be published in July 2004. +802.11 standard was approved in June 2004 and this amendment was +published in July 2004. Wi-Fi Alliance (http://www.wi-fi.org/) used a draft version of the IEEE 802.11i work (draft 3.0) to define a subset of the security enhancements that can be implemented with existing wlan hardware. This is called Wi-Fi Protected Access (WPA). This has now become a mandatory component of interoperability testing and certification done -by Wi-Fi Alliance. Wi-Fi provides information about WPA at its web -site (http://www.wi-fi.org/OpenSection/protected_access.asp). +by Wi-Fi Alliance. IEEE 802.11 standard defined wired equivalent privacy (WEP) algorithm for protecting wireless networks. WEP uses RC4 with 40-bit keys, Copied: stable/12/contrib/wpa/hostapd/README-MULTI-AP (from r346591, head/contrib/wpa/hostapd/README-MULTI-AP) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/contrib/wpa/hostapd/README-MULTI-AP Wed May 1 01:42:38 2019 (r346980, copy of r346591, head/contrib/wpa/hostapd/README-MULTI-AP) @@ -0,0 +1,160 @@ +hostapd, wpa_supplicant and the Multi-AP Specification +====================================================== + +This document describes how hostapd and wpa_supplicant can be configured to +support the Multi-AP Specification. + +Introduction to Multi-AP +------------------------ + +The Wi-Fi Alliance Multi-AP Specification is the technical specification for +Wi-Fi CERTIFIED EasyMesh(TM) [1], the Wi-Fi Alliance® certification program for +Multi-AP. It defines control protocols between Wi-Fi® access points (APs) to +join them into a network with centralized control and operation. It is targeted +only at routers (repeaters, gateways, ...), not at clients. Clients are not +involved at all in the protocols. + +Most of the Multi-AP specification falls outside of the scope of +hostapd/wpa_supplicant. hostapd/wpa_supplicant is only involved for the items +summarized below. The rest of the protocol must be implemented by a separate +daemon, e.g., prplMesh [2]. That daemon also needs to communicate with hostapd, +e.g., to get a list of associated clients, but this can be done using the normal +hostapd interfaces. + +hostapd/wpa_supplicant needs to be configured specifically to support: +- the WPS onboarding process; +- configuring backhaul links. + +The text below refers to "Multi-AP Specification v1.0" [3]. + + +Fronthaul and backhaul links +---------------------------- + +In a Multi-AP network, the central controller can configure the BSSs on the +devices that are joined into the network. These are called fronthaul BSSs. +From the point of view of hostapd, there is nothing special about these +fronthaul BSSs. + +In addition to fronthaul BSSs, the controller can also configure backhaul +links. A backhaul link is a link between two access point devices, giving +internet access to access point devices that don't have a wired link. The +Multi-AP specification doesn't dictate this, but typically the backhaul link +will be bridged into a LAN together with (one of) the fronthaul BSS(s) and the +wired Ethernet ports. + +A backhaul link must be treated specially by hostapd and wpa_supplicant. One +side of the backhaul link is configured through the Multi-AP protocol as the +"backhaul STA", i.e., the client side of the link. A backhaul STA is like any +station and is handled appropriately by wpa_supplicant, but two additional +features are required. It must send an additional information element in each +(Re)Association Request frame ([3], section 5.2, paragraph 4). In addition, it +must use 4-address mode for all frames sent over this link ([3], section 14). +Therefore, wpa_supplicant must be configured explicitly as the backhaul STA +role, by setting 'multi_ap_backhaul_sta=1' in the network configuration block +or when configuring the network profile through the control interface. When +'multi_ap_backhaul_sta=1', wpa_supplicant includes the Multi-AP IE in +(Re)Association Request frame and verifies that it is included in the +(Re)Association Response frame. If it is not, association fails. If it is, +wpa_supplicant sets 4-address mode for this interface through a driver +callback. + +The AP side of the backhaul link is called a "backhaul BSS". Such a BSS must +be handled specially by hostapd, because it must add an additional information +element in each (Re)Association Response frame, but only to stations that have +identified themselves as backhaul stations ([3], section 5.2, paragraph 5-6). +This is important because it is possible to use the same BSS and SSID for +fronthaul and backhaul at the same time. The additional information element must +only be used for frames sent to a backhaul STA, not to a normal STA. Also, +frames sent to a backhaul STA must use 4-address mode, while frames sent to a +normal STA (fronthaul, when it's a fronthaul and backhaul BSS) must use +3-address mode. + +A BSS is configured in Multi-AP mode in hostapd by setting the 'multi_ap' +configuration option to 1 (backhaul BSS), 2 (fronthaul BSS), or 3 +(simultaneous backhaul and fronthaul BSS). If this option is set, hostapd +parses the Multi-AP information element in the Association Request frame. If the +station is a backhaul STA and the BSS is configured as a backhaul BSS, +hostapd sets up 4-address mode. Since there may be multiple stations connected +simultaneously, and each of them has a different RA (receiver address), a VLAN +is created for each backhaul STA and it is automatically added to a bridge. +This is the same behavior as for WDS, and the relevant option ('bridge' or +'wds_bridge') applies here as well. + +If 'multi_ap' is 1 (backhaul BSS only), any station that tries to associate +without the Multi-AP information element will be denied. + +If 'multi_ap' is 2 (fronthaul BSS only), any station that tries to associate +with the Multi-AP information element will be denied. That is also the only +difference with 'multi_ap' set to 0: in the latter case, the Multi-AP +information element is simply ignored. + +In summary, this is the end-to-end behavior for a backhaul BSS (i.e., +multi_ap_backhaul_sta=1 in wpa_supplicant on STA, and multi_ap=1 or 3 in +hostapd on AP). Note that point 1 means that hostapd must not be configured +with WPS support on the backhaul BSS (multi_ap=1). hostapd does not check for +that. + +1. Backhaul BSS beacons do not advertise WPS support (other than that, nothing + Multi-AP specific). +2. STA sends Authentication frame (nothing Multi-AP specific). +3. AP sends Authentication frame (nothing Multi-AP specific). +4. STA sends Association Request frame with Multi-AP IE. +5. AP sends Association Response frame with Multi-AP IE. +6. STA and AP both use 4-address mode for Data frames. + + +WPS support +----------- + +WPS requires more special handling. WPS must only be advertised on fronthaul +BSSs, not on backhaul BSSs, so WPS should not be enabled on a backhaul-only +BSS in hostapd.conf. The WPS configuration purely works on the fronthaul BSS. +When a WPS M1 message has an additional subelement that indicates a request for +a Multi-AP backhaul link, hostapd must not respond with the normal fronthaul +BSS credentials; instead, it should respond with the (potentially different) +backhaul BSS credentials. + +To support this, hostapd has the 'multi_ap_backhaul_ssid', +'multi_ap_backhaul_wpa_psk' and 'multi_ap_backhaul_wpa_passphrase' options. +When these are set on an BSS with WPS, they are used instead of the normal +credentials when hostapd receives a WPS M1 message with the Multi-AP IE. Only +WPA2-Personal is supported in the Multi-AP specification, so there is no need +to specify authentication or encryption options. For the backhaul credentials, +per-device PSK is not supported. + +If the BSS is a simultaneous backhaul and fronthaul BSS, there is no need to +specify the backhaul credentials, since the backhaul and fronthaul credentials +are identical. + +To enable the Multi-AP backhaul STA feature when it performs WPS, a new +parameter has been introduced to the WPS_PBC control interface call. When this +"multi_ap=1" option is set, it adds the Multi-AP backhaul subelement to the +Association Request frame and the M1 message. It then configures the new network +profile with 'multi_ap_backhaul_sta=1'. Note that this means that if the AP does +not follow the Multi-AP specification, wpa_supplicant will fail to associate. + +In summary, this is the end-to-end behavior for WPS of a backhaul link (i.e., +multi_ap=1 option is given in the wps_pbc call on the STA side, and multi_ap=2 +and multi_ap_backhaul_ssid and either multi_ap_backhaul_wpa_psk or +multi_ap_backhaul_wpa_passphrase are set to the credentials of a backhaul BSS +in hostapd on Registrar AP). + +1. Fronthaul BSS Beacon frames advertise WPS support (nothing Multi-AP + specific). +2. Enrollee sends Authentication frame (nothing Multi-AP specific). +3. AP sends Authentication frame (nothing Multi-AP specific). +4. Enrollee sends Association Request frame with Multi-AP IE. +5. AP sends Association Response frame with Multi-AP IE. +6. Enrollee sends M1 with additional Multi-AP subelement. +7. AP sends M8 with backhaul instead of fronthaul credentials. +8. Enrollee sends Deauthentication frame. + + +References +---------- + +[1] https://www.wi-fi.org/discover-wi-fi/wi-fi-easymesh +[2] https://github.com/prplfoundation/prplMesh +[3] https://www.wi-fi.org/file/multi-ap-specification-v10 + (requires registration) Modified: stable/12/contrib/wpa/hostapd/config_file.c ============================================================================== --- stable/12/contrib/wpa/hostapd/config_file.c Wed May 1 00:00:49 2019 (r346979) +++ stable/12/contrib/wpa/hostapd/config_file.c Wed May 1 01:42:38 2019 (r346980) @@ -1,6 +1,6 @@ /* * hostapd / Configuration file parser - * Copyright (c) 2003-2015, Jouni Malinen + * Copyright (c) 2003-2018, Jouni Malinen * * This software may be distributed under the terms of the BSD license. * See README for more details. @@ -14,6 +14,8 @@ #include "utils/common.h" #include "utils/uuid.h" #include "common/ieee802_11_defs.h" +#include "crypto/sha256.h" +#include "crypto/tls.h" #include "drivers/driver.h" #include "eap_server/eap.h" #include "radius/radius_client.h" @@ -35,7 +37,7 @@ static int hostapd_config_read_vlan_file(struct hostap const char *fname) { FILE *f; - char buf[128], *pos, *pos2; + char buf[128], *pos, *pos2, *pos3; int line = 0, vlan_id; struct hostapd_vlan *vlan; @@ -80,7 +82,10 @@ static int hostapd_config_read_vlan_file(struct hostap pos2 = pos; while (*pos2 != ' ' && *pos2 != '\t' && *pos2 != '\0') pos2++; - *pos2 = '\0'; + + if (*pos2 != '\0') + *(pos2++) = '\0'; + if (*pos == '\0' || os_strlen(pos) > IFNAMSIZ) { wpa_printf(MSG_ERROR, "Invalid VLAN ifname at line %d " "in '%s'", line, fname); @@ -88,6 +93,13 @@ static int hostapd_config_read_vlan_file(struct hostap return -1; } + while (*pos2 == ' ' || *pos2 == '\t') + pos2++; + pos3 = pos2; + while (*pos3 != ' ' && *pos3 != '\t' && *pos3 != '\0') + pos3++; + *pos3 = '\0'; + vlan = os_zalloc(sizeof(*vlan)); if (vlan == NULL) { wpa_printf(MSG_ERROR, "Out of memory while reading " @@ -100,6 +112,7 @@ static int hostapd_config_read_vlan_file(struct hostap vlan->vlan_desc.untagged = vlan_id; vlan->vlan_desc.notempty = !!vlan_id; os_strlcpy(vlan->ifname, pos, sizeof(vlan->ifname)); + os_strlcpy(vlan->bridge, pos2, sizeof(vlan->bridge)); vlan->next = bss->vlan; bss->vlan = vlan; } @@ -111,7 +124,7 @@ static int hostapd_config_read_vlan_file(struct hostap #endif /* CONFIG_NO_VLAN */ -static int hostapd_acl_comp(const void *a, const void *b) +int hostapd_acl_comp(const void *a, const void *b) { const struct mac_acl_entry *aa = a; const struct mac_acl_entry *bb = b; @@ -119,6 +132,44 @@ static int hostapd_acl_comp(const void *a, const void } +int hostapd_add_acl_maclist(struct mac_acl_entry **acl, int *num, + int vlan_id, const u8 *addr) +{ + struct mac_acl_entry *newacl; + + newacl = os_realloc_array(*acl, *num + 1, sizeof(**acl)); + if (!newacl) { + wpa_printf(MSG_ERROR, "MAC list reallocation failed"); + return -1; + } + + *acl = newacl; + os_memcpy((*acl)[*num].addr, addr, ETH_ALEN); + os_memset(&(*acl)[*num].vlan_id, 0, sizeof((*acl)[*num].vlan_id)); + (*acl)[*num].vlan_id.untagged = vlan_id; + (*acl)[*num].vlan_id.notempty = !!vlan_id; + (*num)++; + + return 0; +} + + +void hostapd_remove_acl_mac(struct mac_acl_entry **acl, int *num, + const u8 *addr) +{ + int i = 0; + + while (i < *num) { + if (os_memcmp((*acl)[i].addr, addr, ETH_ALEN) == 0) { + os_remove_in_array(*acl, *num, sizeof(**acl), i); + (*num)--; + } else { + i++; + } + } +} + + static int hostapd_config_read_maclist(const char *fname, struct mac_acl_entry **acl, int *num) { @@ -126,12 +177,8 @@ static int hostapd_config_read_maclist(const char *fna char buf[128], *pos; int line = 0; u8 addr[ETH_ALEN]; - struct mac_acl_entry *newacl; int vlan_id; - if (!fname) - return 0; - f = fopen(fname, "r"); if (!f) { wpa_printf(MSG_ERROR, "MAC list file '%s' not found.", fname); @@ -139,7 +186,7 @@ static int hostapd_config_read_maclist(const char *fna } while (fgets(buf, sizeof(buf), f)) { - int i, rem = 0; + int rem = 0; line++; @@ -169,16 +216,7 @@ static int hostapd_config_read_maclist(const char *fna } if (rem) { - i = 0; - while (i < *num) { - if (os_memcmp((*acl)[i].addr, addr, ETH_ALEN) == - 0) { - os_remove_in_array(*acl, *num, - sizeof(**acl), i); - (*num)--; - } else - i++; - } + hostapd_remove_acl_mac(acl, num, addr); continue; } vlan_id = 0; @@ -190,31 +228,78 @@ static int hostapd_config_read_maclist(const char *fna if (*pos != '\0') vlan_id = atoi(pos); - newacl = os_realloc_array(*acl, *num + 1, sizeof(**acl)); - if (newacl == NULL) { - wpa_printf(MSG_ERROR, "MAC list reallocation failed"); + if (hostapd_add_acl_maclist(acl, num, vlan_id, addr) < 0) { fclose(f); return -1; } - - *acl = newacl; - os_memcpy((*acl)[*num].addr, addr, ETH_ALEN); - os_memset(&(*acl)[*num].vlan_id, 0, - sizeof((*acl)[*num].vlan_id)); - (*acl)[*num].vlan_id.untagged = vlan_id; - (*acl)[*num].vlan_id.notempty = !!vlan_id; - (*num)++; } fclose(f); - qsort(*acl, *num, sizeof(**acl), hostapd_acl_comp); + if (*acl) + qsort(*acl, *num, sizeof(**acl), hostapd_acl_comp); return 0; } #ifdef EAP_SERVER + +static int hostapd_config_eap_user_salted(struct hostapd_eap_user *user, + const char *hash, size_t len, + char **pos, int line, + const char *fname) +{ + char *pos2 = *pos; + + while (*pos2 != '\0' && *pos2 != ' ' && *pos2 != '\t' && *pos2 != '#') + pos2++; + + if (pos2 - *pos < (int) (2 * (len + 1))) { /* at least 1 byte of salt */ + wpa_printf(MSG_ERROR, + "Invalid salted %s hash on line %d in '%s'", + hash, line, fname); + return -1; + } + + user->password = os_malloc(len); + if (!user->password) { + wpa_printf(MSG_ERROR, + "Failed to allocate memory for salted %s hash", + hash); + return -1; + } + + if (hexstr2bin(*pos, user->password, len) < 0) { + wpa_printf(MSG_ERROR, + "Invalid salted password on line %d in '%s'", + line, fname); + return -1; + } + user->password_len = len; + *pos += 2 * len; + + user->salt_len = (pos2 - *pos) / 2; + user->salt = os_malloc(user->salt_len); + if (!user->salt) { + wpa_printf(MSG_ERROR, + "Failed to allocate memory for salted %s hash", + hash); + return -1; + } + + if (hexstr2bin(*pos, user->salt, user->salt_len) < 0) { + wpa_printf(MSG_ERROR, + "Invalid salt for password on line %d in '%s'", + line, fname); + return -1; + } + + *pos = pos2; + return 0; +} + + static int hostapd_config_read_eap_user(const char *fname, struct hostapd_bss_config *conf) { @@ -223,9 +308,6 @@ static int hostapd_config_read_eap_user(const char *fn int line = 0, ret = 0, num_methods; struct hostapd_eap_user *user = NULL, *tail = NULL, *new_user = NULL; - if (!fname) - return 0; - if (os_strncmp(fname, "sqlite:", 7) == 0) { #ifdef CONFIG_SQLITE os_free(conf->eap_user_sqlite); @@ -312,13 +394,12 @@ static int hostapd_config_read_eap_user(const char *fn goto failed; } - user->identity = os_malloc(pos - start); + user->identity = os_memdup(start, pos - start); if (user->identity == NULL) { wpa_printf(MSG_ERROR, "Failed to allocate " "memory for EAP identity"); goto failed; } - os_memcpy(user->identity, start, pos - start); user->identity_len = pos - start; if (pos[0] == '"' && pos[1] == '*') { @@ -436,13 +517,12 @@ static int hostapd_config_read_eap_user(const char *fn goto failed; } - user->password = os_malloc(pos - start); + user->password = os_memdup(start, pos - start); if (user->password == NULL) { wpa_printf(MSG_ERROR, "Failed to allocate " "memory for EAP password"); goto failed; } - os_memcpy(user->password, start, pos - start); user->password_len = pos - start; pos++; @@ -471,6 +551,24 @@ static int hostapd_config_read_eap_user(const char *fn user->password_len = 16; user->password_hash = 1; pos = pos2; + } else if (os_strncmp(pos, "ssha1:", 6) == 0) { + pos += 6; + if (hostapd_config_eap_user_salted(user, "sha1", 20, + &pos, + line, fname) < 0) + goto failed; + } else if (os_strncmp(pos, "ssha256:", 8) == 0) { + pos += 8; + if (hostapd_config_eap_user_salted(user, "sha256", 32, + &pos, + line, fname) < 0) + goto failed; + } else if (os_strncmp(pos, "ssha512:", 8) == 0) { + pos += 8; + if (hostapd_config_eap_user_salted(user, "sha512", 64, + &pos, + line, fname) < 0) + goto failed; } else { pos2 = pos; while (*pos2 != '\0' && *pos2 != ' ' && @@ -522,19 +620,15 @@ static int hostapd_config_read_eap_user(const char *fn fclose(f); if (ret == 0) { - user = conf->eap_user; - while (user) { - struct hostapd_eap_user *prev; - - prev = user; - user = user->next; - hostapd_config_free_eap_user(prev); - } + hostapd_config_free_eap_users(conf->eap_user); conf->eap_user = new_user; + } else { + hostapd_config_free_eap_users(new_user); } return ret; } + #endif /* EAP_SERVER */ @@ -684,12 +778,16 @@ static int hostapd_config_parse_key_mgmt(int line, con val |= WPA_KEY_MGMT_PSK; else if (os_strcmp(start, "WPA-EAP") == 0) val |= WPA_KEY_MGMT_IEEE8021X; -#ifdef CONFIG_IEEE80211R +#ifdef CONFIG_IEEE80211R_AP else if (os_strcmp(start, "FT-PSK") == 0) val |= WPA_KEY_MGMT_FT_PSK; else if (os_strcmp(start, "FT-EAP") == 0) val |= WPA_KEY_MGMT_FT_IEEE8021X; -#endif /* CONFIG_IEEE80211R */ +#ifdef CONFIG_SHA384 + else if (os_strcmp(start, "FT-EAP-SHA384") == 0) + val |= WPA_KEY_MGMT_FT_IEEE8021X_SHA384; +#endif /* CONFIG_SHA384 */ +#endif /* CONFIG_IEEE80211R_AP */ #ifdef CONFIG_IEEE80211W else if (os_strcmp(start, "WPA-PSK-SHA256") == 0) val |= WPA_KEY_MGMT_PSK_SHA256; @@ -710,6 +808,30 @@ static int hostapd_config_parse_key_mgmt(int line, con else if (os_strcmp(start, "WPA-EAP-SUITE-B-192") == 0) val |= WPA_KEY_MGMT_IEEE8021X_SUITE_B_192; #endif /* CONFIG_SUITEB192 */ +#ifdef CONFIG_FILS + else if (os_strcmp(start, "FILS-SHA256") == 0) + val |= WPA_KEY_MGMT_FILS_SHA256; + else if (os_strcmp(start, "FILS-SHA384") == 0) + val |= WPA_KEY_MGMT_FILS_SHA384; +#ifdef CONFIG_IEEE80211R_AP + else if (os_strcmp(start, "FT-FILS-SHA256") == 0) + val |= WPA_KEY_MGMT_FT_FILS_SHA256; + else if (os_strcmp(start, "FT-FILS-SHA384") == 0) + val |= WPA_KEY_MGMT_FT_FILS_SHA384; +#endif /* CONFIG_IEEE80211R_AP */ +#endif /* CONFIG_FILS */ +#ifdef CONFIG_OWE + else if (os_strcmp(start, "OWE") == 0) + val |= WPA_KEY_MGMT_OWE; +#endif /* CONFIG_OWE */ +#ifdef CONFIG_DPP + else if (os_strcmp(start, "DPP") == 0) + val |= WPA_KEY_MGMT_DPP; +#endif /* CONFIG_DPP */ +#ifdef CONFIG_HS20 + else if (os_strcmp(start, "OSEN") == 0) + val |= WPA_KEY_MGMT_OSEN; +#endif /* CONFIG_HS20 */ else { wpa_printf(MSG_ERROR, "Line %d: invalid key_mgmt '%s'", line, start); @@ -755,17 +877,34 @@ static int hostapd_config_read_wep(struct hostapd_wep_ { size_t len = os_strlen(val); - if (keyidx < 0 || keyidx > 3 || wep->key[keyidx] != NULL) + if (keyidx < 0 || keyidx > 3) return -1; + if (len == 0) { + int i, set = 0; + + bin_clear_free(wep->key[keyidx], wep->len[keyidx]); + wep->key[keyidx] = NULL; + wep->len[keyidx] = 0; + for (i = 0; i < NUM_WEP_KEYS; i++) { + if (wep->key[i]) + set++; + } + if (!set) + wep->keys_set = 0; + return 0; + } + + if (wep->key[keyidx] != NULL) + return -1; + if (val[0] == '"') { if (len < 2 || val[len - 1] != '"') return -1; len -= 2; - wep->key[keyidx] = os_malloc(len); + wep->key[keyidx] = os_memdup(val + 1, len); if (wep->key[keyidx] == NULL) return -1; - os_memcpy(wep->key[keyidx], val + 1, len); wep->len[keyidx] = len; } else { if (len & 1) @@ -978,7 +1117,27 @@ static int hostapd_config_tx_queue(struct hostapd_conf } -#ifdef CONFIG_IEEE80211R +#ifdef CONFIG_IEEE80211R_AP + +static int rkh_derive_key(const char *pos, u8 *key, size_t key_len) +{ + u8 oldkey[16]; + int ret; + + if (!hexstr2bin(pos, key, key_len)) + return 0; + + /* Try to use old short key for backwards compatibility */ + if (hexstr2bin(pos, oldkey, sizeof(oldkey))) + return -1; + + ret = hmac_sha256_kdf(oldkey, sizeof(oldkey), "FT OLDKEY", NULL, 0, + key, key_len); + os_memset(oldkey, 0, sizeof(oldkey)); + return ret; +} + + static int add_r0kh(struct hostapd_bss_config *bss, char *value) { struct ft_remote_r0kh *r0kh; @@ -1012,7 +1171,7 @@ static int add_r0kh(struct hostapd_bss_config *bss, ch os_memcpy(r0kh->id, pos, r0kh->id_len); pos = next; - if (hexstr2bin(pos, r0kh->key, sizeof(r0kh->key))) { + if (rkh_derive_key(pos, r0kh->key, sizeof(r0kh->key)) < 0) { wpa_printf(MSG_ERROR, "Invalid R0KH key: '%s'", pos); os_free(r0kh); return -1; @@ -1057,7 +1216,7 @@ static int add_r1kh(struct hostapd_bss_config *bss, ch } pos = next; - if (hexstr2bin(pos, r1kh->key, sizeof(r1kh->key))) { + if (rkh_derive_key(pos, r1kh->key, sizeof(r1kh->key)) < 0) { wpa_printf(MSG_ERROR, "Invalid R1KH key: '%s'", pos); os_free(r1kh); return -1; @@ -1068,7 +1227,7 @@ static int add_r1kh(struct hostapd_bss_config *bss, ch return 0; } -#endif /* CONFIG_IEEE80211R */ +#endif /* CONFIG_IEEE80211R_AP */ #ifdef CONFIG_IEEE80211N @@ -1085,6 +1244,12 @@ static int hostapd_config_ht_capab(struct hostapd_conf conf->ht_capab |= HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET; conf->secondary_channel = 1; } + if (os_strstr(capab, "[HT40+]") && os_strstr(capab, "[HT40-]")) { + conf->ht_capab |= HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET; + conf->ht40_plus_minus_allowed = 1; + } + if (!os_strstr(capab, "[HT40+]") && !os_strstr(capab, "[HT40-]")) + conf->secondary_channel = 0; if (os_strstr(capab, "[SMPS-STATIC]")) { conf->ht_capab &= ~HT_CAP_INFO_SMPS_MASK; conf->ht_capab |= HT_CAP_INFO_SMPS_STATIC; @@ -1214,6 +1379,30 @@ static int hostapd_config_vht_capab(struct hostapd_con #endif /* CONFIG_IEEE80211AC */ +#ifdef CONFIG_IEEE80211AX + +static u8 find_bit_offset(u8 val) +{ + u8 res = 0; + + for (; val; val >>= 1) { + if (val & 1) + break; + res++; + } + + return res; +} + + +static u8 set_he_cap(int val, u8 mask) +{ + return (u8) (mask & (val << find_bit_offset(mask))); +} + +#endif /* CONFIG_IEEE80211AX */ + + #ifdef CONFIG_INTERWORKING static int parse_roaming_consortium(struct hostapd_bss_config *bss, char *pos, int line) @@ -1307,6 +1496,44 @@ static int parse_venue_name(struct hostapd_bss_config } +static int parse_venue_url(struct hostapd_bss_config *bss, char *pos, + int line) +{ + char *sep; + size_t nlen; + struct hostapd_venue_url *url; + int ret = -1; + + sep = os_strchr(pos, ':'); + if (!sep) + goto fail; + *sep++ = '\0'; + + nlen = os_strlen(sep); + if (nlen > 254) + goto fail; + + url = os_realloc_array(bss->venue_url, bss->venue_url_count + 1, + sizeof(struct hostapd_venue_url)); + if (!url) + goto fail; + + bss->venue_url = url; + url = &bss->venue_url[bss->venue_url_count++]; + + url->venue_number = atoi(pos); + url->url_len = nlen; + os_memcpy(url->url, sep, nlen); + + ret = 0; +fail: + if (ret) + wpa_printf(MSG_ERROR, "Line %d: Invalid venue_url '%s'", + line, pos); + return ret; +} + + static int parse_3gpp_cell_net(struct hostapd_bss_config *bss, char *buf, int line) { @@ -1857,6 +2084,24 @@ static int hs20_parse_osu_nai(struct hostapd_bss_confi } +static int hs20_parse_osu_nai2(struct hostapd_bss_config *bss, + char *pos, int line) +{ + if (bss->last_osu == NULL) { + wpa_printf(MSG_ERROR, "Line %d: Unexpected OSU field", line); + return -1; + } + + os_free(bss->last_osu->osu_nai2); + bss->last_osu->osu_nai2 = os_strdup(pos); + if (bss->last_osu->osu_nai2 == NULL) + return -1; + bss->hs20_osu_providers_nai_count++; + + return 0; +} + + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed May 1 01:43:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8BD315A3E96; Wed, 1 May 2019 01:43:19 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 992DC70A1E; Wed, 1 May 2019 01:43:19 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71DAF1A6EF; Wed, 1 May 2019 01:43:19 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x411hJ7f041899; Wed, 1 May 2019 01:43:19 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x411hIWe041891; Wed, 1 May 2019 01:43:18 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905010143.x411hIWe041891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 1 May 2019 01:43:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346981 - in stable/11: contrib/wpa contrib/wpa/hostapd contrib/wpa/hs20/client contrib/wpa/src/ap contrib/wpa/src/common contrib/wpa/src/crypto contrib/wpa/src/drivers contrib/wpa/src/... X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable/11: contrib/wpa contrib/wpa/hostapd contrib/wpa/hs20/client contrib/wpa/src/ap contrib/wpa/src/common contrib/wpa/src/crypto contrib/wpa/src/drivers contrib/wpa/src/eap_common contrib/wpa/sr... X-SVN-Commit-Revision: 346981 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 992DC70A1E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 01:43:20 -0000 Author: cy Date: Wed May 1 01:43:17 2019 New Revision: 346981 URL: https://svnweb.freebsd.org/changeset/base/346981 Log: MFC r341759, r341839, r346591: The following five MFCs update wpa 2.6 --> 2.8. r341759: MFV r341618: Update wpa 2.6 --> 2.7. r341839: Set default ciphers. Submitted by: jkim@ r346591: Update wpa_supplicant/hostapd 2.7 --> 2.8 Upstream documents the following advisories: - https://w1.fi/security/2019-1/sae-side-channel-attacks.txt - https://w1.fi/security/2019-2/eap-pwd-side-channel-attack.txt - https://w1.fi/security/2019-3/sae-confirm-missing-state-validation.txt - https://w1.fi/security/2019-4/eap-pwd-missing-commit-validation.txt - https://w1.fi/security/2019-5/eap-pwd-message-reassembly-issue-\ with-unexpected-fragment.txt Security: CVE-2019-9494, VU#871675, CVE-2019-9495, CVE-2019-9496, CVE-2019-9497, CVE-2019-9498, CVE-2019-9499 Relnotes: yes Added: stable/11/contrib/wpa/hostapd/README-MULTI-AP - copied unchanged from r346591, head/contrib/wpa/hostapd/README-MULTI-AP stable/11/contrib/wpa/src/ap/dpp_hostapd.c - copied, changed from r341759, head/contrib/wpa/src/ap/dpp_hostapd.c stable/11/contrib/wpa/src/ap/dpp_hostapd.h - copied, changed from r341759, head/contrib/wpa/src/ap/dpp_hostapd.h stable/11/contrib/wpa/src/ap/eth_p_oui.c - copied unchanged from r341759, head/contrib/wpa/src/ap/eth_p_oui.c stable/11/contrib/wpa/src/ap/eth_p_oui.h - copied unchanged from r341759, head/contrib/wpa/src/ap/eth_p_oui.h stable/11/contrib/wpa/src/ap/fils_hlp.c - copied, changed from r341759, head/contrib/wpa/src/ap/fils_hlp.c stable/11/contrib/wpa/src/ap/fils_hlp.h - copied unchanged from r341759, head/contrib/wpa/src/ap/fils_hlp.h stable/11/contrib/wpa/src/ap/gas_query_ap.c - copied unchanged from r341759, head/contrib/wpa/src/ap/gas_query_ap.c stable/11/contrib/wpa/src/ap/gas_query_ap.h - copied unchanged from r341759, head/contrib/wpa/src/ap/gas_query_ap.h stable/11/contrib/wpa/src/ap/ieee802_11_he.c - copied, changed from r341759, head/contrib/wpa/src/ap/ieee802_11_he.c stable/11/contrib/wpa/src/common/dhcp.h - copied unchanged from r341759, head/contrib/wpa/src/common/dhcp.h stable/11/contrib/wpa/src/common/dpp.c - copied, changed from r341759, head/contrib/wpa/src/common/dpp.c stable/11/contrib/wpa/src/common/dpp.h - copied, changed from r341759, head/contrib/wpa/src/common/dpp.h stable/11/contrib/wpa/src/common/gas_server.c - copied unchanged from r341759, head/contrib/wpa/src/common/gas_server.c stable/11/contrib/wpa/src/common/gas_server.h - copied unchanged from r341759, head/contrib/wpa/src/common/gas_server.h stable/11/contrib/wpa/src/common/ocv.c - copied unchanged from r346591, head/contrib/wpa/src/common/ocv.c stable/11/contrib/wpa/src/common/ocv.h - copied unchanged from r346591, head/contrib/wpa/src/common/ocv.h stable/11/contrib/wpa/src/crypto/crypto_linux.c - copied, changed from r341759, head/contrib/wpa/src/crypto/crypto_linux.c stable/11/contrib/wpa/src/crypto/crypto_nettle.c - copied, changed from r341759, head/contrib/wpa/src/crypto/crypto_nettle.c stable/11/contrib/wpa/src/crypto/crypto_wolfssl.c - copied, changed from r341759, head/contrib/wpa/src/crypto/crypto_wolfssl.c stable/11/contrib/wpa/src/crypto/fips_prf_wolfssl.c - copied unchanged from r341759, head/contrib/wpa/src/crypto/fips_prf_wolfssl.c stable/11/contrib/wpa/src/crypto/sha384-kdf.c - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha384-kdf.c stable/11/contrib/wpa/src/crypto/sha384.c - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha384.c stable/11/contrib/wpa/src/crypto/sha512-kdf.c - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha512-kdf.c stable/11/contrib/wpa/src/crypto/sha512-prf.c - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha512-prf.c stable/11/contrib/wpa/src/crypto/sha512.c - copied unchanged from r346591, head/contrib/wpa/src/crypto/sha512.c stable/11/contrib/wpa/src/crypto/sha512.h - copied unchanged from r341759, head/contrib/wpa/src/crypto/sha512.h stable/11/contrib/wpa/src/crypto/tls_wolfssl.c - copied, changed from r341759, head/contrib/wpa/src/crypto/tls_wolfssl.c stable/11/contrib/wpa/src/drivers/driver_macsec_linux.c - copied, changed from r341759, head/contrib/wpa/src/drivers/driver_macsec_linux.c stable/11/contrib/wpa/src/drivers/driver_wired_common.c - copied unchanged from r341759, head/contrib/wpa/src/drivers/driver_wired_common.c stable/11/contrib/wpa/src/drivers/driver_wired_common.h - copied unchanged from r341759, head/contrib/wpa/src/drivers/driver_wired_common.h stable/11/contrib/wpa/src/utils/const_time.h - copied unchanged from r346591, head/contrib/wpa/src/utils/const_time.h stable/11/contrib/wpa/src/utils/crc32.c - copied unchanged from r341759, head/contrib/wpa/src/utils/crc32.c stable/11/contrib/wpa/src/utils/crc32.h - copied unchanged from r341759, head/contrib/wpa/src/utils/crc32.h stable/11/contrib/wpa/src/utils/json.c - copied, changed from r341759, head/contrib/wpa/src/utils/json.c stable/11/contrib/wpa/src/utils/json.h - copied unchanged from r341759, head/contrib/wpa/src/utils/json.h stable/11/contrib/wpa/wpa_supplicant/README-DPP - copied unchanged from r346591, head/contrib/wpa/wpa_supplicant/README-DPP stable/11/contrib/wpa/wpa_supplicant/dpp_supplicant.c - copied, changed from r341759, head/contrib/wpa/wpa_supplicant/dpp_supplicant.c stable/11/contrib/wpa/wpa_supplicant/dpp_supplicant.h - copied, changed from r341759, head/contrib/wpa/wpa_supplicant/dpp_supplicant.h stable/11/contrib/wpa/wpa_supplicant/examples/dpp-qrcode.py - copied, changed from r341759, head/contrib/wpa/wpa_supplicant/examples/dpp-qrcode.py stable/11/contrib/wpa/wpa_supplicant/op_classes.c - copied, changed from r341759, head/contrib/wpa/wpa_supplicant/op_classes.c stable/11/contrib/wpa/wpa_supplicant/rrm.c - copied, changed from r341759, head/contrib/wpa/wpa_supplicant/rrm.c Deleted: stable/11/contrib/wpa/src/ap/peerkey_auth.c stable/11/contrib/wpa/src/rsn_supp/peerkey.c stable/11/contrib/wpa/src/rsn_supp/peerkey.h stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_old.c stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_old.h stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_old_handlers.c stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_old_handlers.h stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_old_handlers_wps.c stable/11/contrib/wpa/wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service.in stable/11/contrib/wpa/wpa_supplicant/examples/wpas-test.py Modified: stable/11/contrib/wpa/CONTRIBUTIONS stable/11/contrib/wpa/COPYING stable/11/contrib/wpa/README stable/11/contrib/wpa/hostapd/ChangeLog stable/11/contrib/wpa/hostapd/README stable/11/contrib/wpa/hostapd/config_file.c stable/11/contrib/wpa/hostapd/config_file.h stable/11/contrib/wpa/hostapd/ctrl_iface.c stable/11/contrib/wpa/hostapd/defconfig stable/11/contrib/wpa/hostapd/hlr_auc_gw.c stable/11/contrib/wpa/hostapd/hostapd.conf stable/11/contrib/wpa/hostapd/hostapd.eap_user_sqlite stable/11/contrib/wpa/hostapd/hostapd.wpa_psk stable/11/contrib/wpa/hostapd/hostapd_cli.c stable/11/contrib/wpa/hostapd/main.c stable/11/contrib/wpa/hostapd/wps-ap-nfc.py stable/11/contrib/wpa/hs20/client/Makefile stable/11/contrib/wpa/hs20/client/est.c stable/11/contrib/wpa/hs20/client/oma_dm_client.c stable/11/contrib/wpa/hs20/client/osu_client.c stable/11/contrib/wpa/hs20/client/osu_client.h stable/11/contrib/wpa/src/ap/acs.c stable/11/contrib/wpa/src/ap/acs.h stable/11/contrib/wpa/src/ap/ap_config.c stable/11/contrib/wpa/src/ap/ap_config.h stable/11/contrib/wpa/src/ap/ap_drv_ops.c stable/11/contrib/wpa/src/ap/ap_drv_ops.h stable/11/contrib/wpa/src/ap/ap_mlme.c stable/11/contrib/wpa/src/ap/authsrv.c stable/11/contrib/wpa/src/ap/beacon.c stable/11/contrib/wpa/src/ap/beacon.h stable/11/contrib/wpa/src/ap/bss_load.c stable/11/contrib/wpa/src/ap/ctrl_iface_ap.c stable/11/contrib/wpa/src/ap/ctrl_iface_ap.h stable/11/contrib/wpa/src/ap/dfs.c stable/11/contrib/wpa/src/ap/dfs.h stable/11/contrib/wpa/src/ap/dhcp_snoop.c stable/11/contrib/wpa/src/ap/drv_callbacks.c stable/11/contrib/wpa/src/ap/eap_user_db.c stable/11/contrib/wpa/src/ap/gas_serv.c stable/11/contrib/wpa/src/ap/gas_serv.h stable/11/contrib/wpa/src/ap/hostapd.c stable/11/contrib/wpa/src/ap/hostapd.h stable/11/contrib/wpa/src/ap/hs20.c stable/11/contrib/wpa/src/ap/hs20.h stable/11/contrib/wpa/src/ap/hw_features.c stable/11/contrib/wpa/src/ap/ieee802_11.c stable/11/contrib/wpa/src/ap/ieee802_11.h stable/11/contrib/wpa/src/ap/ieee802_11_auth.c stable/11/contrib/wpa/src/ap/ieee802_11_auth.h stable/11/contrib/wpa/src/ap/ieee802_11_ht.c stable/11/contrib/wpa/src/ap/ieee802_11_shared.c stable/11/contrib/wpa/src/ap/ieee802_11_vht.c stable/11/contrib/wpa/src/ap/ieee802_1x.c stable/11/contrib/wpa/src/ap/ieee802_1x.h stable/11/contrib/wpa/src/ap/ndisc_snoop.c stable/11/contrib/wpa/src/ap/neighbor_db.c stable/11/contrib/wpa/src/ap/neighbor_db.h stable/11/contrib/wpa/src/ap/pmksa_cache_auth.c stable/11/contrib/wpa/src/ap/pmksa_cache_auth.h stable/11/contrib/wpa/src/ap/rrm.c stable/11/contrib/wpa/src/ap/rrm.h stable/11/contrib/wpa/src/ap/sta_info.c stable/11/contrib/wpa/src/ap/sta_info.h stable/11/contrib/wpa/src/ap/taxonomy.c stable/11/contrib/wpa/src/ap/tkip_countermeasures.c stable/11/contrib/wpa/src/ap/vlan_full.c stable/11/contrib/wpa/src/ap/vlan_init.c stable/11/contrib/wpa/src/ap/wmm.c stable/11/contrib/wpa/src/ap/wnm_ap.c stable/11/contrib/wpa/src/ap/wnm_ap.h stable/11/contrib/wpa/src/ap/wpa_auth.c stable/11/contrib/wpa/src/ap/wpa_auth.h stable/11/contrib/wpa/src/ap/wpa_auth_ft.c stable/11/contrib/wpa/src/ap/wpa_auth_glue.c stable/11/contrib/wpa/src/ap/wpa_auth_i.h stable/11/contrib/wpa/src/ap/wpa_auth_ie.c stable/11/contrib/wpa/src/ap/wpa_auth_ie.h stable/11/contrib/wpa/src/ap/wps_hostapd.c stable/11/contrib/wpa/src/common/common_module_tests.c stable/11/contrib/wpa/src/common/ctrl_iface_common.c stable/11/contrib/wpa/src/common/ctrl_iface_common.h stable/11/contrib/wpa/src/common/defs.h stable/11/contrib/wpa/src/common/gas.c stable/11/contrib/wpa/src/common/gas.h stable/11/contrib/wpa/src/common/hw_features_common.c stable/11/contrib/wpa/src/common/hw_features_common.h stable/11/contrib/wpa/src/common/ieee802_11_common.c stable/11/contrib/wpa/src/common/ieee802_11_common.h stable/11/contrib/wpa/src/common/ieee802_11_defs.h stable/11/contrib/wpa/src/common/ieee802_1x_defs.h stable/11/contrib/wpa/src/common/privsep_commands.h stable/11/contrib/wpa/src/common/qca-vendor.h stable/11/contrib/wpa/src/common/sae.c stable/11/contrib/wpa/src/common/sae.h stable/11/contrib/wpa/src/common/version.h stable/11/contrib/wpa/src/common/wpa_common.c stable/11/contrib/wpa/src/common/wpa_common.h stable/11/contrib/wpa/src/common/wpa_ctrl.c stable/11/contrib/wpa/src/common/wpa_ctrl.h stable/11/contrib/wpa/src/common/wpa_helpers.c stable/11/contrib/wpa/src/crypto/aes-ctr.c stable/11/contrib/wpa/src/crypto/aes-internal-dec.c stable/11/contrib/wpa/src/crypto/aes-internal-enc.c stable/11/contrib/wpa/src/crypto/aes-siv.c stable/11/contrib/wpa/src/crypto/aes.h stable/11/contrib/wpa/src/crypto/aes_siv.h stable/11/contrib/wpa/src/crypto/aes_wrap.h stable/11/contrib/wpa/src/crypto/crypto.h stable/11/contrib/wpa/src/crypto/crypto_gnutls.c stable/11/contrib/wpa/src/crypto/crypto_internal-modexp.c stable/11/contrib/wpa/src/crypto/crypto_internal.c stable/11/contrib/wpa/src/crypto/crypto_libtomcrypt.c stable/11/contrib/wpa/src/crypto/crypto_module_tests.c stable/11/contrib/wpa/src/crypto/crypto_none.c stable/11/contrib/wpa/src/crypto/crypto_openssl.c stable/11/contrib/wpa/src/crypto/des-internal.c stable/11/contrib/wpa/src/crypto/dh_groups.c stable/11/contrib/wpa/src/crypto/md4-internal.c stable/11/contrib/wpa/src/crypto/ms_funcs.c stable/11/contrib/wpa/src/crypto/ms_funcs.h stable/11/contrib/wpa/src/crypto/random.c stable/11/contrib/wpa/src/crypto/sha1-internal.c stable/11/contrib/wpa/src/crypto/sha1-tlsprf.c stable/11/contrib/wpa/src/crypto/sha256-internal.c stable/11/contrib/wpa/src/crypto/sha256-kdf.c stable/11/contrib/wpa/src/crypto/sha384-prf.c stable/11/contrib/wpa/src/crypto/sha384.h stable/11/contrib/wpa/src/crypto/sha512-internal.c stable/11/contrib/wpa/src/crypto/tls.h stable/11/contrib/wpa/src/crypto/tls_gnutls.c stable/11/contrib/wpa/src/crypto/tls_internal.c stable/11/contrib/wpa/src/crypto/tls_none.c stable/11/contrib/wpa/src/crypto/tls_openssl.c stable/11/contrib/wpa/src/drivers/driver.h stable/11/contrib/wpa/src/drivers/driver_bsd.c stable/11/contrib/wpa/src/drivers/driver_common.c stable/11/contrib/wpa/src/drivers/driver_macsec_qca.c stable/11/contrib/wpa/src/drivers/driver_ndis.c stable/11/contrib/wpa/src/drivers/driver_nl80211.h stable/11/contrib/wpa/src/drivers/driver_nl80211_capa.c stable/11/contrib/wpa/src/drivers/driver_nl80211_event.c stable/11/contrib/wpa/src/drivers/driver_nl80211_monitor.c stable/11/contrib/wpa/src/drivers/driver_nl80211_scan.c stable/11/contrib/wpa/src/drivers/driver_openbsd.c stable/11/contrib/wpa/src/drivers/driver_privsep.c stable/11/contrib/wpa/src/drivers/driver_wired.c stable/11/contrib/wpa/src/drivers/drivers.c stable/11/contrib/wpa/src/eap_common/eap_eke_common.c stable/11/contrib/wpa/src/eap_common/eap_fast_common.c stable/11/contrib/wpa/src/eap_common/eap_pwd_common.c stable/11/contrib/wpa/src/eap_common/eap_pwd_common.h stable/11/contrib/wpa/src/eap_common/eap_sake_common.c stable/11/contrib/wpa/src/eap_common/eap_sake_common.h stable/11/contrib/wpa/src/eap_common/eap_sim_common.c stable/11/contrib/wpa/src/eap_peer/eap.c stable/11/contrib/wpa/src/eap_peer/eap.h stable/11/contrib/wpa/src/eap_peer/eap_aka.c stable/11/contrib/wpa/src/eap_peer/eap_config.h stable/11/contrib/wpa/src/eap_peer/eap_eke.c stable/11/contrib/wpa/src/eap_peer/eap_fast.c stable/11/contrib/wpa/src/eap_peer/eap_fast_pac.c stable/11/contrib/wpa/src/eap_peer/eap_gpsk.c stable/11/contrib/wpa/src/eap_peer/eap_i.h stable/11/contrib/wpa/src/eap_peer/eap_ikev2.c stable/11/contrib/wpa/src/eap_peer/eap_leap.c stable/11/contrib/wpa/src/eap_peer/eap_mschapv2.c stable/11/contrib/wpa/src/eap_peer/eap_pax.c stable/11/contrib/wpa/src/eap_peer/eap_peap.c stable/11/contrib/wpa/src/eap_peer/eap_proxy.h stable/11/contrib/wpa/src/eap_peer/eap_proxy_dummy.c stable/11/contrib/wpa/src/eap_peer/eap_psk.c stable/11/contrib/wpa/src/eap_peer/eap_pwd.c stable/11/contrib/wpa/src/eap_peer/eap_sake.c stable/11/contrib/wpa/src/eap_peer/eap_sim.c stable/11/contrib/wpa/src/eap_peer/eap_tls.c stable/11/contrib/wpa/src/eap_peer/eap_tls_common.c stable/11/contrib/wpa/src/eap_peer/eap_tls_common.h stable/11/contrib/wpa/src/eap_peer/eap_ttls.c stable/11/contrib/wpa/src/eap_peer/eap_wsc.c stable/11/contrib/wpa/src/eap_peer/ikev2.c stable/11/contrib/wpa/src/eap_peer/tncc.c stable/11/contrib/wpa/src/eap_server/eap.h stable/11/contrib/wpa/src/eap_server/eap_i.h stable/11/contrib/wpa/src/eap_server/eap_server.c stable/11/contrib/wpa/src/eap_server/eap_server_aka.c stable/11/contrib/wpa/src/eap_server/eap_server_eke.c stable/11/contrib/wpa/src/eap_server/eap_server_fast.c stable/11/contrib/wpa/src/eap_server/eap_server_gpsk.c stable/11/contrib/wpa/src/eap_server/eap_server_gtc.c stable/11/contrib/wpa/src/eap_server/eap_server_ikev2.c stable/11/contrib/wpa/src/eap_server/eap_server_mschapv2.c stable/11/contrib/wpa/src/eap_server/eap_server_pax.c stable/11/contrib/wpa/src/eap_server/eap_server_peap.c stable/11/contrib/wpa/src/eap_server/eap_server_psk.c stable/11/contrib/wpa/src/eap_server/eap_server_pwd.c stable/11/contrib/wpa/src/eap_server/eap_server_sake.c stable/11/contrib/wpa/src/eap_server/eap_server_sim.c stable/11/contrib/wpa/src/eap_server/eap_server_tls.c stable/11/contrib/wpa/src/eap_server/eap_server_tls_common.c stable/11/contrib/wpa/src/eap_server/eap_server_ttls.c stable/11/contrib/wpa/src/eap_server/eap_server_wsc.c stable/11/contrib/wpa/src/eap_server/eap_tls_common.h stable/11/contrib/wpa/src/eap_server/ikev2.c stable/11/contrib/wpa/src/eap_server/tncs.c stable/11/contrib/wpa/src/eapol_auth/eapol_auth_sm.c stable/11/contrib/wpa/src/eapol_auth/eapol_auth_sm.h stable/11/contrib/wpa/src/eapol_supp/eapol_supp_sm.c stable/11/contrib/wpa/src/eapol_supp/eapol_supp_sm.h stable/11/contrib/wpa/src/fst/fst.h stable/11/contrib/wpa/src/fst/fst_ctrl_aux.h stable/11/contrib/wpa/src/fst/fst_ctrl_iface.c stable/11/contrib/wpa/src/fst/fst_group.c stable/11/contrib/wpa/src/fst/fst_iface.h stable/11/contrib/wpa/src/fst/fst_session.c stable/11/contrib/wpa/src/l2_packet/l2_packet.h stable/11/contrib/wpa/src/l2_packet/l2_packet_privsep.c stable/11/contrib/wpa/src/p2p/p2p.c stable/11/contrib/wpa/src/p2p/p2p.h stable/11/contrib/wpa/src/p2p/p2p_build.c stable/11/contrib/wpa/src/p2p/p2p_go_neg.c stable/11/contrib/wpa/src/p2p/p2p_group.c stable/11/contrib/wpa/src/p2p/p2p_i.h stable/11/contrib/wpa/src/p2p/p2p_invitation.c stable/11/contrib/wpa/src/p2p/p2p_pd.c stable/11/contrib/wpa/src/p2p/p2p_sd.c stable/11/contrib/wpa/src/p2p/p2p_utils.c stable/11/contrib/wpa/src/pae/ieee802_1x_cp.c stable/11/contrib/wpa/src/pae/ieee802_1x_cp.h stable/11/contrib/wpa/src/pae/ieee802_1x_kay.c stable/11/contrib/wpa/src/pae/ieee802_1x_kay.h stable/11/contrib/wpa/src/pae/ieee802_1x_kay_i.h stable/11/contrib/wpa/src/pae/ieee802_1x_key.c stable/11/contrib/wpa/src/pae/ieee802_1x_key.h stable/11/contrib/wpa/src/pae/ieee802_1x_secy_ops.c stable/11/contrib/wpa/src/pae/ieee802_1x_secy_ops.h stable/11/contrib/wpa/src/radius/radius.c stable/11/contrib/wpa/src/radius/radius.h stable/11/contrib/wpa/src/radius/radius_client.c stable/11/contrib/wpa/src/radius/radius_das.c stable/11/contrib/wpa/src/radius/radius_das.h stable/11/contrib/wpa/src/radius/radius_server.c stable/11/contrib/wpa/src/radius/radius_server.h stable/11/contrib/wpa/src/rsn_supp/pmksa_cache.c stable/11/contrib/wpa/src/rsn_supp/pmksa_cache.h stable/11/contrib/wpa/src/rsn_supp/preauth.c stable/11/contrib/wpa/src/rsn_supp/tdls.c stable/11/contrib/wpa/src/rsn_supp/wpa.c stable/11/contrib/wpa/src/rsn_supp/wpa.h stable/11/contrib/wpa/src/rsn_supp/wpa_ft.c stable/11/contrib/wpa/src/rsn_supp/wpa_i.h stable/11/contrib/wpa/src/rsn_supp/wpa_ie.c stable/11/contrib/wpa/src/rsn_supp/wpa_ie.h stable/11/contrib/wpa/src/tls/asn1.c stable/11/contrib/wpa/src/tls/bignum.c stable/11/contrib/wpa/src/tls/libtommath.c stable/11/contrib/wpa/src/tls/rsa.c stable/11/contrib/wpa/src/tls/tlsv1_client.c stable/11/contrib/wpa/src/tls/tlsv1_client.h stable/11/contrib/wpa/src/tls/tlsv1_client_read.c stable/11/contrib/wpa/src/tls/tlsv1_client_write.c stable/11/contrib/wpa/src/tls/tlsv1_common.c stable/11/contrib/wpa/src/tls/tlsv1_cred.c stable/11/contrib/wpa/src/tls/tlsv1_server.c stable/11/contrib/wpa/src/tls/tlsv1_server.h stable/11/contrib/wpa/src/tls/tlsv1_server_i.h stable/11/contrib/wpa/src/tls/tlsv1_server_read.c stable/11/contrib/wpa/src/tls/tlsv1_server_write.c stable/11/contrib/wpa/src/tls/x509v3.c stable/11/contrib/wpa/src/utils/base64.c stable/11/contrib/wpa/src/utils/base64.h stable/11/contrib/wpa/src/utils/browser-wpadebug.c stable/11/contrib/wpa/src/utils/browser.c stable/11/contrib/wpa/src/utils/common.c stable/11/contrib/wpa/src/utils/common.h stable/11/contrib/wpa/src/utils/eloop.c stable/11/contrib/wpa/src/utils/eloop.h stable/11/contrib/wpa/src/utils/http_curl.c stable/11/contrib/wpa/src/utils/list.h stable/11/contrib/wpa/src/utils/os.h stable/11/contrib/wpa/src/utils/os_internal.c stable/11/contrib/wpa/src/utils/os_none.c stable/11/contrib/wpa/src/utils/os_unix.c stable/11/contrib/wpa/src/utils/os_win32.c stable/11/contrib/wpa/src/utils/trace.c stable/11/contrib/wpa/src/utils/utils_module_tests.c stable/11/contrib/wpa/src/utils/uuid.c stable/11/contrib/wpa/src/utils/uuid.h stable/11/contrib/wpa/src/utils/wpa_debug.c stable/11/contrib/wpa/src/utils/wpa_debug.h stable/11/contrib/wpa/src/utils/wpabuf.c stable/11/contrib/wpa/src/utils/xml-utils.c stable/11/contrib/wpa/src/wps/wps.c stable/11/contrib/wpa/src/wps/wps.h stable/11/contrib/wpa/src/wps/wps_attr_build.c stable/11/contrib/wpa/src/wps/wps_attr_parse.c stable/11/contrib/wpa/src/wps/wps_attr_parse.h stable/11/contrib/wpa/src/wps/wps_common.c stable/11/contrib/wpa/src/wps/wps_defs.h stable/11/contrib/wpa/src/wps/wps_dev_attr.c stable/11/contrib/wpa/src/wps/wps_dev_attr.h stable/11/contrib/wpa/src/wps/wps_enrollee.c stable/11/contrib/wpa/src/wps/wps_er.c stable/11/contrib/wpa/src/wps/wps_i.h stable/11/contrib/wpa/src/wps/wps_registrar.c stable/11/contrib/wpa/src/wps/wps_upnp.c stable/11/contrib/wpa/src/wps/wps_validate.c stable/11/contrib/wpa/wpa_supplicant/Android.mk stable/11/contrib/wpa/wpa_supplicant/ChangeLog stable/11/contrib/wpa/wpa_supplicant/README stable/11/contrib/wpa/wpa_supplicant/README-HS20 stable/11/contrib/wpa/wpa_supplicant/README-P2P stable/11/contrib/wpa/wpa_supplicant/android.config stable/11/contrib/wpa/wpa_supplicant/ap.c stable/11/contrib/wpa/wpa_supplicant/ap.h stable/11/contrib/wpa/wpa_supplicant/autoscan.c stable/11/contrib/wpa/wpa_supplicant/bgscan.c stable/11/contrib/wpa/wpa_supplicant/bgscan_learn.c stable/11/contrib/wpa/wpa_supplicant/bgscan_simple.c stable/11/contrib/wpa/wpa_supplicant/bss.c stable/11/contrib/wpa/wpa_supplicant/bss.h stable/11/contrib/wpa/wpa_supplicant/config.c stable/11/contrib/wpa/wpa_supplicant/config.h stable/11/contrib/wpa/wpa_supplicant/config_file.c stable/11/contrib/wpa/wpa_supplicant/config_ssid.h stable/11/contrib/wpa/wpa_supplicant/ctrl_iface.c stable/11/contrib/wpa/wpa_supplicant/ctrl_iface_named_pipe.c stable/11/contrib/wpa/wpa_supplicant/ctrl_iface_udp.c stable/11/contrib/wpa/wpa_supplicant/ctrl_iface_unix.c stable/11/contrib/wpa/wpa_supplicant/dbus/Makefile stable/11/contrib/wpa/wpa_supplicant/dbus/dbus-wpa_supplicant.conf stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_common.c stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_new.c stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_new.h stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers.c stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers.h stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers_p2p.c stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers_p2p.h stable/11/contrib/wpa/wpa_supplicant/dbus/dbus_new_handlers_wps.c stable/11/contrib/wpa/wpa_supplicant/defconfig stable/11/contrib/wpa/wpa_supplicant/driver_i.h stable/11/contrib/wpa/wpa_supplicant/eapol_test.c stable/11/contrib/wpa/wpa_supplicant/eapol_test.py stable/11/contrib/wpa/wpa_supplicant/events.c stable/11/contrib/wpa/wpa_supplicant/examples/dbus-listen-preq.py stable/11/contrib/wpa/wpa_supplicant/examples/p2p-nfc.py stable/11/contrib/wpa/wpa_supplicant/examples/p2p/p2p_connect.py stable/11/contrib/wpa/wpa_supplicant/examples/p2p/p2p_disconnect.py stable/11/contrib/wpa/wpa_supplicant/examples/p2p/p2p_find.py stable/11/contrib/wpa/wpa_supplicant/examples/p2p/p2p_flush.py stable/11/contrib/wpa/wpa_supplicant/examples/p2p/p2p_group_add.py stable/11/contrib/wpa/wpa_supplicant/examples/p2p/p2p_invite.py stable/11/contrib/wpa/wpa_supplicant/examples/p2p/p2p_listen.py stable/11/contrib/wpa/wpa_supplicant/examples/p2p/p2p_stop_find.py stable/11/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new-getall.py stable/11/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new-signals.py stable/11/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new-wps.py stable/11/contrib/wpa/wpa_supplicant/examples/wpas-dbus-new.py stable/11/contrib/wpa/wpa_supplicant/examples/wps-ap-cli stable/11/contrib/wpa/wpa_supplicant/examples/wps-nfc.py stable/11/contrib/wpa/wpa_supplicant/gas_query.c stable/11/contrib/wpa/wpa_supplicant/gas_query.h stable/11/contrib/wpa/wpa_supplicant/hs20_supplicant.c stable/11/contrib/wpa/wpa_supplicant/hs20_supplicant.h stable/11/contrib/wpa/wpa_supplicant/ibss_rsn.c stable/11/contrib/wpa/wpa_supplicant/interworking.c stable/11/contrib/wpa/wpa_supplicant/interworking.h stable/11/contrib/wpa/wpa_supplicant/main.c stable/11/contrib/wpa/wpa_supplicant/mbo.c stable/11/contrib/wpa/wpa_supplicant/mesh.c stable/11/contrib/wpa/wpa_supplicant/mesh_mpm.c stable/11/contrib/wpa/wpa_supplicant/mesh_rsn.c stable/11/contrib/wpa/wpa_supplicant/notify.c stable/11/contrib/wpa/wpa_supplicant/notify.h stable/11/contrib/wpa/wpa_supplicant/offchannel.c stable/11/contrib/wpa/wpa_supplicant/p2p_supplicant.c stable/11/contrib/wpa/wpa_supplicant/p2p_supplicant.h stable/11/contrib/wpa/wpa_supplicant/preauth_test.c stable/11/contrib/wpa/wpa_supplicant/scan.c stable/11/contrib/wpa/wpa_supplicant/sme.c stable/11/contrib/wpa/wpa_supplicant/sme.h stable/11/contrib/wpa/wpa_supplicant/systemd/wpa_supplicant.service.in stable/11/contrib/wpa/wpa_supplicant/utils/log2pcap.py stable/11/contrib/wpa/wpa_supplicant/wifi_display.c stable/11/contrib/wpa/wpa_supplicant/wmm_ac.c stable/11/contrib/wpa/wpa_supplicant/wnm_sta.c stable/11/contrib/wpa/wpa_supplicant/wnm_sta.h stable/11/contrib/wpa/wpa_supplicant/wpa_cli.c stable/11/contrib/wpa/wpa_supplicant/wpa_passphrase.c stable/11/contrib/wpa/wpa_supplicant/wpa_priv.c stable/11/contrib/wpa/wpa_supplicant/wpa_supplicant.c stable/11/contrib/wpa/wpa_supplicant/wpa_supplicant.conf stable/11/contrib/wpa/wpa_supplicant/wpa_supplicant_i.h stable/11/contrib/wpa/wpa_supplicant/wpa_supplicant_template.conf stable/11/contrib/wpa/wpa_supplicant/wpas_glue.c stable/11/contrib/wpa/wpa_supplicant/wpas_kay.c stable/11/contrib/wpa/wpa_supplicant/wpas_kay.h stable/11/contrib/wpa/wpa_supplicant/wps_supplicant.c stable/11/contrib/wpa/wpa_supplicant/wps_supplicant.h stable/11/usr.sbin/wpa/Makefile.crypto stable/11/usr.sbin/wpa/Makefile.inc stable/11/usr.sbin/wpa/hostapd/Makefile stable/11/usr.sbin/wpa/wpa_cli/Makefile stable/11/usr.sbin/wpa/wpa_supplicant/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/wpa/CONTRIBUTIONS ============================================================================== --- stable/11/contrib/wpa/CONTRIBUTIONS Wed May 1 01:42:38 2019 (r346980) +++ stable/11/contrib/wpa/CONTRIBUTIONS Wed May 1 01:43:17 2019 (r346981) @@ -140,7 +140,7 @@ The license terms used for hostap.git files Modified BSD license (no advertisement clause): -Copyright (c) 2002-2016, Jouni Malinen and contributors +Copyright (c) 2002-2019, Jouni Malinen and contributors All Rights Reserved. Redistribution and use in source and binary forms, with or without Modified: stable/11/contrib/wpa/COPYING ============================================================================== --- stable/11/contrib/wpa/COPYING Wed May 1 01:42:38 2019 (r346980) +++ stable/11/contrib/wpa/COPYING Wed May 1 01:43:17 2019 (r346981) @@ -1,7 +1,7 @@ wpa_supplicant and hostapd -------------------------- -Copyright (c) 2002-2016, Jouni Malinen and contributors +Copyright (c) 2002-2019, Jouni Malinen and contributors All Rights Reserved. Modified: stable/11/contrib/wpa/README ============================================================================== --- stable/11/contrib/wpa/README Wed May 1 01:42:38 2019 (r346980) +++ stable/11/contrib/wpa/README Wed May 1 01:43:17 2019 (r346981) @@ -1,7 +1,7 @@ wpa_supplicant and hostapd -------------------------- -Copyright (c) 2002-2016, Jouni Malinen and contributors +Copyright (c) 2002-2019, Jouni Malinen and contributors All Rights Reserved. These programs are licensed under the BSD license (the one with Modified: stable/11/contrib/wpa/hostapd/ChangeLog ============================================================================== --- stable/11/contrib/wpa/hostapd/ChangeLog Wed May 1 01:42:38 2019 (r346980) +++ stable/11/contrib/wpa/hostapd/ChangeLog Wed May 1 01:43:17 2019 (r346981) @@ -1,5 +1,115 @@ ChangeLog for hostapd +2019-04-21 - v2.8 + * SAE changes + - added support for SAE Password Identifier + - changed default configuration to enable only group 19 + (i.e., disable groups 20, 21, 25, 26 from default configuration) and + disable all unsuitable groups completely based on REVmd changes + - improved anti-clogging token mechanism and SAE authentication + frame processing during heavy CPU load; this mitigates some issues + with potential DoS attacks trying to flood an AP with large number + of SAE messages + - added Finite Cyclic Group field in status code 77 responses + - reject use of unsuitable groups based on new implementation guidance + in REVmd (allow only FFC groups with prime >= 3072 bits and ECC + groups with prime >= 256) + - minimize timing and memory use differences in PWE derivation + [https://w1.fi/security/2019-1/] (CVE-2019-9494) + - fixed confirm message validation in error cases + [https://w1.fi/security/2019-3/] (CVE-2019-9496) + * EAP-pwd changes + - minimize timing and memory use differences in PWE derivation + [https://w1.fi/security/2019-2/] (CVE-2019-9495) + - verify peer scalar/element + [https://w1.fi/security/2019-4/] (CVE-2019-9497 and CVE-2019-9498) + - fix message reassembly issue with unexpected fragment + [https://w1.fi/security/2019-5/] + - enforce rand,mask generation rules more strictly + - fix a memory leak in PWE derivation + - disallow ECC groups with a prime under 256 bits (groups 25, 26, and + 27) + * Hotspot 2.0 changes + - added support for release number 3 + - reject release 2 or newer association without PMF + * added support for RSN operating channel validation + (CONFIG_OCV=y and configuration parameter ocv=1) + * added Multi-AP protocol support + * added FTM responder configuration + * fixed build with LibreSSL + * added FT/RRB workaround for short Ethernet frame padding + * fixed KEK2 derivation for FILS+FT + * added RSSI-based association rejection from OCE + * extended beacon reporting functionality + * VLAN changes + - allow local VLAN management with remote RADIUS authentication + - add WPA/WPA2 passphrase/PSK -based VLAN assignment + * OpenSSL: allow systemwide policies to be overridden + * extended PEAP to derive EMSK to enable use with ERP/FILS + * extended WPS to allow SAE configuration to be added automatically + for PSK (wps_cred_add_sae=1) + * fixed FT and SA Query Action frame with AP-MLME-in-driver cases + * OWE: allow Diffie-Hellman Parameter element to be included with DPP + in preparation for DPP protocol extension + * RADIUS server: started to accept ERP keyName-NAI as user identity + automatically without matching EAP database entry + * fixed PTK rekeying with FILS and FT + +2018-12-02 - v2.7 + * fixed WPA packet number reuse with replayed messages and key + reinstallation + [http://w1.fi/security/2017-1/] (CVE-2017-13082) + * added support for FILS (IEEE 802.11ai) shared key authentication + * added support for OWE (Opportunistic Wireless Encryption, RFC 8110; + and transition mode defined by WFA) + * added support for DPP (Wi-Fi Device Provisioning Protocol) + * FT: + - added local generation of PMK-R0/PMK-R1 for FT-PSK + (ft_psk_generate_local=1) + - replaced inter-AP protocol with a cleaner design that is more + easily extensible; this breaks backward compatibility and requires + all APs in the ESS to be updated at the same time to maintain FT + functionality + - added support for wildcard R0KH/R1KH + - replaced r0_key_lifetime (minutes) parameter with + ft_r0_key_lifetime (seconds) + - fixed wpa_psk_file use for FT-PSK + - fixed FT-SAE PMKID matching + - added expiration to PMK-R0 and PMK-R1 cache + - added IEEE VLAN support (including tagged VLANs) + - added support for SHA384 based AKM + * SAE + - fixed some PMKSA caching cases with SAE + - added support for configuring SAE password separately of the + WPA2 PSK/passphrase + - added option to require MFP for SAE associations + (sae_require_pmf=1) + - fixed PTK and EAPOL-Key integrity and key-wrap algorithm selection + for SAE; + note: this is not backwards compatible, i.e., both the AP and + station side implementations will need to be update at the same + time to maintain interoperability + - added support for Password Identifier + * hostapd_cli: added support for command history and completion + * added support for requesting beacon report + * large number of other fixes, cleanup, and extensions + * added option to configure EAPOL-Key retry limits + (wpa_group_update_count and wpa_pairwise_update_count) + * removed all PeerKey functionality + * fixed nl80211 AP mode configuration regression with Linux 4.15 and + newer + * added support for using wolfSSL cryptographic library + * fixed some 20/40 MHz coexistence cases where the BSS could drop to + 20 MHz even when 40 MHz would be allowed + * Hotspot 2.0 + - added support for setting Venue URL ANQP-element (venue_url) + - added support for advertising Hotspot 2.0 operator icons + - added support for Roaming Consortium Selection element + - added support for Terms and Conditions + - added support for OSEN connection in a shared RSN BSS + * added support for using OpenSSL 1.1.1 + * added EAP-pwd server support for salted passwords + 2016-10-02 - v2.6 * fixed EAP-pwd last fragment validation [http://w1.fi/security/2015-7/] (CVE-2015-5314) Modified: stable/11/contrib/wpa/hostapd/README ============================================================================== --- stable/11/contrib/wpa/hostapd/README Wed May 1 01:42:38 2019 (r346980) +++ stable/11/contrib/wpa/hostapd/README Wed May 1 01:43:17 2019 (r346981) @@ -2,7 +2,7 @@ hostapd - user space IEEE 802.11 AP and IEEE 802.1X/WP Authenticator and RADIUS authentication server ================================================================ -Copyright (c) 2002-2016, Jouni Malinen and contributors +Copyright (c) 2002-2019, Jouni Malinen and contributors All Rights Reserved. This program is licensed under the BSD license (the one with @@ -70,7 +70,7 @@ Requirements Current hardware/software requirements: - drivers: Host AP driver for Prism2/2.5/3. - (http://hostap.epitest.fi/) + (http://w1.fi/hostap-driver.html) Please note that station firmware version needs to be 1.7.0 or newer to work in WPA mode. @@ -81,8 +81,7 @@ Current hardware/software requirements: Any wired Ethernet driver for wired IEEE 802.1X authentication (experimental code) - FreeBSD -current (with some kernel mods that have not yet been - committed when hostapd v0.3.0 was released) + FreeBSD -current BSD net80211 layer (e.g., Atheros driver) @@ -186,24 +185,14 @@ Authenticator and RADIUS encapsulation between the Aut the Authentication Server. Other than this, the functionality is similar to the case with the co-located Authentication Server. -Authentication Server and Supplicant ------------------------------------- +Authentication Server +--------------------- Any RADIUS server supporting EAP should be usable as an IEEE 802.1X Authentication Server with hostapd Authenticator. FreeRADIUS (http://www.freeradius.org/) has been successfully tested with hostapd -Authenticator and both Xsupplicant (http://www.open1x.org) and Windows -XP Supplicants. EAP/TLS was used with Xsupplicant and -EAP/MD5-Challenge with Windows XP. +Authenticator. -http://www.missl.cs.umd.edu/wireless/eaptls/ has useful information -about using EAP/TLS with FreeRADIUS and Xsupplicant (just replace -Cisco access point with Host AP driver, hostapd daemon, and a Prism2 -card ;-). http://www.freeradius.org/doc/EAP-MD5.html has information -about using EAP/MD5 with FreeRADIUS, including instructions for WinXP -configuration. http://www.denobula.com/EAPTLS.pdf has a HOWTO on -EAP/TLS use with WinXP Supplicant. - Automatic WEP key configuration ------------------------------- @@ -243,16 +232,15 @@ networks that require some kind of security. Task grou of IEEE 802.11 working group (http://www.ieee802.org/11/) has worked to address the flaws of the base standard and has in practice completed its work in May 2004. The IEEE 802.11i amendment to the IEEE -802.11 standard was approved in June 2004 and this amendment is likely -to be published in July 2004. +802.11 standard was approved in June 2004 and this amendment was +published in July 2004. Wi-Fi Alliance (http://www.wi-fi.org/) used a draft version of the IEEE 802.11i work (draft 3.0) to define a subset of the security enhancements that can be implemented with existing wlan hardware. This is called Wi-Fi Protected Access (WPA). This has now become a mandatory component of interoperability testing and certification done -by Wi-Fi Alliance. Wi-Fi provides information about WPA at its web -site (http://www.wi-fi.org/OpenSection/protected_access.asp). +by Wi-Fi Alliance. IEEE 802.11 standard defined wired equivalent privacy (WEP) algorithm for protecting wireless networks. WEP uses RC4 with 40-bit keys, Copied: stable/11/contrib/wpa/hostapd/README-MULTI-AP (from r346591, head/contrib/wpa/hostapd/README-MULTI-AP) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/wpa/hostapd/README-MULTI-AP Wed May 1 01:43:17 2019 (r346981, copy of r346591, head/contrib/wpa/hostapd/README-MULTI-AP) @@ -0,0 +1,160 @@ +hostapd, wpa_supplicant and the Multi-AP Specification +====================================================== + +This document describes how hostapd and wpa_supplicant can be configured to +support the Multi-AP Specification. + +Introduction to Multi-AP +------------------------ + +The Wi-Fi Alliance Multi-AP Specification is the technical specification for +Wi-Fi CERTIFIED EasyMesh(TM) [1], the Wi-Fi Alliance® certification program for +Multi-AP. It defines control protocols between Wi-Fi® access points (APs) to +join them into a network with centralized control and operation. It is targeted +only at routers (repeaters, gateways, ...), not at clients. Clients are not +involved at all in the protocols. + +Most of the Multi-AP specification falls outside of the scope of +hostapd/wpa_supplicant. hostapd/wpa_supplicant is only involved for the items +summarized below. The rest of the protocol must be implemented by a separate +daemon, e.g., prplMesh [2]. That daemon also needs to communicate with hostapd, +e.g., to get a list of associated clients, but this can be done using the normal +hostapd interfaces. + +hostapd/wpa_supplicant needs to be configured specifically to support: +- the WPS onboarding process; +- configuring backhaul links. + +The text below refers to "Multi-AP Specification v1.0" [3]. + + +Fronthaul and backhaul links +---------------------------- + +In a Multi-AP network, the central controller can configure the BSSs on the +devices that are joined into the network. These are called fronthaul BSSs. +From the point of view of hostapd, there is nothing special about these +fronthaul BSSs. + +In addition to fronthaul BSSs, the controller can also configure backhaul +links. A backhaul link is a link between two access point devices, giving +internet access to access point devices that don't have a wired link. The +Multi-AP specification doesn't dictate this, but typically the backhaul link +will be bridged into a LAN together with (one of) the fronthaul BSS(s) and the +wired Ethernet ports. + +A backhaul link must be treated specially by hostapd and wpa_supplicant. One +side of the backhaul link is configured through the Multi-AP protocol as the +"backhaul STA", i.e., the client side of the link. A backhaul STA is like any +station and is handled appropriately by wpa_supplicant, but two additional +features are required. It must send an additional information element in each +(Re)Association Request frame ([3], section 5.2, paragraph 4). In addition, it +must use 4-address mode for all frames sent over this link ([3], section 14). +Therefore, wpa_supplicant must be configured explicitly as the backhaul STA +role, by setting 'multi_ap_backhaul_sta=1' in the network configuration block +or when configuring the network profile through the control interface. When +'multi_ap_backhaul_sta=1', wpa_supplicant includes the Multi-AP IE in +(Re)Association Request frame and verifies that it is included in the +(Re)Association Response frame. If it is not, association fails. If it is, +wpa_supplicant sets 4-address mode for this interface through a driver +callback. + +The AP side of the backhaul link is called a "backhaul BSS". Such a BSS must +be handled specially by hostapd, because it must add an additional information +element in each (Re)Association Response frame, but only to stations that have +identified themselves as backhaul stations ([3], section 5.2, paragraph 5-6). +This is important because it is possible to use the same BSS and SSID for +fronthaul and backhaul at the same time. The additional information element must +only be used for frames sent to a backhaul STA, not to a normal STA. Also, +frames sent to a backhaul STA must use 4-address mode, while frames sent to a +normal STA (fronthaul, when it's a fronthaul and backhaul BSS) must use +3-address mode. + +A BSS is configured in Multi-AP mode in hostapd by setting the 'multi_ap' +configuration option to 1 (backhaul BSS), 2 (fronthaul BSS), or 3 +(simultaneous backhaul and fronthaul BSS). If this option is set, hostapd +parses the Multi-AP information element in the Association Request frame. If the +station is a backhaul STA and the BSS is configured as a backhaul BSS, +hostapd sets up 4-address mode. Since there may be multiple stations connected +simultaneously, and each of them has a different RA (receiver address), a VLAN +is created for each backhaul STA and it is automatically added to a bridge. +This is the same behavior as for WDS, and the relevant option ('bridge' or +'wds_bridge') applies here as well. + +If 'multi_ap' is 1 (backhaul BSS only), any station that tries to associate +without the Multi-AP information element will be denied. + +If 'multi_ap' is 2 (fronthaul BSS only), any station that tries to associate +with the Multi-AP information element will be denied. That is also the only +difference with 'multi_ap' set to 0: in the latter case, the Multi-AP +information element is simply ignored. + +In summary, this is the end-to-end behavior for a backhaul BSS (i.e., +multi_ap_backhaul_sta=1 in wpa_supplicant on STA, and multi_ap=1 or 3 in +hostapd on AP). Note that point 1 means that hostapd must not be configured +with WPS support on the backhaul BSS (multi_ap=1). hostapd does not check for +that. + +1. Backhaul BSS beacons do not advertise WPS support (other than that, nothing + Multi-AP specific). +2. STA sends Authentication frame (nothing Multi-AP specific). +3. AP sends Authentication frame (nothing Multi-AP specific). +4. STA sends Association Request frame with Multi-AP IE. +5. AP sends Association Response frame with Multi-AP IE. +6. STA and AP both use 4-address mode for Data frames. + + +WPS support +----------- + +WPS requires more special handling. WPS must only be advertised on fronthaul +BSSs, not on backhaul BSSs, so WPS should not be enabled on a backhaul-only +BSS in hostapd.conf. The WPS configuration purely works on the fronthaul BSS. +When a WPS M1 message has an additional subelement that indicates a request for +a Multi-AP backhaul link, hostapd must not respond with the normal fronthaul +BSS credentials; instead, it should respond with the (potentially different) +backhaul BSS credentials. + +To support this, hostapd has the 'multi_ap_backhaul_ssid', +'multi_ap_backhaul_wpa_psk' and 'multi_ap_backhaul_wpa_passphrase' options. +When these are set on an BSS with WPS, they are used instead of the normal +credentials when hostapd receives a WPS M1 message with the Multi-AP IE. Only +WPA2-Personal is supported in the Multi-AP specification, so there is no need +to specify authentication or encryption options. For the backhaul credentials, +per-device PSK is not supported. + +If the BSS is a simultaneous backhaul and fronthaul BSS, there is no need to +specify the backhaul credentials, since the backhaul and fronthaul credentials +are identical. + +To enable the Multi-AP backhaul STA feature when it performs WPS, a new +parameter has been introduced to the WPS_PBC control interface call. When this +"multi_ap=1" option is set, it adds the Multi-AP backhaul subelement to the +Association Request frame and the M1 message. It then configures the new network +profile with 'multi_ap_backhaul_sta=1'. Note that this means that if the AP does +not follow the Multi-AP specification, wpa_supplicant will fail to associate. + +In summary, this is the end-to-end behavior for WPS of a backhaul link (i.e., +multi_ap=1 option is given in the wps_pbc call on the STA side, and multi_ap=2 +and multi_ap_backhaul_ssid and either multi_ap_backhaul_wpa_psk or +multi_ap_backhaul_wpa_passphrase are set to the credentials of a backhaul BSS +in hostapd on Registrar AP). + +1. Fronthaul BSS Beacon frames advertise WPS support (nothing Multi-AP + specific). +2. Enrollee sends Authentication frame (nothing Multi-AP specific). +3. AP sends Authentication frame (nothing Multi-AP specific). +4. Enrollee sends Association Request frame with Multi-AP IE. +5. AP sends Association Response frame with Multi-AP IE. +6. Enrollee sends M1 with additional Multi-AP subelement. +7. AP sends M8 with backhaul instead of fronthaul credentials. +8. Enrollee sends Deauthentication frame. + + +References +---------- + +[1] https://www.wi-fi.org/discover-wi-fi/wi-fi-easymesh +[2] https://github.com/prplfoundation/prplMesh +[3] https://www.wi-fi.org/file/multi-ap-specification-v10 + (requires registration) Modified: stable/11/contrib/wpa/hostapd/config_file.c ============================================================================== --- stable/11/contrib/wpa/hostapd/config_file.c Wed May 1 01:42:38 2019 (r346980) +++ stable/11/contrib/wpa/hostapd/config_file.c Wed May 1 01:43:17 2019 (r346981) @@ -1,6 +1,6 @@ /* * hostapd / Configuration file parser - * Copyright (c) 2003-2015, Jouni Malinen + * Copyright (c) 2003-2018, Jouni Malinen * * This software may be distributed under the terms of the BSD license. * See README for more details. @@ -14,6 +14,8 @@ #include "utils/common.h" #include "utils/uuid.h" #include "common/ieee802_11_defs.h" +#include "crypto/sha256.h" +#include "crypto/tls.h" #include "drivers/driver.h" #include "eap_server/eap.h" #include "radius/radius_client.h" @@ -35,7 +37,7 @@ static int hostapd_config_read_vlan_file(struct hostap const char *fname) { FILE *f; - char buf[128], *pos, *pos2; + char buf[128], *pos, *pos2, *pos3; int line = 0, vlan_id; struct hostapd_vlan *vlan; @@ -80,7 +82,10 @@ static int hostapd_config_read_vlan_file(struct hostap pos2 = pos; while (*pos2 != ' ' && *pos2 != '\t' && *pos2 != '\0') pos2++; - *pos2 = '\0'; + + if (*pos2 != '\0') + *(pos2++) = '\0'; + if (*pos == '\0' || os_strlen(pos) > IFNAMSIZ) { wpa_printf(MSG_ERROR, "Invalid VLAN ifname at line %d " "in '%s'", line, fname); @@ -88,6 +93,13 @@ static int hostapd_config_read_vlan_file(struct hostap return -1; } + while (*pos2 == ' ' || *pos2 == '\t') + pos2++; + pos3 = pos2; + while (*pos3 != ' ' && *pos3 != '\t' && *pos3 != '\0') + pos3++; + *pos3 = '\0'; + vlan = os_zalloc(sizeof(*vlan)); if (vlan == NULL) { wpa_printf(MSG_ERROR, "Out of memory while reading " @@ -100,6 +112,7 @@ static int hostapd_config_read_vlan_file(struct hostap vlan->vlan_desc.untagged = vlan_id; vlan->vlan_desc.notempty = !!vlan_id; os_strlcpy(vlan->ifname, pos, sizeof(vlan->ifname)); + os_strlcpy(vlan->bridge, pos2, sizeof(vlan->bridge)); vlan->next = bss->vlan; bss->vlan = vlan; } @@ -111,7 +124,7 @@ static int hostapd_config_read_vlan_file(struct hostap #endif /* CONFIG_NO_VLAN */ -static int hostapd_acl_comp(const void *a, const void *b) +int hostapd_acl_comp(const void *a, const void *b) { const struct mac_acl_entry *aa = a; const struct mac_acl_entry *bb = b; @@ -119,6 +132,44 @@ static int hostapd_acl_comp(const void *a, const void } +int hostapd_add_acl_maclist(struct mac_acl_entry **acl, int *num, + int vlan_id, const u8 *addr) +{ + struct mac_acl_entry *newacl; + + newacl = os_realloc_array(*acl, *num + 1, sizeof(**acl)); + if (!newacl) { + wpa_printf(MSG_ERROR, "MAC list reallocation failed"); + return -1; + } + + *acl = newacl; + os_memcpy((*acl)[*num].addr, addr, ETH_ALEN); + os_memset(&(*acl)[*num].vlan_id, 0, sizeof((*acl)[*num].vlan_id)); + (*acl)[*num].vlan_id.untagged = vlan_id; + (*acl)[*num].vlan_id.notempty = !!vlan_id; + (*num)++; + + return 0; +} + + +void hostapd_remove_acl_mac(struct mac_acl_entry **acl, int *num, + const u8 *addr) +{ + int i = 0; + + while (i < *num) { + if (os_memcmp((*acl)[i].addr, addr, ETH_ALEN) == 0) { + os_remove_in_array(*acl, *num, sizeof(**acl), i); + (*num)--; + } else { + i++; + } + } +} + + static int hostapd_config_read_maclist(const char *fname, struct mac_acl_entry **acl, int *num) { @@ -126,12 +177,8 @@ static int hostapd_config_read_maclist(const char *fna char buf[128], *pos; int line = 0; u8 addr[ETH_ALEN]; - struct mac_acl_entry *newacl; int vlan_id; - if (!fname) - return 0; - f = fopen(fname, "r"); if (!f) { wpa_printf(MSG_ERROR, "MAC list file '%s' not found.", fname); @@ -139,7 +186,7 @@ static int hostapd_config_read_maclist(const char *fna } while (fgets(buf, sizeof(buf), f)) { - int i, rem = 0; + int rem = 0; line++; @@ -169,16 +216,7 @@ static int hostapd_config_read_maclist(const char *fna } if (rem) { - i = 0; - while (i < *num) { - if (os_memcmp((*acl)[i].addr, addr, ETH_ALEN) == - 0) { - os_remove_in_array(*acl, *num, - sizeof(**acl), i); - (*num)--; - } else - i++; - } + hostapd_remove_acl_mac(acl, num, addr); continue; } vlan_id = 0; @@ -190,31 +228,78 @@ static int hostapd_config_read_maclist(const char *fna if (*pos != '\0') vlan_id = atoi(pos); - newacl = os_realloc_array(*acl, *num + 1, sizeof(**acl)); - if (newacl == NULL) { - wpa_printf(MSG_ERROR, "MAC list reallocation failed"); + if (hostapd_add_acl_maclist(acl, num, vlan_id, addr) < 0) { fclose(f); return -1; } - - *acl = newacl; - os_memcpy((*acl)[*num].addr, addr, ETH_ALEN); - os_memset(&(*acl)[*num].vlan_id, 0, - sizeof((*acl)[*num].vlan_id)); - (*acl)[*num].vlan_id.untagged = vlan_id; - (*acl)[*num].vlan_id.notempty = !!vlan_id; - (*num)++; } fclose(f); - qsort(*acl, *num, sizeof(**acl), hostapd_acl_comp); + if (*acl) + qsort(*acl, *num, sizeof(**acl), hostapd_acl_comp); return 0; } #ifdef EAP_SERVER + +static int hostapd_config_eap_user_salted(struct hostapd_eap_user *user, + const char *hash, size_t len, + char **pos, int line, + const char *fname) +{ + char *pos2 = *pos; + + while (*pos2 != '\0' && *pos2 != ' ' && *pos2 != '\t' && *pos2 != '#') + pos2++; + + if (pos2 - *pos < (int) (2 * (len + 1))) { /* at least 1 byte of salt */ + wpa_printf(MSG_ERROR, + "Invalid salted %s hash on line %d in '%s'", + hash, line, fname); + return -1; + } + + user->password = os_malloc(len); + if (!user->password) { + wpa_printf(MSG_ERROR, + "Failed to allocate memory for salted %s hash", + hash); + return -1; + } + + if (hexstr2bin(*pos, user->password, len) < 0) { + wpa_printf(MSG_ERROR, + "Invalid salted password on line %d in '%s'", + line, fname); + return -1; + } + user->password_len = len; + *pos += 2 * len; + + user->salt_len = (pos2 - *pos) / 2; + user->salt = os_malloc(user->salt_len); + if (!user->salt) { + wpa_printf(MSG_ERROR, + "Failed to allocate memory for salted %s hash", + hash); + return -1; + } + + if (hexstr2bin(*pos, user->salt, user->salt_len) < 0) { + wpa_printf(MSG_ERROR, + "Invalid salt for password on line %d in '%s'", + line, fname); + return -1; + } + + *pos = pos2; + return 0; +} + + static int hostapd_config_read_eap_user(const char *fname, struct hostapd_bss_config *conf) { @@ -223,9 +308,6 @@ static int hostapd_config_read_eap_user(const char *fn int line = 0, ret = 0, num_methods; struct hostapd_eap_user *user = NULL, *tail = NULL, *new_user = NULL; - if (!fname) - return 0; - if (os_strncmp(fname, "sqlite:", 7) == 0) { #ifdef CONFIG_SQLITE os_free(conf->eap_user_sqlite); @@ -312,13 +394,12 @@ static int hostapd_config_read_eap_user(const char *fn goto failed; } - user->identity = os_malloc(pos - start); + user->identity = os_memdup(start, pos - start); if (user->identity == NULL) { wpa_printf(MSG_ERROR, "Failed to allocate " "memory for EAP identity"); goto failed; } - os_memcpy(user->identity, start, pos - start); user->identity_len = pos - start; if (pos[0] == '"' && pos[1] == '*') { @@ -436,13 +517,12 @@ static int hostapd_config_read_eap_user(const char *fn goto failed; } - user->password = os_malloc(pos - start); + user->password = os_memdup(start, pos - start); if (user->password == NULL) { wpa_printf(MSG_ERROR, "Failed to allocate " "memory for EAP password"); goto failed; } - os_memcpy(user->password, start, pos - start); user->password_len = pos - start; pos++; @@ -471,6 +551,24 @@ static int hostapd_config_read_eap_user(const char *fn user->password_len = 16; user->password_hash = 1; pos = pos2; + } else if (os_strncmp(pos, "ssha1:", 6) == 0) { + pos += 6; + if (hostapd_config_eap_user_salted(user, "sha1", 20, + &pos, + line, fname) < 0) + goto failed; + } else if (os_strncmp(pos, "ssha256:", 8) == 0) { + pos += 8; + if (hostapd_config_eap_user_salted(user, "sha256", 32, + &pos, + line, fname) < 0) + goto failed; + } else if (os_strncmp(pos, "ssha512:", 8) == 0) { + pos += 8; + if (hostapd_config_eap_user_salted(user, "sha512", 64, + &pos, + line, fname) < 0) + goto failed; } else { pos2 = pos; while (*pos2 != '\0' && *pos2 != ' ' && @@ -522,19 +620,15 @@ static int hostapd_config_read_eap_user(const char *fn fclose(f); if (ret == 0) { - user = conf->eap_user; - while (user) { - struct hostapd_eap_user *prev; - - prev = user; - user = user->next; - hostapd_config_free_eap_user(prev); - } + hostapd_config_free_eap_users(conf->eap_user); conf->eap_user = new_user; + } else { + hostapd_config_free_eap_users(new_user); } return ret; } + #endif /* EAP_SERVER */ @@ -684,12 +778,16 @@ static int hostapd_config_parse_key_mgmt(int line, con val |= WPA_KEY_MGMT_PSK; else if (os_strcmp(start, "WPA-EAP") == 0) val |= WPA_KEY_MGMT_IEEE8021X; -#ifdef CONFIG_IEEE80211R +#ifdef CONFIG_IEEE80211R_AP else if (os_strcmp(start, "FT-PSK") == 0) val |= WPA_KEY_MGMT_FT_PSK; else if (os_strcmp(start, "FT-EAP") == 0) val |= WPA_KEY_MGMT_FT_IEEE8021X; -#endif /* CONFIG_IEEE80211R */ +#ifdef CONFIG_SHA384 + else if (os_strcmp(start, "FT-EAP-SHA384") == 0) + val |= WPA_KEY_MGMT_FT_IEEE8021X_SHA384; +#endif /* CONFIG_SHA384 */ +#endif /* CONFIG_IEEE80211R_AP */ #ifdef CONFIG_IEEE80211W else if (os_strcmp(start, "WPA-PSK-SHA256") == 0) val |= WPA_KEY_MGMT_PSK_SHA256; @@ -710,6 +808,30 @@ static int hostapd_config_parse_key_mgmt(int line, con else if (os_strcmp(start, "WPA-EAP-SUITE-B-192") == 0) val |= WPA_KEY_MGMT_IEEE8021X_SUITE_B_192; #endif /* CONFIG_SUITEB192 */ +#ifdef CONFIG_FILS + else if (os_strcmp(start, "FILS-SHA256") == 0) + val |= WPA_KEY_MGMT_FILS_SHA256; + else if (os_strcmp(start, "FILS-SHA384") == 0) + val |= WPA_KEY_MGMT_FILS_SHA384; +#ifdef CONFIG_IEEE80211R_AP + else if (os_strcmp(start, "FT-FILS-SHA256") == 0) + val |= WPA_KEY_MGMT_FT_FILS_SHA256; + else if (os_strcmp(start, "FT-FILS-SHA384") == 0) + val |= WPA_KEY_MGMT_FT_FILS_SHA384; +#endif /* CONFIG_IEEE80211R_AP */ +#endif /* CONFIG_FILS */ +#ifdef CONFIG_OWE + else if (os_strcmp(start, "OWE") == 0) + val |= WPA_KEY_MGMT_OWE; +#endif /* CONFIG_OWE */ +#ifdef CONFIG_DPP + else if (os_strcmp(start, "DPP") == 0) + val |= WPA_KEY_MGMT_DPP; +#endif /* CONFIG_DPP */ +#ifdef CONFIG_HS20 + else if (os_strcmp(start, "OSEN") == 0) + val |= WPA_KEY_MGMT_OSEN; +#endif /* CONFIG_HS20 */ else { wpa_printf(MSG_ERROR, "Line %d: invalid key_mgmt '%s'", line, start); @@ -755,17 +877,34 @@ static int hostapd_config_read_wep(struct hostapd_wep_ { size_t len = os_strlen(val); - if (keyidx < 0 || keyidx > 3 || wep->key[keyidx] != NULL) + if (keyidx < 0 || keyidx > 3) return -1; + if (len == 0) { + int i, set = 0; + + bin_clear_free(wep->key[keyidx], wep->len[keyidx]); + wep->key[keyidx] = NULL; + wep->len[keyidx] = 0; + for (i = 0; i < NUM_WEP_KEYS; i++) { + if (wep->key[i]) + set++; + } + if (!set) + wep->keys_set = 0; + return 0; + } + + if (wep->key[keyidx] != NULL) + return -1; + if (val[0] == '"') { if (len < 2 || val[len - 1] != '"') return -1; len -= 2; - wep->key[keyidx] = os_malloc(len); + wep->key[keyidx] = os_memdup(val + 1, len); if (wep->key[keyidx] == NULL) return -1; - os_memcpy(wep->key[keyidx], val + 1, len); wep->len[keyidx] = len; } else { if (len & 1) @@ -978,7 +1117,27 @@ static int hostapd_config_tx_queue(struct hostapd_conf } -#ifdef CONFIG_IEEE80211R +#ifdef CONFIG_IEEE80211R_AP + +static int rkh_derive_key(const char *pos, u8 *key, size_t key_len) +{ + u8 oldkey[16]; + int ret; + + if (!hexstr2bin(pos, key, key_len)) + return 0; + + /* Try to use old short key for backwards compatibility */ + if (hexstr2bin(pos, oldkey, sizeof(oldkey))) + return -1; + + ret = hmac_sha256_kdf(oldkey, sizeof(oldkey), "FT OLDKEY", NULL, 0, + key, key_len); + os_memset(oldkey, 0, sizeof(oldkey)); + return ret; +} + + static int add_r0kh(struct hostapd_bss_config *bss, char *value) { struct ft_remote_r0kh *r0kh; @@ -1012,7 +1171,7 @@ static int add_r0kh(struct hostapd_bss_config *bss, ch os_memcpy(r0kh->id, pos, r0kh->id_len); pos = next; - if (hexstr2bin(pos, r0kh->key, sizeof(r0kh->key))) { + if (rkh_derive_key(pos, r0kh->key, sizeof(r0kh->key)) < 0) { wpa_printf(MSG_ERROR, "Invalid R0KH key: '%s'", pos); os_free(r0kh); return -1; @@ -1057,7 +1216,7 @@ static int add_r1kh(struct hostapd_bss_config *bss, ch } pos = next; - if (hexstr2bin(pos, r1kh->key, sizeof(r1kh->key))) { + if (rkh_derive_key(pos, r1kh->key, sizeof(r1kh->key)) < 0) { wpa_printf(MSG_ERROR, "Invalid R1KH key: '%s'", pos); os_free(r1kh); return -1; @@ -1068,7 +1227,7 @@ static int add_r1kh(struct hostapd_bss_config *bss, ch return 0; } -#endif /* CONFIG_IEEE80211R */ +#endif /* CONFIG_IEEE80211R_AP */ #ifdef CONFIG_IEEE80211N @@ -1085,6 +1244,12 @@ static int hostapd_config_ht_capab(struct hostapd_conf conf->ht_capab |= HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET; conf->secondary_channel = 1; } + if (os_strstr(capab, "[HT40+]") && os_strstr(capab, "[HT40-]")) { + conf->ht_capab |= HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET; + conf->ht40_plus_minus_allowed = 1; + } + if (!os_strstr(capab, "[HT40+]") && !os_strstr(capab, "[HT40-]")) + conf->secondary_channel = 0; if (os_strstr(capab, "[SMPS-STATIC]")) { conf->ht_capab &= ~HT_CAP_INFO_SMPS_MASK; conf->ht_capab |= HT_CAP_INFO_SMPS_STATIC; @@ -1214,6 +1379,30 @@ static int hostapd_config_vht_capab(struct hostapd_con #endif /* CONFIG_IEEE80211AC */ +#ifdef CONFIG_IEEE80211AX + +static u8 find_bit_offset(u8 val) +{ + u8 res = 0; + + for (; val; val >>= 1) { + if (val & 1) + break; + res++; + } + + return res; +} + + +static u8 set_he_cap(int val, u8 mask) +{ + return (u8) (mask & (val << find_bit_offset(mask))); +} + +#endif /* CONFIG_IEEE80211AX */ + + #ifdef CONFIG_INTERWORKING static int parse_roaming_consortium(struct hostapd_bss_config *bss, char *pos, int line) @@ -1307,6 +1496,44 @@ static int parse_venue_name(struct hostapd_bss_config } +static int parse_venue_url(struct hostapd_bss_config *bss, char *pos, + int line) +{ + char *sep; + size_t nlen; + struct hostapd_venue_url *url; + int ret = -1; + + sep = os_strchr(pos, ':'); + if (!sep) + goto fail; + *sep++ = '\0'; + + nlen = os_strlen(sep); + if (nlen > 254) + goto fail; + + url = os_realloc_array(bss->venue_url, bss->venue_url_count + 1, + sizeof(struct hostapd_venue_url)); + if (!url) + goto fail; + + bss->venue_url = url; + url = &bss->venue_url[bss->venue_url_count++]; + + url->venue_number = atoi(pos); + url->url_len = nlen; + os_memcpy(url->url, sep, nlen); + + ret = 0; +fail: + if (ret) + wpa_printf(MSG_ERROR, "Line %d: Invalid venue_url '%s'", + line, pos); + return ret; +} + + static int parse_3gpp_cell_net(struct hostapd_bss_config *bss, char *buf, int line) { @@ -1857,6 +2084,24 @@ static int hs20_parse_osu_nai(struct hostapd_bss_confi } +static int hs20_parse_osu_nai2(struct hostapd_bss_config *bss, + char *pos, int line) +{ + if (bss->last_osu == NULL) { + wpa_printf(MSG_ERROR, "Line %d: Unexpected OSU field", line); + return -1; + } + + os_free(bss->last_osu->osu_nai2); + bss->last_osu->osu_nai2 = os_strdup(pos); + if (bss->last_osu->osu_nai2 == NULL) + return -1; + bss->hs20_osu_providers_nai_count++; + + return 0; +} + + static int hs20_parse_osu_method_list(struct hostapd_bss_config *bss, char *pos, int line) { @@ -1916,6 +2161,25 @@ static int hs20_parse_osu_service_desc(struct hostapd_ return 0; } + +static int hs20_parse_operator_icon(struct hostapd_bss_config *bss, char *pos, + int line) +{ + char **n; + + n = os_realloc_array(bss->hs20_operator_icon, + bss->hs20_operator_icon_count + 1, sizeof(char *)); + if (!n) + return -1; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed May 1 01:49:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EFA815A3FC8; Wed, 1 May 2019 01:49:34 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C58ED70BC1; Wed, 1 May 2019 01:49:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A9231A6F1; Wed, 1 May 2019 01:49:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x411nXOa042232; Wed, 1 May 2019 01:49:33 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x411nXcZ042231; Wed, 1 May 2019 01:49:33 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905010149.x411nXcZ042231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 1 May 2019 01:49:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346982 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 346982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C58ED70BC1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 01:49:34 -0000 Author: cy Date: Wed May 1 01:49:33 2019 New Revision: 346982 URL: https://svnweb.freebsd.org/changeset/base/346982 Log: MFC r346804: Left justify a function header brace as it should be. No functional change. Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed May 1 01:43:17 2019 (r346981) +++ stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed May 1 01:49:33 2019 (r346982) @@ -1181,7 +1181,7 @@ ipf_checkv6sum(fin) size_t mbufchainlen(m0) struct mbuf *m0; - { +{ size_t len; if ((m0->m_flags & M_PKTHDR) != 0) { From owner-svn-src-all@freebsd.org Wed May 1 01:49:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77F8C15A3FCE; Wed, 1 May 2019 01:49:34 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1EC5E70BC2; Wed, 1 May 2019 01:49:34 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB8AD1A6F2; Wed, 1 May 2019 01:49:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x411nXQi042238; Wed, 1 May 2019 01:49:33 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x411nXfu042237; Wed, 1 May 2019 01:49:33 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905010149.x411nXfu042237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 1 May 2019 01:49:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346982 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 346982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1EC5E70BC2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 01:49:34 -0000 Author: cy Date: Wed May 1 01:49:33 2019 New Revision: 346982 URL: https://svnweb.freebsd.org/changeset/base/346982 Log: MFC r346804: Left justify a function header brace as it should be. No functional change. Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed May 1 01:43:17 2019 (r346981) +++ stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed May 1 01:49:33 2019 (r346982) @@ -1181,7 +1181,7 @@ ipf_checkv6sum(fin) size_t mbufchainlen(m0) struct mbuf *m0; - { +{ size_t len; if ((m0->m_flags & M_PKTHDR) != 0) { From owner-svn-src-all@freebsd.org Wed May 1 01:49:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B5F415A3FD2; Wed, 1 May 2019 01:49:35 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A4FF670BC8; Wed, 1 May 2019 01:49:34 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AC5A1A6F3; Wed, 1 May 2019 01:49:34 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x411nYMh042244; Wed, 1 May 2019 01:49:34 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x411nYoM042243; Wed, 1 May 2019 01:49:34 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905010149.x411nYoM042243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 1 May 2019 01:49:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r346982 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 346982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A4FF670BC8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 01:49:35 -0000 Author: cy Date: Wed May 1 01:49:33 2019 New Revision: 346982 URL: https://svnweb.freebsd.org/changeset/base/346982 Log: MFC r346804: Left justify a function header brace as it should be. No functional change. Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/11/ (props changed) stable/12/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed May 1 01:43:17 2019 (r346981) +++ stable/10/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed May 1 01:49:33 2019 (r346982) @@ -1203,7 +1203,7 @@ ipf_checkv6sum(fin) size_t mbufchainlen(m0) struct mbuf *m0; - { +{ size_t len; if ((m0->m_flags & M_PKTHDR) != 0) { From owner-svn-src-all@freebsd.org Wed May 1 01:53:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 591CC1580394; Wed, 1 May 2019 01:53:36 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F113F711EC; Wed, 1 May 2019 01:53:35 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9C871A895; Wed, 1 May 2019 01:53:35 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x411rZNg047555; Wed, 1 May 2019 01:53:35 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x411rK4D047543; Wed, 1 May 2019 01:53:20 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905010153.x411rK4D047543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 1 May 2019 01:53:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346983 - in stable: 11/contrib/sqlite3 11/contrib/sqlite3/tea 12/contrib/sqlite3 12/contrib/sqlite3/tea X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/sqlite3 11/contrib/sqlite3/tea 12/contrib/sqlite3 12/contrib/sqlite3/tea X-SVN-Commit-Revision: 346983 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F113F711EC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 01:53:36 -0000 Author: cy Date: Wed May 1 01:53:19 2019 New Revision: 346983 URL: https://svnweb.freebsd.org/changeset/base/346983 Log: MFC r346459: MFV r346450: Update sqlite3-3.27.1 (3270100) --> sqlite3-3.27.2 (3270200) Modified: stable/11/contrib/sqlite3/configure stable/11/contrib/sqlite3/configure.ac stable/11/contrib/sqlite3/sqlite3.c stable/11/contrib/sqlite3/sqlite3.h stable/11/contrib/sqlite3/tea/configure stable/11/contrib/sqlite3/tea/configure.ac Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/sqlite3/configure stable/12/contrib/sqlite3/configure.ac stable/12/contrib/sqlite3/sqlite3.c stable/12/contrib/sqlite3/sqlite3.h stable/12/contrib/sqlite3/tea/configure stable/12/contrib/sqlite3/tea/configure.ac Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/sqlite3/configure ============================================================================== --- stable/11/contrib/sqlite3/configure Wed May 1 01:49:33 2019 (r346982) +++ stable/11/contrib/sqlite3/configure Wed May 1 01:53:19 2019 (r346983) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.27.1. +# Generated by GNU Autoconf 2.69 for sqlite 3.27.2. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.27.1' -PACKAGE_STRING='sqlite 3.27.1' +PACKAGE_VERSION='3.27.2' +PACKAGE_STRING='sqlite 3.27.2' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.27.1 to adapt to many kinds of systems. +\`configure' configures sqlite 3.27.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1412,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.27.1:";; + short | recursive ) echo "Configuration of sqlite 3.27.2:";; esac cat <<\_ACEOF @@ -1537,7 +1537,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.27.1 +sqlite configure 3.27.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.27.1, which was +It was created by sqlite $as_me 3.27.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2818,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.27.1' + VERSION='3.27.2' cat >>confdefs.h <<_ACEOF @@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.27.1, which was +This file was extended by sqlite $as_me 3.27.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14495,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.27.1 +sqlite config.status 3.27.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/11/contrib/sqlite3/configure.ac ============================================================================== --- stable/11/contrib/sqlite3/configure.ac Wed May 1 01:49:33 2019 (r346982) +++ stable/11/contrib/sqlite3/configure.ac Wed May 1 01:53:19 2019 (r346983) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.27.1, http://www.sqlite.org) +AC_INIT(sqlite, 3.27.2, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) Modified: stable/11/contrib/sqlite3/sqlite3.c ============================================================================== --- stable/11/contrib/sqlite3/sqlite3.c Wed May 1 01:49:33 2019 (r346982) +++ stable/11/contrib/sqlite3/sqlite3.c Wed May 1 01:53:19 2019 (r346983) @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.27.1. By combining all the individual C code files into this +** version 3.27.2. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -1162,9 +1162,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.27.1" -#define SQLITE_VERSION_NUMBER 3027001 -#define SQLITE_SOURCE_ID "2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959a1dd" +#define SQLITE_VERSION "3.27.2" +#define SQLITE_VERSION_NUMBER 3027002 +#define SQLITE_SOURCE_ID "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -3408,7 +3408,7 @@ SQLITE_API int sqlite3_changes(sqlite3*); ** not. ^Changes to a view that are intercepted by INSTEAD OF triggers ** are not counted. ** -** This the [sqlite3_total_changes(D)] interface only reports the number +** The [sqlite3_total_changes(D)] interface only reports the number ** of rows that changed due to SQL statement run against database ** connection D. Any changes by other database connections are ignored. ** To detect changes against a database file from other database @@ -14937,57 +14937,56 @@ typedef struct VdbeOpList VdbeOpList; #define OP_Sequence 120 /* synopsis: r[P2]=cursor[P1].ctr++ */ #define OP_NewRowid 121 /* synopsis: r[P2]=rowid */ #define OP_Insert 122 /* synopsis: intkey=r[P3] data=r[P2] */ -#define OP_InsertInt 123 /* synopsis: intkey=P3 data=r[P2] */ -#define OP_Delete 124 -#define OP_ResetCount 125 -#define OP_SorterCompare 126 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */ -#define OP_SorterData 127 /* synopsis: r[P2]=data */ -#define OP_RowData 128 /* synopsis: r[P2]=data */ -#define OP_Rowid 129 /* synopsis: r[P2]=rowid */ -#define OP_NullRow 130 -#define OP_SeekEnd 131 -#define OP_SorterInsert 132 /* synopsis: key=r[P2] */ -#define OP_IdxInsert 133 /* synopsis: key=r[P2] */ -#define OP_IdxDelete 134 /* synopsis: key=r[P2@P3] */ -#define OP_DeferredSeek 135 /* synopsis: Move P3 to P1.rowid if needed */ -#define OP_IdxRowid 136 /* synopsis: r[P2]=rowid */ -#define OP_Destroy 137 -#define OP_Clear 138 -#define OP_ResetSorter 139 -#define OP_CreateBtree 140 /* synopsis: r[P2]=root iDb=P1 flags=P3 */ +#define OP_Delete 123 +#define OP_ResetCount 124 +#define OP_SorterCompare 125 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */ +#define OP_SorterData 126 /* synopsis: r[P2]=data */ +#define OP_RowData 127 /* synopsis: r[P2]=data */ +#define OP_Rowid 128 /* synopsis: r[P2]=rowid */ +#define OP_NullRow 129 +#define OP_SeekEnd 130 +#define OP_SorterInsert 131 /* synopsis: key=r[P2] */ +#define OP_IdxInsert 132 /* synopsis: key=r[P2] */ +#define OP_IdxDelete 133 /* synopsis: key=r[P2@P3] */ +#define OP_DeferredSeek 134 /* synopsis: Move P3 to P1.rowid if needed */ +#define OP_IdxRowid 135 /* synopsis: r[P2]=rowid */ +#define OP_Destroy 136 +#define OP_Clear 137 +#define OP_ResetSorter 138 +#define OP_CreateBtree 139 /* synopsis: r[P2]=root iDb=P1 flags=P3 */ +#define OP_SqlExec 140 #define OP_Real 141 /* same as TK_FLOAT, synopsis: r[P2]=P4 */ -#define OP_SqlExec 142 -#define OP_ParseSchema 143 -#define OP_LoadAnalysis 144 -#define OP_DropTable 145 -#define OP_DropIndex 146 -#define OP_DropTrigger 147 -#define OP_IntegrityCk 148 -#define OP_RowSetAdd 149 /* synopsis: rowset(P1)=r[P2] */ -#define OP_Param 150 -#define OP_FkCounter 151 /* synopsis: fkctr[P1]+=P2 */ -#define OP_MemMax 152 /* synopsis: r[P1]=max(r[P1],r[P2]) */ -#define OP_OffsetLimit 153 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */ -#define OP_AggInverse 154 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */ -#define OP_AggStep 155 /* synopsis: accum=r[P3] step(r[P2@P5]) */ -#define OP_AggStep1 156 /* synopsis: accum=r[P3] step(r[P2@P5]) */ -#define OP_AggValue 157 /* synopsis: r[P3]=value N=P2 */ -#define OP_AggFinal 158 /* synopsis: accum=r[P1] N=P2 */ -#define OP_Expire 159 -#define OP_TableLock 160 /* synopsis: iDb=P1 root=P2 write=P3 */ -#define OP_VBegin 161 -#define OP_VCreate 162 -#define OP_VDestroy 163 -#define OP_VOpen 164 -#define OP_VColumn 165 /* synopsis: r[P3]=vcolumn(P2) */ -#define OP_VRename 166 -#define OP_Pagecount 167 -#define OP_MaxPgcnt 168 -#define OP_Trace 169 -#define OP_CursorHint 170 -#define OP_Noop 171 -#define OP_Explain 172 -#define OP_Abortable 173 +#define OP_ParseSchema 142 +#define OP_LoadAnalysis 143 +#define OP_DropTable 144 +#define OP_DropIndex 145 +#define OP_DropTrigger 146 +#define OP_IntegrityCk 147 +#define OP_RowSetAdd 148 /* synopsis: rowset(P1)=r[P2] */ +#define OP_Param 149 +#define OP_FkCounter 150 /* synopsis: fkctr[P1]+=P2 */ +#define OP_MemMax 151 /* synopsis: r[P1]=max(r[P1],r[P2]) */ +#define OP_OffsetLimit 152 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */ +#define OP_AggInverse 153 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */ +#define OP_AggStep 154 /* synopsis: accum=r[P3] step(r[P2@P5]) */ +#define OP_AggStep1 155 /* synopsis: accum=r[P3] step(r[P2@P5]) */ +#define OP_AggValue 156 /* synopsis: r[P3]=value N=P2 */ +#define OP_AggFinal 157 /* synopsis: accum=r[P1] N=P2 */ +#define OP_Expire 158 +#define OP_TableLock 159 /* synopsis: iDb=P1 root=P2 write=P3 */ +#define OP_VBegin 160 +#define OP_VCreate 161 +#define OP_VDestroy 162 +#define OP_VOpen 163 +#define OP_VColumn 164 /* synopsis: r[P3]=vcolumn(P2) */ +#define OP_VRename 165 +#define OP_Pagecount 166 +#define OP_MaxPgcnt 167 +#define OP_Trace 168 +#define OP_CursorHint 169 +#define OP_Noop 170 +#define OP_Explain 171 +#define OP_Abortable 172 /* Properties such as "out2" or "jump" that are specified in ** comments following the "case" for each opcode in the vdbe.c @@ -15016,12 +15015,12 @@ typedef struct VdbeOpList VdbeOpList; /* 104 */ 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,\ /* 112 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ /* 120 */ 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ -/* 128 */ 0x00, 0x10, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00,\ -/* 136 */ 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,\ -/* 144 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x00,\ -/* 152 */ 0x04, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ -/* 160 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,\ -/* 168 */ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,} +/* 128 */ 0x10, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x10,\ +/* 136 */ 0x10, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00,\ +/* 144 */ 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x00, 0x04,\ +/* 152 */ 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ +/* 160 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10,\ +/* 168 */ 0x00, 0x00, 0x00, 0x00, 0x00,} /* The sqlite3P2Values() routine is able to run faster if it knows ** the value of the largest JUMP opcode. The smaller the maximum @@ -19174,7 +19173,7 @@ SQLITE_PRIVATE void sqlite3AlterRenameColumn(Parse*, S SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *, int *); SQLITE_PRIVATE void sqlite3NestedParse(Parse*, const char*, ...); SQLITE_PRIVATE void sqlite3ExpirePreparedStatements(sqlite3*, int); -SQLITE_PRIVATE void sqlite3CodeRhsOfIN(Parse*, Expr*, int, int); +SQLITE_PRIVATE void sqlite3CodeRhsOfIN(Parse*, Expr*, int); SQLITE_PRIVATE int sqlite3CodeSubselect(Parse*, Expr*); SQLITE_PRIVATE void sqlite3SelectPrep(Parse*, Select*, NameContext*); SQLITE_PRIVATE void sqlite3SelectWrongNumTermsError(Parse *pParse, Select *p); @@ -32139,57 +32138,56 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){ /* 120 */ "Sequence" OpHelp("r[P2]=cursor[P1].ctr++"), /* 121 */ "NewRowid" OpHelp("r[P2]=rowid"), /* 122 */ "Insert" OpHelp("intkey=r[P3] data=r[P2]"), - /* 123 */ "InsertInt" OpHelp("intkey=P3 data=r[P2]"), - /* 124 */ "Delete" OpHelp(""), - /* 125 */ "ResetCount" OpHelp(""), - /* 126 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"), - /* 127 */ "SorterData" OpHelp("r[P2]=data"), - /* 128 */ "RowData" OpHelp("r[P2]=data"), - /* 129 */ "Rowid" OpHelp("r[P2]=rowid"), - /* 130 */ "NullRow" OpHelp(""), - /* 131 */ "SeekEnd" OpHelp(""), - /* 132 */ "SorterInsert" OpHelp("key=r[P2]"), - /* 133 */ "IdxInsert" OpHelp("key=r[P2]"), - /* 134 */ "IdxDelete" OpHelp("key=r[P2@P3]"), - /* 135 */ "DeferredSeek" OpHelp("Move P3 to P1.rowid if needed"), - /* 136 */ "IdxRowid" OpHelp("r[P2]=rowid"), - /* 137 */ "Destroy" OpHelp(""), - /* 138 */ "Clear" OpHelp(""), - /* 139 */ "ResetSorter" OpHelp(""), - /* 140 */ "CreateBtree" OpHelp("r[P2]=root iDb=P1 flags=P3"), + /* 123 */ "Delete" OpHelp(""), + /* 124 */ "ResetCount" OpHelp(""), + /* 125 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"), + /* 126 */ "SorterData" OpHelp("r[P2]=data"), + /* 127 */ "RowData" OpHelp("r[P2]=data"), + /* 128 */ "Rowid" OpHelp("r[P2]=rowid"), + /* 129 */ "NullRow" OpHelp(""), + /* 130 */ "SeekEnd" OpHelp(""), + /* 131 */ "SorterInsert" OpHelp("key=r[P2]"), + /* 132 */ "IdxInsert" OpHelp("key=r[P2]"), + /* 133 */ "IdxDelete" OpHelp("key=r[P2@P3]"), + /* 134 */ "DeferredSeek" OpHelp("Move P3 to P1.rowid if needed"), + /* 135 */ "IdxRowid" OpHelp("r[P2]=rowid"), + /* 136 */ "Destroy" OpHelp(""), + /* 137 */ "Clear" OpHelp(""), + /* 138 */ "ResetSorter" OpHelp(""), + /* 139 */ "CreateBtree" OpHelp("r[P2]=root iDb=P1 flags=P3"), + /* 140 */ "SqlExec" OpHelp(""), /* 141 */ "Real" OpHelp("r[P2]=P4"), - /* 142 */ "SqlExec" OpHelp(""), - /* 143 */ "ParseSchema" OpHelp(""), - /* 144 */ "LoadAnalysis" OpHelp(""), - /* 145 */ "DropTable" OpHelp(""), - /* 146 */ "DropIndex" OpHelp(""), - /* 147 */ "DropTrigger" OpHelp(""), - /* 148 */ "IntegrityCk" OpHelp(""), - /* 149 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"), - /* 150 */ "Param" OpHelp(""), - /* 151 */ "FkCounter" OpHelp("fkctr[P1]+=P2"), - /* 152 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"), - /* 153 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"), - /* 154 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"), - /* 155 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"), - /* 156 */ "AggStep1" OpHelp("accum=r[P3] step(r[P2@P5])"), - /* 157 */ "AggValue" OpHelp("r[P3]=value N=P2"), - /* 158 */ "AggFinal" OpHelp("accum=r[P1] N=P2"), - /* 159 */ "Expire" OpHelp(""), - /* 160 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"), - /* 161 */ "VBegin" OpHelp(""), - /* 162 */ "VCreate" OpHelp(""), - /* 163 */ "VDestroy" OpHelp(""), - /* 164 */ "VOpen" OpHelp(""), - /* 165 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"), - /* 166 */ "VRename" OpHelp(""), - /* 167 */ "Pagecount" OpHelp(""), - /* 168 */ "MaxPgcnt" OpHelp(""), - /* 169 */ "Trace" OpHelp(""), - /* 170 */ "CursorHint" OpHelp(""), - /* 171 */ "Noop" OpHelp(""), - /* 172 */ "Explain" OpHelp(""), - /* 173 */ "Abortable" OpHelp(""), + /* 142 */ "ParseSchema" OpHelp(""), + /* 143 */ "LoadAnalysis" OpHelp(""), + /* 144 */ "DropTable" OpHelp(""), + /* 145 */ "DropIndex" OpHelp(""), + /* 146 */ "DropTrigger" OpHelp(""), + /* 147 */ "IntegrityCk" OpHelp(""), + /* 148 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"), + /* 149 */ "Param" OpHelp(""), + /* 150 */ "FkCounter" OpHelp("fkctr[P1]+=P2"), + /* 151 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"), + /* 152 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"), + /* 153 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"), + /* 154 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"), + /* 155 */ "AggStep1" OpHelp("accum=r[P3] step(r[P2@P5])"), + /* 156 */ "AggValue" OpHelp("r[P3]=value N=P2"), + /* 157 */ "AggFinal" OpHelp("accum=r[P1] N=P2"), + /* 158 */ "Expire" OpHelp(""), + /* 159 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"), + /* 160 */ "VBegin" OpHelp(""), + /* 161 */ "VCreate" OpHelp(""), + /* 162 */ "VDestroy" OpHelp(""), + /* 163 */ "VOpen" OpHelp(""), + /* 164 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"), + /* 165 */ "VRename" OpHelp(""), + /* 166 */ "Pagecount" OpHelp(""), + /* 167 */ "MaxPgcnt" OpHelp(""), + /* 168 */ "Trace" OpHelp(""), + /* 169 */ "CursorHint" OpHelp(""), + /* 170 */ "Noop" OpHelp(""), + /* 171 */ "Explain" OpHelp(""), + /* 172 */ "Abortable" OpHelp(""), }; return azName[i]; } @@ -87935,14 +87933,7 @@ case OP_NewRowid: { /* out2 */ ** This instruction only works on tables. The equivalent instruction ** for indices is OP_IdxInsert. */ -/* Opcode: InsertInt P1 P2 P3 P4 P5 -** Synopsis: intkey=P3 data=r[P2] -** -** This works exactly like OP_Insert except that the key is the -** integer value P3, not the value of the integer stored in register P3. -*/ -case OP_Insert: -case OP_InsertInt: { +case OP_Insert: { Mem *pData; /* MEM cell holding data for the record to be inserted */ Mem *pKey; /* MEM cell holding key for the record */ VdbeCursor *pC; /* Cursor to table into which insert is written */ @@ -87963,16 +87954,11 @@ case OP_InsertInt: { REGISTER_TRACE(pOp->p2, pData); sqlite3VdbeIncrWriteCounter(p, pC); - if( pOp->opcode==OP_Insert ){ - pKey = &aMem[pOp->p3]; - assert( pKey->flags & MEM_Int ); - assert( memIsValid(pKey) ); - REGISTER_TRACE(pOp->p3, pKey); - x.nKey = pKey->u.i; - }else{ - assert( pOp->opcode==OP_InsertInt ); - x.nKey = pOp->p3; - } + pKey = &aMem[pOp->p3]; + assert( pKey->flags & MEM_Int ); + assert( memIsValid(pKey) ); + REGISTER_TRACE(pOp->p3, pKey); + x.nKey = pKey->u.i; if( pOp->p4type==P4_TABLE && HAS_UPDATE_HOOK(db) ){ assert( pC->iDb>=0 ); @@ -96131,7 +96117,39 @@ SQLITE_PRIVATE int sqlite3ResolveOrderGroupBy( return 0; } +#ifndef SQLITE_OMIT_WINDOWFUNC /* +** Walker callback for resolveRemoveWindows(). +*/ +static int resolveRemoveWindowsCb(Walker *pWalker, Expr *pExpr){ + if( ExprHasProperty(pExpr, EP_WinFunc) ){ + Window **pp; + for(pp=&pWalker->u.pSelect->pWin; *pp; pp=&(*pp)->pNextWin){ + if( *pp==pExpr->y.pWin ){ + *pp = (*pp)->pNextWin; + break; + } + } + } + return WRC_Continue; +} + +/* +** Remove any Window objects owned by the expression pExpr from the +** Select.pWin list of Select object pSelect. +*/ +static void resolveRemoveWindows(Select *pSelect, Expr *pExpr){ + Walker sWalker; + memset(&sWalker, 0, sizeof(Walker)); + sWalker.xExprCallback = resolveRemoveWindowsCb; + sWalker.u.pSelect = pSelect; + sqlite3WalkExpr(&sWalker, pExpr); +} +#else +# define resolveRemoveWindows(x,y) +#endif + +/* ** pOrderBy is an ORDER BY or GROUP BY clause in SELECT statement pSelect. ** The Name context of the SELECT statement is pNC. zType is either ** "ORDER" or "GROUP" depending on which type of clause pOrderBy is. @@ -96197,19 +96215,10 @@ static int resolveOrderGroupBy( } for(j=0; jpEList->nExpr; j++){ if( sqlite3ExprCompare(0, pE, pSelect->pEList->a[j].pExpr, -1)==0 ){ -#ifndef SQLITE_OMIT_WINDOWFUNC - if( ExprHasProperty(pE, EP_WinFunc) ){ - /* Since this window function is being changed into a reference - ** to the same window function the result set, remove the instance - ** of this window function from the Select.pWin list. */ - Window **pp; - for(pp=&pSelect->pWin; *pp; pp=&(*pp)->pNextWin){ - if( *pp==pE->y.pWin ){ - *pp = (*pp)->pNextWin; - } - } - } -#endif + /* Since this expresion is being changed into a reference + ** to an identical expression in the result set, remove all Window + ** objects belonging to the expression from the Select.pWin list. */ + resolveRemoveWindows(pSelect, pE); pItem->u.x.iOrderByCol = j+1; } } @@ -99181,14 +99190,11 @@ SQLITE_PRIVATE int sqlite3FindInIndex( eType = IN_INDEX_EPH; if( inFlags & IN_INDEX_LOOP ){ pParse->nQueryLoop = 0; - if( pX->pLeft->iColumn<0 && !ExprHasProperty(pX, EP_xIsSelect) ){ - eType = IN_INDEX_ROWID; - } }else if( prRhsHasNull ){ *prRhsHasNull = rMayHaveNull = ++pParse->nMem; } assert( pX->op==TK_IN ); - sqlite3CodeRhsOfIN(pParse, pX, iTab, eType==IN_INDEX_ROWID); + sqlite3CodeRhsOfIN(pParse, pX, iTab); if( rMayHaveNull ){ sqlite3SetHasNullFlag(v, iTab, rMayHaveNull); } @@ -99289,12 +99295,6 @@ SQLITE_PRIVATE void sqlite3VectorErrorMsg(Parse *pPars ** however the cursor number returned might not be the same, as it might ** have been duplicated using OP_OpenDup. ** -** If parameter isRowid is non-zero, then LHS of the IN operator is guaranteed -** to be a non-null integer. In this case, the ephemeral table can be an -** table B-Tree that keyed by only integers. The more general cases uses -** an index B-Tree which can have arbitrary keys, but is slower to both -** read and write. -** ** If the LHS expression ("x" in the examples) is a column value, or ** the SELECT statement returns a column value, then the affinity of that ** column is used to build the index keys. If both 'x' and the @@ -99306,8 +99306,7 @@ SQLITE_PRIVATE void sqlite3VectorErrorMsg(Parse *pPars SQLITE_PRIVATE void sqlite3CodeRhsOfIN( Parse *pParse, /* Parsing context */ Expr *pExpr, /* The IN operator */ - int iTab, /* Use this cursor number */ - int isRowid /* If true, LHS is a rowid */ + int iTab /* Use this cursor number */ ){ int addrOnce = 0; /* Address of the OP_Once instruction at top */ int addr; /* Address of OP_OpenEphemeral instruction */ @@ -99360,14 +99359,12 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN( /* Check to see if this is a vector IN operator */ pLeft = pExpr->pLeft; nVal = sqlite3ExprVectorSize(pLeft); - assert( !isRowid || nVal==1 ); /* Construct the ephemeral table that will contain the content of ** RHS of the IN operator. */ pExpr->iTable = iTab; - addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, - pExpr->iTable, (isRowid?0:nVal)); + addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pExpr->iTable, nVal); #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS if( ExprHasProperty(pExpr, EP_xIsSelect) ){ VdbeComment((v, "Result of SELECT %u", pExpr->x.pSelect->selId)); @@ -99375,7 +99372,7 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN( VdbeComment((v, "RHS of IN operator")); } #endif - pKeyInfo = isRowid ? 0 : sqlite3KeyInfoAlloc(pParse->db, nVal, 1); + pKeyInfo = sqlite3KeyInfoAlloc(pParse->db, nVal, 1); if( ExprHasProperty(pExpr, EP_xIsSelect) ){ /* Case 1: expr IN (SELECT ...) @@ -99389,7 +99386,6 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN( ExplainQueryPlan((pParse, 1, "%sLIST SUBQUERY %d", addrOnce?"":"CORRELATED ", pSelect->selId )); - assert( !isRowid ); /* If the LHS and RHS of the IN operator do not match, that ** error will have been caught long before we reach this point. */ if( ALWAYS(pEList->nExpr==nVal) ){ @@ -99442,10 +99438,8 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN( /* Loop through each expression in . */ r1 = sqlite3GetTempReg(pParse); r2 = sqlite3GetTempReg(pParse); - if( isRowid ) sqlite3VdbeAddOp4(v, OP_Blob, 0, r2, 0, "", P4_STATIC); for(i=pList->nExpr, pItem=pList->a; i>0; i--, pItem++){ Expr *pE2 = pItem->pExpr; - int iValToIns; /* If the expression is not constant then we will need to ** disable the test that was generated above that makes sure @@ -99458,20 +99452,9 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN( } /* Evaluate the expression and insert it into the temp table */ - if( isRowid && sqlite3ExprIsInteger(pE2, &iValToIns) ){ - sqlite3VdbeAddOp3(v, OP_InsertInt, iTab, r2, iValToIns); - }else{ - r3 = sqlite3ExprCodeTarget(pParse, pE2, r1); - if( isRowid ){ - sqlite3VdbeAddOp2(v, OP_MustBeInt, r3, - sqlite3VdbeCurrentAddr(v)+2); - VdbeCoverage(v); - sqlite3VdbeAddOp3(v, OP_Insert, iTab, r2, r3); - }else{ - sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1); - sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iTab, r2, r3, 1); - } - } + r3 = sqlite3ExprCodeTarget(pParse, pE2, r1); + sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1); + sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iTab, r2, r3, 1); } sqlite3ReleaseTempReg(pParse, r1); sqlite3ReleaseTempReg(pParse, r2); @@ -118107,10 +118090,13 @@ SQLITE_PRIVATE void sqlite3CompleteInsertion( pik_flags |= (update_flags & OPFLAG_SAVEPOSITION); #ifdef SQLITE_ENABLE_PREUPDATE_HOOK if( update_flags==0 ){ - sqlite3VdbeAddOp4(v, OP_InsertInt, - iIdxCur+i, aRegIdx[i], 0, (char*)pTab, P4_TABLE + int r = sqlite3GetTempReg(pParse); + sqlite3VdbeAddOp2(v, OP_Integer, 0, r); + sqlite3VdbeAddOp4(v, OP_Insert, + iIdxCur+i, aRegIdx[i], r, (char*)pTab, P4_TABLE ); sqlite3VdbeChangeP5(v, OPFLAG_ISNOOP); + sqlite3ReleaseTempReg(pParse, r); } #endif } @@ -136427,7 +136413,6 @@ static int codeEqualityTerm( if( pLoop->aLTerm[i]->pExpr==pX ){ int iOut = iReg + i - iEq; if( eType==IN_INDEX_ROWID ){ - testcase( nEq>1 ); /* Happens with a UNIQUE index on ROWID */ pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iOut); }else{ int iCol = aiMap ? aiMap[iMap++] : 0; @@ -137189,6 +137174,9 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( sqlite3VdbeAddOp3(v, OP_SeekRowid, iCur, addrNxt, iRowidReg); VdbeCoverage(v); pLevel->op = OP_Noop; + if( (pTerm->prereqAll & pLevel->notReady)==0 ){ + pTerm->wtFlags |= TERM_CODED; + } }else if( (pLoop->wsFlags & WHERE_IPK)!=0 && (pLoop->wsFlags & WHERE_COLUMN_RANGE)!=0 ){ @@ -217076,7 +217064,7 @@ static void fts5SourceIdFunc( ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); - sqlite3_result_text(pCtx, "fts5: 2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959a1dd", -1, SQLITE_TRANSIENT); + sqlite3_result_text(pCtx, "fts5: 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7", -1, SQLITE_TRANSIENT); } /* @@ -221840,9 +221828,9 @@ SQLITE_API int sqlite3_stmt_init( #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */ /************** End of stmt.c ************************************************/ -#if __LINE__!=221843 +#if __LINE__!=221831 #undef SQLITE_SOURCE_ID -#define SQLITE_SOURCE_ID "2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959alt2" +#define SQLITE_SOURCE_ID "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0alt2" #endif /* Return the source-id for this library */ SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } Modified: stable/11/contrib/sqlite3/sqlite3.h ============================================================================== --- stable/11/contrib/sqlite3/sqlite3.h Wed May 1 01:49:33 2019 (r346982) +++ stable/11/contrib/sqlite3/sqlite3.h Wed May 1 01:53:19 2019 (r346983) @@ -123,9 +123,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.27.1" -#define SQLITE_VERSION_NUMBER 3027001 -#define SQLITE_SOURCE_ID "2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959a1dd" +#define SQLITE_VERSION "3.27.2" +#define SQLITE_VERSION_NUMBER 3027002 +#define SQLITE_SOURCE_ID "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -2369,7 +2369,7 @@ SQLITE_API int sqlite3_changes(sqlite3*); ** not. ^Changes to a view that are intercepted by INSTEAD OF triggers ** are not counted. ** -** This the [sqlite3_total_changes(D)] interface only reports the number +** The [sqlite3_total_changes(D)] interface only reports the number ** of rows that changed due to SQL statement run against database ** connection D. Any changes by other database connections are ignored. ** To detect changes against a database file from other database Modified: stable/11/contrib/sqlite3/tea/configure ============================================================================== --- stable/11/contrib/sqlite3/tea/configure Wed May 1 01:49:33 2019 (r346982) +++ stable/11/contrib/sqlite3/tea/configure Wed May 1 01:53:19 2019 (r346983) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.27.1. +# Generated by GNU Autoconf 2.69 for sqlite 3.27.2. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -577,8 +577,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.27.1' -PACKAGE_STRING='sqlite 3.27.1' +PACKAGE_VERSION='3.27.2' +PACKAGE_STRING='sqlite 3.27.2' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1303,7 +1303,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.27.1 to adapt to many kinds of systems. +\`configure' configures sqlite 3.27.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1365,7 +1365,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.27.1:";; + short | recursive ) echo "Configuration of sqlite 3.27.2:";; esac cat <<\_ACEOF @@ -1467,7 +1467,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.27.1 +sqlite configure 3.27.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1878,7 +1878,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.27.1, which was +It was created by sqlite $as_me 3.27.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -9373,7 +9373,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.27.1, which was +This file was extended by sqlite $as_me 3.27.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -9426,7 +9426,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.27.1 +sqlite config.status 3.27.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/11/contrib/sqlite3/tea/configure.ac ============================================================================== --- stable/11/contrib/sqlite3/tea/configure.ac Wed May 1 01:49:33 2019 (r346982) +++ stable/11/contrib/sqlite3/tea/configure.ac Wed May 1 01:53:19 2019 (r346983) @@ -19,7 +19,7 @@ dnl to configure the system for the local environment. # so you can encode the package version directly into the source files. #----------------------------------------------------------------------- -AC_INIT([sqlite], [3.27.1]) +AC_INIT([sqlite], [3.27.2]) #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. From owner-svn-src-all@freebsd.org Wed May 1 01:53:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 113C515803D2; Wed, 1 May 2019 01:53:53 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B896E712D5; Wed, 1 May 2019 01:53:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFC621A896; Wed, 1 May 2019 01:53:51 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x411rp7G047577; Wed, 1 May 2019 01:53:51 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x411rafT047563; Wed, 1 May 2019 01:53:36 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905010153.x411rafT047563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 1 May 2019 01:53:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346983 - in stable: 11/contrib/sqlite3 11/contrib/sqlite3/tea 12/contrib/sqlite3 12/contrib/sqlite3/tea X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/sqlite3 11/contrib/sqlite3/tea 12/contrib/sqlite3 12/contrib/sqlite3/tea X-SVN-Commit-Revision: 346983 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B896E712D5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 01:53:53 -0000 Author: cy Date: Wed May 1 01:53:19 2019 New Revision: 346983 URL: https://svnweb.freebsd.org/changeset/base/346983 Log: MFC r346459: MFV r346450: Update sqlite3-3.27.1 (3270100) --> sqlite3-3.27.2 (3270200) Modified: stable/12/contrib/sqlite3/configure stable/12/contrib/sqlite3/configure.ac stable/12/contrib/sqlite3/sqlite3.c stable/12/contrib/sqlite3/sqlite3.h stable/12/contrib/sqlite3/tea/configure stable/12/contrib/sqlite3/tea/configure.ac Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/sqlite3/configure stable/11/contrib/sqlite3/configure.ac stable/11/contrib/sqlite3/sqlite3.c stable/11/contrib/sqlite3/sqlite3.h stable/11/contrib/sqlite3/tea/configure stable/11/contrib/sqlite3/tea/configure.ac Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/sqlite3/configure ============================================================================== --- stable/12/contrib/sqlite3/configure Wed May 1 01:49:33 2019 (r346982) +++ stable/12/contrib/sqlite3/configure Wed May 1 01:53:19 2019 (r346983) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.27.1. +# Generated by GNU Autoconf 2.69 for sqlite 3.27.2. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.27.1' -PACKAGE_STRING='sqlite 3.27.1' +PACKAGE_VERSION='3.27.2' +PACKAGE_STRING='sqlite 3.27.2' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.27.1 to adapt to many kinds of systems. +\`configure' configures sqlite 3.27.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1412,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.27.1:";; + short | recursive ) echo "Configuration of sqlite 3.27.2:";; esac cat <<\_ACEOF @@ -1537,7 +1537,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.27.1 +sqlite configure 3.27.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.27.1, which was +It was created by sqlite $as_me 3.27.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2818,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.27.1' + VERSION='3.27.2' cat >>confdefs.h <<_ACEOF @@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.27.1, which was +This file was extended by sqlite $as_me 3.27.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14495,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.27.1 +sqlite config.status 3.27.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/12/contrib/sqlite3/configure.ac ============================================================================== --- stable/12/contrib/sqlite3/configure.ac Wed May 1 01:49:33 2019 (r346982) +++ stable/12/contrib/sqlite3/configure.ac Wed May 1 01:53:19 2019 (r346983) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.27.1, http://www.sqlite.org) +AC_INIT(sqlite, 3.27.2, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) Modified: stable/12/contrib/sqlite3/sqlite3.c ============================================================================== --- stable/12/contrib/sqlite3/sqlite3.c Wed May 1 01:49:33 2019 (r346982) +++ stable/12/contrib/sqlite3/sqlite3.c Wed May 1 01:53:19 2019 (r346983) @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.27.1. By combining all the individual C code files into this +** version 3.27.2. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -1162,9 +1162,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.27.1" -#define SQLITE_VERSION_NUMBER 3027001 -#define SQLITE_SOURCE_ID "2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959a1dd" +#define SQLITE_VERSION "3.27.2" +#define SQLITE_VERSION_NUMBER 3027002 +#define SQLITE_SOURCE_ID "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -3408,7 +3408,7 @@ SQLITE_API int sqlite3_changes(sqlite3*); ** not. ^Changes to a view that are intercepted by INSTEAD OF triggers ** are not counted. ** -** This the [sqlite3_total_changes(D)] interface only reports the number +** The [sqlite3_total_changes(D)] interface only reports the number ** of rows that changed due to SQL statement run against database ** connection D. Any changes by other database connections are ignored. ** To detect changes against a database file from other database @@ -14937,57 +14937,56 @@ typedef struct VdbeOpList VdbeOpList; #define OP_Sequence 120 /* synopsis: r[P2]=cursor[P1].ctr++ */ #define OP_NewRowid 121 /* synopsis: r[P2]=rowid */ #define OP_Insert 122 /* synopsis: intkey=r[P3] data=r[P2] */ -#define OP_InsertInt 123 /* synopsis: intkey=P3 data=r[P2] */ -#define OP_Delete 124 -#define OP_ResetCount 125 -#define OP_SorterCompare 126 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */ -#define OP_SorterData 127 /* synopsis: r[P2]=data */ -#define OP_RowData 128 /* synopsis: r[P2]=data */ -#define OP_Rowid 129 /* synopsis: r[P2]=rowid */ -#define OP_NullRow 130 -#define OP_SeekEnd 131 -#define OP_SorterInsert 132 /* synopsis: key=r[P2] */ -#define OP_IdxInsert 133 /* synopsis: key=r[P2] */ -#define OP_IdxDelete 134 /* synopsis: key=r[P2@P3] */ -#define OP_DeferredSeek 135 /* synopsis: Move P3 to P1.rowid if needed */ -#define OP_IdxRowid 136 /* synopsis: r[P2]=rowid */ -#define OP_Destroy 137 -#define OP_Clear 138 -#define OP_ResetSorter 139 -#define OP_CreateBtree 140 /* synopsis: r[P2]=root iDb=P1 flags=P3 */ +#define OP_Delete 123 +#define OP_ResetCount 124 +#define OP_SorterCompare 125 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */ +#define OP_SorterData 126 /* synopsis: r[P2]=data */ +#define OP_RowData 127 /* synopsis: r[P2]=data */ +#define OP_Rowid 128 /* synopsis: r[P2]=rowid */ +#define OP_NullRow 129 +#define OP_SeekEnd 130 +#define OP_SorterInsert 131 /* synopsis: key=r[P2] */ +#define OP_IdxInsert 132 /* synopsis: key=r[P2] */ +#define OP_IdxDelete 133 /* synopsis: key=r[P2@P3] */ +#define OP_DeferredSeek 134 /* synopsis: Move P3 to P1.rowid if needed */ +#define OP_IdxRowid 135 /* synopsis: r[P2]=rowid */ +#define OP_Destroy 136 +#define OP_Clear 137 +#define OP_ResetSorter 138 +#define OP_CreateBtree 139 /* synopsis: r[P2]=root iDb=P1 flags=P3 */ +#define OP_SqlExec 140 #define OP_Real 141 /* same as TK_FLOAT, synopsis: r[P2]=P4 */ -#define OP_SqlExec 142 -#define OP_ParseSchema 143 -#define OP_LoadAnalysis 144 -#define OP_DropTable 145 -#define OP_DropIndex 146 -#define OP_DropTrigger 147 -#define OP_IntegrityCk 148 -#define OP_RowSetAdd 149 /* synopsis: rowset(P1)=r[P2] */ -#define OP_Param 150 -#define OP_FkCounter 151 /* synopsis: fkctr[P1]+=P2 */ -#define OP_MemMax 152 /* synopsis: r[P1]=max(r[P1],r[P2]) */ -#define OP_OffsetLimit 153 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */ -#define OP_AggInverse 154 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */ -#define OP_AggStep 155 /* synopsis: accum=r[P3] step(r[P2@P5]) */ -#define OP_AggStep1 156 /* synopsis: accum=r[P3] step(r[P2@P5]) */ -#define OP_AggValue 157 /* synopsis: r[P3]=value N=P2 */ -#define OP_AggFinal 158 /* synopsis: accum=r[P1] N=P2 */ -#define OP_Expire 159 -#define OP_TableLock 160 /* synopsis: iDb=P1 root=P2 write=P3 */ -#define OP_VBegin 161 -#define OP_VCreate 162 -#define OP_VDestroy 163 -#define OP_VOpen 164 -#define OP_VColumn 165 /* synopsis: r[P3]=vcolumn(P2) */ -#define OP_VRename 166 -#define OP_Pagecount 167 -#define OP_MaxPgcnt 168 -#define OP_Trace 169 -#define OP_CursorHint 170 -#define OP_Noop 171 -#define OP_Explain 172 -#define OP_Abortable 173 +#define OP_ParseSchema 142 +#define OP_LoadAnalysis 143 +#define OP_DropTable 144 +#define OP_DropIndex 145 +#define OP_DropTrigger 146 +#define OP_IntegrityCk 147 +#define OP_RowSetAdd 148 /* synopsis: rowset(P1)=r[P2] */ +#define OP_Param 149 +#define OP_FkCounter 150 /* synopsis: fkctr[P1]+=P2 */ +#define OP_MemMax 151 /* synopsis: r[P1]=max(r[P1],r[P2]) */ +#define OP_OffsetLimit 152 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */ +#define OP_AggInverse 153 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */ +#define OP_AggStep 154 /* synopsis: accum=r[P3] step(r[P2@P5]) */ +#define OP_AggStep1 155 /* synopsis: accum=r[P3] step(r[P2@P5]) */ +#define OP_AggValue 156 /* synopsis: r[P3]=value N=P2 */ +#define OP_AggFinal 157 /* synopsis: accum=r[P1] N=P2 */ +#define OP_Expire 158 +#define OP_TableLock 159 /* synopsis: iDb=P1 root=P2 write=P3 */ +#define OP_VBegin 160 +#define OP_VCreate 161 +#define OP_VDestroy 162 +#define OP_VOpen 163 +#define OP_VColumn 164 /* synopsis: r[P3]=vcolumn(P2) */ +#define OP_VRename 165 +#define OP_Pagecount 166 +#define OP_MaxPgcnt 167 +#define OP_Trace 168 +#define OP_CursorHint 169 +#define OP_Noop 170 +#define OP_Explain 171 +#define OP_Abortable 172 /* Properties such as "out2" or "jump" that are specified in ** comments following the "case" for each opcode in the vdbe.c @@ -15016,12 +15015,12 @@ typedef struct VdbeOpList VdbeOpList; /* 104 */ 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,\ /* 112 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ /* 120 */ 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ -/* 128 */ 0x00, 0x10, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00,\ -/* 136 */ 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,\ -/* 144 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x00,\ -/* 152 */ 0x04, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ -/* 160 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,\ -/* 168 */ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,} +/* 128 */ 0x10, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x10,\ +/* 136 */ 0x10, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00,\ +/* 144 */ 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x00, 0x04,\ +/* 152 */ 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ +/* 160 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10,\ +/* 168 */ 0x00, 0x00, 0x00, 0x00, 0x00,} /* The sqlite3P2Values() routine is able to run faster if it knows ** the value of the largest JUMP opcode. The smaller the maximum @@ -19174,7 +19173,7 @@ SQLITE_PRIVATE void sqlite3AlterRenameColumn(Parse*, S SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *, int *); SQLITE_PRIVATE void sqlite3NestedParse(Parse*, const char*, ...); SQLITE_PRIVATE void sqlite3ExpirePreparedStatements(sqlite3*, int); -SQLITE_PRIVATE void sqlite3CodeRhsOfIN(Parse*, Expr*, int, int); +SQLITE_PRIVATE void sqlite3CodeRhsOfIN(Parse*, Expr*, int); SQLITE_PRIVATE int sqlite3CodeSubselect(Parse*, Expr*); SQLITE_PRIVATE void sqlite3SelectPrep(Parse*, Select*, NameContext*); SQLITE_PRIVATE void sqlite3SelectWrongNumTermsError(Parse *pParse, Select *p); @@ -32139,57 +32138,56 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){ /* 120 */ "Sequence" OpHelp("r[P2]=cursor[P1].ctr++"), /* 121 */ "NewRowid" OpHelp("r[P2]=rowid"), /* 122 */ "Insert" OpHelp("intkey=r[P3] data=r[P2]"), - /* 123 */ "InsertInt" OpHelp("intkey=P3 data=r[P2]"), - /* 124 */ "Delete" OpHelp(""), - /* 125 */ "ResetCount" OpHelp(""), - /* 126 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"), - /* 127 */ "SorterData" OpHelp("r[P2]=data"), - /* 128 */ "RowData" OpHelp("r[P2]=data"), - /* 129 */ "Rowid" OpHelp("r[P2]=rowid"), - /* 130 */ "NullRow" OpHelp(""), - /* 131 */ "SeekEnd" OpHelp(""), - /* 132 */ "SorterInsert" OpHelp("key=r[P2]"), - /* 133 */ "IdxInsert" OpHelp("key=r[P2]"), - /* 134 */ "IdxDelete" OpHelp("key=r[P2@P3]"), - /* 135 */ "DeferredSeek" OpHelp("Move P3 to P1.rowid if needed"), - /* 136 */ "IdxRowid" OpHelp("r[P2]=rowid"), - /* 137 */ "Destroy" OpHelp(""), - /* 138 */ "Clear" OpHelp(""), - /* 139 */ "ResetSorter" OpHelp(""), - /* 140 */ "CreateBtree" OpHelp("r[P2]=root iDb=P1 flags=P3"), + /* 123 */ "Delete" OpHelp(""), + /* 124 */ "ResetCount" OpHelp(""), + /* 125 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"), + /* 126 */ "SorterData" OpHelp("r[P2]=data"), + /* 127 */ "RowData" OpHelp("r[P2]=data"), + /* 128 */ "Rowid" OpHelp("r[P2]=rowid"), + /* 129 */ "NullRow" OpHelp(""), + /* 130 */ "SeekEnd" OpHelp(""), + /* 131 */ "SorterInsert" OpHelp("key=r[P2]"), + /* 132 */ "IdxInsert" OpHelp("key=r[P2]"), + /* 133 */ "IdxDelete" OpHelp("key=r[P2@P3]"), + /* 134 */ "DeferredSeek" OpHelp("Move P3 to P1.rowid if needed"), + /* 135 */ "IdxRowid" OpHelp("r[P2]=rowid"), + /* 136 */ "Destroy" OpHelp(""), + /* 137 */ "Clear" OpHelp(""), + /* 138 */ "ResetSorter" OpHelp(""), + /* 139 */ "CreateBtree" OpHelp("r[P2]=root iDb=P1 flags=P3"), + /* 140 */ "SqlExec" OpHelp(""), /* 141 */ "Real" OpHelp("r[P2]=P4"), - /* 142 */ "SqlExec" OpHelp(""), - /* 143 */ "ParseSchema" OpHelp(""), - /* 144 */ "LoadAnalysis" OpHelp(""), - /* 145 */ "DropTable" OpHelp(""), - /* 146 */ "DropIndex" OpHelp(""), - /* 147 */ "DropTrigger" OpHelp(""), - /* 148 */ "IntegrityCk" OpHelp(""), - /* 149 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"), - /* 150 */ "Param" OpHelp(""), - /* 151 */ "FkCounter" OpHelp("fkctr[P1]+=P2"), - /* 152 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"), - /* 153 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"), - /* 154 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"), - /* 155 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"), - /* 156 */ "AggStep1" OpHelp("accum=r[P3] step(r[P2@P5])"), - /* 157 */ "AggValue" OpHelp("r[P3]=value N=P2"), - /* 158 */ "AggFinal" OpHelp("accum=r[P1] N=P2"), - /* 159 */ "Expire" OpHelp(""), - /* 160 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"), - /* 161 */ "VBegin" OpHelp(""), - /* 162 */ "VCreate" OpHelp(""), - /* 163 */ "VDestroy" OpHelp(""), - /* 164 */ "VOpen" OpHelp(""), - /* 165 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"), - /* 166 */ "VRename" OpHelp(""), - /* 167 */ "Pagecount" OpHelp(""), - /* 168 */ "MaxPgcnt" OpHelp(""), - /* 169 */ "Trace" OpHelp(""), - /* 170 */ "CursorHint" OpHelp(""), - /* 171 */ "Noop" OpHelp(""), - /* 172 */ "Explain" OpHelp(""), - /* 173 */ "Abortable" OpHelp(""), + /* 142 */ "ParseSchema" OpHelp(""), + /* 143 */ "LoadAnalysis" OpHelp(""), + /* 144 */ "DropTable" OpHelp(""), + /* 145 */ "DropIndex" OpHelp(""), + /* 146 */ "DropTrigger" OpHelp(""), + /* 147 */ "IntegrityCk" OpHelp(""), + /* 148 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"), + /* 149 */ "Param" OpHelp(""), + /* 150 */ "FkCounter" OpHelp("fkctr[P1]+=P2"), + /* 151 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"), + /* 152 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"), + /* 153 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"), + /* 154 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"), + /* 155 */ "AggStep1" OpHelp("accum=r[P3] step(r[P2@P5])"), + /* 156 */ "AggValue" OpHelp("r[P3]=value N=P2"), + /* 157 */ "AggFinal" OpHelp("accum=r[P1] N=P2"), + /* 158 */ "Expire" OpHelp(""), + /* 159 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"), + /* 160 */ "VBegin" OpHelp(""), + /* 161 */ "VCreate" OpHelp(""), + /* 162 */ "VDestroy" OpHelp(""), + /* 163 */ "VOpen" OpHelp(""), + /* 164 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"), + /* 165 */ "VRename" OpHelp(""), + /* 166 */ "Pagecount" OpHelp(""), + /* 167 */ "MaxPgcnt" OpHelp(""), + /* 168 */ "Trace" OpHelp(""), + /* 169 */ "CursorHint" OpHelp(""), + /* 170 */ "Noop" OpHelp(""), + /* 171 */ "Explain" OpHelp(""), + /* 172 */ "Abortable" OpHelp(""), }; return azName[i]; } @@ -87935,14 +87933,7 @@ case OP_NewRowid: { /* out2 */ ** This instruction only works on tables. The equivalent instruction ** for indices is OP_IdxInsert. */ -/* Opcode: InsertInt P1 P2 P3 P4 P5 -** Synopsis: intkey=P3 data=r[P2] -** -** This works exactly like OP_Insert except that the key is the -** integer value P3, not the value of the integer stored in register P3. -*/ -case OP_Insert: -case OP_InsertInt: { +case OP_Insert: { Mem *pData; /* MEM cell holding data for the record to be inserted */ Mem *pKey; /* MEM cell holding key for the record */ VdbeCursor *pC; /* Cursor to table into which insert is written */ @@ -87963,16 +87954,11 @@ case OP_InsertInt: { REGISTER_TRACE(pOp->p2, pData); sqlite3VdbeIncrWriteCounter(p, pC); - if( pOp->opcode==OP_Insert ){ - pKey = &aMem[pOp->p3]; - assert( pKey->flags & MEM_Int ); - assert( memIsValid(pKey) ); - REGISTER_TRACE(pOp->p3, pKey); - x.nKey = pKey->u.i; - }else{ - assert( pOp->opcode==OP_InsertInt ); - x.nKey = pOp->p3; - } + pKey = &aMem[pOp->p3]; + assert( pKey->flags & MEM_Int ); + assert( memIsValid(pKey) ); + REGISTER_TRACE(pOp->p3, pKey); + x.nKey = pKey->u.i; if( pOp->p4type==P4_TABLE && HAS_UPDATE_HOOK(db) ){ assert( pC->iDb>=0 ); @@ -96131,7 +96117,39 @@ SQLITE_PRIVATE int sqlite3ResolveOrderGroupBy( return 0; } +#ifndef SQLITE_OMIT_WINDOWFUNC /* +** Walker callback for resolveRemoveWindows(). +*/ +static int resolveRemoveWindowsCb(Walker *pWalker, Expr *pExpr){ + if( ExprHasProperty(pExpr, EP_WinFunc) ){ + Window **pp; + for(pp=&pWalker->u.pSelect->pWin; *pp; pp=&(*pp)->pNextWin){ + if( *pp==pExpr->y.pWin ){ + *pp = (*pp)->pNextWin; + break; + } + } + } + return WRC_Continue; +} + +/* +** Remove any Window objects owned by the expression pExpr from the +** Select.pWin list of Select object pSelect. +*/ +static void resolveRemoveWindows(Select *pSelect, Expr *pExpr){ + Walker sWalker; + memset(&sWalker, 0, sizeof(Walker)); + sWalker.xExprCallback = resolveRemoveWindowsCb; + sWalker.u.pSelect = pSelect; + sqlite3WalkExpr(&sWalker, pExpr); +} +#else +# define resolveRemoveWindows(x,y) +#endif + +/* ** pOrderBy is an ORDER BY or GROUP BY clause in SELECT statement pSelect. ** The Name context of the SELECT statement is pNC. zType is either ** "ORDER" or "GROUP" depending on which type of clause pOrderBy is. @@ -96197,19 +96215,10 @@ static int resolveOrderGroupBy( } for(j=0; jpEList->nExpr; j++){ if( sqlite3ExprCompare(0, pE, pSelect->pEList->a[j].pExpr, -1)==0 ){ -#ifndef SQLITE_OMIT_WINDOWFUNC - if( ExprHasProperty(pE, EP_WinFunc) ){ - /* Since this window function is being changed into a reference - ** to the same window function the result set, remove the instance - ** of this window function from the Select.pWin list. */ - Window **pp; - for(pp=&pSelect->pWin; *pp; pp=&(*pp)->pNextWin){ - if( *pp==pE->y.pWin ){ - *pp = (*pp)->pNextWin; - } - } - } -#endif + /* Since this expresion is being changed into a reference + ** to an identical expression in the result set, remove all Window + ** objects belonging to the expression from the Select.pWin list. */ + resolveRemoveWindows(pSelect, pE); pItem->u.x.iOrderByCol = j+1; } } @@ -99181,14 +99190,11 @@ SQLITE_PRIVATE int sqlite3FindInIndex( eType = IN_INDEX_EPH; if( inFlags & IN_INDEX_LOOP ){ pParse->nQueryLoop = 0; - if( pX->pLeft->iColumn<0 && !ExprHasProperty(pX, EP_xIsSelect) ){ - eType = IN_INDEX_ROWID; - } }else if( prRhsHasNull ){ *prRhsHasNull = rMayHaveNull = ++pParse->nMem; } assert( pX->op==TK_IN ); - sqlite3CodeRhsOfIN(pParse, pX, iTab, eType==IN_INDEX_ROWID); + sqlite3CodeRhsOfIN(pParse, pX, iTab); if( rMayHaveNull ){ sqlite3SetHasNullFlag(v, iTab, rMayHaveNull); } @@ -99289,12 +99295,6 @@ SQLITE_PRIVATE void sqlite3VectorErrorMsg(Parse *pPars ** however the cursor number returned might not be the same, as it might ** have been duplicated using OP_OpenDup. ** -** If parameter isRowid is non-zero, then LHS of the IN operator is guaranteed -** to be a non-null integer. In this case, the ephemeral table can be an -** table B-Tree that keyed by only integers. The more general cases uses -** an index B-Tree which can have arbitrary keys, but is slower to both -** read and write. -** ** If the LHS expression ("x" in the examples) is a column value, or ** the SELECT statement returns a column value, then the affinity of that ** column is used to build the index keys. If both 'x' and the @@ -99306,8 +99306,7 @@ SQLITE_PRIVATE void sqlite3VectorErrorMsg(Parse *pPars SQLITE_PRIVATE void sqlite3CodeRhsOfIN( Parse *pParse, /* Parsing context */ Expr *pExpr, /* The IN operator */ - int iTab, /* Use this cursor number */ - int isRowid /* If true, LHS is a rowid */ + int iTab /* Use this cursor number */ ){ int addrOnce = 0; /* Address of the OP_Once instruction at top */ int addr; /* Address of OP_OpenEphemeral instruction */ @@ -99360,14 +99359,12 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN( /* Check to see if this is a vector IN operator */ pLeft = pExpr->pLeft; nVal = sqlite3ExprVectorSize(pLeft); - assert( !isRowid || nVal==1 ); /* Construct the ephemeral table that will contain the content of ** RHS of the IN operator. */ pExpr->iTable = iTab; - addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, - pExpr->iTable, (isRowid?0:nVal)); + addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pExpr->iTable, nVal); #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS if( ExprHasProperty(pExpr, EP_xIsSelect) ){ VdbeComment((v, "Result of SELECT %u", pExpr->x.pSelect->selId)); @@ -99375,7 +99372,7 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN( VdbeComment((v, "RHS of IN operator")); } #endif - pKeyInfo = isRowid ? 0 : sqlite3KeyInfoAlloc(pParse->db, nVal, 1); + pKeyInfo = sqlite3KeyInfoAlloc(pParse->db, nVal, 1); if( ExprHasProperty(pExpr, EP_xIsSelect) ){ /* Case 1: expr IN (SELECT ...) @@ -99389,7 +99386,6 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN( ExplainQueryPlan((pParse, 1, "%sLIST SUBQUERY %d", addrOnce?"":"CORRELATED ", pSelect->selId )); - assert( !isRowid ); /* If the LHS and RHS of the IN operator do not match, that ** error will have been caught long before we reach this point. */ if( ALWAYS(pEList->nExpr==nVal) ){ @@ -99442,10 +99438,8 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN( /* Loop through each expression in . */ r1 = sqlite3GetTempReg(pParse); r2 = sqlite3GetTempReg(pParse); - if( isRowid ) sqlite3VdbeAddOp4(v, OP_Blob, 0, r2, 0, "", P4_STATIC); for(i=pList->nExpr, pItem=pList->a; i>0; i--, pItem++){ Expr *pE2 = pItem->pExpr; - int iValToIns; /* If the expression is not constant then we will need to ** disable the test that was generated above that makes sure @@ -99458,20 +99452,9 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN( } /* Evaluate the expression and insert it into the temp table */ - if( isRowid && sqlite3ExprIsInteger(pE2, &iValToIns) ){ - sqlite3VdbeAddOp3(v, OP_InsertInt, iTab, r2, iValToIns); - }else{ - r3 = sqlite3ExprCodeTarget(pParse, pE2, r1); - if( isRowid ){ - sqlite3VdbeAddOp2(v, OP_MustBeInt, r3, - sqlite3VdbeCurrentAddr(v)+2); - VdbeCoverage(v); - sqlite3VdbeAddOp3(v, OP_Insert, iTab, r2, r3); - }else{ - sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1); - sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iTab, r2, r3, 1); - } - } + r3 = sqlite3ExprCodeTarget(pParse, pE2, r1); + sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1); + sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iTab, r2, r3, 1); } sqlite3ReleaseTempReg(pParse, r1); sqlite3ReleaseTempReg(pParse, r2); @@ -118107,10 +118090,13 @@ SQLITE_PRIVATE void sqlite3CompleteInsertion( pik_flags |= (update_flags & OPFLAG_SAVEPOSITION); #ifdef SQLITE_ENABLE_PREUPDATE_HOOK if( update_flags==0 ){ - sqlite3VdbeAddOp4(v, OP_InsertInt, - iIdxCur+i, aRegIdx[i], 0, (char*)pTab, P4_TABLE + int r = sqlite3GetTempReg(pParse); + sqlite3VdbeAddOp2(v, OP_Integer, 0, r); + sqlite3VdbeAddOp4(v, OP_Insert, + iIdxCur+i, aRegIdx[i], r, (char*)pTab, P4_TABLE ); sqlite3VdbeChangeP5(v, OPFLAG_ISNOOP); + sqlite3ReleaseTempReg(pParse, r); } #endif } @@ -136427,7 +136413,6 @@ static int codeEqualityTerm( if( pLoop->aLTerm[i]->pExpr==pX ){ int iOut = iReg + i - iEq; if( eType==IN_INDEX_ROWID ){ - testcase( nEq>1 ); /* Happens with a UNIQUE index on ROWID */ pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iOut); }else{ int iCol = aiMap ? aiMap[iMap++] : 0; @@ -137189,6 +137174,9 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( sqlite3VdbeAddOp3(v, OP_SeekRowid, iCur, addrNxt, iRowidReg); VdbeCoverage(v); pLevel->op = OP_Noop; + if( (pTerm->prereqAll & pLevel->notReady)==0 ){ + pTerm->wtFlags |= TERM_CODED; + } }else if( (pLoop->wsFlags & WHERE_IPK)!=0 && (pLoop->wsFlags & WHERE_COLUMN_RANGE)!=0 ){ @@ -217076,7 +217064,7 @@ static void fts5SourceIdFunc( ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); - sqlite3_result_text(pCtx, "fts5: 2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959a1dd", -1, SQLITE_TRANSIENT); + sqlite3_result_text(pCtx, "fts5: 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7", -1, SQLITE_TRANSIENT); } /* @@ -221840,9 +221828,9 @@ SQLITE_API int sqlite3_stmt_init( #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */ /************** End of stmt.c ************************************************/ -#if __LINE__!=221843 +#if __LINE__!=221831 #undef SQLITE_SOURCE_ID -#define SQLITE_SOURCE_ID "2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959alt2" +#define SQLITE_SOURCE_ID "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0alt2" #endif /* Return the source-id for this library */ SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } Modified: stable/12/contrib/sqlite3/sqlite3.h ============================================================================== --- stable/12/contrib/sqlite3/sqlite3.h Wed May 1 01:49:33 2019 (r346982) +++ stable/12/contrib/sqlite3/sqlite3.h Wed May 1 01:53:19 2019 (r346983) @@ -123,9 +123,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.27.1" -#define SQLITE_VERSION_NUMBER 3027001 -#define SQLITE_SOURCE_ID "2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959a1dd" +#define SQLITE_VERSION "3.27.2" +#define SQLITE_VERSION_NUMBER 3027002 +#define SQLITE_SOURCE_ID "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -2369,7 +2369,7 @@ SQLITE_API int sqlite3_changes(sqlite3*); ** not. ^Changes to a view that are intercepted by INSTEAD OF triggers ** are not counted. ** -** This the [sqlite3_total_changes(D)] interface only reports the number +** The [sqlite3_total_changes(D)] interface only reports the number ** of rows that changed due to SQL statement run against database ** connection D. Any changes by other database connections are ignored. ** To detect changes against a database file from other database Modified: stable/12/contrib/sqlite3/tea/configure ============================================================================== --- stable/12/contrib/sqlite3/tea/configure Wed May 1 01:49:33 2019 (r346982) +++ stable/12/contrib/sqlite3/tea/configure Wed May 1 01:53:19 2019 (r346983) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.27.1. +# Generated by GNU Autoconf 2.69 for sqlite 3.27.2. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -577,8 +577,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.27.1' -PACKAGE_STRING='sqlite 3.27.1' +PACKAGE_VERSION='3.27.2' +PACKAGE_STRING='sqlite 3.27.2' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1303,7 +1303,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.27.1 to adapt to many kinds of systems. +\`configure' configures sqlite 3.27.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1365,7 +1365,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.27.1:";; + short | recursive ) echo "Configuration of sqlite 3.27.2:";; esac cat <<\_ACEOF @@ -1467,7 +1467,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.27.1 +sqlite configure 3.27.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1878,7 +1878,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.27.1, which was +It was created by sqlite $as_me 3.27.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -9373,7 +9373,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.27.1, which was +This file was extended by sqlite $as_me 3.27.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -9426,7 +9426,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.27.1 +sqlite config.status 3.27.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/12/contrib/sqlite3/tea/configure.ac ============================================================================== --- stable/12/contrib/sqlite3/tea/configure.ac Wed May 1 01:49:33 2019 (r346982) +++ stable/12/contrib/sqlite3/tea/configure.ac Wed May 1 01:53:19 2019 (r346983) @@ -19,7 +19,7 @@ dnl to configure the system for the local environment. # so you can encode the package version directly into the source files. #----------------------------------------------------------------------- -AC_INIT([sqlite], [3.27.1]) +AC_INIT([sqlite], [3.27.2]) #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. From owner-svn-src-all@freebsd.org Wed May 1 05:42:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 169421582DE0; Wed, 1 May 2019 05:42:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 71D4984BCC; Wed, 1 May 2019 05:42:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1492C1D06A; Wed, 1 May 2019 05:42:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x415gDTd065802; Wed, 1 May 2019 05:42:13 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x415gDJx065801; Wed, 1 May 2019 05:42:13 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905010542.x415gDJx065801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 1 May 2019 05:42:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346984 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 346984 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 71D4984BCC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.81 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.81)[-0.809,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 05:42:15 -0000 Author: imp Date: Wed May 1 05:42:13 2019 New Revision: 346984 URL: https://svnweb.freebsd.org/changeset/base/346984 Log: Use D_PARTISGPT rather than bare 255 These three cases dovetail with other places in the code where we use or set D_PARTISGPT when we mean that the partitioning scheme is GPT. Use this #define to make the code easier to undertand. Reviewed by: tsoome@ Differential Revision: https://reviews.freebsd.org/D20122 Modified: head/stand/common/disk.c Modified: head/stand/common/disk.c ============================================================================== --- head/stand/common/disk.c Wed May 1 01:53:19 2019 (r346983) +++ head/stand/common/disk.c Wed May 1 05:42:13 2019 (r346984) @@ -286,9 +286,9 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize od->entrysize = part.end - part.start + 1; slice = part.index; if (ptable_gettype(od->table) == PTABLE_GPT) { - partition = 255; + partition = D_PARTISGPT; goto out; /* Nothing more to do */ - } else if (partition == 255) { + } else if (partition == D_PARTISGPT) { /* * When we try to open GPT partition, but partition * table isn't GPT, reset d_partition value to -1 @@ -419,7 +419,7 @@ disk_parsedev(struct disk_devdesc *dev, const char *de /* we don't support nested partitions on GPT */ if (*cp != '\0' && *cp != ':') return (EINVAL); - partition = 255; + partition = D_PARTISGPT; } else #endif #ifdef LOADER_MBR_SUPPORT From owner-svn-src-all@freebsd.org Wed May 1 07:09:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 202FA158F057; Wed, 1 May 2019 07:09:30 +0000 (UTC) (envelope-from slava.shwartsman@gmail.com) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 17EBC8F041; Wed, 1 May 2019 07:09:29 +0000 (UTC) (envelope-from slava.shwartsman@gmail.com) Received: by mail-wm1-f66.google.com with SMTP id q15so621827wmf.3; Wed, 01 May 2019 00:09:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Nwv+MxoTi8a47eJZHr4gBkqerIhJC+GpQf5VSIO6an0=; b=Y+0432sBRocFuU7dmmJK4mfmjHjZx8dsa66qUnyCtjUPNZ9v5fdql6YTABc7OUQ3Ju jTdUDe+Vts7Rj2Y9KuPi5zUVrysMDka4CgSQGh2waEiZEJ0iL2vm2d2Mw45vzXUIYrKL znuyGFMJ/oQ5/NeN4UUXiJdckX81O5s8J5EEAr6Ol4Ch3aIt8zF0mi/D6vk5cNisCTxV l1Nd/uylHasPwA977uYw5eSzf0iV7USQbGA3KpEGFkYkWsI4i6VbJvrmuDE2aTaAwvl/ pzEdYKPEiWIxJWIVqsNK5CfbyVOdpMbrIiFTi/HQG954cVQE5WVtPKrPXtGrhVxTTgp2 zlsg== X-Gm-Message-State: APjAAAViLqxxegp1hK3mY24kbwvVy5wRlON+uuTYz8qPgmtUjqVXiY/b 7PiIcInozMlSaXUVaVcE862GXjc3 X-Google-Smtp-Source: APXvYqyeJEv83uUZ+7ofMs6kRZF62No0mhG3cSR0nXLoi1QnRMXtpUvu4daBvzW721GKLkkxRiBLew== X-Received: by 2002:a1c:6783:: with SMTP id b125mr5548050wmc.79.1556694562025; Wed, 01 May 2019 00:09:22 -0700 (PDT) Received: from [10.223.3.125] ([193.47.165.251]) by smtp.gmail.com with ESMTPSA id a4sm6016742wmf.45.2019.05.01.00.09.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 May 2019 00:09:20 -0700 (PDT) Reply-To: slavash@FreeBSD.org Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en To: John Baldwin , Hans Petter Selasky , "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051425.wB5EP38T004562@repo.freebsd.org> <7cea5305-4136-a0b6-487b-51307b1c6db9@FreeBSD.org> <123654bf-59f7-1db8-55ce-36306bdac43d@FreeBSD.org> <67b638e0-8e6f-f960-b263-62eed8ce28b7@FreeBSD.org> From: Slava Shwartsman Message-ID: <0e80cb1d-20b9-5b8c-330e-5f64a603ff10@FreeBSD.org> Date: Wed, 1 May 2019 10:09:19 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <67b638e0-8e6f-f960-b263-62eed8ce28b7@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 17EBC8F041 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of slavashwartsman@gmail.com designates 209.85.128.66 as permitted sender) smtp.mailfrom=slavashwartsman@gmail.com X-Spamd-Result: default: False [-2.37 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[slavash@FreeBSD.org]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; FORGED_SENDER(0.30)[slavash@FreeBSD.org,slavashwartsman@gmail.com]; IP_SCORE(-1.23)[ipnet: 209.85.128.0/17(-3.85), asn: 15169(-2.24), country: US(-0.06)]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FROM_NEQ_ENVFROM(0.00)[slavash@FreeBSD.org,slavashwartsman@gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; TAGGED_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.87)[0.871,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[FreeBSD.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[66.128.85.209.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 07:09:30 -0000 On 30-Apr-19 00:14, John Baldwin wrote: > On 4/25/19 12:10 AM, Slava Shwartsman wrote: >> >> >> On 17-Apr-19 00:28, John Baldwin wrote: >>> On 4/16/19 8:32 AM, Hans Petter Selasky wrote: >>>> On 4/16/19 4:39 PM, Andrey V. Elsukov wrote: >>>>> On 05.12.2018 17:25, Slava Shwartsman wrote: >>>>>> Author: slavash >>>>>> Date: Wed Dec 5 14:25:03 2018 >>>>>> New Revision: 341586 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/341586 >>>>>> >>>>>> Log: >>>>>> mlx5en: Implement backpressure indication. >>>>>> >>>>>> The backpressure indication is implemented using an unlimited rate type of >>>>>> mbuf send tag. When the upper layers typically the socket layer has obtained such >>>>>> a tag, it can then query the destination driver queue for the current >>>>>> amount of space available in the send queue. >>>>>> >>>>>> A single mbuf send tag may be referenced multiple times and a refcount has been added >>>>>> to the mlx5e_priv structure to track its usage. Because the send tag resides >>>>>> in the mlx5e_channel structure, there is no need to wait for refcounts to reach >>>>>> zero until the mlx4en(4) driver is detached. The channels structure is persistant >>>>>> during the lifetime of the mlx5en(4) driver it belongs to and can so be accessed >>>>>> without any need of synchronization. >>>>>> >>>>>> The mlx5e_snd_tag structure was extended to contain a type field, because there are now >>>>>> two different tag types which end up in the driver which need to be distinguished. >>>>>> >>>>>> Submitted by: hselasky@ >>>>>> Approved by: hselasky (mentor) >>>>>> MFC after: 1 week >>>>>> Sponsored by: Mellanox Technologies >>>>>> @@ -587,27 +609,33 @@ mlx5e_xmit(struct ifnet *ifp, struct mbuf *mb) >>>>>> struct mlx5e_sq *sq; >>>>>> int ret; >>>>>> >>>>>> - sq = mlx5e_select_queue(ifp, mb); >>>>>> - if (unlikely(sq == NULL)) { >>>>>> -#ifdef RATELIMIT >>>>>> - /* Check for route change */ >>>>>> - if (mb->m_pkthdr.snd_tag != NULL && >>>>>> - mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>>> + if (mb->m_pkthdr.snd_tag != NULL) { >>>>>> + sq = mlx5e_select_queue_by_send_tag(ifp, mb); >>>>>> + if (unlikely(sq == NULL)) { >>>>>> + /* Check for route change */ >>>>>> + if (mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>>> + /* Free mbuf */ >>>>>> + m_freem(mb); >>>>>> + >>>>>> + /* >>>>>> + * Tell upper layers about route >>>>>> + * change and to re-transmit this >>>>>> + * packet: >>>>>> + */ >>>>>> + return (EAGAIN); >>>>>> + } >>>>> >>>>> Hi, >>>>> >>>>> I just discovered something strange and found that this commit is the >>>>> cause. >>>>> The test system has mlx5en 100G interface. It has two vlans: vlan500 and >>>>> vlan100. >>>>> Via vlan500 it receives some packets flows. Then it routes these packets >>>>> into vlan100. >>>>> But packets are dropped in mlx5e_xmit() with EAGAIN error code. >>>>> >>>>> # dtrace -n 'fbt::ip6_output:return {printf("%d", arg1);}' >>>>> dtrace: description 'fbt::ip6_output:return ' matched 1 probe >>>>> CPU ID FUNCTION:NAME >>>>> 23 54338 ip6_output:return 35 >>>>> 16 54338 ip6_output:return 35 >>>>> 21 54338 ip6_output:return 35 >>>>> 22 54338 ip6_output:return 35 >>>>> 24 54338 ip6_output:return 35 >>>>> 23 54338 ip6_output:return 35 >>>>> 14 54338 ip6_output:return 35 >>>>> ^C >>>>> >>>>> # dtrace -n 'fbt::mlx5e_xmit:return {printf("%d", arg1);}' >>>>> dtrace: description 'fbt::mlx5e_xmit:return ' matched 1 probe >>>>> CPU ID FUNCTION:NAME >>>>> 16 69030 mlx5e_xmit:return 35 >>>>> 23 69030 mlx5e_xmit:return 35 >>>>> 26 69030 mlx5e_xmit:return 35 >>>>> 25 69030 mlx5e_xmit:return 35 >>>>> 24 69030 mlx5e_xmit:return 35 >>>>> 21 69030 mlx5e_xmit:return 35 >>>>> 26 69030 mlx5e_xmit:return 35 >>>>> ^C >>>>> >>>>> The kernel config is GENERIC. >>>>> 13.0-CURRENT #9 r345758+82f3d57(svn_head)-dirty >>>>> >>>> >>>> Hi, >>>> >>>> This might be a case where rcvif in the mbuf's pktheader is not cleared >>>> before the packet is fed back on the wire. >>>> >>>> John Baldwin is working on the send tags implementation, to eliminate >>>> the EAGAIN handling in the network drivers. >>> >>> I will try to push this branch sooner then since it affects more than just >>> TLS. Part of the change includes a new flag we can use to assert that we >> Thanks John! >>> aren't just getting a stale rcvif (though there are also now assertions in >>> ip_output that should catch this case I think). >>> >> >> >> >> Hi Andrey, >> >> Yes, we were able to reproduce this issue in house. If you don't mind, I >> prefer to wait for John's update - where he eliminates the EAGAIN >> handling in the network drivers. > > I have rebased the branch for this, but for now it will just panic sooner > I believe by tripping an assertion. Can you grab the diff (or just the branch) > from the 'send_tags' branch at github/bsdjhb/freebsd and reproduce under a > kernel with INVARIANTS? I think we will have to explicitly clear the 'rcvif' > pointer somewhere, but I want to see what the stack trace looks like so I can > think about the "right" place to clear it. > Hi John, I grabbed your branch (which doesn't build BTW due to libbe(3): Fix mis-application of patch (SHLIBDIR) so I just reverted it). The kernel doesn't panic in this scenario - it just that the packets are being dropped. So I added a kdb_backtrace right before the return (EAGAIN) in mlx5e_xmit: KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0000547d90 mlx5e_xmit() at mlx5e_xmit+0x3d/frame 0xfffffe0000548160 vlan_transmit() at vlan_transmit+0xdc/frame 0xfffffe00005481d0 ether_output_frame() at ether_output_frame+0xa2/frame 0xfffffe0000548200 ether_output() at ether_output+0x689/frame 0xfffffe00005482a0 ip_output() at ip_output+0x13a4/frame 0xfffffe00005483f0 ip_forward() at ip_forward+0x344/frame 0xfffffe00005484b0 ip_input() at ip_input+0x7f5/frame 0xfffffe0000548560 netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005485d0 ether_demux() at ether_demux+0x147/frame 0xfffffe0000548600 ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe0000548660 netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005486d0 ether_input() at ether_input+0x73/frame 0xfffffe0000548700 vlan_input() at vlan_input+0x1e7/frame 0xfffffe0000548750 ether_demux() at ether_demux+0x12d/frame 0xfffffe0000548780 ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe00005487e0 netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe0000548850 ether_input() at ether_input+0x73/frame 0xfffffe0000548880 mlx5e_rx_cq_comp() at mlx5e_rx_cq_comp+0x8b4/frame 0xfffffe00005489a0 mlx5_cq_completion() at mlx5_cq_completion+0x5e/frame 0xfffffe00005489d0 mlx5_msix_handler() at mlx5_msix_handler+0x1ba/frame 0xfffffe0000548a10 ithread_loop() at ithread_loop+0x187/frame 0xfffffe0000548a70 fork_exit() at fork_exit+0x84/frame 0xfffffe0000548ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0000548ab0 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- Please ping me if you want me to try anything else. Slava From owner-svn-src-all@freebsd.org Wed May 1 06:59:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DD63158CD66; Wed, 1 May 2019 06:59:05 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8E098E49B; Wed, 1 May 2019 06:59:04 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8294F1DC44; Wed, 1 May 2019 06:59:04 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x416x4QD003862; Wed, 1 May 2019 06:59:04 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x416x4wg003861; Wed, 1 May 2019 06:59:04 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201905010659.x416x4wg003861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 1 May 2019 06:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346985 - stable/11/contrib/tcpdump X-SVN-Group: stable-11 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/11/contrib/tcpdump X-SVN-Commit-Revision: 346985 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A8E098E49B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.74 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.74)[-0.742,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 06:59:05 -0000 Author: oshogbo Date: Wed May 1 06:59:04 2019 New Revision: 346985 URL: https://svnweb.freebsd.org/changeset/base/346985 Log: MFC r346263: tcpdump: disable Capsicum if -E option is provided. The -E is used to provide a secret for decrypting IPsec. The secret may be provided through command line or as the file. The problem is that tcpdump doesn't support yet opening files in capability mode and the file may contain a list of the files to open. As a workaround, for now, let's just disable capsicum if the -E the option is provided. PR: 236819 MFC after: 2 weeks Modified: stable/11/contrib/tcpdump/tcpdump.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/tcpdump/tcpdump.c ============================================================================== --- stable/11/contrib/tcpdump/tcpdump.c Wed May 1 05:42:13 2019 (r346984) +++ stable/11/contrib/tcpdump/tcpdump.c Wed May 1 06:59:04 2019 (r346985) @@ -2063,7 +2063,8 @@ main(int argc, char **argv) } #ifdef HAVE_CAPSICUM - cansandbox = (VFileName == NULL && zflag == NULL); + cansandbox = (VFileName == NULL && zflag == NULL && + ndo->ndo_espsecret == NULL); #ifdef HAVE_CASPER cansandbox = (cansandbox && (ndo->ndo_nflag || capdns != NULL)); #else From owner-svn-src-all@freebsd.org Wed May 1 07:00:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC5B8158D634; Wed, 1 May 2019 07:00:57 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A3278E84B; Wed, 1 May 2019 07:00:57 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 755FB1DC62; Wed, 1 May 2019 07:00:57 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4170vYb006512; Wed, 1 May 2019 07:00:57 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4170vgJ006511; Wed, 1 May 2019 07:00:57 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201905010700.x4170vgJ006511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 1 May 2019 07:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346986 - stable/12/contrib/tcpdump X-SVN-Group: stable-12 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/12/contrib/tcpdump X-SVN-Commit-Revision: 346986 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9A3278E84B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.74 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.74)[-0.742,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 07:00:58 -0000 Author: oshogbo Date: Wed May 1 07:00:56 2019 New Revision: 346986 URL: https://svnweb.freebsd.org/changeset/base/346986 Log: MFC r346263: tcpdump: disable Capsicum if -E option is provided. The -E is used to provide a secret for decrypting IPsec. The secret may be provided through command line or as the file. The problem is that tcpdump doesn't support yet opening files in capability mode and the file may contain a list of the files to open. As a workaround, for now, let's just disable capsicum if the -E the option is provided. PR: 236819 Modified: stable/12/contrib/tcpdump/tcpdump.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/tcpdump/tcpdump.c ============================================================================== --- stable/12/contrib/tcpdump/tcpdump.c Wed May 1 06:59:04 2019 (r346985) +++ stable/12/contrib/tcpdump/tcpdump.c Wed May 1 07:00:56 2019 (r346986) @@ -2063,7 +2063,8 @@ main(int argc, char **argv) } #ifdef HAVE_CAPSICUM - cansandbox = (VFileName == NULL && zflag == NULL); + cansandbox = (VFileName == NULL && zflag == NULL && + ndo->ndo_espsecret == NULL); #ifdef HAVE_CASPER cansandbox = (cansandbox && (ndo->ndo_nflag || capdns != NULL)); #else From owner-svn-src-all@freebsd.org Wed May 1 08:06:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75C371598AA5; Wed, 1 May 2019 08:06:07 +0000 (UTC) (envelope-from slava.shwartsman@gmail.com) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 025D96A889; Wed, 1 May 2019 08:06:05 +0000 (UTC) (envelope-from slava.shwartsman@gmail.com) Received: by mail-wr1-f65.google.com with SMTP id o4so11852778wra.3; Wed, 01 May 2019 01:06:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:from:to:references:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=pYpzvyvmGs4c9zK5kbcxmuwABTB2cM9SVj3k4V1GTEc=; b=mB6LNcFZ6+nCNuqycex25hZzWz4EsK4S1/PWDK55o8uirR6R86Ox2vY4w6TDZl5Kx/ FfltUENRwuKfsZIcaQEWBFpO4HoIiiFu3oG1hEqRUJWo3UBBrya2guzubP8Xg1BuMZuj BDScFOOuhdP0cbUjyrJvEp9iOR95Rs12eo6HAtiMEIbZ8zjtwr3sAhSrT6AqWRDIe8hU EVn32wUNM4TFYyF6zzsKcKOq2yFZdymEJWhBjiHYv1RYEBN+kC9DpUPYjPsFwa11zdZu X+Z5b/2ejz7ZRsPJjE4J6Ia0wbPUlwFQQaQ+otAi7WxuXhLFMHexgTOOMBuCv2r0DLOj JkMA== X-Gm-Message-State: APjAAAXzShPTgy51s+yFEW2potKTcqIOI1iSJ+RT5EmBKniPIZVQtwkX 25UHdWevDcjo5L764Fa8AyppVgcP X-Google-Smtp-Source: APXvYqzt/8cvyaWEl4Fks1gLuC9gMca7xILJKY6V7KQhYykjC5Rpl2iQT58726REevZYtd7kM+GiXw== X-Received: by 2002:adf:dcc7:: with SMTP id x7mr12370052wrm.197.1556697958472; Wed, 01 May 2019 01:05:58 -0700 (PDT) Received: from [10.223.3.125] ([193.47.165.251]) by smtp.gmail.com with ESMTPSA id i30sm7305802wrc.8.2019.05.01.01.05.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 May 2019 01:05:57 -0700 (PDT) Reply-To: slavash@FreeBSD.org Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en From: Slava Shwartsman To: John Baldwin , Hans Petter Selasky , "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051425.wB5EP38T004562@repo.freebsd.org> <7cea5305-4136-a0b6-487b-51307b1c6db9@FreeBSD.org> <123654bf-59f7-1db8-55ce-36306bdac43d@FreeBSD.org> <67b638e0-8e6f-f960-b263-62eed8ce28b7@FreeBSD.org> <0e80cb1d-20b9-5b8c-330e-5f64a603ff10@FreeBSD.org> <737bfa62-eb3e-7c48-6356-0e0b76bb0593@FreeBSD.org> Message-ID: <76a05c08-b851-c50a-16fa-ac42c872413c@FreeBSD.org> Date: Wed, 1 May 2019 11:05:56 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <737bfa62-eb3e-7c48-6356-0e0b76bb0593@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 025D96A889 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of slavashwartsman@gmail.com designates 209.85.221.65 as permitted sender) smtp.mailfrom=slavashwartsman@gmail.com X-Spamd-Result: default: False [-4.07 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[slavash@FreeBSD.org]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.82)[-0.825,0]; FORGED_SENDER(0.30)[slavash@FreeBSD.org,slavashwartsman@gmail.com]; IP_SCORE(-1.23)[ipnet: 209.85.128.0/17(-3.85), asn: 15169(-2.24), country: US(-0.06)]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FROM_NEQ_ENVFROM(0.00)[slavash@FreeBSD.org,slavashwartsman@gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; TAGGED_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[FreeBSD.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[65.221.85.209.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 08:06:07 -0000 On 01-May-19 10:28, Slava Shwartsman wrote: > > > On 01-May-19 10:09, Slava Shwartsman wrote: >> >> >> On 30-Apr-19 00:14, John Baldwin wrote: >>> On 4/25/19 12:10 AM, Slava Shwartsman wrote: >>>> >>>> >>>> On 17-Apr-19 00:28, John Baldwin wrote: >>>>> On 4/16/19 8:32 AM, Hans Petter Selasky wrote: >>>>>> On 4/16/19 4:39 PM, Andrey V. Elsukov wrote: >>>>>>> On 05.12.2018 17:25, Slava Shwartsman wrote: >>>>>>>> Author: slavash >>>>>>>> Date: Wed Dec  5 14:25:03 2018 >>>>>>>> New Revision: 341586 >>>>>>>> URL: https://svnweb.freebsd.org/changeset/base/341586 >>>>>>>> >>>>>>>> Log: >>>>>>>>      mlx5en: Implement backpressure indication. >>>>>>>>      The backpressure indication is implemented using an >>>>>>>> unlimited rate type of >>>>>>>>      mbuf send tag. When the upper layers typically the socket >>>>>>>> layer has obtained such >>>>>>>>      a tag, it can then query the destination driver queue for >>>>>>>> the current >>>>>>>>      amount of space available in the send queue. >>>>>>>>      A single mbuf send tag may be referenced multiple times and >>>>>>>> a refcount has been added >>>>>>>>      to the mlx5e_priv structure to track its usage. Because the >>>>>>>> send tag resides >>>>>>>>      in the mlx5e_channel structure, there is no need to wait >>>>>>>> for refcounts to reach >>>>>>>>      zero until the mlx4en(4) driver is detached. The channels >>>>>>>> structure is persistant >>>>>>>>      during the lifetime of the mlx5en(4) driver it belongs to >>>>>>>> and can so be accessed >>>>>>>>      without any need of synchronization. >>>>>>>>      The mlx5e_snd_tag structure was extended to contain a type >>>>>>>> field, because there are now >>>>>>>>      two different tag types which end up in the driver which >>>>>>>> need to be distinguished. >>>>>>>>      Submitted by:   hselasky@ >>>>>>>>      Approved by:    hselasky (mentor) >>>>>>>>      MFC after:      1 week >>>>>>>>      Sponsored by:   Mellanox Technologies >>>>>>>> @@ -587,27 +609,33 @@ mlx5e_xmit(struct ifnet *ifp, struct mbuf >>>>>>>> *mb) >>>>>>>>         struct mlx5e_sq *sq; >>>>>>>>         int ret; >>>>>>>> -    sq = mlx5e_select_queue(ifp, mb); >>>>>>>> -    if (unlikely(sq == NULL)) { >>>>>>>> -#ifdef RATELIMIT >>>>>>>> -        /* Check for route change */ >>>>>>>> -        if (mb->m_pkthdr.snd_tag != NULL && >>>>>>>> -            mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>>>>> +    if (mb->m_pkthdr.snd_tag != NULL) { >>>>>>>> +        sq = mlx5e_select_queue_by_send_tag(ifp, mb); >>>>>>>> +        if (unlikely(sq == NULL)) { >>>>>>>> +            /* Check for route change */ >>>>>>>> +            if (mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>>>>> +                /* Free mbuf */ >>>>>>>> +                m_freem(mb); >>>>>>>> + >>>>>>>> +                /* >>>>>>>> +                 * Tell upper layers about route >>>>>>>> +                 * change and to re-transmit this >>>>>>>> +                 * packet: >>>>>>>> +                 */ >>>>>>>> +                return (EAGAIN); >>>>>>>> +            } >>>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> I just discovered something strange and found that this commit is >>>>>>> the >>>>>>> cause. >>>>>>> The test system has mlx5en 100G interface. It has two vlans: >>>>>>> vlan500 and >>>>>>> vlan100. >>>>>>> Via vlan500 it receives some packets flows. Then it routes these >>>>>>> packets >>>>>>> into vlan100. >>>>>>> But packets are dropped in mlx5e_xmit() with EAGAIN error code. >>>>>>> >>>>>>> # dtrace -n 'fbt::ip6_output:return {printf("%d", arg1);}' >>>>>>> dtrace: description 'fbt::ip6_output:return ' matched 1 probe >>>>>>> CPU     ID                    FUNCTION:NAME >>>>>>>     23  54338                ip6_output:return 35 >>>>>>>     16  54338                ip6_output:return 35 >>>>>>>     21  54338                ip6_output:return 35 >>>>>>>     22  54338                ip6_output:return 35 >>>>>>>     24  54338                ip6_output:return 35 >>>>>>>     23  54338                ip6_output:return 35 >>>>>>>     14  54338                ip6_output:return 35 >>>>>>> ^C >>>>>>> >>>>>>> # dtrace -n 'fbt::mlx5e_xmit:return {printf("%d", arg1);}' >>>>>>> dtrace: description 'fbt::mlx5e_xmit:return ' matched 1 probe >>>>>>> CPU     ID                    FUNCTION:NAME >>>>>>>     16  69030                mlx5e_xmit:return 35 >>>>>>>     23  69030                mlx5e_xmit:return 35 >>>>>>>     26  69030                mlx5e_xmit:return 35 >>>>>>>     25  69030                mlx5e_xmit:return 35 >>>>>>>     24  69030                mlx5e_xmit:return 35 >>>>>>>     21  69030                mlx5e_xmit:return 35 >>>>>>>     26  69030                mlx5e_xmit:return 35 >>>>>>> ^C >>>>>>> >>>>>>> The kernel config is GENERIC. >>>>>>> 13.0-CURRENT #9 r345758+82f3d57(svn_head)-dirty >>>>>>> >>>>>> >>>>>> Hi, >>>>>> >>>>>> This might be a case where rcvif in the mbuf's pktheader is not >>>>>> cleared >>>>>> before the packet is fed back on the wire. >>>>>> >>>>>> John Baldwin is working on the send tags implementation, to eliminate >>>>>> the EAGAIN handling in the network drivers. >>>>> >>>>> I will try to push this branch sooner then since it affects more >>>>> than just >>>>> TLS.  Part of the change includes a new flag we can use to assert >>>>> that we >>>> Thanks John! >>>>> aren't just getting a stale rcvif (though there are also now >>>>> assertions in >>>>> ip_output that should catch this case I think). >>>>> >>>> >>>> >>>> >>>> Hi Andrey, >>>> >>>> Yes, we were able to reproduce this issue in house. If you don't >>>> mind, I >>>> prefer to wait for John's update - where he eliminates the EAGAIN >>>> handling in the network drivers. >>> >>> I have rebased the branch for this, but for now it will just panic >>> sooner >>> I believe by tripping an assertion.  Can you grab the diff (or just >>> the branch) >>> from the 'send_tags' branch at github/bsdjhb/freebsd and reproduce >>> under a >>> kernel with INVARIANTS?  I think we will have to explicitly clear the >>> 'rcvif' >>> pointer somewhere, but I want to see what the stack trace looks like >>> so I can >>> think about the "right" place to clear it. >>> >> >> Hi John, >> >> I grabbed your branch (which doesn't build BTW due to libbe(3): Fix >> mis-application of patch (SHLIBDIR) so I just reverted it). >> >> The kernel doesn't panic in this scenario - it just that the packets >> are being dropped. So I added a kdb_backtrace right before the return >> (EAGAIN) in mlx5e_xmit: >> >> KDB: stack backtrace: >> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame >> 0xfffffe0000547d90 >> mlx5e_xmit() at mlx5e_xmit+0x3d/frame 0xfffffe0000548160 >> vlan_transmit() at vlan_transmit+0xdc/frame 0xfffffe00005481d0 >> ether_output_frame() at ether_output_frame+0xa2/frame 0xfffffe0000548200 >> ether_output() at ether_output+0x689/frame 0xfffffe00005482a0 >> ip_output() at ip_output+0x13a4/frame 0xfffffe00005483f0 >> ip_forward() at ip_forward+0x344/frame 0xfffffe00005484b0 >> ip_input() at ip_input+0x7f5/frame 0xfffffe0000548560 >> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame >> 0xfffffe00005485d0 >> ether_demux() at ether_demux+0x147/frame 0xfffffe0000548600 >> ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe0000548660 >> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame >> 0xfffffe00005486d0 >> ether_input() at ether_input+0x73/frame 0xfffffe0000548700 >> vlan_input() at vlan_input+0x1e7/frame 0xfffffe0000548750 >> ether_demux() at ether_demux+0x12d/frame 0xfffffe0000548780 >> ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe00005487e0 >> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame >> 0xfffffe0000548850 >> ether_input() at ether_input+0x73/frame 0xfffffe0000548880 >> mlx5e_rx_cq_comp() at mlx5e_rx_cq_comp+0x8b4/frame 0xfffffe00005489a0 >> mlx5_cq_completion() at mlx5_cq_completion+0x5e/frame 0xfffffe00005489d0 >> mlx5_msix_handler() at mlx5_msix_handler+0x1ba/frame 0xfffffe0000548a10 >> ithread_loop() at ithread_loop+0x187/frame 0xfffffe0000548a70 >> fork_exit() at fork_exit+0x84/frame 0xfffffe0000548ab0 >> fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0000548ab0 >> --- trap 0, rip = 0, rsp = 0, rbp = 0 --- >> >> >> Please ping me if you want me to try anything else. >> >> >> Slava > > My bad - tested with master. Re-testing now. > > > Slava Got it now: panic: Assertion m->m_pkthdr.snd_tag == NULL failed at /usr/src/sys/netinet/ip_output.c:213 cpuid = 0 time = 1556697834 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00005ac1f0 vpanic() at vpanic+0x19d/frame 0xfffffe00005ac240 panic() at panic+0x43/frame 0xfffffe00005ac2a0 ip_output() at ip_output+0x159f/frame 0xfffffe00005ac3f0 ip_forward() at ip_forward+0x38c/frame 0xfffffe00005ac4b0 ip_input() at ip_input+0x7f5/frame 0xfffffe00005ac560 netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005ac5d0 ether_demux() at ether_demux+0x147/frame 0xfffffe00005ac600 ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe00005ac660 netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005ac6d0 ether_input() at ether_input+0x7d/frame 0xfffffe00005ac700 vlan_input() at vlan_input+0x1e7/frame 0xfffffe00005ac750 ether_demux() at ether_demux+0x12d/frame 0xfffffe00005ac780 ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe00005ac7e0 netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005ac850 ether_input() at ether_input+0x7d/frame 0xfffffe00005ac880 mlx5e_rx_cq_comp() at mlx5e_rx_cq_comp+0x8b4/frame 0xfffffe00005ac9a0 mlx5_cq_completion() at mlx5_cq_completion+0x5e/frame 0xfffffe00005ac9d0 mlx5_msix_handler() at mlx5_msix_handler+0x1ba/frame 0xfffffe00005aca10 ithread_loop() at ithread_loop+0x187/frame 0xfffffe00005aca70 fork_exit() at fork_exit+0x84/frame 0xfffffe00005acab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00005acab0 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- KDB: enter: panic [ thread pid 12 tid 100113 ] Stopped at kdb_enter+0x3b: movq $0,kdb_why I can keep the machine in this state for a while now if you want to take a look at anything specific. Slava From owner-svn-src-all@freebsd.org Wed May 1 07:28:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E810515928E8; Wed, 1 May 2019 07:28:10 +0000 (UTC) (envelope-from slava.shwartsman@gmail.com) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 74D5A8FDA7; Wed, 1 May 2019 07:28:09 +0000 (UTC) (envelope-from slava.shwartsman@gmail.com) Received: by mail-wm1-f66.google.com with SMTP id o25so6307627wmf.5; Wed, 01 May 2019 00:28:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:from:to:references:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=KsIG70QEzPib2ajR8JxPLUGaPyK7qQCfqzwojcXhN6o=; b=HmZUo4SsA7Ms4PGT8zii5DeI/M98Ej/K3i13kNOBwa7H23lTkiIE2w2lBpWO7abXbK Uf1vtdSwvcGjRx1jreFY1wNdAZSmLgFyOOHitMUWgFffzFvj9KBRc1IVS6xB69pQSCSN D5Et/udvGq4NH9ucsiop5xCeRJTEyQofK3DlJIGNuh8MyaQEKoHhcV+AlCirPHdpmcwl zq7L+SXAQP6pRMjSJtphTAzYTaoimcHXvmiVYzxhNYm8Pr16lxQGojTq/vY4icgDUbLT hSYbmcsdi1jL8MDj6jpEHXornnvA41y7abDQGS6ms7GlbkWYSWXuZSMXgr1b1a0pnLny yi4Q== X-Gm-Message-State: APjAAAXMwkfmiDILlJBCMlv8NLSeJryi6Z2OzNS92myvl1SrTF0LobP4 ZUv/NDEaPRTmbMeO5A2u0sH2jqCI X-Google-Smtp-Source: APXvYqxFGsQZFI5R8VOOUG1x7dvH1aZ3iQuuq2LxA8UizZLMWe2jXvGf0X+zxS8cpZOIQHFsO27lsw== X-Received: by 2002:a05:600c:2506:: with SMTP id d6mr3251685wma.106.1556695687584; Wed, 01 May 2019 00:28:07 -0700 (PDT) Received: from [10.223.3.125] ([193.47.165.251]) by smtp.gmail.com with ESMTPSA id d3sm6720116wmf.46.2019.05.01.00.28.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 May 2019 00:28:07 -0700 (PDT) Reply-To: slavash@FreeBSD.org Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en From: Slava Shwartsman To: John Baldwin , Hans Petter Selasky , "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051425.wB5EP38T004562@repo.freebsd.org> <7cea5305-4136-a0b6-487b-51307b1c6db9@FreeBSD.org> <123654bf-59f7-1db8-55ce-36306bdac43d@FreeBSD.org> <67b638e0-8e6f-f960-b263-62eed8ce28b7@FreeBSD.org> <0e80cb1d-20b9-5b8c-330e-5f64a603ff10@FreeBSD.org> Message-ID: <737bfa62-eb3e-7c48-6356-0e0b76bb0593@FreeBSD.org> Date: Wed, 1 May 2019 10:28:05 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <0e80cb1d-20b9-5b8c-330e-5f64a603ff10@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 74D5A8FDA7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of slavashwartsman@gmail.com designates 209.85.128.66 as permitted sender) smtp.mailfrom=slavashwartsman@gmail.com X-Spamd-Result: default: False [-2.47 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[slavash@FreeBSD.org]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; FORGED_SENDER(0.30)[slavash@FreeBSD.org,slavashwartsman@gmail.com]; IP_SCORE(-1.23)[ipnet: 209.85.128.0/17(-3.85), asn: 15169(-2.24), country: US(-0.06)]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_NEQ_ENVFROM(0.00)[slavash@FreeBSD.org,slavashwartsman@gmail.com]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.77)[0.771,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[FreeBSD.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[66.128.85.209.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 07:28:11 -0000 On 01-May-19 10:09, Slava Shwartsman wrote: > > > On 30-Apr-19 00:14, John Baldwin wrote: >> On 4/25/19 12:10 AM, Slava Shwartsman wrote: >>> >>> >>> On 17-Apr-19 00:28, John Baldwin wrote: >>>> On 4/16/19 8:32 AM, Hans Petter Selasky wrote: >>>>> On 4/16/19 4:39 PM, Andrey V. Elsukov wrote: >>>>>> On 05.12.2018 17:25, Slava Shwartsman wrote: >>>>>>> Author: slavash >>>>>>> Date: Wed Dec  5 14:25:03 2018 >>>>>>> New Revision: 341586 >>>>>>> URL: https://svnweb.freebsd.org/changeset/base/341586 >>>>>>> >>>>>>> Log: >>>>>>>      mlx5en: Implement backpressure indication. >>>>>>>      The backpressure indication is implemented using an >>>>>>> unlimited rate type of >>>>>>>      mbuf send tag. When the upper layers typically the socket >>>>>>> layer has obtained such >>>>>>>      a tag, it can then query the destination driver queue for >>>>>>> the current >>>>>>>      amount of space available in the send queue. >>>>>>>      A single mbuf send tag may be referenced multiple times and >>>>>>> a refcount has been added >>>>>>>      to the mlx5e_priv structure to track its usage. Because the >>>>>>> send tag resides >>>>>>>      in the mlx5e_channel structure, there is no need to wait for >>>>>>> refcounts to reach >>>>>>>      zero until the mlx4en(4) driver is detached. The channels >>>>>>> structure is persistant >>>>>>>      during the lifetime of the mlx5en(4) driver it belongs to >>>>>>> and can so be accessed >>>>>>>      without any need of synchronization. >>>>>>>      The mlx5e_snd_tag structure was extended to contain a type >>>>>>> field, because there are now >>>>>>>      two different tag types which end up in the driver which >>>>>>> need to be distinguished. >>>>>>>      Submitted by:   hselasky@ >>>>>>>      Approved by:    hselasky (mentor) >>>>>>>      MFC after:      1 week >>>>>>>      Sponsored by:   Mellanox Technologies >>>>>>> @@ -587,27 +609,33 @@ mlx5e_xmit(struct ifnet *ifp, struct mbuf *mb) >>>>>>>         struct mlx5e_sq *sq; >>>>>>>         int ret; >>>>>>> -    sq = mlx5e_select_queue(ifp, mb); >>>>>>> -    if (unlikely(sq == NULL)) { >>>>>>> -#ifdef RATELIMIT >>>>>>> -        /* Check for route change */ >>>>>>> -        if (mb->m_pkthdr.snd_tag != NULL && >>>>>>> -            mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>>>> +    if (mb->m_pkthdr.snd_tag != NULL) { >>>>>>> +        sq = mlx5e_select_queue_by_send_tag(ifp, mb); >>>>>>> +        if (unlikely(sq == NULL)) { >>>>>>> +            /* Check for route change */ >>>>>>> +            if (mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>>>> +                /* Free mbuf */ >>>>>>> +                m_freem(mb); >>>>>>> + >>>>>>> +                /* >>>>>>> +                 * Tell upper layers about route >>>>>>> +                 * change and to re-transmit this >>>>>>> +                 * packet: >>>>>>> +                 */ >>>>>>> +                return (EAGAIN); >>>>>>> +            } >>>>>> >>>>>> Hi, >>>>>> >>>>>> I just discovered something strange and found that this commit is the >>>>>> cause. >>>>>> The test system has mlx5en 100G interface. It has two vlans: >>>>>> vlan500 and >>>>>> vlan100. >>>>>> Via vlan500 it receives some packets flows. Then it routes these >>>>>> packets >>>>>> into vlan100. >>>>>> But packets are dropped in mlx5e_xmit() with EAGAIN error code. >>>>>> >>>>>> # dtrace -n 'fbt::ip6_output:return {printf("%d", arg1);}' >>>>>> dtrace: description 'fbt::ip6_output:return ' matched 1 probe >>>>>> CPU     ID                    FUNCTION:NAME >>>>>>     23  54338                ip6_output:return 35 >>>>>>     16  54338                ip6_output:return 35 >>>>>>     21  54338                ip6_output:return 35 >>>>>>     22  54338                ip6_output:return 35 >>>>>>     24  54338                ip6_output:return 35 >>>>>>     23  54338                ip6_output:return 35 >>>>>>     14  54338                ip6_output:return 35 >>>>>> ^C >>>>>> >>>>>> # dtrace -n 'fbt::mlx5e_xmit:return {printf("%d", arg1);}' >>>>>> dtrace: description 'fbt::mlx5e_xmit:return ' matched 1 probe >>>>>> CPU     ID                    FUNCTION:NAME >>>>>>     16  69030                mlx5e_xmit:return 35 >>>>>>     23  69030                mlx5e_xmit:return 35 >>>>>>     26  69030                mlx5e_xmit:return 35 >>>>>>     25  69030                mlx5e_xmit:return 35 >>>>>>     24  69030                mlx5e_xmit:return 35 >>>>>>     21  69030                mlx5e_xmit:return 35 >>>>>>     26  69030                mlx5e_xmit:return 35 >>>>>> ^C >>>>>> >>>>>> The kernel config is GENERIC. >>>>>> 13.0-CURRENT #9 r345758+82f3d57(svn_head)-dirty >>>>>> >>>>> >>>>> Hi, >>>>> >>>>> This might be a case where rcvif in the mbuf's pktheader is not >>>>> cleared >>>>> before the packet is fed back on the wire. >>>>> >>>>> John Baldwin is working on the send tags implementation, to eliminate >>>>> the EAGAIN handling in the network drivers. >>>> >>>> I will try to push this branch sooner then since it affects more >>>> than just >>>> TLS.  Part of the change includes a new flag we can use to assert >>>> that we >>> Thanks John! >>>> aren't just getting a stale rcvif (though there are also now >>>> assertions in >>>> ip_output that should catch this case I think). >>>> >>> >>> >>> >>> Hi Andrey, >>> >>> Yes, we were able to reproduce this issue in house. If you don't mind, I >>> prefer to wait for John's update - where he eliminates the EAGAIN >>> handling in the network drivers. >> >> I have rebased the branch for this, but for now it will just panic sooner >> I believe by tripping an assertion.  Can you grab the diff (or just >> the branch) >> from the 'send_tags' branch at github/bsdjhb/freebsd and reproduce >> under a >> kernel with INVARIANTS?  I think we will have to explicitly clear the >> 'rcvif' >> pointer somewhere, but I want to see what the stack trace looks like >> so I can >> think about the "right" place to clear it. >> > > Hi John, > > I grabbed your branch (which doesn't build BTW due to libbe(3): Fix > mis-application of patch (SHLIBDIR) so I just reverted it). > > The kernel doesn't panic in this scenario - it just that the packets are > being dropped. So I added a kdb_backtrace right before the return > (EAGAIN) in mlx5e_xmit: > > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > 0xfffffe0000547d90 > mlx5e_xmit() at mlx5e_xmit+0x3d/frame 0xfffffe0000548160 > vlan_transmit() at vlan_transmit+0xdc/frame 0xfffffe00005481d0 > ether_output_frame() at ether_output_frame+0xa2/frame 0xfffffe0000548200 > ether_output() at ether_output+0x689/frame 0xfffffe00005482a0 > ip_output() at ip_output+0x13a4/frame 0xfffffe00005483f0 > ip_forward() at ip_forward+0x344/frame 0xfffffe00005484b0 > ip_input() at ip_input+0x7f5/frame 0xfffffe0000548560 > netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005485d0 > ether_demux() at ether_demux+0x147/frame 0xfffffe0000548600 > ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe0000548660 > netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005486d0 > ether_input() at ether_input+0x73/frame 0xfffffe0000548700 > vlan_input() at vlan_input+0x1e7/frame 0xfffffe0000548750 > ether_demux() at ether_demux+0x12d/frame 0xfffffe0000548780 > ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe00005487e0 > netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe0000548850 > ether_input() at ether_input+0x73/frame 0xfffffe0000548880 > mlx5e_rx_cq_comp() at mlx5e_rx_cq_comp+0x8b4/frame 0xfffffe00005489a0 > mlx5_cq_completion() at mlx5_cq_completion+0x5e/frame 0xfffffe00005489d0 > mlx5_msix_handler() at mlx5_msix_handler+0x1ba/frame 0xfffffe0000548a10 > ithread_loop() at ithread_loop+0x187/frame 0xfffffe0000548a70 > fork_exit() at fork_exit+0x84/frame 0xfffffe0000548ab0 > fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0000548ab0 > --- trap 0, rip = 0, rsp = 0, rbp = 0 --- > > > Please ping me if you want me to try anything else. > > > Slava My bad - tested with master. Re-testing now. Slava From owner-svn-src-all@freebsd.org Wed May 1 08:40:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BD7F1580D18; Wed, 1 May 2019 08:40:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 164676B9DF; Wed, 1 May 2019 08:40:40 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [176.74.212.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 34A052601EC; Wed, 1 May 2019 10:40:37 +0200 (CEST) Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en To: slavash@FreeBSD.org, John Baldwin , "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051425.wB5EP38T004562@repo.freebsd.org> <7cea5305-4136-a0b6-487b-51307b1c6db9@FreeBSD.org> <123654bf-59f7-1db8-55ce-36306bdac43d@FreeBSD.org> <67b638e0-8e6f-f960-b263-62eed8ce28b7@FreeBSD.org> <0e80cb1d-20b9-5b8c-330e-5f64a603ff10@FreeBSD.org> <737bfa62-eb3e-7c48-6356-0e0b76bb0593@FreeBSD.org> <76a05c08-b851-c50a-16fa-ac42c872413c@FreeBSD.org> From: Hans Petter Selasky Message-ID: <83cdfc8f-7223-590c-0e6e-6cd55fe9b355@selasky.org> Date: Wed, 1 May 2019 10:40:09 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <76a05c08-b851-c50a-16fa-ac42c872413c@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 164676B9DF X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-5.67 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: mail.turbocat.net]; NEURAL_HAM_SHORT(-0.84)[-0.836,0]; IP_SCORE(-2.53)[ip: (-8.90), ipnet: 2a01:4f8::/29(-2.05), asn: 24940(-1.68), country: DE(-0.01)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 08:40:42 -0000 Hi, Try this first: https://reviews.freebsd.org/D20117 --HPS From owner-svn-src-all@freebsd.org Wed May 1 09:05:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0245A1585511; Wed, 1 May 2019 09:05:50 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 944FA6CE27; Wed, 1 May 2019 09:05:49 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 677671F257; Wed, 1 May 2019 09:05:49 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4195npX072168; Wed, 1 May 2019 09:05:49 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4195nbh072167; Wed, 1 May 2019 09:05:49 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905010905.x4195nbh072167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 1 May 2019 09:05:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346988 - stable/12/contrib/bsnmp/lib X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/contrib/bsnmp/lib X-SVN-Commit-Revision: 346988 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 944FA6CE27 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 09:05:50 -0000 Author: ae Date: Wed May 1 09:05:48 2019 New Revision: 346988 URL: https://svnweb.freebsd.org/changeset/base/346988 Log: MFC r345843: Follow the declared behaviour that specifies server string format in bsnmpclient(3). snmp_parse_server() function accepts string where some fields can be omitted: [trans::][community@][server][:port] "trans" field can be "udp", "udp6", "dgram" and "stream". "community" can be empty string, if it is omitted, the default value will be used. For read_community it is "public", for write_comminity it is "private". "server" field can be hostname, IPv4 address or IPv6 address. IPv6 address should be specified in brackets "[]". If port is omitted, the default value "snmp" will be used for "udp" and "udp6" transports. So, now for bsnmpget(1) and bsnmwalk(1) it is not required to specify all fields in argument of '-s' option. E.g. # bsnmpget -s 127.1 sysName.0 # bsnmpget -s "udp::127.1" sysName.0 # bsnmpget -s "udp::public@127.1" sysName.0 # bsnmpget -s "udp::public@127.1:161" sysName.0 # bsnmpget -s "udp::[::1]" sysName.0 # bsnmpget -s "udp6::[::1]" sysName.0 # bsnmpget -s "[fe80::1%lo0]" sysName.0 PR: 236664 Reported by: olivier Modified: stable/12/contrib/bsnmp/lib/snmpclient.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- stable/12/contrib/bsnmp/lib/snmpclient.c Wed May 1 09:04:14 2019 (r346987) +++ stable/12/contrib/bsnmp/lib/snmpclient.c Wed May 1 09:05:48 2019 (r346988) @@ -1874,38 +1874,47 @@ snmp_client_set_port(struct snmp_client *cl, const cha return (0); } +static const char *const trans_list[] = { + [SNMP_TRANS_UDP] = "udp::", + [SNMP_TRANS_LOC_DGRAM] = "dgram::", + [SNMP_TRANS_LOC_STREAM] = "stream::", + [SNMP_TRANS_UDP6] = "udp6::", +}; + /** * Try to get a transport identifier which is a leading alphanumeric string - * (starting with '_' or a letter and including also '_') terminated by - * a double colon. The string may not be empty. The transport identifier - * is optional. + * terminated by a double colon. The string may not be empty. The transport + * identifier is optional. * * \param sc client struct to set errors * \param strp possible start of transport; updated to point to * the next character to parse * - * \return end of transport; equals *strp if there is none; NULL if there - * was an error + * \return transport identifier */ -static inline const char * +static inline int get_transp(struct snmp_client *sc, const char **strp) { - const char *p = *strp; + const char *p; + size_t i; - if (isascii(*p) && (isalpha(*p) || *p == '_')) { - p++; - while (isascii(*p) && (isalnum(*p) || *p == '_')) - p++; - if (p[0] == ':' && p[1] == ':') { - *strp = p + 2; - return (p); + for (i = 0; i < nitems(trans_list); i++) { + if (trans_list[i] == NULL || *trans_list[i] == '\0') + continue; + p = strstr(*strp, trans_list[i]); + if (p == *strp) { + *strp += strlen(trans_list[i]); + return ((int)i); } } + + p = *strp; if (p[0] == ':' && p[1] == ':') { seterr(sc, "empty transport specifier"); - return (NULL); + return (-1); } - return (*strp); + /* by default assume UDP */ + return (SNMP_TRANS_UDP); } /** @@ -2143,24 +2152,13 @@ save_str(struct snmp_client *sc, const char *const s[2 int snmp_parse_server(struct snmp_client *sc, const char *str) { -#if DEBUG_PARSE const char *const orig = str; -#endif - - const char *const trans_list[] = { - [SNMP_TRANS_UDP] = "udp", - [SNMP_TRANS_LOC_DGRAM] = "dgram", - [SNMP_TRANS_LOC_STREAM] = "stream", - [SNMP_TRANS_UDP6] = "udp6", - }; - /* parse input */ - const char *const transp[2] = { - str, - get_transp(sc, &str), - }; - if (transp[1] == NULL) + int i, trans = get_transp(sc, &str); + if (trans < 0) return (-1); + /* choose automatically */ + i = orig == str ? -1: trans; const char *const comm[2] = { str, @@ -2206,7 +2204,7 @@ snmp_parse_server(struct snmp_client *sc, const char * } #if DEBUG_PARSE - printf("transp: %zu %zu\n", transp[0] - orig, transp[1] - orig); + printf("transp: %u\n", trans); printf("comm: %zu %zu\n", comm[0] - orig, comm[1] - orig); printf("ipv6: %zu %zu\n", ipv6[0] - orig, ipv6[1] - orig); printf("ipv4: %zu %zu\n", ipv4[0] - orig, ipv4[1] - orig); @@ -2215,69 +2213,73 @@ snmp_parse_server(struct snmp_client *sc, const char * #endif /* analyse and allocate */ - int i = -1; - if (transp[0] != transp[1]) { - for (i = 0; i < (int)nitems(trans_list); i++) { - if (trans_list[i] != NULL && - strlen(trans_list[i]) == (size_t)(transp[1] - - transp[0]) && !strncmp(trans_list[i], transp[0], - transp[1] - transp[0])) - break; - } - - if (i == (int)nitems(trans_list)) { - seterr(sc, "unknown transport specifier '%.*s'", - transp[1] - transp[0], transp[0]); - return (-1); - } - } - char *chost; if (ipv6[0] != ipv6[1]) { if ((chost = save_str(sc, ipv6)) == NULL) return (-1); - if (i == -1) - i = SNMP_TRANS_UDP6; + if (i == -1 || trans == SNMP_TRANS_UDP) + trans = SNMP_TRANS_UDP6; } else if (ipv4[0] != ipv4[1]) { if ((chost = save_str(sc, ipv4)) == NULL) return (-1); if (i == -1) - i = SNMP_TRANS_UDP; + trans = SNMP_TRANS_UDP; } else { if ((chost = save_str(sc, host)) == NULL) return (-1); if (i == -1) { - /* Default transport is UDP unless the host contains - * a slash in which case we default to DGRAM. */ - i = SNMP_TRANS_UDP; + /* + * Default transport is UDP unless the host contains + * a slash in which case we default to DGRAM. + */ for (const char *p = host[0]; p < host[1]; p++) if (*p == '/') { - i = SNMP_TRANS_LOC_DGRAM; + trans = SNMP_TRANS_LOC_DGRAM; break; } } } - char *cport = save_str(sc, port); + char *cport; + + if (port[0] == port[1] && ( + trans == SNMP_TRANS_UDP || trans == SNMP_TRANS_UDP6)) { + /* If port was not specified, use "snmp" name by default */ + cport = strdup("snmp"); + } else + cport = save_str(sc, port); + if (cport == NULL) { free(chost); return (-1); } /* commit */ - sc->trans = i; + sc->trans = trans; + /* + * If community string was specified and it is empty, overwrite it. + * If it was not specified, use default. + */ + if (comm[0] != comm[1] || strrchr(comm[0], '@') != NULL) { + strncpy(sc->read_community, comm[0], comm[1] - comm[0]); + sc->read_community[comm[1] - comm[0]] = '\0'; + strncpy(sc->write_community, comm[0], comm[1] - comm[0]); + sc->write_community[comm[1] - comm[0]] = '\0'; + } - strncpy(sc->read_community, comm[0], comm[1] - comm[0]); - sc->read_community[comm[1] - comm[0]] = '\0'; - strncpy(sc->write_community, comm[0], comm[1] - comm[0]); - sc->write_community[comm[1] - comm[0]] = '\0'; - free(sc->chost); sc->chost = chost; free(sc->cport); sc->cport = cport; +#if DEBUG_PARSE + printf("Committed values:\n"); + printf("trans: %u\n", sc->trans); + printf("comm: '%s'/'%s'\n", sc->read_community, sc->write_community); + printf("host: '%s'\n", sc->chost); + printf("port: '%s'\n", sc->cport); +#endif return (0); } From owner-svn-src-all@freebsd.org Wed May 1 09:04:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FBD7158525E; Wed, 1 May 2019 09:04:15 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A0906CD0C; Wed, 1 May 2019 09:04:15 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 078561F252; Wed, 1 May 2019 09:04:15 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4194FWr072045; Wed, 1 May 2019 09:04:15 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4194EJH072042; Wed, 1 May 2019 09:04:14 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905010904.x4194EJH072042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 1 May 2019 09:04:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346987 - in stable/12: contrib/bsnmp/gensnmptree contrib/bsnmp/lib contrib/bsnmp/snmpd lib/libbsnmp/libbsnmp usr.sbin/bsnmpd/bsnmpd X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/12: contrib/bsnmp/gensnmptree contrib/bsnmp/lib contrib/bsnmp/snmpd lib/libbsnmp/libbsnmp usr.sbin/bsnmpd/bsnmpd X-SVN-Commit-Revision: 346987 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A0906CD0C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 09:04:15 -0000 Author: ae Date: Wed May 1 09:04:14 2019 New Revision: 346987 URL: https://svnweb.freebsd.org/changeset/base/346987 Log: MFC r345797: Add IPv6 transport for bsnmp. This patch adds a new table begemotSnmpdTransInetTable that uses the InetAddressType textual convention and can be used to create listening ports for IPv4, IPv6, zoned IPv6 and based on DNS names. It also supports future extension beyond UDP by adding a protocol identifier to the table index. In order to support this gensnmptree had to be modified. Submitted by: harti Relnotes: yes Differential Revision: https://reviews.freebsd.org/D16654 Added: stable/12/contrib/bsnmp/snmpd/trans_inet.c - copied unchanged from r345797, head/contrib/bsnmp/snmpd/trans_inet.c stable/12/contrib/bsnmp/snmpd/trans_inet.h - copied unchanged from r345797, head/contrib/bsnmp/snmpd/trans_inet.h Modified: stable/12/contrib/bsnmp/gensnmptree/gensnmptree.1 stable/12/contrib/bsnmp/gensnmptree/gensnmptree.c stable/12/contrib/bsnmp/lib/snmpclient.c stable/12/contrib/bsnmp/lib/snmpclient.h stable/12/contrib/bsnmp/lib/tc.def stable/12/contrib/bsnmp/snmpd/BEGEMOT-SNMPD.txt stable/12/contrib/bsnmp/snmpd/main.c stable/12/contrib/bsnmp/snmpd/snmpd.config stable/12/contrib/bsnmp/snmpd/snmpd.h stable/12/contrib/bsnmp/snmpd/snmpmod.h stable/12/contrib/bsnmp/snmpd/trans_lsock.c stable/12/contrib/bsnmp/snmpd/trans_udp.c stable/12/contrib/bsnmp/snmpd/tree.def stable/12/lib/libbsnmp/libbsnmp/Makefile stable/12/usr.sbin/bsnmpd/bsnmpd/Makefile stable/12/usr.sbin/bsnmpd/bsnmpd/snmpd.config Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/bsnmp/gensnmptree/gensnmptree.1 ============================================================================== --- stable/12/contrib/bsnmp/gensnmptree/gensnmptree.1 Wed May 1 07:00:56 2019 (r346986) +++ stable/12/contrib/bsnmp/gensnmptree/gensnmptree.1 Wed May 1 09:04:14 2019 (r346987) @@ -31,7 +31,7 @@ .\" .\" $Begemot: gensnmptree.1 383 2006-05-30 07:40:49Z brandt_h $ .\" -.Dd June 29, 2018 +.Dd April 2, 2019 .Dt GENSNMPTREE 1 .Os .Sh NAME @@ -100,25 +100,11 @@ is the length of the OID. is the last component of the OID. .El .It Fl F -Together with -.Fl E -causes -.Nm -instead of the generation of enum definitions the generation of -functions for checking a value to be one of the enumeration variants and -for conversion between strings and the enum. The file is sent to standard -output and is meant to be included into a C-file for compilation. +emit definitions for C-functions includeable in a C-file that do some basic +stuff on enums like value checking and conversion between value and strings. .It Fl f -This flag can be used together with -.Fl E -or when generating the tree files. It causes -.Nm -to emit static inline functions for checking a value to be one of the -enumeration values and for conversion between strings and the enum. -If used when generating the tree files, the preprocessor symbol -.Ar SNMPTREE_TYPES -must be defined when including the tree header file for these definitions -to become visible. +emit definitions for inline C-functions that do some basic +stuff on enums like value checking and conversion between value and strings. .It Fl h Print a short help page. .It Fl I Ar directory @@ -136,36 +122,6 @@ Instead of normal output print the resulting tree. Prefix the file names and the table name with .Ar prefix . .El -.Pp -The following functions are generated by -.Fl f -or -.Fl F : -.Pp -.Ft static inline int -.Fn isok_EnumName "enum EnumName" ; -.Pp -.Ft static inline const char * -.Fn tostr_EnumName "enum EnumName" ; -.Pp -.Ft static inline int -.Fn fromstr_EnumName "const char *" "enum EnumName *" ; -.Pp -The -.Fa EnumName -is replaced with the enumeration name. -.Fn isok_EnumName -returns 1 if the argument is one of the valid enum values and 0 otherwise. -.Fn tostr_EnumName -returns a string representation of the enumeration value. -If the values is not one of the legal values -.Ar EnumName??? -is returned. -.Fn fromstr_EnumName -returns 1 if the string represents one of the legal enumeration values and -0 otherwise. -If 1 is return the variable pointed to by the second argument is set to -the enumeration value. .Sh MIBS The syntax of the MIB description file can formally be specified as follows: .Bd -unfilled -offset indent Modified: stable/12/contrib/bsnmp/gensnmptree/gensnmptree.c ============================================================================== --- stable/12/contrib/bsnmp/gensnmptree/gensnmptree.c Wed May 1 07:00:56 2019 (r346986) +++ stable/12/contrib/bsnmp/gensnmptree/gensnmptree.c Wed May 1 09:04:14 2019 (r346987) @@ -110,7 +110,6 @@ static int debug; static const char usgtxt[] = "\ Generate SNMP tables.\n\ -$Id$\n\ usage: gensnmptree [-dEeFfhlt] [-I directory] [-i infile] [-p prefix]\n\ [name]...\n\ options:\n\ @@ -127,6 +126,37 @@ options:\n\ -t generate a .def file\n\ "; +/** + * Program operation. + */ +enum op { + /** generate the tree */ + OP_GEN, + + /** extract OIDs */ + OP_EXTRACT, + + /** print the parsed tree */ + OP_TREE, + + /** extract enums */ + OP_ENUMS, +}; + +/** + * Which functions to create. + */ +enum gen_funcs { + /** none */ + GEN_FUNCS_NONE, + + /** functions for header files */ + GEN_FUNCS_H, + + /** functions for C files */ + GEN_FUNCS_C, +}; + /* * A node in the OID tree */ @@ -162,15 +192,18 @@ struct node { uint32_t index; /* index for table entry */ char *func; /* function for tables */ struct node_list subs; + char *subtypes[SNMP_INDEXES_MAX]; } entry; struct leaf { enum snmp_syntax syntax; /* syntax for this leaf */ char *func; /* function name */ + char *subtype; /* subtype */ } leaf; struct column { enum snmp_syntax syntax; /* syntax for this column */ + char *subtype; /* subtype */ } column; } u; }; @@ -214,7 +247,7 @@ xalloc(size_t size) { void *ptr; - if ((ptr = malloc(size)) == NULL) + if ((ptr = calloc(1, size)) == NULL) err(1, "allocing %zu bytes", size); return (ptr); @@ -710,12 +743,14 @@ make_type(const char *s) * token. */ static u_int -parse_type(enum tok *tok, struct type *t, const char *vname) +parse_type(enum tok *tok, struct type *t, const char *vname, char **subtype) { u_int syntax; struct enums *e; syntax = val; + if (subtype != NULL) + *subtype = NULL; if (*tok == TOK_ENUM || *tok == TOK_BITS) { if (t == NULL && vname != NULL) { @@ -759,6 +794,8 @@ parse_type(enum tok *tok, struct type *t, const char * if ((*tok = gettoken()) == '|') { if (gettoken() != TOK_STR) report("subtype expected after '|'"); + if (subtype != NULL) + *subtype = savetok(); *tok = gettoken(); } } @@ -794,18 +831,21 @@ parse(enum tok tok) if ((tok = gettoken()) == TOK_TYPE || tok == TOK_DEFTYPE || tok == TOK_ENUM || tok == TOK_BITS) { /* LEAF or COLUM */ - u_int syntax = parse_type(&tok, NULL, node->name); + char *subtype; + u_int syntax = parse_type(&tok, NULL, node->name, &subtype); if (tok == TOK_STR) { /* LEAF */ node->type = NODE_LEAF; node->u.leaf.func = savetok(); node->u.leaf.syntax = syntax; + node->u.leaf.subtype = subtype; tok = gettoken(); } else { /* COLUMN */ node->type = NODE_COLUMN; node->u.column.syntax = syntax; + node->u.column.subtype = subtype; } while (tok != ')') { @@ -825,9 +865,12 @@ parse(enum tok tok) tok = gettoken(); while (tok == TOK_TYPE || tok == TOK_DEFTYPE || tok == TOK_ENUM || tok == TOK_BITS) { - u_int syntax = parse_type(&tok, NULL, node->name); - if (index_count++ == SNMP_INDEXES_MAX) + char *subtype; + u_int syntax = parse_type(&tok, NULL, node->name, + &subtype); + if (index_count == SNMP_INDEXES_MAX) report("too many table indexes"); + node->u.entry.subtypes[index_count++] = subtype; node->u.entry.index |= syntax << (SNMP_INDEX_SHIFT * index_count); } @@ -882,7 +925,8 @@ parse_top(enum tok tok) tok = gettoken(); t->is_enum = (tok == TOK_ENUM); t->is_bits = (tok == TOK_BITS); - t->syntax = parse_type(&tok, t, NULL); + + t->syntax = parse_type(&tok, t, NULL, NULL); pushback(tok); return (NULL); @@ -903,7 +947,7 @@ parse_top(enum tok tok) * Generate the C-code table part for one node. */ static void -gen_node(FILE *fp, struct node *np, struct asn_oid *oid, u_int idx, +gen_node(FILE *fp, const struct node *np, struct asn_oid *oid, u_int idx, const char *func) { u_int n; @@ -1008,7 +1052,7 @@ gen_node(FILE *fp, struct node *np, struct asn_oid *oi * Generate the header file with the function declarations. */ static void -gen_header(FILE *fp, struct node *np, u_int oidlen, const char *func) +gen_header(FILE *fp, const struct node *np, u_int oidlen, const char *func) { char f[MAXSTR + 4]; struct node *sub; @@ -1058,7 +1102,7 @@ gen_header(FILE *fp, struct node *np, u_int oidlen, co * Generate the OID table. */ static void -gen_table(FILE *fp, struct node *node) +gen_table(FILE *fp, const struct node *node) { struct asn_oid oid; @@ -1067,7 +1111,6 @@ gen_table(FILE *fp, struct node *node) #ifdef HAVE_STDINT_H fprintf(fp, "#include \n"); #endif - fprintf(fp, "#include \n"); if (localincs) { fprintf(fp, "#include \"asn1.h\"\n"); fprintf(fp, "#include \"snmp.h\"\n"); @@ -1118,6 +1161,8 @@ gen_tree(const struct node *np, int level) case NODE_LEAF: print_syntax(np->u.leaf.syntax); + if (np->u.leaf.subtype != NULL) + printf(" | %s", np->u.leaf.subtype); printf(" %s%s%s)\n", np->u.leaf.func, (np->flags & FL_GET) ? " GET" : "", (np->flags & FL_SET) ? " SET" : ""); @@ -1137,8 +1182,11 @@ gen_tree(const struct node *np, int level) case NODE_ENTRY: printf(" :"); - for (i = 0; i < SNMP_INDEX_COUNT(np->u.entry.index); i++) + for (i = 0; i < SNMP_INDEX_COUNT(np->u.entry.index); i++) { print_syntax(SNMP_INDEX(np->u.entry.index, i)); + if (np->u.entry.subtypes[i] != NULL) + printf(" | %s", np->u.entry.subtypes[i]); + } printf(" %s\n", np->u.entry.func); TAILQ_FOREACH(sp, &np->u.entry.subs, link) gen_tree(sp, level + 1); @@ -1147,6 +1195,8 @@ gen_tree(const struct node *np, int level) case NODE_COLUMN: print_syntax(np->u.column.syntax); + if (np->u.column.subtype != NULL) + printf(" | %s", np->u.column.subtype); printf("%s%s)\n", (np->flags & FL_GET) ? " GET" : "", (np->flags & FL_SET) ? " SET" : ""); break; @@ -1194,15 +1244,6 @@ extract(FILE *fp, const struct node *np, struct asn_oi return (1); } -/** - * Extract the named OID. - * - * \param fp file to extract to - * \param root root of the tree - * \param object name of the object to extract - * - * \return 0 on success, -1 if the object was not found - */ static int gen_extract(FILE *fp, const struct node *root, char *object) { @@ -1391,45 +1432,6 @@ unminus(FILE *fp, const char *s) } /** - * Generate a definition for the enum packed into a guard against multiple - * definitions. - * - * \param fp file to write definition to - * \param t type - */ -static void -gen_enum(FILE *fp, const struct type *t) -{ - const struct enums *e; - long min = LONG_MAX; - - fprintf(fp, "\n"); - fprintf(fp, "#ifndef %s_defined__\n", t->name); - fprintf(fp, "#define %s_defined__\n", t->name); - fprintf(fp, "/*\n"); - fprintf(fp, " * From %s:%u\n", t->from_fname, t->from_lno); - fprintf(fp, " */\n"); - fprintf(fp, "enum %s {\n", t->name); - TAILQ_FOREACH(e, &t->enums, link) { - fprintf(fp, "\t%s_", t->name); - unminus(fp, e->name); - fprintf(fp, " = %ld,\n", e->value); - if (e->value < min) - min = e->value; - } - fprintf(fp, "};\n"); - fprintf(fp, "#define STROFF_%s %ld\n", t->name, min); - fprintf(fp, "#define STRING_%s \\\n", t->name); - TAILQ_FOREACH(e, &t->enums, link) { - fprintf(fp, "\t[%ld] = \"%s_", e->value - min, t->name); - unminus(fp, e->name); - fprintf(fp, "\",\\\n"); - } - fprintf(fp, "\n"); - fprintf(fp, "#endif /* %s_defined__ */\n", t->name); -} - -/** * Generate helper functions for an enum. * * We always generate a switch statement for the isok function. The compiler @@ -1494,6 +1496,54 @@ gen_enum_funcs(FILE *fp, const struct type *t, int cco } /** + * Generate a definition for the enum packed into a guard against multiple + * definitions. + * + * \param fp file to write definition to + * \param t type + * \param dof generate functions too + */ +static void +gen_enum(FILE *fp, const struct type *t, int dof) +{ + const struct enums *e; + long min = LONG_MAX; + + fprintf(fp, "\n"); + fprintf(fp, "#ifndef %s_defined__\n", t->name); + fprintf(fp, "#define %s_defined__\n", t->name); + fprintf(fp, "/*\n"); + fprintf(fp, " * From %s:%u\n", t->from_fname, t->from_lno); + fprintf(fp, " */\n"); + fprintf(fp, "enum %s {\n", t->name); + TAILQ_FOREACH(e, &t->enums, link) { + fprintf(fp, "\t%s_", t->name); + unminus(fp, e->name); + fprintf(fp, " = %ld,\n", e->value); + if (e->value < min) + min = e->value; + } + fprintf(fp, "};\n"); + fprintf(fp, "#define STROFF_%s %ld\n", t->name, min); + fprintf(fp, "#define STRING_%s \\\n", t->name); + TAILQ_FOREACH(e, &t->enums, link) { + fprintf(fp, "\t[%ld] = \"%s_", e->value - min, t->name); + unminus(fp, e->name); + fprintf(fp, "\",\\\n"); + } + fprintf(fp, "\n"); + if (dof) { + fprintf(fp, "#ifdef SNMPENUM_FUNCS\n"); + fprintf(fp, "\n"); + gen_enum_funcs(fp, t, 0); + fprintf(fp, "\n"); + fprintf(fp, "#endif\n"); + fprintf(fp, "\n"); + } + fprintf(fp, "#endif /* %s_defined__ */\n", t->name); +} + +/** * Generate helper functions for an enum. This generates code for a c file. * * \param fp file to write to @@ -1529,6 +1579,16 @@ gen_all_enum_funcs(FILE *fp, int ccode) gen_enum_funcs(fp, t, ccode); } +static void +gen_enums(FILE *fp, int dof) +{ + const struct type *t; + + LIST_FOREACH(t, &types, link) + if (t->is_enum || t->is_bits) + gen_enum(fp, t, dof); +} + /** * Extract a given enum to the specified file and optionally generate static * inline helper functions for them. @@ -1546,9 +1606,7 @@ extract_enum(FILE *fp, const char *name, int gen_funcs LIST_FOREACH(t, &types, link) if ((t->is_enum || t->is_bits) && strcmp(t->name, name) == 0) { - gen_enum(fp, t); - if (gen_funcs) - gen_enum_funcs(fp, t, 0); + gen_enum(fp, t, gen_funcs); return (0); } return (-1); @@ -1567,11 +1625,8 @@ extract_all_enums(FILE *fp, int gen_funcs) const struct type *t; LIST_FOREACH(t, &types, link) - if (t->is_enum || t->is_bits) { - gen_enum(fp, t); - if (gen_funcs) - gen_enum_funcs(fp, t, 0); - } + if (t->is_enum || t->is_bits) + gen_enum(fp, t, gen_funcs); } /** @@ -1579,13 +1634,12 @@ extract_all_enums(FILE *fp, int gen_funcs) * * \param argc number of arguments * \param argv arguments (enum names) - * \param gen_funcs_h generate functions into the header file - * \param gen_funcs_c generate a .c file with functions + * \param gen_funcs which functions to generate */ static void -make_enums(int argc, char *argv[], int gen_funcs_h, int gen_funcs_c) +make_enums(int argc, char *argv[], enum gen_funcs gen_funcs) { - if (gen_funcs_c) { + if (gen_funcs == GEN_FUNCS_C) { if (argc == 0) gen_all_enum_funcs(stdout, 1); else { @@ -1595,30 +1649,58 @@ make_enums(int argc, char *argv[], int gen_funcs_h, in } } else { if (argc == 0) - extract_all_enums(stdout, gen_funcs_h); + extract_all_enums(stdout, gen_funcs == GEN_FUNCS_H); else { for (int i = 0; i < argc; i++) - if (extract_enum(stdout, argv[i], gen_funcs_h)) + if (extract_enum(stdout, argv[i], + gen_funcs == GEN_FUNCS_H)) errx(1, "enum not found: %s", argv[i]); } } } +/** + * Produce the operation tables for the daemon or a module. + * + * \param root tree root + * \param gen_funcs generate enum funcs + */ +static void +make_table(const struct node *root, int gen_funcs) +{ + FILE *fp; + + char fname[MAXPATHLEN + 1]; + sprintf(fname, "%stree.h", file_prefix); + if ((fp = fopen(fname, "w")) == NULL) + err(1, "%s: ", fname); + gen_header(fp, root, PREFIX_LEN, NULL); + + fprintf(fp, "\n#ifdef SNMPTREE_TYPES\n"); + gen_enums(fp, gen_funcs); + fprintf(fp, "\n#endif /* SNMPTREE_TYPES */\n\n"); + + fprintf(fp, "#define %sCTREE_SIZE %u\n", file_prefix, tree_size); + fprintf(fp, "extern const struct snmp_node %sctree[];\n", file_prefix); + + fclose(fp); + + sprintf(fname, "%stree.c", file_prefix); + if ((fp = fopen(fname, "w")) == NULL) + err(1, "%s: ", fname); + gen_table(fp, root); + fclose(fp); +} + int main(int argc, char *argv[]) { - int do_extract = 0; - int do_tree = 0; - int do_enums = 0; - int gen_funcs_h = 0; - int gen_funcs_c = 0; - int opt; - struct node *root; - char fname[MAXPATHLEN + 1]; - int tok; - FILE *fp; + enum op op = OP_GEN; + enum gen_funcs gen_funcs = GEN_FUNCS_NONE; + char *infile = NULL; + int opt; while ((opt = getopt(argc, argv, "dEeFfhI:i:lp:t")) != EOF) switch (opt) { @@ -1627,19 +1709,29 @@ main(int argc, char *argv[]) break; case 'E': - do_enums = 1; + if (op != OP_GEN && op != OP_ENUMS) + errx(1, "-E conflicts with earlier options"); + op = OP_ENUMS; break; case 'e': - do_extract = 1; + if (op != OP_GEN && op != OP_EXTRACT) + errx(1, "-e conflicts with earlier options"); + op = OP_EXTRACT; break; case 'F': - gen_funcs_c = 1; + if (gen_funcs != GEN_FUNCS_NONE && + gen_funcs != GEN_FUNCS_C) + errx(1, "-F conflicts with -f"); + gen_funcs = GEN_FUNCS_C; break; case 'f': - gen_funcs_h = 1; + if (gen_funcs != GEN_FUNCS_NONE && + gen_funcs != GEN_FUNCS_H) + errx(1, "-f conflicts with -F"); + gen_funcs = GEN_FUNCS_H; break; case 'h': @@ -1666,75 +1758,61 @@ main(int argc, char *argv[]) break; case 't': - do_tree = 1; + if (op != OP_GEN && op != OP_TREE) + errx(1, "-t conflicts with earlier options"); + op = OP_TREE; break; } - if (do_extract + do_tree + do_enums > 1) - errx(1, "conflicting options -e/-t/-E"); - if (!do_extract && !do_enums && argc != optind) - errx(1, "no arguments allowed"); - if (do_extract && argc == optind) - errx(1, "no objects specified"); + argc -= optind; + argv += optind; - if ((gen_funcs_h || gen_funcs_c) && (do_extract || do_tree)) - errx(1, "-f and -F not allowed with -e or -t"); - if (gen_funcs_c && !do_enums) - errx(1, "-F requires -E"); - if (gen_funcs_h && gen_funcs_c) - errx(1, "-f and -F are mutually exclusive"); - + /* open input */ if (infile == NULL) { input_new(stdin, NULL, ""); } else { + FILE *fp; if ((fp = fopen(infile, "r")) == NULL) err(1, "%s", infile); input_new(fp, NULL, infile); } - root = parse_top(gettoken()); + /* parse and check input */ + struct node *root = parse_top(gettoken()); + + int tok; while ((tok = gettoken()) != TOK_EOF) merge(&root, parse_top(tok)); if (root) check_tree(root); - if (do_extract) { - while (optind < argc) { - if (gen_extract(stdout, root, argv[optind])) - errx(1, "object not found: %s", argv[optind]); - optind++; - } + /* do what the user has requested */ + switch (op) { + + case OP_EXTRACT: + if (argc == 0) + errx(1, "-e requires arguments"); + + for (int i = 0; i < argc; i++) + if (gen_extract(stdout, root, argv[i])) + errx(1, "object not found: %s", argv[i]); return (0); - } - if (do_enums) { - make_enums(argc - optind, argv + optind, - gen_funcs_h, gen_funcs_c); + + case OP_ENUMS: + make_enums(argc, argv, gen_funcs); return (0); - } - if (do_tree) { + + case OP_TREE: + if (argc != 0) + errx(1, "-t allows no arguments"); gen_tree(root, 0); return (0); - } - sprintf(fname, "%stree.h", file_prefix); - if ((fp = fopen(fname, "w")) == NULL) - err(1, "%s: ", fname); - gen_header(fp, root, PREFIX_LEN, NULL); - fprintf(fp, "\n#ifdef SNMPTREE_TYPES\n"); - extract_all_enums(fp, gen_funcs_h); - fprintf(fp, "\n#endif /* SNMPTREE_TYPES */\n\n"); - - fprintf(fp, "#define %sCTREE_SIZE %u\n", file_prefix, tree_size); - fprintf(fp, "extern const struct snmp_node %sctree[];\n", file_prefix); - - fclose(fp); - - sprintf(fname, "%stree.c", file_prefix); - if ((fp = fopen(fname, "w")) == NULL) - err(1, "%s: ", fname); - gen_table(fp, root); - fclose(fp); - - return (0); + case OP_GEN: + if (argc != 0) + errx(1, "tree generation allows no arguments"); + make_table(root, gen_funcs == GEN_FUNCS_H); + return (0); + } } Modified: stable/12/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- stable/12/contrib/bsnmp/lib/snmpclient.c Wed May 1 07:00:56 2019 (r346986) +++ stable/12/contrib/bsnmp/lib/snmpclient.c Wed May 1 09:04:14 2019 (r346987) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2005 + * Copyright (c) 2004-2005,2018 * Hartmut Brandt. * All rights reserved. * Copyright (c) 2001-2003 @@ -34,11 +34,13 @@ * * Support functions for SNMP clients. */ -#include +#include #include #include #include #include +#include +#include #include #include #include @@ -58,12 +60,16 @@ #include #endif +#include + #include "support.h" #include "asn1.h" #include "snmp.h" #include "snmpclient.h" #include "snmppriv.h" +#define DEBUG_PARSE 0 + /* global context */ struct snmp_client snmp_client; @@ -924,7 +930,8 @@ open_client_udp(const char *host, const char *port) /* open connection */ memset(&hints, 0, sizeof(hints)); hints.ai_flags = AI_CANONNAME; - hints.ai_family = AF_INET; + hints.ai_family = snmp_client.trans == SNMP_TRANS_UDP ? AF_INET: + AF_INET6; hints.ai_socktype = SOCK_DGRAM; hints.ai_protocol = 0; error = getaddrinfo(snmp_client.chost, snmp_client.cport, &hints, &res0); @@ -1068,6 +1075,7 @@ snmp_open(const char *host, const char *port, const ch switch (snmp_client.trans) { case SNMP_TRANS_UDP: + case SNMP_TRANS_UDP6: if (open_client_udp(host, port) != 0) return (-1); break; @@ -1866,99 +1874,410 @@ snmp_client_set_port(struct snmp_client *cl, const cha return (0); } -/* - * parse a server specification +/** + * Try to get a transport identifier which is a leading alphanumeric string + * (starting with '_' or a letter and including also '_') terminated by + * a double colon. The string may not be empty. The transport identifier + * is optional. * - * [trans::][community@][server][:port] + * \param sc client struct to set errors + * \param strp possible start of transport; updated to point to + * the next character to parse + * + * \return end of transport; equals *strp if there is none; NULL if there + * was an error */ -int -snmp_parse_server(struct snmp_client *sc, const char *str) +static inline const char * +get_transp(struct snmp_client *sc, const char **strp) { - const char *p, *s = str; + const char *p = *strp; - /* look for a double colon */ - for (p = s; *p != '\0'; p++) { - if (*p == '\\' && p[1] != '\0') { + if (isascii(*p) && (isalpha(*p) || *p == '_')) { + p++; + while (isascii(*p) && (isalnum(*p) || *p == '_')) p++; - continue; + if (p[0] == ':' && p[1] == ':') { + *strp = p + 2; + return (p); } - if (*p == ':' && p[1] == ':') - break; } - if (*p != '\0') { - if (p > s) { - if (p - s == 3 && strncmp(s, "udp", 3) == 0) - sc->trans = SNMP_TRANS_UDP; - else if (p - s == 6 && strncmp(s, "stream", 6) == 0) - sc->trans = SNMP_TRANS_LOC_STREAM; - else if (p - s == 5 && strncmp(s, "dgram", 5) == 0) - sc->trans = SNMP_TRANS_LOC_DGRAM; - else { - seterr(sc, "unknown SNMP transport '%.*s'", - (int)(p - s), s); - return (-1); - } - } - s = p + 2; + if (p[0] == ':' && p[1] == ':') { + seterr(sc, "empty transport specifier"); + return (NULL); } + return (*strp); +} - /* look for a @ */ - for (p = s; *p != '\0'; p++) { - if (*p == '\\' && p[1] != '\0') { - p++; - continue; - } - if (*p == '@') - break; +/** + * Try to get community string. Eat everything up to the last @ (if there is + * any) but only if it is not longer than SNMP_COMMUNITY_MAXLEN. Empty + * community strings are legal. + * + * \param sc client struct to set errors + * \param strp possible start of community; updated to the point to + * the next character to parse + * + * \return end of community; equals *strp if there is none; NULL if there + * was an error + */ +static inline const char * +get_comm(struct snmp_client *sc, const char **strp) +{ + const char *p = strrchr(*strp, '@'); + + if (p == NULL) + /* no community string */ + return (*strp); + + if (p - *strp > SNMP_COMMUNITY_MAXLEN) { + seterr(sc, "community string too long '%.*s'", + p - *strp, *strp); + return (NULL); } - if (*p != '\0') { - if (p - s > SNMP_COMMUNITY_MAXLEN) { - seterr(sc, "community string too long"); - return (-1); + *strp = p + 1; + return (p); +} + +/** + * Try to get an IPv6 address. This starts with an [ and should end with an ] + * and everything between should be not longer than INET6_ADDRSTRLEN and + * parseable by inet_pton(). + * + * \param sc client struct to set errors + * \param strp possible start of IPv6 address (the '['); updated to point to + * the next character to parse (the one after the closing ']') + * + * \return end of address (equals *strp + 1 if there is none) or NULL + * on errors + */ +static inline const char * +get_ipv6(struct snmp_client *sc, const char **strp) +{ + char str[INET6_ADDRSTRLEN + IF_NAMESIZE]; + struct addrinfo hints, *res; + int error; + + if (**strp != '[') + return (*strp + 1); + + const char *p = *strp + 1; + while (*p != ']' ) { + if (*p == '\0') { + seterr(sc, "unterminated IPv6 address '%.*s'", + p - *strp, *strp); + return (NULL); } - strncpy(sc->read_community, s, p - s); - sc->read_community[p - s] = '\0'; - strncpy(sc->write_community, s, p - s); - sc->write_community[p - s] = '\0'; - s = p + 1; + p++; } - /* look for a colon */ - for (p = s; *p != '\0'; p++) { - if (*p == '\\' && p[1] != '\0') { - p++; - continue; - } - if (*p == ':') - break; + if (p - *strp > INET6_ADDRSTRLEN + IF_NAMESIZE) { + seterr(sc, "IPv6 address too long '%.*s'", p - *strp, *strp); + return (NULL); } - if (*p == ':') { - if (p > s) { - /* host:port */ - free(sc->chost); - if ((sc->chost = malloc(p - s + 1)) == NULL) { - seterr(sc, "%s", strerror(errno)); - return (-1); - } - strncpy(sc->chost, s, p - s); - sc->chost[p - s] = '\0'; + strncpy(str, *strp + 1, p - (*strp + 1)); + str[p - (*strp + 1)] = '\0'; + + memset(&hints, 0, sizeof(hints)); + hints.ai_flags = AI_CANONNAME | AI_NUMERICHOST; + hints.ai_family = AF_INET6; + hints.ai_socktype = SOCK_DGRAM; + hints.ai_protocol = IPPROTO_UDP; + error = getaddrinfo(str, NULL, &hints, &res); + if (error != 0) { + seterr(sc, "%s: %s", str, gai_strerror(error)); + return (NULL); + } + freeaddrinfo(res); + *strp = p + 1; + return (p); +} + +/** + * Try to get an IPv4 address. This starts with a digit and consists of digits + * and dots, is not longer INET_ADDRSTRLEN and must be parseable by + * inet_aton(). + * + * \param sc client struct to set errors + * \param strp possible start of IPv4 address; updated to point to the + * next character to parse + * + * \return end of address (equals *strp if there is none) or NULL + * on errors + */ +static inline const char * +get_ipv4(struct snmp_client *sc, const char **strp) +{ + const char *p = *strp; + + while (isascii(*p) && (isdigit(*p) || *p == '.')) + p++; + + if (p - *strp > INET_ADDRSTRLEN) { + seterr(sc, "IPv4 address too long '%.*s'", p - *strp, *strp); + return (NULL); + } + if (*strp == p) + return *strp; + + char str[INET_ADDRSTRLEN + 1]; + strncpy(str, *strp, p - *strp); + str[p - *strp] = '\0'; + + struct in_addr addr; + if (inet_aton(str, &addr) != 1) { + seterr(sc, "illegal IPv4 address '%s'", str); + return (NULL); + } + + *strp = p; + return (p); +} + +/** + * Try to get a hostname. This includes everything up to but not including + * the last colon (if any). There is no length restriction. + * + * \param sc client struct to set errors + * \param strp possible start of hostname; updated to point to the next + * character to parse (the trailing NUL character or the last + * colon) + * + * \return end of address (equals *strp if there is none) + */ +static inline const char * +get_host(struct snmp_client *sc __unused, const char **strp) +{ + const char *p = strrchr(*strp, ':'); + + if (p == NULL) { + *strp += strlen(*strp); + return (*strp); + } + + *strp = p; + return (p); +} + +/** + * Try to get a port number. This start with a colon and extends to the end + * of string. The port number must not be empty. + * + * \param sc client struct to set errors *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed May 1 13:00:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 574F815967EB; Wed, 1 May 2019 13:00:34 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F02A175161; Wed, 1 May 2019 13:00:33 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C901721986; Wed, 1 May 2019 13:00:33 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41D0X1C091792; Wed, 1 May 2019 13:00:33 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41D0XeF091791; Wed, 1 May 2019 13:00:33 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905011300.x41D0XeF091791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 1 May 2019 13:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346989 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 346989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F02A175161 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 13:00:34 -0000 Author: trasz Date: Wed May 1 13:00:33 2019 New Revision: 346989 URL: https://svnweb.freebsd.org/changeset/base/346989 Log: Remove trailing slashes from URLs; current mandoc(1) seems to render them just fine. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/share/man/man7/development.7 Modified: head/share/man/man7/development.7 ============================================================================== --- head/share/man/man7/development.7 Wed May 1 09:05:48 2019 (r346988) +++ head/share/man/man7/development.7 Wed May 1 13:00:33 2019 (r346989) @@ -93,7 +93,7 @@ For coding conventions, see To ask questions regarding development, use the mailing lists, such as freebsd-arch@ and freebsd-hackers@: .Pp -.Lk https://lists.FreeBSD.org/ +.Lk https://lists.FreeBSD.org .Pp To get your patches integrated into the main .Fx @@ -102,7 +102,7 @@ it is a code review tool that allows other developers suggest improvements, and, eventually, allows them to pick up the change and commit it: .Pp -.Lk https://reviews.FreeBSD.org/ +.Lk https://reviews.FreeBSD.org .Sh EXAMPLES Check out the CURRENT branch, build it, and install, overwriting the current system: From owner-svn-src-all@freebsd.org Wed May 1 13:15:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CE9D1596CA4; Wed, 1 May 2019 13:15:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B4725759B2; Wed, 1 May 2019 13:15:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EC8E21D28; Wed, 1 May 2019 13:15:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41DF757002485; Wed, 1 May 2019 13:15:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41DF7UT002484; Wed, 1 May 2019 13:15:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905011315.x41DF7UT002484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 1 May 2019 13:15:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346990 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 346990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B4725759B2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 13:15:08 -0000 Author: kib Date: Wed May 1 13:15:06 2019 New Revision: 346990 URL: https://svnweb.freebsd.org/changeset/base/346990 Log: Fix another race between vm_map_protect() and vm_map_wire(). vm_map_wire() increments entry->wire_count, after that it drops the map lock both for faulting in the entry' pages, and for marking next entry in the requested region as IN_TRANSITION. Only after all entries are faulted in, MAP_ENTRY_USER_WIRE flag is set. This makes it possible for vm_map_protect() to run while other entry' MAP_ENTRY_IN_TRANSITION flag is handled, and vm_map_busy() lock does not prevent it. In particular, if the call to vm_map_protect() adds VM_PROT_WRITE to CoW entry, it would fail to call vm_fault_copy_entry(). There are at least two consequences of the race: the top object in the shadow chain is not populated with writeable pages, and second, the entry eventually get contradictory flags MAP_ENTRY_NEEDS_COPY | MAP_ENTRY_USER_WIRED with VM_PROT_WRITE set. Handle it by waiting for all MAP_ENTRY_IN_TRANSITION flags to go away in vm_map_protect(), which does not drop map lock afterwards. Note that vm_map_busy_wait() is left as is. Reported and tested by: pho (previous version) Reviewed by: Doug Moore , markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D20091 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed May 1 13:00:33 2019 (r346989) +++ head/sys/vm/vm_map.c Wed May 1 13:15:06 2019 (r346990) @@ -2347,7 +2347,7 @@ int vm_map_protect(vm_map_t map, vm_offset_t start, vm_offset_t end, vm_prot_t new_prot, boolean_t set_max) { - vm_map_entry_t current, entry; + vm_map_entry_t current, entry, in_tran; vm_object_t obj; struct ucred *cred; vm_prot_t old_prot; @@ -2355,6 +2355,8 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_off if (start == end) return (KERN_SUCCESS); +again: + in_tran = NULL; vm_map_lock(map); /* @@ -2387,6 +2389,22 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_off vm_map_unlock(map); return (KERN_PROTECTION_FAILURE); } + if ((entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0) + in_tran = entry; + } + + /* + * Postpone the operation until all in transition map entries + * are stabilized. In-transition entry might already have its + * pages wired and wired_count incremented, but + * MAP_ENTRY_USER_WIRED flag not yet set, and visible to other + * threads because the map lock is dropped. In this case we + * would miss our call to vm_fault_copy_entry(). + */ + if (in_tran != NULL) { + in_tran->eflags |= MAP_ENTRY_NEEDS_WAKEUP; + vm_map_unlock_and_wait(map, 0); + goto again; } /* From owner-svn-src-all@freebsd.org Wed May 1 13:42:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4966B15976D1; Wed, 1 May 2019 13:42:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E17FE766AF; Wed, 1 May 2019 13:42:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA1622223F; Wed, 1 May 2019 13:42:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41DguxB017961; Wed, 1 May 2019 13:42:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41DguhG017960; Wed, 1 May 2019 13:42:56 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905011342.x41DguhG017960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 1 May 2019 13:42:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346991 - stable/12/sys/geom X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/geom X-SVN-Commit-Revision: 346991 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E17FE766AF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 13:42:57 -0000 Author: mav Date: Wed May 1 13:42:56 2019 New Revision: 346991 URL: https://svnweb.freebsd.org/changeset/base/346991 Log: MFC r346644: Call delist_dev() before destroy_dev_sched_cb(). destroy_dev_sched_cb() is excessively asynchronous, and during media change retaste new provider may appear sooner then device of the previous one get destroyed. Sponsored by: iXsystems, Inc. Modified: stable/12/sys/geom/geom_dev.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/geom/geom_dev.c ============================================================================== --- stable/12/sys/geom/geom_dev.c Wed May 1 13:15:06 2019 (r346990) +++ stable/12/sys/geom/geom_dev.c Wed May 1 13:42:56 2019 (r346991) @@ -838,6 +838,7 @@ g_dev_orphan(struct g_consumer *cp) (void)clear_dumper(curthread); /* Destroy the struct cdev *so we get no more requests */ + delist_dev(dev); destroy_dev_sched_cb(dev, g_dev_callback, cp); } From owner-svn-src-all@freebsd.org Wed May 1 13:43:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A88291597743; Wed, 1 May 2019 13:43:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4AE0B767E8; Wed, 1 May 2019 13:43:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23A0822240; Wed, 1 May 2019 13:43:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41Dhof3018059; Wed, 1 May 2019 13:43:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41DhoMU018058; Wed, 1 May 2019 13:43:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905011343.x41DhoMU018058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 1 May 2019 13:43:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346992 - stable/11/sys/geom X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/geom X-SVN-Commit-Revision: 346992 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4AE0B767E8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 13:43:50 -0000 Author: mav Date: Wed May 1 13:43:49 2019 New Revision: 346992 URL: https://svnweb.freebsd.org/changeset/base/346992 Log: MFC r346644: Call delist_dev() before destroy_dev_sched_cb(). destroy_dev_sched_cb() is excessively asynchronous, and during media change retaste new provider may appear sooner then device of the previous one get destroyed. Sponsored by: iXsystems, Inc. Modified: stable/11/sys/geom/geom_dev.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/geom/geom_dev.c ============================================================================== --- stable/11/sys/geom/geom_dev.c Wed May 1 13:42:56 2019 (r346991) +++ stable/11/sys/geom/geom_dev.c Wed May 1 13:43:49 2019 (r346992) @@ -766,6 +766,7 @@ g_dev_orphan(struct g_consumer *cp) (void)set_dumper(NULL, NULL, curthread); /* Destroy the struct cdev *so we get no more requests */ + delist_dev(dev); destroy_dev_sched_cb(dev, g_dev_callback, cp); } From owner-svn-src-all@freebsd.org Wed May 1 14:20:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8BCA1598158; Wed, 1 May 2019 14:20:32 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B8EB77CD8; Wed, 1 May 2019 14:20:32 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10EF022765; Wed, 1 May 2019 14:20:32 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41EKVQ4034437; Wed, 1 May 2019 14:20:31 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41EKVZu034436; Wed, 1 May 2019 14:20:31 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201905011420.x41EKVZu034436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Wed, 1 May 2019 14:20:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346993 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: ganbold X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 346993 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3B8EB77CD8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 14:20:32 -0000 Author: ganbold Date: Wed May 1 14:20:31 2019 New Revision: 346993 URL: https://svnweb.freebsd.org/changeset/base/346993 Log: Add a hw.model sysctl oid for arm64 which reports the CPU model similar to armv6/7. Reviewed by: andrew, manu Differential Revision: https://reviews.freebsd.org/D20123 Modified: head/sys/arm64/arm64/identcpu.c Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Wed May 1 13:43:49 2019 (r346992) +++ head/sys/arm64/arm64/identcpu.c Wed May 1 14:20:31 2019 (r346993) @@ -72,6 +72,10 @@ sysctl_hw_machine(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_hw, HW_MACHINE, machine, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, sysctl_hw_machine, "A", "Machine class"); +static char cpu_model[64]; +SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, + cpu_model, sizeof(cpu_model), "Machine model"); + /* * Per-CPU affinity as provided in MPIDR_EL1 * Indexed by CPU number in logical order selected by the system. @@ -1312,6 +1316,10 @@ identify_cpu(void) cpu_desc[cpu].cpu_revision = CPU_REV(midr); cpu_desc[cpu].cpu_variant = CPU_VAR(midr); + + snprintf(cpu_model, sizeof(cpu_model), "%s %s r%dp%d", + cpu_desc[cpu].cpu_impl_name, cpu_desc[cpu].cpu_part_name, + cpu_desc[cpu].cpu_variant, cpu_desc[cpu].cpu_revision); /* Save affinity for current CPU */ cpu_desc[cpu].mpidr = get_mpidr(); From owner-svn-src-all@freebsd.org Wed May 1 15:03:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FB2F15991F6; Wed, 1 May 2019 15:03:13 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 124F3815AE; Wed, 1 May 2019 15:03:13 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D997222FDE; Wed, 1 May 2019 15:03:12 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41F3Cv5060457; Wed, 1 May 2019 15:03:12 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41F3Cjv060456; Wed, 1 May 2019 15:03:12 GMT (envelope-from br@FreeBSD.org) Message-Id: <201905011503.x41F3Cjv060456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 1 May 2019 15:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346994 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 346994 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 124F3815AE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 15:03:13 -0000 Author: br Date: Wed May 1 15:03:12 2019 New Revision: 346994 URL: https://svnweb.freebsd.org/changeset/base/346994 Log: Deactivate IRQ resource by calling to intr_deactivate_irq(). This is the part of INTRNG support that was missed. Sponsored by: DARPA, AFRL Modified: head/sys/riscv/riscv/nexus.c Modified: head/sys/riscv/riscv/nexus.c ============================================================================== --- head/sys/riscv/riscv/nexus.c Wed May 1 14:20:31 2019 (r346993) +++ head/sys/riscv/riscv/nexus.c Wed May 1 15:03:12 2019 (r346994) @@ -357,13 +357,17 @@ nexus_deactivate_resource(device_t bus, device_t child bus_size_t psize; bus_space_handle_t vaddr; - psize = (bus_size_t)rman_get_size(r); - vaddr = rman_get_bushandle(r); + if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { + psize = (bus_size_t)rman_get_size(r); + vaddr = rman_get_bushandle(r); - if (vaddr != 0) { - bus_space_unmap(&memmap_bus, vaddr, psize); - rman_set_virtual(r, NULL); - rman_set_bushandle(r, 0); + if (vaddr != 0) { + bus_space_unmap(&memmap_bus, vaddr, psize); + rman_set_virtual(r, NULL); + rman_set_bushandle(r, 0); + } + } else if (type == SYS_RES_IRQ) { + intr_deactivate_irq(child, r); } return (rman_deactivate_resource(r)); From owner-svn-src-all@freebsd.org Wed May 1 15:28:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 740621599AFD; Wed, 1 May 2019 15:28:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDD7D8239A; Wed, 1 May 2019 15:28:23 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B454423363; Wed, 1 May 2019 15:28:23 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41FSN6h071283; Wed, 1 May 2019 15:28:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41FSNls071281; Wed, 1 May 2019 15:28:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905011528.x41FSNls071281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 1 May 2019 15:28:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346995 - head/tests/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/tests/sys/vm X-SVN-Commit-Revision: 346995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DDD7D8239A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 15:28:24 -0000 Author: markj Date: Wed May 1 15:28:23 2019 New Revision: 346995 URL: https://svnweb.freebsd.org/changeset/base/346995 Log: Add a few regression tests for mlock(2). These are intended to exercise some rarely executed code paths. MFC after: 2 weeks Added: head/tests/sys/vm/mlock_test.c (contents, props changed) Modified: head/tests/sys/vm/Makefile Modified: head/tests/sys/vm/Makefile ============================================================================== --- head/tests/sys/vm/Makefile Wed May 1 15:03:12 2019 (r346994) +++ head/tests/sys/vm/Makefile Wed May 1 15:28:23 2019 (r346995) @@ -4,6 +4,7 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/vm -ATF_TESTS_C+= mmap_test +ATF_TESTS_C+= mlock_test \ + mmap_test .include Added: head/tests/sys/vm/mlock_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/vm/mlock_test.c Wed May 1 15:28:23 2019 (r346995) @@ -0,0 +1,174 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Mark Johnston + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +static void +test_wired_copy_on_write(void *addr, size_t len) +{ + int status, val; + pid_t pid; + + pid = fork(); + if (pid == -1) + atf_tc_fail("fork() failed: %s", strerror(errno)); + if (pid == 0) { + if (mlock(addr, len) != 0) + _exit(1); + if (ptrace(PT_TRACE_ME, 0, NULL, 0) != 0) + _exit(2); + if (raise(SIGSTOP) != 0) + _exit(3); + if (munlock(addr, len) != 0) + _exit(4); + _exit(0); + } + + ATF_REQUIRE(waitpid(pid, &status, 0) == pid); + ATF_REQUIRE_MSG(!WIFEXITED(status), + "child exited with status %d", WEXITSTATUS(status)); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + errno = 0; + val = ptrace(PT_READ_D, pid, addr, 0); + ATF_REQUIRE(errno == 0); + ATF_REQUIRE(ptrace(PT_WRITE_D, pid, addr, val) == 0); + ATF_REQUIRE(ptrace(PT_CONTINUE, pid, (caddr_t)1, 0) == 0); + ATF_REQUIRE(waitpid(pid, &status, 0) == pid); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE_MSG(WEXITSTATUS(status) == 0, + "child exited with status %d", WSTOPSIG(status)); +} + +/* + * Use ptrace(2) to trigger a copy-on-write fault of anonymous memory. + */ +ATF_TC_WITHOUT_HEAD(mlock__copy_on_write_anon); +ATF_TC_BODY(mlock__copy_on_write_anon, tc) +{ + char *addr; + int len; + + len = getpagesize(); + addr = mmap(NULL, len, PROT_READ, MAP_ANON, -1, 0); + ATF_REQUIRE(addr != MAP_FAILED); + + test_wired_copy_on_write(addr, len); +} + +/* + * Use ptrace(2) to trigger a copy-on-write fault of a read-only text page. + */ +ATF_TC_WITHOUT_HEAD(mlock__copy_on_write_vnode); +ATF_TC_BODY(mlock__copy_on_write_vnode, tc) +{ + void *addr; + int len; + + len = getpagesize(); + addr = (void *)((uintptr_t)test_wired_copy_on_write & ~(len - 1)); + + test_wired_copy_on_write(addr, len); +} + +/* + * Try truncating and then resizing an mlock()ed mapping. + */ +ATF_TC_WITHOUT_HEAD(mlock__truncate_and_resize); +ATF_TC_BODY(mlock__truncate_and_resize, tc) +{ + char filename[16]; + char *addr; + int fd, i, len; + + snprintf(filename, sizeof(filename), "tmp.XXXXXX"); + fd = mkstemp(filename); + ATF_REQUIRE(fd >= 0); + ATF_REQUIRE(unlink(filename) == 0); + + len = getpagesize(); + ATF_REQUIRE(ftruncate(fd, len) == 0); + + addr = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + ATF_REQUIRE(addr != MAP_FAILED); + ATF_REQUIRE(mlock(addr, len) == 0); + memset(addr, 1, len); + ATF_REQUIRE(ftruncate(fd, 0) == 0); + ATF_REQUIRE(ftruncate(fd, len) == 0); + for (i = 0; i < len; i++) + ATF_REQUIRE(addr[i] == 0); + ATF_REQUIRE(munlock(addr, len) == 0); +} + +/* + * Make sure that we can munlock() a truncated mapping. + */ +ATF_TC_WITHOUT_HEAD(mlock__truncate_and_unlock); +ATF_TC_BODY(mlock__truncate_and_unlock, tc) +{ + char filename[16]; + void *addr; + int fd, len; + + snprintf(filename, sizeof(filename), "tmp.XXXXXX"); + fd = mkstemp(filename); + ATF_REQUIRE(fd >= 0); + ATF_REQUIRE(unlink(filename) == 0); + + len = getpagesize(); + ATF_REQUIRE(ftruncate(fd, len) == 0); + + addr = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + ATF_REQUIRE(addr != MAP_FAILED); + ATF_REQUIRE(mlock(addr, len) == 0); + ATF_REQUIRE(ftruncate(fd, 0) == 0); + ATF_REQUIRE(munlock(addr, len) == 0); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, mlock__copy_on_write_anon); + ATF_TP_ADD_TC(tp, mlock__copy_on_write_vnode); + ATF_TP_ADD_TC(tp, mlock__truncate_and_resize); + ATF_TP_ADD_TC(tp, mlock__truncate_and_unlock); + + return (atf_no_error()); +} From owner-svn-src-all@freebsd.org Wed May 1 16:45:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF081159B4FD; Wed, 1 May 2019 16:45:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7045E84BAC; Wed, 1 May 2019 16:45:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 723EA354D; Wed, 1 May 2019 16:45:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en To: slavash@FreeBSD.org, Hans Petter Selasky , "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051425.wB5EP38T004562@repo.freebsd.org> <7cea5305-4136-a0b6-487b-51307b1c6db9@FreeBSD.org> <123654bf-59f7-1db8-55ce-36306bdac43d@FreeBSD.org> <67b638e0-8e6f-f960-b263-62eed8ce28b7@FreeBSD.org> <0e80cb1d-20b9-5b8c-330e-5f64a603ff10@FreeBSD.org> <737bfa62-eb3e-7c48-6356-0e0b76bb0593@FreeBSD.org> <76a05c08-b851-c50a-16fa-ac42c872413c@FreeBSD.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <054b81ee-0bdc-184a-9928-8679b53d52cc@FreeBSD.org> Date: Wed, 1 May 2019 09:45:54 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <76a05c08-b851-c50a-16fa-ac42c872413c@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7045E84BAC X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 16:45:58 -0000 On 5/1/19 1:05 AM, Slava Shwartsman wrote: > > > On 01-May-19 10:28, Slava Shwartsman wrote: >> >> >> On 01-May-19 10:09, Slava Shwartsman wrote: >>> >>> >>> On 30-Apr-19 00:14, John Baldwin wrote: >>>> On 4/25/19 12:10 AM, Slava Shwartsman wrote: >>>>> >>>>> >>>>> On 17-Apr-19 00:28, John Baldwin wrote: >>>>>> On 4/16/19 8:32 AM, Hans Petter Selasky wrote: >>>>>>> On 4/16/19 4:39 PM, Andrey V. Elsukov wrote: >>>>>>>> On 05.12.2018 17:25, Slava Shwartsman wrote: >>>>>>>>> Author: slavash >>>>>>>>> Date: Wed Dec  5 14:25:03 2018 >>>>>>>>> New Revision: 341586 >>>>>>>>> URL: https://svnweb.freebsd.org/changeset/base/341586 >>>>>>>>> >>>>>>>>> Log: >>>>>>>>>      mlx5en: Implement backpressure indication. >>>>>>>>>      The backpressure indication is implemented using an >>>>>>>>> unlimited rate type of >>>>>>>>>      mbuf send tag. When the upper layers typically the socket >>>>>>>>> layer has obtained such >>>>>>>>>      a tag, it can then query the destination driver queue for >>>>>>>>> the current >>>>>>>>>      amount of space available in the send queue. >>>>>>>>>      A single mbuf send tag may be referenced multiple times and >>>>>>>>> a refcount has been added >>>>>>>>>      to the mlx5e_priv structure to track its usage. Because the >>>>>>>>> send tag resides >>>>>>>>>      in the mlx5e_channel structure, there is no need to wait >>>>>>>>> for refcounts to reach >>>>>>>>>      zero until the mlx4en(4) driver is detached. The channels >>>>>>>>> structure is persistant >>>>>>>>>      during the lifetime of the mlx5en(4) driver it belongs to >>>>>>>>> and can so be accessed >>>>>>>>>      without any need of synchronization. >>>>>>>>>      The mlx5e_snd_tag structure was extended to contain a type >>>>>>>>> field, because there are now >>>>>>>>>      two different tag types which end up in the driver which >>>>>>>>> need to be distinguished. >>>>>>>>>      Submitted by:   hselasky@ >>>>>>>>>      Approved by:    hselasky (mentor) >>>>>>>>>      MFC after:      1 week >>>>>>>>>      Sponsored by:   Mellanox Technologies >>>>>>>>> @@ -587,27 +609,33 @@ mlx5e_xmit(struct ifnet *ifp, struct mbuf >>>>>>>>> *mb) >>>>>>>>>         struct mlx5e_sq *sq; >>>>>>>>>         int ret; >>>>>>>>> -    sq = mlx5e_select_queue(ifp, mb); >>>>>>>>> -    if (unlikely(sq == NULL)) { >>>>>>>>> -#ifdef RATELIMIT >>>>>>>>> -        /* Check for route change */ >>>>>>>>> -        if (mb->m_pkthdr.snd_tag != NULL && >>>>>>>>> -            mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>>>>>> +    if (mb->m_pkthdr.snd_tag != NULL) { >>>>>>>>> +        sq = mlx5e_select_queue_by_send_tag(ifp, mb); >>>>>>>>> +        if (unlikely(sq == NULL)) { >>>>>>>>> +            /* Check for route change */ >>>>>>>>> +            if (mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>>>>>> +                /* Free mbuf */ >>>>>>>>> +                m_freem(mb); >>>>>>>>> + >>>>>>>>> +                /* >>>>>>>>> +                 * Tell upper layers about route >>>>>>>>> +                 * change and to re-transmit this >>>>>>>>> +                 * packet: >>>>>>>>> +                 */ >>>>>>>>> +                return (EAGAIN); >>>>>>>>> +            } >>>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> I just discovered something strange and found that this commit is >>>>>>>> the >>>>>>>> cause. >>>>>>>> The test system has mlx5en 100G interface. It has two vlans: >>>>>>>> vlan500 and >>>>>>>> vlan100. >>>>>>>> Via vlan500 it receives some packets flows. Then it routes these >>>>>>>> packets >>>>>>>> into vlan100. >>>>>>>> But packets are dropped in mlx5e_xmit() with EAGAIN error code. >>>>>>>> >>>>>>>> # dtrace -n 'fbt::ip6_output:return {printf("%d", arg1);}' >>>>>>>> dtrace: description 'fbt::ip6_output:return ' matched 1 probe >>>>>>>> CPU     ID                    FUNCTION:NAME >>>>>>>>     23  54338                ip6_output:return 35 >>>>>>>>     16  54338                ip6_output:return 35 >>>>>>>>     21  54338                ip6_output:return 35 >>>>>>>>     22  54338                ip6_output:return 35 >>>>>>>>     24  54338                ip6_output:return 35 >>>>>>>>     23  54338                ip6_output:return 35 >>>>>>>>     14  54338                ip6_output:return 35 >>>>>>>> ^C >>>>>>>> >>>>>>>> # dtrace -n 'fbt::mlx5e_xmit:return {printf("%d", arg1);}' >>>>>>>> dtrace: description 'fbt::mlx5e_xmit:return ' matched 1 probe >>>>>>>> CPU     ID                    FUNCTION:NAME >>>>>>>>     16  69030                mlx5e_xmit:return 35 >>>>>>>>     23  69030                mlx5e_xmit:return 35 >>>>>>>>     26  69030                mlx5e_xmit:return 35 >>>>>>>>     25  69030                mlx5e_xmit:return 35 >>>>>>>>     24  69030                mlx5e_xmit:return 35 >>>>>>>>     21  69030                mlx5e_xmit:return 35 >>>>>>>>     26  69030                mlx5e_xmit:return 35 >>>>>>>> ^C >>>>>>>> >>>>>>>> The kernel config is GENERIC. >>>>>>>> 13.0-CURRENT #9 r345758+82f3d57(svn_head)-dirty >>>>>>>> >>>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> This might be a case where rcvif in the mbuf's pktheader is not >>>>>>> cleared >>>>>>> before the packet is fed back on the wire. >>>>>>> >>>>>>> John Baldwin is working on the send tags implementation, to eliminate >>>>>>> the EAGAIN handling in the network drivers. >>>>>> >>>>>> I will try to push this branch sooner then since it affects more >>>>>> than just >>>>>> TLS.  Part of the change includes a new flag we can use to assert >>>>>> that we >>>>> Thanks John! >>>>>> aren't just getting a stale rcvif (though there are also now >>>>>> assertions in >>>>>> ip_output that should catch this case I think). >>>>>> >>>>> >>>>> >>>>> >>>>> Hi Andrey, >>>>> >>>>> Yes, we were able to reproduce this issue in house. If you don't >>>>> mind, I >>>>> prefer to wait for John's update - where he eliminates the EAGAIN >>>>> handling in the network drivers. >>>> >>>> I have rebased the branch for this, but for now it will just panic >>>> sooner >>>> I believe by tripping an assertion.  Can you grab the diff (or just >>>> the branch) >>>> from the 'send_tags' branch at github/bsdjhb/freebsd and reproduce >>>> under a >>>> kernel with INVARIANTS?  I think we will have to explicitly clear the >>>> 'rcvif' >>>> pointer somewhere, but I want to see what the stack trace looks like >>>> so I can >>>> think about the "right" place to clear it. >>>> >>> >>> Hi John, >>> >>> I grabbed your branch (which doesn't build BTW due to libbe(3): Fix >>> mis-application of patch (SHLIBDIR) so I just reverted it). >>> >>> The kernel doesn't panic in this scenario - it just that the packets >>> are being dropped. So I added a kdb_backtrace right before the return >>> (EAGAIN) in mlx5e_xmit: >>> >>> KDB: stack backtrace: >>> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame >>> 0xfffffe0000547d90 >>> mlx5e_xmit() at mlx5e_xmit+0x3d/frame 0xfffffe0000548160 >>> vlan_transmit() at vlan_transmit+0xdc/frame 0xfffffe00005481d0 >>> ether_output_frame() at ether_output_frame+0xa2/frame 0xfffffe0000548200 >>> ether_output() at ether_output+0x689/frame 0xfffffe00005482a0 >>> ip_output() at ip_output+0x13a4/frame 0xfffffe00005483f0 >>> ip_forward() at ip_forward+0x344/frame 0xfffffe00005484b0 >>> ip_input() at ip_input+0x7f5/frame 0xfffffe0000548560 >>> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame >>> 0xfffffe00005485d0 >>> ether_demux() at ether_demux+0x147/frame 0xfffffe0000548600 >>> ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe0000548660 >>> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame >>> 0xfffffe00005486d0 >>> ether_input() at ether_input+0x73/frame 0xfffffe0000548700 >>> vlan_input() at vlan_input+0x1e7/frame 0xfffffe0000548750 >>> ether_demux() at ether_demux+0x12d/frame 0xfffffe0000548780 >>> ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe00005487e0 >>> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame >>> 0xfffffe0000548850 >>> ether_input() at ether_input+0x73/frame 0xfffffe0000548880 >>> mlx5e_rx_cq_comp() at mlx5e_rx_cq_comp+0x8b4/frame 0xfffffe00005489a0 >>> mlx5_cq_completion() at mlx5_cq_completion+0x5e/frame 0xfffffe00005489d0 >>> mlx5_msix_handler() at mlx5_msix_handler+0x1ba/frame 0xfffffe0000548a10 >>> ithread_loop() at ithread_loop+0x187/frame 0xfffffe0000548a70 >>> fork_exit() at fork_exit+0x84/frame 0xfffffe0000548ab0 >>> fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0000548ab0 >>> --- trap 0, rip = 0, rsp = 0, rbp = 0 --- >>> >>> >>> Please ping me if you want me to try anything else. >>> >>> >>> Slava >> >> My bad - tested with master. Re-testing now. >> >> >> Slava > > Got it now: > > panic: Assertion m->m_pkthdr.snd_tag == NULL failed at > /usr/src/sys/netinet/ip_output.c:213 > cpuid = 0 > time = 1556697834 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > 0xfffffe00005ac1f0 > vpanic() at vpanic+0x19d/frame 0xfffffe00005ac240 > panic() at panic+0x43/frame 0xfffffe00005ac2a0 > ip_output() at ip_output+0x159f/frame 0xfffffe00005ac3f0 > ip_forward() at ip_forward+0x38c/frame 0xfffffe00005ac4b0 > ip_input() at ip_input+0x7f5/frame 0xfffffe00005ac560 > netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005ac5d0 > ether_demux() at ether_demux+0x147/frame 0xfffffe00005ac600 > ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe00005ac660 > netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005ac6d0 > ether_input() at ether_input+0x7d/frame 0xfffffe00005ac700 > vlan_input() at vlan_input+0x1e7/frame 0xfffffe00005ac750 > ether_demux() at ether_demux+0x12d/frame 0xfffffe00005ac780 > ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe00005ac7e0 > netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005ac850 > ether_input() at ether_input+0x7d/frame 0xfffffe00005ac880 > mlx5e_rx_cq_comp() at mlx5e_rx_cq_comp+0x8b4/frame 0xfffffe00005ac9a0 > mlx5_cq_completion() at mlx5_cq_completion+0x5e/frame 0xfffffe00005ac9d0 > mlx5_msix_handler() at mlx5_msix_handler+0x1ba/frame 0xfffffe00005aca10 > ithread_loop() at ithread_loop+0x187/frame 0xfffffe00005aca70 > fork_exit() at fork_exit+0x84/frame 0xfffffe00005acab0 > fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00005acab0 > --- trap 0, rip = 0, rsp = 0, rbp = 0 --- > KDB: enter: panic > [ thread pid 12 tid 100113 ] > Stopped at kdb_enter+0x3b: movq $0,kdb_why > > > I can keep the machine in this state for a while now if you want to take > a look at anything specific. I pushed further changes to this branch (that are now in the review that Hans noted) that I think should fix the panic. You can either pull the branch (I'll try to rebase it today) or from the review. Please let me know if this resolves the panic. Thanks! -- John Baldwin From owner-svn-src-all@freebsd.org Wed May 1 17:12:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF790159BF9A; Wed, 1 May 2019 17:12:50 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 53DA385A36; Wed, 1 May 2019 17:12:50 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D67A247F3; Wed, 1 May 2019 17:12:50 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41HCo7I028426; Wed, 1 May 2019 17:12:50 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41HCoN3028425; Wed, 1 May 2019 17:12:50 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201905011712.x41HCoN3028425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 1 May 2019 17:12:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346996 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 346996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 53DA385A36 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 17:12:50 -0000 Author: andrew Date: Wed May 1 17:12:49 2019 New Revision: 346996 URL: https://svnweb.freebsd.org/changeset/base/346996 Log: Restore x18 in efi_arch_leave. Some UEFI implementations trash this register and, as we use it as a platform register, the kernel doesn't save it before calling into the UEFI runtime services. As we have a copy in tpidr_el1 restore from there when exiting the EFI environment. PR: 237234, 237055 Reviewed by: manu Tested On: Ampere eMAG MFC after: 2 weeks Sponsored by: DARPA, AFRL Sponsored by: Ampere Computing (hardware) Differential Revision: https://reviews.freebsd.org/D20127 Modified: head/sys/arm64/arm64/efirt_machdep.c Modified: head/sys/arm64/arm64/efirt_machdep.c ============================================================================== --- head/sys/arm64/arm64/efirt_machdep.c Wed May 1 15:28:23 2019 (r346995) +++ head/sys/arm64/arm64/efirt_machdep.c Wed May 1 17:12:49 2019 (r346996) @@ -259,6 +259,16 @@ efi_arch_leave(void) { struct thread *td; + /* + * Restore the pcpu pointer. Some UEFI implementations trash it and + * we don't store it before calling into them. To fix this we need + * to restore it after returning to the kernel context. As reading + * curthread will access x18 we need to restore it before loading + * the thread pointer. + */ + __asm __volatile( + "mrs x18, tpidr_el1 \n" + ); td = curthread; __asm __volatile( "msr ttbr0_el1, %0 \n" From owner-svn-src-all@freebsd.org Wed May 1 17:30:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24804159C3DD; Wed, 1 May 2019 17:30:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF04A8625C; Wed, 1 May 2019 17:30:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 981B8249D2; Wed, 1 May 2019 17:30:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41HUEY4033887; Wed, 1 May 2019 17:30:14 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41HUEiH033886; Wed, 1 May 2019 17:30:14 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905011730.x41HUEiH033886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 1 May 2019 17:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346999 - in stable: 11/sys/dev/acpica 12/sys/dev/acpica X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/dev/acpica 12/sys/dev/acpica X-SVN-Commit-Revision: 346999 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BF04A8625C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 17:30:15 -0000 Author: jhb Date: Wed May 1 17:30:14 2019 New Revision: 346999 URL: https://svnweb.freebsd.org/changeset/base/346999 Log: MFC 346063: Don't pre-reserve resources for CPU devices when they are set. CPUs can use shared (RF_SHAREABLE) resources for the I/O port used for entering and exiting C states. If this I/O port is included in an ACPI system resource device, then this happens to still work, but if the port wasn't part of a system resource device, only the first CPU could allocate the I/O port and use C states since resource_list_reserve() was always allocating the resource from nexus0 without RF_SHAREABLE. By avoiding the reservation, the flags from the bus_alloc_resource() in the CPU driver (which include RF_SHAREABLE) are honored. PR: 236513 Modified: stable/12/sys/dev/acpica/acpi.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/acpica/acpi.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/dev/acpica/acpi.c ============================================================================== --- stable/12/sys/dev/acpica/acpi.c Wed May 1 17:27:04 2019 (r346998) +++ stable/12/sys/dev/acpica/acpi.c Wed May 1 17:30:14 2019 (r346999) @@ -1347,6 +1347,14 @@ acpi_set_resource(device_t dev, device_t child, int ty return (0); /* + * Don't reserve resources for CPU devices. Some of these + * resources need to be allocated as shareable, but reservations + * are always non-shareable. + */ + if (device_get_devclass(child) == devclass_find("cpu")) + return (0); + + /* * Reserve the resource. * * XXX: Ignores failure for now. Failure here is probably a From owner-svn-src-all@freebsd.org Wed May 1 17:30:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76A26159C3E3; Wed, 1 May 2019 17:30:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 196F18625D; Wed, 1 May 2019 17:30:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E717B249D3; Wed, 1 May 2019 17:30:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41HUEpM033893; Wed, 1 May 2019 17:30:14 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41HUEl2033892; Wed, 1 May 2019 17:30:14 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905011730.x41HUEl2033892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 1 May 2019 17:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346999 - in stable: 11/sys/dev/acpica 12/sys/dev/acpica X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/dev/acpica 12/sys/dev/acpica X-SVN-Commit-Revision: 346999 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 196F18625D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 17:30:15 -0000 Author: jhb Date: Wed May 1 17:30:14 2019 New Revision: 346999 URL: https://svnweb.freebsd.org/changeset/base/346999 Log: MFC 346063: Don't pre-reserve resources for CPU devices when they are set. CPUs can use shared (RF_SHAREABLE) resources for the I/O port used for entering and exiting C states. If this I/O port is included in an ACPI system resource device, then this happens to still work, but if the port wasn't part of a system resource device, only the first CPU could allocate the I/O port and use C states since resource_list_reserve() was always allocating the resource from nexus0 without RF_SHAREABLE. By avoiding the reservation, the flags from the bus_alloc_resource() in the CPU driver (which include RF_SHAREABLE) are honored. PR: 236513 Modified: stable/11/sys/dev/acpica/acpi.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/dev/acpica/acpi.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/dev/acpica/acpi.c ============================================================================== --- stable/11/sys/dev/acpica/acpi.c Wed May 1 17:27:04 2019 (r346998) +++ stable/11/sys/dev/acpica/acpi.c Wed May 1 17:30:14 2019 (r346999) @@ -1346,6 +1346,14 @@ acpi_set_resource(device_t dev, device_t child, int ty return (0); /* + * Don't reserve resources for CPU devices. Some of these + * resources need to be allocated as shareable, but reservations + * are always non-shareable. + */ + if (device_get_devclass(child) == devclass_find("cpu")) + return (0); + + /* * Reserve the resource. * * XXX: Ignores failure for now. Failure here is probably a From owner-svn-src-all@freebsd.org Wed May 1 18:17:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F71D159D7BE; Wed, 1 May 2019 18:17:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4707A880C5; Wed, 1 May 2019 18:17:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20F342526B; Wed, 1 May 2019 18:17:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41IHhEr060676; Wed, 1 May 2019 18:17:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41IHhgF060675; Wed, 1 May 2019 18:17:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905011817.x41IHhgF060675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 1 May 2019 18:17:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347000 - stable/12/sys/dev/acpica X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/dev/acpica X-SVN-Commit-Revision: 347000 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4707A880C5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 18:17:43 -0000 Author: jhb Date: Wed May 1 18:17:42 2019 New Revision: 347000 URL: https://svnweb.freebsd.org/changeset/base/347000 Log: MFC 346066: Refine r330113 to honor the ProducerConsumer flag most of the time. While it is true that the ACPI spec says that the flag is only valid on Extended Address Space Descriptors, examples of other descriptors in the spec use the ProducerConsumer flag explicitly, and real hardware uses it as well. In fact, even in the ASL of the Thunder X2 for which r330113 was a workaround, some devices use this flag on non-Extended Address Space Descriptors correctly. Instead, only ignore the flag for resources associated with the UART devices on the Thunder X2 using the "ARMH0011" HID to identify these devices. This should fix regressions from ignoring this flag in other contexts such as Hyper-V. PR: 235876 Modified: stable/12/sys/dev/acpica/acpi_resource.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/acpica/acpi_resource.c ============================================================================== --- stable/12/sys/dev/acpica/acpi_resource.c Wed May 1 17:30:14 2019 (r346999) +++ stable/12/sys/dev/acpica/acpi_resource.c Wed May 1 18:17:42 2019 (r347000) @@ -159,6 +159,7 @@ struct acpi_resource_context { struct acpi_parse_resource_set *set; device_t dev; void *context; + bool ignore_producer_flag; }; #ifdef ACPI_DEBUG_OUTPUT @@ -342,7 +343,7 @@ acpi_parse_resource(ACPI_RESOURCE *res, void *context) } if (length <= 0) break; - if (res->Type == ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 && + if (!arc->ignore_producer_flag && res->Data.Address.ProducerConsumer != ACPI_CONSUMER) { ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "ignored %s %s producer\n", name, @@ -431,6 +432,12 @@ acpi_parse_resources(device_t dev, ACPI_HANDLE handle, set->set_init(dev, arg, &arc.context); arc.set = set; arc.dev = dev; + arc.ignore_producer_flag = false; + + /* UARTs on ThunderX2 set ResourceProducer on memory resources. */ + if (acpi_MatchHid(handle, "ARMH0011")) + arc.ignore_producer_flag = true; + status = AcpiWalkResources(handle, "_CRS", acpi_parse_resource, &arc); if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) { printf("can't fetch resources for %s - %s\n", From owner-svn-src-all@freebsd.org Wed May 1 18:54:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64F33159E483; Wed, 1 May 2019 18:54:28 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03BE489381; Wed, 1 May 2019 18:54:28 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3E742591D; Wed, 1 May 2019 18:54:27 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41IsReP081751; Wed, 1 May 2019 18:54:27 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41IsRgu081750; Wed, 1 May 2019 18:54:27 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905011854.x41IsRgu081750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 1 May 2019 18:54:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347001 - head/lib/atf/libatf-c X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/lib/atf/libatf-c X-SVN-Commit-Revision: 347001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 03BE489381 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 18:54:28 -0000 Author: trasz Date: Wed May 1 18:54:27 2019 New Revision: 347001 URL: https://svnweb.freebsd.org/changeset/base/347001 Log: Add MLINKS to atf-c.3. Reviewed by: ngie MFC after: 2 weeks Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D20125 Modified: head/lib/atf/libatf-c/Makefile Modified: head/lib/atf/libatf-c/Makefile ============================================================================== --- head/lib/atf/libatf-c/Makefile Wed May 1 18:17:42 2019 (r347000) +++ head/lib/atf/libatf-c/Makefile Wed May 1 18:54:27 2019 (r347001) @@ -95,6 +95,65 @@ INCS+= atf-c.h INCSDIR_atf-c.h= ${INCLUDEDIR} MAN= atf-c.3 +MLINKS+= atf-c.3 ATF_CHECK.3 \ + atf-c.3 ATF_CHECK_MSG.3 \ + atf-c.3 ATF_CHECK_EQ.3 \ + atf-c.3 ATF_CHECK_EQ_MSG.3 \ + atf-c.3 ATF_CHECK_MATCH.3 \ + atf-c.3 ATF_CHECK_MATCH_MSG.3 \ + atf-c.3 ATF_CHECK_STREQ.3 \ + atf-c.3 ATF_CHECK_STREQ_MSG.3 \ + atf-c.3 ATF_CHECK_ERRNO.3 \ + atf-c.3 ATF_REQUIRE.3 \ + atf-c.3 ATF_REQUIRE_MSG.3 \ + atf-c.3 ATF_REQUIRE_EQ.3 \ + atf-c.3 ATF_REQUIRE_EQ_MSG.3 \ + atf-c.3 ATF_REQUIRE_MATCH.3 \ + atf-c.3 ATF_REQUIRE_MATCH_MSG.3 \ + atf-c.3 ATF_REQUIRE_STREQ.3 \ + atf-c.3 ATF_REQUIRE_STREQ_MSG.3 \ + atf-c.3 ATF_REQUIRE_ERRNO.3 \ + atf-c.3 ATF_TC.3 \ + atf-c.3 ATF_TC_BODY.3 \ + atf-c.3 ATF_TC_BODY_NAME.3 \ + atf-c.3 ATF_TC_CLEANUP.3 \ + atf-c.3 ATF_TC_CLEANUP_NAME.3 \ + atf-c.3 ATF_TC_HEAD.3 \ + atf-c.3 ATF_TC_HEAD_NAME.3 \ + atf-c.3 ATF_TC_NAME.3 \ + atf-c.3 ATF_TC_WITH_CLEANUP.3 \ + atf-c.3 ATF_TC_WITHOUT_HEAD.3 \ + atf-c.3 ATF_TP_ADD_TC.3 \ + atf-c.3 ATF_TP_ADD_TCS.3 \ + atf-c.3 atf_tc_get_config_var.3 \ + atf-c.3 atf_tc_get_config_var_wd.3 \ + atf-c.3 atf_tc_get_config_var_as_bool.3 \ + atf-c.3 atf_tc_get_config_var_as_bool_wd.3 \ + atf-c.3 atf_tc_get_config_var_as_long.3 \ + atf-c.3 atf_tc_get_config_var_as_long_wd.3 \ + atf-c.3 atf_no_error.3 \ + atf-c.3 atf_tc_expect_death.3 \ + atf-c.3 atf_tc_expect_exit.3 \ + atf-c.3 atf_tc_expect_fail.3 \ + atf-c.3 atf_tc_expect_pass.3 \ + atf-c.3 atf_tc_expect_signal.3 \ + atf-c.3 atf_tc_expect_timeout.3 \ + atf-c.3 atf_tc_fail.3 \ + atf-c.3 atf_tc_fail_nonfatal.3 \ + atf-c.3 atf_tc_pass.3 \ + atf-c.3 atf_tc_skip.3 \ + atf-c.3 atf_utils_cat_file.3 \ + atf-c.3 atf_utils_compare_file.3 \ + atf-c.3 atf_utils_copy_file.3 \ + atf-c.3 atf_utils_create_file.3 \ + atf-c.3 atf_utils_file_exists.3 \ + atf-c.3 atf_utils_fork.3 \ + atf-c.3 atf_utils_free_charpp.3 \ + atf-c.3 atf_utils_grep_file.3 \ + atf-c.3 atf_utils_grep_string.3 \ + atf-c.3 atf_utils_readline.3 \ + atf-c.3 atf_utils_redirect.3 \ + atf-c.3 atf_utils_wait.3 MLINKS+= atf-c.3 atf-c-api.3 # Backwards compatibility. HAS_TESTS= From owner-svn-src-all@freebsd.org Wed May 1 18:56:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12AD0159E538; Wed, 1 May 2019 18:56:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA5EF89507; Wed, 1 May 2019 18:56:22 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 756F52592E; Wed, 1 May 2019 18:56:22 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41IuMpH081894; Wed, 1 May 2019 18:56:22 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41IuMLE081893; Wed, 1 May 2019 18:56:22 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905011856.x41IuMLE081893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 1 May 2019 18:56:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347002 - head/usr.bin/stat X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.bin/stat X-SVN-Commit-Revision: 347002 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AA5EF89507 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 18:56:23 -0000 Author: trasz Date: Wed May 1 18:56:22 2019 New Revision: 347002 URL: https://svnweb.freebsd.org/changeset/base/347002 Log: Add 'Birth' to 'stat -x' output. Current Linux stat(1) also includes that. Reviewed by: cem MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20130 Modified: head/usr.bin/stat/stat.c Modified: head/usr.bin/stat/stat.c ============================================================================== --- head/usr.bin/stat/stat.c Wed May 1 18:54:27 2019 (r347001) +++ head/usr.bin/stat/stat.c Wed May 1 18:56:22 2019 (r347002) @@ -112,7 +112,8 @@ __FBSDID("$FreeBSD$"); "Device: %Hd,%Ld Inode: %i Links: %l%n" \ "Access: %Sa%n" \ "Modify: %Sm%n" \ - "Change: %Sc" + "Change: %Sc%n" \ + " Birth: %SB" #define TIME_FORMAT "%b %e %T %Y" From owner-svn-src-all@freebsd.org Wed May 1 19:02:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D489159E64D; Wed, 1 May 2019 19:02:04 +0000 (UTC) (envelope-from slava.shwartsman@gmail.com) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 B3BF78983E; Wed, 1 May 2019 19:02:03 +0000 (UTC) (envelope-from slava.shwartsman@gmail.com) Received: by mail-wr1-f65.google.com with SMTP id c12so25608740wrt.8; Wed, 01 May 2019 12:02:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=7d6NJZcsUO41HBlpC2Tis+rlIzqBoY26+lB/4eoYFPI=; b=YW8L07WIU2YVlhARgai/jPsucLsqsThZfVvhiGaHeDds/drKm86xyo25xMDThxdQHa w8LlmfaVUH5nRzDzIzHy7BG1Jv8BYRYdB3rWHSPEGUJa3mG/5BALPb6+wdpNzorko2Ir DiU4bpkg3ZoxxjJ8jdQhOK7Zwry748PGNwO02IA3pK+CbWzyb4lrnCwJEDok8EHcYMX7 AS+fFnVshp2Wo2Y4ps5SCgjir+HAigfw2z1oWXdlrfv95x9HgGHflluZV5k2iG1K4XYE rGWlEqxd0lhln9eaZ/cP6OYD1TKhHFcgAbKzBu07Pe45oY7DHGS5t4fyWZywQ9FGxMwN xBbQ== X-Gm-Message-State: APjAAAVUX0xgXZxLnkkXaxB39Ay+mttRZlZ1Edn22ckcwl5XQ6kO+lrS IHOO10FVk/3Z8igGXIo3QfpnigbO X-Google-Smtp-Source: APXvYqyrkf78k+OD/2+202XuDPVFH2cIBOVcucJTwAcEwxiIw9Dm83kt/XF4zRHYqL8wT6PXhLsOqw== X-Received: by 2002:adf:c788:: with SMTP id l8mr19233690wrg.143.1556737321469; Wed, 01 May 2019 12:02:01 -0700 (PDT) Received: from [10.0.0.30] (bzq-79-183-97-188.red.bezeqint.net. [79.183.97.188]) by smtp.gmail.com with ESMTPSA id c18sm20171560wrb.16.2019.05.01.12.01.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 May 2019 12:02:00 -0700 (PDT) Reply-To: slavash@FreeBSD.org Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en To: John Baldwin , Hans Petter Selasky , "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051425.wB5EP38T004562@repo.freebsd.org> <7cea5305-4136-a0b6-487b-51307b1c6db9@FreeBSD.org> <123654bf-59f7-1db8-55ce-36306bdac43d@FreeBSD.org> <67b638e0-8e6f-f960-b263-62eed8ce28b7@FreeBSD.org> <0e80cb1d-20b9-5b8c-330e-5f64a603ff10@FreeBSD.org> <737bfa62-eb3e-7c48-6356-0e0b76bb0593@FreeBSD.org> <76a05c08-b851-c50a-16fa-ac42c872413c@FreeBSD.org> <054b81ee-0bdc-184a-9928-8679b53d52cc@FreeBSD.org> From: Slava Shwartsman Message-ID: <83f514cb-b481-4a39-d9e7-3a86f1b3760f@FreeBSD.org> Date: Wed, 1 May 2019 22:01:55 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <054b81ee-0bdc-184a-9928-8679b53d52cc@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B3BF78983E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.994,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 19:02:04 -0000 On 01-May-19 19:45, John Baldwin wrote: > On 5/1/19 1:05 AM, Slava Shwartsman wrote: >> >> >> On 01-May-19 10:28, Slava Shwartsman wrote: >>> >>> >>> On 01-May-19 10:09, Slava Shwartsman wrote: >>>> >>>> >>>> On 30-Apr-19 00:14, John Baldwin wrote: >>>>> On 4/25/19 12:10 AM, Slava Shwartsman wrote: >>>>>> >>>>>> >>>>>> On 17-Apr-19 00:28, John Baldwin wrote: >>>>>>> On 4/16/19 8:32 AM, Hans Petter Selasky wrote: >>>>>>>> On 4/16/19 4:39 PM, Andrey V. Elsukov wrote: >>>>>>>>> On 05.12.2018 17:25, Slava Shwartsman wrote: >>>>>>>>>> Author: slavash >>>>>>>>>> Date: Wed Dec  5 14:25:03 2018 >>>>>>>>>> New Revision: 341586 >>>>>>>>>> URL: https://svnweb.freebsd.org/changeset/base/341586 >>>>>>>>>> >>>>>>>>>> Log: >>>>>>>>>>      mlx5en: Implement backpressure indication. >>>>>>>>>>      The backpressure indication is implemented using an >>>>>>>>>> unlimited rate type of >>>>>>>>>>      mbuf send tag. When the upper layers typically the socket >>>>>>>>>> layer has obtained such >>>>>>>>>>      a tag, it can then query the destination driver queue for >>>>>>>>>> the current >>>>>>>>>>      amount of space available in the send queue. >>>>>>>>>>      A single mbuf send tag may be referenced multiple times and >>>>>>>>>> a refcount has been added >>>>>>>>>>      to the mlx5e_priv structure to track its usage. Because the >>>>>>>>>> send tag resides >>>>>>>>>>      in the mlx5e_channel structure, there is no need to wait >>>>>>>>>> for refcounts to reach >>>>>>>>>>      zero until the mlx4en(4) driver is detached. The channels >>>>>>>>>> structure is persistant >>>>>>>>>>      during the lifetime of the mlx5en(4) driver it belongs to >>>>>>>>>> and can so be accessed >>>>>>>>>>      without any need of synchronization. >>>>>>>>>>      The mlx5e_snd_tag structure was extended to contain a type >>>>>>>>>> field, because there are now >>>>>>>>>>      two different tag types which end up in the driver which >>>>>>>>>> need to be distinguished. >>>>>>>>>>      Submitted by:   hselasky@ >>>>>>>>>>      Approved by:    hselasky (mentor) >>>>>>>>>>      MFC after:      1 week >>>>>>>>>>      Sponsored by:   Mellanox Technologies >>>>>>>>>> @@ -587,27 +609,33 @@ mlx5e_xmit(struct ifnet *ifp, struct mbuf >>>>>>>>>> *mb) >>>>>>>>>>         struct mlx5e_sq *sq; >>>>>>>>>>         int ret; >>>>>>>>>> -    sq = mlx5e_select_queue(ifp, mb); >>>>>>>>>> -    if (unlikely(sq == NULL)) { >>>>>>>>>> -#ifdef RATELIMIT >>>>>>>>>> -        /* Check for route change */ >>>>>>>>>> -        if (mb->m_pkthdr.snd_tag != NULL && >>>>>>>>>> -            mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>>>>>>> +    if (mb->m_pkthdr.snd_tag != NULL) { >>>>>>>>>> +        sq = mlx5e_select_queue_by_send_tag(ifp, mb); >>>>>>>>>> +        if (unlikely(sq == NULL)) { >>>>>>>>>> +            /* Check for route change */ >>>>>>>>>> +            if (mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>>>>>>> +                /* Free mbuf */ >>>>>>>>>> +                m_freem(mb); >>>>>>>>>> + >>>>>>>>>> +                /* >>>>>>>>>> +                 * Tell upper layers about route >>>>>>>>>> +                 * change and to re-transmit this >>>>>>>>>> +                 * packet: >>>>>>>>>> +                 */ >>>>>>>>>> +                return (EAGAIN); >>>>>>>>>> +            } >>>>>>>>> >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I just discovered something strange and found that this commit is >>>>>>>>> the >>>>>>>>> cause. >>>>>>>>> The test system has mlx5en 100G interface. It has two vlans: >>>>>>>>> vlan500 and >>>>>>>>> vlan100. >>>>>>>>> Via vlan500 it receives some packets flows. Then it routes these >>>>>>>>> packets >>>>>>>>> into vlan100. >>>>>>>>> But packets are dropped in mlx5e_xmit() with EAGAIN error code. >>>>>>>>> >>>>>>>>> # dtrace -n 'fbt::ip6_output:return {printf("%d", arg1);}' >>>>>>>>> dtrace: description 'fbt::ip6_output:return ' matched 1 probe >>>>>>>>> CPU     ID                    FUNCTION:NAME >>>>>>>>>     23  54338                ip6_output:return 35 >>>>>>>>>     16  54338                ip6_output:return 35 >>>>>>>>>     21  54338                ip6_output:return 35 >>>>>>>>>     22  54338                ip6_output:return 35 >>>>>>>>>     24  54338                ip6_output:return 35 >>>>>>>>>     23  54338                ip6_output:return 35 >>>>>>>>>     14  54338                ip6_output:return 35 >>>>>>>>> ^C >>>>>>>>> >>>>>>>>> # dtrace -n 'fbt::mlx5e_xmit:return {printf("%d", arg1);}' >>>>>>>>> dtrace: description 'fbt::mlx5e_xmit:return ' matched 1 probe >>>>>>>>> CPU     ID                    FUNCTION:NAME >>>>>>>>>     16  69030                mlx5e_xmit:return 35 >>>>>>>>>     23  69030                mlx5e_xmit:return 35 >>>>>>>>>     26  69030                mlx5e_xmit:return 35 >>>>>>>>>     25  69030                mlx5e_xmit:return 35 >>>>>>>>>     24  69030                mlx5e_xmit:return 35 >>>>>>>>>     21  69030                mlx5e_xmit:return 35 >>>>>>>>>     26  69030                mlx5e_xmit:return 35 >>>>>>>>> ^C >>>>>>>>> >>>>>>>>> The kernel config is GENERIC. >>>>>>>>> 13.0-CURRENT #9 r345758+82f3d57(svn_head)-dirty >>>>>>>>> >>>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> This might be a case where rcvif in the mbuf's pktheader is not >>>>>>>> cleared >>>>>>>> before the packet is fed back on the wire. >>>>>>>> >>>>>>>> John Baldwin is working on the send tags implementation, to eliminate >>>>>>>> the EAGAIN handling in the network drivers. >>>>>>> >>>>>>> I will try to push this branch sooner then since it affects more >>>>>>> than just >>>>>>> TLS.  Part of the change includes a new flag we can use to assert >>>>>>> that we >>>>>> Thanks John! >>>>>>> aren't just getting a stale rcvif (though there are also now >>>>>>> assertions in >>>>>>> ip_output that should catch this case I think). >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> Hi Andrey, >>>>>> >>>>>> Yes, we were able to reproduce this issue in house. If you don't >>>>>> mind, I >>>>>> prefer to wait for John's update - where he eliminates the EAGAIN >>>>>> handling in the network drivers. >>>>> >>>>> I have rebased the branch for this, but for now it will just panic >>>>> sooner >>>>> I believe by tripping an assertion.  Can you grab the diff (or just >>>>> the branch) >>>>> from the 'send_tags' branch at github/bsdjhb/freebsd and reproduce >>>>> under a >>>>> kernel with INVARIANTS?  I think we will have to explicitly clear the >>>>> 'rcvif' >>>>> pointer somewhere, but I want to see what the stack trace looks like >>>>> so I can >>>>> think about the "right" place to clear it. >>>>> >>>> >>>> Hi John, >>>> >>>> I grabbed your branch (which doesn't build BTW due to libbe(3): Fix >>>> mis-application of patch (SHLIBDIR) so I just reverted it). >>>> >>>> The kernel doesn't panic in this scenario - it just that the packets >>>> are being dropped. So I added a kdb_backtrace right before the return >>>> (EAGAIN) in mlx5e_xmit: >>>> >>>> KDB: stack backtrace: >>>> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame >>>> 0xfffffe0000547d90 >>>> mlx5e_xmit() at mlx5e_xmit+0x3d/frame 0xfffffe0000548160 >>>> vlan_transmit() at vlan_transmit+0xdc/frame 0xfffffe00005481d0 >>>> ether_output_frame() at ether_output_frame+0xa2/frame 0xfffffe0000548200 >>>> ether_output() at ether_output+0x689/frame 0xfffffe00005482a0 >>>> ip_output() at ip_output+0x13a4/frame 0xfffffe00005483f0 >>>> ip_forward() at ip_forward+0x344/frame 0xfffffe00005484b0 >>>> ip_input() at ip_input+0x7f5/frame 0xfffffe0000548560 >>>> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame >>>> 0xfffffe00005485d0 >>>> ether_demux() at ether_demux+0x147/frame 0xfffffe0000548600 >>>> ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe0000548660 >>>> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame >>>> 0xfffffe00005486d0 >>>> ether_input() at ether_input+0x73/frame 0xfffffe0000548700 >>>> vlan_input() at vlan_input+0x1e7/frame 0xfffffe0000548750 >>>> ether_demux() at ether_demux+0x12d/frame 0xfffffe0000548780 >>>> ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe00005487e0 >>>> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame >>>> 0xfffffe0000548850 >>>> ether_input() at ether_input+0x73/frame 0xfffffe0000548880 >>>> mlx5e_rx_cq_comp() at mlx5e_rx_cq_comp+0x8b4/frame 0xfffffe00005489a0 >>>> mlx5_cq_completion() at mlx5_cq_completion+0x5e/frame 0xfffffe00005489d0 >>>> mlx5_msix_handler() at mlx5_msix_handler+0x1ba/frame 0xfffffe0000548a10 >>>> ithread_loop() at ithread_loop+0x187/frame 0xfffffe0000548a70 >>>> fork_exit() at fork_exit+0x84/frame 0xfffffe0000548ab0 >>>> fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0000548ab0 >>>> --- trap 0, rip = 0, rsp = 0, rbp = 0 --- >>>> >>>> >>>> Please ping me if you want me to try anything else. >>>> >>>> >>>> Slava >>> >>> My bad - tested with master. Re-testing now. >>> >>> >>> Slava >> >> Got it now: >> >> panic: Assertion m->m_pkthdr.snd_tag == NULL failed at >> /usr/src/sys/netinet/ip_output.c:213 >> cpuid = 0 >> time = 1556697834 >> KDB: stack backtrace: >> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame >> 0xfffffe00005ac1f0 >> vpanic() at vpanic+0x19d/frame 0xfffffe00005ac240 >> panic() at panic+0x43/frame 0xfffffe00005ac2a0 >> ip_output() at ip_output+0x159f/frame 0xfffffe00005ac3f0 >> ip_forward() at ip_forward+0x38c/frame 0xfffffe00005ac4b0 >> ip_input() at ip_input+0x7f5/frame 0xfffffe00005ac560 >> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005ac5d0 >> ether_demux() at ether_demux+0x147/frame 0xfffffe00005ac600 >> ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe00005ac660 >> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005ac6d0 >> ether_input() at ether_input+0x7d/frame 0xfffffe00005ac700 >> vlan_input() at vlan_input+0x1e7/frame 0xfffffe00005ac750 >> ether_demux() at ether_demux+0x12d/frame 0xfffffe00005ac780 >> ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe00005ac7e0 >> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005ac850 >> ether_input() at ether_input+0x7d/frame 0xfffffe00005ac880 >> mlx5e_rx_cq_comp() at mlx5e_rx_cq_comp+0x8b4/frame 0xfffffe00005ac9a0 >> mlx5_cq_completion() at mlx5_cq_completion+0x5e/frame 0xfffffe00005ac9d0 >> mlx5_msix_handler() at mlx5_msix_handler+0x1ba/frame 0xfffffe00005aca10 >> ithread_loop() at ithread_loop+0x187/frame 0xfffffe00005aca70 >> fork_exit() at fork_exit+0x84/frame 0xfffffe00005acab0 >> fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00005acab0 >> --- trap 0, rip = 0, rsp = 0, rbp = 0 --- >> KDB: enter: panic >> [ thread pid 12 tid 100113 ] >> Stopped at kdb_enter+0x3b: movq $0,kdb_why >> >> >> I can keep the machine in this state for a while now if you want to take >> a look at anything specific. > > I pushed further changes to this branch (that are now in the review that > Hans noted) that I think should fix the panic. You can either pull the > branch (I'll try to rebase it today) or from the review. Please let me > know if this resolves the panic. Thanks! > I puled the branch and it solves the panic (and the issue): # dtrace -n 'fbt::mlx5e_xmit:return {printf("%d", arg1);}' dtrace: description 'fbt::mlx5e_xmit:return ' matched 1 probe CPU ID FUNCTION:NAME 1 61827 mlx5e_xmit:return 0 0 61827 mlx5e_xmit:return 0 0 61827 mlx5e_xmit:return 0 0 61827 mlx5e_xmit:return 0 0 61827 mlx5e_xmit:return 0 0 61827 mlx5e_xmit:return 0 Andrey, do you want to test it on your end too? Slava From owner-svn-src-all@freebsd.org Wed May 1 19:35:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7323A159F311; Wed, 1 May 2019 19:35:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13AB38AAC7; Wed, 1 May 2019 19:35:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7AA4C2601E; Wed, 1 May 2019 19:35:46 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41JZkAZ005857; Wed, 1 May 2019 19:35:46 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41JZkVh005856; Wed, 1 May 2019 19:35:46 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905011935.x41JZkVh005856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 1 May 2019 19:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347003 - head/usr.bin/stat/tests X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.bin/stat/tests X-SVN-Commit-Revision: 347003 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 13AB38AAC7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 19:35:47 -0000 Author: trasz Date: Wed May 1 19:35:45 2019 New Revision: 347003 URL: https://svnweb.freebsd.org/changeset/base/347003 Log: Unbreak the tests after r347002. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/stat/tests/stat_test.sh Modified: head/usr.bin/stat/tests/stat_test.sh ============================================================================== --- head/usr.bin/stat/tests/stat_test.sh Wed May 1 18:56:22 2019 (r347002) +++ head/usr.bin/stat/tests/stat_test.sh Wed May 1 19:35:45 2019 (r347003) @@ -184,6 +184,7 @@ x_output() local path=$1; shift local atime_s=$(x_output_date -f '%Sa' $path) + local btime_s=$(x_output_date -f '%SB' $path) local ctime_s=$(x_output_date -f '%Sc' $path) local devid=$(stat -f '%Hd,%Ld' $path) local file_type_s=$(stat -f '%HT' $path) @@ -206,6 +207,7 @@ Device: $devid Inode: $inode Links: $nlink Access: $atime_s Modify: $mtime_s Change: $ctime_s + Birth: $btime_s EOF } From owner-svn-src-all@freebsd.org Wed May 1 21:26:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0E7415A125F; Wed, 1 May 2019 21:26:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8050F8E355; Wed, 1 May 2019 21:26:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55900273F8; Wed, 1 May 2019 21:26:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41LQYuA064350; Wed, 1 May 2019 21:26:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41LQYpp064349; Wed, 1 May 2019 21:26:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905012126.x41LQYpp064349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 1 May 2019 21:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347004 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 347004 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8050F8E355 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 21:26:35 -0000 Author: jhb Date: Wed May 1 21:26:33 2019 New Revision: 347004 URL: https://svnweb.freebsd.org/changeset/base/347004 Log: MFC 345659: Use a dedicated malloc type for lagg(4)'s structures. Modified: stable/12/sys/net/if_lagg.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_lagg.c ============================================================================== --- stable/12/sys/net/if_lagg.c Wed May 1 19:35:45 2019 (r347003) +++ stable/12/sys/net/if_lagg.c Wed May 1 21:26:33 2019 (r347004) @@ -111,6 +111,7 @@ static void lagg_clone_destroy(struct ifnet *); VNET_DEFINE_STATIC(struct if_clone *, lagg_cloner); #define V_lagg_cloner VNET(lagg_cloner) static const char laggname[] = "lagg"; +static MALLOC_DEFINE(M_LAGG, laggname, "802.3AD Link Aggregation Interface"); static void lagg_capabilities(struct lagg_softc *); static int lagg_port_create(struct lagg_softc *, struct ifnet *); @@ -478,10 +479,10 @@ lagg_clone_create(struct if_clone *ifc, int unit, cadd struct ifnet *ifp; static const u_char eaddr[6]; /* 00:00:00:00:00:00 */ - sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO); + sc = malloc(sizeof(*sc), M_LAGG, M_WAITOK|M_ZERO); ifp = sc->sc_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { - free(sc, M_DEVBUF); + free(sc, M_LAGG); return (ENOSPC); } LAGG_SX_INIT(sc); @@ -568,7 +569,7 @@ lagg_clone_destroy(struct ifnet *ifp) LAGG_LIST_UNLOCK(); LAGG_SX_DESTROY(sc); - free(sc, M_DEVBUF); + free(sc, M_LAGG); } static void @@ -682,7 +683,7 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * ifr.ifr_mtu = oldmtu; } - lp = malloc(sizeof(struct lagg_port), M_DEVBUF, M_WAITOK|M_ZERO); + lp = malloc(sizeof(struct lagg_port), M_LAGG, M_WAITOK|M_ZERO); lp->lp_softc = sc; /* Check if port is a stacked lagg */ @@ -690,7 +691,7 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * SLIST_FOREACH(sc_ptr, &V_lagg_list, sc_entries) { if (ifp == sc_ptr->sc_ifp) { LAGG_LIST_UNLOCK(); - free(lp, M_DEVBUF); + free(lp, M_LAGG); if (oldmtu != -1) (*ifp->if_ioctl)(ifp, SIOCSIFMTU, (caddr_t)&ifr); @@ -701,7 +702,7 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * if (lagg_port_checkstacking(sc_ptr) >= LAGG_MAX_STACKING) { LAGG_LIST_UNLOCK(); - free(lp, M_DEVBUF); + free(lp, M_LAGG); if (oldmtu != -1) (*ifp->if_ioctl)(ifp, SIOCSIFMTU, (caddr_t)&ifr); @@ -812,7 +813,7 @@ lagg_port_destroy_cb(epoch_context_t ec) ifp = lp->lp_ifp; if_rele(ifp); - free(lp, M_DEVBUF); + free(lp, M_LAGG); } static int @@ -1584,7 +1585,7 @@ lagg_setmulti(struct lagg_port *lp) CK_STAILQ_FOREACH(ifma, &scifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; - mc = malloc(sizeof(struct lagg_mc), M_DEVBUF, M_NOWAIT); + mc = malloc(sizeof(struct lagg_mc), M_LAGG, M_NOWAIT); if (mc == NULL) { IF_ADDR_WUNLOCK(scifp); return (ENOMEM); @@ -1615,7 +1616,7 @@ lagg_clrmulti(struct lagg_port *lp) SLIST_REMOVE(&lp->lp_mc_head, mc, lagg_mc, mc_entries); if (mc->mc_ifma && lp->lp_detaching == 0) if_delmulti_ifma(mc->mc_ifma); - free(mc, M_DEVBUF); + free(mc, M_LAGG); } return (0); } @@ -2059,7 +2060,7 @@ lagg_lb_attach(struct lagg_softc *sc) struct lagg_lb *lb; LAGG_XLOCK_ASSERT(sc); - lb = malloc(sizeof(struct lagg_lb), M_DEVBUF, M_WAITOK | M_ZERO); + lb = malloc(sizeof(struct lagg_lb), M_LAGG, M_WAITOK | M_ZERO); lb->lb_key = m_ether_tcpip_hash_init(); sc->sc_psc = lb; @@ -2074,7 +2075,7 @@ lagg_lb_detach(struct lagg_softc *sc) lb = (struct lagg_lb *)sc->sc_psc; if (lb != NULL) - free(lb, M_DEVBUF); + free(lb, M_LAGG); } static int From owner-svn-src-all@freebsd.org Wed May 1 21:45:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A009B15A1BA7; Wed, 1 May 2019 21:45:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C1CE8EDDD; Wed, 1 May 2019 21:45:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 214AF2777C; Wed, 1 May 2019 21:45:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41LjGCJ074489; Wed, 1 May 2019 21:45:16 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41LjFhD074488; Wed, 1 May 2019 21:45:16 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905012145.x41LjFhD074488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 1 May 2019 21:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347005 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 347005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3C1CE8EDDD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 21:45:16 -0000 Author: jhb Date: Wed May 1 21:45:15 2019 New Revision: 347005 URL: https://svnweb.freebsd.org/changeset/base/347005 Log: MFC 345655: Remove nested epochs from lagg(4). lagg_bcast_start appeared to have a bug in that was using the last lagg port structure after exiting the epoch that was keeping that structure alive. However, upon further inspection, the epoch was already entered by the caller (lagg_transmit), so the epoch enter/exit in lagg_bcast_start was actually unnecessary. This commit generally removes uses of the net epoch via LAGG_RLOCK to protect the list of ports when the list of ports was already protected by an existing LAGG_RLOCK in a caller, or the LAGG_XLOCK. It also adds a missing epoch enter/exit in lagg_snd_tag_alloc while accessing the lagg port structures. An ifp is still accessed via an unsafe reference after the epoch is exited, but that is true in the current code and will be fixed in a future change. Modified: stable/12/sys/net/if_lagg.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_lagg.c ============================================================================== --- stable/12/sys/net/if_lagg.c Wed May 1 21:26:33 2019 (r347004) +++ stable/12/sys/net/if_lagg.c Wed May 1 21:45:15 2019 (r347005) @@ -750,7 +750,6 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * * is predictable and `ifconfig laggN create ...` command * will lead to the same result each time. */ - LAGG_RLOCK(); CK_SLIST_FOREACH(tlp, &sc->sc_ports, lp_entries) { if (tlp->lp_ifp->if_index < ifp->if_index && ( CK_SLIST_NEXT(tlp, lp_entries) == NULL || @@ -758,7 +757,6 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * ifp->if_index)) break; } - LAGG_RUNLOCK(); if (tlp != NULL) CK_SLIST_INSERT_AFTER(tlp, lp, lp_entries); else @@ -1536,14 +1534,17 @@ lagg_snd_tag_alloc(struct ifnet *ifp, struct lagg_lb *lb; uint32_t p; + LAGG_RLOCK(); switch (sc->sc_proto) { case LAGG_PROTO_FAILOVER: lp = lagg_link_active(sc, sc->sc_primary); break; case LAGG_PROTO_LOADBALANCE: if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) == 0 || - params->hdr.flowtype == M_HASHTYPE_NONE) + params->hdr.flowtype == M_HASHTYPE_NONE) { + LAGG_RUNLOCK(); return (EOPNOTSUPP); + } p = params->hdr.flowid >> sc->flowid_shift; p %= sc->sc_count; lb = (struct lagg_lb *)sc->sc_psc; @@ -1552,16 +1553,22 @@ lagg_snd_tag_alloc(struct ifnet *ifp, break; case LAGG_PROTO_LACP: if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) == 0 || - params->hdr.flowtype == M_HASHTYPE_NONE) + params->hdr.flowtype == M_HASHTYPE_NONE) { + LAGG_RUNLOCK(); return (EOPNOTSUPP); + } lp = lacp_select_tx_port_by_hash(sc, params->hdr.flowid); break; default: + LAGG_RUNLOCK(); return (EOPNOTSUPP); } - if (lp == NULL) + if (lp == NULL) { + LAGG_RUNLOCK(); return (EOPNOTSUPP); + } ifp = lp->lp_ifp; + LAGG_RUNLOCK(); if (ifp == NULL || ifp->if_snd_tag_alloc == NULL || (ifp->if_capenable & IFCAP_TXRTLMT) == 0) return (EOPNOTSUPP); @@ -1845,12 +1852,18 @@ struct lagg_port * lagg_link_active(struct lagg_softc *sc, struct lagg_port *lp) { struct lagg_port *lp_next, *rval = NULL; - struct epoch_tracker net_et; /* * Search a port which reports an active link state. */ + /* + * This is called with either LAGG_RLOCK() held or + * LAGG_XLOCK(sc) held. + */ + if (!in_epoch(net_epoch_preempt)) + LAGG_XLOCK_ASSERT(sc); + if (lp == NULL) goto search; if (LAGG_PORTACTIVE(lp)) { @@ -1863,15 +1876,12 @@ lagg_link_active(struct lagg_softc *sc, struct lagg_po goto found; } - search: - epoch_enter_preempt(net_epoch_preempt, &net_et); +search: CK_SLIST_FOREACH(lp_next, &sc->sc_ports, lp_entries) { if (LAGG_PORTACTIVE(lp_next)) { - epoch_exit_preempt(net_epoch_preempt, &net_et); return (lp_next); } } - epoch_exit_preempt(net_epoch_preempt, &net_et); found: return (rval); } @@ -1953,7 +1963,7 @@ lagg_bcast_start(struct lagg_softc *sc, struct mbuf *m struct lagg_port *lp, *last = NULL; struct mbuf *m0; - LAGG_RLOCK(); + LAGG_RLOCK_ASSERT(); CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { if (!LAGG_PORTACTIVE(lp)) continue; @@ -1974,7 +1984,6 @@ lagg_bcast_start(struct lagg_softc *sc, struct mbuf *m } last = lp; } - LAGG_RUNLOCK(); if (last == NULL) { m_freem(m); @@ -2087,7 +2096,7 @@ lagg_lb_porttable(struct lagg_softc *sc, struct lagg_p rv = 0; bzero(&lb->lb_ports, sizeof(lb->lb_ports)); - LAGG_RLOCK(); + LAGG_XLOCK_ASSERT(sc); CK_SLIST_FOREACH(lp_next, &sc->sc_ports, lp_entries) { if (lp_next == lp) continue; @@ -2100,7 +2109,6 @@ lagg_lb_porttable(struct lagg_softc *sc, struct lagg_p sc->sc_ifname, lp_next->lp_ifp->if_xname, i); lb->lb_ports[i++] = lp_next; } - LAGG_RUNLOCK(); return (rv); } From owner-svn-src-all@freebsd.org Wed May 1 21:54:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39A3415A1E61; Wed, 1 May 2019 21:54:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3FE08F34C; Wed, 1 May 2019 21:54:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB74E2797B; Wed, 1 May 2019 21:54:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41LsLNU079790; Wed, 1 May 2019 21:54:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41LsLEx079789; Wed, 1 May 2019 21:54:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905012154.x41LsLEx079789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 1 May 2019 21:54:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347006 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347006 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D3FE08F34C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 21:54:22 -0000 Author: jhb Date: Wed May 1 21:54:21 2019 New Revision: 347006 URL: https://svnweb.freebsd.org/changeset/base/347006 Log: MFC 345712: Don't check the inp socket pointer in in_pcboutput_eagain. Modified: stable/12/sys/netinet/in_pcb.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/in_pcb.c ============================================================================== --- stable/12/sys/netinet/in_pcb.c Wed May 1 21:45:15 2019 (r347005) +++ stable/12/sys/netinet/in_pcb.c Wed May 1 21:54:21 2019 (r347006) @@ -3398,14 +3398,9 @@ in_pcboutput_txrtlmt(struct inpcb *inp, struct ifnet * void in_pcboutput_eagain(struct inpcb *inp) { - struct socket *socket; bool did_upgrade; if (inp == NULL) - return; - - socket = inp->inp_socket; - if (socket == NULL) return; if (inp->inp_snd_tag == NULL) From owner-svn-src-all@freebsd.org Wed May 1 22:12:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5885715A2493; Wed, 1 May 2019 22:12:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1A658FE4C; Wed, 1 May 2019 22:12:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C537B27CEC; Wed, 1 May 2019 22:12:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41MCd0I090205; Wed, 1 May 2019 22:12:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41MCdCK090203; Wed, 1 May 2019 22:12:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905012212.x41MCdCK090203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 1 May 2019 22:12:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r347007 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: kib X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 347007 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F1A658FE4C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 22:12:40 -0000 Author: kib Date: Wed May 1 22:12:39 2019 New Revision: 347007 URL: https://svnweb.freebsd.org/changeset/base/347007 Log: Welcome Doug Moore as src committer. He proposed a lot of vm changes, and more is in works. Markj as co-mentor. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Wed May 1 21:54:21 2019 (r347006) +++ svnadmin/conf/access Wed May 1 22:12:39 2019 (r347007) @@ -63,6 +63,7 @@ des dexuan dfr dim +dougm dteske dumbbell dwmalone dwmalone=freebsd-committers@maths.tcd.ie Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Wed May 1 21:54:21 2019 (r347006) +++ svnadmin/conf/mentors Wed May 1 22:12:39 2019 (r347007) @@ -14,6 +14,7 @@ achim scottl Co-mentor: emaste anish jhb brd allanjude Co-mentor: bapt def pjd +dougm kib Co-mentor: markj gordon delphij Co-mentor: emaste jceel trasz jkh rwatson From owner-svn-src-all@freebsd.org Thu May 2 01:02:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC74D1583478; Thu, 2 May 2019 01:02:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5334F6E64B; Thu, 2 May 2019 01:02:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CB7C1ACE; Thu, 2 May 2019 01:02:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4212QV2080776; Thu, 2 May 2019 01:02:26 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4212QQN080775; Thu, 2 May 2019 01:02:26 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201905020102.x4212QQN080775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 2 May 2019 01:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347008 - stable/12/usr.sbin/nfsdumpstate X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/12/usr.sbin/nfsdumpstate X-SVN-Commit-Revision: 347008 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5334F6E64B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.931,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 01:02:28 -0000 Author: rmacklem Date: Thu May 2 01:02:26 2019 New Revision: 347008 URL: https://svnweb.freebsd.org/changeset/base/347008 Log: MFC: r346709 Add support to nfsdumpstate for printing of INET6 addresses for locks. r346190 added support for printing of INET6 addresses for the "-o" option (all opens) but missed adding support for INET6 addresses for the "-l" option. This patch adds that support. Modified: stable/12/usr.sbin/nfsdumpstate/nfsdumpstate.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/nfsdumpstate/nfsdumpstate.c ============================================================================== --- stable/12/usr.sbin/nfsdumpstate/nfsdumpstate.c Wed May 1 22:12:39 2019 (r347007) +++ stable/12/usr.sbin/nfsdumpstate/nfsdumpstate.c Thu May 2 01:02:26 2019 (r347008) @@ -176,6 +176,7 @@ dump_lockstate(char *fname) { struct nfsd_dumplocklist dumplocklist; int cnt, i; + char nbuf[INET6_ADDRSTRLEN]; dumplocklist.ndllck_size = DUMPSIZE; dumplocklist.ndllck_list = (void *)lp; @@ -183,7 +184,7 @@ dump_lockstate(char *fname) if (nfssvc(NFSSVC_DUMPLOCKS, &dumplocklist) < 0) errx(1, "Can't dump locks for %s\n", fname); - printf("%-11s %-36s %-15s %s\n", + printf("%-11s %-36s %-45s %s\n", "Open/Lock", " Stateid or Lock Range", "Clientaddr", @@ -213,11 +214,26 @@ dump_lockstate(char *fname) lock_flags(lp[cnt].ndlck_flags), lp[cnt].ndlck_first, lp[cnt].ndlck_end); - if (lp[cnt].ndlck_addrfam == AF_INET) - printf("%-15s ", + switch (lp[cnt].ndlck_addrfam) { +#ifdef INET + case AF_INET: + printf("%-45s ", inet_ntoa(lp[cnt].ndlck_cbaddr.sin_addr)); - else - printf("%-15s ", " "); + break; +#endif +#ifdef INET6 + case AF_INET6: + if (inet_ntop(AF_INET6, &lp[cnt].ndlck_cbaddr.sin6_addr, + nbuf, sizeof(nbuf)) != NULL) + printf("%-45s ", nbuf); + else + printf("%-45s ", " "); + break; +#endif + default: + printf("%-45s ", " "); + break; + } for (i = 0; i < lp[cnt].ndlck_owner.nclid_idlen; i++) printf("%02x", lp[cnt].ndlck_owner.nclid_id[i]); printf(" "); From owner-svn-src-all@freebsd.org Thu May 2 01:11:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC23F1583C17; Thu, 2 May 2019 01:11:50 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 932F56EB9D; Thu, 2 May 2019 01:11:50 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E1EF1C68; Thu, 2 May 2019 01:11:50 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x421BokZ082238; Thu, 2 May 2019 01:11:50 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x421Bonf082237; Thu, 2 May 2019 01:11:50 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201905020111.x421Bonf082237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 2 May 2019 01:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347009 - stable/11/usr.sbin/nfsdumpstate X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/11/usr.sbin/nfsdumpstate X-SVN-Commit-Revision: 347009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 932F56EB9D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.931,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 01:11:51 -0000 Author: rmacklem Date: Thu May 2 01:11:49 2019 New Revision: 347009 URL: https://svnweb.freebsd.org/changeset/base/347009 Log: MFC: r346709 Add support to nfsdumpstate for printing of INET6 addresses for locks. r346190 added support for printing of INET6 addresses for the "-o" option (all opens) but missed adding support for INET6 addresses for the "-l" option. This patch adds that support. Modified: stable/11/usr.sbin/nfsdumpstate/nfsdumpstate.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/nfsdumpstate/nfsdumpstate.c ============================================================================== --- stable/11/usr.sbin/nfsdumpstate/nfsdumpstate.c Thu May 2 01:02:26 2019 (r347008) +++ stable/11/usr.sbin/nfsdumpstate/nfsdumpstate.c Thu May 2 01:11:49 2019 (r347009) @@ -176,6 +176,7 @@ dump_lockstate(char *fname) { struct nfsd_dumplocklist dumplocklist; int cnt, i; + char nbuf[INET6_ADDRSTRLEN]; dumplocklist.ndllck_size = DUMPSIZE; dumplocklist.ndllck_list = (void *)lp; @@ -183,7 +184,7 @@ dump_lockstate(char *fname) if (nfssvc(NFSSVC_DUMPLOCKS, &dumplocklist) < 0) errx(1, "Can't dump locks for %s\n", fname); - printf("%-11s %-36s %-15s %s\n", + printf("%-11s %-36s %-45s %s\n", "Open/Lock", " Stateid or Lock Range", "Clientaddr", @@ -213,11 +214,26 @@ dump_lockstate(char *fname) lock_flags(lp[cnt].ndlck_flags), lp[cnt].ndlck_first, lp[cnt].ndlck_end); - if (lp[cnt].ndlck_addrfam == AF_INET) - printf("%-15s ", + switch (lp[cnt].ndlck_addrfam) { +#ifdef INET + case AF_INET: + printf("%-45s ", inet_ntoa(lp[cnt].ndlck_cbaddr.sin_addr)); - else - printf("%-15s ", " "); + break; +#endif +#ifdef INET6 + case AF_INET6: + if (inet_ntop(AF_INET6, &lp[cnt].ndlck_cbaddr.sin6_addr, + nbuf, sizeof(nbuf)) != NULL) + printf("%-45s ", nbuf); + else + printf("%-45s ", " "); + break; +#endif + default: + printf("%-45s ", " "); + break; + } for (i = 0; i < lp[cnt].ndlck_owner.nclid_idlen; i++) printf("%02x", lp[cnt].ndlck_owner.nclid_id[i]); printf(" "); From owner-svn-src-all@freebsd.org Thu May 2 01:17:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AA3D1584301; Thu, 2 May 2019 01:17:56 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2CF2B6F19D; Thu, 2 May 2019 01:17:56 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06E091CA1; Thu, 2 May 2019 01:17:56 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x421HtQ3086285; Thu, 2 May 2019 01:17:55 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x421Htm5086284; Thu, 2 May 2019 01:17:55 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201905020117.x421Htm5086284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 2 May 2019 01:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r347010 - stable/10/usr.sbin/nfsdumpstate X-SVN-Group: stable-10 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/10/usr.sbin/nfsdumpstate X-SVN-Commit-Revision: 347010 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2CF2B6F19D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.931,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 01:17:56 -0000 Author: rmacklem Date: Thu May 2 01:17:55 2019 New Revision: 347010 URL: https://svnweb.freebsd.org/changeset/base/347010 Log: MFC: r346709 Add support to nfsdumpstate for printing of INET6 addresses for locks. r346190 added support for printing of INET6 addresses for the "-o" option (all opens) but missed adding support for INET6 addresses for the "-l" option. This patch adds that support. Modified: stable/10/usr.sbin/nfsdumpstate/nfsdumpstate.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/nfsdumpstate/nfsdumpstate.c ============================================================================== --- stable/10/usr.sbin/nfsdumpstate/nfsdumpstate.c Thu May 2 01:11:49 2019 (r347009) +++ stable/10/usr.sbin/nfsdumpstate/nfsdumpstate.c Thu May 2 01:17:55 2019 (r347010) @@ -176,6 +176,7 @@ dump_lockstate(char *fname) { struct nfsd_dumplocklist dumplocklist; int cnt, i; + char nbuf[INET6_ADDRSTRLEN]; dumplocklist.ndllck_size = DUMPSIZE; dumplocklist.ndllck_list = (void *)lp; @@ -183,7 +184,7 @@ dump_lockstate(char *fname) if (nfssvc(NFSSVC_DUMPLOCKS, &dumplocklist) < 0) errx(1, "Can't dump locks for %s\n", fname); - printf("%-11s %-36s %-15s %s\n", + printf("%-11s %-36s %-45s %s\n", "Open/Lock", " Stateid or Lock Range", "Clientaddr", @@ -213,11 +214,26 @@ dump_lockstate(char *fname) lock_flags(lp[cnt].ndlck_flags), lp[cnt].ndlck_first, lp[cnt].ndlck_end); - if (lp[cnt].ndlck_addrfam == AF_INET) - printf("%-15s ", + switch (lp[cnt].ndlck_addrfam) { +#ifdef INET + case AF_INET: + printf("%-45s ", inet_ntoa(lp[cnt].ndlck_cbaddr.sin_addr)); - else - printf("%-15s ", " "); + break; +#endif +#ifdef INET6 + case AF_INET6: + if (inet_ntop(AF_INET6, &lp[cnt].ndlck_cbaddr.sin6_addr, + nbuf, sizeof(nbuf)) != NULL) + printf("%-45s ", nbuf); + else + printf("%-45s ", " "); + break; +#endif + default: + printf("%-45s ", " "); + break; + } for (i = 0; i < lp[cnt].ndlck_owner.nclid_idlen; i++) printf("%02x", lp[cnt].ndlck_owner.nclid_id[i]); printf(" "); From owner-svn-src-all@freebsd.org Thu May 2 02:26:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88C9415857F3; Thu, 2 May 2019 02:26:43 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2DE7E70AE3; Thu, 2 May 2019 02:26:43 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 035ED285C; Thu, 2 May 2019 02:26:43 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x422QgJX023200; Thu, 2 May 2019 02:26:42 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x422Qge2023199; Thu, 2 May 2019 02:26:42 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905020226.x422Qge2023199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Thu, 2 May 2019 02:26:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347012 - stable/12/sys/compat/linuxkpi/common/src X-SVN-Group: stable-12 X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 347012 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2DE7E70AE3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 02:26:43 -0000 Author: johalun Date: Thu May 2 02:26:42 2019 New Revision: 347012 URL: https://svnweb.freebsd.org/changeset/base/347012 Log: MFC r346712: Don't call cdev_init where cdev_alloc is called. cdev_alloc already handles initialization. Reviewed by: hps Approved by: imp (mentor) Modified: stable/12/sys/compat/linuxkpi/common/src/linux_compat.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- stable/12/sys/compat/linuxkpi/common/src/linux_compat.c Thu May 2 02:08:26 2019 (r347011) +++ stable/12/sys/compat/linuxkpi/common/src/linux_compat.c Thu May 2 02:26:42 2019 (r347012) @@ -2328,7 +2328,7 @@ __register_chrdev(unsigned int major, unsigned int bas for (i = baseminor; i < baseminor + count; i++) { cdev = cdev_alloc(); - cdev_init(cdev, fops); + cdev->ops = fops; kobject_set_name(&cdev->kobj, name); ret = cdev_add(cdev, makedev(major, i), 1); @@ -2350,7 +2350,7 @@ __register_chrdev_p(unsigned int major, unsigned int b for (i = baseminor; i < baseminor + count; i++) { cdev = cdev_alloc(); - cdev_init(cdev, fops); + cdev->ops = fops; kobject_set_name(&cdev->kobj, name); ret = cdev_add_ext(cdev, makedev(major, i), uid, gid, mode); From owner-svn-src-all@freebsd.org Thu May 2 03:39:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B61971587137; Thu, 2 May 2019 03:39:04 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DDD373058; Thu, 2 May 2019 03:39:04 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 357CD34BF; Thu, 2 May 2019 03:39:04 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x423d4WV060649; Thu, 2 May 2019 03:39:04 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x423d4JQ060648; Thu, 2 May 2019 03:39:04 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905020339.x423d4JQ060648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 2 May 2019 03:39:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347013 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 347013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5DDD373058 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 03:39:04 -0000 Author: jhibbits Date: Thu May 2 03:39:03 2019 New Revision: 347013 URL: https://svnweb.freebsd.org/changeset/base/347013 Log: powerpc: Drop OPAL_HANDLE_HMI2 for now, to avoid panicking It's possible for a Hypervisor Maintenance Interrupt (HMI) to occur while in the pmap code, holding locks. This can cause WITNESS to panic due to lock errors in calling pmap_kextract(). Since we don't yet handle the flags returned by OPAL_HANDLE_HMI2, just stop using it, so that we don't call into pmap_kextract(). Reported by: pkubaj Modified: head/sys/powerpc/powernv/opal_hmi.c Modified: head/sys/powerpc/powernv/opal_hmi.c ============================================================================== --- head/sys/powerpc/powernv/opal_hmi.c Thu May 2 02:26:42 2019 (r347012) +++ head/sys/powerpc/powernv/opal_hmi.c Thu May 2 03:39:03 2019 (r347013) @@ -39,25 +39,6 @@ __FBSDID("$FreeBSD$"); #include "opal.h" static int -opal_hmi_handler2(struct trapframe *frame) -{ - int64_t flags; - int err; - - err = opal_call(OPAL_HANDLE_HMI2, vtophys(&flags)); - - /* XXX: At some point, handle the flags outvar. */ - if (err == OPAL_SUCCESS) { - mtspr(SPR_HMER, 0); - return (0); - } - - printf("HMI handler failed! OPAL error code: %d\n", err); - - return (-1); -} - -static int opal_hmi_handler(struct trapframe *frame) { int err; @@ -81,9 +62,7 @@ opal_setup_hmi(void *data) if (opal_check() != 0) return; - if (opal_call(OPAL_CHECK_TOKEN, OPAL_HANDLE_HMI2) == OPAL_TOKEN_PRESENT) - hmi_handler = opal_hmi_handler2; - else if (opal_call(OPAL_CHECK_TOKEN, OPAL_HANDLE_HMI) == OPAL_TOKEN_PRESENT) + if (opal_call(OPAL_CHECK_TOKEN, OPAL_HANDLE_HMI) == OPAL_TOKEN_PRESENT) hmi_handler = opal_hmi_handler; else { printf("Warning: No OPAL HMI handler found.\n"); From owner-svn-src-all@freebsd.org Thu May 2 07:33:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05454158BC3B; Thu, 2 May 2019 07:33:32 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DFC8814CF; Thu, 2 May 2019 07:33:31 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [176.74.212.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 102CF260354; Thu, 2 May 2019 09:33:24 +0200 (CEST) Subject: Re: svn commit: r347012 - stable/12/sys/compat/linuxkpi/common/src To: Johannes Lundberg , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org References: <201905020226.x422Qge2023199@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Thu, 2 May 2019 09:32:56 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201905020226.x422Qge2023199@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 8DFC8814CF X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.963,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 07:33:32 -0000 On 2019-05-02 04:26, Johannes Lundberg wrote: > Author: johalun > Date: Thu May 2 02:26:42 2019 > New Revision: 347012 > URL: https://svnweb.freebsd.org/changeset/base/347012 > > Log: > MFC r346712: > Don't call cdev_init where cdev_alloc is called. cdev_alloc already > handles initialization. > Please also MFC to 11 if possible. --HPS From owner-svn-src-all@freebsd.org Thu May 2 08:17:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A35C158CD5C; Thu, 2 May 2019 08:17:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2EE6183168; Thu, 2 May 2019 08:17:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1950A66E2; Thu, 2 May 2019 08:17:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x428HTNX009086; Thu, 2 May 2019 08:17:29 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x428HT1v009085; Thu, 2 May 2019 08:17:29 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905020817.x428HT1v009085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 2 May 2019 08:17:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347015 - head/sys/compat/linsysfs X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linsysfs X-SVN-Commit-Revision: 347015 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2EE6183168 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 08:17:30 -0000 Author: trasz Date: Thu May 2 08:17:29 2019 New Revision: 347015 URL: https://svnweb.freebsd.org/changeset/base/347015 Log: Add sys/devices/system/cpu/{possible,present} to linsysfs(5). That makes Linux lscpu(1) work. Reviewed by: dchagin MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20131 Modified: head/sys/compat/linsysfs/linsysfs.c Modified: head/sys/compat/linsysfs/linsysfs.c ============================================================================== --- head/sys/compat/linsysfs/linsysfs.c Thu May 2 04:16:46 2019 (r347014) +++ head/sys/compat/linsysfs/linsysfs.c Thu May 2 08:17:29 2019 (r347015) @@ -436,7 +436,7 @@ linsysfs_run_bus(device_t dev, struct pfs_node *dir, s } /* - * Filler function for sys/devices/system/cpu/online + * Filler function for sys/devices/system/cpu/{online,possible,present} */ static int linsysfs_cpuonline(PFS_FILL_ARGS) @@ -532,6 +532,10 @@ linsysfs_init(PFS_INIT_ARGS) cpu = pfs_create_dir(sys, "cpu", NULL, NULL, NULL, 0); pfs_create_file(cpu, "online", &linsysfs_cpuonline, + NULL, NULL, NULL, PFS_RD); + pfs_create_file(cpu, "possible", &linsysfs_cpuonline, + NULL, NULL, NULL, PFS_RD); + pfs_create_file(cpu, "present", &linsysfs_cpuonline, NULL, NULL, NULL, PFS_RD); linsysfs_listcpus(cpu); From owner-svn-src-all@freebsd.org Thu May 2 09:00:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AE95158DFB3; Thu, 2 May 2019 09:00:37 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D075B846D6; Thu, 2 May 2019 09:00:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8A376DA1; Thu, 2 May 2019 09:00:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4290ax1030250; Thu, 2 May 2019 09:00:36 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4290aSM030249; Thu, 2 May 2019 09:00:36 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905020900.x4290aSM030249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 2 May 2019 09:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347016 - head/sys/compat/linsysfs X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: head/sys/compat/linsysfs X-SVN-Commit-Revision: 347016 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D075B846D6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 09:00:37 -0000 Author: dchagin Date: Thu May 2 09:00:36 2019 New Revision: 347016 URL: https://svnweb.freebsd.org/changeset/base/347016 Log: Remove unneeded includes. MFC after: 2 week Modified: head/sys/compat/linsysfs/linsysfs.c Modified: head/sys/compat/linsysfs/linsysfs.c ============================================================================== --- head/sys/compat/linsysfs/linsysfs.c Thu May 2 08:17:29 2019 (r347015) +++ head/sys/compat/linsysfs/linsysfs.c Thu May 2 09:00:36 2019 (r347016) @@ -31,22 +31,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include -#include #include -#include #include #include -#include -#include -#include #include #include #include -#include #include #include @@ -55,17 +45,6 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include #include #include From owner-svn-src-all@freebsd.org Thu May 2 11:12:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12E3F159184F; Thu, 2 May 2019 11:12:47 +0000 (UTC) (envelope-from prvs=018794465=roger.pau@citrix.com) Received: from SMTP.EU.CITRIX.COM (smtp.eu.citrix.com [185.25.65.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.citrix.com", Issuer "DigiCert SHA2 Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 71DCC8982E; Thu, 2 May 2019 11:12:35 +0000 (UTC) (envelope-from prvs=018794465=roger.pau@citrix.com) X-IronPort-AV: E=Sophos;i="5.60,421,1549929600"; d="scan'208";a="89564606" Date: Thu, 2 May 2019 13:11:06 +0200 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Kyle Evans CC: , , Subject: Re: svn commit: r346670 - head/sys/net Message-ID: <20190502111106.pfosaq73kgo6g33j@Air-de-Roger.citrite.net> References: <201904251244.x3PCi8g0096201@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <201904251244.x3PCi8g0096201@repo.freebsd.org> User-Agent: NeoMutt/20180716 X-ClientProxiedBy: AMSPEX02CAS01.citrite.net (10.69.22.112) To AMSPEX02CL02.citrite.net (10.69.22.126) X-Rspamd-Queue-Id: 71DCC8982E X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of prvs=018794465=roger.pau@citrix.com designates 185.25.65.24 as permitted sender) smtp.mailfrom=prvs=018794465=roger.pau@citrix.com X-Spamd-Result: default: False [-5.14 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+mx]; ENVFROM_PRVS(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[citrix.com]; TO_DN_SOME(0.00)[]; FORGED_SENDER_VERP_SRS(0.00)[]; IP_SCORE(-1.97)[ip: (-5.13), ipnet: 185.25.64.0/23(-2.56), asn: 60825(-2.05), country: GB(-0.09)]; RCVD_IN_DNSWL_MED(-0.20)[24.65.25.185.list.dnswl.org : 127.0.9.2]; MX_GOOD(-0.01)[smtp02.citrix.com,smtp.eu.citrix.com,smtp03.citrix.com,smtp.citrix.com]; NEURAL_HAM_SHORT(-0.66)[-0.663,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; FORGED_SENDER(0.00)[roger.pau@citrix.com,prvs=018794465=roger.pau@citrix.com]; RCVD_COUNT_ZERO(0.00)[0]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:60825, ipnet:185.25.64.0/23, country:GB]; FROM_NEQ_ENVFROM(0.00)[roger.pau@citrix.com,prvs=018794465=roger.pau@citrix.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 11:12:47 -0000 On Thu, Apr 25, 2019 at 12:44:08PM +0000, Kyle Evans wrote: > Author: kevans > Date: Thu Apr 25 12:44:08 2019 > New Revision: 346670 > URL: https://svnweb.freebsd.org/changeset/base/346670 >=20 > Log: > tun/tap: close race between destroy/ioctl handler > =20 > It seems that there should be a better way to handle this, but this see= ms to > be the more common approach and it should likely get replaced in all of= the > places it happens... Basically, thread 1 is in the process of destroyin= g the > tun/tap while thread 2 is executing one of the ioctls that requires the > tun/tap mutex and the mutex is destroyed before the ioctl handler can > acquire it. > =20 > This is only one of the races described/found in PR 233955. > =20 > PR: 233955 > Reviewed by: ae > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D20027 This has caused a regression when booting. I reliably get the following panic when booting on several different boxes: Apr 26 16:23:57.662653 panic: mtx_lock() of spin mutex (null) @ /usr/home/o= sstest/build.135317.build-amd64-freebsd/freebsd/sys/kern/subr_bus.c:620 Apr 26 16:23:57.674650 cpuid =3D 2 Apr 26 16:23:57.686653 time =3D 1 Apr 26 16:23:57.686720 KDB: stack backtrace: Apr 26 16:23:57.686797 db_trace_self_wrapper() at db_trace_self_wrapper+0x2= b/frame 0xfffffe003abe8710 Apr 26 16:23:57.686879 vpanic() at vpanic+0x19d/frame 0xfffffe003abe8760 Apr 26 16:23:57.698637 panic() at panic+0x43/frame 0xfffffe003abe87c0 Apr 26 16:23:57.698700 __mtx_lock_flags() at __mtx_lock_flags+0x145/frame 0= xfffffe003abe8810 Apr 26 16:23:57.710640 devctl_queue_data_f() at devctl_queue_data_f+0x6a/fr= ame 0xfffffe003abe8840 Apr 26 16:23:57.722625 g_dev_taste() at g_dev_taste+0x463/frame 0xfffffe003= abe8a00 Apr 26 16:23:57.722690 g_load_class() at g_load_class+0x1bc/frame 0xfffffe0= 03abe8a30 Apr 26 16:23:57.734638 g_run_events() at g_run_events+0x197/frame 0xfffffe0= 03abe8a70 Apr 26 16:23:57.734704 fork_exit() at fork_exit+0x84/frame 0xfffffe003abe8a= b0 Apr 26 16:23:57.746655 fork_trampoline() at fork_trampoline+0xe/frame 0xfff= ffe003abe8ab0 Apr 26 16:23:57.746721 --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- Apr 26 16:23:57.758797 KDB: enter: panic Apr 26 16:23:57.758913 [ thread pid 13 tid 100029 ] Apr 26 16:23:57.758943 Stopped at kdb_enter+0x3b: movq $0,kdb_why Apr 26 16:23:57.770557 db>=20 The full serial log of the host booting: =1B[01;01He820: 0000000095fff000 0`0000000/boot/config: -hn -S115200/=08-= =08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08= /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|= =08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08= \=08|=08/=08-=08\=08|=08/=08-=08\=08Consoles: serial port =20 Apr 26 16:23:50.318505 BIOS drive C: is disk0 Apr 26 16:23:50.318505 BIOS drive D: is disk1 Apr 26 16:23:50.330486 |=08/=08BIOS 632kB/2316028kB available memory Apr 26 16:23:50.366512=20 Apr 26 16:23:50.366512 FreeBSD/x86 bootstrap loader, Revision 1.1 Apr 26 16:23:50.366512 -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08= \=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/= =08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08= |=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-= =08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08= /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|= =08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08= \=08|=08/=08-=08\=08|=08/=08-=08\=08|=08Loading /boot/defaults/loader.conf Apr 26 16:23:50.414528 Loading /boot/device.hints Apr 26 16:23:50.426510 /=08-=08\=08|=08/=08-=08Loading /boot/loader.conf Apr 26 16:23:50.426510 \=08|=08/=08-=08Loading /boot/loader.conf.local Apr 26 16:23:50.438526 \=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08= |=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-= =08\=08Loading kernel... Apr 26 16:23:50.450532 |=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08= /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08/boot/kerne= l/kernel text=3D0x16e4c29 -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-= =08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08= /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08data=3D0x1d65a8= +0x819948 /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/= =08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08= |=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-= =08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08= /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08syms=3D[0x8+0x183c48\=08|=08= /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|= =08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08= \=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08+0x8+0x1a1479-=08\=08|=08] Apr 26 16:23:51.626609 Loading configured modules... Apr 26 16:23:51.638619 /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08|=08can't find '/boot/entropy' Apr 26 16:23:51.638679 /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08/mfsroot |=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-= =088000000 2 \=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08= /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|= =08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08= \=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/= =08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08= |=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-= =08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08= /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|= =08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08= \=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/= =08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08= |=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-= =08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08= /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|= =08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08= \=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/= =08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08= |=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-= =08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08= /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|= =08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08= \=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/= =08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08= |=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-= =08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08= /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|= =08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08= \=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/= =08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08= |=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-= =08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08= /=08-=08\=08|=08/=08-=08 \=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08size=3D0x171c8000 Apr 26 16:23:53.846620=20 Apr 26 16:23:53.846671=20 Booting [/boot/kernel/kernel]... =20 Apr 26 16:23:53.846719 GDB: no debug ports present Apr 26 16:23:54.530540 KDB: debugger backends: ddb Apr 26 16:23:54.530540 KDB: current backend: ddb Apr 26 16:23:54.530540 ---<>--- Apr 26 16:23:54.530540 Table 'FACP' at 0x95ff7000 Apr 26 16:23:54.542628 Table 'UEFI' at 0x95ffd000 Apr 26 16:23:54.542683 Table 'UEFI' at 0x95ffc000 Apr 26 16:23:54.542726 Table 'ASF!' at 0x95ffb000 Apr 26 16:23:54.554635 Table 'ASPT' at 0x95ffa000 Apr 26 16:23:54.554696 Table 'BOOT' at 0x95ff9000 Apr 26 16:23:54.554743 Table 'DBGP' at 0x95ff8000 Apr 26 16:23:54.554792 Table 'HPET' at 0x95ff6000 Apr 26 16:23:54.566627 Table 'APIC' at 0x95ff5000 Apr 26 16:23:54.566689 APIC: Found table at 0x95ff5000 Apr 26 16:23:54.566738 APIC: Using the MADT enumerator. Apr 26 16:23:54.566787 Copyright (c) 1992-2019 The FreeBSD Project. Apr 26 16:23:54.578639 Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 19= 91, 1992, 1993, 1994 Apr 26 16:23:54.578706 The Regents of the University of California. All ri= ghts reserved. Apr 26 16:23:54.590645 FreeBSD is a registered trademark of The FreeBSD Fou= ndation. Apr 26 16:23:54.590710 FreeBSD 13.0-CURRENT 4284b348ee3(HEAD) GENERIC amd64 Apr 26 16:23:54.602637 FreeBSD clang version 8.0.0 (tags/RELEASE_800/final = 356365) (based on LLVM 8.0.0) Apr 26 16:23:54.614600 WARNING: WITNESS option enabled, expect reduced perf= ormance. Apr 26 16:23:54.614665 Table 'FACP' at 0x95ff7000 Apr 26 16:23:54.614715 Table 'UEFI' at 0x95ffd000 Apr 26 16:23:54.614762 Table 'UEFI' at 0x95ffc000 Apr 26 16:23:54.626589 Table 'ASF!' at 0x95ffb000 Apr 26 16:23:54.626643 Table 'ASPT' at 0x95ffa000 Apr 26 16:23:54.626690 Table 'BOOT' at 0x95ff9000 Apr 26 16:23:54.626736 Table 'DBGP' at 0x95ff8000 Apr 26 16:23:54.638647 Table 'HPET' at 0x95ff6000 Apr 26 16:23:54.638729 Table 'APIC' at 0x95ff5000 Apr 26 16:23:54.638779 Table 'MCFG' at 0x95ff4000 Apr 26 16:23:54.638826 Table 'SLIC' at 0x95ff3000 Apr 26 16:23:54.650634 Table 'SSDT' at 0x95fdc000 Apr 26 16:23:54.650695 Table 'SPMI' at 0x95fda000 Apr 26 16:23:54.650743 Table 'SSDT' at 0x95fd9000 Apr 26 16:23:54.650790 Table 'SSDT' at 0x95fd8000 Apr 26 16:23:54.650837 Table 'SSDT' at 0x95fd4000 Apr 26 16:23:54.662635 Table 'SPCR' at 0x95ff2000 Apr 26 16:23:54.662696 Table 'DMAR' at 0x95fd3000 Apr 26 16:23:54.662744 Table 'SSDT' at 0x95fd2000 Apr 26 16:23:54.662791 Table 'FPDT' at 0x95fd1000 Apr 26 16:23:54.674633 Table 'HEST' at 0x95fd0000 Apr 26 16:23:54.674694 Table 'ERST' at 0x95fce000 Apr 26 16:23:54.674742 Table 'BERT' at 0x95fcd000 Apr 26 16:23:54.674789 Table 'EINJ' at 0x95fcc000 Apr 26 16:23:54.674836 ACPI: No SRAT table found Apr 26 16:23:54.686618 PPIM 0: PA=3D0xa0000, VA=3D0xffffffff99a10000, size= =3D0x10000, mode=3D0 Apr 26 16:23:54.722627 pmap: large map 8 PML4 slots (4096 Gb) Apr 26 16:23:54.734614 VT(vga): resolution 640x480 Apr 26 16:23:54.734676 Preloaded elf kernel "/boot/kernel/kernel" at 0xffff= ffff998dd000. Apr 26 16:23:54.746630 Preloaded mfs_root "/mfsroot" at 0xffffffff998e61f0. Apr 26 16:23:54.746696 Table 'FACP' at 0x95ff7000 Apr 26 16:23:54.746745 FACP: Found table at 0x95ff7000 Apr 26 16:23:54.758587 Calibrating TSC clock ... TSC clock: 3092899860 Hz Apr 26 16:23:55.754490 CPU: Intel(R) Xeon(R) CPU E3-1220 v3 @ 3.10GHz (3092= =2E90-MHz K8-class CPU) Apr 26 16:23:55.766650 Origin=3D"GenuineIntel" Id=3D0x306c3 Family=3D0x= 6 Model=3D0x3c Stepping=3D3 Apr 26 16:23:55.778636 Features=3D0xbfebfbff Apr 26 16:23:55.790589 Features2=3D0x7ffafbff Apr 26 16:23:55.802661 AMD Features=3D0x2c100800 Apr 26 16:23:55.814629 AMD Features2=3D0x21 Apr 26 16:23:55.814690 Structured Extended Features=3D0x2fbb Apr 26 16:23:55.826639 XSAVE Features=3D0x1 Apr 26 16:23:55.826700 VT-x: Basic Features=3D0xda0400 Apr 26 16:23:55.826753 Pin-Based Controls=3D0x7f Apr 26 16:23:55.838605 Primary Processor Controls=3D0xfff9fffe Apr 26 16:23:55.850662 Secondary Processor Controls=3D0x7cff Apr 26 16:23:55.862645 Exit Controls=3D0xda0400 Apr 26 16:23:55.874646 Entry Controls=3D0xda0400 Apr 26 16:23:55.874708 EPT Features=3D0x6334141 Apr 26 16:23:55.886587 VPID Features=3D0xf01 Apr 26 16:23:55.886598 TSC: P-state invariant, performance statistics Apr 26 16:23:55.898658 Data TLB: 2 MByte or 4 MByte pages, 4-way set associ= ative, 32 entries and a separate array with 1 GByte pages, 4-way set associ= ative, 4 entries Apr 26 16:23:55.910639 Data TLB: 4 KB pages, 4-way set associative, 64 entr= ies Apr 26 16:23:55.910704 Instruction TLB: 2M/4M pages, fully associative, 8 e= ntries Apr 26 16:23:55.922634 Instruction TLB: 4KByte pages, 8-way set associative= , 128 entries Apr 26 16:23:55.922701 64-Byte prefetching Apr 26 16:23:55.922749 Shared 2nd-Level TLB: 4 KByte/2MByte pages, 8-way as= sociative, 1024 entries Apr 26 16:23:55.934645 L2 cache: 256 kbytes, 8-way associative, 64 bytes/li= ne Apr 26 16:23:55.946629 real memory =3D 8589934592 (8192 MB) Apr 26 16:23:55.946692 Physical memory chunk(s): Apr 26 16:23:55.946742 0x0000000000010000 - 0x000000000009cfff, 577536 byte= s (141 pages) Apr 26 16:23:55.958641 0x0000000000103000 - 0x00000000001fffff, 1036288 byt= es (253 pages) Apr 26 16:23:55.958736 0x0000000019a00000 - 0x000000008d6befff, 1942745088 = bytes (474303 pages) Apr 26 16:23:55.970634 0x0000000095fff000 - 0x0000000095ffffff, 4096 bytes = (1 pages) Apr 26 16:23:55.970700 0x0000000100000000 - 0x0000000250b8efff, 5649264640 = bytes (1379215 pages) Apr 26 16:23:55.982625 avail memory =3D 7548768256 (7199 MB) Apr 26 16:23:55.994570 Table 'FACP' at 0x95ff7000 Apr 26 16:23:56.006636 Table 'UEFI' at 0x95ffd000 Apr 26 16:23:56.006696 Table 'UEFI' at 0x95ffc000 Apr 26 16:23:56.006743 Table 'ASF!' at 0x95ffb000 Apr 26 16:23:56.006790 Table 'ASPT' at 0x95ffa000 Apr 26 16:23:56.018651 Table 'BOOT' at 0x95ff9000 Apr 26 16:23:56.018712 Table 'DBGP' at 0x95ff8000 Apr 26 16:23:56.018760 Table 'HPET' at 0x95ff6000 Apr 26 16:23:56.018807 Table 'APIC' at 0x95ff5000 Apr 26 16:23:56.018854 Table 'MCFG' at 0x95ff4000 Apr 26 16:23:56.030634 Table 'SLIC' at 0x95ff3000 Apr 26 16:23:56.030694 Table 'SSDT' at 0x95fdc000 Apr 26 16:23:56.030741 Table 'SPMI' at 0x95fda000 Apr 26 16:23:56.030788 Table 'SSDT' at 0x95fd9000 Apr 26 16:23:56.042642 Table 'SSDT' at 0x95fd8000 Apr 26 16:23:56.042702 Table 'SSDT' at 0x95fd4000 Apr 26 16:23:56.042750 Table 'SPCR' at 0x95ff2000 Apr 26 16:23:56.042797 Table 'DMAR' at 0x95fd3000 Apr 26 16:23:56.054632 DMAR: Found table at 0x95fd3000 Apr 26 16:23:56.054694 MADT: Found CPU APIC ID 0 ACPI ID 1: enabled Apr 26 16:23:56.054746 SMP: Added CPU 0 (AP) Apr 26 16:23:56.054793 MADT: Found CPU APIC ID 2 ACPI ID 2: enabled Apr 26 16:23:56.066632 SMP: Added CPU 2 (AP) Apr 26 16:23:56.066691 MADT: Found CPU APIC ID 4 ACPI ID 3: enabled Apr 26 16:23:56.066742 SMP: Added CPU 4 (AP) Apr 26 16:23:56.066788 MADT: Found CPU APIC ID 6 ACPI ID 4: enabled Apr 26 16:23:56.078725 SMP: Added CPU 6 (AP) Apr 26 16:23:56.078760 MADT: Found CPU APIC ID 0 ACPI ID 5: disabled Apr 26 16:23:56.078817 MADT: Found CPU APIC ID 0 ACPI ID 6: disabled Apr 26 16:23:56.090547 MADT: Found CPU APIC ID 0 ACPI ID 7: disabled Apr 26 16:23:56.090547 MADT: Found CPU APIC ID 0 ACPI ID 8: disabled Apr 26 16:23:56.102520 Event timer "LAPIC" quality 600 Apr 26 16:23:56.102520 ACPI APIC Table: Apr 26 16:23:56.102520 Package ID shift: 4 Apr 26 16:23:56.102520 L3 cache ID shift: 4 Apr 26 16:23:56.102520 L2 cache ID shift: 1 Apr 26 16:23:56.114479 L1 cache ID shift: 1 Apr 26 16:23:56.114479 Core ID shift: 1 Apr 26 16:23:56.114479 INTR: Adding local APIC 2 as a target Apr 26 16:23:56.150539 INTR: Adding local APIC 4 as a target Apr 26 16:23:56.150539 INTR: Adding local APIC 6 as a target Apr 26 16:23:56.150539 FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs Apr 26 16:23:56.162543 FreeBSD/SMP: 1 package(s) x 4 core(s) Apr 26 16:23:56.162543 Package HW ID =3D 0 Apr 26 16:23:56.162543 Core HW ID =3D 0 Apr 26 16:23:56.174555 CPU0 (BSP): APIC ID: 0 Apr 26 16:23:56.174555 Core HW ID =3D 1 Apr 26 16:23:56.174555 CPU1 (AP): APIC ID: 2 Apr 26 16:23:56.174555 Core HW ID =3D 2 Apr 26 16:23:56.174555 CPU2 (AP): APIC ID: 4 Apr 26 16:23:56.174555 Core HW ID =3D 3 Apr 26 16:23:56.186544 CPU3 (AP): APIC ID: 6 Apr 26 16:23:56.186544 APIC: CPU 0 has ACPI ID 1 Apr 26 16:23:56.186544 APIC: CPU 1 has ACPI ID 2 Apr 26 16:23:56.186544 APIC: CPU 2 has ACPI ID 3 Apr 26 16:23:56.186544 APIC: CPU 3 has ACPI ID 4 Apr 26 16:23:56.198550 x86bios: IVT 0x000000-0x0004ff at 0xfffff80000000000 Apr 26 16:23:56.198550 x86bios: SSEG 0x09c000-0x09cfff at 0xfffffe0002eb1000 Apr 26 16:23:56.210547 x86bios: EBDA 0x09f000-0x09ffff at 0xfffff8000009f000 Apr 26 16:23:56.210547 x86bios: ROM 0x0a0000-0x0fefff at 0xfffff800000a0000 Apr 26 16:23:56.210547 lapic0: CMCI unmasked Apr 26 16:23:56.222548 Pentium Pro MTRR support enabled Apr 26 16:23:56.222611 __stack_chk_init: WARNING: Initializing stack protec= tion with non-random cookies! Apr 26 16:23:56.234649 __stack_chk_init: WARNING: This severely limits the = benefit of -fstack-protector! Apr 26 16:23:56.234725 VIMAGE (virtualized network stack) enabled Apr 26 16:23:56.246632 ULE: setup cpu 0 Apr 26 16:23:56.246709 ULE: setup cpu 1 Apr 26 16:23:56.246757 ULE: setup cpu 2 Apr 26 16:23:56.246803 ULE: setup cpu 3 Apr 26 16:23:56.246850 ACPI: RSDP 0x00000000000FE020 000024 (v02 DELL ) Apr 26 16:23:56.258620 ACPI: XSDT 0x0000000095FCF188 0000E4 (v01 DELL PE_= SC3 00000001 01000013) Apr 26 16:23:56.258689 ACPI: FACP 0x0000000095FF7000 00010C (v05 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.270640 ACPI: DSDT 0x0000000095FDF000 012335 (v01 DELL PE_= SC3 00000000 DELL 00040000) Apr 26 16:23:56.282635 ACPI: FACS 0x0000000095FBD000 000040 Apr 26 16:23:56.282698 ACPI: UEFI 0x0000000095FFD000 000236 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.294635 ACPI: UEFI 0x0000000095FFC000 000042 (v01 DELL PE_= SC3 00000000 DELL 00040000) Apr 26 16:23:56.294705 ACPI: ASF! 0x0000000095FFB000 0000A5 (v32 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.306597 ACPI: ASPT 0x0000000095FFA000 000034 (v07 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.318581 ACPI: BOOT 0x0000000095FF9000 000028 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.318581 ACPI: DBGP 0x0000000095FF8000 000034 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.330620 ACPI: HPET 0x0000000095FF6000 000038 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.342636 ACPI: APIC 0x0000000095FF5000 000092 (v03 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.342704 ACPI: MCFG 0x0000000095FF4000 00003C (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.354639 ACPI: SLIC 0x0000000095FF3000 000176 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.366687 ACPI: SSDT 0x0000000095FDC000 002028 (v01 DELL PE_= SC3 00001000 DELL 00040000) Apr 26 16:23:56.366756 ACPI: SPMI 0x0000000095FDA000 000040 (v05 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.378647 ACPI: SSDT 0x0000000095FD9000 000533 (v01 DELL PE_= SC3 00003000 DELL 00040000) Apr 26 16:23:56.390638 ACPI: SSDT 0x0000000095FD8000 000ACE (v01 DELL PE_= SC3 00003000 DELL 00040000) Apr 26 16:23:56.390709 ACPI: SSDT 0x0000000095FD4000 003492 (v01 DELL PE_= SC3 00003000 DELL 00040000) Apr 26 16:23:56.402647 ACPI: SPCR 0x0000000095FF2000 000050 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.414633 ACPI: DMAR 0x0000000095FD3000 000080 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.414701 ACPI: SSDT 0x0000000095FD2000 000514 (v01 DELL PE_= SC3 00001000 DELL 00040000) Apr 26 16:23:56.426646 ACPI: FPDT 0x0000000095FD1000 000044 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.438643 ACPI: HEST 0x0000000095FD0000 0000A8 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.438711 ACPI: ERST 0x0000000095FCE000 000230 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.450651 ACPI: BERT 0x0000000095FCD000 000030 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.462631 ACPI: EINJ 0x0000000095FCC000 000150 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.462700 MADT: Found IO APIC ID 2, Interrupt 0 at 0xfec00000 Apr 26 16:23:56.474535 ioapic0: ver 0x20 maxredir 0x17 Apr 26 16:23:56.474568 ioapic0: Routing external 8259A's -> intpin 0 Apr 26 16:23:56.474596 MADT: Interrupt override: source 0, irq 2 Apr 26 16:23:56.486634 ioapic0: Routing IRQ 0 -> intpin 2 Apr 26 16:23:56.486696 MADT: Interrupt override: source 9, irq 9 Apr 26 16:23:56.486748 ioapic0: intpin 9 trigger: level Apr 26 16:23:56.498651 lapic: Routing NMI -> LINT1 Apr 26 16:23:56.498713 lapic: LINT1 trigger: edge Apr 26 16:23:56.498761 lapic: LINT1 polarity: high Apr 26 16:23:56.498809 ioapic0 irqs 0-23 on motherboard Apr 26 16:23:56.510592 lapic: Divisor 2, Frequency 49885486 Hz Apr 26 16:23:57.506602 lapic: deadline tsc mode, Frequency 3092899860 Hz Apr 26 16:23:57.518669 cpu0 BSP: Apr 26 16:23:57.518727 ID: 0x00000000 VER: 0x01060015 LDR: 0x0000000= 1 DFR: 0x00000000 x2APIC: 1 Apr 26 16:23:57.530597 lint0: 0x00010700 lint1: 0x00000400 TPR: 0x0000000= 0 SVR: 0x000011ff Apr 26 16:23:57.530611 timer: 0x000100ef therm: 0x00010000 err: 0x000000f= 0 pmc: 0x00010400 Apr 26 16:23:57.542651 cmci: 0x000000f2 Apr 26 16:23:57.542714 lapic4: CMCI unmasked Apr 26 16:23:57.542762 SMP: AP CPU #2 Launched! Apr 26 16:23:57.542809 cpu2 AP: Apr 26 16:23:57.554629 ID: 0x00000004 VER: 0x01060015 LDR: 0x0000001= 0 DFR: 0x00000000 x2APIC: 1 Apr 26 16:23:57.554698 lint0: 0x00010700 lint1: 0x00000400 TPR: 0x0000000= 0 SVR: 0x000011ff Apr 26 16:23:57.566634 timer: 0x000100ef therm: 0x00010000 err: 0x000000f= 0 pmc: 0x00010400 Apr 26 16:23:57.566701 cmci: 0x000000f2 Apr 26 16:23:57.566748 lapic6: CMCI unmasked Apr 26 16:23:57.578636 SMP: AP CPU #3 Launched! Apr 26 16:23:57.578697 cpu3 AP: Apr 26 16:23:57.578741 ID: 0x00000006 VER: 0x01060015 LDR: 0x0000004= 0 DFR: 0x00000000 x2APIC: 1 Apr 26 16:23:57.590638 lint0: 0x00010700 lint1: 0x00000400 TPR: 0x0000000= 0 SVR: 0x000011ff Apr 26 16:23:57.590703 timer: 0x000100ef therm: 0x00010000 err: 0x000000f= 0 pmc: 0x00010400 Apr 26 16:23:57.602644 cmci: 0x000000f2 Apr 26 16:23:57.602702 lapic2: CMCI unmasked Apr 26 16:23:57.602749 SMP: AP CPU #1 Launched! Apr 26 16:23:57.602798 cpu1 AP: Apr 26 16:23:57.614625 ID: 0x00000002 VER: 0x01060015 LDR: 0x0000000= 4 DFR: 0x00000000 x2APIC: 1 Apr 26 16:23:57.614693 lint0: 0x00010700 lint1: 0x00000400 TPR: 0x0000000= 0 SVR: 0x000011ff Apr 26 16:23:57.626628 timer: 0x000100ef therm: 0x00010000 err: 0x000000f= 0 pmc: 0x00010400 Apr 26 16:23:57.626694 cmci: 0x000000f2 Apr 26 16:23:57.638631 SMP: passed TSC synchronization test Apr 26 16:23:57.638694 TSC timecounter discards lower 1 bit(s) Apr 26 16:23:57.638744 Timecounter "TSC-low" frequency 1546449930 Hz qualit= y 1000 Apr 26 16:23:57.650643 snd_md0: Preload)e u=3D0x00ff800f0 [512] d=3D0743070= 07cbyt e[32at c=3D0x00000f3f82 [10248] Apr 26 16:23:57.650713 feeder_register: snd_unit=3D-1 snd_maxautovchans=3D1= 6 latency=3D5 feeder_rate_min=3D1 feeder_rate_max=3D2016000 feeder_rate_rou= nd=3D25 Apr 26 16:23:57.662653 panic: mtx_lock() of spin mutex (null) @ /usr/home/o= sstest/build.135317.build-amd64-freebsd/freebsd/sys/kern/subr_bus.c:620 Apr 26 16:23:57.674650 cpuid =3D 2 Apr 26 16:23:57.686653 time =3D 1 Apr 26 16:23:57.686720 KDB: stack backtrace: Apr 26 16:23:57.686797 db_trace_self_wrapper() at db_trace_self_wrapper+0x2= b/frame 0xfffffe003abe8710 Apr 26 16:23:57.686879 vpanic() at vpanic+0x19d/frame 0xfffffe003abe8760 Apr 26 16:23:57.698637 panic() at panic+0x43/frame 0xfffffe003abe87c0 Apr 26 16:23:57.698700 __mtx_lock_flags() at __mtx_lock_flags+0x145/frame 0= xfffffe003abe8810 Apr 26 16:23:57.710640 devctl_queue_data_f() at devctl_queue_data_f+0x6a/fr= ame 0xfffffe003abe8840 Apr 26 16:23:57.722625 g_dev_taste() at g_dev_taste+0x463/frame 0xfffffe003= abe8a00 Apr 26 16:23:57.722690 g_load_class() at g_load_class+0x1bc/frame 0xfffffe0= 03abe8a30 Apr 26 16:23:57.734638 g_run_events() at g_run_events+0x197/frame 0xfffffe0= 03abe8a70 Apr 26 16:23:57.734704 fork_exit() at fork_exit+0x84/frame 0xfffffe003abe8a= b0 Apr 26 16:23:57.746655 fork_trampoline() at fork_trampoline+0xe/frame 0xfff= ffe003abe8ab0 Apr 26 16:23:57.746721 --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- Apr 26 16:23:57.758797 KDB: enter: panic Apr 26 16:23:57.758913 [ thread pid 13 tid 100029 ] Apr 26 16:23:57.758943 Stopped at kdb_enter+0x3b: movq $0,kdb_why Apr 26 16:23:57.770557 db>=20 The automatic bisector has pointed as this commit as the culprit, you can see the full bisection at: https://lists.xenproject.org/archives/html/xen-devel/2019-04/msg02061.html And an example of a failed test at: https://lists.xenproject.org/archives/html/xen-devel/2019-05/msg00104.html http://logs.test-lab.xenproject.org/osstest/logs/135458/ Thanks, Roger. From owner-svn-src-all@freebsd.org Thu May 2 11:58:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27CD61593233; Thu, 2 May 2019 11:58:55 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B84C28B962; Thu, 2 May 2019 11:58:53 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id MAMKhPrgLldkPMAMLhs0lY; Thu, 02 May 2019 05:58:45 -0600 X-Authority-Analysis: v=2.3 cv=Ko4zJleN c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=E5NmQfObTbMA:10 a=baVkBnF-AAAA:8 a=6I5d2MoRAAAA:8 a=cWRNjhkoAAAA:8 a=YxBL1-UpAAAA:8 a=lYlWJ9YPIbE2u9GGOegA:9 a=mw87X0hgnAeoXYiz:21 a=CjuIK1q_8ugA:10 a=U0-lpeXeMuwA:10 a=LLpjHUk9RYsA:10 a=8T6hGYADbIqAPJwOXx51:22 a=IjZwj45LgO3ly-622nXo:22 a=sVa6W5Aao32NNC1mekxh:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id C3E5BC8F; Thu, 2 May 2019 04:58:39 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x42BwdAH006868; Thu, 2 May 2019 04:58:39 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x42BwduG006865; Thu, 2 May 2019 04:58:39 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201905021158.x42BwduG006865@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Roger Pau =?utf-8?B?TW9ubsOp?= cc: Kyle Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346670 - head/sys/net In-Reply-To: Message from Roger Pau =?utf-8?B?TW9ubsOp?= of "Thu, 02 May 2019 13:11:06 +0200." <20190502111106.pfosaq73kgo6g33j@Air-de-Roger.citrite.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 02 May 2019 04:58:39 -0700 X-CMAE-Envelope: MS4wfDbPJrLPJdF+4zGT3z65C3qSY6eYeSxawPewXN67MYWOx64zU2g0PaotlJqs+H9K5y2/5AW3/+BjHUo7rslZuFOnX3bYg4ne8a98qeKRLiTnXwXCVo7D tXSGh8fw01eil9kVRPnp27BhJp9LokSz+DMYWMXx2hO23FUu3xoQM/B9Rb9uc2mGiXXl0WW86lRs+4S3+q3p+fjtWoHIiojdw1ZbSnnrFwBLPvZ3Eqp/BEhQ PEoBO9BJrJWeviesReYDifCSAPmzv8dQWwNn+UQddSmM1kiGp1yB11HcFkWiE+/2juSbOoQk9VkNld2knsETd1p7pFBQzpF9giJUKdVsE+E= X-Rspamd-Queue-Id: B84C28B962 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-5.18 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; IP_SCORE(-2.57)[ip: (-7.08), ipnet: 64.59.128.0/20(-3.21), asn: 6327(-2.46), country: CA(-0.09)]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.90)[-0.901,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[13.134.59.64.list.dnswl.org : 127.0.5.1] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 11:58:55 -0000 In message <20190502111106.pfosaq73kgo6g33j@Air-de-Roger.citrite.net>, Roger Pa u =?utf-8?B?TW9ubsOp?= writes: > On Thu, Apr 25, 2019 at 12:44:08PM +0000, Kyle Evans wrote: > > Author: kevans > > Date: Thu Apr 25 12:44:08 2019 > > New Revision: 346670 > > URL: https://svnweb.freebsd.org/changeset/base/346670 > > > > Log: > > tun/tap: close race between destroy/ioctl handler > > > > It seems that there should be a better way to handle this, but this seems > to > > be the more common approach and it should likely get replaced in all of t > he > > places it happens... Basically, thread 1 is in the process of destroying > the > > tun/tap while thread 2 is executing one of the ioctls that requires the > > tun/tap mutex and the mutex is destroyed before the ioctl handler can > > acquire it. > > > > This is only one of the races described/found in PR 233955. > > > > PR: 233955 > > Reviewed by: ae > > MFC after: 2 weeks > > Differential Revision: https://reviews.freebsd.org/D20027 > > This has caused a regression when booting. I reliably get the > following panic when booting on several different boxes: > > Apr 26 16:23:57.662653 panic: mtx_lock() of spin mutex (null) @ /usr/home/oss > test/build.135317.build-amd64-freebsd/freebsd/sys/kern/subr_bus.c:620 > Apr 26 16:23:57.674650 cpuid = 2 > Apr 26 16:23:57.686653 time = 1 > Apr 26 16:23:57.686720 KDB: stack backtrace: > Apr 26 16:23:57.686797 db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/ > frame 0xfffffe003abe8710 > Apr 26 16:23:57.686879 vpanic() at vpanic+0x19d/frame 0xfffffe003abe8760 > Apr 26 16:23:57.698637 panic() at panic+0x43/frame 0xfffffe003abe87c0 > Apr 26 16:23:57.698700 __mtx_lock_flags() at __mtx_lock_flags+0x145/frame 0xf > ffffe003abe8810 > Apr 26 16:23:57.710640 devctl_queue_data_f() at devctl_queue_data_f+0x6a/fram > e 0xfffffe003abe8840 > Apr 26 16:23:57.722625 g_dev_taste() at g_dev_taste+0x463/frame 0xfffffe003ab > e8a00 > Apr 26 16:23:57.722690 g_load_class() at g_load_class+0x1bc/frame 0xfffffe003 > abe8a30 > Apr 26 16:23:57.734638 g_run_events() at g_run_events+0x197/frame 0xfffffe003 > abe8a70 > Apr 26 16:23:57.734704 fork_exit() at fork_exit+0x84/frame 0xfffffe003abe8ab0 > Apr 26 16:23:57.746655 fork_trampoline() at fork_trampoline+0xe/frame 0xfffff > e003abe8ab0 > Apr 26 16:23:57.746721 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- > Apr 26 16:23:57.758797 KDB: enter: panic > Apr 26 16:23:57.758913 [ thread pid 13 tid 100029 ] > Apr 26 16:23:57.758943 Stopped at kdb_enter+0x3b: movq $0,kdb_why > Apr 26 16:23:57.770557 db> > > The full serial log of the host booting: > > e820: 0000000095fff000 0`0000000/boot/config: -hn -S115200/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\Consoles: s > erial port > Apr 26 16:23:50.318505 BIOS drive C: is disk0 > Apr 26 16:23:50.318505 BIOS drive D: is disk1 > Apr 26 16:23:50.330486 |/BIOS 632kB/2316028kB available memory > Apr 26 16:23:50.366512 > Apr 26 16:23:50.366512 FreeBSD/x86 bootstrap loader, Revision 1.1 > Apr 26 16:23:50.366512 -\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|Loading /boot/defaults/loader.conf > Apr 26 16:23:50.414528 Loading /boot/device.hints > Apr 26 16:23:50.426510 /-\|/-Loading /boot/loader.conf > Apr 26 16:23:50.426510 \|/-Loading /boot/loader.conf.local > Apr 26 16:23:50.438526 \|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\Loading kernel... > Apr 26 16:23:50.450532 |/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|//boot/kernel/kernel text=0x16e4c29 -\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|data=0x1d65a8+0x819 > 948 /-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-syms=[0x8+0x183c48\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/+0x8+0x1a1479-\|] > Apr 26 16:23:51.626609 Loading configured modules... > Apr 26 16:23:51.638619 /-\|/-\|/-\|/-\|can't find '/boot/entropy' > Apr 26 16:23:51.638679 /-\|/-\|/-\|/-\/mfsroot |/-\|/-\|/-\|/-8000000 2 \|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-! \|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/- \|/-\|/-\|/-size=0x171c80 > 00 > Apr 26 16:23:53.846620 > Apr 26 16:23:53.846671 > Booting [/boot/kernel/kernel]... > Apr 26 16:23:53.846719 GDB: no debug ports present > Apr 26 16:23:54.530540 KDB: debugger backends: ddb > Apr 26 16:23:54.530540 KDB: current backend: ddb > Apr 26 16:23:54.530540 ---<>--- > Apr 26 16:23:54.530540 Table 'FACP' at 0x95ff7000 > Apr 26 16:23:54.542628 Table 'UEFI' at 0x95ffd000 > Apr 26 16:23:54.542683 Table 'UEFI' at 0x95ffc000 > Apr 26 16:23:54.542726 Table 'ASF!' at 0x95ffb000 > Apr 26 16:23:54.554635 Table 'ASPT' at 0x95ffa000 > Apr 26 16:23:54.554696 Table 'BOOT' at 0x95ff9000 > Apr 26 16:23:54.554743 Table 'DBGP' at 0x95ff8000 > Apr 26 16:23:54.554792 Table 'HPET' at 0x95ff6000 > Apr 26 16:23:54.566627 Table 'APIC' at 0x95ff5000 > Apr 26 16:23:54.566689 APIC: Found table at 0x95ff5000 > Apr 26 16:23:54.566738 APIC: Using the MADT enumerator. > Apr 26 16:23:54.566787 Copyright (c) 1992-2019 The FreeBSD Project. > Apr 26 16:23:54.578639 Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991 > , 1992, 1993, 1994 > Apr 26 16:23:54.578706 The Regents of the University of California. Al > l rights reserved. > Apr 26 16:23:54.590645 FreeBSD is a registered trademark of The FreeBSD Found > ation. > Apr 26 16:23:54.590710 FreeBSD 13.0-CURRENT 4284b348ee3(HEAD) GENERIC amd64 > Apr 26 16:23:54.602637 FreeBSD clang version 8.0.0 (tags/RELEASE_800/final 35 > 6365) (based on LLVM 8.0.0) > Apr 26 16:23:54.614600 WARNING: WITNESS option enabled, expect reduced perfor > mance. > Apr 26 16:23:54.614665 Table 'FACP' at 0x95ff7000 > Apr 26 16:23:54.614715 Table 'UEFI' at 0x95ffd000 > Apr 26 16:23:54.614762 Table 'UEFI' at 0x95ffc000 > Apr 26 16:23:54.626589 Table 'ASF!' at 0x95ffb000 > Apr 26 16:23:54.626643 Table 'ASPT' at 0x95ffa000 > Apr 26 16:23:54.626690 Table 'BOOT' at 0x95ff9000 > Apr 26 16:23:54.626736 Table 'DBGP' at 0x95ff8000 > Apr 26 16:23:54.638647 Table 'HPET' at 0x95ff6000 > Apr 26 16:23:54.638729 Table 'APIC' at 0x95ff5000 > Apr 26 16:23:54.638779 Table 'MCFG' at 0x95ff4000 > Apr 26 16:23:54.638826 Table 'SLIC' at 0x95ff3000 > Apr 26 16:23:54.650634 Table 'SSDT' at 0x95fdc000 > Apr 26 16:23:54.650695 Table 'SPMI' at 0x95fda000 > Apr 26 16:23:54.650743 Table 'SSDT' at 0x95fd9000 > Apr 26 16:23:54.650790 Table 'SSDT' at 0x95fd8000 > Apr 26 16:23:54.650837 Table 'SSDT' at 0x95fd4000 > Apr 26 16:23:54.662635 Table 'SPCR' at 0x95ff2000 > Apr 26 16:23:54.662696 Table 'DMAR' at 0x95fd3000 > Apr 26 16:23:54.662744 Table 'SSDT' at 0x95fd2000 > Apr 26 16:23:54.662791 Table 'FPDT' at 0x95fd1000 > Apr 26 16:23:54.674633 Table 'HEST' at 0x95fd0000 > Apr 26 16:23:54.674694 Table 'ERST' at 0x95fce000 > Apr 26 16:23:54.674742 Table 'BERT' at 0x95fcd000 > Apr 26 16:23:54.674789 Table 'EINJ' at 0x95fcc000 > Apr 26 16:23:54.674836 ACPI: No SRAT table found > Apr 26 16:23:54.686618 PPIM 0: PA=0xa0000, VA=0xffffffff99a10000, size=0x1000 > 0, mode=0 > Apr 26 16:23:54.722627 pmap: large map 8 PML4 slots (4096 Gb) > Apr 26 16:23:54.734614 VT(vga): resolution 640x480 > Apr 26 16:23:54.734676 Preloaded elf kernel "/boot/kernel/kernel" at 0xffffff > ff998dd000. > Apr 26 16:23:54.746630 Preloaded mfs_root "/mfsroot" at 0xffffffff998e61f0. > Apr 26 16:23:54.746696 Table 'FACP' at 0x95ff7000 > Apr 26 16:23:54.746745 FACP: Found table at 0x95ff7000 > Apr 26 16:23:54.758587 Calibrating TSC clock ... TSC clock: 3092899860 Hz > Apr 26 16:23:55.754490 CPU: Intel(R) Xeon(R) CPU E3-1220 v3 @ 3.10GHz (3092.9 > 0-MHz K8-class CPU) > Apr 26 16:23:55.766650 Origin="GenuineIntel" Id=0x306c3 Family=0x6 Model > =0x3c Stepping=3 > Apr 26 16:23:55.778636 Features=0xbfebfbff X8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS > ,HTT,TM,PBE> > Apr 26 16:23:55.790589 Features2=0x7ffafbff L,VMX,SMX,EST,TM2,SSSE3,SDBG,FMA,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOV > BE,POPCNT,TSCDLT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND> > Apr 26 16:23:55.802661 AMD Features=0x2c100800 > > Apr 26 16:23:55.814629 AMD Features2=0x21 > Apr 26 16:23:55.814690 Structured Extended Features=0x2fbb BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,NFPUSG> > Apr 26 16:23:55.826639 XSAVE Features=0x1 > Apr 26 16:23:55.826700 VT-x: Basic Features=0xda0400 > Apr 26 16:23:55.826753 Pin-Based Controls=0x7f > > Apr 26 16:23:55.838605 Primary Processor Controls=0xfff9fffe SCOff,HLT,INVLPG,MWAIT,RDPMC,RDTSC,CR3-LD,CR3-ST,CR8-LD,CR8-ST,TPR,NMIWIN,MOV > -DR,IO,IOmap,MTF,MSRmap,MONITOR,PAUSE> > Apr 26 16:23:55.850662 Secondary Processor Controls=0x7cff T,RDTSCP,x2APIC,VPID,WBINVD,UG,PAUSE-loop,RDRAND,INVPCID,VMFUNC,VMCS> > Apr 26 16:23:55.862645 Exit Controls=0xda0400 > Apr 26 16:23:55.874646 Entry Controls=0xda0400 > Apr 26 16:23:55.874708 EPT Features=0x6334141 PT,AD,single,all> > Apr 26 16:23:55.886587 VPID Features=0xf01 all,single-globals> > Apr 26 16:23:55.886598 TSC: P-state invariant, performance statistics > Apr 26 16:23:55.898658 Data TLB: 2 MByte or 4 MByte pages, 4-way set associat > ive, 32 entries and a separate array with 1 GByte pages, 4-way set associativ > e, 4 entries > Apr 26 16:23:55.910639 Data TLB: 4 KB pages, 4-way set associative, 64 entrie > s > Apr 26 16:23:55.910704 Instruction TLB: 2M/4M pages, fully associative, 8 ent > ries > Apr 26 16:23:55.922634 Instruction TLB: 4KByte pages, 8-way set associative, > 128 entries > Apr 26 16:23:55.922701 64-Byte prefetching > Apr 26 16:23:55.922749 Shared 2nd-Level TLB: 4 KByte/2MByte pages, 8-way asso > ciative, 1024 entries > Apr 26 16:23:55.934645 L2 cache: 256 kbytes, 8-way associative, 64 bytes/line > Apr 26 16:23:55.946629 real memory = 8589934592 (8192 MB) > Apr 26 16:23:55.946692 Physical memory chunk(s): > Apr 26 16:23:55.946742 0x0000000000010000 - 0x000000000009cfff, 577536 bytes > (141 pages) > Apr 26 16:23:55.958641 0x0000000000103000 - 0x00000000001fffff, 1036288 bytes > (253 pages) > Apr 26 16:23:55.958736 0x0000000019a00000 - 0x000000008d6befff, 1942745088 by > tes (474303 pages) > Apr 26 16:23:55.970634 0x0000000095fff000 - 0x0000000095ffffff, 4096 bytes (1 > pages) > Apr 26 16:23:55.970700 0x0000000100000000 - 0x0000000250b8efff, 5649264640 by > tes (1379215 pages) > Apr 26 16:23:55.982625 avail memory = 7548768256 (7199 MB) > Apr 26 16:23:55.994570 Table 'FACP' at 0x95ff7000 > Apr 26 16:23:56.006636 Table 'UEFI' at 0x95ffd000 > Apr 26 16:23:56.006696 Table 'UEFI' at 0x95ffc000 > Apr 26 16:23:56.006743 Table 'ASF!' at 0x95ffb000 > Apr 26 16:23:56.006790 Table 'ASPT' at 0x95ffa000 > Apr 26 16:23:56.018651 Table 'BOOT' at 0x95ff9000 > Apr 26 16:23:56.018712 Table 'DBGP' at 0x95ff8000 > Apr 26 16:23:56.018760 Table 'HPET' at 0x95ff6000 > Apr 26 16:23:56.018807 Table 'APIC' at 0x95ff5000 > Apr 26 16:23:56.018854 Table 'MCFG' at 0x95ff4000 > Apr 26 16:23:56.030634 Table 'SLIC' at 0x95ff3000 > Apr 26 16:23:56.030694 Table 'SSDT' at 0x95fdc000 > Apr 26 16:23:56.030741 Table 'SPMI' at 0x95fda000 > Apr 26 16:23:56.030788 Table 'SSDT' at 0x95fd9000 > Apr 26 16:23:56.042642 Table 'SSDT' at 0x95fd8000 > Apr 26 16:23:56.042702 Table 'SSDT' at 0x95fd4000 > Apr 26 16:23:56.042750 Table 'SPCR' at 0x95ff2000 > Apr 26 16:23:56.042797 Table 'DMAR' at 0x95fd3000 > Apr 26 16:23:56.054632 DMAR: Found table at 0x95fd3000 > Apr 26 16:23:56.054694 MADT: Found CPU APIC ID 0 ACPI ID 1: enabled > Apr 26 16:23:56.054746 SMP: Added CPU 0 (AP) > Apr 26 16:23:56.054793 MADT: Found CPU APIC ID 2 ACPI ID 2: enabled > Apr 26 16:23:56.066632 SMP: Added CPU 2 (AP) > Apr 26 16:23:56.066691 MADT: Found CPU APIC ID 4 ACPI ID 3: enabled > Apr 26 16:23:56.066742 SMP: Added CPU 4 (AP) > Apr 26 16:23:56.066788 MADT: Found CPU APIC ID 6 ACPI ID 4: enabled > Apr 26 16:23:56.078725 SMP: Added CPU 6 (AP) > Apr 26 16:23:56.078760 MADT: Found CPU APIC ID 0 ACPI ID 5: disabled > Apr 26 16:23:56.078817 MADT: Found CPU APIC ID 0 ACPI ID 6: disabled > Apr 26 16:23:56.090547 MADT: Found CPU APIC ID 0 ACPI ID 7: disabled > Apr 26 16:23:56.090547 MADT: Found CPU APIC ID 0 ACPI ID 8: disabled > Apr 26 16:23:56.102520 Event timer "LAPIC" quality 600 > Apr 26 16:23:56.102520 ACPI APIC Table: > Apr 26 16:23:56.102520 Package ID shift: 4 > Apr 26 16:23:56.102520 L3 cache ID shift: 4 > Apr 26 16:23:56.102520 L2 cache ID shift: 1 > Apr 26 16:23:56.114479 L1 cache ID shift: 1 > Apr 26 16:23:56.114479 Core ID shift: 1 > Apr 26 16:23:56.114479 INTR: Adding local APIC 2 as a target > Apr 26 16:23:56.150539 INTR: Adding local APIC 4 as a target > Apr 26 16:23:56.150539 INTR: Adding local APIC 6 as a target > Apr 26 16:23:56.150539 FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs > Apr 26 16:23:56.162543 FreeBSD/SMP: 1 package(s) x 4 core(s) > Apr 26 16:23:56.162543 Package HW ID = 0 > Apr 26 16:23:56.162543 Core HW ID = 0 > Apr 26 16:23:56.174555 CPU0 (BSP): APIC ID: 0 > Apr 26 16:23:56.174555 Core HW ID = 1 > Apr 26 16:23:56.174555 CPU1 (AP): APIC ID: 2 > Apr 26 16:23:56.174555 Core HW ID = 2 > Apr 26 16:23:56.174555 CPU2 (AP): APIC ID: 4 > Apr 26 16:23:56.174555 Core HW ID = 3 > Apr 26 16:23:56.186544 CPU3 (AP): APIC ID: 6 > Apr 26 16:23:56.186544 APIC: CPU 0 has ACPI ID 1 > Apr 26 16:23:56.186544 APIC: CPU 1 has ACPI ID 2 > Apr 26 16:23:56.186544 APIC: CPU 2 has ACPI ID 3 > Apr 26 16:23:56.186544 APIC: CPU 3 has ACPI ID 4 > Apr 26 16:23:56.198550 x86bios: IVT 0x000000-0x0004ff at 0xfffff80000000000 > Apr 26 16:23:56.198550 x86bios: SSEG 0x09c000-0x09cfff at 0xfffffe0002eb1000 > Apr 26 16:23:56.210547 x86bios: EBDA 0x09f000-0x09ffff at 0xfffff8000009f000 > Apr 26 16:23:56.210547 x86bios: ROM 0x0a0000-0x0fefff at 0xfffff800000a0000 > Apr 26 16:23:56.210547 lapic0: CMCI unmasked > Apr 26 16:23:56.222548 Pentium Pro MTRR support enabled > Apr 26 16:23:56.222611 __stack_chk_init: WARNING: Initializing stack protecti > on with non-random cookies! > Apr 26 16:23:56.234649 __stack_chk_init: WARNING: This severely limits the be > nefit of -fstack-protector! > Apr 26 16:23:56.234725 VIMAGE (virtualized network stack) enabled > Apr 26 16:23:56.246632 ULE: setup cpu 0 > Apr 26 16:23:56.246709 ULE: setup cpu 1 > Apr 26 16:23:56.246757 ULE: setup cpu 2 > Apr 26 16:23:56.246803 ULE: setup cpu 3 > Apr 26 16:23:56.246850 ACPI: RSDP 0x00000000000FE020 000024 (v02 DELL ) > Apr 26 16:23:56.258620 ACPI: XSDT 0x0000000095FCF188 0000E4 (v01 DELL PE_SC > 3 00000001 01000013) > Apr 26 16:23:56.258689 ACPI: FACP 0x0000000095FF7000 00010C (v05 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.270640 ACPI: DSDT 0x0000000095FDF000 012335 (v01 DELL PE_SC > 3 00000000 DELL 00040000) > Apr 26 16:23:56.282635 ACPI: FACS 0x0000000095FBD000 000040 > Apr 26 16:23:56.282698 ACPI: UEFI 0x0000000095FFD000 000236 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.294635 ACPI: UEFI 0x0000000095FFC000 000042 (v01 DELL PE_SC > 3 00000000 DELL 00040000) > Apr 26 16:23:56.294705 ACPI: ASF! 0x0000000095FFB000 0000A5 (v32 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.306597 ACPI: ASPT 0x0000000095FFA000 000034 (v07 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.318581 ACPI: BOOT 0x0000000095FF9000 000028 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.318581 ACPI: DBGP 0x0000000095FF8000 000034 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.330620 ACPI: HPET 0x0000000095FF6000 000038 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.342636 ACPI: APIC 0x0000000095FF5000 000092 (v03 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.342704 ACPI: MCFG 0x0000000095FF4000 00003C (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.354639 ACPI: SLIC 0x0000000095FF3000 000176 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.366687 ACPI: SSDT 0x0000000095FDC000 002028 (v01 DELL PE_SC > 3 00001000 DELL 00040000) > Apr 26 16:23:56.366756 ACPI: SPMI 0x0000000095FDA000 000040 (v05 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.378647 ACPI: SSDT 0x0000000095FD9000 000533 (v01 DELL PE_SC > 3 00003000 DELL 00040000) > Apr 26 16:23:56.390638 ACPI: SSDT 0x0000000095FD8000 000ACE (v01 DELL PE_SC > 3 00003000 DELL 00040000) > Apr 26 16:23:56.390709 ACPI: SSDT 0x0000000095FD4000 003492 (v01 DELL PE_SC > 3 00003000 DELL 00040000) > Apr 26 16:23:56.402647 ACPI: SPCR 0x0000000095FF2000 000050 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.414633 ACPI: DMAR 0x0000000095FD3000 000080 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.414701 ACPI: SSDT 0x0000000095FD2000 000514 (v01 DELL PE_SC > 3 00001000 DELL 00040000) > Apr 26 16:23:56.426646 ACPI: FPDT 0x0000000095FD1000 000044 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.438643 ACPI: HEST 0x0000000095FD0000 0000A8 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.438711 ACPI: ERST 0x0000000095FCE000 000230 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.450651 ACPI: BERT 0x0000000095FCD000 000030 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.462631 ACPI: EINJ 0x0000000095FCC000 000150 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.462700 MADT: Found IO APIC ID 2, Interrupt 0 at 0xfec00000 > Apr 26 16:23:56.474535 ioapic0: ver 0x20 maxredir 0x17 > Apr 26 16:23:56.474568 ioapic0: Routing external 8259A's -> intpin 0 > Apr 26 16:23:56.474596 MADT: Interrupt override: source 0, irq 2 > Apr 26 16:23:56.486634 ioapic0: Routing IRQ 0 -> intpin 2 > Apr 26 16:23:56.486696 MADT: Interrupt override: source 9, irq 9 > Apr 26 16:23:56.486748 ioapic0: intpin 9 trigger: level > Apr 26 16:23:56.498651 lapic: Routing NMI -> LINT1 > Apr 26 16:23:56.498713 lapic: LINT1 trigger: edge > Apr 26 16:23:56.498761 lapic: LINT1 polarity: high > Apr 26 16:23:56.498809 ioapic0 irqs 0-23 on motherboard > Apr 26 16:23:56.510592 lapic: Divisor 2, Frequency 49885486 Hz > Apr 26 16:23:57.506602 lapic: deadline tsc mode, Frequency 3092899860 Hz > Apr 26 16:23:57.518669 cpu0 BSP: > Apr 26 16:23:57.518727 ID: 0x00000000 VER: 0x01060015 LDR: 0x00000001 > DFR: 0x00000000 x2APIC: 1 > Apr 26 16:23:57.530597 lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 > SVR: 0x000011ff > Apr 26 16:23:57.530611 timer: 0x000100ef therm: 0x00010000 err: 0x000000f0 > pmc: 0x00010400 > Apr 26 16:23:57.542651 cmci: 0x000000f2 > Apr 26 16:23:57.542714 lapic4: CMCI unmasked > Apr 26 16:23:57.542762 SMP: AP CPU #2 Launched! > Apr 26 16:23:57.542809 cpu2 AP: > Apr 26 16:23:57.554629 ID: 0x00000004 VER: 0x01060015 LDR: 0x00000010 > DFR: 0x00000000 x2APIC: 1 > Apr 26 16:23:57.554698 lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 > SVR: 0x000011ff > Apr 26 16:23:57.566634 timer: 0x000100ef therm: 0x00010000 err: 0x000000f0 > pmc: 0x00010400 > Apr 26 16:23:57.566701 cmci: 0x000000f2 > Apr 26 16:23:57.566748 lapic6: CMCI unmasked > Apr 26 16:23:57.578636 SMP: AP CPU #3 Launched! > Apr 26 16:23:57.578697 cpu3 AP: > Apr 26 16:23:57.578741 ID: 0x00000006 VER: 0x01060015 LDR: 0x00000040 > DFR: 0x00000000 x2APIC: 1 > Apr 26 16:23:57.590638 lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 > SVR: 0x000011ff > Apr 26 16:23:57.590703 timer: 0x000100ef therm: 0x00010000 err: 0x000000f0 > pmc: 0x00010400 > Apr 26 16:23:57.602644 cmci: 0x000000f2 > Apr 26 16:23:57.602702 lapic2: CMCI unmasked > Apr 26 16:23:57.602749 SMP: AP CPU #1 Launched! > Apr 26 16:23:57.602798 cpu1 AP: > Apr 26 16:23:57.614625 ID: 0x00000002 VER: 0x01060015 LDR: 0x00000004 > DFR: 0x00000000 x2APIC: 1 > Apr 26 16:23:57.614693 lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 > SVR: 0x000011ff > Apr 26 16:23:57.626628 timer: 0x000100ef therm: 0x00010000 err: 0x000000f0 > pmc: 0x00010400 > Apr 26 16:23:57.626694 cmci: 0x000000f2 > Apr 26 16:23:57.638631 SMP: passed TSC synchronization test > Apr 26 16:23:57.638694 TSC timecounter discards lower 1 bit(s) > Apr 26 16:23:57.638744 Timecounter "TSC-low" frequency 1546449930 Hz quality > 1000 > Apr 26 16:23:57.650643 snd_md0: Preload)e u=0x00ff800f0 [512] d=074307007cbyt > e[32at c=0x00000f3f82 [10248] > Apr 26 16:23:57.650713 feeder_register: snd_unit=-1 snd_maxautovchans=16 late > ncy=5 feeder_rate_min=1 feeder_rate_max=2016000 feeder_rate_round=25 > Apr 26 16:23:57.662653 panic: mtx_lock() of spin mutex (null) @ /usr/home/oss > test/build.135317.build-amd64-freebsd/freebsd/sys/kern/subr_bus.c:620 > Apr 26 16:23:57.674650 cpuid = 2 > Apr 26 16:23:57.686653 time = 1 > Apr 26 16:23:57.686720 KDB: stack backtrace: > Apr 26 16:23:57.686797 db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/ > frame 0xfffffe003abe8710 > Apr 26 16:23:57.686879 vpanic() at vpanic+0x19d/frame 0xfffffe003abe8760 > Apr 26 16:23:57.698637 panic() at panic+0x43/frame 0xfffffe003abe87c0 > Apr 26 16:23:57.698700 __mtx_lock_flags() at __mtx_lock_flags+0x145/frame 0xf > ffffe003abe8810 > Apr 26 16:23:57.710640 devctl_queue_data_f() at devctl_queue_data_f+0x6a/fram > e 0xfffffe003abe8840 > Apr 26 16:23:57.722625 g_dev_taste() at g_dev_taste+0x463/frame 0xfffffe003ab > e8a00 > Apr 26 16:23:57.722690 g_load_class() at g_load_class+0x1bc/frame 0xfffffe003 > abe8a30 > Apr 26 16:23:57.734638 g_run_events() at g_run_events+0x197/frame 0xfffffe003 > abe8a70 > Apr 26 16:23:57.734704 fork_exit() at fork_exit+0x84/frame 0xfffffe003abe8ab0 > Apr 26 16:23:57.746655 fork_trampoline() at fork_trampoline+0xe/frame 0xfffff > e003abe8ab0 > Apr 26 16:23:57.746721 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- > Apr 26 16:23:57.758797 KDB: enter: panic > Apr 26 16:23:57.758913 [ thread pid 13 tid 100029 ] > Apr 26 16:23:57.758943 Stopped at kdb_enter+0x3b: movq $0,kdb_why > Apr 26 16:23:57.770557 db> > > The automatic bisector has pointed as this commit as the culprit, you > can see the full bisection at: > > https://lists.xenproject.org/archives/html/xen-devel/2019-04/msg02061.html > > And an example of a failed test at: > > https://lists.xenproject.org/archives/html/xen-devel/2019-05/msg00104.html > http://logs.test-lab.xenproject.org/osstest/logs/135458/ > > Thanks, Roger. > > It made a strange connection to this commit. The panic has geom written all over it. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Thu May 2 12:54:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E3AA15952BC; Thu, 2 May 2019 12:54:04 +0000 (UTC) (envelope-from prvs=018794465=roger.pau@citrix.com) Received: from SMTP.EU.CITRIX.COM (smtp.eu.citrix.com [185.25.65.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.citrix.com", Issuer "DigiCert SHA2 Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8392A8DB90; Thu, 2 May 2019 12:54:03 +0000 (UTC) (envelope-from prvs=018794465=roger.pau@citrix.com) X-IronPort-AV: E=Sophos;i="5.60,421,1549929600"; d="scan'208";a="89569125" Date: Thu, 2 May 2019 14:53:34 +0200 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Cy Schubert CC: Kyle Evans , , , Subject: Re: svn commit: r346670 - head/sys/net Message-ID: <20190502125334.ly3putfkfnxvbhqv@Air-de-Roger.citrite.net> References: <20190502111106.pfosaq73kgo6g33j@Air-de-Roger.citrite.net> <201905021158.x42BwduG006865@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <201905021158.x42BwduG006865@slippy.cwsent.com> User-Agent: NeoMutt/20180716 X-ClientProxiedBy: AMSPEX02CAS01.citrite.net (10.69.22.112) To AMSPEX02CL02.citrite.net (10.69.22.126) X-Rspamd-Queue-Id: 8392A8DB90 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.974,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 12:54:04 -0000 On Thu, May 02, 2019 at 04:58:39AM -0700, Cy Schubert wrote: > In message <20190502111106.pfosaq73kgo6g33j@Air-de-Roger.citrite.net>, > Roger Pa > u =?utf-8?B?TW9ubsOp?= writes: > > On Thu, Apr 25, 2019 at 12:44:08PM +0000, Kyle Evans wrote: > > Apr 26 16:23:57.662653 panic: mtx_lock() of spin mutex (null) @ /usr/home/oss > > test/build.135317.build-amd64-freebsd/freebsd/sys/kern/subr_bus.c:620 > > Apr 26 16:23:57.674650 cpuid = 2 > > Apr 26 16:23:57.686653 time = 1 > > Apr 26 16:23:57.686720 KDB: stack backtrace: > > Apr 26 16:23:57.686797 db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/ > > frame 0xfffffe003abe8710 > > Apr 26 16:23:57.686879 vpanic() at vpanic+0x19d/frame 0xfffffe003abe8760 > > Apr 26 16:23:57.698637 panic() at panic+0x43/frame 0xfffffe003abe87c0 > > Apr 26 16:23:57.698700 __mtx_lock_flags() at __mtx_lock_flags+0x145/frame 0xf > > ffffe003abe8810 > > Apr 26 16:23:57.710640 devctl_queue_data_f() at devctl_queue_data_f+0x6a/fram > > e 0xfffffe003abe8840 > > Apr 26 16:23:57.722625 g_dev_taste() at g_dev_taste+0x463/frame 0xfffffe003ab > > e8a00 > > Apr 26 16:23:57.722690 g_load_class() at g_load_class+0x1bc/frame 0xfffffe003 > > abe8a30 > > Apr 26 16:23:57.734638 g_run_events() at g_run_events+0x197/frame 0xfffffe003 > > abe8a70 > > Apr 26 16:23:57.734704 fork_exit() at fork_exit+0x84/frame 0xfffffe003abe8ab0 > > Apr 26 16:23:57.746655 fork_trampoline() at fork_trampoline+0xe/frame 0xfffff > > e003abe8ab0 > > Apr 26 16:23:57.746721 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- > > Apr 26 16:23:57.758797 KDB: enter: panic > > Apr 26 16:23:57.758913 [ thread pid 13 tid 100029 ] > > Apr 26 16:23:57.758943 Stopped at kdb_enter+0x3b: movq $0,kdb_why > > Apr 26 16:23:57.770557 db> > > > > The automatic bisector has pointed as this commit as the culprit, you > > can see the full bisection at: > > > > https://lists.xenproject.org/archives/html/xen-devel/2019-04/msg02061.html > > > > And an example of a failed test at: > > > > https://lists.xenproject.org/archives/html/xen-devel/2019-05/msg00104.html > > http://logs.test-lab.xenproject.org/osstest/logs/135458/ > > > > Thanks, Roger. > > > > > > It made a strange connection to this commit. The panic has geom written > all over it. I agree it's a strange connection, but the results from the bisection are quite clear, the previous commit which is 070cf1ede1850d8c (r346664) works fine and d61e108233bfdb3 (r346670) this commit fails. The bisection looks reliable as there are no skipped revisions or spurious failures. Roger. From owner-svn-src-all@freebsd.org Thu May 2 12:56:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72D7F1595352; Thu, 2 May 2019 12:56:15 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 174778DD1A; Thu, 2 May 2019 12:56:15 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E0B779708; Thu, 2 May 2019 12:56:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42CuErv057111; Thu, 2 May 2019 12:56:14 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42CuD9m057105; Thu, 2 May 2019 12:56:13 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905021256.x42CuD9m057105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 2 May 2019 12:56:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347017 - in head/sys: arm64/conf conf dts/arm64/overlays modules/dtb/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm64/conf conf dts/arm64/overlays modules/dtb/allwinner X-SVN-Commit-Revision: 347017 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 174778DD1A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 12:56:15 -0000 Author: manu Date: Thu May 2 12:56:13 2019 New Revision: 347017 URL: https://svnweb.freebsd.org/changeset/base/347017 Log: arm64: Add support for NanoPI NEO2 Add overlay files and activate devicetree file for NanoPi NEO2 featuring Allwinner H5 ARM64 core. To enable sound, dma and codec drivers are enabled for build. Submitted by: Manuel Stühn (freebsdnewbie@freenet.de) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D20129 Added: head/sys/dts/arm64/overlays/sun50i-h5-nanopi-neo2-opp.dtso (contents, props changed) head/sys/dts/arm64/overlays/sun50i-h5-opp.dtso (contents, props changed) head/sys/dts/arm64/overlays/sun50i-h5-sid.dtso (contents, props changed) head/sys/dts/arm64/overlays/sun50i-h5-ths.dtso (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 head/sys/modules/dtb/allwinner/Makefile Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Thu May 2 09:00:36 2019 (r347016) +++ head/sys/arm64/conf/GENERIC Thu May 2 12:56:13 2019 (r347017) @@ -215,11 +215,19 @@ device muge device smcphy device smsc +# Sound support +device sound +device a10_codec + +# DMA controller +device a31_dmac + # GPIO / PINCTRL device aw_gpio # Allwinner GPIO controller device gpio device gpioled device fdt_pinctrl +device gpioregulator device mv_gpio # Marvell GPIO controller device mvebu_pinctrl # Marvell Pinmux Controller device rk_gpio # RockChip GPIO Controller Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Thu May 2 09:00:36 2019 (r347016) +++ head/sys/conf/files.arm64 Thu May 2 12:56:13 2019 (r347017) @@ -27,6 +27,9 @@ cloudabi64_vdso_blob.o optional compat_cloudabi64 \ # Allwinner common files arm/allwinner/a10_ehci.c optional ehci aw_ehci fdt arm/allwinner/a10_timer.c optional a10_timer fdt +arm/allwinner/a10_codec.c optional sound a10_codec +arm/allwinner/a31_dmac.c optional a31_dmac +arm/allwinner/sunxi_dma_if.m optional a31_dmac arm/allwinner/aw_cir.c optional evdev aw_cir fdt arm/allwinner/aw_gpio.c optional gpio aw_gpio fdt arm/allwinner/aw_mmc.c optional mmc aw_mmc fdt | mmccam aw_mmc fdt Added: head/sys/dts/arm64/overlays/sun50i-h5-nanopi-neo2-opp.dtso ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dts/arm64/overlays/sun50i-h5-nanopi-neo2-opp.dtso Thu May 2 12:56:13 2019 (r347017) @@ -0,0 +1,32 @@ +/dts-v1/; +/plugin/; + +#include + +/ { + compatible = "allwinner,sun50i-h5"; +}; + +&{/} { + vdd_cpux: gpio-regulator { + compatible = "regulator-gpio"; + pinctrl-names = "default"; + regulator-name = "vdd-cpux"; + regulator-type = "voltage"; + regulator-boot-on; + regulator-always-on; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1300000>; + regulator-ramp-delay = <50>; /* 4ms */ + gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */ + gpios-states = <0x1>; + states = <1100000 0x0 + 1300000 0x1>; + }; + +}; + +&{/cpus/cpu@0} { + cpu-supply = <&vdd_cpux>; +}; + Added: head/sys/dts/arm64/overlays/sun50i-h5-opp.dtso ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dts/arm64/overlays/sun50i-h5-opp.dtso Thu May 2 12:56:13 2019 (r347017) @@ -0,0 +1,99 @@ +/dts-v1/; +/plugin/; + +#include + +/ { + compatible = "allwinner,sun50i-h5"; +}; + +&{/} { + cpu_opp_table: opp_table { + compatible = "operating-points-v2"; + opp-shared; + + opp@408000000 { + opp-hz = /bits/ 64 <408000000>; + opp-microvolt = <1000000 1000000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@648000000 { + opp-hz = /bits/ 64 <648000000>; + opp-microvolt = <1040000 1040000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@816000000 { + opp-hz = /bits/ 64 <816000000>; + opp-microvolt = <1080000 1080000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@912000000 { + opp-hz = /bits/ 64 <912000000>; + opp-microvolt = <1120000 1120000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@960000000 { + opp-hz = /bits/ 64 <960000000>; + opp-microvolt = <1160000 1160000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@1008000000 { + opp-hz = /bits/ 64 <1008000000>; + opp-microvolt = <1200000 1200000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@1056000000 { + opp-hz = /bits/ 64 <1056000000>; + opp-microvolt = <1240000 1240000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@1104000000 { + opp-hz = /bits/ 64 <1104000000>; + opp-microvolt = <1260000 1260000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@1152000000 { + opp-hz = /bits/ 64 <1152000000>; + opp-microvolt = <1300000 1300000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + }; + + reg_cpu_fallback: reg_cpu_fallback { + compatible = "regulator-fixed"; + regulator-name = "vdd-cpux-dummy"; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + }; + +}; + +&{/cpus/cpu@0} { + clocks = <&ccu CLK_CPUX>; + clock-names = "cpu"; + clock-latency = <244144>; /* 8 32k periods */ + operating-points-v2 = <&cpu_opp_table>; + cpu-supply = <®_cpu_fallback>; + #cooling-cells = <2>; +}; + +&{/cpus/cpu@1} { + operating-points-v2 = <&cpu_opp_table>; +}; + +&{/cpus/cpu@2} { + operating-points-v2 = <&cpu_opp_table>; +}; + +&{/cpus/cpu@3} { + operating-points-v2 = <&cpu_opp_table>; +}; + Added: head/sys/dts/arm64/overlays/sun50i-h5-sid.dtso ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dts/arm64/overlays/sun50i-h5-sid.dtso Thu May 2 12:56:13 2019 (r347017) @@ -0,0 +1,17 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "allwinner,sun50i-h5"; +}; + +&{/soc} { + sid: eeprom@1c14000 { + compatible = "allwinner,sun50i-h5-sid"; + reg = <0x1c14000 0x400>; + + ths_calib: calib@234 { + reg = <0x234 0x4>; + }; + }; +}; Added: head/sys/dts/arm64/overlays/sun50i-h5-ths.dtso ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dts/arm64/overlays/sun50i-h5-ths.dtso Thu May 2 12:56:13 2019 (r347017) @@ -0,0 +1,26 @@ +/dts-v1/; +/plugin/; + +#include +#include +#include + +/ { + compatible = "allwinner,sun50i-h5"; +}; + +&{/soc} { + ths: thermal_sensor@1c25000 { + compatible = "allwinner,sun50i-h5-ths"; + reg = <0x01c25000 0x100>; + interrupts = ; + clocks = <&ccu CLK_BUS_THS>, <&ccu CLK_THS>; + clock-names = "apb", "ths"; + resets = <&ccu RST_BUS_THS>; + reset-names = "apb"; + #thermal-sensor-cells = <1>; + + nvmem-cells = <&ths_calib>; + nvmem-cell-names = "ths-calib"; + }; +}; Modified: head/sys/modules/dtb/allwinner/Makefile ============================================================================== --- head/sys/modules/dtb/allwinner/Makefile Thu May 2 09:00:36 2019 (r347016) +++ head/sys/modules/dtb/allwinner/Makefile Thu May 2 12:56:13 2019 (r347017) @@ -44,14 +44,19 @@ DTS= \ allwinner/sun50i-a64-pine64-plus.dts \ allwinner/sun50i-a64-pine64.dts \ allwinner/sun50i-a64-sopine-baseboard.dts \ - allwinner/sun50i-h5-orangepi-pc2.dts + allwinner/sun50i-h5-orangepi-pc2.dts \ + allwinner/sun50i-h5-nanopi-neo2.dts DTSO= sun50i-a64-opp.dtso \ sun50i-a64-pwm.dtso \ sun50i-a64-rpwm.dtso \ sun50i-a64-sid.dtso \ sun50i-a64-ths.dtso \ - sun50i-a64-timer.dtso + sun50i-a64-timer.dtso \ + sun50i-h5-opp.dtso \ + sun50i-h5-sid.dtso \ + sun50i-h5-ths.dtso \ + sun50i-h5-nanopi-neo2-opp.dtso .endif From owner-svn-src-all@freebsd.org Thu May 2 13:14:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08F1415958B4; Thu, 2 May 2019 13:14:43 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A4678E8B9; Thu, 2 May 2019 13:14:42 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-ua1-f50.google.com (mail-ua1-f50.google.com [209.85.222.50]) (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 5A270BFCF; Thu, 2 May 2019 13:14:42 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-ua1-f50.google.com with SMTP id 90so675674uav.10; Thu, 02 May 2019 06:14:42 -0700 (PDT) X-Gm-Message-State: APjAAAWqLK3b4/qudZ4nIA5/wG66yt9K0zBUAy9r+RQ3z2GrDMowI/cd 5QxeAkmjMB8KHSRIpXe3lANlk0EbDxjt3cd/s40= X-Google-Smtp-Source: APXvYqzVsd1mY5MSF6qa3S4O4NhhWNA+oEWoqzdb1jD3wB3MshrD1VqMZ11EcG8btVJudzYI14sK0PL++1g0wg8EhHE= X-Received: by 2002:ab0:413:: with SMTP id 19mr1702257uav.87.1556802881748; Thu, 02 May 2019 06:14:41 -0700 (PDT) MIME-Version: 1.0 References: <20190502111106.pfosaq73kgo6g33j@Air-de-Roger.citrite.net> <201905021158.x42BwduG006865@slippy.cwsent.com> <20190502125334.ly3putfkfnxvbhqv@Air-de-Roger.citrite.net> In-Reply-To: <20190502125334.ly3putfkfnxvbhqv@Air-de-Roger.citrite.net> From: Kyle Evans Date: Thu, 2 May 2019 08:14:08 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346670 - head/sys/net To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Cc: Cy Schubert , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 9A4678E8B9 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 13:14:43 -0000 On Thu, May 2, 2019 at 7:54 AM Roger Pau Monn=C3=A9 = wrote: > > On Thu, May 02, 2019 at 04:58:39AM -0700, Cy Schubert wrote: > > In message <20190502111106.pfosaq73kgo6g33j@Air-de-Roger.citrite.net>, > > Roger Pa > > u =3D?utf-8?B?TW9ubsOp?=3D writes: > > > On Thu, Apr 25, 2019 at 12:44:08PM +0000, Kyle Evans wrote: > > > Apr 26 16:23:57.662653 panic: mtx_lock() of spin mutex (null) @ /usr/= home/oss > > > test/build.135317.build-amd64-freebsd/freebsd/sys/kern/subr_bus.c:620 > > > Apr 26 16:23:57.674650 cpuid =3D 2 > > > Apr 26 16:23:57.686653 time =3D 1 > > > Apr 26 16:23:57.686720 KDB: stack backtrace: > > > Apr 26 16:23:57.686797 db_trace_self_wrapper() at db_trace_self_wrapp= er+0x2b/ > > > frame 0xfffffe003abe8710 > > > Apr 26 16:23:57.686879 vpanic() at vpanic+0x19d/frame 0xfffffe003abe8= 760 > > > Apr 26 16:23:57.698637 panic() at panic+0x43/frame 0xfffffe003abe87c0 > > > Apr 26 16:23:57.698700 __mtx_lock_flags() at __mtx_lock_flags+0x145/f= rame 0xf > > > ffffe003abe8810 > > > Apr 26 16:23:57.710640 devctl_queue_data_f() at devctl_queue_data_f+0= x6a/fram > > > e 0xfffffe003abe8840 > > > Apr 26 16:23:57.722625 g_dev_taste() at g_dev_taste+0x463/frame 0xfff= ffe003ab > > > e8a00 > > > Apr 26 16:23:57.722690 g_load_class() at g_load_class+0x1bc/frame 0xf= ffffe003 > > > abe8a30 > > > Apr 26 16:23:57.734638 g_run_events() at g_run_events+0x197/frame 0xf= ffffe003 > > > abe8a70 > > > Apr 26 16:23:57.734704 fork_exit() at fork_exit+0x84/frame 0xfffffe00= 3abe8ab0 > > > Apr 26 16:23:57.746655 fork_trampoline() at fork_trampoline+0xe/frame= 0xfffff > > > e003abe8ab0 > > > Apr 26 16:23:57.746721 --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --= - > > > Apr 26 16:23:57.758797 KDB: enter: panic > > > Apr 26 16:23:57.758913 [ thread pid 13 tid 100029 ] > > > Apr 26 16:23:57.758943 Stopped at kdb_enter+0x3b: movq $0,kdb= _why > > > Apr 26 16:23:57.770557 db> > > > > > > The automatic bisector has pointed as this commit as the culprit, you > > > can see the full bisection at: > > > > > > https://lists.xenproject.org/archives/html/xen-devel/2019-04/msg02061= .html > > > > > > And an example of a failed test at: > > > > > > https://lists.xenproject.org/archives/html/xen-devel/2019-05/msg00104= .html > > > http://logs.test-lab.xenproject.org/osstest/logs/135458/ > > > > > > Thanks, Roger. > > > > > > > > > > It made a strange connection to this commit. The panic has geom written > > all over it. > > I agree it's a strange connection, but the results from the bisection > are quite clear, the previous commit which is 070cf1ede1850d8c > (r346664) works fine and d61e108233bfdb3 (r346670) this commit > fails. > > The bisection looks reliable as there are no skipped revisions or > spurious failures. > This panic seems to make sense, generally if I read things right, but I'm not immediately sure how my commit triggered it. The mutex in question is initialized in devinit, invoked by the root_bus_mod at SI_SUB_DRIVERS + SI_ORDER_FIRST [0]. geom classes are also declared at SI_SUB_DRIVERS + SI_ORDER_FIRST [1], which takes us on a trip through g_modevent -> g_init. g_init creates the g_event thread [2] -> g_event_procbody -> g_run_events -> ... -> (boom). I guess the timing/ordering of these things normally works out so that devinit gets the mutex ready before the g_event thread does any loading/tasting, but not here. [0] https://svnweb.freebsd.org/base/head/sys/kern/subr_bus.c?view=3Dmarkup#= l5127 [1] https://svnweb.freebsd.org/base/head/sys/geom/geom.h?view=3Dmarkup#l414 [2] https://svnweb.freebsd.org/base/head/sys/geom/geom_kern.c?view=3Dmarkup= #l149 From owner-svn-src-all@freebsd.org Thu May 2 14:27:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67F111597340; Thu, 2 May 2019 14:27:23 +0000 (UTC) (envelope-from prvs=018794465=roger.pau@citrix.com) Received: from SMTP.EU.CITRIX.COM (smtp.ctxuk.citrix.com [185.25.65.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.citrix.com", Issuer "DigiCert SHA2 Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 857F490FA0; Thu, 2 May 2019 14:27:21 +0000 (UTC) (envelope-from prvs=018794465=roger.pau@citrix.com) X-IronPort-AV: E=Sophos;i="5.60,421,1549929600"; d="scan'208";a="89576929" Date: Thu, 2 May 2019 16:22:54 +0200 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Kyle Evans CC: Cy Schubert , src-committers , , Subject: Re: svn commit: r346670 - head/sys/net Message-ID: <20190502142254.ywpxblnztanbmu6v@Air-de-Roger.citrite.net> References: <20190502111106.pfosaq73kgo6g33j@Air-de-Roger.citrite.net> <201905021158.x42BwduG006865@slippy.cwsent.com> <20190502125334.ly3putfkfnxvbhqv@Air-de-Roger.citrite.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 X-ClientProxiedBy: AMSPEX02CAS02.citrite.net (10.69.22.113) To AMSPEX02CL02.citrite.net (10.69.22.126) X-Rspamd-Queue-Id: 857F490FA0 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 14:27:23 -0000 On Thu, May 02, 2019 at 08:14:08AM -0500, Kyle Evans wrote: > On Thu, May 2, 2019 at 7:54 AM Roger Pau Monné wrote: > > > > On Thu, May 02, 2019 at 04:58:39AM -0700, Cy Schubert wrote: > > > In message <20190502111106.pfosaq73kgo6g33j@Air-de-Roger.citrite.net>, > > > Roger Pa > > > u =?utf-8?B?TW9ubsOp?= writes: > > > > On Thu, Apr 25, 2019 at 12:44:08PM +0000, Kyle Evans wrote: > > > > Apr 26 16:23:57.662653 panic: mtx_lock() of spin mutex (null) @ /usr/home/oss > > > > test/build.135317.build-amd64-freebsd/freebsd/sys/kern/subr_bus.c:620 > > > > Apr 26 16:23:57.674650 cpuid = 2 > > > > Apr 26 16:23:57.686653 time = 1 > > > > Apr 26 16:23:57.686720 KDB: stack backtrace: > > > > Apr 26 16:23:57.686797 db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/ > > > > frame 0xfffffe003abe8710 > > > > Apr 26 16:23:57.686879 vpanic() at vpanic+0x19d/frame 0xfffffe003abe8760 > > > > Apr 26 16:23:57.698637 panic() at panic+0x43/frame 0xfffffe003abe87c0 > > > > Apr 26 16:23:57.698700 __mtx_lock_flags() at __mtx_lock_flags+0x145/frame 0xf > > > > ffffe003abe8810 > > > > Apr 26 16:23:57.710640 devctl_queue_data_f() at devctl_queue_data_f+0x6a/fram > > > > e 0xfffffe003abe8840 > > > > Apr 26 16:23:57.722625 g_dev_taste() at g_dev_taste+0x463/frame 0xfffffe003ab > > > > e8a00 > > > > Apr 26 16:23:57.722690 g_load_class() at g_load_class+0x1bc/frame 0xfffffe003 > > > > abe8a30 > > > > Apr 26 16:23:57.734638 g_run_events() at g_run_events+0x197/frame 0xfffffe003 > > > > abe8a70 > > > > Apr 26 16:23:57.734704 fork_exit() at fork_exit+0x84/frame 0xfffffe003abe8ab0 > > > > Apr 26 16:23:57.746655 fork_trampoline() at fork_trampoline+0xe/frame 0xfffff > > > > e003abe8ab0 > > > > Apr 26 16:23:57.746721 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- > > > > Apr 26 16:23:57.758797 KDB: enter: panic > > > > Apr 26 16:23:57.758913 [ thread pid 13 tid 100029 ] > > > > Apr 26 16:23:57.758943 Stopped at kdb_enter+0x3b: movq $0,kdb_why > > > > Apr 26 16:23:57.770557 db> > > > > > > > > The automatic bisector has pointed as this commit as the culprit, you > > > > can see the full bisection at: > > > > > > > > https://lists.xenproject.org/archives/html/xen-devel/2019-04/msg02061.html > > > > > > > > And an example of a failed test at: > > > > > > > > https://lists.xenproject.org/archives/html/xen-devel/2019-05/msg00104.html > > > > http://logs.test-lab.xenproject.org/osstest/logs/135458/ > > > > > > > > Thanks, Roger. > > > > > > > > > > > > > > It made a strange connection to this commit. The panic has geom written > > > all over it. > > > > I agree it's a strange connection, but the results from the bisection > > are quite clear, the previous commit which is 070cf1ede1850d8c > > (r346664) works fine and d61e108233bfdb3 (r346670) this commit > > fails. > > > > The bisection looks reliable as there are no skipped revisions or > > spurious failures. > > > > This panic seems to make sense, generally if I read things right, but > I'm not immediately sure how my commit triggered it. The mutex in > question is initialized in devinit, invoked by the root_bus_mod at > SI_SUB_DRIVERS + SI_ORDER_FIRST [0]. geom classes are also declared at > SI_SUB_DRIVERS + SI_ORDER_FIRST [1], which takes us on a trip through > g_modevent -> g_init. g_init creates the g_event thread [2] -> > g_event_procbody -> g_run_events -> ... -> (boom). I guess the > timing/ordering of these things normally works out so that devinit > gets the mutex ready before the g_event thread does any > loading/tasting, but not here. My bet is that your usage of SX_SYSINIT somehow changed the order of the geom stuff and now it's exploding. I think I might have a fix for this, but I need to reproduce on the CI test boxes, my test box doesn't trigger the issue. Roger. From owner-svn-src-all@freebsd.org Thu May 2 15:03:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33E9F1598031; Thu, 2 May 2019 15:03:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA1B59262B; Thu, 2 May 2019 15:03:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3384AD93; Thu, 2 May 2019 15:03:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42F3G9c025862; Thu, 2 May 2019 15:03:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42F3GSs025861; Thu, 2 May 2019 15:03:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905021503.x42F3GSs025861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 2 May 2019 15:03:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347019 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 347019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CA1B59262B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 15:03:17 -0000 Author: kib Date: Thu May 2 15:03:16 2019 New Revision: 347019 URL: https://svnweb.freebsd.org/changeset/base/347019 Log: Cleanup for rtld_malloc.c. - Remove dead and most likely rotten MALLOC_DEBUG, MSTAT, and RCHECK options. - Remove unused headers. - Remove one case of undefined behavior where left shift could overflow. It is impossible on practice for rtld and libthr consumer. PR: 237577 Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/libexec/rtld-elf/rtld_malloc.c Modified: head/libexec/rtld-elf/rtld_malloc.c ============================================================================== --- head/libexec/rtld-elf/rtld_malloc.c Thu May 2 14:40:21 2019 (r347018) +++ head/libexec/rtld-elf/rtld_malloc.c Thu May 2 15:03:16 2019 (r347019) @@ -45,17 +45,14 @@ static char *rcsid = "$FreeBSD$"; * This is designed for use in a virtual memory environment. */ -#include +#include #include +#include #include #include #include -#include -#include #include #include -#include -#include #include "rtld.h" #include "rtld_printf.h" #include "paths.h" @@ -81,10 +78,6 @@ union overhead { struct { u_char ovu_magic; /* magic number */ u_char ovu_index; /* bucket # */ -#ifdef RCHECK - u_short ovu_rmagic; /* range magic number */ - u_int ovu_size; /* actual block size */ -#endif } ovu; #define ov_magic ovu.ovu_magic #define ov_index ovu.ovu_index @@ -100,12 +93,6 @@ static int findbucket(union overhead *freep, int srchl #define MAGIC 0xef /* magic # on accounting info */ #define RMAGIC 0x5555 /* magic # on range info */ -#ifdef RCHECK -#define RSLOP sizeof (u_short) -#else -#define RSLOP 0 -#endif - /* * nextf[i] is the pointer to the next free block of size 2^(i+3). The * smallest allocatable block is 8 bytes. The overhead information @@ -117,34 +104,7 @@ static union overhead *nextf[NBUCKETS]; static int pagesz; /* page size */ static int pagebucket; /* page size bucket */ -#ifdef MSTATS /* - * nmalloc[i] is the difference between the number of mallocs and frees - * for a given block size. - */ -static u_int nmalloc[NBUCKETS]; -#include -#endif - -#if defined(MALLOC_DEBUG) || defined(RCHECK) -#define ASSERT(p) if (!(p)) botch("p") -#include -static void -botch(s) - char *s; -{ - fprintf(stderr, "\r\nassertion botched: %s\r\n", s); - (void) fflush(stderr); /* just in case user buffered it */ - abort(); -} -#else -#define ASSERT(p) -#endif - -/* Debugging stuff */ -#define TRACE() rtld_printf("TRACE %s:%d\n", __FILE__, __LINE__) - -/* * The array of supported page sizes is provided by the user, i.e., the * program that calls this storage allocator. That program must initialize * the array before making its first call to allocate storage. The array @@ -188,15 +148,10 @@ __crt_malloc(size_t nbytes) * stored in hash buckets which satisfies request. * Account for space used per block for accounting. */ - if (nbytes <= (unsigned long)(n = pagesz - sizeof (*op) - RSLOP)) { -#ifndef RCHECK + if (nbytes <= (unsigned long)(n = pagesz - sizeof(*op))) { amt = 8; /* size of first bucket */ bucket = 0; -#else - amt = 16; /* size of first bucket */ - bucket = 1; -#endif - n = -(sizeof (*op) + RSLOP); + n = -sizeof(*op); } else { amt = pagesz; bucket = pagebucket; @@ -220,18 +175,6 @@ __crt_malloc(size_t nbytes) nextf[bucket] = op->ov_next; op->ov_magic = MAGIC; op->ov_index = bucket; -#ifdef MSTATS - nmalloc[bucket]++; -#endif -#ifdef RCHECK - /* - * Record allocated size of block and - * bound space with magic numbers. - */ - op->ov_size = roundup2(nbytes, RSLOP); - op->ov_rmagic = RMAGIC; - *(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; -#endif return ((char *)(op + 1)); } @@ -266,13 +209,9 @@ morecore(int bucket) * sbrk_size <= 0 only for big, FLUFFY, requests (about * 2^30 bytes on a VAX, I think) or for a negative arg. */ - sz = 1 << (bucket + 3); -#ifdef MALLOC_DEBUG - ASSERT(sz > 0); -#else - if (sz <= 0) + if ((unsigned)bucket >= NBBY * sizeof(int) - 4) return; -#endif + sz = 1 << (bucket + 3); if (sz < pagesz) { amt = pagesz; nblks = amt / sz; @@ -306,23 +245,11 @@ __crt_free(void *cp) if (cp == NULL) return; op = (union overhead *)((caddr_t)cp - sizeof (union overhead)); -#ifdef MALLOC_DEBUG - ASSERT(op->ov_magic == MAGIC); /* make sure it was in use */ -#else if (op->ov_magic != MAGIC) return; /* sanity */ -#endif -#ifdef RCHECK - ASSERT(op->ov_rmagic == RMAGIC); - ASSERT(*(u_short *)((caddr_t)(op + 1) + op->ov_size) == RMAGIC); -#endif size = op->ov_index; - ASSERT(size < NBUCKETS); op->ov_next = nextf[size]; /* also clobbers ov_magic */ nextf[size] = op; -#ifdef MSTATS - nmalloc[size]--; -#endif } /* @@ -374,26 +301,21 @@ __crt_realloc(void *cp, size_t nbytes) } onb = 1 << (i + 3); if (onb < (u_int)pagesz) - onb -= sizeof (*op) + RSLOP; + onb -= sizeof(*op); else - onb += pagesz - sizeof (*op) - RSLOP; + onb += pagesz - sizeof(*op); /* avoid the copy if same size block */ if (was_alloced) { if (i) { i = 1 << (i + 2); if (i < pagesz) - i -= sizeof (*op) + RSLOP; + i -= sizeof(*op); else - i += pagesz - sizeof (*op) - RSLOP; + i += pagesz - sizeof(*op); } - if (nbytes <= onb && nbytes > (size_t)i) { -#ifdef RCHECK - op->ov_size = roundup2(nbytes, RSLOP); - *(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; -#endif - return(cp); - } else - __crt_free(cp); + if (nbytes <= onb && nbytes > (size_t)i) + return (cp); + __crt_free(cp); } if ((res = __crt_malloc(nbytes)) == NULL) return (NULL); @@ -423,39 +345,6 @@ findbucket(union overhead *freep, int srchlen) } return (-1); } - -#ifdef MSTATS -/* - * mstats - print out statistics about malloc - * - * Prints two lines of numbers, one showing the length of the free list - * for each size category, the second showing the number of mallocs - - * frees for each size category. - */ -mstats(char * s) -{ - int i, j; - union overhead *p; - int totfree = 0, - totused = 0; - - fprintf(stderr, "Memory allocation statistics %s\nfree:\t", s); - for (i = 0; i < NBUCKETS; i++) { - for (j = 0, p = nextf[i]; p; p = p->ov_next, j++) - ; - fprintf(stderr, " %d", j); - totfree += j * (1 << (i + 3)); - } - fprintf(stderr, "\nused:\t"); - for (i = 0; i < NBUCKETS; i++) { - fprintf(stderr, " %d", nmalloc[i]); - totused += nmalloc[i] * (1 << (i + 3)); - } - fprintf(stderr, "\n\tTotal in use: %d, total free: %d\n", - totused, totfree); -} -#endif - static int morepages(int n) From owner-svn-src-all@freebsd.org Thu May 2 16:28:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86186159A419; Thu, 2 May 2019 16:28:34 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 284A895B93; Thu, 2 May 2019 16:28:34 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18912BD5F; Thu, 2 May 2019 16:28:34 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42GSXUS068742; Thu, 2 May 2019 16:28:33 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42GSXRC068741; Thu, 2 May 2019 16:28:33 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201905021628.x42GSXRC068741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Douglas William Moore Date: Thu, 2 May 2019 16:28:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347020 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 347020 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 284A895B93 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 16:28:34 -0000 Author: dougm Date: Thu May 2 16:28:33 2019 New Revision: 347020 URL: https://svnweb.freebsd.org/changeset/base/347020 Log: Enroll new committer Doug Moore (dougm@freebsd.org). Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D20136 Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu May 2 15:03:16 2019 (r347019) +++ head/share/misc/committers-src.dot Thu May 2 16:28:33 2019 (r347020) @@ -155,6 +155,7 @@ dexuan [label="Dexuan Cui\ndexuan@FreeBSD.org\n2016/10 dfr [label="Doug Rabson\ndfr@FreeBSD.org\n????/??/??"] dg [label="David Greenman\ndg@FreeBSD.org\n1993/06/14"] dim [label="Dimitry Andric\ndim@FreeBSD.org\n2010/08/30"] +dougm [label="Doug Moore\ndougm@FreeBSD.org\n2019/04/30"] dteske [label="Devin Teske\ndteske@FreeBSD.org\n2012/04/10"] dumbbell [label="Jean-Sebastien Pedron\ndumbbell@FreeBSD.org\n2004/11/29"] dwmalone [label="David Malone\ndwmalone@FreeBSD.org\n2000/07/11"] @@ -663,6 +664,7 @@ ken -> will kib -> ae kib -> badger kib -> dchagin +kib -> dougm kib -> gjb kib -> jah kib -> jlh @@ -694,6 +696,7 @@ marcel -> nwhitehorn marcel -> sjg markj -> cem +markj -> dougm markj -> lwhsu markj -> mhorne markj -> rlibby From owner-svn-src-all@freebsd.org Thu May 2 16:56:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D6A1159AFDA; Thu, 2 May 2019 16:56:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E73F096D6B; Thu, 2 May 2019 16:56:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCC55C2F4; Thu, 2 May 2019 16:56:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42Gu3w2084046; Thu, 2 May 2019 16:56:03 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42Gu3hP084045; Thu, 2 May 2019 16:56:03 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905021656.x42Gu3hP084045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 2 May 2019 16:56:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347021 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 347021 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E73F096D6B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 16:56:04 -0000 Author: kevans Date: Thu May 2 16:56:03 2019 New Revision: 347021 URL: https://svnweb.freebsd.org/changeset/base/347021 Log: fdt: Fix installation of aarch64 dtb r345519 rewrote parts of how we build .dtb, but mistakenly dropped the vendor dir for aarch64. Simply drop the :T for building ${DTB} in the aarch64 case- it'll get applied at install-time as-needed, with :H:T for determining the vendor dir. Reported by: manu Tested by: manu Reviewed by: manu MFC after: 3 days Modified: head/sys/conf/dtb.build.mk Modified: head/sys/conf/dtb.build.mk ============================================================================== --- head/sys/conf/dtb.build.mk Thu May 2 16:28:33 2019 (r347020) +++ head/sys/conf/dtb.build.mk Thu May 2 16:56:03 2019 (r347021) @@ -24,7 +24,16 @@ SYSDIR= ${_dir:tA} .error "can't find kernel source tree" .endif -DTB=${DTS:T:R:S/$/.dtb/} +.for _dts in ${DTS} +# DTB for aarch64 needs to preserve the immediate parent of the .dts, because +# these DTS are vendored and should be installed into their vendored directory. +.if ${MACHINE_ARCH} == "aarch64" +DTB+= ${_dts:R:S/$/.dtb/} +.else +DTB+= ${_dts:T:R:S/$/.dtb/} +.endif +.endfor + DTBO=${DTSO:T:R:S/$/.dtbo/} .SUFFIXES: .dtb .dts .dtbo .dtso From owner-svn-src-all@freebsd.org Thu May 2 16:57:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4688159B0B3; Thu, 2 May 2019 16:57:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A34296F15; Thu, 2 May 2019 16:57:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61BADC2F5; Thu, 2 May 2019 16:57:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42Gve9U084172; Thu, 2 May 2019 16:57:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42Gve4c084171; Thu, 2 May 2019 16:57:40 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905021657.x42Gve4c084171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 2 May 2019 16:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r347022 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 347022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8A34296F15 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 16:57:41 -0000 Author: jhb Date: Thu May 2 16:57:39 2019 New Revision: 347022 URL: https://svnweb.freebsd.org/changeset/base/347022 Log: Release peterj@ from mentorship. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Thu May 2 16:56:03 2019 (r347021) +++ svnadmin/conf/mentors Thu May 2 16:57:39 2019 (r347022) @@ -24,7 +24,6 @@ mahrens mckusick mhorne markj miwi araujo mjoras rstone -peterj jhb Co-mentor: grog ram ken Co-mentor: mav rgrimes phk Co-mentor: bde slavash kib Co-mentor: hselasky From owner-svn-src-all@freebsd.org Thu May 2 17:01:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2979159B2ED; Thu, 2 May 2019 17:01:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5731D97182; Thu, 2 May 2019 17:01:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D36D8C331; Thu, 2 May 2019 17:01:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42H1DIv087802; Thu, 2 May 2019 17:01:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42H1Dg2087801; Thu, 2 May 2019 17:01:13 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905021701.x42H1Dg2087801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 2 May 2019 17:01:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347023 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 347023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5731D97182 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 17:01:14 -0000 Author: kevans Date: Thu May 2 17:01:13 2019 New Revision: 347023 URL: https://svnweb.freebsd.org/changeset/base/347023 Log: stand: correct mis-merge from r346879 Small mis-merge from multiple WIP resulted in block io media handles getting double-initialized. This resulted in some installations oddly landing at the mountroot prompt. Reported by: ler Reviewed by: imp Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Thu May 2 16:57:39 2019 (r347022) +++ head/stand/efi/loader/main.c Thu May 2 17:01:13 2019 (r347023) @@ -910,20 +910,6 @@ main(int argc, CHAR16 *argv[]) uhowto = parse_uefi_con_out(); /* - * Scan the BLOCK IO MEDIA handles then - * march through the device switch probing for things. - */ - i = efipart_inithandles(); - if (i != 0 && i != ENOENT) { - printf("efipart_inithandles failed with ERRNO %d, expect " - "failures\n", i); - } - - for (i = 0; devsw[i] != NULL; i++) - if (devsw[i]->dv_init != NULL) - (devsw[i]->dv_init)(); - - /* * Read additional environment variables from the boot device's * "LoaderEnv" file. Any boot loader environment variable may be set * there, which are subtly different than loader.conf variables. Only From owner-svn-src-all@freebsd.org Thu May 2 17:04:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3DDA159B4E0; Thu, 2 May 2019 17:04:02 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 656279760E; Thu, 2 May 2019 17:04:02 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EDDFC49D; Thu, 2 May 2019 17:04:02 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42H42K0089417; Thu, 2 May 2019 17:04:02 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42H42jR089416; Thu, 2 May 2019 17:04:02 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905021704.x42H42jR089416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 2 May 2019 17:04:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347024 - head/sys/modules/dtb/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/modules/dtb/rockchip X-SVN-Commit-Revision: 347024 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 656279760E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 17:04:03 -0000 Author: manu Date: Thu May 2 17:04:01 2019 New Revision: 347024 URL: https://svnweb.freebsd.org/changeset/base/347024 Log: dtb: Include RK3399 RockPro64 DTS in kernel build The DTS for this board is already present in sys/gnu/dts/arm64/rockchip/ and just needs to be enabled. Submitted by: alex@wied.io Differential Revision: https://reviews.freebsd.org/D19823 Modified: head/sys/modules/dtb/rockchip/Makefile Modified: head/sys/modules/dtb/rockchip/Makefile ============================================================================== --- head/sys/modules/dtb/rockchip/Makefile Thu May 2 17:01:13 2019 (r347023) +++ head/sys/modules/dtb/rockchip/Makefile Thu May 2 17:04:01 2019 (r347024) @@ -1,7 +1,7 @@ # $FreeBSD$ -# For now only for rk3328-rock64 dts file. DTS= \ - rockchip/rk3328-rock64.dts + rockchip/rk3328-rock64.dts \ + rockchip/rk3399-rockpro64.dts .include From owner-svn-src-all@freebsd.org Thu May 2 17:41:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 774F3159C8D7; Thu, 2 May 2019 17:41:43 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C1D26A3C9; Thu, 2 May 2019 17:41:43 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB4BCCB57; Thu, 2 May 2019 17:41:42 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42Hfg4e008767; Thu, 2 May 2019 17:41:42 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42Hfg2J008766; Thu, 2 May 2019 17:41:42 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905021741.x42Hfg2J008766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 2 May 2019 17:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347025 - stable/11/contrib/bsnmp/snmp_mibII X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/contrib/bsnmp/snmp_mibII X-SVN-Commit-Revision: 347025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1C1D26A3C9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 17:41:43 -0000 Author: ae Date: Thu May 2 17:41:42 2019 New Revision: 347025 URL: https://svnweb.freebsd.org/changeset/base/347025 Log: MFC r345798: Create 64bit mibII counters for all interfaces. PR: 157015 Obtained from: Yandex LLC Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII_interfaces.c ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Thu May 2 17:04:01 2019 (r347024) +++ stable/11/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Thu May 2 17:41:42 2019 (r347025) @@ -373,11 +373,6 @@ op_ifxtable(struct snmp_context *ctx, struct snmp_valu switch (op) { - again: - if (op != SNMP_OP_GETNEXT) - return (SNMP_ERR_NOSUCHNAME); - /* FALLTHROUGH */ - case SNMP_OP_GETNEXT: if ((ifp = NEXT_OBJECT_INT(&mibif_list, &value->var, sub)) == NULL) return (SNMP_ERR_NOSUCHNAME); @@ -460,52 +455,36 @@ op_ifxtable(struct snmp_context *ctx, struct snmp_valu break; case LEAF_ifHCInOctets: - if (!(ifp->flags & MIBIF_HIGHSPEED)) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_inoctets; break; case LEAF_ifHCInUcastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_ipackets - MIBIF_PRIV(ifp)->hc_imcasts; break; case LEAF_ifHCInMulticastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_imcasts; break; case LEAF_ifHCInBroadcastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = 0; break; case LEAF_ifHCOutOctets: - if (!(ifp->flags & MIBIF_HIGHSPEED)) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_outoctets; break; case LEAF_ifHCOutUcastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_opackets - MIBIF_PRIV(ifp)->hc_omcasts; break; case LEAF_ifHCOutMulticastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_omcasts; break; case LEAF_ifHCOutBroadcastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = 0; break; From owner-svn-src-all@freebsd.org Thu May 2 17:43:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C660159C997; Thu, 2 May 2019 17:43:49 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3DD96A655; Thu, 2 May 2019 17:43:48 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B079CB8B; Thu, 2 May 2019 17:43:48 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42HhmH5010442; Thu, 2 May 2019 17:43:48 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42Hhm0k010441; Thu, 2 May 2019 17:43:48 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905021743.x42Hhm0k010441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 2 May 2019 17:43:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347026 - stable/12/contrib/bsnmp/snmp_mibII X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/contrib/bsnmp/snmp_mibII X-SVN-Commit-Revision: 347026 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A3DD96A655 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 17:43:49 -0000 Author: ae Date: Thu May 2 17:43:47 2019 New Revision: 347026 URL: https://svnweb.freebsd.org/changeset/base/347026 Log: MFC r345798: Create 64bit mibII counters for all interfaces. PR: 157015 Obtained from: Yandex LLC Modified: stable/12/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/bsnmp/snmp_mibII/mibII_interfaces.c ============================================================================== --- stable/12/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Thu May 2 17:41:42 2019 (r347025) +++ stable/12/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Thu May 2 17:43:47 2019 (r347026) @@ -373,11 +373,6 @@ op_ifxtable(struct snmp_context *ctx, struct snmp_valu switch (op) { - again: - if (op != SNMP_OP_GETNEXT) - return (SNMP_ERR_NOSUCHNAME); - /* FALLTHROUGH */ - case SNMP_OP_GETNEXT: if ((ifp = NEXT_OBJECT_INT(&mibif_list, &value->var, sub)) == NULL) return (SNMP_ERR_NOSUCHNAME); @@ -460,52 +455,36 @@ op_ifxtable(struct snmp_context *ctx, struct snmp_valu break; case LEAF_ifHCInOctets: - if (!(ifp->flags & MIBIF_HIGHSPEED)) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_inoctets; break; case LEAF_ifHCInUcastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_ipackets - MIBIF_PRIV(ifp)->hc_imcasts; break; case LEAF_ifHCInMulticastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_imcasts; break; case LEAF_ifHCInBroadcastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = 0; break; case LEAF_ifHCOutOctets: - if (!(ifp->flags & MIBIF_HIGHSPEED)) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_outoctets; break; case LEAF_ifHCOutUcastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_opackets - MIBIF_PRIV(ifp)->hc_omcasts; break; case LEAF_ifHCOutMulticastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = MIBIF_PRIV(ifp)->hc_omcasts; break; case LEAF_ifHCOutBroadcastPkts: - if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED))) - goto again; value->v.counter64 = 0; break; From owner-svn-src-all@freebsd.org Thu May 2 17:44:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 551D9159CA1D; Thu, 2 May 2019 17:44:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0CFA6A7E6; Thu, 2 May 2019 17:44:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAC7CCB8D; Thu, 2 May 2019 17:44:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42HiklJ010557; Thu, 2 May 2019 17:44:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42HikfO010556; Thu, 2 May 2019 17:44:46 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905021744.x42HikfO010556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 2 May 2019 17:44:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347027 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 347027 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F0CFA6A7E6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 17:44:47 -0000 Author: kevans Date: Thu May 2 17:44:46 2019 New Revision: 347027 URL: https://svnweb.freebsd.org/changeset/base/347027 Log: libbe(3): Properly mount BEs with mountpoint=none Instead of pretending to successfully mount them while not actually mounting anything, we'll now actually mount them *and* claim we mounted them successfully. Reported by: ler MFC after: 3 days Modified: head/lib/libbe/be_access.c Modified: head/lib/libbe/be_access.c ============================================================================== --- head/lib/libbe/be_access.c Thu May 2 17:43:47 2019 (r347026) +++ head/lib/libbe/be_access.c Thu May 2 17:44:46 2019 (r347027) @@ -45,6 +45,7 @@ struct be_mount_info { const char *mountpoint; int mntflags; int deepmount; + int depth; }; static int @@ -79,6 +80,7 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data) char *mountpoint; char tmp[BE_MAXPATHLEN], zfs_mnt[BE_MAXPATHLEN]; struct be_mount_info *info; + char opt; info = (struct be_mount_info *)data; @@ -94,37 +96,50 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data) NULL, NULL, 0, 1)) return (1); - if (strcmp("none", zfs_mnt) != 0) { - char opt = '\0'; + if (strcmp("none", zfs_mnt) == 0) { + /* + * mountpoint=none; we'll mount it at info->mountpoint assuming + * we're at the root. If we're not at the root... that's less + * than stellar and not entirely sure what to do with that. + * For now, we won't treat it as an error condition -- we just + * won't mount it, and we'll continue on. + */ + if (info->depth > 0) + return (0); + snprintf(tmp, BE_MAXPATHLEN, "%s", info->mountpoint); + } else { mountpoint = be_mountpoint_augmented(info->lbh, zfs_mnt); - snprintf(tmp, BE_MAXPATHLEN, "%s%s", info->mountpoint, mountpoint); + } - if ((err = zmount(zfs_get_name(zfs_hdl), tmp, info->mntflags, - __DECONST(char *, MNTTYPE_ZFS), NULL, 0, &opt, 1)) != 0) { - switch (errno) { - case ENAMETOOLONG: - return (set_error(info->lbh, BE_ERR_PATHLEN)); - case ELOOP: - case ENOENT: - case ENOTDIR: - return (set_error(info->lbh, BE_ERR_BADPATH)); - case EPERM: - return (set_error(info->lbh, BE_ERR_PERMS)); - case EBUSY: - return (set_error(info->lbh, BE_ERR_PATHBUSY)); - default: - return (set_error(info->lbh, BE_ERR_UNKNOWN)); - } + opt = '\0'; + if ((err = zmount(zfs_get_name(zfs_hdl), tmp, info->mntflags, + __DECONST(char *, MNTTYPE_ZFS), NULL, 0, &opt, 1)) != 0) { + switch (errno) { + case ENAMETOOLONG: + return (set_error(info->lbh, BE_ERR_PATHLEN)); + case ELOOP: + case ENOENT: + case ENOTDIR: + return (set_error(info->lbh, BE_ERR_BADPATH)); + case EPERM: + return (set_error(info->lbh, BE_ERR_PERMS)); + case EBUSY: + return (set_error(info->lbh, BE_ERR_PATHBUSY)); + default: + return (set_error(info->lbh, BE_ERR_UNKNOWN)); } } if (!info->deepmount) return (0); - return (zfs_iter_filesystems(zfs_hdl, be_mount_iter, info)); + ++info->depth; + err = zfs_iter_filesystems(zfs_hdl, be_mount_iter, info); + --info->depth; + return (err); } @@ -138,9 +153,11 @@ be_umount_iter(zfs_handle_t *zfs_hdl, void *data) info = (struct be_mount_info *)data; + ++info->depth; if((err = zfs_iter_filesystems(zfs_hdl, be_umount_iter, info)) != 0) { return (err); } + --info->depth; if (!zfs_is_mounted(zfs_hdl, &mountpoint)) { return (0); @@ -248,6 +265,7 @@ be_mount(libbe_handle_t *lbh, char *bootenv, char *mou info.mountpoint = (mountpoint == NULL) ? mnt_temp : mountpoint; info.mntflags = mntflags; info.deepmount = mntdeep; + info.depth = 0; if((err = be_mount_iter(zhdl, &info) != 0)) { zfs_close(zhdl); @@ -283,6 +301,7 @@ be_unmount(libbe_handle_t *lbh, char *bootenv, int fla info.be = be; info.mountpoint = NULL; info.mntflags = (flags & BE_MNT_FORCE) ? MS_FORCE : 0; + info.depth = 0; if ((err = be_umount_iter(root_hdl, &info)) != 0) { zfs_close(root_hdl); From owner-svn-src-all@freebsd.org Thu May 2 17:50:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97A04159CCE8; Thu, 2 May 2019 17:50:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D2EC6AE17; Thu, 2 May 2019 17:50:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1760ACBB0; Thu, 2 May 2019 17:50:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42HouWA011839; Thu, 2 May 2019 17:50:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42HoutN011838; Thu, 2 May 2019 17:50:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905021750.x42HoutN011838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 2 May 2019 17:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347028 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 347028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3D2EC6AE17 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 17:50:57 -0000 Author: kevans Date: Thu May 2 17:50:56 2019 New Revision: 347028 URL: https://svnweb.freebsd.org/changeset/base/347028 Log: libbe: set mountpoint=none in be_import If we're going to set a mountpoint at all, mountpoint=none makes more sense than mountpoint=/. MFC after: 3 days Modified: head/lib/libbe/be.c Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Thu May 2 17:44:46 2019 (r347027) +++ head/lib/libbe/be.c Thu May 2 17:50:56 2019 (r347028) @@ -822,7 +822,7 @@ be_import(libbe_handle_t *lbh, const char *bootenv, in nvlist_alloc(&props, NV_UNIQUE_NAME, KM_SLEEP); nvlist_add_string(props, "canmount", "noauto"); - nvlist_add_string(props, "mountpoint", "/"); + nvlist_add_string(props, "mountpoint", "none"); err = zfs_prop_set_list(zfs, props); nvlist_free(props); From owner-svn-src-all@freebsd.org Thu May 2 18:10:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19582159D392; Thu, 2 May 2019 18:10:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B48F36B9AD; Thu, 2 May 2019 18:10:27 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E651CF0B; Thu, 2 May 2019 18:10:27 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42IARGb021789; Thu, 2 May 2019 18:10:27 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42IAN1J021769; Thu, 2 May 2019 18:10:23 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905021810.x42IAN1J021769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 2 May 2019 18:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347029 - in head/sys: amd64/conf arm/conf arm64/conf conf i386/conf mips/conf powerpc/conf sparc64/conf X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: amd64/conf arm/conf arm64/conf conf i386/conf mips/conf powerpc/conf sparc64/conf X-SVN-Commit-Revision: 347029 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B48F36B9AD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 18:10:28 -0000 Author: cem Date: Thu May 2 18:10:23 2019 New Revision: 347029 URL: https://svnweb.freebsd.org/changeset/base/347029 Log: Add a COMPAT_FREEBSD12 kernel option. Use it wherever COMPAT_FREEBSD11 is currently specified, like r309749. Reviewed by: imp, jhb, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20120 Modified: head/sys/amd64/conf/GENERIC head/sys/amd64/conf/MINIMAL head/sys/arm/conf/std.arm head/sys/arm/conf/std.armv6 head/sys/arm/conf/std.armv7 head/sys/arm64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/options head/sys/i386/conf/GENERIC head/sys/i386/conf/MINIMAL head/sys/mips/conf/ERL head/sys/mips/conf/JZ4780 head/sys/mips/conf/X1000 head/sys/mips/conf/std.BERI head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 head/sys/powerpc/conf/MPC85XX head/sys/powerpc/conf/MPC85XXSPE head/sys/sparc64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Thu May 2 17:50:56 2019 (r347028) +++ head/sys/amd64/conf/GENERIC Thu May 2 18:10:23 2019 (r347029) @@ -63,6 +63,7 @@ options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support Modified: head/sys/amd64/conf/MINIMAL ============================================================================== --- head/sys/amd64/conf/MINIMAL Thu May 2 17:50:56 2019 (r347028) +++ head/sys/amd64/conf/MINIMAL Thu May 2 18:10:23 2019 (r347029) @@ -60,6 +60,7 @@ options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support Modified: head/sys/arm/conf/std.arm ============================================================================== --- head/sys/arm/conf/std.arm Thu May 2 17:50:56 2019 (r347028) +++ head/sys/arm/conf/std.arm Thu May 2 18:10:23 2019 (r347029) @@ -4,6 +4,7 @@ options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 # Debugging support. Always need this: makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/std.armv6 ============================================================================== --- head/sys/arm/conf/std.armv6 Thu May 2 17:50:56 2019 (r347028) +++ head/sys/arm/conf/std.armv6 Thu May 2 18:10:23 2019 (r347029) @@ -49,6 +49,7 @@ options MAC # Support for Mandatory Access Control options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 # DTrace support options KDTRACE_HOOKS # Kernel DTrace hooks Modified: head/sys/arm/conf/std.armv7 ============================================================================== --- head/sys/arm/conf/std.armv7 Thu May 2 17:50:56 2019 (r347028) +++ head/sys/arm/conf/std.armv7 Thu May 2 18:10:23 2019 (r347029) @@ -49,6 +49,7 @@ options MAC # Support for Mandatory Access Control options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 # DTrace support options KDTRACE_HOOKS # Kernel DTrace hooks Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Thu May 2 17:50:56 2019 (r347028) +++ head/sys/arm64/conf/GENERIC Thu May 2 18:10:23 2019 (r347029) @@ -54,6 +54,7 @@ options GEOM_RAID # Soft RAID functionality. options GEOM_LABEL # Provides labelization options COMPAT_FREEBSD32 # Compatible with FreeBSD/arm options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu May 2 17:50:56 2019 (r347028) +++ head/sys/conf/NOTES Thu May 2 18:10:23 2019 (r347029) @@ -376,6 +376,9 @@ options COMPAT_FREEBSD10 # Enable FreeBSD11 compatibility syscalls options COMPAT_FREEBSD11 +# Enable FreeBSD12 compatibility syscalls +options COMPAT_FREEBSD12 + # Enable Linux Kernel Programming Interface options COMPAT_LINUXKPI Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu May 2 17:50:56 2019 (r347028) +++ head/sys/conf/options Thu May 2 18:10:23 2019 (r347029) @@ -88,6 +88,7 @@ COMPAT_FREEBSD7 opt_global.h COMPAT_FREEBSD9 opt_global.h COMPAT_FREEBSD10 opt_global.h COMPAT_FREEBSD11 opt_global.h +COMPAT_FREEBSD12 opt_global.h COMPAT_CLOUDABI32 opt_dontuse.h COMPAT_CLOUDABI64 opt_dontuse.h COMPAT_LINUXKPI opt_dontuse.h Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Thu May 2 17:50:56 2019 (r347028) +++ head/sys/i386/conf/GENERIC Thu May 2 18:10:23 2019 (r347029) @@ -60,6 +60,7 @@ options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support Modified: head/sys/i386/conf/MINIMAL ============================================================================== --- head/sys/i386/conf/MINIMAL Thu May 2 17:50:56 2019 (r347028) +++ head/sys/i386/conf/MINIMAL Thu May 2 18:10:23 2019 (r347029) @@ -60,6 +60,7 @@ options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support Modified: head/sys/mips/conf/ERL ============================================================================== --- head/sys/mips/conf/ERL Thu May 2 17:50:56 2019 (r347028) +++ head/sys/mips/conf/ERL Thu May 2 18:10:23 2019 (r347029) @@ -75,6 +75,7 @@ options GEOM_LABEL # Provides labelization options COMPAT_FREEBSD32 # Compatible with o32 binaries options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support Modified: head/sys/mips/conf/JZ4780 ============================================================================== --- head/sys/mips/conf/JZ4780 Thu May 2 17:50:56 2019 (r347028) +++ head/sys/mips/conf/JZ4780 Thu May 2 18:10:23 2019 (r347029) @@ -31,6 +31,7 @@ options BREAK_TO_DEBUGGER options COMPAT_FREEBSD10 options COMPAT_FREEBSD11 +options COMPAT_FREEBSD12 options SCHED_4BSD #4BSD scheduler options INET #InterNETworking Modified: head/sys/mips/conf/X1000 ============================================================================== --- head/sys/mips/conf/X1000 Thu May 2 17:50:56 2019 (r347028) +++ head/sys/mips/conf/X1000 Thu May 2 18:10:23 2019 (r347029) @@ -29,6 +29,7 @@ options BREAK_TO_DEBUGGER options COMPAT_FREEBSD10 options COMPAT_FREEBSD11 +options COMPAT_FREEBSD12 options SCHED_4BSD #4BSD scheduler options INET #InterNETworking Modified: head/sys/mips/conf/std.BERI ============================================================================== --- head/sys/mips/conf/std.BERI Thu May 2 17:50:56 2019 (r347028) +++ head/sys/mips/conf/std.BERI Thu May 2 18:10:23 2019 (r347029) @@ -33,6 +33,7 @@ options CAPABILITIES options COMPAT_FREEBSD10 options COMPAT_FREEBSD11 +options COMPAT_FREEBSD12 options INTRNG options SCHED_ULE Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Thu May 2 17:50:56 2019 (r347028) +++ head/sys/powerpc/conf/GENERIC Thu May 2 18:10:23 2019 (r347029) @@ -68,6 +68,7 @@ options COMPAT_FREEBSD7 #Compatible with FreeBSD7 options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI options KTRACE #ktrace(1) syscall trace support options STACK #stack(9) support Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Thu May 2 17:50:56 2019 (r347028) +++ head/sys/powerpc/conf/GENERIC64 Thu May 2 18:10:23 2019 (r347029) @@ -72,6 +72,7 @@ options COMPAT_FREEBSD7 #Compatible with FreeBSD7 options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI options KTRACE #ktrace(1) syscall trace support options STACK #stack(9) support Modified: head/sys/powerpc/conf/MPC85XX ============================================================================== --- head/sys/powerpc/conf/MPC85XX Thu May 2 17:50:56 2019 (r347028) +++ head/sys/powerpc/conf/MPC85XX Thu May 2 18:10:23 2019 (r347029) @@ -61,6 +61,7 @@ options WITNESS options WITNESS_SKIPSPIN options COMPAT_FREEBSD10 options COMPAT_FREEBSD11 +options COMPAT_FREEBSD12 options HWPMC_HOOKS options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # Kernel ELF linker loads CTF data Modified: head/sys/powerpc/conf/MPC85XXSPE ============================================================================== --- head/sys/powerpc/conf/MPC85XXSPE Thu May 2 17:50:56 2019 (r347028) +++ head/sys/powerpc/conf/MPC85XXSPE Thu May 2 18:10:23 2019 (r347029) @@ -62,6 +62,7 @@ options WITNESS options WITNESS_SKIPSPIN options COMPAT_FREEBSD10 options COMPAT_FREEBSD11 +options COMPAT_FREEBSD12 options HWPMC_HOOKS options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # Kernel ELF linker loads CTF data Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Thu May 2 17:50:56 2019 (r347028) +++ head/sys/sparc64/conf/GENERIC Thu May 2 18:10:23 2019 (r347029) @@ -58,6 +58,7 @@ options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support From owner-svn-src-all@freebsd.org Thu May 2 19:02:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19363159EC7F; Thu, 2 May 2019 19:02:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0F026E289; Thu, 2 May 2019 19:02:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 879E3D929; Thu, 2 May 2019 19:02:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42J2GNw052950; Thu, 2 May 2019 19:02:16 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42J2GVA052949; Thu, 2 May 2019 19:02:16 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905021902.x42J2GVA052949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 2 May 2019 19:02:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347030 - head/sys/compat/linprocfs X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linprocfs X-SVN-Commit-Revision: 347030 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B0F026E289 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 19:02:17 -0000 Author: trasz Date: Thu May 2 19:02:16 2019 New Revision: 347030 URL: https://svnweb.freebsd.org/changeset/base/347030 Log: Fix flags in cpuinfo. Reviewed by: dchagin MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20139 Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Thu May 2 18:10:23 2019 (r347029) +++ head/sys/compat/linprocfs/linprocfs.c Thu May 2 19:02:16 2019 (r347030) @@ -215,11 +215,11 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) static char *flags[] = { "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce", "cx8", "apic", - "sep", "sep", "mtrr", "pge", "mca", - "cmov", "pat", "pse36", "pn", "b19", - "b20", "b21", "mmxext", "mmx", "fxsr", - "xmm", "sse2", "b27", "b28", "b29", - "3dnowext", "3dnow" + "", "sep", "mtrr", "pge", "mca", + "cmov", "pat", "pse36", "pn", "clflush", + "", "dts", "acpi", "mmx", "fxsr", + "sse", "sse2", "ss", "ht", "tm", + "ia64", "pbe" }; static char *power_flags[] = { @@ -287,7 +287,7 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) CPUID_TO_FAMILY(cpu_id), "yes"); sbuf_cat(sb, "flags\t\t:"); for (j = 0; j < nitems(flags); j++) - if (cpu_feature & (1 << j)) + if (cpu_feature & (1 << j) && flags[j][0] != '\0') sbuf_printf(sb, " %s", flags[j]); sbuf_cat(sb, "\n"); sbuf_printf(sb, From owner-svn-src-all@freebsd.org Thu May 2 19:13:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1DB0159EF9A; Thu, 2 May 2019 19:13:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6389D6E8AE; Thu, 2 May 2019 19:13:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35630DAF0; Thu, 2 May 2019 19:13:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42JDVJ0058681; Thu, 2 May 2019 19:13:31 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42JDVIK058680; Thu, 2 May 2019 19:13:31 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201905021913.x42JDVIK058680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 2 May 2019 19:13:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347031 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 347031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6389D6E8AE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 19:13:32 -0000 Author: emaste Date: Thu May 2 19:13:31 2019 New Revision: 347031 URL: https://svnweb.freebsd.org/changeset/base/347031 Log: iflib: remove assertion that isc_capabilities is nonzero It's atypical, but not invalid, for a driver to pass no capabilities. Submitted by: Gerald Aryeetey Reviewed by: shurd MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20142 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu May 2 19:02:16 2019 (r347030) +++ head/sys/net/iflib.c Thu May 2 19:13:31 2019 (r347031) @@ -4584,7 +4584,6 @@ iflib_device_register(device_t dev, void *sc, if_share ctx->ifc_txrx = *scctx->isc_txrx; #ifdef INVARIANTS - MPASS(scctx->isc_capabilities); if (scctx->isc_capabilities & IFCAP_TXCSUM) MPASS(scctx->isc_tx_csum_flags); #endif @@ -4825,7 +4824,6 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc ifmedia_set(&ctx->ifc_media, IFM_ETHER | IFM_AUTO); #ifdef INVARIANTS - MPASS(scctx->isc_capabilities); if (scctx->isc_capabilities & IFCAP_TXCSUM) MPASS(scctx->isc_tx_csum_flags); #endif From owner-svn-src-all@freebsd.org Thu May 2 19:59:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF21D15A0000; Thu, 2 May 2019 19:59:38 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79FBE6FFCC; Thu, 2 May 2019 19:59:38 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BB90E228; Thu, 2 May 2019 19:59:38 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42Jxc8H079630; Thu, 2 May 2019 19:59:38 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42JxcX6079629; Thu, 2 May 2019 19:59:38 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905021959.x42JxcX6079629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 2 May 2019 19:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347032 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 347032 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 79FBE6FFCC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 19:59:39 -0000 Author: asomers Date: Thu May 2 19:59:37 2019 New Revision: 347032 URL: https://svnweb.freebsd.org/changeset/base/347032 Log: directory.3: add a STANDARDS section Reviewed by: jilles, ngie MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20111 Modified: head/lib/libc/gen/directory.3 Modified: head/lib/libc/gen/directory.3 ============================================================================== --- head/lib/libc/gen/directory.3 Thu May 2 19:13:31 2019 (r347031) +++ head/lib/libc/gen/directory.3 Thu May 2 19:59:37 2019 (r347032) @@ -28,7 +28,7 @@ .\" @(#)directory.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd May 22, 2017 +.Dd April 30, 2019 .Dt DIRECTORY 3 .Os .Sh NAME @@ -264,6 +264,30 @@ return (NOT_FOUND); .Xr open 2 , .Xr read 2 , .Xr dir 5 +.Sh STANDARDS +The +.Fn closedir , +.Fn dirfd , +.Fn fdopendir , +.Fn opendir , +.Fn readdir , +.Fn readdir_r , +.Fn rewinddir , +.Fn seekdir +and +.Fn telldir +functions are expected to conform to +.St -p1003.1-2008 . +The +.Fn fdclosedir +function and the +.Fa d_off , +.Fa d_reclen +and +.Fa d_type +fields of +.Vt struct dirent +are non-standard, and should not be used in portable programs. .Sh HISTORY The .Fn opendir , From owner-svn-src-all@freebsd.org Thu May 2 22:46:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A302715A31E0; Thu, 2 May 2019 22:46:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4844774C1D; Thu, 2 May 2019 22:46:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20E5BFF71; Thu, 2 May 2019 22:46:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42MkcTw068258; Thu, 2 May 2019 22:46:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42MkbFr068255; Thu, 2 May 2019 22:46:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905022246.x42MkbFr068255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 2 May 2019 22:46:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347033 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 347033 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4844774C1D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 22:46:38 -0000 Author: jhb Date: Thu May 2 22:46:37 2019 New Revision: 347033 URL: https://svnweb.freebsd.org/changeset/base/347033 Log: Increase the VirtIO segment count to support modern Windows guests. The Windows virtio driver ignores the advertized seg_max field and assumes the host can accept up to 67 segments in indirect descriptors, triggering an assert in the bhyve process. This brings back r282922 but with a couple of changes: - It raises the block interface segment limit to 128 instead of 67. - Linux's virtio driver assumes that the segment limit is no larger than the ring size. To avoid breaking Linux guests, raise the VirtIO ring size to 128, and cap the VirtIO segment limit at ring size - 2 (effectively 126). Reviewed by: rgrimes, Patrick Mooney Obtained from: Joyent (Linux workaround) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18831 Modified: head/usr.sbin/bhyve/block_if.c head/usr.sbin/bhyve/block_if.h head/usr.sbin/bhyve/pci_virtio_block.c Modified: head/usr.sbin/bhyve/block_if.c ============================================================================== --- head/usr.sbin/bhyve/block_if.c Thu May 2 19:59:37 2019 (r347032) +++ head/usr.sbin/bhyve/block_if.c Thu May 2 22:46:37 2019 (r347033) @@ -65,7 +65,7 @@ __FBSDID("$FreeBSD$"); #define BLOCKIF_SIG 0xb109b109 #define BLOCKIF_NUMTHR 8 -#define BLOCKIF_MAXREQ (64 + BLOCKIF_NUMTHR) +#define BLOCKIF_MAXREQ (BLOCKIF_RING_MAX + BLOCKIF_NUMTHR) enum blockop { BOP_READ, Modified: head/usr.sbin/bhyve/block_if.h ============================================================================== --- head/usr.sbin/bhyve/block_if.h Thu May 2 19:59:37 2019 (r347032) +++ head/usr.sbin/bhyve/block_if.h Thu May 2 22:46:37 2019 (r347033) @@ -41,7 +41,13 @@ #include #include -#define BLOCKIF_IOV_MAX 33 /* not practical to be IOV_MAX */ +/* + * BLOCKIF_IOV_MAX is the maximum number of scatter/gather entries in + * a single request. BLOCKIF_RING_MAX is the maxmimum number of + * pending requests that can be queued. + */ +#define BLOCKIF_IOV_MAX 128 /* not practical to be IOV_MAX */ +#define BLOCKIF_RING_MAX 128 struct blockif_req { int br_iovcnt; Modified: head/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_block.c Thu May 2 19:59:37 2019 (r347032) +++ head/usr.sbin/bhyve/pci_virtio_block.c Thu May 2 22:46:37 2019 (r347033) @@ -3,6 +3,7 @@ * * Copyright (c) 2011 NetApp, Inc. * All rights reserved. + * Copyright (c) 2019 Joyent, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -55,8 +56,10 @@ __FBSDID("$FreeBSD$"); #include "virtio.h" #include "block_if.h" -#define VTBLK_RINGSZ 64 +#define VTBLK_RINGSZ 128 +_Static_assert(VTBLK_RINGSZ <= BLOCKIF_RING_MAX, "Each ring entry must be able to queue a request"); + #define VTBLK_S_OK 0 #define VTBLK_S_IOERR 1 #define VTBLK_S_UNSUPP 2 @@ -351,7 +354,15 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst * /* setup virtio block config space */ sc->vbsc_cfg.vbc_capacity = size / DEV_BSIZE; /* 512-byte units */ sc->vbsc_cfg.vbc_size_max = 0; /* not negotiated */ - sc->vbsc_cfg.vbc_seg_max = BLOCKIF_IOV_MAX; + + /* + * If Linux is presented with a seg_max greater than the virtio queue + * size, it can stumble into situations where it violates its own + * invariants and panics. For safety, we keep seg_max clamped, paying + * heed to the two extra descriptors needed for the header and status + * of a request. + */ + sc->vbsc_cfg.vbc_seg_max = MIN(VTBLK_RINGSZ - 2, BLOCKIF_IOV_MAX); sc->vbsc_cfg.vbc_geometry.cylinders = 0; /* no geometry */ sc->vbsc_cfg.vbc_geometry.heads = 0; sc->vbsc_cfg.vbc_geometry.sectors = 0; From owner-svn-src-all@freebsd.org Thu May 2 23:59:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBE0615A4816; Thu, 2 May 2019 23:59:45 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92DB576975; Thu, 2 May 2019 23:59:45 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C77918B86; Thu, 2 May 2019 23:59:45 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42NxjsC005113; Thu, 2 May 2019 23:59:45 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42Nxijh005089; Thu, 2 May 2019 23:59:44 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201905022359.x42Nxijh005089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 2 May 2019 23:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347034 - in stable/11: . etc/pkg gnu/usr.bin/groff/tmac lib/clang sys/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable/11: . etc/pkg gnu/usr.bin/groff/tmac lib/clang sys/conf X-SVN-Commit-Revision: 347034 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 92DB576975 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 23:59:46 -0000 Author: gjb Date: Thu May 2 23:59:44 2019 New Revision: 347034 URL: https://svnweb.freebsd.org/changeset/base/347034 Log: Update stable/11 from 11.2-STABLE to 11.3-PRERELEASE, marking the official start of the code slush for the 11.3-RELEASE cycle. Set the default mdoc(7) version to 11.3, and update the clang(1) TARGET_TRIPLE to reflect 11.3. Update the default pkg(8) repository to the 'quarterly' branch to prevent further 11.3 builds from downgrading packages when invoking 'pkg upgrade' for the duration of the cycle. This will be reverted on the stable/11 branch once releng/11.3 is branched. [*] Approved by: re (implicit) MFC after: 6 weeks MFC note: reminder to revert pkg(8) default repository [8] Sponsored by: The FreeBSD Foundation Modified: stable/11/Makefile.inc1 stable/11/etc/pkg/FreeBSD.conf stable/11/gnu/usr.bin/groff/tmac/mdoc.local.in stable/11/lib/clang/llvm.build.mk stable/11/sys/conf/newvers.sh Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Thu May 2 22:46:37 2019 (r347033) +++ stable/11/Makefile.inc1 Thu May 2 23:59:44 2019 (r347034) @@ -605,7 +605,7 @@ XCXXFLAGS+= -isystem ${WORLDTMP}/usr/include/c++/v1 -s .endif .else TARGET_ABI?= unknown -TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.2 +TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.3 XCFLAGS+= -target ${TARGET_TRIPLE} .endif XCFLAGS+= --sysroot=${WORLDTMP} Modified: stable/11/etc/pkg/FreeBSD.conf ============================================================================== --- stable/11/etc/pkg/FreeBSD.conf Thu May 2 22:46:37 2019 (r347033) +++ stable/11/etc/pkg/FreeBSD.conf Thu May 2 23:59:44 2019 (r347034) @@ -8,7 +8,7 @@ # FreeBSD: { - url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest", + url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", Modified: stable/11/gnu/usr.bin/groff/tmac/mdoc.local.in ============================================================================== --- stable/11/gnu/usr.bin/groff/tmac/mdoc.local.in Thu May 2 22:46:37 2019 (r347033) +++ stable/11/gnu/usr.bin/groff/tmac/mdoc.local.in Thu May 2 23:59:44 2019 (r347034) @@ -50,7 +50,7 @@ .ds doc-str-Lb-libstdthreads C11 Threads Library (libstdthreads, \-lstdthreads) . .\" Default .Os value -.ds doc-default-operating-system FreeBSD\~11.2 +.ds doc-default-operating-system FreeBSD\~11.3 . .\" FreeBSD releases not found in doc-common .ds doc-operating-system-FreeBSD-2.2.9 2.2.9 @@ -68,6 +68,7 @@ .ds doc-operating-system-FreeBSD-11.0 11.0 .ds doc-operating-system-FreeBSD-11.1 11.1 .ds doc-operating-system-FreeBSD-11.2 11.2 +.ds doc-operating-system-FreeBSD-11.3 11.3 . .\" Definitions for other *BSDs not (yet) in doc-common .ds doc-operating-system-NetBSD-7.0 7.0 Modified: stable/11/lib/clang/llvm.build.mk ============================================================================== --- stable/11/lib/clang/llvm.build.mk Thu May 2 22:46:37 2019 (r347033) +++ stable/11/lib/clang/llvm.build.mk Thu May 2 23:59:44 2019 (r347034) @@ -33,7 +33,7 @@ TARGET_ABI= -gnueabi TARGET_ABI= .endif VENDOR= unknown -OS_VERSION= freebsd11.2 +OS_VERSION= freebsd11.3 LLVM_TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/:C/arm64/aarch64/}-${VENDOR}-${OS_VERSION}${TARGET_ABI} LLVM_BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/:C/arm64/aarch64/}-${VENDOR}-${OS_VERSION} Modified: stable/11/sys/conf/newvers.sh ============================================================================== --- stable/11/sys/conf/newvers.sh Thu May 2 22:46:37 2019 (r347033) +++ stable/11/sys/conf/newvers.sh Thu May 2 23:59:44 2019 (r347034) @@ -43,8 +43,8 @@ # included if the tree is modified. TYPE="FreeBSD" -REVISION="11.2" -BRANCH="STABLE" +REVISION="11.3" +BRANCH="PRERELEASE" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri May 3 00:02:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5561615A4B0E; Fri, 3 May 2019 00:02:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF03A76F70; Fri, 3 May 2019 00:02:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C723818D10; Fri, 3 May 2019 00:02:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43027Tb009293; Fri, 3 May 2019 00:02:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43027NL009292; Fri, 3 May 2019 00:02:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905030002.x43027NL009292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 3 May 2019 00:02:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347035 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/usr.sbin/bhyve X-SVN-Commit-Revision: 347035 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EF03A76F70 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 00:02:08 -0000 Author: jhb Date: Fri May 3 00:02:07 2019 New Revision: 347035 URL: https://svnweb.freebsd.org/changeset/base/347035 Log: MFC 313732: bhyve: whitespace fix for r313727 Modified: stable/11/usr.sbin/bhyve/consport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/consport.c ============================================================================== --- stable/11/usr.sbin/bhyve/consport.c Thu May 2 23:59:44 2019 (r347034) +++ stable/11/usr.sbin/bhyve/consport.c Fri May 3 00:02:07 2019 (r347035) @@ -136,11 +136,14 @@ console_handler(struct vmctx *ctx, int vcpu, int in, i if (!opened) { #ifndef WITHOUT_CAPSICUM - cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, CAP_WRITE); - if (cap_rights_limit(STDIN_FILENO, &rights) == -1 && errno != ENOSYS) - errx(EX_OSERR, "Unable to apply rights for sandbox"); - if (cap_ioctls_limit(STDIN_FILENO, cmds, nitems(cmds)) == -1 && errno != ENOSYS) - errx(EX_OSERR, "Unable to apply rights for sandbox"); + cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, + CAP_WRITE); + if (cap_rights_limit(STDIN_FILENO, &rights) == -1 && + errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (cap_ioctls_limit(STDIN_FILENO, cmds, nitems(cmds)) == -1 && + errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); #endif ttyopen(); opened = 1; From owner-svn-src-all@freebsd.org Fri May 3 00:20:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B5BE15A51BB; Fri, 3 May 2019 00:20:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 933477789D; Fri, 3 May 2019 00:20:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BEC018EF4; Fri, 3 May 2019 00:20:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x430K3IY016054; Fri, 3 May 2019 00:20:03 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x430K3Hb016053; Fri, 3 May 2019 00:20:03 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905030020.x430K3Hb016053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 3 May 2019 00:20:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347036 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/usr.sbin/bhyve X-SVN-Commit-Revision: 347036 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 933477789D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 00:20:04 -0000 Author: jhb Date: Fri May 3 00:20:02 2019 New Revision: 347036 URL: https://svnweb.freebsd.org/changeset/base/347036 Log: MFC 325727: bhyve: avoid applying capsicum capabilities to file that was not opened When using -l option targeting file that can't be opened (ie. nmdm module is not loaded and /dev/nmdm* is specified) bhyve tries to apply capsicum capabilities to a file that was not opened. Enclose that code in an if statement and only run it on correctly opened descriptor also providing meaningful message in case of an error. Modified: stable/11/usr.sbin/bhyve/uart_emul.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/uart_emul.c ============================================================================== --- stable/11/usr.sbin/bhyve/uart_emul.c Fri May 3 00:02:07 2019 (r347035) +++ stable/11/usr.sbin/bhyve/uart_emul.c Fri May 3 00:20:02 2019 (r347036) @@ -680,25 +680,35 @@ uart_set_backend(struct uart_softc *sc, const char *op if (retval == 0) retval = fcntl(sc->tty.fd, F_SETFL, O_NONBLOCK); + if (retval == 0) { #ifndef WITHOUT_CAPSICUM - cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, CAP_WRITE); - if (cap_rights_limit(sc->tty.fd, &rights) == -1 && errno != ENOSYS) - errx(EX_OSERR, "Unable to apply rights for sandbox"); - if (cap_ioctls_limit(sc->tty.fd, cmds, nitems(cmds)) == -1 && errno != ENOSYS) - errx(EX_OSERR, "Unable to apply rights for sandbox"); - if (!uart_stdio) { - cap_rights_init(&rights, CAP_FCNTL, CAP_FSTAT, CAP_IOCTL, CAP_READ); - if (cap_rights_limit(STDIN_FILENO, &rights) == -1 && errno != ENOSYS) + cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, + CAP_WRITE); + if (cap_rights_limit(sc->tty.fd, &rights) == -1 && + errno != ENOSYS) errx(EX_OSERR, "Unable to apply rights for sandbox"); - if (cap_ioctls_limit(STDIN_FILENO, sicmds, nitems(sicmds)) == -1 && errno != ENOSYS) + if (cap_ioctls_limit(sc->tty.fd, cmds, nitems(cmds)) == -1 && + errno != ENOSYS) errx(EX_OSERR, "Unable to apply rights for sandbox"); - if (cap_fcntls_limit(STDIN_FILENO, CAP_FCNTL_GETFL) == -1 && errno != ENOSYS) - errx(EX_OSERR, "Unable to apply rights for sandbox"); - } + if (!uart_stdio) { + cap_rights_init(&rights, CAP_FCNTL, CAP_FSTAT, + CAP_IOCTL, CAP_READ); + if (cap_rights_limit(STDIN_FILENO, &rights) == -1 && + errno != ENOSYS) + errx(EX_OSERR, + "Unable to apply rights for sandbox"); + if (cap_ioctls_limit(STDIN_FILENO, sicmds, + nitems(sicmds)) == -1 && errno != ENOSYS) + errx(EX_OSERR, + "Unable to apply rights for sandbox"); + if (cap_fcntls_limit(STDIN_FILENO, CAP_FCNTL_GETFL) == + -1 && errno != ENOSYS) + errx(EX_OSERR, + "Unable to apply rights for sandbox"); + } #endif - - if (retval == 0) uart_opentty(sc); + } return (retval); } From owner-svn-src-all@freebsd.org Fri May 3 00:45:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3157C15A57BC; Fri, 3 May 2019 00:45:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C87A48045D; Fri, 3 May 2019 00:45:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1DED193F1; Fri, 3 May 2019 00:45:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x430jWB4031719; Fri, 3 May 2019 00:45:32 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x430jWg6031716; Fri, 3 May 2019 00:45:32 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201905030045.x430jWg6031716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 3 May 2019 00:45:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347037 - in stable: 11/release 11/release/tools 12/release 12/release/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 11/release 11/release/tools 12/release 12/release/tools X-SVN-Commit-Revision: 347037 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C87A48045D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 00:45:33 -0000 Author: gjb Date: Fri May 3 00:45:31 2019 New Revision: 347037 URL: https://svnweb.freebsd.org/changeset/base/347037 Log: MFC r346959: Reduce the default image size for virtual machine disk images from 30GB to 3GB. The raw images can be resized using truncate(1), and other formats can be resized with tools included in hypervisors. Enable the growfs(8) rc(8) at firstboot if the disk was resized prior to booting the virtual machine for the first time. Sponsored by: The FreeBSD Foundation Modified: stable/11/release/Makefile.vm stable/11/release/tools/gce.conf stable/11/release/tools/vmimage.subr Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/release/Makefile.vm stable/12/release/tools/gce.conf stable/12/release/tools/vmimage.subr Directory Properties: stable/12/ (props changed) Modified: stable/11/release/Makefile.vm ============================================================================== --- stable/11/release/Makefile.vm Fri May 3 00:20:02 2019 (r347036) +++ stable/11/release/Makefile.vm Fri May 3 00:45:31 2019 (r347037) @@ -7,7 +7,7 @@ VMTARGETS= vm-image VMFORMATS?= vhd vmdk qcow2 raw -VMSIZE?= 30G +VMSIZE?= 3072M SWAPSIZE?= 1G VMBASE?= vm Modified: stable/11/release/tools/gce.conf ============================================================================== --- stable/11/release/tools/gce.conf Fri May 3 00:20:02 2019 (r347036) +++ stable/11/release/tools/gce.conf Fri May 3 00:45:31 2019 (r347037) @@ -3,9 +3,6 @@ # $FreeBSD$ # -# Reduce VMSIZE to be below the free quota limit. -export VMSIZE=27G - # Set to a list of packages to install. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \ google-cloud-sdk panicmail sudo sysutils/py-google-compute-engine \ Modified: stable/11/release/tools/vmimage.subr ============================================================================== --- stable/11/release/tools/vmimage.subr Fri May 3 00:20:02 2019 (r347036) +++ stable/11/release/tools/vmimage.subr Fri May 3 00:45:31 2019 (r347037) @@ -179,6 +179,9 @@ vm_extra_enable_services() { if [ -z "${VMCONFIG}" -o -c "${VMCONFIG}" ]; then echo 'ifconfig_DEFAULT="DHCP inet6 accept_rtadv"' >> \ ${DESTDIR}/etc/rc.conf + # Expand the filesystem to fill the disk. + echo 'growfs_enable="YES"' >> ${DESTDIR}/etc/rc.conf + touch ${DESTDIR}/firstboot fi return 0 From owner-svn-src-all@freebsd.org Fri May 3 00:45:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0290A15A57C0; Fri, 3 May 2019 00:45:34 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BE0C8045E; Fri, 3 May 2019 00:45:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C41D193F2; Fri, 3 May 2019 00:45:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x430jXxp031727; Fri, 3 May 2019 00:45:33 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x430jWd4031724; Fri, 3 May 2019 00:45:32 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201905030045.x430jWd4031724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 3 May 2019 00:45:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347037 - in stable: 11/release 11/release/tools 12/release 12/release/tools X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 11/release 11/release/tools 12/release 12/release/tools X-SVN-Commit-Revision: 347037 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9BE0C8045E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 00:45:34 -0000 Author: gjb Date: Fri May 3 00:45:31 2019 New Revision: 347037 URL: https://svnweb.freebsd.org/changeset/base/347037 Log: MFC r346959: Reduce the default image size for virtual machine disk images from 30GB to 3GB. The raw images can be resized using truncate(1), and other formats can be resized with tools included in hypervisors. Enable the growfs(8) rc(8) at firstboot if the disk was resized prior to booting the virtual machine for the first time. Sponsored by: The FreeBSD Foundation Modified: stable/12/release/Makefile.vm stable/12/release/tools/gce.conf stable/12/release/tools/vmimage.subr Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/release/Makefile.vm stable/11/release/tools/gce.conf stable/11/release/tools/vmimage.subr Directory Properties: stable/11/ (props changed) Modified: stable/12/release/Makefile.vm ============================================================================== --- stable/12/release/Makefile.vm Fri May 3 00:20:02 2019 (r347036) +++ stable/12/release/Makefile.vm Fri May 3 00:45:31 2019 (r347037) @@ -7,7 +7,7 @@ VMTARGETS= vm-image VMFORMATS?= vhd vmdk qcow2 raw -VMSIZE?= 30G +VMSIZE?= 3072M SWAPSIZE?= 1G VMBASE?= vm Modified: stable/12/release/tools/gce.conf ============================================================================== --- stable/12/release/tools/gce.conf Fri May 3 00:20:02 2019 (r347036) +++ stable/12/release/tools/gce.conf Fri May 3 00:45:31 2019 (r347037) @@ -3,9 +3,6 @@ # $FreeBSD$ # -# Reduce VMSIZE to be below the free quota limit. -export VMSIZE=27G - # Set to a list of packages to install. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \ google-cloud-sdk panicmail sudo sysutils/py-google-compute-engine \ Modified: stable/12/release/tools/vmimage.subr ============================================================================== --- stable/12/release/tools/vmimage.subr Fri May 3 00:20:02 2019 (r347036) +++ stable/12/release/tools/vmimage.subr Fri May 3 00:45:31 2019 (r347037) @@ -175,6 +175,9 @@ vm_extra_enable_services() { if [ -z "${VMCONFIG}" -o -c "${VMCONFIG}" ]; then echo 'ifconfig_DEFAULT="DHCP inet6 accept_rtadv"' >> \ ${DESTDIR}/etc/rc.conf + # Expand the filesystem to fill the disk. + echo 'growfs_enable="YES"' >> ${DESTDIR}/etc/rc.conf + touch ${DESTDIR}/firstboot fi return 0 From owner-svn-src-all@freebsd.org Fri May 3 02:03:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD7CB1580D6C; Fri, 3 May 2019 02:03:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49DB6826B0; Fri, 3 May 2019 02:03:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 358711A149; Fri, 3 May 2019 02:03:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4323TWJ074473; Fri, 3 May 2019 02:03:29 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4323TZk074469; Fri, 3 May 2019 02:03:29 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201905030203.x4323TZk074469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 3 May 2019 02:03:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347038 - in stable/12/sys/fs: nfs nfsserver X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in stable/12/sys/fs: nfs nfsserver X-SVN-Commit-Revision: 347038 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 49DB6826B0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 02:03:31 -0000 Author: rmacklem Date: Fri May 3 02:03:29 2019 New Revision: 347038 URL: https://svnweb.freebsd.org/changeset/base/347038 Log: MFC: r346365 Fix the NFSv4.0 server so that it does not support NFSv4.1 attributes. During inspection of a packet trace, I noticed that an NFSv4.0 mount reported that it supported attributes that are only defined for NFSv4.1. In practice, this bug appears to be benign, since NFSv4.0 clients will not use attributes that were added for NFSv4.1. However, this was not correct and this patch fixes the NFSv4.0 server so that it only supports attributes defined for NFSv4.0. It also adds a definition for NFSv4.1 attributes that can only be set, although it is only defined as 0 for now. This is anticipation of the addition of support for the NFSv4.1 mode+mask attribute soon. Modified: stable/12/sys/fs/nfs/nfs.h stable/12/sys/fs/nfs/nfs_commonsubs.c stable/12/sys/fs/nfs/nfsproto.h stable/12/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfs/nfs.h ============================================================================== --- stable/12/sys/fs/nfs/nfs.h Fri May 3 00:45:31 2019 (r347037) +++ stable/12/sys/fs/nfs/nfs.h Fri May 3 02:03:29 2019 (r347038) @@ -423,10 +423,14 @@ typedef struct { (t)->bits[2] = (f)->bits[2]; \ } while (0) -#define NFSSETSUPP_ATTRBIT(b) do { \ +#define NFSSETSUPP_ATTRBIT(b, n) do { \ (b)->bits[0] = NFSATTRBIT_SUPP0; \ - (b)->bits[1] = (NFSATTRBIT_SUPP1 | NFSATTRBIT_SUPPSETONLY); \ - (b)->bits[2] = NFSATTRBIT_SUPP2; \ + (b)->bits[1] = (NFSATTRBIT_SUPP1 | NFSATTRBIT_SUPPSETONLY1); \ + (b)->bits[2] = (NFSATTRBIT_SUPP2 | NFSATTRBIT_SUPPSETONLY2); \ + if (((n)->nd_flag & ND_NFSV41) == 0) { \ + (b)->bits[1] &= ~NFSATTRBIT_NFSV41_1; \ + (b)->bits[2] &= ~NFSATTRBIT_NFSV41_2; \ + } \ } while (0) #define NFSISSET_ATTRBIT(b, p) ((b)->bits[(p) / 32] & (1 << ((p) % 32))) @@ -445,16 +449,22 @@ typedef struct { (b)->bits[2] &= ((a)->bits[2]); \ } while (0) -#define NFSCLRNOTFILLABLE_ATTRBIT(b) do { \ +#define NFSCLRNOTFILLABLE_ATTRBIT(b, n) do { \ (b)->bits[0] &= NFSATTRBIT_SUPP0; \ (b)->bits[1] &= NFSATTRBIT_SUPP1; \ (b)->bits[2] &= NFSATTRBIT_SUPP2; \ + if (((n)->nd_flag & ND_NFSV41) == 0) { \ + (b)->bits[1] &= ~NFSATTRBIT_NFSV41_1; \ + (b)->bits[2] &= ~NFSATTRBIT_NFSV41_2; \ + } \ } while (0) -#define NFSCLRNOTSETABLE_ATTRBIT(b) do { \ +#define NFSCLRNOTSETABLE_ATTRBIT(b, n) do { \ (b)->bits[0] &= NFSATTRBIT_SETABLE0; \ (b)->bits[1] &= NFSATTRBIT_SETABLE1; \ (b)->bits[2] &= NFSATTRBIT_SETABLE2; \ + if (((n)->nd_flag & ND_NFSV41) == 0) \ + (b)->bits[2] &= ~NFSATTRBIT_NFSV41_2; \ } while (0) #define NFSNONZERO_ATTRBIT(b) ((b)->bits[0] || (b)->bits[1] || (b)->bits[2]) Modified: stable/12/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/12/sys/fs/nfs/nfs_commonsubs.c Fri May 3 00:45:31 2019 (r347037) +++ stable/12/sys/fs/nfs/nfs_commonsubs.c Fri May 3 02:03:29 2019 (r347038) @@ -1294,7 +1294,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, if (error) goto nfsmout; if (compare && !(*retcmpp)) { - NFSSETSUPP_ATTRBIT(&checkattrbits); + NFSSETSUPP_ATTRBIT(&checkattrbits, nd); /* Some filesystem do not support NFSv4ACL */ if (nfsrv_useacl == 0 || nfs_supportsnfsv4acls(vp) == 0) { @@ -2130,8 +2130,8 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, if (error) goto nfsmout; if (compare && !(*retcmpp)) { - NFSSETSUPP_ATTRBIT(&checkattrbits); - NFSCLRNOTSETABLE_ATTRBIT(&checkattrbits); + NFSSETSUPP_ATTRBIT(&checkattrbits, nd); + NFSCLRNOTSETABLE_ATTRBIT(&checkattrbits, nd); NFSCLRBIT_ATTRBIT(&checkattrbits, NFSATTRBIT_TIMEACCESSSET); if (!NFSEQUAL_ATTRBIT(&retattrbits, &checkattrbits) @@ -2461,10 +2461,10 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount * reply call. */ if (p == NULL && cred == NULL) { - NFSCLRNOTSETABLE_ATTRBIT(retbitp); + NFSCLRNOTSETABLE_ATTRBIT(retbitp, nd); aclp = saclp; } else { - NFSCLRNOTFILLABLE_ATTRBIT(retbitp); + NFSCLRNOTFILLABLE_ATTRBIT(retbitp, nd); naclp = acl_alloc(M_WAITOK); aclp = naclp; } @@ -2534,7 +2534,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount if (NFSISSET_ATTRBIT(retbitp, bitpos)) { switch (bitpos) { case NFSATTRBIT_SUPPORTEDATTRS: - NFSSETSUPP_ATTRBIT(&attrbits); + NFSSETSUPP_ATTRBIT(&attrbits, nd); if (nfsrv_useacl == 0 || ((cred != NULL || p != NULL) && supports_nfsv4acls == 0)) { NFSCLRBIT_ATTRBIT(&attrbits,NFSATTRBIT_ACLSUPPORT); @@ -2936,8 +2936,8 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount retnum += NFSX_HYPER; break; case NFSATTRBIT_SUPPATTREXCLCREAT: - NFSSETSUPP_ATTRBIT(&attrbits); - NFSCLRNOTSETABLE_ATTRBIT(&attrbits); + NFSSETSUPP_ATTRBIT(&attrbits, nd); + NFSCLRNOTSETABLE_ATTRBIT(&attrbits, nd); NFSCLRBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEACCESSSET); retnum += nfsrv_putattrbit(nd, &attrbits); break; Modified: stable/12/sys/fs/nfs/nfsproto.h ============================================================================== --- stable/12/sys/fs/nfs/nfsproto.h Fri May 3 00:45:31 2019 (r347037) +++ stable/12/sys/fs/nfs/nfsproto.h Fri May 3 02:03:29 2019 (r347038) @@ -1086,11 +1086,11 @@ struct nfsv3_sattr { NFSATTRBM_SUPPATTREXCLCREAT) /* - * NFSATTRBIT_SUPPSETONLY is the OR of NFSATTRBIT_TIMEACCESSSET and - * NFSATTRBIT_TIMEMODIFYSET. + * These are the set only attributes. */ -#define NFSATTRBIT_SUPPSETONLY (NFSATTRBM_TIMEACCESSSET | \ +#define NFSATTRBIT_SUPPSETONLY1 (NFSATTRBM_TIMEACCESSSET | \ NFSATTRBM_TIMEMODIFYSET) +#define NFSATTRBIT_SUPPSETONLY2 0 /* * NFSATTRBIT_SETABLE - SETABLE0 - bits 0<->31 @@ -1107,6 +1107,18 @@ struct nfsv3_sattr { NFSATTRBM_TIMEACCESSSET | \ NFSATTRBM_TIMEMODIFYSET) #define NFSATTRBIT_SETABLE2 0 + +/* + * NFSATTRBIT_NFSV41 - Attributes only supported by NFSv4.1. + */ +#define NFSATTRBIT_NFSV41_1 \ + (NFSATTRBM_FSLAYOUTTYPE) +#define NFSATTRBIT_NFSV41_2 \ + (NFSATTRBM_LAYOUTTYPE | \ + NFSATTRBM_LAYOUTBLKSIZE | \ + NFSATTRBM_LAYOUTALIGNMENT | \ + NFSATTRBM_MODESETMASKED | \ + NFSATTRBM_SUPPATTREXCLCREAT) /* * Set of attributes that the getattr vnode op needs. Modified: stable/12/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/12/sys/fs/nfsserver/nfs_nfsdport.c Fri May 3 00:45:31 2019 (r347037) +++ stable/12/sys/fs/nfsserver/nfs_nfsdport.c Fri May 3 02:03:29 2019 (r347038) @@ -2123,7 +2123,7 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdg if (error) goto nfsmout; NFSSET_ATTRBIT(&savbits, &attrbits); - NFSCLRNOTFILLABLE_ATTRBIT(&attrbits); + NFSCLRNOTFILLABLE_ATTRBIT(&attrbits, nd); NFSZERO_ATTRBIT(&rderrbits); NFSSETBIT_ATTRBIT(&rderrbits, NFSATTRBIT_RDATTRERROR); } else { From owner-svn-src-all@freebsd.org Fri May 3 02:17:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64C7C1580FD0; Fri, 3 May 2019 02:17:54 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC27E82AC5; Fri, 3 May 2019 02:17:53 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 923411A2F7; Fri, 3 May 2019 02:17:53 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x432HrkV079977; Fri, 3 May 2019 02:17:53 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x432HqW3079974; Fri, 3 May 2019 02:17:52 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201905030217.x432HqW3079974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 3 May 2019 02:17:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347039 - in stable/11/sys/fs: nfs nfsserver X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in stable/11/sys/fs: nfs nfsserver X-SVN-Commit-Revision: 347039 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BC27E82AC5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 02:17:54 -0000 Author: rmacklem Date: Fri May 3 02:17:52 2019 New Revision: 347039 URL: https://svnweb.freebsd.org/changeset/base/347039 Log: MFC: r346365 Fix the NFSv4.0 server so that it does not support NFSv4.1 attributes. During inspection of a packet trace, I noticed that an NFSv4.0 mount reported that it supported attributes that are only defined for NFSv4.1. In practice, this bug appears to be benign, since NFSv4.0 clients will not use attributes that were added for NFSv4.1. However, this was not correct and this patch fixes the NFSv4.0 server so that it only supports attributes defined for NFSv4.0. It also adds a definition for NFSv4.1 attributes that can only be set, although it is only defined as 0 for now. This is anticipation of the addition of support for the NFSv4.1 mode+mask attribute soon. Modified: stable/11/sys/fs/nfs/nfs.h stable/11/sys/fs/nfs/nfs_commonsubs.c stable/11/sys/fs/nfs/nfsproto.h stable/11/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfs/nfs.h ============================================================================== --- stable/11/sys/fs/nfs/nfs.h Fri May 3 02:03:29 2019 (r347038) +++ stable/11/sys/fs/nfs/nfs.h Fri May 3 02:17:52 2019 (r347039) @@ -383,10 +383,14 @@ typedef struct { (t)->bits[2] = (f)->bits[2]; \ } while (0) -#define NFSSETSUPP_ATTRBIT(b) do { \ +#define NFSSETSUPP_ATTRBIT(b, n) do { \ (b)->bits[0] = NFSATTRBIT_SUPP0; \ - (b)->bits[1] = (NFSATTRBIT_SUPP1 | NFSATTRBIT_SUPPSETONLY); \ - (b)->bits[2] = NFSATTRBIT_SUPP2; \ + (b)->bits[1] = (NFSATTRBIT_SUPP1 | NFSATTRBIT_SUPPSETONLY1); \ + (b)->bits[2] = (NFSATTRBIT_SUPP2 | NFSATTRBIT_SUPPSETONLY2); \ + if (((n)->nd_flag & ND_NFSV41) == 0) { \ + (b)->bits[1] &= ~NFSATTRBIT_NFSV41_1; \ + (b)->bits[2] &= ~NFSATTRBIT_NFSV41_2; \ + } \ } while (0) #define NFSISSET_ATTRBIT(b, p) ((b)->bits[(p) / 32] & (1 << ((p) % 32))) @@ -405,16 +409,22 @@ typedef struct { (b)->bits[2] &= ((a)->bits[2]); \ } while (0) -#define NFSCLRNOTFILLABLE_ATTRBIT(b) do { \ +#define NFSCLRNOTFILLABLE_ATTRBIT(b, n) do { \ (b)->bits[0] &= NFSATTRBIT_SUPP0; \ (b)->bits[1] &= NFSATTRBIT_SUPP1; \ (b)->bits[2] &= NFSATTRBIT_SUPP2; \ + if (((n)->nd_flag & ND_NFSV41) == 0) { \ + (b)->bits[1] &= ~NFSATTRBIT_NFSV41_1; \ + (b)->bits[2] &= ~NFSATTRBIT_NFSV41_2; \ + } \ } while (0) -#define NFSCLRNOTSETABLE_ATTRBIT(b) do { \ +#define NFSCLRNOTSETABLE_ATTRBIT(b, n) do { \ (b)->bits[0] &= NFSATTRBIT_SETABLE0; \ (b)->bits[1] &= NFSATTRBIT_SETABLE1; \ (b)->bits[2] &= NFSATTRBIT_SETABLE2; \ + if (((n)->nd_flag & ND_NFSV41) == 0) \ + (b)->bits[2] &= ~NFSATTRBIT_NFSV41_2; \ } while (0) #define NFSNONZERO_ATTRBIT(b) ((b)->bits[0] || (b)->bits[1] || (b)->bits[2]) Modified: stable/11/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/11/sys/fs/nfs/nfs_commonsubs.c Fri May 3 02:03:29 2019 (r347038) +++ stable/11/sys/fs/nfs/nfs_commonsubs.c Fri May 3 02:17:52 2019 (r347039) @@ -935,7 +935,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, if (error) goto nfsmout; if (compare && !(*retcmpp)) { - NFSSETSUPP_ATTRBIT(&checkattrbits); + NFSSETSUPP_ATTRBIT(&checkattrbits, nd); /* Some filesystem do not support NFSv4ACL */ if (nfsrv_useacl == 0 || nfs_supportsnfsv4acls(vp) == 0) { @@ -1793,8 +1793,8 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, if (error) goto nfsmout; if (compare && !(*retcmpp)) { - NFSSETSUPP_ATTRBIT(&checkattrbits); - NFSCLRNOTSETABLE_ATTRBIT(&checkattrbits); + NFSSETSUPP_ATTRBIT(&checkattrbits, nd); + NFSCLRNOTSETABLE_ATTRBIT(&checkattrbits, nd); NFSCLRBIT_ATTRBIT(&checkattrbits, NFSATTRBIT_TIMEACCESSSET); if (!NFSEQUAL_ATTRBIT(&retattrbits, &checkattrbits) @@ -2089,10 +2089,10 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount * reply call. */ if (p == NULL && cred == NULL) { - NFSCLRNOTSETABLE_ATTRBIT(retbitp); + NFSCLRNOTSETABLE_ATTRBIT(retbitp, nd); aclp = saclp; } else { - NFSCLRNOTFILLABLE_ATTRBIT(retbitp); + NFSCLRNOTFILLABLE_ATTRBIT(retbitp, nd); naclp = acl_alloc(M_WAITOK); aclp = naclp; } @@ -2162,7 +2162,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount if (NFSISSET_ATTRBIT(retbitp, bitpos)) { switch (bitpos) { case NFSATTRBIT_SUPPORTEDATTRS: - NFSSETSUPP_ATTRBIT(&attrbits); + NFSSETSUPP_ATTRBIT(&attrbits, nd); if (nfsrv_useacl == 0 || ((cred != NULL || p != NULL) && supports_nfsv4acls == 0)) { NFSCLRBIT_ATTRBIT(&attrbits,NFSATTRBIT_ACLSUPPORT); @@ -2544,8 +2544,8 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount retnum += NFSX_HYPER; break; case NFSATTRBIT_SUPPATTREXCLCREAT: - NFSSETSUPP_ATTRBIT(&attrbits); - NFSCLRNOTSETABLE_ATTRBIT(&attrbits); + NFSSETSUPP_ATTRBIT(&attrbits, nd); + NFSCLRNOTSETABLE_ATTRBIT(&attrbits, nd); NFSCLRBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEACCESSSET); retnum += nfsrv_putattrbit(nd, &attrbits); break; Modified: stable/11/sys/fs/nfs/nfsproto.h ============================================================================== --- stable/11/sys/fs/nfs/nfsproto.h Fri May 3 02:03:29 2019 (r347038) +++ stable/11/sys/fs/nfs/nfsproto.h Fri May 3 02:17:52 2019 (r347039) @@ -1055,11 +1055,11 @@ struct nfsv3_sattr { #define NFSATTRBIT_SUPP2 NFSATTRBM_SUPPATTREXCLCREAT /* - * NFSATTRBIT_SUPPSETONLY is the OR of NFSATTRBIT_TIMEACCESSSET and - * NFSATTRBIT_TIMEMODIFYSET. + * These are the set only attributes. */ -#define NFSATTRBIT_SUPPSETONLY (NFSATTRBM_TIMEACCESSSET | \ +#define NFSATTRBIT_SUPPSETONLY1 (NFSATTRBM_TIMEACCESSSET | \ NFSATTRBM_TIMEMODIFYSET) +#define NFSATTRBIT_SUPPSETONLY2 0 /* * NFSATTRBIT_SETABLE - SETABLE0 - bits 0<->31 @@ -1076,6 +1076,18 @@ struct nfsv3_sattr { NFSATTRBM_TIMEACCESSSET | \ NFSATTRBM_TIMEMODIFYSET) #define NFSATTRBIT_SETABLE2 0 + +/* + * NFSATTRBIT_NFSV41 - Attributes only supported by NFSv4.1. + */ +#define NFSATTRBIT_NFSV41_1 \ + (NFSATTRBM_FSLAYOUTTYPE) +#define NFSATTRBIT_NFSV41_2 \ + (NFSATTRBM_LAYOUTTYPE | \ + NFSATTRBM_LAYOUTBLKSIZE | \ + NFSATTRBM_LAYOUTALIGNMENT | \ + NFSATTRBM_MODESETMASKED | \ + NFSATTRBM_SUPPATTREXCLCREAT) /* * Set of attributes that the getattr vnode op needs. Modified: stable/11/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdport.c Fri May 3 02:03:29 2019 (r347038) +++ stable/11/sys/fs/nfsserver/nfs_nfsdport.c Fri May 3 02:17:52 2019 (r347039) @@ -1874,7 +1874,7 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdg if (error) goto nfsmout; NFSSET_ATTRBIT(&savbits, &attrbits); - NFSCLRNOTFILLABLE_ATTRBIT(&attrbits); + NFSCLRNOTFILLABLE_ATTRBIT(&attrbits, nd); NFSZERO_ATTRBIT(&rderrbits); NFSSETBIT_ATTRBIT(&rderrbits, NFSATTRBIT_RDATTRERROR); } else { From owner-svn-src-all@freebsd.org Fri May 3 02:30:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFE6C15817A3; Fri, 3 May 2019 02:30:02 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7371E83158; Fri, 3 May 2019 02:30:02 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4906B1A4B2; Fri, 3 May 2019 02:30:02 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x432U2Dd085195; Fri, 3 May 2019 02:30:02 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x432U1Uf085191; Fri, 3 May 2019 02:30:01 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201905030230.x432U1Uf085191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 3 May 2019 02:30:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r347040 - in stable/10/sys/fs: nfs nfsserver X-SVN-Group: stable-10 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in stable/10/sys/fs: nfs nfsserver X-SVN-Commit-Revision: 347040 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7371E83158 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 02:30:03 -0000 Author: rmacklem Date: Fri May 3 02:30:01 2019 New Revision: 347040 URL: https://svnweb.freebsd.org/changeset/base/347040 Log: MFC: r346365 Fix the NFSv4.0 server so that it does not support NFSv4.1 attributes. During inspection of a packet trace, I noticed that an NFSv4.0 mount reported that it supported attributes that are only defined for NFSv4.1. In practice, this bug appears to be benign, since NFSv4.0 clients will not use attributes that were added for NFSv4.1. However, this was not correct and this patch fixes the NFSv4.0 server so that it only supports attributes defined for NFSv4.0. It also adds a definition for NFSv4.1 attributes that can only be set, although it is only defined as 0 for now. This is anticipation of the addition of support for the NFSv4.1 mode+mask attribute soon. Modified: stable/10/sys/fs/nfs/nfs.h stable/10/sys/fs/nfs/nfs_commonsubs.c stable/10/sys/fs/nfs/nfsproto.h stable/10/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfs/nfs.h ============================================================================== --- stable/10/sys/fs/nfs/nfs.h Fri May 3 02:17:52 2019 (r347039) +++ stable/10/sys/fs/nfs/nfs.h Fri May 3 02:30:01 2019 (r347040) @@ -383,10 +383,14 @@ typedef struct { (t)->bits[2] = (f)->bits[2]; \ } while (0) -#define NFSSETSUPP_ATTRBIT(b) do { \ +#define NFSSETSUPP_ATTRBIT(b, n) do { \ (b)->bits[0] = NFSATTRBIT_SUPP0; \ - (b)->bits[1] = (NFSATTRBIT_SUPP1 | NFSATTRBIT_SUPPSETONLY); \ - (b)->bits[2] = NFSATTRBIT_SUPP2; \ + (b)->bits[1] = (NFSATTRBIT_SUPP1 | NFSATTRBIT_SUPPSETONLY1); \ + (b)->bits[2] = (NFSATTRBIT_SUPP2 | NFSATTRBIT_SUPPSETONLY2); \ + if (((n)->nd_flag & ND_NFSV41) == 0) { \ + (b)->bits[1] &= ~NFSATTRBIT_NFSV41_1; \ + (b)->bits[2] &= ~NFSATTRBIT_NFSV41_2; \ + } \ } while (0) #define NFSISSET_ATTRBIT(b, p) ((b)->bits[(p) / 32] & (1 << ((p) % 32))) @@ -405,16 +409,22 @@ typedef struct { (b)->bits[2] &= ((a)->bits[2]); \ } while (0) -#define NFSCLRNOTFILLABLE_ATTRBIT(b) do { \ +#define NFSCLRNOTFILLABLE_ATTRBIT(b, n) do { \ (b)->bits[0] &= NFSATTRBIT_SUPP0; \ (b)->bits[1] &= NFSATTRBIT_SUPP1; \ (b)->bits[2] &= NFSATTRBIT_SUPP2; \ + if (((n)->nd_flag & ND_NFSV41) == 0) { \ + (b)->bits[1] &= ~NFSATTRBIT_NFSV41_1; \ + (b)->bits[2] &= ~NFSATTRBIT_NFSV41_2; \ + } \ } while (0) -#define NFSCLRNOTSETABLE_ATTRBIT(b) do { \ +#define NFSCLRNOTSETABLE_ATTRBIT(b, n) do { \ (b)->bits[0] &= NFSATTRBIT_SETABLE0; \ (b)->bits[1] &= NFSATTRBIT_SETABLE1; \ (b)->bits[2] &= NFSATTRBIT_SETABLE2; \ + if (((n)->nd_flag & ND_NFSV41) == 0) \ + (b)->bits[2] &= ~NFSATTRBIT_NFSV41_2; \ } while (0) #define NFSNONZERO_ATTRBIT(b) ((b)->bits[0] || (b)->bits[1] || (b)->bits[2]) Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonsubs.c Fri May 3 02:17:52 2019 (r347039) +++ stable/10/sys/fs/nfs/nfs_commonsubs.c Fri May 3 02:30:01 2019 (r347040) @@ -927,7 +927,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, if (error) goto nfsmout; if (compare && !(*retcmpp)) { - NFSSETSUPP_ATTRBIT(&checkattrbits); + NFSSETSUPP_ATTRBIT(&checkattrbits, nd); if (!NFSEQUAL_ATTRBIT(&retattrbits, &checkattrbits) || retnotsup) *retcmpp = NFSERR_NOTSAME; @@ -1778,8 +1778,8 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, if (error) goto nfsmout; if (compare && !(*retcmpp)) { - NFSSETSUPP_ATTRBIT(&checkattrbits); - NFSCLRNOTSETABLE_ATTRBIT(&checkattrbits); + NFSSETSUPP_ATTRBIT(&checkattrbits, nd); + NFSCLRNOTSETABLE_ATTRBIT(&checkattrbits, nd); NFSCLRBIT_ATTRBIT(&checkattrbits, NFSATTRBIT_TIMEACCESSSET); if (!NFSEQUAL_ATTRBIT(&retattrbits, &checkattrbits) @@ -2074,10 +2074,10 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount * reply call. */ if (p == NULL && cred == NULL) { - NFSCLRNOTSETABLE_ATTRBIT(retbitp); + NFSCLRNOTSETABLE_ATTRBIT(retbitp, nd); aclp = saclp; } else { - NFSCLRNOTFILLABLE_ATTRBIT(retbitp); + NFSCLRNOTFILLABLE_ATTRBIT(retbitp, nd); naclp = acl_alloc(M_WAITOK); aclp = naclp; } @@ -2143,7 +2143,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount if (NFSISSET_ATTRBIT(retbitp, bitpos)) { switch (bitpos) { case NFSATTRBIT_SUPPORTEDATTRS: - NFSSETSUPP_ATTRBIT(&attrbits); + NFSSETSUPP_ATTRBIT(&attrbits, nd); if (nfsrv_useacl == 0 || ((cred != NULL || p != NULL) && supports_nfsv4acls == 0)) { NFSCLRBIT_ATTRBIT(&attrbits,NFSATTRBIT_ACLSUPPORT); @@ -2525,8 +2525,8 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount retnum += NFSX_HYPER; break; case NFSATTRBIT_SUPPATTREXCLCREAT: - NFSSETSUPP_ATTRBIT(&attrbits); - NFSCLRNOTSETABLE_ATTRBIT(&attrbits); + NFSSETSUPP_ATTRBIT(&attrbits, nd); + NFSCLRNOTSETABLE_ATTRBIT(&attrbits, nd); NFSCLRBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEACCESSSET); retnum += nfsrv_putattrbit(nd, &attrbits); break; Modified: stable/10/sys/fs/nfs/nfsproto.h ============================================================================== --- stable/10/sys/fs/nfs/nfsproto.h Fri May 3 02:17:52 2019 (r347039) +++ stable/10/sys/fs/nfs/nfsproto.h Fri May 3 02:30:01 2019 (r347040) @@ -1049,11 +1049,11 @@ struct nfsv3_sattr { #define NFSATTRBIT_SUPP2 NFSATTRBM_SUPPATTREXCLCREAT /* - * NFSATTRBIT_SUPPSETONLY is the OR of NFSATTRBIT_TIMEACCESSSET and - * NFSATTRBIT_TIMEMODIFYSET. + * These are the set only attributes. */ -#define NFSATTRBIT_SUPPSETONLY (NFSATTRBM_TIMEACCESSSET | \ +#define NFSATTRBIT_SUPPSETONLY1 (NFSATTRBM_TIMEACCESSSET | \ NFSATTRBM_TIMEMODIFYSET) +#define NFSATTRBIT_SUPPSETONLY2 0 /* * NFSATTRBIT_SETABLE - SETABLE0 - bits 0<->31 @@ -1070,6 +1070,18 @@ struct nfsv3_sattr { NFSATTRBM_TIMEACCESSSET | \ NFSATTRBM_TIMEMODIFYSET) #define NFSATTRBIT_SETABLE2 0 + +/* + * NFSATTRBIT_NFSV41 - Attributes only supported by NFSv4.1. + */ +#define NFSATTRBIT_NFSV41_1 \ + (NFSATTRBM_FSLAYOUTTYPE) +#define NFSATTRBIT_NFSV41_2 \ + (NFSATTRBM_LAYOUTTYPE | \ + NFSATTRBM_LAYOUTBLKSIZE | \ + NFSATTRBM_LAYOUTALIGNMENT | \ + NFSATTRBM_MODESETMASKED | \ + NFSATTRBM_SUPPATTREXCLCREAT) /* * Set of attributes that the getattr vnode op needs. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdport.c Fri May 3 02:17:52 2019 (r347039) +++ stable/10/sys/fs/nfsserver/nfs_nfsdport.c Fri May 3 02:30:01 2019 (r347040) @@ -1863,7 +1863,7 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdg if (error) goto nfsmout; NFSSET_ATTRBIT(&savbits, &attrbits); - NFSCLRNOTFILLABLE_ATTRBIT(&attrbits); + NFSCLRNOTFILLABLE_ATTRBIT(&attrbits, nd); NFSZERO_ATTRBIT(&rderrbits); NFSSETBIT_ATTRBIT(&rderrbits, NFSATTRBIT_RDATTRERROR); } else { From owner-svn-src-all@freebsd.org Fri May 3 02:44:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D8371581BBA; Fri, 3 May 2019 02:44:58 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0513B8382F; Fri, 3 May 2019 02:44:58 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC9D61A7F3; Fri, 3 May 2019 02:44:57 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x432ivri095858; Fri, 3 May 2019 02:44:57 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x432ivwJ095857; Fri, 3 May 2019 02:44:57 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201905030244.x432ivwJ095857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 3 May 2019 02:44:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347041 - stable/12/sys/fs/nfsserver X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/12/sys/fs/nfsserver X-SVN-Commit-Revision: 347041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0513B8382F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 02:44:58 -0000 Author: rmacklem Date: Fri May 3 02:44:57 2019 New Revision: 347041 URL: https://svnweb.freebsd.org/changeset/base/347041 Log: MFC: r346423 Replace "vp" with NULL to make the code more readable. At the time of this nfsv4_sattr() call, "vp == NULL", so this patch doesn't change the semantics, but I think it makes the code more readable. It also makes it consistent with the nfsv4_sattr() call a few lines above this one. Found during code inspection. Modified: stable/12/sys/fs/nfsserver/nfs_nfsdserv.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/12/sys/fs/nfsserver/nfs_nfsdserv.c Fri May 3 02:30:01 2019 (r347040) +++ stable/12/sys/fs/nfsserver/nfs_nfsdserv.c Fri May 3 02:44:57 2019 (r347041) @@ -2872,7 +2872,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int is NFSM_DISSECT(tl, u_int32_t *, NFSX_VERF); cverf[0] = *tl++; cverf[1] = *tl; - error = nfsv4_sattr(nd, vp, &nva, &attrbits, aclp, p); + error = nfsv4_sattr(nd, NULL, &nva, &attrbits, aclp, p); if (error != 0) goto nfsmout; if (NFSISSET_ATTRBIT(&attrbits, From owner-svn-src-all@freebsd.org Fri May 3 02:51:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5E861581C7F; Fri, 3 May 2019 02:51:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C2EE83B56; Fri, 3 May 2019 02:51:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 351921A847; Fri, 3 May 2019 02:51:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x432pYTa099312; Fri, 3 May 2019 02:51:34 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x432pYtP099311; Fri, 3 May 2019 02:51:34 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201905030251.x432pYtP099311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 3 May 2019 02:51:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347042 - stable/11/sys/fs/nfsserver X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/11/sys/fs/nfsserver X-SVN-Commit-Revision: 347042 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5C2EE83B56 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 02:51:34 -0000 Author: rmacklem Date: Fri May 3 02:51:33 2019 New Revision: 347042 URL: https://svnweb.freebsd.org/changeset/base/347042 Log: MFC: r346423 Replace "vp" with NULL to make the code more readable. At the time of this nfsv4_sattr() call, "vp == NULL", so this patch doesn't change the semantics, but I think it makes the code more readable. It also makes it consistent with the nfsv4_sattr() call a few lines above this one. Found during code inspection. Modified: stable/11/sys/fs/nfsserver/nfs_nfsdserv.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdserv.c Fri May 3 02:44:57 2019 (r347041) +++ stable/11/sys/fs/nfsserver/nfs_nfsdserv.c Fri May 3 02:51:33 2019 (r347042) @@ -2732,7 +2732,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int is NFSM_DISSECT(tl, u_int32_t *, NFSX_VERF); cverf[0] = *tl++; cverf[1] = *tl; - error = nfsv4_sattr(nd, vp, &nva, &attrbits, aclp, p); + error = nfsv4_sattr(nd, NULL, &nva, &attrbits, aclp, p); if (error != 0) goto nfsmout; if (NFSISSET_ATTRBIT(&attrbits, From owner-svn-src-all@freebsd.org Fri May 3 02:55:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AEB71581F22; Fri, 3 May 2019 02:55:55 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C53E183D98; Fri, 3 May 2019 02:55:54 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E0711A9AB; Fri, 3 May 2019 02:55:54 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x432tsNL001163; Fri, 3 May 2019 02:55:54 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x432tsKK001162; Fri, 3 May 2019 02:55:54 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201905030255.x432tsKK001162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Douglas William Moore Date: Fri, 3 May 2019 02:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347043 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 347043 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C53E183D98 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 02:55:55 -0000 Author: dougm Date: Fri May 3 02:55:54 2019 New Revision: 347043 URL: https://svnweb.freebsd.org/changeset/base/347043 Log: fls() should find the most significant bit of an int faster than a linear search can, so use it to avoid a linear search in isqrt. Approved by: kib (mentor), markj (mentor) Differential Revision: https://reviews.freebsd.org/D20102 Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Fri May 3 02:51:33 2019 (r347042) +++ head/sys/vm/vm_pageout.c Fri May 3 02:55:54 2019 (r347043) @@ -928,9 +928,7 @@ isqrt(u_int num) { u_int bit, root, tmp; - bit = 1u << ((NBBY * sizeof(u_int)) - 2); - while (bit > num) - bit >>= 2; + bit = num != 0 ? (1u << ((fls(num) - 1) & ~1)) : 0; root = 0; while (bit != 0) { tmp = root + bit; From owner-svn-src-all@freebsd.org Fri May 3 02:58:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05849158208A; Fri, 3 May 2019 02:58:35 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F75C83F3C; Fri, 3 May 2019 02:58:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52C9D1A9B0; Fri, 3 May 2019 02:58:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x432wYBa001321; Fri, 3 May 2019 02:58:34 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x432wXJc001318; Fri, 3 May 2019 02:58:33 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201905030258.x432wXJc001318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 3 May 2019 02:58:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347044 - in stable/12/sys/fs: nfs nfsserver X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in stable/12/sys/fs: nfs nfsserver X-SVN-Commit-Revision: 347044 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9F75C83F3C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 02:58:35 -0000 Author: rmacklem Date: Fri May 3 02:58:33 2019 New Revision: 347044 URL: https://svnweb.freebsd.org/changeset/base/347044 Log: MFC: r346424 Add support for the ModeSetMasked attribute to the NFSv4.1 server. I do not know of an extant NFSv4.1 client that currently does a Setattr operation for the ModeSetMasked, but it has been discussed on the linux-nfs mailing list. This patch adds support for doing a Setattr of ModeSetMasked, so that it will work for any future NFSv4.1 client that chooses to do so. Tested via a hacked FreeBSD NFSv4.1 client. Modified: stable/12/sys/fs/nfs/nfsproto.h stable/12/sys/fs/nfsserver/nfs_nfsdport.c stable/12/sys/fs/nfsserver/nfs_nfsdserv.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfs/nfsproto.h ============================================================================== --- stable/12/sys/fs/nfs/nfsproto.h Fri May 3 02:55:54 2019 (r347043) +++ stable/12/sys/fs/nfs/nfsproto.h Fri May 3 02:58:33 2019 (r347044) @@ -1090,7 +1090,7 @@ struct nfsv3_sattr { */ #define NFSATTRBIT_SUPPSETONLY1 (NFSATTRBM_TIMEACCESSSET | \ NFSATTRBM_TIMEMODIFYSET) -#define NFSATTRBIT_SUPPSETONLY2 0 +#define NFSATTRBIT_SUPPSETONLY2 (NFSATTRBM_MODESETMASKED) /* * NFSATTRBIT_SETABLE - SETABLE0 - bits 0<->31 @@ -1106,7 +1106,8 @@ struct nfsv3_sattr { NFSATTRBM_OWNERGROUP | \ NFSATTRBM_TIMEACCESSSET | \ NFSATTRBM_TIMEMODIFYSET) -#define NFSATTRBIT_SETABLE2 0 +#define NFSATTRBIT_SETABLE2 \ + (NFSATTRBM_MODESETMASKED) /* * NFSATTRBIT_NFSV41 - Attributes only supported by NFSv4.1. Modified: stable/12/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/12/sys/fs/nfsserver/nfs_nfsdport.c Fri May 3 02:55:54 2019 (r347043) +++ stable/12/sys/fs/nfsserver/nfs_nfsdport.c Fri May 3 02:58:33 2019 (r347044) @@ -2696,10 +2696,12 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, str int attrsum = 0; int i, j; int error, attrsize, bitpos, aclsize, aceerr, retnotsup = 0; - int toclient = 0; + int moderet, toclient = 0; u_char *cp, namestr[NFSV4_SMALLSTR + 1]; uid_t uid; gid_t gid; + u_short mode, mask; /* Same type as va_mode. */ + struct vattr va; error = nfsrv_getattrbits(nd, attrbitp, NULL, &retnotsup); if (error) @@ -2717,6 +2719,7 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, str } else { bitpos = 0; } + moderet = 0; for (; bitpos < NFSATTRBIT_MAX; bitpos++) { if (attrsum > attrsize) { error = NFSERR_BADXDR; @@ -2766,6 +2769,7 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, str attrsum += (NFSX_UNSIGNED + NFSM_RNDUP(i)); break; case NFSATTRBIT_MODE: + moderet = NFSERR_INVAL; /* Can't do MODESETMASKED. */ NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); nvap->na_mode = nfstov_mode(*tl); attrsum += NFSX_UNSIGNED; @@ -2868,6 +2872,32 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, str if (!toclient) nvap->na_vaflags |= VA_UTIMES_NULL; } + break; + case NFSATTRBIT_MODESETMASKED: + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); + mode = fxdr_unsigned(u_short, *tl++); + mask = fxdr_unsigned(u_short, *tl); + /* + * vp == NULL implies an Open/Create operation. + * This attribute can only be used for Setattr and + * only for NFSv4.1 or higher. + * If moderet != 0, a mode attribute has also been + * specified and this attribute cannot be done in the + * same Setattr operation. + */ + if ((nd->nd_flag & ND_NFSV41) == 0) + nd->nd_repstat = NFSERR_ATTRNOTSUPP; + else if ((mode & ~07777) != 0 || (mask & ~07777) != 0 || + vp == NULL) + nd->nd_repstat = NFSERR_INVAL; + else if (moderet == 0) + moderet = VOP_GETATTR(vp, &va, nd->nd_cred); + if (moderet == 0) + nvap->na_mode = (mode & mask) | + (va.va_mode & ~mask); + else + nd->nd_repstat = moderet; + attrsum += 2 * NFSX_UNSIGNED; break; default: nd->nd_repstat = NFSERR_ATTRNOTSUPP; Modified: stable/12/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/12/sys/fs/nfsserver/nfs_nfsdserv.c Fri May 3 02:55:54 2019 (r347043) +++ stable/12/sys/fs/nfsserver/nfs_nfsdserv.c Fri May 3 02:58:33 2019 (r347044) @@ -461,13 +461,18 @@ nfsrvd_setattr(struct nfsrv_descript *nd, __unused int } } if (!nd->nd_repstat && - NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_MODE)) { + (NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_MODE) || + NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_MODESETMASKED))) { NFSVNO_ATTRINIT(&nva2); NFSVNO_SETATTRVAL(&nva2, mode, nva.na_mode); nd->nd_repstat = nfsvno_setattr(vp, &nva2, nd->nd_cred, p, exp); - if (!nd->nd_repstat) - NFSSETBIT_ATTRBIT(&retbits, NFSATTRBIT_MODE); + if (!nd->nd_repstat) { + if (NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_MODE)) + NFSSETBIT_ATTRBIT(&retbits, NFSATTRBIT_MODE); + if (NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_MODESETMASKED)) + NFSSETBIT_ATTRBIT(&retbits, NFSATTRBIT_MODESETMASKED); + } } #ifdef NFS4_ACL_EXTATTR_NAME From owner-svn-src-all@freebsd.org Fri May 3 03:05:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2808915823E3; Fri, 3 May 2019 03:05:24 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B4ADB8464B; Fri, 3 May 2019 03:05:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F0E31ABB6; Fri, 3 May 2019 03:05:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4335Nco007385; Fri, 3 May 2019 03:05:23 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4335NDL007383; Fri, 3 May 2019 03:05:23 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201905030305.x4335NDL007383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 3 May 2019 03:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347045 - in stable/11/sys/fs: nfs nfsserver X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in stable/11/sys/fs: nfs nfsserver X-SVN-Commit-Revision: 347045 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B4ADB8464B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 03:05:24 -0000 Author: rmacklem Date: Fri May 3 03:05:22 2019 New Revision: 347045 URL: https://svnweb.freebsd.org/changeset/base/347045 Log: MFC: r346424 Add support for the ModeSetMasked attribute to the NFSv4.1 server. I do not know of an extant NFSv4.1 client that currently does a Setattr operation for the ModeSetMasked, but it has been discussed on the linux-nfs mailing list. This patch adds support for doing a Setattr of ModeSetMasked, so that it will work for any future NFSv4.1 client that chooses to do so. Tested via a hacked FreeBSD NFSv4.1 client. Modified: stable/11/sys/fs/nfs/nfsproto.h stable/11/sys/fs/nfsserver/nfs_nfsdport.c stable/11/sys/fs/nfsserver/nfs_nfsdserv.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfs/nfsproto.h ============================================================================== --- stable/11/sys/fs/nfs/nfsproto.h Fri May 3 02:58:33 2019 (r347044) +++ stable/11/sys/fs/nfs/nfsproto.h Fri May 3 03:05:22 2019 (r347045) @@ -1059,7 +1059,7 @@ struct nfsv3_sattr { */ #define NFSATTRBIT_SUPPSETONLY1 (NFSATTRBM_TIMEACCESSSET | \ NFSATTRBM_TIMEMODIFYSET) -#define NFSATTRBIT_SUPPSETONLY2 0 +#define NFSATTRBIT_SUPPSETONLY2 (NFSATTRBM_MODESETMASKED) /* * NFSATTRBIT_SETABLE - SETABLE0 - bits 0<->31 @@ -1075,7 +1075,8 @@ struct nfsv3_sattr { NFSATTRBM_OWNERGROUP | \ NFSATTRBM_TIMEACCESSSET | \ NFSATTRBM_TIMEMODIFYSET) -#define NFSATTRBIT_SETABLE2 0 +#define NFSATTRBIT_SETABLE2 \ + (NFSATTRBM_MODESETMASKED) /* * NFSATTRBIT_NFSV41 - Attributes only supported by NFSv4.1. Modified: stable/11/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdport.c Fri May 3 02:58:33 2019 (r347044) +++ stable/11/sys/fs/nfsserver/nfs_nfsdport.c Fri May 3 03:05:22 2019 (r347045) @@ -2430,10 +2430,12 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, str int attrsum = 0; int i, j; int error, attrsize, bitpos, aclsize, aceerr, retnotsup = 0; - int toclient = 0; + int moderet, toclient = 0; u_char *cp, namestr[NFSV4_SMALLSTR + 1]; uid_t uid; gid_t gid; + u_short mode, mask; /* Same type as va_mode. */ + struct vattr va; error = nfsrv_getattrbits(nd, attrbitp, NULL, &retnotsup); if (error) @@ -2451,6 +2453,7 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, str } else { bitpos = 0; } + moderet = 0; for (; bitpos < NFSATTRBIT_MAX; bitpos++) { if (attrsum > attrsize) { error = NFSERR_BADXDR; @@ -2500,6 +2503,7 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, str attrsum += (NFSX_UNSIGNED + NFSM_RNDUP(i)); break; case NFSATTRBIT_MODE: + moderet = NFSERR_INVAL; /* Can't do MODESETMASKED. */ NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); nvap->na_mode = nfstov_mode(*tl); attrsum += NFSX_UNSIGNED; @@ -2602,6 +2606,32 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, str if (!toclient) nvap->na_vaflags |= VA_UTIMES_NULL; } + break; + case NFSATTRBIT_MODESETMASKED: + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); + mode = fxdr_unsigned(u_short, *tl++); + mask = fxdr_unsigned(u_short, *tl); + /* + * vp == NULL implies an Open/Create operation. + * This attribute can only be used for Setattr and + * only for NFSv4.1 or higher. + * If moderet != 0, a mode attribute has also been + * specified and this attribute cannot be done in the + * same Setattr operation. + */ + if ((nd->nd_flag & ND_NFSV41) == 0) + nd->nd_repstat = NFSERR_ATTRNOTSUPP; + else if ((mode & ~07777) != 0 || (mask & ~07777) != 0 || + vp == NULL) + nd->nd_repstat = NFSERR_INVAL; + else if (moderet == 0) + moderet = VOP_GETATTR(vp, &va, nd->nd_cred); + if (moderet == 0) + nvap->na_mode = (mode & mask) | + (va.va_mode & ~mask); + else + nd->nd_repstat = moderet; + attrsum += 2 * NFSX_UNSIGNED; break; default: nd->nd_repstat = NFSERR_ATTRNOTSUPP; Modified: stable/11/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdserv.c Fri May 3 02:58:33 2019 (r347044) +++ stable/11/sys/fs/nfsserver/nfs_nfsdserv.c Fri May 3 03:05:22 2019 (r347045) @@ -430,13 +430,18 @@ nfsrvd_setattr(struct nfsrv_descript *nd, __unused int } } if (!nd->nd_repstat && - NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_MODE)) { + (NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_MODE) || + NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_MODESETMASKED))) { NFSVNO_ATTRINIT(&nva2); NFSVNO_SETATTRVAL(&nva2, mode, nva.na_mode); nd->nd_repstat = nfsvno_setattr(vp, &nva2, nd->nd_cred, p, exp); - if (!nd->nd_repstat) - NFSSETBIT_ATTRBIT(&retbits, NFSATTRBIT_MODE); + if (!nd->nd_repstat) { + if (NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_MODE)) + NFSSETBIT_ATTRBIT(&retbits, NFSATTRBIT_MODE); + if (NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_MODESETMASKED)) + NFSSETBIT_ATTRBIT(&retbits, NFSATTRBIT_MODESETMASKED); + } } #ifdef NFS4_ACL_EXTATTR_NAME From owner-svn-src-all@freebsd.org Fri May 3 03:34:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E64311582F62; Fri, 3 May 2019 03:34:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89DEC85945; Fri, 3 May 2019 03:34:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DFA41B0E3; Fri, 3 May 2019 03:34:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x433YNut023993; Fri, 3 May 2019 03:34:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x433YNll023992; Fri, 3 May 2019 03:34:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905030334.x433YNll023992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 3 May 2019 03:34:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347046 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 347046 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 89DEC85945 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 03:34:24 -0000 Author: mav Date: Fri May 3 03:34:22 2019 New Revision: 347046 URL: https://svnweb.freebsd.org/changeset/base/347046 Log: MFC r346760: Fix minor mismerges. No functional change. Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h Fri May 3 03:05:22 2019 (r347045) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h Fri May 3 03:34:22 2019 (r347046) @@ -84,7 +84,7 @@ void range_tree_init(void); void range_tree_fini(void); range_tree_t *range_tree_create_impl(range_tree_ops_t *ops, void *arg, int (*avl_compare)(const void*, const void*), uint64_t gap); - range_tree_t *range_tree_create(range_tree_ops_t *ops, void *arg); +range_tree_t *range_tree_create(range_tree_ops_t *ops, void *arg); void range_tree_destroy(range_tree_t *rt); boolean_t range_tree_contains(range_tree_t *rt, uint64_t start, uint64_t size); range_seg_t *range_tree_find(range_tree_t *rt, uint64_t start, uint64_t size); @@ -108,13 +108,6 @@ void range_tree_clear(range_tree_t *rt, uint64_t start void range_tree_vacate(range_tree_t *rt, range_tree_func_t *func, void *arg); void range_tree_walk(range_tree_t *rt, range_tree_func_t *func, void *arg); range_seg_t *range_tree_first(range_tree_t *rt); - -void rt_avl_create(range_tree_t *rt, void *arg); -void rt_avl_destroy(range_tree_t *rt, void *arg); -void rt_avl_add(range_tree_t *rt, range_seg_t *rs, void *arg); -void rt_avl_remove(range_tree_t *rt, range_seg_t *rs, void *arg); -void rt_avl_vacate(range_tree_t *rt, void *arg); -extern struct range_tree_ops rt_avl_ops; void rt_avl_create(range_tree_t *rt, void *arg); void rt_avl_destroy(range_tree_t *rt, void *arg); From owner-svn-src-all@freebsd.org Fri May 3 03:34:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5F991582FBC; Fri, 3 May 2019 03:34:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CA2C85A52; Fri, 3 May 2019 03:34:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65BB21B0E4; Fri, 3 May 2019 03:34:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x433YoKW024073; Fri, 3 May 2019 03:34:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x433YoRH024072; Fri, 3 May 2019 03:34:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905030334.x433YoRH024072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 3 May 2019 03:34:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347047 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 347047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8CA2C85A52 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 03:34:51 -0000 Author: mav Date: Fri May 3 03:34:50 2019 New Revision: 347047 URL: https://svnweb.freebsd.org/changeset/base/347047 Log: MFC r346760: Fix minor mismerges. No functional change. Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h Fri May 3 03:34:22 2019 (r347046) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h Fri May 3 03:34:50 2019 (r347047) @@ -84,7 +84,7 @@ void range_tree_init(void); void range_tree_fini(void); range_tree_t *range_tree_create_impl(range_tree_ops_t *ops, void *arg, int (*avl_compare)(const void*, const void*), uint64_t gap); - range_tree_t *range_tree_create(range_tree_ops_t *ops, void *arg); +range_tree_t *range_tree_create(range_tree_ops_t *ops, void *arg); void range_tree_destroy(range_tree_t *rt); boolean_t range_tree_contains(range_tree_t *rt, uint64_t start, uint64_t size); range_seg_t *range_tree_find(range_tree_t *rt, uint64_t start, uint64_t size); @@ -108,13 +108,6 @@ void range_tree_clear(range_tree_t *rt, uint64_t start void range_tree_vacate(range_tree_t *rt, range_tree_func_t *func, void *arg); void range_tree_walk(range_tree_t *rt, range_tree_func_t *func, void *arg); range_seg_t *range_tree_first(range_tree_t *rt); - -void rt_avl_create(range_tree_t *rt, void *arg); -void rt_avl_destroy(range_tree_t *rt, void *arg); -void rt_avl_add(range_tree_t *rt, range_seg_t *rs, void *arg); -void rt_avl_remove(range_tree_t *rt, range_seg_t *rs, void *arg); -void rt_avl_vacate(range_tree_t *rt, void *arg); -extern struct range_tree_ops rt_avl_ops; void rt_avl_create(range_tree_t *rt, void *arg); void rt_avl_destroy(range_tree_t *rt, void *arg); From owner-svn-src-all@freebsd.org Fri May 3 03:35:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAA301583037; Fri, 3 May 2019 03:35:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8215285BA4; Fri, 3 May 2019 03:35:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 572191B0E6; Fri, 3 May 2019 03:35:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x433ZbE6024175; Fri, 3 May 2019 03:35:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x433ZbHP024174; Fri, 3 May 2019 03:35:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905030335.x433ZbHP024174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 3 May 2019 03:35:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347048 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 347048 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8215285BA4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 03:35:38 -0000 Author: mav Date: Fri May 3 03:35:36 2019 New Revision: 347048 URL: https://svnweb.freebsd.org/changeset/base/347048 Log: MFC r346762: Add mutex_destroy() missed in r334844. Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Fri May 3 03:34:50 2019 (r347047) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Fri May 3 03:35:36 2019 (r347048) @@ -498,8 +498,10 @@ dsl_pool_close(dsl_pool_t *dp) rrw_destroy(&dp->dp_config_rwlock); mutex_destroy(&dp->dp_lock); taskq_destroy(dp->dp_vnrele_taskq); - if (dp->dp_blkstats != NULL) + if (dp->dp_blkstats != NULL) { + mutex_destroy(&dp->dp_blkstats->zab_lock); kmem_free(dp->dp_blkstats, sizeof (zfs_all_blkstats_t)); + } kmem_free(dp, sizeof (dsl_pool_t)); } From owner-svn-src-all@freebsd.org Fri May 3 03:36:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74C7715830AD; Fri, 3 May 2019 03:36:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19C5085CD0; Fri, 3 May 2019 03:36:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E84821B0E7; Fri, 3 May 2019 03:36:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x433a0Wl024252; Fri, 3 May 2019 03:36:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x433a0s1024251; Fri, 3 May 2019 03:36:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905030336.x433a0s1024251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 3 May 2019 03:36:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347049 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 347049 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 19C5085CD0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 03:36:01 -0000 Author: mav Date: Fri May 3 03:36:00 2019 New Revision: 347049 URL: https://svnweb.freebsd.org/changeset/base/347049 Log: MFC r346762: Add mutex_destroy() missed in r334844. Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Fri May 3 03:35:36 2019 (r347048) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Fri May 3 03:36:00 2019 (r347049) @@ -498,8 +498,10 @@ dsl_pool_close(dsl_pool_t *dp) rrw_destroy(&dp->dp_config_rwlock); mutex_destroy(&dp->dp_lock); taskq_destroy(dp->dp_vnrele_taskq); - if (dp->dp_blkstats != NULL) + if (dp->dp_blkstats != NULL) { + mutex_destroy(&dp->dp_blkstats->zab_lock); kmem_free(dp->dp_blkstats, sizeof (zfs_all_blkstats_t)); + } kmem_free(dp, sizeof (dsl_pool_t)); } From owner-svn-src-all@freebsd.org Fri May 3 06:06:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A11D1585B23; Fri, 3 May 2019 06:06:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E38C08959D; Fri, 3 May 2019 06:06:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC4161CA07; Fri, 3 May 2019 06:06:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4366ddI002836; Fri, 3 May 2019 06:06:39 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4366d9r002835; Fri, 3 May 2019 06:06:39 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201905030606.x4366d9r002835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 3 May 2019 06:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347050 - head/lib/libfetch X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/lib/libfetch X-SVN-Commit-Revision: 347050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E38C08959D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 06:06:40 -0000 Author: adrian Date: Fri May 3 06:06:39 2019 New Revision: 347050 URL: https://svnweb.freebsd.org/changeset/base/347050 Log: [libfetch] Fix compilation with WITHOUT_CRYPT. Modified: head/lib/libfetch/common.c Modified: head/lib/libfetch/common.c ============================================================================== --- head/lib/libfetch/common.c Fri May 3 03:36:00 2019 (r347049) +++ head/lib/libfetch/common.c Fri May 3 06:06:39 2019 (r347050) @@ -994,6 +994,7 @@ fetch_ssl(conn_t *conn, const struct url *URL, int ver #else (void)conn; (void)verbose; + (void)URL; fprintf(stderr, "SSL support disabled\n"); return (-1); #endif From owner-svn-src-all@freebsd.org Fri May 3 08:27:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82B791588E9C; Fri, 3 May 2019 08:27:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 281A98D70B; Fri, 3 May 2019 08:27:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F41511E1C0; Fri, 3 May 2019 08:27:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x438R39o076384; Fri, 3 May 2019 08:27:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x438R3ro076383; Fri, 3 May 2019 08:27:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905030827.x438R3ro076383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 3 May 2019 08:27:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347051 - head/sys/compat/linprocfs X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linprocfs X-SVN-Commit-Revision: 347051 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 281A98D70B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 08:27:04 -0000 Author: trasz Date: Fri May 3 08:27:03 2019 New Revision: 347051 URL: https://svnweb.freebsd.org/changeset/base/347051 Log: Decode more CPU flags in cpuinfo. Reviewed by: dchagin MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20145 Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Fri May 3 06:06:39 2019 (r347050) +++ head/sys/compat/linprocfs/linprocfs.c Fri May 3 08:27:03 2019 (r347051) @@ -212,16 +212,61 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) * We default the flags to include all non-conflicting flags, * and the Intel versions of conflicting flags. */ - static char *flags[] = { - "fpu", "vme", "de", "pse", "tsc", - "msr", "pae", "mce", "cx8", "apic", - "", "sep", "mtrr", "pge", "mca", - "cmov", "pat", "pse36", "pn", "clflush", - "", "dts", "acpi", "mmx", "fxsr", - "sse", "sse2", "ss", "ht", "tm", - "ia64", "pbe" + static char *cpu_feature_names[] = { + /* 0 */ "fpu", "vme", "de", "pse", + /* 4 */ "tsc", "msr", "pae", "mce", + /* 8 */ "cx8", "apic", "", "sep", + /* 12 */ "mtrr", "pge", "mca", "cmov", + /* 16 */ "pat", "pse36", "pn", "clflush", + /* 20 */ "", "dts", "acpi", "mmx", + /* 24 */ "fxsr", "sse", "sse2", "ss", + /* 28 */ "ht", "tm", "ia64", "pbe" }; + static char *amd_feature_names[] = { + /* 0 */ "", "", "", "", + /* 4 */ "", "", "", "", + /* 8 */ "", "", "", "syscall", + /* 12 */ "", "", "", "", + /* 16 */ "", "", "", "mp", + /* 20 */ "nx", "", "mmxext", "", + /* 24 */ "", "fxsr_opt", "pdpe1gb", "rdtscp", + /* 28 */ "", "lm", "3dnowext", "3dnow" + }; + + static char *cpu_feature2_names[] = { + /* 0 */ "pni", "pclmulqdq", "dtes3", "monitor", + /* 4 */ "ds_cpl", "vmx", "smx", "est", + /* 8 */ "tm2", "ssse3", "cid", "sdbg", + /* 12 */ "fma", "cx16", "xptr", "pdcm", + /* 16 */ "", "pcid", "dca", "sse4_1", + /* 20 */ "sse4_2", "x2apic", "movbe", "popcnt", + /* 24 */ "tsc_deadline_timer", "aes", "xsave", "", + /* 28 */ "avx", "f16c", "rdrand", "hypervisor" + }; + + static char *amd_feature2_names[] = { + /* 0 */ "lahf_lm", "cmp_legacy", "svm", "extapic", + /* 4 */ "cr8_legacy", "abm", "sse4a", "misalignsse", + /* 8 */ "3dnowprefetch", "osvw", "ibs", "xop", + /* 12 */ "skinit", "wdt", "", "lwp", + /* 16 */ "fma4", "tce", "", "nodeid_msr", + /* 20 */ "", "tbm", "topoext", "perfctr_core", + /* 24 */ "perfctr_nb", "", "bpext", "ptsc", + /* 28 */ "perfctr_llc", "mwaitx", "", "" + }; + + static char *cpu_stdext_feature_names[] = { + /* 0 */ "fsgsbase", "tsc_adjust", "", "bmi1", + /* 4 */ "hle", "avx2", "", "smep", + /* 8 */ "bmi2", "erms", "invpcid", "rtm", + /* 12 */ "cqm", "", "mpx", "rdt_a", + /* 16 */ "avx512f", "avx512dq", "rdseed", "adx", + /* 20 */ "smap", "avx512ifma", "", "clflushopt", + /* 24 */ "clwb", "intel_pt", "avx512pf", "avx512er", + /* 28 */ "avx512cd", "sha_ni", "avx512bw", "avx512vl" + }; + static char *power_flags[] = { "ts", "fid", "vid", "ttp", "tm", "stc", @@ -240,10 +285,10 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) switch (cpu_vendor_id) { case CPU_VENDOR_AMD: if (cpu_class < CPUCLASS_686) - flags[16] = "fcmov"; + cpu_feature_names[16] = "fcmov"; break; case CPU_VENDOR_CYRIX: - flags[24] = "cxmmx"; + cpu_feature_names[24] = "cxmmx"; break; } #endif @@ -286,9 +331,27 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) (cpu_feature & CPUID_FPU) ? "yes" : "no", "yes", CPUID_TO_FAMILY(cpu_id), "yes"); sbuf_cat(sb, "flags\t\t:"); - for (j = 0; j < nitems(flags); j++) - if (cpu_feature & (1 << j) && flags[j][0] != '\0') - sbuf_printf(sb, " %s", flags[j]); + for (j = 0; j < nitems(cpu_feature_names); j++) + if (cpu_feature & (1 << j) && + cpu_feature_names[j][0] != '\0') + sbuf_printf(sb, " %s", cpu_feature_names[j]); + for (j = 0; j < nitems(amd_feature_names); j++) + if (amd_feature & (1 << j) && + amd_feature_names[j][0] != '\0') + sbuf_printf(sb, " %s", amd_feature_names[j]); + for (j = 0; j < nitems(cpu_feature2_names); j++) + if (cpu_feature2 & (1 << j) && + cpu_feature2_names[j][0] != '\0') + sbuf_printf(sb, " %s", cpu_feature2_names[j]); + for (j = 0; j < nitems(amd_feature2_names); j++) + if (amd_feature2 & (1 << j) && + amd_feature2_names[j][0] != '\0') + sbuf_printf(sb, " %s", amd_feature2_names[j]); + for (j = 0; j < nitems(cpu_stdext_feature_names); j++) + if (cpu_stdext_feature & (1 << j) && + cpu_stdext_feature_names[j][0] != '\0') + sbuf_printf(sb, " %s", + cpu_stdext_feature_names[j]); sbuf_cat(sb, "\n"); sbuf_printf(sb, "bugs\t\t: %s\n" From owner-svn-src-all@freebsd.org Fri May 3 08:40:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 000C915893AF for ; Fri, 3 May 2019 08:40:30 +0000 (UTC) (envelope-from vanessa@leadsdatalist.com) Received: from NEW-02-4.privateemail.com (new-02-4.privateemail.com [198.54.122.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "privateemail.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 467058DFD9 for ; Fri, 3 May 2019 08:40:29 +0000 (UTC) (envelope-from vanessa@leadsdatalist.com) Received: from NEW-02-2.privateemail.com (unknown [10.20.150.222]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by NEW-02-4.privateemail.com (Postfix) with ESMTPS id 91F7880BF2 for ; Fri, 3 May 2019 08:40:26 +0000 (UTC) Received: from MTA-06-1.privateemail.com (unknown [10.20.147.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by NEW-02.privateemail.com (Postfix) with ESMTPS id 8C3BA608CB for ; Fri, 3 May 2019 08:40:26 +0000 (UTC) Received: from MTA-06.privateemail.com (localhost [127.0.0.1]) by MTA-06.privateemail.com (Postfix) with ESMTP id 7BE3A60045 for ; Fri, 3 May 2019 04:40:26 -0400 (EDT) Received: from DESKTOP9H8BFK9 (unknown [10.20.151.209]) by MTA-06.privateemail.com (Postfix) with ESMTPA id 929426004B for ; Fri, 3 May 2019 08:40:25 +0000 (UTC) From: "Vanessa Sam" To: Subject: ANGA COM 2019 - Attendee Portal Date: Fri, 3 May 2019 04:39:38 -0400 Message-ID: MIME-Version: 1.0 X-Mailer: Microsoft Outlook 15.0 Thread-Index: AdUBi7V34H0e4ElJRtmoFNmTK5Y4yw== Content-Language: en-us X-Virus-Scanned: ClamAV using ClamSMTP X-Rspamd-Queue-Id: 467058DFD9 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of vanessa@leadsdatalist.com designates 198.54.122.48 as permitted sender) smtp.mailfrom=vanessa@leadsdatalist.com X-Spamd-Result: default: False [-4.59 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:198.54.122.32/27]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_TLS_LAST(0.00)[]; MX_GOOD(-0.01)[mx2.privateemail.com,mx1.privateemail.com]; NEURAL_HAM_SHORT(-0.89)[-0.889,0]; RCVD_IN_DNSWL_NONE(0.00)[48.122.54.198.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.39)[ip: (-7.25), ipnet: 198.54.122.0/24(-0.19), asn: 22612(0.56), country: US(-0.06)]; DMARC_NA(0.00)[leadsdatalist.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; ASN(0.00)[asn:22612, ipnet:198.54.122.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 08:40:31 -0000 Dear Exhibitor, May we wish you every success in the forthcoming exhibition? ANGA COM 2019 Attendees list is available now, all the contacts include only permission-based opt-in information. Hence, you directly reach the right point of contact. We can accord the insights on an excel spread-sheet or whichever the format your CRM supports to send invitations and to run an effective marketing campaign before and after the show. Attendees : * Telecommunication And Media Industry Professionals Attendee's List Include : Company Name, Website, Contact Name, Title, Contact Number, Mailing Address and Contact Person Verified Business Email Address etc. Information provided is for perpetual and unlimited usage including telemarketing, direct marketing and email marketing initiatives. Please let me know your thoughts and interest, So that I can send you the Exhibitor discount costs of the lists. Swift response would be appreciated. Regards, Vanessa Sam From owner-svn-src-all@freebsd.org Fri May 3 08:42:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D913D158961B; Fri, 3 May 2019 08:42:51 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AA018E337; Fri, 3 May 2019 08:42:51 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 256B71E520; Fri, 3 May 2019 08:42:51 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x438gpcW087271; Fri, 3 May 2019 08:42:51 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x438gnmw087262; Fri, 3 May 2019 08:42:49 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905030842.x438gnmw087262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Fri, 3 May 2019 08:42:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347052 - in head/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux X-SVN-Commit-Revision: 347052 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7AA018E337 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 08:42:52 -0000 Author: dchagin Date: Fri May 3 08:42:49 2019 New Revision: 347052 URL: https://svnweb.freebsd.org/changeset/base/347052 Log: In order to reduce duplication between MD parts of the Linuxulator move bits that are MI out into the headers in compat/linux. For that remove bogus _packed attribute from struct l_sockaddr and use MI types for struct members. And continue to move into the linux_common module a code that is intended for both Linuxulator modules (both instruction set - 32 & 64 bit) or for external modules like linsysfs or linprocfs. To avoid header pollution introduce new sys/compat/linux_common.h header. Reviewed by: emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20137 Added: head/sys/compat/linux/linux_common.h (contents, props changed) Modified: head/sys/amd64/linux/linux.h head/sys/amd64/linux32/linux.h head/sys/arm64/linux/linux.h head/sys/compat/linux/linux.c head/sys/compat/linux/linux.h head/sys/compat/linux/linux_ioctl.c head/sys/i386/linux/linux.h Modified: head/sys/amd64/linux/linux.h ============================================================================== --- head/sys/amd64/linux/linux.h Fri May 3 08:27:03 2019 (r347051) +++ head/sys/amd64/linux/linux.h Fri May 3 08:42:49 2019 (r347052) @@ -377,11 +377,6 @@ union l_semun { l_uintptr_t __pad; }; -struct l_sockaddr { - l_ushort sa_family; - char sa_data[14]; -}; - struct l_ifmap { l_ulong mem_start; l_ulong mem_end; @@ -390,9 +385,6 @@ struct l_ifmap { u_char dma; u_char port; } __packed; - -#define LINUX_IFHWADDRLEN 6 -#define LINUX_IFNAMSIZ 16 struct l_ifreq { union { Modified: head/sys/amd64/linux32/linux.h ============================================================================== --- head/sys/amd64/linux32/linux.h Fri May 3 08:27:03 2019 (r347051) +++ head/sys/amd64/linux32/linux.h Fri May 3 08:42:49 2019 (r347052) @@ -478,11 +478,6 @@ union l_semun { l_uintptr_t __pad; } __packed; -struct l_sockaddr { - l_ushort sa_family; - char sa_data[14]; -} __packed; - struct l_ifmap { l_ulong mem_start; l_ulong mem_end; @@ -491,9 +486,6 @@ struct l_ifmap { u_char dma; u_char port; } __packed; - -#define LINUX_IFHWADDRLEN 6 -#define LINUX_IFNAMSIZ 16 struct l_ifreq { union { Modified: head/sys/arm64/linux/linux.h ============================================================================== --- head/sys/arm64/linux/linux.h Fri May 3 08:27:03 2019 (r347051) +++ head/sys/arm64/linux/linux.h Fri May 3 08:42:49 2019 (r347052) @@ -264,11 +264,6 @@ union l_semun { l_uintptr_t __pad; }; -struct l_sockaddr { - l_ushort sa_family; - char sa_data[14]; -}; - struct l_ifmap { l_ulong mem_start; l_ulong mem_end; @@ -277,9 +272,6 @@ struct l_ifmap { u_char dma; u_char port; } __packed; - -#define LINUX_IFHWADDRLEN 6 -#define LINUX_IFNAMSIZ 16 struct l_ifreq { union { Modified: head/sys/compat/linux/linux.c ============================================================================== --- head/sys/compat/linux/linux.c Fri May 3 08:27:03 2019 (r347051) +++ head/sys/compat/linux/linux.c Fri May 3 08:42:49 2019 (r347052) @@ -29,10 +29,21 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include #include +#include +#include +#include +#include +#include + #include +#include +CTASSERT(LINUX_IFNAMSIZ == IFNAMSIZ); static int bsd_to_linux_sigtbl[LINUX_SIGTBLSZ] = { LINUX_SIGHUP, /* SIGHUP */ @@ -202,4 +213,98 @@ bsd_to_linux_sigset(sigset_t *bss, l_sigset_t *lss) LINUX_SIGADDSET(*lss, l); } } +} + +/* + * Translate a Linux interface name to a FreeBSD interface name, + * and return the associated ifnet structure + * bsdname and lxname need to be least IFNAMSIZ bytes long, but + * can point to the same buffer. + */ +struct ifnet * +ifname_linux_to_bsd(struct thread *td, const char *lxname, char *bsdname) +{ + struct ifnet *ifp; + int len, unit; + char *ep; + int is_eth, is_lo, index; + + for (len = 0; len < LINUX_IFNAMSIZ; ++len) + if (!isalpha(lxname[len]) || lxname[len] == 0) + break; + if (len == 0 || len == LINUX_IFNAMSIZ) + return (NULL); + /* Linux loopback interface name is lo (not lo0) */ + is_lo = (len == 2 && !strncmp(lxname, "lo", len)) ? 1 : 0; + unit = (int)strtoul(lxname + len, &ep, 10); + if ((ep == NULL || ep == lxname + len || ep >= lxname + LINUX_IFNAMSIZ) && + is_lo == 0) + return (NULL); + index = 0; + is_eth = (len == 3 && !strncmp(lxname, "eth", len)) ? 1 : 0; + + CURVNET_SET(TD_TO_VNET(td)); + IFNET_RLOCK(); + CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { + /* + * Allow Linux programs to use FreeBSD names. Don't presume + * we never have an interface named "eth", so don't make + * the test optional based on is_eth. + */ + if (strncmp(ifp->if_xname, lxname, LINUX_IFNAMSIZ) == 0) + break; + if (is_eth && IFP_IS_ETH(ifp) && unit == index++) + break; + if (is_lo && IFP_IS_LOOP(ifp)) + break; + } + IFNET_RUNLOCK(); + CURVNET_RESTORE(); + if (ifp != NULL && bsdname != NULL) + strlcpy(bsdname, ifp->if_xname, IFNAMSIZ); + return (ifp); +} + +void +linux_ifflags(struct ifnet *ifp, short *flags) +{ + + *flags = (ifp->if_flags | ifp->if_drv_flags) & 0xffff; + /* these flags have no Linux equivalent */ + *flags &= ~(IFF_DRV_OACTIVE|IFF_SIMPLEX| + IFF_LINK0|IFF_LINK1|IFF_LINK2); + /* Linux' multicast flag is in a different bit */ + if (*flags & IFF_MULTICAST) { + *flags &= ~IFF_MULTICAST; + *flags |= 0x1000; + } +} + +int +linux_ifhwaddr(struct ifnet *ifp, struct l_sockaddr *lsa) +{ + struct ifaddr *ifa; + struct sockaddr_dl *sdl; + + if (IFP_IS_LOOP(ifp)) { + bzero(lsa, sizeof(*lsa)); + lsa->sa_family = LINUX_ARPHRD_LOOPBACK; + return (0); + } + + if (!IFP_IS_ETH(ifp)) + return (ENOENT); + + CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + sdl = (struct sockaddr_dl*)ifa->ifa_addr; + if (sdl != NULL && (sdl->sdl_family == AF_LINK) && + (sdl->sdl_type == IFT_ETHER)) { + bzero(lsa, sizeof(*lsa)); + lsa->sa_family = LINUX_ARPHRD_ETHER; + bcopy(LLADDR(sdl), lsa->sa_data, LINUX_IFHWADDRLEN); + return (0); + } + } + + return (ENOENT); } Modified: head/sys/compat/linux/linux.h ============================================================================== --- head/sys/compat/linux/linux.h Fri May 3 08:27:03 2019 (r347051) +++ head/sys/compat/linux/linux.h Fri May 3 08:42:49 2019 (r347052) @@ -29,6 +29,23 @@ #ifndef _LINUX_MI_H_ #define _LINUX_MI_H_ +#define LINUX_IFHWADDRLEN 6 +#define LINUX_IFNAMSIZ 16 + +/* + * Criteria for interface name translation + */ +#define IFP_IS_ETH(ifp) (ifp->if_type == IFT_ETHER) +#define IFP_IS_LOOP(ifp) (ifp->if_type == IFT_LOOP) + +struct l_sockaddr { + unsigned short sa_family; + char sa_data[14]; +}; + +#define LINUX_ARPHRD_ETHER 1 +#define LINUX_ARPHRD_LOOPBACK 772 + /* sigaltstack */ #define LINUX_SS_ONSTACK 1 #define LINUX_SS_DISABLE 2 Added: head/sys/compat/linux/linux_common.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linux/linux_common.h Fri May 3 08:42:49 2019 (r347052) @@ -0,0 +1,38 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 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. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_COMMON_H_ +#define _LINUX_COMMON_H_ + +struct ifnet *ifname_linux_to_bsd(struct thread *td, + const char *lxname, char *bsdname); +void linux_ifflags(struct ifnet *ifp, short *flags); +int linux_ifhwaddr(struct ifnet *ifp, struct l_sockaddr *lsa); + +#endif /* _LINUX_COMMON_H_ */ Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Fri May 3 08:27:03 2019 (r347051) +++ head/sys/compat/linux/linux_ioctl.c Fri May 3 08:42:49 2019 (r347052) @@ -81,6 +81,7 @@ __FBSDID("$FreeBSD$"); #include #endif +#include #include #include #include @@ -2122,56 +2123,6 @@ linux_ioctl_console(struct thread *td, struct linux_io } /* - * Criteria for interface name translation - */ -#define IFP_IS_ETH(ifp) (ifp->if_type == IFT_ETHER) - -/* - * Translate a Linux interface name to a FreeBSD interface name, - * and return the associated ifnet structure - * bsdname and lxname need to be least IFNAMSIZ bytes long, but - * can point to the same buffer. - */ - -static struct ifnet * -ifname_linux_to_bsd(struct thread *td, const char *lxname, char *bsdname) -{ - struct ifnet *ifp; - int len, unit; - char *ep; - int is_eth, index; - - for (len = 0; len < LINUX_IFNAMSIZ; ++len) - if (!isalpha(lxname[len])) - break; - if (len == 0 || len == LINUX_IFNAMSIZ) - return (NULL); - unit = (int)strtoul(lxname + len, &ep, 10); - if (ep == NULL || ep == lxname + len || ep >= lxname + LINUX_IFNAMSIZ) - return (NULL); - index = 0; - is_eth = (len == 3 && !strncmp(lxname, "eth", len)) ? 1 : 0; - CURVNET_SET(TD_TO_VNET(td)); - IFNET_RLOCK(); - CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { - /* - * Allow Linux programs to use FreeBSD names. Don't presume - * we never have an interface named "eth", so don't make - * the test optional based on is_eth. - */ - if (strncmp(ifp->if_xname, lxname, LINUX_IFNAMSIZ) == 0) - break; - if (is_eth && IFP_IS_ETH(ifp) && unit == index++) - break; - } - IFNET_RUNLOCK(); - CURVNET_RESTORE(); - if (ifp != NULL) - strlcpy(bsdname, ifp->if_xname, IFNAMSIZ); - return (ifp); -} - -/* * Implement the SIOCGIFNAME ioctl */ @@ -2332,50 +2283,20 @@ linux_gifflags(struct thread *td, struct ifnet *ifp, s { l_short flags; - flags = (ifp->if_flags | ifp->if_drv_flags) & 0xffff; - /* these flags have no Linux equivalent */ - flags &= ~(IFF_DRV_OACTIVE|IFF_SIMPLEX| - IFF_LINK0|IFF_LINK1|IFF_LINK2); - /* Linux' multicast flag is in a different bit */ - if (flags & IFF_MULTICAST) { - flags &= ~IFF_MULTICAST; - flags |= 0x1000; - } + linux_ifflags(ifp, &flags); return (copyout(&flags, &ifr->ifr_flags, sizeof(flags))); } -#define ARPHRD_ETHER 1 -#define ARPHRD_LOOPBACK 772 - static int linux_gifhwaddr(struct ifnet *ifp, struct l_ifreq *ifr) { - struct ifaddr *ifa; - struct sockaddr_dl *sdl; struct l_sockaddr lsa; - if (ifp->if_type == IFT_LOOP) { - bzero(&lsa, sizeof(lsa)); - lsa.sa_family = ARPHRD_LOOPBACK; - return (copyout(&lsa, &ifr->ifr_hwaddr, sizeof(lsa))); - } - - if (ifp->if_type != IFT_ETHER) + if (linux_ifhwaddr(ifp, &lsa) != 0) return (ENOENT); - CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - sdl = (struct sockaddr_dl*)ifa->ifa_addr; - if (sdl != NULL && (sdl->sdl_family == AF_LINK) && - (sdl->sdl_type == IFT_ETHER)) { - bzero(&lsa, sizeof(lsa)); - lsa.sa_family = ARPHRD_ETHER; - bcopy(LLADDR(sdl), lsa.sa_data, LINUX_IFHWADDRLEN); - return (copyout(&lsa, &ifr->ifr_hwaddr, sizeof(lsa))); - } - } - - return (ENOENT); + return (copyout(&lsa, &ifr->ifr_hwaddr, sizeof(lsa))); } Modified: head/sys/i386/linux/linux.h ============================================================================== --- head/sys/i386/linux/linux.h Fri May 3 08:27:03 2019 (r347051) +++ head/sys/i386/linux/linux.h Fri May 3 08:42:49 2019 (r347052) @@ -454,11 +454,6 @@ union l_semun { l_uintptr_t __pad; }; -struct l_sockaddr { - l_ushort sa_family; - char sa_data[14]; -}; - struct l_ifmap { l_ulong mem_start; l_ulong mem_end; @@ -467,9 +462,6 @@ struct l_ifmap { u_char dma; u_char port; }; - -#define LINUX_IFHWADDRLEN 6 -#define LINUX_IFNAMSIZ 16 struct l_ifreq { union { From owner-svn-src-all@freebsd.org Fri May 3 08:57:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0789615898E2; Fri, 3 May 2019 08:57:23 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C37818E9F6; Fri, 3 May 2019 08:57:16 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (mh0.gentlemail.de [78.138.80.135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id x438vDXt078377; Fri, 3 May 2019 10:57:13 +0200 (CEST) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id 450F23F6; Fri, 3 May 2019 10:57:13 +0200 (CEST) Subject: Re: svn commit: r346217 - in head/sys: fs/nfs fs/nfsclient kern sys To: Rick Macklem , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201904150127.x3F1RG7X062973@repo.freebsd.org> From: Harry Schmalzbauer Organization: OmniLAN Message-ID: <8a6cb225-8644-9949-09ab-7e1525e24034@omnilan.de> Date: Fri, 3 May 2019 10:57:12 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201904150127.x3F1RG7X062973@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Greylist: ACL 130 matched, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [78.138.80.130]); Fri, 03 May 2019 10:57:13 +0200 (CEST) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: 78.138.80.135; Sender-helo: mh0.gentlemail.de; ) X-Rspamd-Queue-Id: C37818E9F6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of freebsd@omnilan.de designates 2a00:e10:2800::a130 as permitted sender) smtp.mailfrom=freebsd@omnilan.de X-Spamd-Result: default: False [-6.74 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[omnilan.de]; TO_DN_SOME(0.00)[]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-3.51)[ip: (-9.19), ipnet: 2a00:e10:2800::/64(-4.67), asn: 25074(-3.68), country: DE(-0.01)]; MX_GOOD(-0.01)[mx0.gentlemail.de]; NEURAL_HAM_SHORT(-0.92)[-0.923,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:25074, ipnet:2a00:e10:2800::/64, country:DE]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 08:57:23 -0000 Am 15.04.2019 um 03:27 schrieb Rick Macklem: > Author: rmacklem > Date: Mon Apr 15 01:27:15 2019 > New Revision: 346217 > URL: https://svnweb.freebsd.org/changeset/base/346217 > > Log: > Fix the NFSv4 client to safely find processes. > > r340744 broke the NFSv4 client, because it replaced pfind_locked() with a > call to pfind(), since pfind() acquires the sx lock for the pid hash and > the NFSv4 already holds a mutex when it does the call. > The patch fixes the problem by recreating a pfind_any_locked() and adding the > functions pidhash_slockall() and pidhash_sunlockall to acquire/release > all of the pid hash locks. > These functions are then used by the NFSv4 client instead of acquiring > the allproc_lock and calling pfind(). > > Reviewed by: kib, mjg > MFC after: 2 weeks Hello, I guess as long as r340744 isn't MFCd, this commit isn't needed in /stable/, is it? Any plans to MFC https://svnweb.freebsd.org/base?view=revision&revision=340744 (proc: convert pfind & friends to use pidhash locks and other cleanup) Thanks, -Harry From owner-svn-src-all@freebsd.org Fri May 3 09:38:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60E3B158A81C; Fri, 3 May 2019 09:38:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D162D68168; Fri, 3 May 2019 09:38:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54B441EE15; Fri, 3 May 2019 09:38:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x439cOgc014119; Fri, 3 May 2019 09:38:24 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x439cOrI014118; Fri, 3 May 2019 09:38:24 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905030938.x439cOrI014118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 3 May 2019 09:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347053 - stable/11/sys/compat/linuxkpi/common/src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 347053 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D162D68168 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 09:38:25 -0000 Author: hselasky Date: Fri May 3 09:38:23 2019 New Revision: 347053 URL: https://svnweb.freebsd.org/changeset/base/347053 Log: MFC r346712: Don't call cdev_init where cdev_alloc is called. cdev_alloc already handles initialization. Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Fri May 3 08:42:49 2019 (r347052) +++ stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Fri May 3 09:38:23 2019 (r347053) @@ -2328,7 +2328,7 @@ __register_chrdev(unsigned int major, unsigned int bas for (i = baseminor; i < baseminor + count; i++) { cdev = cdev_alloc(); - cdev_init(cdev, fops); + cdev->ops = fops; kobject_set_name(&cdev->kobj, name); ret = cdev_add(cdev, makedev(major, i), 1); @@ -2350,7 +2350,7 @@ __register_chrdev_p(unsigned int major, unsigned int b for (i = baseminor; i < baseminor + count; i++) { cdev = cdev_alloc(); - cdev_init(cdev, fops); + cdev->ops = fops; kobject_set_name(&cdev->kobj, name); ret = cdev_add_ext(cdev, makedev(major, i), uid, gid, mode); From owner-svn-src-all@freebsd.org Fri May 3 09:38:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE448158A873; Fri, 3 May 2019 09:38:49 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49A9F6836E; Fri, 3 May 2019 09:38:48 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [176.74.212.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 015A326029D; Fri, 3 May 2019 11:38:45 +0200 (CEST) Subject: Re: svn commit: r347012 - stable/12/sys/compat/linuxkpi/common/src From: Hans Petter Selasky To: Johannes Lundberg , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org References: <201905020226.x422Qge2023199@repo.freebsd.org> Message-ID: Date: Fri, 3 May 2019 11:38:18 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 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-Rspamd-Queue-Id: 49A9F6836E X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-5.69 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; IP_SCORE(-2.54)[ip: (-8.92), ipnet: 2a01:4f8::/29(-2.06), asn: 24940(-1.70), country: DE(-0.01)]; MX_GOOD(-0.01)[mail.turbocat.net]; NEURAL_HAM_SHORT(-0.84)[-0.842,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 09:38:49 -0000 On 2019-05-02 09:32, Hans Petter Selasky wrote: > On 2019-05-02 04:26, Johannes Lundberg wrote: >> Author: johalun >> Date: Thu May  2 02:26:42 2019 >> New Revision: 347012 >> URL: https://svnweb.freebsd.org/changeset/base/347012 >> >> Log: >>    MFC r346712: >>    Don't call cdev_init where cdev_alloc is called. cdev_alloc already >>    handles initialization. > > Please also MFC to 11 if possible. > I took care of it. --HPS From owner-svn-src-all@freebsd.org Fri May 3 13:06:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0068F1590072; Fri, 3 May 2019 13:06:47 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 986FE70ABE; Fri, 3 May 2019 13:06:46 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7130D21187; Fri, 3 May 2019 13:06:46 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43D6kkG026701; Fri, 3 May 2019 13:06:46 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43D6kOp026700; Fri, 3 May 2019 13:06:46 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201905031306.x43D6kOp026700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 3 May 2019 13:06:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347054 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 347054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 986FE70ABE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 13:06:47 -0000 Author: bde Date: Fri May 3 13:06:46 2019 New Revision: 347054 URL: https://svnweb.freebsd.org/changeset/base/347054 Log: Fix copying planar bitmaps when the horizontal start and end are both not multiples of 8. Then the misaligned pixels at the end were not copied. Clean up variable misuse related to this bug. The width in bytes was first calculated correctly and used to do complicated reblocking correctly, but it was stored in an unrelated scratch variable and later recalculated with an off-by-1-error, so the last byte (times 4 planes) in the intermediate copy was not copied. This doubly-misaligned case is especially slow. Misalignment complicates the reblocking, and each misaligment requires a read before write, and this read is still not done from the shadow buffer. Modified: head/lib/libvgl/bitmap.c Modified: head/lib/libvgl/bitmap.c ============================================================================== --- head/lib/libvgl/bitmap.c Fri May 3 09:38:23 2019 (r347053) +++ head/lib/libvgl/bitmap.c Fri May 3 13:06:46 2019 (r347054) @@ -47,7 +47,7 @@ static int color2bit[16] = {0x00000000, 0x00000001, 0x static void WriteVerticalLine(VGLBitmap *dst, int x, int y, int width, byte *line) { - int i, pos, last, planepos, start_offset, end_offset, offset; + int bwidth, i, pos, last, planepos, start_offset, end_offset, offset; int len; unsigned int word = 0; byte *address; @@ -58,13 +58,13 @@ WriteVerticalLine(VGLBitmap *dst, int x, int y, int wi case VIDBUF4S: start_offset = (x & 0x07); end_offset = (x + width) & 0x07; - i = (width + start_offset) / 8; + bwidth = (width + start_offset) / 8; if (end_offset) - i++; + bwidth++; VGLPlane[0] = VGLBuf; - VGLPlane[1] = VGLPlane[0] + i; - VGLPlane[2] = VGLPlane[1] + i; - VGLPlane[3] = VGLPlane[2] + i; + VGLPlane[1] = VGLPlane[0] + bwidth; + VGLPlane[2] = VGLPlane[1] + bwidth; + VGLPlane[3] = VGLPlane[2] + bwidth; pos = 0; planepos = 0; last = 8 - start_offset; @@ -87,9 +87,6 @@ WriteVerticalLine(VGLBitmap *dst, int x, int y, int wi VGLPlane[2][planepos] = word>>16; VGLPlane[3][planepos] = word>>24; } - if (start_offset || end_offset) - width+=8; - width /= 8; outb(0x3ce, 0x01); outb(0x3cf, 0x00); /* set/reset enable */ outb(0x3ce, 0x08); outb(0x3cf, 0xff); /* bit mask */ for (i=0; i<4; i++) { @@ -103,7 +100,7 @@ WriteVerticalLine(VGLBitmap *dst, int x, int y, int wi VGLPlane[i][planepos] |= dst->Bitmap[pos+planepos] & mask[end_offset]; if (start_offset) VGLPlane[i][0] |= dst->Bitmap[pos] & ~mask[start_offset]; - bcopy(&VGLPlane[i][0], dst->Bitmap + pos, width); + bcopy(&VGLPlane[i][0], dst->Bitmap + pos, bwidth); } else { /* VIDBUF4S */ if (end_offset) { offset = VGLSetSegment(pos + planepos); @@ -112,9 +109,9 @@ WriteVerticalLine(VGLBitmap *dst, int x, int y, int wi offset = VGLSetSegment(pos); if (start_offset) VGLPlane[i][0] |= dst->Bitmap[offset] & ~mask[start_offset]; - for (last = width; ; ) { + for (last = bwidth; ; ) { len = min(VGLAdpInfo.va_window_size - offset, last); - bcopy(&VGLPlane[i][width - last], dst->Bitmap + offset, len); + bcopy(&VGLPlane[i][bwidth - last], dst->Bitmap + offset, len); pos += len; last -= len; if (last <= 0) From owner-svn-src-all@freebsd.org Fri May 3 14:43:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D37431592457; Fri, 3 May 2019 14:43:23 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76C2574646; Fri, 3 May 2019 14:43:23 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62AE8222D2; Fri, 3 May 2019 14:43:23 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43EhNp8080877; Fri, 3 May 2019 14:43:23 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43EhML2080871; Fri, 3 May 2019 14:43:22 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201905031443.x43EhML2080871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Fri, 3 May 2019 14:43:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347055 - in head: sbin/ifconfig sys/net X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: in head: sbin/ifconfig sys/net X-SVN-Commit-Revision: 347055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 76C2574646 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 14:43:24 -0000 Author: gallatin Date: Fri May 3 14:43:21 2019 New Revision: 347055 URL: https://svnweb.freebsd.org/changeset/base/347055 Log: Select lacp egress ports based on NUMA domain This change creates an array of port maps indexed by numa domain for lacp port selection. If we have lacp interfaces in more than one domain, then we select the egress port by indexing into the numa port maps and picking a port on the appropriate numa domain. This is behavior is controlled by the new ifconfig use_numa flag and net.link.lagg.use_numa sysctl/tunable (both modeled after the existing use_flowid), which default to enabled. Reviewed by: bz, hselasky, markj (and scottl, earlier version) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20060 Modified: head/sbin/ifconfig/ifconfig.8 head/sbin/ifconfig/iflagg.c head/sys/net/ieee8023ad_lacp.c head/sys/net/ieee8023ad_lacp.h head/sys/net/if_lagg.c head/sys/net/if_lagg.h Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Fri May 3 13:06:46 2019 (r347054) +++ head/sbin/ifconfig/ifconfig.8 Fri May 3 14:43:21 2019 (r347055) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd June 27, 2018 +.Dd May 3, 2019 .Dt IFCONFIG 8 .Os .Sh NAME @@ -2497,6 +2497,22 @@ Use the RSS hash from the network card if available. Set a shift parameter for RSS local hash computation. Hash is calculated by using flowid bits in a packet header mbuf which are shifted by the number of this parameter. +.It Cm use_numa +Enable selection of egress ports based on the native +.Xr NUMA 4 +domain for the packets being transmitted. +This is currently only implemented for lacp mode. +This works only on +.Xr NUMA 4 +hardware, running a kernel compiled with the +.Xr NUMA 4 +option, and when interfaces from multiple +.Xr NUMA 4 +domains are ports of the aggregation interface. +.It Cm -use_numa +Disable selection of egress ports based on the native +.Xr NUMA 4 +domain for the packets being transmitted. .It Cm lacp_fast_timeout Enable lacp fast-timeout on the interface. .It Cm -lacp_fast_timeout Modified: head/sbin/ifconfig/iflagg.c ============================================================================== --- head/sbin/ifconfig/iflagg.c Fri May 3 13:06:46 2019 (r347054) +++ head/sbin/ifconfig/iflagg.c Fri May 3 14:43:21 2019 (r347055) @@ -130,6 +130,8 @@ setlaggsetopt(const char *val, int d, int s, const str switch (ro.ro_opts) { case LAGG_OPT_USE_FLOWID: case -LAGG_OPT_USE_FLOWID: + case LAGG_OPT_USE_NUMA: + case -LAGG_OPT_USE_NUMA: case LAGG_OPT_LACP_STRICT: case -LAGG_OPT_LACP_STRICT: case LAGG_OPT_LACP_TXTEST: @@ -303,6 +305,8 @@ static struct cmd lagg_cmds[] = { DEF_CMD_ARG("lagghash", setlagghash), DEF_CMD("use_flowid", LAGG_OPT_USE_FLOWID, setlaggsetopt), DEF_CMD("-use_flowid", -LAGG_OPT_USE_FLOWID, setlaggsetopt), + DEF_CMD("use_numa", LAGG_OPT_USE_NUMA, setlaggsetopt), + DEF_CMD("-use_numa", -LAGG_OPT_USE_NUMA, setlaggsetopt), DEF_CMD("lacp_strict", LAGG_OPT_LACP_STRICT, setlaggsetopt), DEF_CMD("-lacp_strict", -LAGG_OPT_LACP_STRICT, setlaggsetopt), DEF_CMD("lacp_txtest", LAGG_OPT_LACP_TXTEST, setlaggsetopt), Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Fri May 3 13:06:46 2019 (r347054) +++ head/sys/net/ieee8023ad_lacp.c Fri May 3 14:43:21 2019 (r347055) @@ -835,7 +835,9 @@ lacp_select_tx_port(struct lagg_softc *sc, struct mbuf struct lacp_softc *lsc = LACP_SOFTC(sc); struct lacp_portmap *pm; struct lacp_port *lp; + struct lacp_port **map; uint32_t hash; + int count; if (__predict_false(lsc->lsc_suppress_distributing)) { LACP_DPRINTF((NULL, "%s: waiting transit\n", __func__)); @@ -848,14 +850,32 @@ lacp_select_tx_port(struct lagg_softc *sc, struct mbuf return (NULL); } +#ifdef NUMA + if ((sc->sc_opts & LAGG_OPT_USE_NUMA) && + pm->pm_num_dom > 1 && m->m_pkthdr.numa_domain < MAXMEMDOM) { + count = pm->pm_numa[m->m_pkthdr.numa_domain].count; + if (count > 0) { + map = pm->pm_numa[m->m_pkthdr.numa_domain].map; + } else { + /* No ports on this domain; use global hash. */ + map = pm->pm_map; + count = pm->pm_count; + } + } else +#endif + { + map = pm->pm_map; + count = pm->pm_count; + } if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) && M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) hash = m->m_pkthdr.flowid >> sc->flowid_shift; else hash = m_ether_tcpip_hash(sc->sc_flags, m, lsc->lsc_hashkey); - hash %= pm->pm_count; - lp = pm->pm_map[hash]; + hash %= count; + lp = map[hash]; + KASSERT((lp->lp_state & LACP_STATE_DISTRIBUTING) != 0, ("aggregated port is not distributing")); @@ -1044,6 +1064,10 @@ lacp_update_portmap(struct lacp_softc *lsc) uint64_t speed; u_int newmap; int i; +#ifdef NUMA + int count; + uint8_t domain; +#endif newmap = lsc->lsc_activemap == 0 ? 1 : 0; p = &lsc->lsc_pmap[newmap]; @@ -1054,9 +1078,25 @@ lacp_update_portmap(struct lacp_softc *lsc) if (la != NULL && la->la_nports > 0) { p->pm_count = la->la_nports; i = 0; - TAILQ_FOREACH(lp, &la->la_ports, lp_dist_q) + TAILQ_FOREACH(lp, &la->la_ports, lp_dist_q) { p->pm_map[i++] = lp; +#ifdef NUMA + domain = lp->lp_ifp->if_numa_domain; + if (domain >= MAXMEMDOM) + continue; + count = p->pm_numa[domain].count; + p->pm_numa[domain].map[count] = lp; + p->pm_numa[domain].count++; +#endif + } KASSERT(i == p->pm_count, ("Invalid port count")); + +#ifdef NUMA + for (i = 0; i < MAXMEMDOM; i++) { + if (p->pm_numa[i].count != 0) + p->pm_num_dom++; + } +#endif speed = lacp_aggregator_bandwidth(la); } sc->sc_ifp->if_baudrate = speed; Modified: head/sys/net/ieee8023ad_lacp.h ============================================================================== --- head/sys/net/ieee8023ad_lacp.h Fri May 3 13:06:46 2019 (r347054) +++ head/sys/net/ieee8023ad_lacp.h Fri May 3 14:43:21 2019 (r347055) @@ -197,8 +197,15 @@ enum lacp_mux_state { #define LACP_MAX_PORTS 32 +struct lacp_numa { + int count; + struct lacp_port *map[LACP_MAX_PORTS]; +}; + struct lacp_portmap { int pm_count; + int pm_num_dom; + struct lacp_numa pm_numa[MAXMEMDOM]; struct lacp_port *pm_map[LACP_MAX_PORTS]; }; Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Fri May 3 13:06:46 2019 (r347054) +++ head/sys/net/if_lagg.c Fri May 3 14:43:21 2019 (r347055) @@ -264,6 +264,13 @@ SYSCTL_INT(_net_link_lagg, OID_AUTO, default_use_flowi &VNET_NAME(def_use_flowid), 0, "Default setting for using flow id for load sharing"); +/* Default value for using numa */ +VNET_DEFINE_STATIC(int, def_use_numa) = 1; +#define V_def_use_numa VNET(def_use_numa) +SYSCTL_INT(_net_link_lagg, OID_AUTO, default_use_numa, CTLFLAG_RWTUN, + &VNET_NAME(def_use_numa), 0, + "Use numa to steer flows"); + /* Default value for flowid shift */ VNET_DEFINE_STATIC(int, def_flowid_shift) = 16; #define V_def_flowid_shift VNET(def_flowid_shift) @@ -491,6 +498,8 @@ lagg_clone_create(struct if_clone *ifc, int unit, cadd LAGG_XLOCK(sc); if (V_def_use_flowid) sc->sc_opts |= LAGG_OPT_USE_FLOWID; + if (V_def_use_numa) + sc->sc_opts |= LAGG_OPT_USE_NUMA; sc->flowid_shift = V_def_flowid_shift; /* Hash all layers by default */ @@ -1247,6 +1256,8 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data switch (ro->ro_opts) { case LAGG_OPT_USE_FLOWID: case -LAGG_OPT_USE_FLOWID: + case LAGG_OPT_USE_NUMA: + case -LAGG_OPT_USE_NUMA: case LAGG_OPT_FLOWIDSHIFT: valid = 1; lacp = 0; Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Fri May 3 13:06:46 2019 (r347054) +++ head/sys/net/if_lagg.h Fri May 3 14:43:21 2019 (r347055) @@ -143,6 +143,7 @@ struct lagg_reqopts { #define LAGG_OPT_USE_FLOWID 0x01 /* enable use of flowid */ /* Pseudo flags which are used in ro_opts but not stored into sc_opts. */ #define LAGG_OPT_FLOWIDSHIFT 0x02 /* set flowid shift */ +#define LAGG_OPT_USE_NUMA 0x04 /* enable use of numa */ #define LAGG_OPT_FLOWIDSHIFT_MASK 0x1f /* flowid is uint32_t */ #define LAGG_OPT_LACP_STRICT 0x10 /* LACP strict mode */ #define LAGG_OPT_LACP_TXTEST 0x20 /* LACP debug: txtest */ @@ -158,8 +159,9 @@ struct lagg_reqopts { #define SIOCGLAGGOPTS _IOWR('i', 152, struct lagg_reqopts) #define SIOCSLAGGOPTS _IOW('i', 153, struct lagg_reqopts) -#define LAGG_OPT_BITS "\020\001USE_FLOWID\005LACP_STRICT" \ - "\006LACP_TXTEST\007LACP_RXTEST" +#define LAGG_OPT_BITS "\020\001USE_FLOWID\003USE_NUMA" \ + "\005LACP_STRICT\006LACP_TXTEST" \ + "\007LACP_RXTEST" #ifdef _KERNEL From owner-svn-src-all@freebsd.org Fri May 3 14:49:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB64A1592526; Fri, 3 May 2019 14:49:53 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-eopbgr670069.outbound.protection.outlook.com [40.107.67.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37DE37483B; Fri, 3 May 2019 14:49:52 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YQBPR0101MB2260.CANPRD01.PROD.OUTLOOK.COM (52.132.70.13) by YQBPR0101MB1122.CANPRD01.PROD.OUTLOOK.COM (52.132.67.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.12; Fri, 3 May 2019 14:49:51 +0000 Received: from YQBPR0101MB2260.CANPRD01.PROD.OUTLOOK.COM ([fe80::8128:ff77:e6ac:fe1a]) by YQBPR0101MB2260.CANPRD01.PROD.OUTLOOK.COM ([fe80::8128:ff77:e6ac:fe1a%5]) with mapi id 15.20.1856.012; Fri, 3 May 2019 14:49:51 +0000 From: Rick Macklem To: Harry Schmalzbauer , Rick Macklem , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r346217 - in head/sys: fs/nfs fs/nfsclient kern sys Thread-Topic: svn commit: r346217 - in head/sys: fs/nfs fs/nfsclient kern sys Thread-Index: AQHVAY49J3ZQW8SFgUi1xSB/QpvD1aZZehTF Date: Fri, 3 May 2019 14:49:51 +0000 Message-ID: References: <201904150127.x3F1RG7X062973@repo.freebsd.org>, <8a6cb225-8644-9949-09ab-7e1525e24034@omnilan.de> In-Reply-To: <8a6cb225-8644-9949-09ab-7e1525e24034@omnilan.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d76dd1a4-fc1e-4b69-4e00-08d6cfd6990f x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:YQBPR0101MB1122; x-ms-traffictypediagnostic: YQBPR0101MB1122: x-ms-exchange-purlcount: 2 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1186; x-forefront-prvs: 0026334A56 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(136003)(39860400002)(346002)(366004)(376002)(199004)(189003)(102836004)(486006)(9686003)(6306002)(229853002)(74482002)(71200400001)(33656002)(71190400001)(14444005)(256004)(5660300002)(53936002)(76116006)(6436002)(73956011)(66446008)(64756008)(66556008)(66476007)(66946007)(68736007)(99286004)(305945005)(52536014)(76176011)(6246003)(7696005)(2906002)(6506007)(2201001)(8936002)(55016002)(316002)(86362001)(81166006)(81156014)(786003)(8676002)(2501003)(478600001)(966005)(110136005)(14454004)(446003)(46003)(476003)(74316002)(25786009)(186003)(11346002); DIR:OUT; SFP:1101; SCL:1; SRVR:YQBPR0101MB1122; H:YQBPR0101MB2260.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: AlV48M1Cn67xO30/dlm2VnS25z2i7B/+jq2I1a2U6z/CFW7FMXpOobDOdETf6wqu2v+iyd7TdtAx/dQQSvrLrsb2Aox2fIEdHwceebHHyr4orLdH4RCXgEZBBE7RNnQ5rV5+HAe/KgNIAs6n/nShcn+WLxOcDnO8japIbGa6CipGA8f5HKOqbWsXIMU2dvhvDN2DBUdzCj8mHuliNbfQGRgmYCtEU6uxp0VPaw/D4dGjBB8hcxoncq+OkRyWvFvy5aN/3QO0dNkSQrytDLALIMg+gAd8HtqPmIxOiS/0h1IQK4e9fUPeL71FR/Ha+JfHWvqOOZHIK9uIWxoh2QBK1Z+z8wpAVyJ68GpWzY/jQU6uDUPWR4W8L/MHcA6pFCrY2BPyYYA3XtPCpeTabIz2/nNIVqTImvDenOa6AvPOrWA= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: d76dd1a4-fc1e-4b69-4e00-08d6cfd6990f X-MS-Exchange-CrossTenant-originalarrivaltime: 03 May 2019 14:49:51.6211 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: YQBPR0101MB1122 X-Rspamd-Queue-Id: 37DE37483B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.976,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 14:49:54 -0000 Harry Schmalzbauer wrote: >Am 15.04.2019 um 03:27 schrieb Rick Macklem: >> Author: rmacklem >> Date: Mon Apr 15 01:27:15 2019 >> New Revision: 346217 >> URL: https://svnweb.freebsd.org/changeset/base/346217 >> >> Log: >> Fix the NFSv4 client to safely find processes. >> >> r340744 broke the NFSv4 client, because it replaced pfind_locked() wi= th a >> call to pfind(), since pfind() acquires the sx lock for the pid hash = and >> the NFSv4 already holds a mutex when it does the call. >> The patch fixes the problem by recreating a pfind_any_locked() and ad= ding the >> functions pidhash_slockall() and pidhash_sunlockall to acquire/releas= e >> all of the pid hash locks. >> These functions are then used by the NFSv4 client instead of acquirin= g >> the allproc_lock and calling pfind(). >> >> Reviewed by: kib, mjg >> MFC after: 2 weeks > >Hello, I guess as long as r340744 isn't MFCd, this commit isn't needed >in /stable/, is it? That is correct. I hadn't looked to see if r340744 was MFC'd when I did the= commit. >Any plans to MFC >https://svnweb.freebsd.org/base?view=3Drevision&revision=3D340744 >(proc: convert pfind & friends to use pidhash locks and other cleanup) No MFC is listed for the commit, so I am assuming that the author isn't pla= nning on MFC'ng it. rick From owner-svn-src-all@freebsd.org Fri May 3 17:23:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94104159668F; Fri, 3 May 2019 17:23:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A64F81BF7; Fri, 3 May 2019 17:23:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10C1C23E2B; Fri, 3 May 2019 17:23:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43HN8gm065160; Fri, 3 May 2019 17:23:08 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43HN8hs065159; Fri, 3 May 2019 17:23:08 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201905031723.x43HN8hs065159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 3 May 2019 17:23:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347056 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 347056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3A64F81BF7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 17:23:09 -0000 Author: gjb Date: Fri May 3 17:23:08 2019 New Revision: 347056 URL: https://svnweb.freebsd.org/changeset/base/347056 Log: Increase the default size of the GCE disk image from 3GB to 20GB, as 3GB is too small as discovered in this week's snapshot builds. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/tools/gce.conf Modified: head/release/tools/gce.conf ============================================================================== --- head/release/tools/gce.conf Fri May 3 14:43:21 2019 (r347055) +++ head/release/tools/gce.conf Fri May 3 17:23:08 2019 (r347056) @@ -3,6 +3,9 @@ # $FreeBSD$ # +# The default of 3GB is too small for GCE, so override the size here. +export VMSIZE=20G + # Set to a list of packages to install. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \ google-cloud-sdk panicmail sudo sysutils/py-google-compute-engine \ From owner-svn-src-all@freebsd.org Fri May 3 20:05:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86AF91599898; Fri, 3 May 2019 20:05:32 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A3B0868BA; Fri, 3 May 2019 20:05:32 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0162525944; Fri, 3 May 2019 20:05:32 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43K5VxQ050072; Fri, 3 May 2019 20:05:31 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43K5Vdo050070; Fri, 3 May 2019 20:05:31 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201905032005.x43K5Vdo050070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 3 May 2019 20:05:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347057 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 347057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2A3B0868BA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 20:05:32 -0000 Author: mmacy Date: Fri May 3 20:05:31 2019 New Revision: 347057 URL: https://svnweb.freebsd.org/changeset/base/347057 Log: Allow iflib drivers to pass a pointer to their own ifmedia structure. Tested by: emaste@ Differential Revision: https://reviews.freebsd.org/D19946 Modified: head/sys/net/iflib.c head/sys/net/iflib.h Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Fri May 3 17:23:08 2019 (r347056) +++ head/sys/net/iflib.c Fri May 3 20:05:31 2019 (r347057) @@ -182,6 +182,7 @@ struct iflib_ctx { struct grouptask ifc_vflr_task; struct iflib_filter_info ifc_filter_info; struct ifmedia ifc_media; + struct ifmedia *ifc_mediap; struct sysctl_oid *ifc_sysctl_node; uint16_t ifc_sysctl_ntxqs; @@ -238,7 +239,7 @@ struct ifmedia * iflib_get_media(if_ctx_t ctx) { - return (&ctx->ifc_media); + return (ctx->ifc_mediap); } uint32_t @@ -4184,7 +4185,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) /* falls thru */ case SIOCGIFMEDIA: case SIOCGIFXMEDIA: - err = ifmedia_ioctl(ifp, ifr, &ctx->ifc_media, command); + err = ifmedia_ioctl(ifp, ifr, ctx->ifc_mediap, command); break; case SIOCGI2C: { @@ -4583,6 +4584,9 @@ iflib_device_register(device_t dev, void *sc, if_share _iflib_pre_assert(scctx); ctx->ifc_txrx = *scctx->isc_txrx; + if (sctx->isc_flags & IFLIB_DRIVER_MEDIA) + ctx->ifc_mediap = scctx->isc_media; + #ifdef INVARIANTS if (scctx->isc_capabilities & IFCAP_TXCSUM) MPASS(scctx->isc_tx_csum_flags); @@ -4819,9 +4823,9 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc device_printf(dev, "IFDI_CLONEATTACH failed %d\n", err); goto fail_ctx_free; } - ifmedia_add(&ctx->ifc_media, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL); - ifmedia_add(&ctx->ifc_media, IFM_ETHER | IFM_AUTO, 0, NULL); - ifmedia_set(&ctx->ifc_media, IFM_ETHER | IFM_AUTO); + ifmedia_add(ctx->ifc_mediap, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL); + ifmedia_add(ctx->ifc_mediap, IFM_ETHER | IFM_AUTO, 0, NULL); + ifmedia_set(ctx->ifc_mediap, IFM_ETHER | IFM_AUTO); #ifdef INVARIANTS if (scctx->isc_capabilities & IFCAP_TXCSUM) @@ -5348,9 +5352,11 @@ iflib_register(if_ctx_t ctx) EVENTHANDLER_REGISTER(vlan_unconfig, iflib_vlan_unregister, ctx, EVENTHANDLER_PRI_FIRST); - ifmedia_init(&ctx->ifc_media, IFM_IMASK, - iflib_media_change, iflib_media_status); - + if ((sctx->isc_flags & IFLIB_DRIVER_MEDIA) == 0) { + ctx->ifc_mediap = &ctx->ifc_media; + ifmedia_init(ctx->ifc_mediap, IFM_IMASK, + iflib_media_change, iflib_media_status); + } return (0); } Modified: head/sys/net/iflib.h ============================================================================== --- head/sys/net/iflib.h Fri May 3 17:23:08 2019 (r347056) +++ head/sys/net/iflib.h Fri May 3 20:05:31 2019 (r347057) @@ -228,8 +228,10 @@ typedef struct if_softc_ctx { pci_vendor_info_t isc_vendor_info; /* set by iflib prior to attach_pre */ int isc_disable_msix; if_txrx_t isc_txrx; + struct ifmedia *isc_media; } *if_softc_ctx_t; + /* * Initialization values for device */ @@ -361,6 +363,10 @@ typedef enum { * Interface needs admin task to ignore interface up/down status */ #define IFLIB_ADMIN_ALWAYS_RUN 0x10000 +/* + * Driver will pass the media + */ +#define IFLIB_DRIVER_MEDIA 0x20000 /* From owner-svn-src-all@freebsd.org Fri May 3 20:38:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 950681599F77; Fri, 3 May 2019 20:38:44 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 38F42874A7; Fri, 3 May 2019 20:38:44 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2011125E5F; Fri, 3 May 2019 20:38:44 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43Kch68065942; Fri, 3 May 2019 20:38:43 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43KchLG065940; Fri, 3 May 2019 20:38:43 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201905032038.x43KchLG065940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Fri, 3 May 2019 20:38:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347058 - head/sys/security/mac X-SVN-Group: head X-SVN-Commit-Author: rwatson X-SVN-Commit-Paths: head/sys/security/mac X-SVN-Commit-Revision: 347058 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 38F42874A7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 20:38:44 -0000 Author: rwatson Date: Fri May 3 20:38:43 2019 New Revision: 347058 URL: https://svnweb.freebsd.org/changeset/base/347058 Log: When MAC is enabled and a policy module is loaded, don't unconditionally lock mac_ifnet_mtx, which protects labels on struct ifnet, unless at least one policy is actively using labels on ifnets. This avoids a global mutex acquire in certain fast paths -- most noticeably ifnet transmit. This was previously invisible by default, as no MAC policies were loaded by default, but recently became visible due to mac_ntpd being enabled by default. gallatin@ reports a reduction in PPS overhead from 300% to 2.2% with this change. We will want to explore further MAC Framework optimisation to reduce overhead further, but this brings things more back into the world of the sane. MFC after: 3 days Modified: head/sys/security/mac/mac_inet.c head/sys/security/mac/mac_internal.h head/sys/security/mac/mac_net.c Modified: head/sys/security/mac/mac_inet.c ============================================================================== --- head/sys/security/mac/mac_inet.c Fri May 3 20:05:31 2019 (r347057) +++ head/sys/security/mac/mac_inet.c Fri May 3 20:38:43 2019 (r347058) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1999-2002, 2007, 2009 Robert N. M. Watson + * Copyright (c) 1999-2002, 2007, 2009, 2019 Robert N. M. Watson * Copyright (c) 2001 Ilmar S. Habibulin * Copyright (c) 2001-2004 Networks Associates Technology, Inc. * Copyright (c) 2006 SPARTA, Inc. @@ -266,16 +266,17 @@ void mac_netinet_arp_send(struct ifnet *ifp, struct mbuf *m) { struct label *mlabel; + int locked; if (mac_policy_count == 0) return; mlabel = mac_mbuf_to_label(m); - MAC_IFNET_LOCK(ifp); + MAC_IFNET_LOCK(ifp, locked); MAC_POLICY_PERFORM_NOSLEEP(netinet_arp_send, ifp, ifp->if_label, m, mlabel); - MAC_IFNET_UNLOCK(ifp); + MAC_IFNET_UNLOCK(ifp, locked); } void @@ -310,16 +311,17 @@ void mac_netinet_igmp_send(struct ifnet *ifp, struct mbuf *m) { struct label *mlabel; + int locked; if (mac_policy_count == 0) return; mlabel = mac_mbuf_to_label(m); - MAC_IFNET_LOCK(ifp); + MAC_IFNET_LOCK(ifp, locked); MAC_POLICY_PERFORM_NOSLEEP(netinet_igmp_send, ifp, ifp->if_label, m, mlabel); - MAC_IFNET_UNLOCK(ifp); + MAC_IFNET_UNLOCK(ifp, locked); } void Modified: head/sys/security/mac/mac_internal.h ============================================================================== --- head/sys/security/mac/mac_internal.h Fri May 3 20:05:31 2019 (r347057) +++ head/sys/security/mac/mac_internal.h Fri May 3 20:38:43 2019 (r347058) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1999-2002, 2006, 2009 Robert N. M. Watson + * Copyright (c) 1999-2002, 2006, 2009, 2019 Robert N. M. Watson * Copyright (c) 2001 Ilmar S. Habibulin * Copyright (c) 2001-2004 Networks Associates Technology, Inc. * Copyright (c) 2006 nCircle Network Security, Inc. @@ -216,8 +216,24 @@ void mac_destroy_label(struct label *label); int mac_check_structmac_consistent(struct mac *mac); int mac_allocate_slot(void); -#define MAC_IFNET_LOCK(ifp) mtx_lock(&mac_ifnet_mtx) -#define MAC_IFNET_UNLOCK(ifp) mtx_unlock(&mac_ifnet_mtx) +/* + * Lock ifnets to protect labels only if ifnet labels are in use. + */ +#define MAC_IFNET_LOCK(ifp, locked) do { \ + if (mac_labeled & MPC_OBJECT_IFNET) { \ + mtx_lock(&mac_ifnet_mtx); \ + locked = 1; \ + } else { \ + locked = 0; \ + } \ +} while (0) + +#define MAC_IFNET_UNLOCK(ifp, locked) do { \ + if (locked) { \ + mtx_unlock(&mac_ifnet_mtx); \ + locked = 0; \ + } \ +} while (0) /* * MAC Framework per-object type functions. It's not yet clear how the Modified: head/sys/security/mac/mac_net.c ============================================================================== --- head/sys/security/mac/mac_net.c Fri May 3 20:05:31 2019 (r347057) +++ head/sys/security/mac/mac_net.c Fri May 3 20:38:43 2019 (r347058) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1999-2002, 2009 Robert N. M. Watson + * Copyright (c) 1999-2002, 2009, 2019 Robert N. M. Watson * Copyright (c) 2001 Ilmar S. Habibulin * Copyright (c) 2001-2004 Networks Associates Technology, Inc. * Copyright (c) 2006 SPARTA, Inc. @@ -77,6 +77,11 @@ __FBSDID("$FreeBSD$"); * XXXRW: struct ifnet locking is incomplete in the network code, so we use * our own global mutex for struct ifnet. Non-ideal, but should help in the * SMP environment. + * + * This lock is acquired only if a loaded policy is using ifnet labeling. + * This should not ever change during a MAC policy check, itself, but could + * change during setup/return from a check, so we have to condition unlock on + * previous lock. */ struct mtx mac_ifnet_mtx; MTX_SYSINIT(mac_ifnet_mtx, &mac_ifnet_mtx, "mac_ifnet", MTX_DEF); @@ -297,13 +302,14 @@ mac_ifnet_internalize_label(struct label *label, char void mac_ifnet_create(struct ifnet *ifp) { + int locked; if (mac_policy_count == 0) return; - MAC_IFNET_LOCK(ifp); + MAC_IFNET_LOCK(ifp, locked); MAC_POLICY_PERFORM_NOSLEEP(ifnet_create, ifp, ifp->if_label); - MAC_IFNET_UNLOCK(ifp); + MAC_IFNET_UNLOCK(ifp, locked); } void @@ -334,16 +340,17 @@ void mac_ifnet_create_mbuf(struct ifnet *ifp, struct mbuf *m) { struct label *label; + int locked; if (mac_policy_count == 0) return; label = mac_mbuf_to_label(m); - MAC_IFNET_LOCK(ifp); + MAC_IFNET_LOCK(ifp, locked); MAC_POLICY_PERFORM_NOSLEEP(ifnet_create_mbuf, ifp, ifp->if_label, m, label); - MAC_IFNET_UNLOCK(ifp); + MAC_IFNET_UNLOCK(ifp, locked); } MAC_CHECK_PROBE_DEFINE2(bpfdesc_check_receive, "struct bpf_d *", @@ -352,7 +359,7 @@ MAC_CHECK_PROBE_DEFINE2(bpfdesc_check_receive, "struct int mac_bpfdesc_check_receive(struct bpf_d *d, struct ifnet *ifp) { - int error; + int error, locked; /* Assume reader lock is enough. */ BPFD_LOCK_ASSERT(d); @@ -360,11 +367,11 @@ mac_bpfdesc_check_receive(struct bpf_d *d, struct ifne if (mac_policy_count == 0) return (0); - MAC_IFNET_LOCK(ifp); + MAC_IFNET_LOCK(ifp, locked); MAC_POLICY_CHECK_NOSLEEP(bpfdesc_check_receive, d, d->bd_label, ifp, ifp->if_label); MAC_CHECK_PROBE2(bpfdesc_check_receive, error, d, ifp); - MAC_IFNET_UNLOCK(ifp); + MAC_IFNET_UNLOCK(ifp, locked); return (error); } @@ -376,7 +383,7 @@ int mac_ifnet_check_transmit(struct ifnet *ifp, struct mbuf *m) { struct label *label; - int error; + int error, locked; M_ASSERTPKTHDR(m); @@ -385,11 +392,11 @@ mac_ifnet_check_transmit(struct ifnet *ifp, struct mbu label = mac_mbuf_to_label(m); - MAC_IFNET_LOCK(ifp); + MAC_IFNET_LOCK(ifp, locked); MAC_POLICY_CHECK_NOSLEEP(ifnet_check_transmit, ifp, ifp->if_label, m, label); MAC_CHECK_PROBE2(ifnet_check_transmit, error, ifp, m); - MAC_IFNET_UNLOCK(ifp); + MAC_IFNET_UNLOCK(ifp, locked); return (error); } @@ -401,7 +408,7 @@ mac_ifnet_ioctl_get(struct ucred *cred, struct ifreq * char *elements, *buffer; struct label *intlabel; struct mac mac; - int error; + int error, locked; if (!(mac_labeled & MPC_OBJECT_IFNET)) return (EINVAL); @@ -423,9 +430,9 @@ mac_ifnet_ioctl_get(struct ucred *cred, struct ifreq * buffer = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK | M_ZERO); intlabel = mac_ifnet_label_alloc(); - MAC_IFNET_LOCK(ifp); + MAC_IFNET_LOCK(ifp, locked); mac_ifnet_copy_label(ifp->if_label, intlabel); - MAC_IFNET_UNLOCK(ifp); + MAC_IFNET_UNLOCK(ifp, locked); error = mac_ifnet_externalize_label(intlabel, elements, buffer, mac.m_buflen); mac_ifnet_label_free(intlabel); @@ -444,7 +451,7 @@ mac_ifnet_ioctl_set(struct ucred *cred, struct ifreq * struct label *intlabel; struct mac mac; char *buffer; - int error; + int error, locked; if (!(mac_labeled & MPC_OBJECT_IFNET)) return (EINVAL); @@ -483,18 +490,18 @@ mac_ifnet_ioctl_set(struct ucred *cred, struct ifreq * return (error); } - MAC_IFNET_LOCK(ifp); + MAC_IFNET_LOCK(ifp, locked); MAC_POLICY_CHECK_NOSLEEP(ifnet_check_relabel, cred, ifp, ifp->if_label, intlabel); if (error) { - MAC_IFNET_UNLOCK(ifp); + MAC_IFNET_UNLOCK(ifp, locked); mac_ifnet_label_free(intlabel); return (error); } MAC_POLICY_PERFORM_NOSLEEP(ifnet_relabel, cred, ifp, ifp->if_label, intlabel); - MAC_IFNET_UNLOCK(ifp); + MAC_IFNET_UNLOCK(ifp, locked); mac_ifnet_label_free(intlabel); return (0); From owner-svn-src-all@freebsd.org Fri May 3 21:06:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67352159AA01; Fri, 3 May 2019 21:06:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D32B8847A; Fri, 3 May 2019 21:06:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2C272635A; Fri, 3 May 2019 21:06:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43L6YPh081255; Fri, 3 May 2019 21:06:34 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43L6YCe081254; Fri, 3 May 2019 21:06:34 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905032106.x43L6YCe081254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 3 May 2019 21:06:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347059 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 347059 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0D32B8847A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 21:06:35 -0000 Author: imp Date: Fri May 3 21:06:34 2019 New Revision: 347059 URL: https://svnweb.freebsd.org/changeset/base/347059 Log: Remove stray '*' We're storing an EFI_HANDLE, not an pointer to a handle. Since EFI_HANDLE is a void * anyway, this has little practical effect since the conversion to / from void * and void ** is silent. Modified: head/stand/efi/boot1/boot_module.h Modified: head/stand/efi/boot1/boot_module.h ============================================================================== --- head/stand/efi/boot1/boot_module.h Fri May 3 20:38:43 2019 (r347058) +++ head/stand/efi/boot1/boot_module.h Fri May 3 21:06:34 2019 (r347059) @@ -48,7 +48,7 @@ typedef struct dev_info { EFI_BLOCK_IO *dev; EFI_DEVICE_PATH *devpath; - EFI_HANDLE *devhandle; + EFI_HANDLE devhandle; void *devdata; uint64_t partoff; int preferred; From owner-svn-src-all@freebsd.org Fri May 3 21:09:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0146E159AAE1; Fri, 3 May 2019 21:09:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BDEB886C1; Fri, 3 May 2019 21:09:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6973E2635C; Fri, 3 May 2019 21:09:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43L9QIX081874; Fri, 3 May 2019 21:09:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43L9QPS081873; Fri, 3 May 2019 21:09:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905032109.x43L9QPS081873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 3 May 2019 21:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347060 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 347060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9BDEB886C1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 21:09:27 -0000 Author: imp Date: Fri May 3 21:09:25 2019 New Revision: 347060 URL: https://svnweb.freebsd.org/changeset/base/347060 Log: When we can't get memory, trying again right away is going to fail. Rather than print N failure messages, bail on the first one. Modified: head/stand/efi/boot1/boot1.c Modified: head/stand/efi/boot1/boot1.c ============================================================================== --- head/stand/efi/boot1/boot1.c Fri May 3 21:06:34 2019 (r347059) +++ head/stand/efi/boot1/boot1.c Fri May 3 21:09:25 2019 (r347060) @@ -328,7 +328,7 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, B devinfo = malloc(sizeof(*devinfo)); if (devinfo == NULL) { DPRINTF("\nFailed to allocate devinfo\n"); - continue; + break; } devinfo->dev = blkio; devinfo->devpath = devpath; From owner-svn-src-all@freebsd.org Fri May 3 21:13:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4015E159ACF3; Fri, 3 May 2019 21:13:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DBE4188AF1; Fri, 3 May 2019 21:13:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4CF826507; Fri, 3 May 2019 21:13:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43LD4ia087156; Fri, 3 May 2019 21:13:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43LD4mg087155; Fri, 3 May 2019 21:13:04 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905032113.x43LD4mg087155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 3 May 2019 21:13:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347061 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 347061 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DBE4188AF1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 21:13:05 -0000 Author: imp Date: Fri May 3 21:13:04 2019 New Revision: 347061 URL: https://svnweb.freebsd.org/changeset/base/347061 Log: Substitute boot1 with ${BOOT1} Allow for other names to be built, so parameterize this makefile to avoid hard coding boot1. Modified: head/stand/efi/boot1/Makefile Modified: head/stand/efi/boot1/Makefile ============================================================================== --- head/stand/efi/boot1/Makefile Fri May 3 21:09:25 2019 (r347060) +++ head/stand/efi/boot1/Makefile Fri May 3 21:13:04 2019 (r347061) @@ -2,7 +2,8 @@ .include -PROG= boot1.sym +BOOT1?= boot1 +PROG= ${BOOT1}.sym INTERNALPROG= WARNS?= 6 @@ -51,8 +52,8 @@ CFLAGS+= -DEFI_DEBUG .PATH: ${LDRSRC} CFLAGS+= -I${LDRSRC} -FILES= boot1.efi boot1.efifat -FILESMODE_boot1.efi= ${BINMODE} +FILES= ${BOOT1}.efi ${BOOT1}.efifat +FILESMODE_${BOOT1}.efi= ${BINMODE} LDSCRIPT= ${EFISRC}/loader/arch/${MACHINE}/ldscript.${MACHINE} LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -shared @@ -77,7 +78,7 @@ LDADD+= ${LIBEFI} ${LIBSA} DPADD+= ${LDSCRIPT} -boot1.efi: ${PROG} +${BOOT1}.efi: ${PROG} if ${NM} ${.ALLSRC} | grep ' U '; then \ echo "Undefined symbols in ${.ALLSRC}"; \ exit 1; \ @@ -93,7 +94,7 @@ boot1.efi: ${PROG} .include "Makefile.fat" -boot1.efifat: boot1.efi +${BOOT1}.efifat: ${BOOT1}.efi @set -- `ls -l ${.ALLSRC}`; \ x=$$(($$5-${BOOT1_MAXSIZE})); \ if [ $$x -ge 0 ]; then \ @@ -104,6 +105,6 @@ boot1.efifat: boot1.efi xz -d -c ${BOOTSRC}/efi/boot1/fat-${MACHINE}.tmpl.xz > ${.TARGET} ${DD} if=${.ALLSRC} of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc -CLEANFILES+= boot1.efi boot1.efifat +CLEANFILES+= ${BOOT1}.efi ${BOOT1}.efifat .include From owner-svn-src-all@freebsd.org Fri May 3 21:13:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AE32159AD21; Fri, 3 May 2019 21:13:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5E8E88B2B; Fri, 3 May 2019 21:13:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B356326508; Fri, 3 May 2019 21:13:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43LD9Uu087210; Fri, 3 May 2019 21:13:09 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43LD9SZ087209; Fri, 3 May 2019 21:13:09 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905032113.x43LD9SZ087209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 3 May 2019 21:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347062 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 347062 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A5E8E88B2B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 21:13:11 -0000 Author: imp Date: Fri May 3 21:13:09 2019 New Revision: 347062 URL: https://svnweb.freebsd.org/changeset/base/347062 Log: Use SRC+= rather than SRC= To allow boot1/Makefile to be included, use SRC+= rathern than SRC= so the including Makefile can add additional sources to the build. Modified: head/stand/efi/boot1/Makefile Modified: head/stand/efi/boot1/Makefile ============================================================================== --- head/stand/efi/boot1/Makefile Fri May 3 21:13:04 2019 (r347061) +++ head/stand/efi/boot1/Makefile Fri May 3 21:13:09 2019 (r347062) @@ -25,7 +25,7 @@ CWARNFLAGS.zfs_module.c += -Wno-unused-parameter CWARNFLAGS.zfs_module.c += -Wno-unused-function # architecture-specific loader code -SRCS= boot1.c self_reloc.c start.S ufs_module.c +SRCS+= boot1.c self_reloc.c start.S ufs_module.c .if ${MK_LOADER_ZFS} != "no" SRCS+= zfs_module.c CFLAGS.zfs_module.c+= -I${ZFSSRC} From owner-svn-src-all@freebsd.org Fri May 3 21:26:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84BED159B012; Fri, 3 May 2019 21:26:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A4348920E; Fri, 3 May 2019 21:26:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1107266BC; Fri, 3 May 2019 21:26:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43LQinO092656; Fri, 3 May 2019 21:26:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43LQilu092655; Fri, 3 May 2019 21:26:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905032126.x43LQilu092655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 3 May 2019 21:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347063 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347063 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A4348920E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 21:26:45 -0000 Author: markj Date: Fri May 3 21:26:44 2019 New Revision: 347063 URL: https://svnweb.freebsd.org/changeset/base/347063 Log: Disallow excessively small times of day in clock_settime(2). Reported by: syzkaller Reviewed by: cem, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20151 Modified: head/sys/kern/kern_time.c Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Fri May 3 21:13:09 2019 (r347062) +++ head/sys/kern/kern_time.c Fri May 3 21:26:44 2019 (r347063) @@ -412,7 +412,9 @@ kern_clock_settime(struct thread *td, clockid_t clock_ if (ats->tv_nsec < 0 || ats->tv_nsec >= 1000000000 || ats->tv_sec < 0) return (EINVAL); - if (!allow_insane_settime && ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60) + if (!allow_insane_settime && + (ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60 || + ats->tv_sec < utc_offset())) return (EINVAL); /* XXX Don't convert nsec->usec and back */ TIMESPEC_TO_TIMEVAL(&atv, ats); From owner-svn-src-all@freebsd.org Fri May 3 21:46:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1ACB159B5A1; Fri, 3 May 2019 21:46:26 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84D2F89CC0; Fri, 3 May 2019 21:46:26 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5861F26A2C; Fri, 3 May 2019 21:46:26 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43LkQx2003449; Fri, 3 May 2019 21:46:26 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43LkQas003448; Fri, 3 May 2019 21:46:26 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201905032146.x43LkQas003448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 3 May 2019 21:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347064 - head/sys/ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ufs X-SVN-Commit-Revision: 347064 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 84D2F89CC0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 21:46:27 -0000 Author: mckusick Date: Fri May 3 21:46:25 2019 New Revision: 347064 URL: https://svnweb.freebsd.org/changeset/base/347064 Log: Simplify calculation of DIRECTSIZ. No functional change intended. Suggested by: kib MFC after: 1 week Modified: head/sys/ufs/ufs/dir.h Modified: head/sys/ufs/ufs/dir.h ============================================================================== --- head/sys/ufs/ufs/dir.h Fri May 3 21:26:44 2019 (r347063) +++ head/sys/ufs/ufs/dir.h Fri May 3 21:46:25 2019 (r347064) @@ -108,13 +108,11 @@ struct direct { * The DIRSIZ macro gives the minimum record length which will hold * the directory entry. This requires the amount of space in struct direct * without the d_name field, plus enough space for the name with a terminating - * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary. - * - * + * null byte (dp->d_namlen + 1), rounded up to a 4 byte boundary. */ -#define DIRECTSIZ(namlen) \ - ((__offsetof(struct direct, d_name) + \ - ((namlen)+1)*sizeof(((struct direct *)0)->d_name[0]) + 3) & ~3) +#define DIR_ROUNDUP 4 /* Directory name roundup size */ +#define DIRECTSIZ(namlen) \ + (roundup2(__offsetof(struct direct, d_name) + (namlen) + 1, DIR_ROUNDUP)) #if (BYTE_ORDER == LITTLE_ENDIAN) #define DIRSIZ(oldfmt, dp) \ ((oldfmt) ? DIRECTSIZ((dp)->d_type) : DIRECTSIZ((dp)->d_namlen)) From owner-svn-src-all@freebsd.org Fri May 3 21:48:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25743159B640; Fri, 3 May 2019 21:48:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE83B89E35; Fri, 3 May 2019 21:48:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7B1326A2D; Fri, 3 May 2019 21:48:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43Lmg2S003596; Fri, 3 May 2019 21:48:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43LmguV003595; Fri, 3 May 2019 21:48:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905032148.x43LmguV003595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 3 May 2019 21:48:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347065 - head/sys/amd64/vmm X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/amd64/vmm X-SVN-Commit-Revision: 347065 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BE83B89E35 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 21:48:43 -0000 Author: jhb Date: Fri May 3 21:48:42 2019 New Revision: 347065 URL: https://svnweb.freebsd.org/changeset/base/347065 Log: Emulate the "ADD reg, r/m" instruction (opcode 03H). OVMF's flash variable storage is using add instructions when indexing the variable store bootrom location. Submitted by: D Scott Phillips Reviewed by: rgrimes MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D19975 Modified: head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Fri May 3 21:46:25 2019 (r347064) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Fri May 3 21:48:42 2019 (r347065) @@ -77,6 +77,7 @@ enum { VIE_OP_TYPE_STOS, VIE_OP_TYPE_BITTEST, VIE_OP_TYPE_TWOB_GRP15, + VIE_OP_TYPE_ADD, VIE_OP_TYPE_LAST }; @@ -112,6 +113,10 @@ static const struct vie_op two_byte_opcodes[256] = { }; static const struct vie_op one_byte_opcodes[256] = { + [0x03] = { + .op_byte = 0x03, + .op_type = VIE_OP_TYPE_ADD, + }, [0x0F] = { .op_byte = 0x0F, .op_type = VIE_OP_TYPE_TWO_BYTE @@ -410,6 +415,41 @@ getcc(int opsize, uint64_t x, uint64_t y) return (getcc64(x, y)); } +/* + * Macro creation of functions getaddflags{8,16,32,64} + */ +#define GETADDFLAGS(sz) \ +static u_long \ +getaddflags##sz(uint##sz##_t x, uint##sz##_t y) \ +{ \ + u_long rflags; \ + \ + __asm __volatile("add %2,%1; pushfq; popq %0" : \ + "=r" (rflags), "+r" (x) : "m" (y)); \ + return (rflags); \ +} struct __hack + +GETADDFLAGS(8); +GETADDFLAGS(16); +GETADDFLAGS(32); +GETADDFLAGS(64); + +static u_long +getaddflags(int opsize, uint64_t x, uint64_t y) +{ + KASSERT(opsize == 1 || opsize == 2 || opsize == 4 || opsize == 8, + ("getaddflags: invalid operand size %d", opsize)); + + if (opsize == 1) + return (getaddflags8(x, y)); + else if (opsize == 2) + return (getaddflags16(x, y)); + else if (opsize == 4) + return (getaddflags32(x, y)); + else + return (getaddflags64(x, y)); +} + static int emulate_mov(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, mem_region_read_t memread, mem_region_write_t memwrite, void *arg) @@ -1179,6 +1219,62 @@ emulate_cmp(void *vm, int vcpuid, uint64_t gpa, struct } static int +emulate_add(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, + mem_region_read_t memread, mem_region_write_t memwrite, void *arg) +{ + int error, size; + uint64_t nval, rflags, rflags2, val1, val2; + enum vm_reg_name reg; + + size = vie->opsize; + error = EINVAL; + + switch (vie->op.op_byte) { + case 0x03: + /* + * ADD r/m to r and store the result in r + * + * 03/r ADD r16, r/m16 + * 03/r ADD r32, r/m32 + * REX.W + 03/r ADD r64, r/m64 + */ + + /* get the first operand */ + reg = gpr_map[vie->reg]; + error = vie_read_register(vm, vcpuid, reg, &val1); + if (error) + break; + + /* get the second operand */ + error = memread(vm, vcpuid, gpa, &val2, size, arg); + if (error) + break; + + /* perform the operation and write the result */ + nval = val1 + val2; + error = vie_update_register(vm, vcpuid, reg, nval, size); + break; + default: + break; + } + + if (!error) { + rflags2 = getaddflags(size, val1, val2); + error = vie_read_register(vm, vcpuid, VM_REG_GUEST_RFLAGS, + &rflags); + if (error) + return (error); + + rflags &= ~RFLAGS_STATUS_BITS; + rflags |= rflags2 & RFLAGS_STATUS_BITS; + error = vie_update_register(vm, vcpuid, VM_REG_GUEST_RFLAGS, + rflags, 8); + } + + return (error); +} + +static int emulate_sub(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, mem_region_read_t memread, mem_region_write_t memwrite, void *arg) { @@ -1542,6 +1638,10 @@ vmm_emulate_instruction(void *vm, int vcpuid, uint64_t case VIE_OP_TYPE_TWOB_GRP15: error = emulate_twob_group15(vm, vcpuid, gpa, vie, memread, memwrite, memarg); + break; + case VIE_OP_TYPE_ADD: + error = emulate_add(vm, vcpuid, gpa, vie, memread, + memwrite, memarg); break; default: error = EINVAL; From owner-svn-src-all@freebsd.org Fri May 3 21:54:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09D96159BA4C; Fri, 3 May 2019 21:54:17 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A53648A31E; Fri, 3 May 2019 21:54:16 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7844E26BE0; Fri, 3 May 2019 21:54:16 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43LsGdb008766; Fri, 3 May 2019 21:54:16 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43LsFae008760; Fri, 3 May 2019 21:54:15 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201905032154.x43LsFae008760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 3 May 2019 21:54:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347066 - in head: sbin/fsck_ffs sys/ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head: sbin/fsck_ffs sys/ufs/ufs X-SVN-Commit-Revision: 347066 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A53648A31E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 21:54:17 -0000 Author: mckusick Date: Fri May 3 21:54:14 2019 New Revision: 347066 URL: https://svnweb.freebsd.org/changeset/base/347066 Log: This update eliminates a kernel stack disclosure bug in UFS/FFS directory entries that is caused by uninitialized directory entry padding written to the disk. It can be viewed by any user with read access to that directory. Up to 3 bytes of kernel stack are disclosed per file entry, depending on the the amount of padding the kernel needs to pad out the entry to a 32 bit boundry. The offset in the kernel stack that is disclosed is a function of the filename size. Furthermore, if the user can create files in a directory, this 3 byte window can be expanded 3 bytes at a time to a 254 byte window with 75% of the data in that window exposed. The additional exposure is done by removing the entry, creating a new entry with a 4-byte longer name, extracting 3 more bytes by reading the directory, and repeating until a 252 byte name is created. This exploit works in part because the area of the kernel stack that is being disclosed is in an area that typically doesn't change that often (perhaps a few times a second on a lightly loaded system), and these file creates and unlinks themselves don't overwrite the area of kernel stack being disclosed. It appears that this bug originated with the creation of the Fast File System in 4.1b-BSD (Circa 1982, more than 36 years ago!), and is likely present in every Unix or Unix-like system that uses UFS/FFS. Amazingly, nobody noticed until now. This update also adds the -z flag to fsck_ffs to have it scrub the leaked information in the name padding of existing directories. It only needs to be run once on each UFS/FFS filesystem after a patched kernel is installed and running. Submitted by: David G. Lawrence Reviewed by: kib MFC after: 1 week Modified: head/sbin/fsck_ffs/dir.c head/sbin/fsck_ffs/fsck.h head/sbin/fsck_ffs/fsck_ffs.8 head/sbin/fsck_ffs/globs.c head/sbin/fsck_ffs/main.c head/sys/ufs/ufs/ufs_lookup.c Modified: head/sbin/fsck_ffs/dir.c ============================================================================== --- head/sbin/fsck_ffs/dir.c Fri May 3 21:48:42 2019 (r347065) +++ head/sbin/fsck_ffs/dir.c Fri May 3 21:54:14 2019 (r347066) @@ -147,14 +147,23 @@ fsck_readdir(struct inodesc *idesc) struct direct *dp, *ndp; struct bufarea *bp; long size, blksiz, fix, dploc; + int dc; blksiz = idesc->id_numfrags * sblock.fs_fsize; bp = getdirblk(idesc->id_blkno, blksiz); if (idesc->id_loc % DIRBLKSIZ == 0 && idesc->id_filesize > 0 && idesc->id_loc < blksiz) { dp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); - if (dircheck(idesc, dp)) + if ((dc = dircheck(idesc, dp)) > 0) { + if (dc == 2) { + /* + * dircheck() cleared unused directory space. + * Mark the buffer as dirty to write it out. + */ + dirty(bp); + } goto dpok; + } if (idesc->id_fix == IGNORE) return (0); fix = dofix(idesc, "DIRECTORY CORRUPTED"); @@ -181,19 +190,26 @@ dpok: if ((idesc->id_loc % DIRBLKSIZ) == 0) return (dp); ndp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); - if (idesc->id_loc < blksiz && idesc->id_filesize > 0 && - dircheck(idesc, ndp) == 0) { - size = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); - idesc->id_loc += size; - idesc->id_filesize -= size; - if (idesc->id_fix == IGNORE) - return (0); - fix = dofix(idesc, "DIRECTORY CORRUPTED"); - bp = getdirblk(idesc->id_blkno, blksiz); - dp = (struct direct *)(bp->b_un.b_buf + dploc); - dp->d_reclen += size; - if (fix) + if (idesc->id_loc < blksiz && idesc->id_filesize > 0) { + if ((dc = dircheck(idesc, ndp)) == 0) { + size = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); + idesc->id_loc += size; + idesc->id_filesize -= size; + if (idesc->id_fix == IGNORE) + return (0); + fix = dofix(idesc, "DIRECTORY CORRUPTED"); + bp = getdirblk(idesc->id_blkno, blksiz); + dp = (struct direct *)(bp->b_un.b_buf + dploc); + dp->d_reclen += size; + if (fix) + dirty(bp); + } else if (dc == 2) { + /* + * dircheck() cleared unused directory space. + * Mark the buffer as dirty to write it out. + */ dirty(bp); + } } return (dp); } @@ -201,6 +217,11 @@ dpok: /* * Verify that a directory entry is valid. * This is a superset of the checks made in the kernel. + * Also optionally clears padding and unused directory space. + * + * Returns 0 if the entry is bad, 1 if the entry is good and no changes + * were made, and 2 if the entry is good but modified to clear out padding + * and unused space and needs to be written back to disk. */ static int dircheck(struct inodesc *idesc, struct direct *dp) @@ -209,15 +230,39 @@ dircheck(struct inodesc *idesc, struct direct *dp) char *cp; u_char type; u_int8_t namlen; - int spaceleft; + int spaceleft, modified, unused; + modified = 0; spaceleft = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); if (dp->d_reclen == 0 || dp->d_reclen > spaceleft || - (dp->d_reclen & 0x3) != 0) + (dp->d_reclen & (DIR_ROUNDUP - 1)) != 0) goto bad; - if (dp->d_ino == 0) - return (1); + if (dp->d_ino == 0) { + /* + * Special case of an unused directory entry. Normally + * the kernel would coalesce unused space with the previous + * entry by extending its d_reclen, but there are situations + * (e.g. fsck) where that doesn't occur. + * If we're clearing out directory cruft (-z flag), then make + * sure this entry gets fully cleared as well. + */ + if (zflag && fswritefd >= 0) { + if (dp->d_type != 0) { + dp->d_type = 0; + modified = 1; + } + if (dp->d_namlen != 0) { + dp->d_namlen = 0; + modified = 1; + } + if (dp->d_name[0] != '\0') { + dp->d_name[0] = '\0'; + modified = 1; + } + } + goto good; + } size = DIRSIZ(0, dp); namlen = dp->d_namlen; type = dp->d_type; @@ -231,7 +276,37 @@ dircheck(struct inodesc *idesc, struct direct *dp) goto bad; if (*cp != '\0') goto bad; + +good: + if (zflag && fswritefd >= 0) { + /* + * Clear unused directory entry space, including the d_name + * padding. + */ + /* First figure the number of pad bytes. */ + unused = roundup2(namlen + 1, DIR_ROUNDUP) - (namlen + 1); + + /* Add in the free space to the end of the record. */ + unused += dp->d_reclen - DIRSIZ(0, dp); + + /* + * Now clear out the unused space, keeping track if we actually + * changed anything. + */ + for (cp = &dp->d_name[namlen + 1]; unused > 0; unused--, cp++) { + if (*cp != '\0') { + *cp = '\0'; + modified = 1; + } + } + + if (modified) { + return 2; + } + } + return (1); + bad: if (debug) printf("Bad dir: ino %d reclen %d namlen %d type %d name %s\n", Modified: head/sbin/fsck_ffs/fsck.h ============================================================================== --- head/sbin/fsck_ffs/fsck.h Fri May 3 21:48:42 2019 (r347065) +++ head/sbin/fsck_ffs/fsck.h Fri May 3 21:54:14 2019 (r347066) @@ -315,6 +315,7 @@ extern off_t bflag; /* location of alternate super b extern int debug; /* output debugging info */ extern int Eflag; /* delete empty data blocks */ extern int Zflag; /* zero empty data blocks */ +extern int zflag; /* zero unused directory space */ extern int inoopt; /* trim out unused inodes */ extern char ckclean; /* only do work if not cleanly unmounted */ extern int cvtlevel; /* convert to newer file system format */ Modified: head/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- head/sbin/fsck_ffs/fsck_ffs.8 Fri May 3 21:48:42 2019 (r347065) +++ head/sbin/fsck_ffs/fsck_ffs.8 Fri May 3 21:54:14 2019 (r347066) @@ -29,7 +29,7 @@ .\" @(#)fsck.8 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd January 13, 2018 +.Dd May 3, 2019 .Dt FSCK_FFS 8 .Os .Sh NAME @@ -38,7 +38,7 @@ .Nd file system consistency check and interactive repair .Sh SYNOPSIS .Nm -.Op Fl BCdEFfnpRrSyZ +.Op Fl BCdEFfnpRrSyZz .Op Fl b Ar block .Op Fl c Ar level .Op Fl m Ar mode @@ -301,6 +301,9 @@ If both and .Fl Z are specified, blocks are first zeroed and then erased. +.It Fl z +Clear unused directory space. +The cleared space includes deleted file names and name padding. .El .Pp Inconsistencies checked are as follows: Modified: head/sbin/fsck_ffs/globs.c ============================================================================== --- head/sbin/fsck_ffs/globs.c Fri May 3 21:48:42 2019 (r347065) +++ head/sbin/fsck_ffs/globs.c Fri May 3 21:54:14 2019 (r347066) @@ -85,6 +85,7 @@ off_t bflag; /* location of alternate super block */ int debug; /* output debugging info */ int Eflag; /* delete empty data blocks */ int Zflag; /* zero empty data blocks */ +int zflag; /* zero unused directory space */ int inoopt; /* trim out unused inodes */ char ckclean; /* only do work if not cleanly unmounted */ int cvtlevel; /* convert to newer file system format */ Modified: head/sbin/fsck_ffs/main.c ============================================================================== --- head/sbin/fsck_ffs/main.c Fri May 3 21:48:42 2019 (r347065) +++ head/sbin/fsck_ffs/main.c Fri May 3 21:54:14 2019 (r347066) @@ -89,7 +89,7 @@ main(int argc, char *argv[]) sync(); skipclean = 1; inoopt = 0; - while ((ch = getopt(argc, argv, "b:Bc:CdEfFm:npRrSyZ")) != -1) { + while ((ch = getopt(argc, argv, "b:Bc:CdEfFm:npRrSyZz")) != -1) { switch (ch) { case 'b': skipclean = 0; @@ -164,6 +164,10 @@ main(int argc, char *argv[]) case 'Z': Zflag++; + break; + + case 'z': + zflag++; break; default: Modified: head/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- head/sys/ufs/ufs/ufs_lookup.c Fri May 3 21:48:42 2019 (r347065) +++ head/sys/ufs/ufs/ufs_lookup.c Fri May 3 21:54:14 2019 (r347066) @@ -825,14 +825,21 @@ ufs_makedirentry(ip, cnp, newdirp) struct componentname *cnp; struct direct *newdirp; { + u_int namelen; -#ifdef INVARIANTS - if ((cnp->cn_flags & SAVENAME) == 0) - panic("ufs_makedirentry: missing name"); -#endif + namelen = (unsigned)cnp->cn_namelen; + KASSERT((cnp->cn_flags & SAVENAME) != 0, + ("ufs_makedirentry: missing name")); + KASSERT(namelen <= UFS_MAXNAMLEN, + ("ufs_makedirentry: name too long")); newdirp->d_ino = ip->i_number; - newdirp->d_namlen = cnp->cn_namelen; - bcopy(cnp->cn_nameptr, newdirp->d_name, (unsigned)cnp->cn_namelen + 1); + newdirp->d_namlen = namelen; + + /* Zero out after-name padding */ + *(u_int32_t *)(&newdirp->d_name[namelen & ~(DIR_ROUNDUP - 1)]) = 0; + + bcopy(cnp->cn_nameptr, newdirp->d_name, namelen); + if (ITOV(ip)->v_mount->mnt_maxsymlinklen > 0) newdirp->d_type = IFTODT(ip->i_mode); else { From owner-svn-src-all@freebsd.org Fri May 3 22:54:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45DDC159C92E; Fri, 3 May 2019 22:54:58 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3B0C8BCAF; Fri, 3 May 2019 22:54:57 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C2D427639; Fri, 3 May 2019 22:54:57 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43MsvaV040368; Fri, 3 May 2019 22:54:57 GMT (envelope-from peterj@FreeBSD.org) Received: (from peterj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43Msuao040363; Fri, 3 May 2019 22:54:56 GMT (envelope-from peterj@FreeBSD.org) Message-Id: <201905032254.x43Msuao040363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peterj set sender to peterj@FreeBSD.org using -f From: Peter Jeremy Date: Fri, 3 May 2019 22:54:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347067 - stable/12/lib/msun/src X-SVN-Group: stable-12 X-SVN-Commit-Author: peterj X-SVN-Commit-Paths: stable/12/lib/msun/src X-SVN-Commit-Revision: 347067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D3B0C8BCAF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 22:54:58 -0000 Author: peterj Date: Fri May 3 22:54:56 2019 New Revision: 347067 URL: https://svnweb.freebsd.org/changeset/base/347067 Log: MFC r343953: Replace calls to sin(x) and cos(x) with a single call to sincos(). Replace calls to sinf(x) and cosf(x) with a single call to sincosf(). Approved by: grog, jhb (mentors) Modified: stable/12/lib/msun/src/e_j0.c stable/12/lib/msun/src/e_j0f.c stable/12/lib/msun/src/e_j1.c stable/12/lib/msun/src/e_j1f.c stable/12/lib/msun/src/e_jn.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/msun/src/e_j0.c ============================================================================== --- stable/12/lib/msun/src/e_j0.c Fri May 3 21:54:14 2019 (r347066) +++ stable/12/lib/msun/src/e_j0.c Fri May 3 22:54:56 2019 (r347067) @@ -93,8 +93,7 @@ __ieee754_j0(double x) if(ix>=0x7ff00000) return one/(x*x); x = fabs(x); if(ix >= 0x40000000) { /* |x| >= 2.0 */ - s = sin(x); - c = cos(x); + sincos(x, &s, &c); ss = s-c; cc = s+c; if(ix<0x7fe00000) { /* Make sure x+x does not overflow. */ @@ -173,8 +172,7 @@ __ieee754_y0(double x) * sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x)) * to compute the worse one. */ - s = sin(x); - c = cos(x); + sincos(x, &s, &c); ss = s-c; cc = s+c; /* Modified: stable/12/lib/msun/src/e_j0f.c ============================================================================== --- stable/12/lib/msun/src/e_j0f.c Fri May 3 21:54:14 2019 (r347066) +++ stable/12/lib/msun/src/e_j0f.c Fri May 3 22:54:56 2019 (r347067) @@ -55,8 +55,7 @@ __ieee754_j0f(float x) if(ix>=0x7f800000) return one/(x*x); x = fabsf(x); if(ix >= 0x40000000) { /* |x| >= 2.0 */ - s = sinf(x); - c = cosf(x); + sincosf(x, &s, &c); ss = s-c; cc = s+c; if(ix<0x7f000000) { /* Make sure x+x does not overflow. */ @@ -128,8 +127,7 @@ __ieee754_y0f(float x) * sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x)) * to compute the worse one. */ - s = sinf(x); - c = cosf(x); + sincosf(x, &s, &c); ss = s-c; cc = s+c; /* Modified: stable/12/lib/msun/src/e_j1.c ============================================================================== --- stable/12/lib/msun/src/e_j1.c Fri May 3 21:54:14 2019 (r347066) +++ stable/12/lib/msun/src/e_j1.c Fri May 3 22:54:56 2019 (r347067) @@ -94,8 +94,7 @@ __ieee754_j1(double x) if(ix>=0x7ff00000) return one/x; y = fabs(x); if(ix >= 0x40000000) { /* |x| >= 2.0 */ - s = sin(y); - c = cos(y); + sincos(y, &s, &c); ss = -s-c; cc = s-c; if(ix<0x7fe00000) { /* make sure y+y not overflow */ @@ -159,8 +158,7 @@ __ieee754_y1(double x) /* y1(x<0) = NaN and raise invalid exception. */ if(hx<0) return vzero/vzero; if(ix >= 0x40000000) { /* |x| >= 2.0 */ - s = sin(x); - c = cos(x); + sincos(x, &s, &c); ss = -s-c; cc = s-c; if(ix<0x7fe00000) { /* make sure x+x not overflow */ Modified: stable/12/lib/msun/src/e_j1f.c ============================================================================== --- stable/12/lib/msun/src/e_j1f.c Fri May 3 21:54:14 2019 (r347066) +++ stable/12/lib/msun/src/e_j1f.c Fri May 3 22:54:56 2019 (r347067) @@ -56,8 +56,7 @@ __ieee754_j1f(float x) if(ix>=0x7f800000) return one/x; y = fabsf(x); if(ix >= 0x40000000) { /* |x| >= 2.0 */ - s = sinf(y); - c = cosf(y); + sincosf(y, &s, &c); ss = -s-c; cc = s-c; if(ix<0x7f000000) { /* make sure y+y not overflow */ @@ -114,8 +113,7 @@ __ieee754_y1f(float x) if(ix==0) return -one/vzero; if(hx<0) return vzero/vzero; if(ix >= 0x40000000) { /* |x| >= 2.0 */ - s = sinf(x); - c = cosf(x); + sincosf(x, &s, &c); ss = -s-c; cc = s-c; if(ix<0x7f000000) { /* make sure x+x not overflow */ Modified: stable/12/lib/msun/src/e_jn.c ============================================================================== --- stable/12/lib/msun/src/e_jn.c Fri May 3 21:54:14 2019 (r347066) +++ stable/12/lib/msun/src/e_jn.c Fri May 3 22:54:56 2019 (r347067) @@ -54,7 +54,7 @@ double __ieee754_jn(int n, double x) { int32_t i,hx,ix,lx, sgn; - double a, b, temp, di; + double a, b, c, s, temp, di; double z, w; /* J(-n,x) = (-1)^n * J(n, x), J(n, -x) = (-1)^n * J(n, x) @@ -91,11 +91,12 @@ __ieee754_jn(int n, double x) * 2 -s+c -c-s * 3 s+c c-s */ + sincos(x, &s, &c); switch(n&3) { - case 0: temp = cos(x)+sin(x); break; - case 1: temp = -cos(x)+sin(x); break; - case 2: temp = -cos(x)-sin(x); break; - case 3: temp = cos(x)-sin(x); break; + case 0: temp = c+s; break; + case 1: temp = -c+s; break; + case 2: temp = -c-s; break; + case 3: temp = c-s; break; } b = invsqrtpi*temp/sqrt(x); } else { @@ -216,7 +217,7 @@ __ieee754_yn(int n, double x) { int32_t i,hx,ix,lx; int32_t sign; - double a, b, temp; + double a, b, c, s, temp; EXTRACT_WORDS(hx,lx,x); ix = 0x7fffffff&hx; @@ -248,11 +249,12 @@ __ieee754_yn(int n, double x) * 2 -s+c -c-s * 3 s+c c-s */ + sincos(x, &s, &c); switch(n&3) { - case 0: temp = sin(x)-cos(x); break; - case 1: temp = -sin(x)-cos(x); break; - case 2: temp = -sin(x)+cos(x); break; - case 3: temp = sin(x)+cos(x); break; + case 0: temp = s-c; break; + case 1: temp = -s-c; break; + case 2: temp = -s+c; break; + case 3: temp = s+c; break; } b = invsqrtpi*temp/sqrt(x); } else { From owner-svn-src-all@freebsd.org Fri May 3 22:56:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 773D2159C9AC; Fri, 3 May 2019 22:56:52 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C43A8BDFA; Fri, 3 May 2019 22:56:52 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE6792763A; Fri, 3 May 2019 22:56:51 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43Mup2J040529; Fri, 3 May 2019 22:56:51 GMT (envelope-from peterj@FreeBSD.org) Received: (from peterj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43MuofS040524; Fri, 3 May 2019 22:56:50 GMT (envelope-from peterj@FreeBSD.org) Message-Id: <201905032256.x43MuofS040524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peterj set sender to peterj@FreeBSD.org using -f From: Peter Jeremy Date: Fri, 3 May 2019 22:56:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347068 - stable/11/lib/msun/src X-SVN-Group: stable-11 X-SVN-Commit-Author: peterj X-SVN-Commit-Paths: stable/11/lib/msun/src X-SVN-Commit-Revision: 347068 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1C43A8BDFA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 22:56:52 -0000 Author: peterj Date: Fri May 3 22:56:50 2019 New Revision: 347068 URL: https://svnweb.freebsd.org/changeset/base/347068 Log: MFC r343953: Replace calls to sin(x) and cos(x) with a single call to sincos(). Replace calls to sinf(x) and cosf(x) with a single call to sincosf(). Approved by: grog, jhb (mentors) Modified: stable/11/lib/msun/src/e_j0.c stable/11/lib/msun/src/e_j0f.c stable/11/lib/msun/src/e_j1.c stable/11/lib/msun/src/e_j1f.c stable/11/lib/msun/src/e_jn.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/msun/src/e_j0.c ============================================================================== --- stable/11/lib/msun/src/e_j0.c Fri May 3 22:54:56 2019 (r347067) +++ stable/11/lib/msun/src/e_j0.c Fri May 3 22:56:50 2019 (r347068) @@ -93,8 +93,7 @@ __ieee754_j0(double x) if(ix>=0x7ff00000) return one/(x*x); x = fabs(x); if(ix >= 0x40000000) { /* |x| >= 2.0 */ - s = sin(x); - c = cos(x); + sincos(x, &s, &c); ss = s-c; cc = s+c; if(ix<0x7fe00000) { /* Make sure x+x does not overflow. */ @@ -173,8 +172,7 @@ __ieee754_y0(double x) * sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x)) * to compute the worse one. */ - s = sin(x); - c = cos(x); + sincos(x, &s, &c); ss = s-c; cc = s+c; /* Modified: stable/11/lib/msun/src/e_j0f.c ============================================================================== --- stable/11/lib/msun/src/e_j0f.c Fri May 3 22:54:56 2019 (r347067) +++ stable/11/lib/msun/src/e_j0f.c Fri May 3 22:56:50 2019 (r347068) @@ -55,8 +55,7 @@ __ieee754_j0f(float x) if(ix>=0x7f800000) return one/(x*x); x = fabsf(x); if(ix >= 0x40000000) { /* |x| >= 2.0 */ - s = sinf(x); - c = cosf(x); + sincosf(x, &s, &c); ss = s-c; cc = s+c; if(ix<0x7f000000) { /* Make sure x+x does not overflow. */ @@ -128,8 +127,7 @@ __ieee754_y0f(float x) * sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x)) * to compute the worse one. */ - s = sinf(x); - c = cosf(x); + sincosf(x, &s, &c); ss = s-c; cc = s+c; /* Modified: stable/11/lib/msun/src/e_j1.c ============================================================================== --- stable/11/lib/msun/src/e_j1.c Fri May 3 22:54:56 2019 (r347067) +++ stable/11/lib/msun/src/e_j1.c Fri May 3 22:56:50 2019 (r347068) @@ -94,8 +94,7 @@ __ieee754_j1(double x) if(ix>=0x7ff00000) return one/x; y = fabs(x); if(ix >= 0x40000000) { /* |x| >= 2.0 */ - s = sin(y); - c = cos(y); + sincos(y, &s, &c); ss = -s-c; cc = s-c; if(ix<0x7fe00000) { /* make sure y+y not overflow */ @@ -159,8 +158,7 @@ __ieee754_y1(double x) /* y1(x<0) = NaN and raise invalid exception. */ if(hx<0) return vzero/vzero; if(ix >= 0x40000000) { /* |x| >= 2.0 */ - s = sin(x); - c = cos(x); + sincos(x, &s, &c); ss = -s-c; cc = s-c; if(ix<0x7fe00000) { /* make sure x+x not overflow */ Modified: stable/11/lib/msun/src/e_j1f.c ============================================================================== --- stable/11/lib/msun/src/e_j1f.c Fri May 3 22:54:56 2019 (r347067) +++ stable/11/lib/msun/src/e_j1f.c Fri May 3 22:56:50 2019 (r347068) @@ -56,8 +56,7 @@ __ieee754_j1f(float x) if(ix>=0x7f800000) return one/x; y = fabsf(x); if(ix >= 0x40000000) { /* |x| >= 2.0 */ - s = sinf(y); - c = cosf(y); + sincosf(y, &s, &c); ss = -s-c; cc = s-c; if(ix<0x7f000000) { /* make sure y+y not overflow */ @@ -114,8 +113,7 @@ __ieee754_y1f(float x) if(ix==0) return -one/vzero; if(hx<0) return vzero/vzero; if(ix >= 0x40000000) { /* |x| >= 2.0 */ - s = sinf(x); - c = cosf(x); + sincosf(x, &s, &c); ss = -s-c; cc = s-c; if(ix<0x7f000000) { /* make sure x+x not overflow */ Modified: stable/11/lib/msun/src/e_jn.c ============================================================================== --- stable/11/lib/msun/src/e_jn.c Fri May 3 22:54:56 2019 (r347067) +++ stable/11/lib/msun/src/e_jn.c Fri May 3 22:56:50 2019 (r347068) @@ -54,7 +54,7 @@ double __ieee754_jn(int n, double x) { int32_t i,hx,ix,lx, sgn; - double a, b, temp, di; + double a, b, c, s, temp, di; double z, w; /* J(-n,x) = (-1)^n * J(n, x), J(n, -x) = (-1)^n * J(n, x) @@ -91,11 +91,12 @@ __ieee754_jn(int n, double x) * 2 -s+c -c-s * 3 s+c c-s */ + sincos(x, &s, &c); switch(n&3) { - case 0: temp = cos(x)+sin(x); break; - case 1: temp = -cos(x)+sin(x); break; - case 2: temp = -cos(x)-sin(x); break; - case 3: temp = cos(x)-sin(x); break; + case 0: temp = c+s; break; + case 1: temp = -c+s; break; + case 2: temp = -c-s; break; + case 3: temp = c-s; break; } b = invsqrtpi*temp/sqrt(x); } else { @@ -216,7 +217,7 @@ __ieee754_yn(int n, double x) { int32_t i,hx,ix,lx; int32_t sign; - double a, b, temp; + double a, b, c, s, temp; EXTRACT_WORDS(hx,lx,x); ix = 0x7fffffff&hx; @@ -248,11 +249,12 @@ __ieee754_yn(int n, double x) * 2 -s+c -c-s * 3 s+c c-s */ + sincos(x, &s, &c); switch(n&3) { - case 0: temp = sin(x)-cos(x); break; - case 1: temp = -sin(x)-cos(x); break; - case 2: temp = -sin(x)+cos(x); break; - case 3: temp = sin(x)+cos(x); break; + case 0: temp = s-c; break; + case 1: temp = -s-c; break; + case 2: temp = -s+c; break; + case 3: temp = s+c; break; } b = invsqrtpi*temp/sqrt(x); } else { From owner-svn-src-all@freebsd.org Fri May 3 23:02:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51707159CBAB; Fri, 3 May 2019 23:02:16 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7FFB8C1F6; Fri, 3 May 2019 23:02:15 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0B27277C9; Fri, 3 May 2019 23:02:15 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43N2FPJ045520; Fri, 3 May 2019 23:02:15 GMT (envelope-from peterj@FreeBSD.org) Received: (from peterj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43N2FS0045519; Fri, 3 May 2019 23:02:15 GMT (envelope-from peterj@FreeBSD.org) Message-Id: <201905032302.x43N2FS0045519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peterj set sender to peterj@FreeBSD.org using -f From: Peter Jeremy Date: Fri, 3 May 2019 23:02:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347069 - stable/12/sys/arm/broadcom/bcm2835 X-SVN-Group: stable-12 X-SVN-Commit-Author: peterj X-SVN-Commit-Paths: stable/12/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 347069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E7FFB8C1F6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 23:02:16 -0000 Author: peterj Date: Fri May 3 23:02:15 2019 New Revision: 347069 URL: https://svnweb.freebsd.org/changeset/base/347069 Log: MFC: r346265 Fix cpufreq(4) on RPI-B Approved by: grog, jhb (mentors) Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c ============================================================================== --- stable/12/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Fri May 3 22:56:50 2019 (r347068) +++ stable/12/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Fri May 3 23:02:15 2019 (r347069) @@ -126,6 +126,7 @@ static struct ofw_compat_data compat_data[] = { { "broadcom,bcm2835-vc", 1 }, { "broadcom,bcm2708-vc", 1 }, { "brcm,bcm2709", 1 }, + { "brcm,bcm2835", 1 }, { "brcm,bcm2836", 1 }, { "brcm,bcm2837", 1 }, { NULL, 0 } From owner-svn-src-all@freebsd.org Fri May 3 23:02:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF45D159CC5D; Fri, 3 May 2019 23:02:55 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 97FA08C37F; Fri, 3 May 2019 23:02:55 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6AC49277DD; Fri, 3 May 2019 23:02:55 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43N2tDt045588; Fri, 3 May 2019 23:02:55 GMT (envelope-from peterj@FreeBSD.org) Received: (from peterj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43N2toW045587; Fri, 3 May 2019 23:02:55 GMT (envelope-from peterj@FreeBSD.org) Message-Id: <201905032302.x43N2toW045587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peterj set sender to peterj@FreeBSD.org using -f From: Peter Jeremy Date: Fri, 3 May 2019 23:02:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347070 - stable/11/sys/arm/broadcom/bcm2835 X-SVN-Group: stable-11 X-SVN-Commit-Author: peterj X-SVN-Commit-Paths: stable/11/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 347070 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 97FA08C37F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 23:02:56 -0000 Author: peterj Date: Fri May 3 23:02:55 2019 New Revision: 347070 URL: https://svnweb.freebsd.org/changeset/base/347070 Log: MFC: r346265 Fix cpufreq(4) on RPI-B Approved by: grog, jhb (mentors) Modified: stable/11/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c ============================================================================== --- stable/11/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Fri May 3 23:02:15 2019 (r347069) +++ stable/11/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Fri May 3 23:02:55 2019 (r347070) @@ -128,6 +128,7 @@ static struct ofw_compat_data compat_data[] = { { "broadcom,bcm2835-vc", 1 }, { "broadcom,bcm2708-vc", 1 }, { "brcm,bcm2709", 1 }, + { "brcm,bcm2835", 1 }, { "brcm,bcm2836", 1 }, { NULL, 0 } }; From owner-svn-src-all@freebsd.org Fri May 3 23:06:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A045B159CDB0; Fri, 3 May 2019 23:06:36 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 431A18C4FC; Fri, 3 May 2019 23:06:36 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24080277DE; Fri, 3 May 2019 23:06:36 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43N6ZGK045825; Fri, 3 May 2019 23:06:35 GMT (envelope-from peterj@FreeBSD.org) Received: (from peterj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43N6ZPQ045824; Fri, 3 May 2019 23:06:35 GMT (envelope-from peterj@FreeBSD.org) Message-Id: <201905032306.x43N6ZPQ045824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peterj set sender to peterj@FreeBSD.org using -f From: Peter Jeremy Date: Fri, 3 May 2019 23:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347071 - stable/12/sys/arm/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: peterj X-SVN-Commit-Paths: stable/12/sys/arm/conf X-SVN-Commit-Revision: 347071 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 431A18C4FC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 23:06:36 -0000 Author: peterj Date: Fri May 3 23:06:35 2019 New Revision: 347071 URL: https://svnweb.freebsd.org/changeset/base/347071 Log: MFC: r346266 Specify correct Ethernet phy for RPI-B Approved by: grog, jhb (mentors) Modified: stable/12/sys/arm/conf/RPI-B Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/conf/RPI-B ============================================================================== --- stable/12/sys/arm/conf/RPI-B Fri May 3 23:02:55 2019 (r347070) +++ stable/12/sys/arm/conf/RPI-B Fri May 3 23:06:35 2019 (r347071) @@ -77,7 +77,7 @@ device da device umass # USB ethernet support -device smcphy +device smscphy device mii device smsc From owner-svn-src-all@freebsd.org Fri May 3 23:07:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87B49159CDF8; Fri, 3 May 2019 23:07:08 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FBB58C614; Fri, 3 May 2019 23:07:08 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0911C277DF; Fri, 3 May 2019 23:07:08 +0000 (UTC) (envelope-from peterj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43N77Ti045896; Fri, 3 May 2019 23:07:07 GMT (envelope-from peterj@FreeBSD.org) Received: (from peterj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43N77DN045895; Fri, 3 May 2019 23:07:07 GMT (envelope-from peterj@FreeBSD.org) Message-Id: <201905032307.x43N77DN045895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peterj set sender to peterj@FreeBSD.org using -f From: Peter Jeremy Date: Fri, 3 May 2019 23:07:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347072 - stable/11/sys/arm/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: peterj X-SVN-Commit-Paths: stable/11/sys/arm/conf X-SVN-Commit-Revision: 347072 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2FBB58C614 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 23:07:08 -0000 Author: peterj Date: Fri May 3 23:07:07 2019 New Revision: 347072 URL: https://svnweb.freebsd.org/changeset/base/347072 Log: MFC: r346266 Specify correct Ethernet phy for RPI-B Approved by: grog, jhb (mentors) Modified: stable/11/sys/arm/conf/RPI-B Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/conf/RPI-B ============================================================================== --- stable/11/sys/arm/conf/RPI-B Fri May 3 23:06:35 2019 (r347071) +++ stable/11/sys/arm/conf/RPI-B Fri May 3 23:07:07 2019 (r347072) @@ -80,7 +80,7 @@ device da device umass # USB ethernet support -device smcphy +device smscphy device mii device smsc From owner-svn-src-all@freebsd.org Sat May 4 00:56:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33941159EF15; Sat, 4 May 2019 00:56:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BBBC78F773; Sat, 4 May 2019 00:56:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FEB5AD4; Sat, 4 May 2019 00:56:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x440ulmx004348; Sat, 4 May 2019 00:56:47 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x440ulAM004347; Sat, 4 May 2019 00:56:47 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905040056.x440ulAM004347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 4 May 2019 00:56:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347073 - stable/11/sys/amd64/vmm/intel X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/sys/amd64/vmm/intel X-SVN-Commit-Revision: 347073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BBBC78F773 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.926,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 00:56:48 -0000 Author: jhb Date: Sat May 4 00:56:47 2019 New Revision: 347073 URL: https://svnweb.freebsd.org/changeset/base/347073 Log: MFC 327065: Recognize a pending virtual interrupt while emulating the halt instruction. Modified: stable/11/sys/amd64/vmm/intel/vmx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/11/sys/amd64/vmm/intel/vmx.c Fri May 3 23:07:07 2019 (r347072) +++ stable/11/sys/amd64/vmm/intel/vmx.c Sat May 4 00:56:47 2019 (r347073) @@ -3361,9 +3361,29 @@ vmx_pending_intr(struct vlapic *vlapic, int *vecptr) pir_desc = vlapic_vtx->pir_desc; pending = atomic_load_acq_long(&pir_desc->pending); - if (!pending) - return (0); /* common case */ + if (!pending) { + /* + * While a virtual interrupt may have already been + * processed the actual delivery maybe pending the + * interruptibility of the guest. Recognize a pending + * interrupt by reevaluating virtual interrupts + * following Section 29.2.1 in the Intel SDM Volume 3. + */ + uint64_t val; + uint8_t rvi, ppr; + vmx_getreg(vlapic_vtx->vmx, vlapic->vcpuid, + VMCS_IDENT(VMCS_GUEST_INTR_STATUS), &val); + rvi = val & APIC_TPR_INT; + lapic = vlapic->apic_page; + ppr = lapic->ppr & APIC_TPR_INT; + if (rvi > ppr) { + return (1); + } + + return (0); + } + /* * If there is an interrupt pending then it will be recognized only * if its priority is greater than the processor priority. @@ -3372,7 +3392,7 @@ vmx_pending_intr(struct vlapic *vlapic, int *vecptr) * interrupt will be recognized. */ lapic = vlapic->apic_page; - ppr = lapic->ppr & 0xf0; + ppr = lapic->ppr & APIC_TPR_INT; if (ppr == 0) return (1); @@ -3383,7 +3403,7 @@ vmx_pending_intr(struct vlapic *vlapic, int *vecptr) for (i = 3; i >= 0; i--) { pirval = pir_desc->pir[i]; if (pirval != 0) { - vpr = (i * 64 + flsl(pirval) - 1) & 0xf0; + vpr = (i * 64 + flsl(pirval) - 1) & APIC_TPR_INT; break; } } From owner-svn-src-all@freebsd.org Sat May 4 00:59:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 971AA159F001; Sat, 4 May 2019 00:59:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FB0C8F8D7; Sat, 4 May 2019 00:59:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DE2FAD7; Sat, 4 May 2019 00:59:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x440xBpJ004642; Sat, 4 May 2019 00:59:11 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x440xBCx004641; Sat, 4 May 2019 00:59:11 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905040059.x440xBCx004641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 4 May 2019 00:59:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347074 - in stable/11/sys/amd64: include vmm/intel X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/11/sys/amd64: include vmm/intel X-SVN-Commit-Revision: 347074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2FB0C8F8D7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.926,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 00:59:12 -0000 Author: jhb Date: Sat May 4 00:59:11 2019 New Revision: 347074 URL: https://svnweb.freebsd.org/changeset/base/347074 Log: MFC 330615: Fix a lock recursion introduced in r327065. Modified: stable/11/sys/amd64/include/vmm.h stable/11/sys/amd64/vmm/intel/vmx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/include/vmm.h ============================================================================== --- stable/11/sys/amd64/include/vmm.h Sat May 4 00:56:47 2019 (r347073) +++ stable/11/sys/amd64/include/vmm.h Sat May 4 00:59:11 2019 (r347074) @@ -634,6 +634,7 @@ struct vm_exit { } spinup_ap; struct { uint64_t rflags; + uint64_t intr_status; } hlt; struct { int vector; Modified: stable/11/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/11/sys/amd64/vmm/intel/vmx.c Sat May 4 00:56:47 2019 (r347073) +++ stable/11/sys/amd64/vmm/intel/vmx.c Sat May 4 00:59:11 2019 (r347074) @@ -2329,6 +2329,11 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ vmm_stat_incr(vmx->vm, vcpu, VMEXIT_HLT, 1); vmexit->exitcode = VM_EXITCODE_HLT; vmexit->u.hlt.rflags = vmcs_read(VMCS_GUEST_RFLAGS); + if (virtual_interrupt_delivery) + vmexit->u.hlt.intr_status = + vmcs_read(VMCS_GUEST_INTR_STATUS); + else + vmexit->u.hlt.intr_status = 0; break; case EXIT_REASON_MTF: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_MTRAP, 1); @@ -3369,12 +3374,13 @@ vmx_pending_intr(struct vlapic *vlapic, int *vecptr) * interrupt by reevaluating virtual interrupts * following Section 29.2.1 in the Intel SDM Volume 3. */ - uint64_t val; + struct vm_exit *vmexit; uint8_t rvi, ppr; - vmx_getreg(vlapic_vtx->vmx, vlapic->vcpuid, - VMCS_IDENT(VMCS_GUEST_INTR_STATUS), &val); - rvi = val & APIC_TPR_INT; + vmexit = vm_exitinfo(vlapic->vm, vlapic->vcpuid); + KASSERT(vmexit->exitcode == VM_EXITCODE_HLT, + ("vmx_pending_intr: exitcode not 'HLT'")); + rvi = vmexit->u.hlt.intr_status & APIC_TPR_INT; lapic = vlapic->apic_page; ppr = lapic->ppr & APIC_TPR_INT; if (rvi > ppr) { From owner-svn-src-all@freebsd.org Sat May 4 02:09:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 908F615A2028; Sat, 4 May 2019 02:09:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3261C6B8FE; Sat, 4 May 2019 02:09:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B13B178C; Sat, 4 May 2019 02:09:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4429Ux3041288; Sat, 4 May 2019 02:09:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4429UGV041287; Sat, 4 May 2019 02:09:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905040209.x4429UGV041287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Sat, 4 May 2019 02:09:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347075 - head/usr.sbin/lpr/common_source X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/usr.sbin/lpr/common_source X-SVN-Commit-Revision: 347075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3261C6B8FE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 02:09:31 -0000 Author: ngie Date: Sat May 4 02:09:30 2019 New Revision: 347075 URL: https://svnweb.freebsd.org/changeset/base/347075 Log: Fix `clang -Wcast-qual` issues Remove unnecessary `char*` casting for arguments passed to `cget*(3)`, and deconst `_PATH_PRINTCAP` before passing it to `cget*` via the `printcapdb` variable. This unblocks ^/projects/runtime-coverage-v2 from building cleanly on universe13a.freebsd.org. I suspect the issue was introduced through some changes to `bsd.*.mk` inclusion on the branch, which I will continue to investigate/isolate. MFC after: 1 week Tested with: clang 8 (arm64) Modified: head/usr.sbin/lpr/common_source/printcap.c Modified: head/usr.sbin/lpr/common_source/printcap.c ============================================================================== --- head/usr.sbin/lpr/common_source/printcap.c Sat May 4 00:59:11 2019 (r347074) +++ head/usr.sbin/lpr/common_source/printcap.c Sat May 4 02:09:30 2019 (r347075) @@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$"); /* * Routines and data used in processing the printcap file. */ -static char *printcapdb[2] = { _PATH_PRINTCAP, 0 }; /* list for cget* */ +static char *printcapdb[] = { __DECONST(char *, _PATH_PRINTCAP), NULL }; static char *capdb_canonical_name(const char *_bp); static int capdb_getaltlog(char *_bp, const char *_shrt, @@ -99,15 +99,9 @@ int getprintcap(const char *printer, struct printer *pp) { int status; - char *XXX; char *bp; - /* - * A bug in the declaration of cgetent(3) means that we have - * to hide the constness of its third argument. - */ - XXX = (char *)printer; - if ((status = cgetent(&bp, printcapdb, XXX)) < 0) + if ((status = cgetent(&bp, printcapdb, printer)) < 0) return status; status = getprintcap_int(bp, pp); free(bp); @@ -380,10 +374,10 @@ capdb_getaltstr(char *bp, const char *shrt, const char { int status; - status = cgetstr(bp, (char *)/*XXX*/lng, result); + status = cgetstr(bp, lng, result); if (status >= 0 || status == PCAPERR_OSERR) return status; - status = cgetstr(bp, (char *)/*XXX*/shrt, result); + status = cgetstr(bp, shrt, result); if (status >= 0 || status == PCAPERR_OSERR) return status; if (dflt) { @@ -404,10 +398,10 @@ capdb_getaltnum(char *bp, const char *shrt, const char { int status; - status = cgetnum(bp, (char *)/*XXX*/lng, result); + status = cgetnum(bp, lng, result); if (status >= 0) return status; - status = cgetnum(bp, (char *)/*XXX*/shrt, result); + status = cgetnum(bp, shrt, result); if (status >= 0) return status; *result = dflt; @@ -421,9 +415,9 @@ capdb_getaltnum(char *bp, const char *shrt, const char static int capdb_getaltlog(char *bp, const char *shrt, const char *lng) { - if (cgetcap(bp, (char *)/*XXX*/lng, ':')) + if (cgetcap(bp, lng, ':')) return 1; - if (cgetcap(bp, (char *)/*XXX*/shrt, ':')) + if (cgetcap(bp, shrt, ':')) return 1; return 0; } From owner-svn-src-all@freebsd.org Sat May 4 02:34:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBC0415A2FD8; Sat, 4 May 2019 02:34:29 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 929D36C9F8; Sat, 4 May 2019 02:34:29 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50DF61CC4; Sat, 4 May 2019 02:34:29 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x442YTOE057139; Sat, 4 May 2019 02:34:29 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x442YTM2057138; Sat, 4 May 2019 02:34:29 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905040234.x442YTM2057138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 4 May 2019 02:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347078 - head/sys/powerpc/include X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/include X-SVN-Commit-Revision: 347078 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 929D36C9F8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 02:34:30 -0000 Author: jhibbits Date: Sat May 4 02:34:28 2019 New Revision: 347078 URL: https://svnweb.freebsd.org/changeset/base/347078 Log: powerpc: Merge all pmap struct definitions Summary: A few ports fail to build due to missing pmap-related definitions, which are specific per-pmap type. This tries to appease those ports, by merging all pmaps together. A future change will move the inline page directory out of the Book-E pmap, to eliminate the last #ifdefs in pmap.h and complete the merge. Reviewed By: luporl Differential Revision: https://reviews.freebsd.org/D20119 Modified: head/sys/powerpc/include/pmap.h head/sys/powerpc/include/pte.h Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Sat May 4 02:11:28 2019 (r347077) +++ head/sys/powerpc/include/pmap.h Sat May 4 02:34:28 2019 (r347078) @@ -79,8 +79,6 @@ struct pmap; typedef struct pmap *pmap_t; -#if defined(AIM) - #if !defined(NPMAPS) #define NPMAPS 32768 #endif /* !defined(NPMAPS) */ @@ -96,7 +94,7 @@ struct pvo_entry { struct { #ifndef __powerpc64__ /* 32-bit fields */ - struct pte pte; + pte_t pte; #endif /* 64-bit fields */ uintptr_t slot; @@ -136,28 +134,80 @@ RB_PROTOTYPE(pvo_tree, pvo_entry, pvo_plink, pvo_vaddr struct pmap { struct pmap_statistics pm_stats; struct mtx pm_mtx; - - #ifdef __powerpc64__ - struct slbtnode *pm_slb_tree_root; - struct slb **pm_slb; - int pm_slb_len; - #else - register_t pm_sr[16]; - #endif cpuset_t pm_active; + union { +#ifdef AIM + struct { + + #ifdef __powerpc64__ + struct slbtnode *pm_slb_tree_root; + struct slb **pm_slb; + int pm_slb_len; + #else + register_t pm_sr[16]; + #endif - struct pmap *pmap_phys; - struct pvo_tree pmap_pvo; + struct pmap *pmap_phys; + struct pvo_tree pmap_pvo; + }; +#endif +#ifdef BOOKE + struct { + /* TID to identify this pmap entries in TLB */ + tlbtid_t pm_tid[MAXCPU]; + +#ifdef __powerpc64__ + /* + * Page table directory, + * array of pointers to page directories. + */ + pte_t **pm_pp2d[PP2D_NENTRIES]; + + /* List of allocated pdir bufs (pdir kva regions). */ + TAILQ_HEAD(, ptbl_buf) pm_pdir_list; +#else + /* + * Page table directory, + * array of pointers to page tables. + */ + pte_t *pm_pdir[PDIR_NENTRIES]; +#endif + + /* List of allocated ptbl bufs (ptbl kva regions). */ + TAILQ_HEAD(, ptbl_buf) pm_ptbl_list; + }; +#endif + }; }; +struct pv_entry { + pmap_t pv_pmap; + vm_offset_t pv_va; + TAILQ_ENTRY(pv_entry) pv_link; +}; +typedef struct pv_entry *pv_entry_t; + struct md_page { - volatile int32_t mdpg_attrs; - vm_memattr_t mdpg_cache_attrs; - struct pvo_head mdpg_pvoh; + union { + struct { + volatile int32_t mdpg_attrs; + vm_memattr_t mdpg_cache_attrs; + struct pvo_head mdpg_pvoh; + }; + struct { + TAILQ_HEAD(, pv_entry) pv_list; + int pv_tracked; + }; + }; }; +#ifdef AIM #define pmap_page_get_memattr(m) ((m)->md.mdpg_cache_attrs) #define pmap_page_is_mapped(m) (!LIST_EMPTY(&(m)->md.mdpg_pvoh)) +#else +#define pmap_page_get_memattr(m) VM_MEMATTR_DEFAULT +#define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) +#endif /* * Return the VSID corresponding to a given virtual address. @@ -181,56 +231,6 @@ struct slbtnode *slb_alloc_tree(void); void slb_free_tree(pmap_t pm); struct slb **slb_alloc_user_cache(void); void slb_free_user_cache(struct slb **); - -#elif defined(BOOKE) - -struct pmap { - struct pmap_statistics pm_stats; /* pmap statistics */ - struct mtx pm_mtx; /* pmap mutex */ - tlbtid_t pm_tid[MAXCPU]; /* TID to identify this pmap entries in TLB */ - cpuset_t pm_active; /* active on cpus */ - -#ifdef __powerpc64__ - /* Page table directory, array of pointers to page directories. */ - pte_t **pm_pp2d[PP2D_NENTRIES]; - - /* List of allocated pdir bufs (pdir kva regions). */ - TAILQ_HEAD(, ptbl_buf) pm_pdir_list; -#else - /* Page table directory, array of pointers to page tables. */ - pte_t *pm_pdir[PDIR_NENTRIES]; -#endif - - /* List of allocated ptbl bufs (ptbl kva regions). */ - TAILQ_HEAD(, ptbl_buf) pm_ptbl_list; -}; - -struct pv_entry { - pmap_t pv_pmap; - vm_offset_t pv_va; - TAILQ_ENTRY(pv_entry) pv_link; -}; -typedef struct pv_entry *pv_entry_t; - -struct md_page { - TAILQ_HEAD(, pv_entry) pv_list; - int pv_tracked; -}; - -#define pmap_page_get_memattr(m) VM_MEMATTR_DEFAULT -#define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) - -#else -/* - * Common pmap members between AIM and BOOKE. - * libkvm needs pm_stats at the same location between both, as it doesn't define - * AIM nor BOOKE, and is expected to work across all. - */ -struct pmap { - struct pmap_statistics pm_stats; /* pmap statistics */ - struct mtx pm_mtx; /* pmap mutex */ -}; -#endif /* AIM */ extern struct pmap kernel_pmap_store; #define kernel_pmap (&kernel_pmap_store) Modified: head/sys/powerpc/include/pte.h ============================================================================== --- head/sys/powerpc/include/pte.h Sat May 4 02:11:28 2019 (r347077) +++ head/sys/powerpc/include/pte.h Sat May 4 02:34:28 2019 (r347078) @@ -70,6 +70,8 @@ struct pate { u_int64_t proctab; }; +typedef struct pte pte_t; +typedef struct lpte lpte_t; #endif /* LOCORE */ /* 32-bit PTE definitions */ @@ -161,12 +163,6 @@ struct pate { #define RPDE_NLB_SHIFT 8 #define RPDE_NLS_MASK 0x000000000000001FULL - -#ifndef LOCORE -typedef struct pte pte_t; -typedef struct lpte lpte_t; -#endif /* LOCORE */ - /* * Extract bits from address */ @@ -201,6 +197,114 @@ typedef struct lpte lpte_t; #include +/* + * Flags for pte_remove() routine. + */ +#define PTBL_HOLD 0x00000001 /* do not unhold ptbl pages */ +#define PTBL_UNHOLD 0x00000002 /* unhold and attempt to free ptbl pages */ + +#define PTBL_HOLD_FLAG(pmap) (((pmap) == kernel_pmap) ? PTBL_HOLD : PTBL_UNHOLD) + +/* + * Page Table Entry definitions and macros. + * + * RPN need only be 32-bit because Book-E has 36-bit addresses, and the smallest + * page size is 4k (12-bit mask), so RPN can really fit into 24 bits. + */ +#ifndef LOCORE +typedef uint64_t pte_t; +#endif + +/* RPN mask, TLB0 4K pages */ +#define PTE_PA_MASK PAGE_MASK + +#if defined(BOOKE_E500) + +/* PTE bits assigned to MAS2, MAS3 flags */ +#define PTE_MAS2_SHIFT 19 +#define PTE_W (MAS2_W << PTE_MAS2_SHIFT) +#define PTE_I (MAS2_I << PTE_MAS2_SHIFT) +#define PTE_M (MAS2_M << PTE_MAS2_SHIFT) +#define PTE_G (MAS2_G << PTE_MAS2_SHIFT) +#define PTE_MAS2_MASK (MAS2_G | MAS2_M | MAS2_I | MAS2_W) + +#define PTE_MAS3_SHIFT 2 +#define PTE_UX (MAS3_UX << PTE_MAS3_SHIFT) +#define PTE_SX (MAS3_SX << PTE_MAS3_SHIFT) +#define PTE_UW (MAS3_UW << PTE_MAS3_SHIFT) +#define PTE_SW (MAS3_SW << PTE_MAS3_SHIFT) +#define PTE_UR (MAS3_UR << PTE_MAS3_SHIFT) +#define PTE_SR (MAS3_SR << PTE_MAS3_SHIFT) +#define PTE_MAS3_MASK ((MAS3_UX | MAS3_SX | MAS3_UW \ + | MAS3_SW | MAS3_UR | MAS3_SR) << PTE_MAS3_SHIFT) + +#define PTE_PS_SHIFT 8 +#define PTE_PS_4KB (2 << PTE_PS_SHIFT) + +#elif defined(BOOKE_PPC4XX) + +#define PTE_WL1 TLB_WL1 +#define PTE_IL2I TLB_IL2I +#define PTE_IL2D TLB_IL2D + +#define PTE_W TLB_W +#define PTE_I TLB_I +#define PTE_M TLB_M +#define PTE_G TLB_G + +#define PTE_UX TLB_UX +#define PTE_SX TLB_SX +#define PTE_UW TLB_UW +#define PTE_SW TLB_SW +#define PTE_UR TLB_UR +#define PTE_SR TLB_SR + +#endif + +/* Other PTE flags */ +#define PTE_VALID 0x00000001 /* Valid */ +#define PTE_MODIFIED 0x00001000 /* Modified */ +#define PTE_WIRED 0x00002000 /* Wired */ +#define PTE_MANAGED 0x00000002 /* Managed */ +#define PTE_REFERENCED 0x00040000 /* Referenced */ + +/* + * Page Table Entry definitions and macros. + * + * We use the hardware page table entry format: + * + * 63 24 23 19 18 17 14 13 12 11 8 7 6 5 4 3 2 1 0 + * --------------------------------------------------------------- + * ARPN(12:51) WIMGE R U0:U3 SW0 C PSIZE UX SX UW SW UR SR SW1 V + * --------------------------------------------------------------- + */ + +/* PTE fields. */ +#define PTE_TSIZE_SHIFT (63-54) +#define PTE_TSIZE_MASK 0x7 +#define PTE_TSIZE_SHIFT_DIRECT (63-55) +#define PTE_TSIZE_MASK_DIRECT 0xf +#define PTE_PS_DIRECT(ps) (ps<> PTE_TSIZE_SHIFT) & PTE_TSIZE_MASK) +#define PTE_TSIZE_DIRECT(pte) (int)((*pte >> PTE_TSIZE_SHIFT_DIRECT) & PTE_TSIZE_MASK_DIRECT) + +/* Macro argument must of pte_t type. */ +#define PTE_ARPN_SHIFT 12 +#define PTE_FLAGS_MASK 0x00ffffff +#define PTE_RPN_FROM_PA(pa) (((pa) & ~PAGE_MASK) << PTE_ARPN_SHIFT) +#define PTE_PA(pte) ((vm_paddr_t)(*pte >> PTE_ARPN_SHIFT) & ~PAGE_MASK) +#define PTE_ISVALID(pte) ((*pte) & PTE_VALID) +#define PTE_ISWIRED(pte) ((*pte) & PTE_WIRED) +#define PTE_ISMANAGED(pte) ((*pte) & PTE_MANAGED) +#define PTE_ISMODIFIED(pte) ((*pte) & PTE_MODIFIED) +#define PTE_ISREFERENCED(pte) ((*pte) & PTE_REFERENCED) + +#endif /* BOOKE */ + +/* Book-E page table format, broken out for the generic pmap.h. */ #ifdef __powerpc64__ #include @@ -221,16 +325,11 @@ typedef struct lpte lpte_t; * pp2d consists of PP2D_NENTRIES entries, each being a pointer to * second level entity, i.e. the page table directory (pdir). */ -#define HARDWARE_WALKER #define PP2D_H_H 61 #define PP2D_H_L 60 #define PP2D_L_H 39 #define PP2D_L_L 30 /* >30 would work with no page table pool */ -#ifndef LOCORE -#define PP2D_SIZE (1UL << PP2D_L_L) /* va range mapped by pp2d */ -#else #define PP2D_SIZE (1 << PP2D_L_L) /* va range mapped by pp2d */ -#endif #define PP2D_L_SHIFT PP2D_L_L #define PP2D_L_NUM (PP2D_L_H-PP2D_L_L+1) #define PP2D_L_MASK ((1<> PTE_TSIZE_SHIFT) & PTE_TSIZE_MASK) -#define PTE_TSIZE_DIRECT(pte) (int)((*pte >> PTE_TSIZE_SHIFT_DIRECT) & PTE_TSIZE_MASK_DIRECT) - -/* Macro argument must of pte_t type. */ -#define PTE_ARPN_SHIFT 12 -#define PTE_FLAGS_MASK 0x00ffffff -#define PTE_RPN_FROM_PA(pa) (((pa) & ~PAGE_MASK) << PTE_ARPN_SHIFT) -#define PTE_PA(pte) ((vm_paddr_t)(*pte >> PTE_ARPN_SHIFT) & ~PAGE_MASK) -#define PTE_ISVALID(pte) ((*pte) & PTE_VALID) -#define PTE_ISWIRED(pte) ((*pte) & PTE_WIRED) -#define PTE_ISMANAGED(pte) ((*pte) & PTE_MANAGED) -#define PTE_ISMODIFIED(pte) ((*pte) & PTE_MODIFIED) -#define PTE_ISREFERENCED(pte) ((*pte) & PTE_REFERENCED) - -#endif /* BOOKE */ #endif /* _MACHINE_PTE_H_ */ From owner-svn-src-all@freebsd.org Sat May 4 02:45:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC7BA15A37DB; Sat, 4 May 2019 02:45:25 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 71DEC6D33B; Sat, 4 May 2019 02:45:25 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 485D51E9A; Sat, 4 May 2019 02:45:25 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x442jP8t062436; Sat, 4 May 2019 02:45:25 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x442jPh5062435; Sat, 4 May 2019 02:45:25 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905040245.x442jPh5062435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 4 May 2019 02:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347079 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 347079 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 71DEC6D33B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 02:45:26 -0000 Author: jhibbits Date: Sat May 4 02:45:24 2019 New Revision: 347079 URL: https://svnweb.freebsd.org/changeset/base/347079 Log: powerpc: Optimize padding in bus_dma_tag Avoid 8 bytes of padding (2 noncontiguous ints). Submitted by: Brandon Bergren Differential Revision: https://reviews.freebsd.org/D20121 Modified: head/sys/powerpc/powerpc/busdma_machdep.c Modified: head/sys/powerpc/powerpc/busdma_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/busdma_machdep.c Sat May 4 02:34:28 2019 (r347078) +++ head/sys/powerpc/powerpc/busdma_machdep.c Sat May 4 02:45:24 2019 (r347079) @@ -73,8 +73,8 @@ struct bus_dma_tag { bus_dma_filter_t *filter; void *filterarg; bus_size_t maxsize; - u_int nsegments; bus_size_t maxsegsz; + u_int nsegments; int flags; int ref_count; int map_count; From owner-svn-src-all@freebsd.org Sat May 4 09:01:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 661BE15874CD; Sat, 4 May 2019 09:01:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D39177ED5; Sat, 4 May 2019 09:01:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D88AA626C; Sat, 4 May 2019 09:01:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4491uCq064929; Sat, 4 May 2019 09:01:56 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4491uVE064928; Sat, 4 May 2019 09:01:56 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905040901.x4491uVE064928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 09:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347080 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0D39177ED5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 09:01:57 -0000 Author: tuexen Date: Sat May 4 09:01:56 2019 New Revision: 347080 URL: https://svnweb.freebsd.org/changeset/base/347080 Log: MFC r343401: Update a comment to reflect the current reality. SYN-cache entries live for abaut 12 seconds, not 45, when default setting are used. MFC r343402: Kill a trailing whitespace character... MFC r343403: Get the arithmetic right... Sponsored by: Netflix, Inc. Modified: stable/12/sys/netinet/tcp_syncache.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_syncache.c ============================================================================== --- stable/12/sys/netinet/tcp_syncache.c Sat May 4 02:45:24 2019 (r347079) +++ stable/12/sys/netinet/tcp_syncache.c Sat May 4 09:01:56 2019 (r347080) @@ -154,7 +154,12 @@ static int syncookie_cmp(struct in_conninfo *inc, str /* * Transmit the SYN,ACK fewer times than TCP_MAXRXTSHIFT specifies. - * 3 retransmits corresponds to a timeout of 3 * (1 + 2 + 4 + 8) == 45 seconds, + * 3 retransmits corresponds to a timeout with default values of + * TCPTV_RTOBASE * ( 1 + + * tcp_syn_backoff[1] + + * tcp_syn_backoff[2] + + * tcp_syn_backoff[3]) + 3 * tcp_rexmit_slop, + * 3000 ms * (1 + 1 + 1 + 1) + 3 * 200 ms = 12600 ms, * the odds are that the user has given up attempting to connect by then. */ #define SYNCACHE_MAXREXMTS 3 From owner-svn-src-all@freebsd.org Sat May 4 09:07:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1148B158757F; Sat, 4 May 2019 09:07:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C117801CF; Sat, 4 May 2019 09:07:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 712506295; Sat, 4 May 2019 09:07:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4497s4m065223; Sat, 4 May 2019 09:07:54 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4497seb065221; Sat, 4 May 2019 09:07:54 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905040907.x4497seb065221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 09:07:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347081 - in stable/12/sys/netinet: . tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 347081 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9C117801CF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 09:07:55 -0000 Author: tuexen Date: Sat May 4 09:07:53 2019 New Revision: 347081 URL: https://svnweb.freebsd.org/changeset/base/347081 Log: MFC r343525: Fix the detection of ECN-setup SYN-ACK packets. RFC 3168 defines an ECN-setup SYN-ACK packet as on with the ECE flags set and the CWR flags not set. The code was only checking if ECE flag is set. This patch adds the check to verify that the CWR flags is not set. Submitted by: Richard Scheffenegger Reviewed by: tuexen@ Differential Revision: https://reviews.freebsd.org/D18996 Modified: stable/12/sys/netinet/tcp_input.c stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Sat May 4 09:01:56 2019 (r347080) +++ stable/12/sys/netinet/tcp_input.c Sat May 4 09:07:53 2019 (r347081) @@ -2027,7 +2027,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru else tp->t_flags |= TF_ACKNOW; - if ((thflags & TH_ECE) && V_tcp_do_ecn) { + if (((thflags & (TH_CWR | TH_ECE)) == TH_ECE) && + V_tcp_do_ecn) { tp->t_flags |= TF_ECN_PERMIT; TCPSTAT_INC(tcps_ecn_shs); } Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Sat May 4 09:01:56 2019 (r347080) +++ stable/12/sys/netinet/tcp_stacks/rack.c Sat May 4 09:07:53 2019 (r347081) @@ -5245,7 +5245,8 @@ rack_do_syn_sent(struct mbuf *m, struct tcphdr *th, st tp->t_flags |= TF_ACKNOW; } - if ((thflags & TH_ECE) && V_tcp_do_ecn) { + if (((thflags & (TH_CWR | TH_ECE)) == TH_ECE) && + V_tcp_do_ecn) { tp->t_flags |= TF_ECN_PERMIT; TCPSTAT_INC(tcps_ecn_shs); } From owner-svn-src-all@freebsd.org Sat May 4 09:11:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D82D1587651; Sat, 4 May 2019 09:11:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21A43803AB; Sat, 4 May 2019 09:11:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEE7763D7; Sat, 4 May 2019 09:11:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x449BHTF067922; Sat, 4 May 2019 09:11:17 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x449BH2L067920; Sat, 4 May 2019 09:11:17 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905040911.x449BH2L067920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 09:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347082 - in stable/12/sys/netinet: . tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 347082 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 21A43803AB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 09:11:18 -0000 Author: tuexen Date: Sat May 4 09:11:17 2019 New Revision: 347082 URL: https://svnweb.freebsd.org/changeset/base/347082 Log: MFC r343661: When handling SYN-ACK segments in the SYN-RCVD state, set tp->snd_wnd consistently. This inconsistency was observed when working on the bug reported in PR 235256, although it does not fix the reported issue. The fix for the PR will be a separate commit. PR: 235256 Reviewed by: rrs@, Richard Scheffenegger Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D19033 Modified: stable/12/sys/netinet/tcp_input.c stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Sat May 4 09:07:53 2019 (r347081) +++ stable/12/sys/netinet/tcp_input.c Sat May 4 09:11:17 2019 (r347082) @@ -2402,8 +2402,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru if ((tp->t_flags & (TF_RCVD_SCALE|TF_REQ_SCALE)) == (TF_RCVD_SCALE|TF_REQ_SCALE)) { tp->rcv_scale = tp->request_r_scale; - tp->snd_wnd = tiwin; } + tp->snd_wnd = tiwin; /* * Make transitions: * SYN-RECEIVED -> ESTABLISHED Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Sat May 4 09:07:53 2019 (r347081) +++ stable/12/sys/netinet/tcp_stacks/rack.c Sat May 4 09:11:17 2019 (r347082) @@ -5445,6 +5445,7 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st tp->ts_recent_age = tcp_ts_getticks(); tp->ts_recent = to->to_tsval; } + tp->snd_wnd = tiwin; /* * If the ACK bit is off: if in SYN-RECEIVED state or SENDSYN flag * is on (half-synchronized state), then queue data for later @@ -5452,7 +5453,6 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st */ if ((thflags & TH_ACK) == 0) { if (IS_FASTOPEN(tp->t_flags)) { - tp->snd_wnd = tiwin; cc_conn_init(tp); } return (rack_process_data(m, th, so, tp, drop_hdrlen, tlen, @@ -5464,7 +5464,6 @@ rack_do_syn_recv(struct mbuf *m, struct tcphdr *th, st if ((tp->t_flags & (TF_RCVD_SCALE | TF_REQ_SCALE)) == (TF_RCVD_SCALE | TF_REQ_SCALE)) { tp->rcv_scale = tp->request_r_scale; - tp->snd_wnd = tiwin; } /* * Make transitions: SYN-RECEIVED -> ESTABLISHED SYN-RECEIVED* -> From owner-svn-src-all@freebsd.org Sat May 4 09:13:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF2471587917; Sat, 4 May 2019 09:13:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 950D08077D; Sat, 4 May 2019 09:13:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D9E9643B; Sat, 4 May 2019 09:13:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x449Dq9s070697; Sat, 4 May 2019 09:13:52 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x449DqdW070696; Sat, 4 May 2019 09:13:52 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905040913.x449DqdW070696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 09:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347083 - stable/12/lib/libsysdecode X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/lib/libsysdecode X-SVN-Commit-Revision: 347083 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 950D08077D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 09:13:53 -0000 Author: tuexen Date: Sat May 4 09:13:52 2019 New Revision: 347083 URL: https://svnweb.freebsd.org/changeset/base/347083 Log: MFC r343742: Add missing SCTP_EOR entry. Modified: stable/12/lib/libsysdecode/flags.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libsysdecode/flags.c ============================================================================== --- stable/12/lib/libsysdecode/flags.c Sat May 4 09:11:17 2019 (r347082) +++ stable/12/lib/libsysdecode/flags.c Sat May 4 09:13:52 2019 (r347083) @@ -1208,7 +1208,7 @@ sysdecode_sctp_pr_policy(int policy) static struct name_table sctpsndflags[] = { X(SCTP_EOF) X(SCTP_ABORT) X(SCTP_UNORDERED) X(SCTP_ADDR_OVER) - X(SCTP_SENDALL) X(SCTP_SACK_IMMEDIATELY) XEND + X(SCTP_SENDALL) X(SCTP_EOR) X(SCTP_SACK_IMMEDIATELY) XEND }; bool From owner-svn-src-all@freebsd.org Sat May 4 09:15:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C2FC1587A17; Sat, 4 May 2019 09:15:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B37B5808E7; Sat, 4 May 2019 09:15:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E19B643D; Sat, 4 May 2019 09:15:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x449FvBi070843; Sat, 4 May 2019 09:15:57 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x449FvNl070842; Sat, 4 May 2019 09:15:57 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905040915.x449FvNl070842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 09:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347084 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347084 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B37B5808E7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 09:15:58 -0000 Author: tuexen Date: Sat May 4 09:15:57 2019 New Revision: 347084 URL: https://svnweb.freebsd.org/changeset/base/347084 Log: MFC r343769: Fix an off-by-one error in the input validation of the SCTP_RESET_STREAMS socketoption. This was found by running syzkaller. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 09:13:52 2019 (r347083) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 09:15:57 2019 (r347084) @@ -4654,13 +4654,13 @@ sctp_setopt(struct socket *so, int optname, void *optv } for (i = 0; i < strrst->srs_number_streams; i++) { if ((send_in) && - (strrst->srs_stream_list[i] > stcb->asoc.streamincnt)) { + (strrst->srs_stream_list[i] >= stcb->asoc.streamincnt)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; } if ((send_out) && - (strrst->srs_stream_list[i] > stcb->asoc.streamoutcnt)) { + (strrst->srs_stream_list[i] >= stcb->asoc.streamoutcnt)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; From owner-svn-src-all@freebsd.org Sat May 4 09:18:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F6B41587AD5; Sat, 4 May 2019 09:18:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B59E780A22; Sat, 4 May 2019 09:18:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9825E643E; Sat, 4 May 2019 09:18:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x449IJnP070998; Sat, 4 May 2019 09:18:19 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x449IJaC070997; Sat, 4 May 2019 09:18:19 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905040918.x449IJaC070997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 09:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347085 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347085 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B59E780A22 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 09:18:20 -0000 Author: tuexen Date: Sat May 4 09:18:19 2019 New Revision: 347085 URL: https://svnweb.freebsd.org/changeset/base/347085 Log: MFC r343770: Only reduce the PMTU after the send call. The only way to increase it, is via PMTUD. This fixes an MTU issue reported by Timo Voelker. Modified: stable/12/sys/netinet/sctp_output.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_output.c ============================================================================== --- stable/12/sys/netinet/sctp_output.c Sat May 4 09:15:57 2019 (r347084) +++ stable/12/sys/netinet/sctp_output.c Sat May 4 09:18:19 2019 (r347085) @@ -4287,10 +4287,12 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, if (net->port) { mtu -= sizeof(struct udphdr); } - if ((stcb != NULL) && (stcb->asoc.smallest_mtu > mtu)) { - sctp_mtu_size_reset(inp, &stcb->asoc, mtu); + if (mtu < net->mtu) { + if ((stcb != NULL) && (stcb->asoc.smallest_mtu > mtu)) { + sctp_mtu_size_reset(inp, &stcb->asoc, mtu); + } + net->mtu = mtu; } - net->mtu = mtu; } } else if (ro->ro_rt == NULL) { /* route was freed */ @@ -4645,10 +4647,12 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, if (net->port) { mtu -= sizeof(struct udphdr); } - if ((stcb != NULL) && (stcb->asoc.smallest_mtu > mtu)) { - sctp_mtu_size_reset(inp, &stcb->asoc, mtu); + if (mtu < net->mtu) { + if ((stcb != NULL) && (stcb->asoc.smallest_mtu > mtu)) { + sctp_mtu_size_reset(inp, &stcb->asoc, mtu); + } + net->mtu = mtu; } - net->mtu = mtu; } } else if (ifp) { if (ND_IFINFO(ifp)->linkmtu && From owner-svn-src-all@freebsd.org Sat May 4 09:25:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C4DA1587FBF; Sat, 4 May 2019 09:25:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1FC8181170; Sat, 4 May 2019 09:25:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB3D665F5; Sat, 4 May 2019 09:25:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x449PWJV076534; Sat, 4 May 2019 09:25:32 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x449PWlQ076533; Sat, 4 May 2019 09:25:32 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905040925.x449PWlQ076533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 09:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347086 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347086 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1FC8181170 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 09:25:33 -0000 Author: tuexen Date: Sat May 4 09:25:32 2019 New Revision: 347086 URL: https://svnweb.freebsd.org/changeset/base/347086 Log: MFC r343951: Fix locking for IPPROTO_SCTP level SCTP_DEFAULT_PRINFO socket option. This problem occurred when calling setsockopt() will invalid parameters. This issue was found by running syzkaller. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 09:18:19 2019 (r347085) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 09:25:32 2019 (r347086) @@ -6209,6 +6209,9 @@ sctp_setopt(struct socket *so, int optname, void *optv SCTP_FIND_STCB(inp, stcb, info->pr_assoc_id); if (info->pr_policy > SCTP_PR_SCTP_MAX) { + if (stcb) { + SCTP_TCB_UNLOCK(stcb); + } SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; break; From owner-svn-src-all@freebsd.org Sat May 4 09:28:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7822D158805B; Sat, 4 May 2019 09:28:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1FCAC812CD; Sat, 4 May 2019 09:28:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E850965F6; Sat, 4 May 2019 09:28:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x449SBSl076709; Sat, 4 May 2019 09:28:11 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x449SBhD076708; Sat, 4 May 2019 09:28:11 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905040928.x449SBhD076708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 09:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347087 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347087 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1FCAC812CD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 09:28:12 -0000 Author: tuexen Date: Sat May 4 09:28:11 2019 New Revision: 347087 URL: https://svnweb.freebsd.org/changeset/base/347087 Log: MFC r343954: Fix a locking bug in the IPPROTO_SCTP level SCTP_EVENT socket option. This occurs when call setsockopt() with invalid parameters. This issue was found by syzkaller. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 09:25:32 2019 (r347086) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 09:28:11 2019 (r347087) @@ -6115,6 +6115,10 @@ sctp_setopt(struct socket *so, int optname, void *optv SCTP_INP_RUNLOCK(inp); } } + } else { + if (stcb) { + SCTP_TCB_UNLOCK(stcb); + } } break; } From owner-svn-src-all@freebsd.org Sat May 4 09:30:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DED01588135; Sat, 4 May 2019 09:30:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C89308144A; Sat, 4 May 2019 09:30:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C54F65FA; Sat, 4 May 2019 09:30:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x449U3b6076866; Sat, 4 May 2019 09:30:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x449U39k076865; Sat, 4 May 2019 09:30:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905040930.x449U39k076865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 4 May 2019 09:30:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347088 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 347088 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C89308144A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 09:30:04 -0000 Author: hselasky Date: Sat May 4 09:30:03 2019 New Revision: 347088 URL: https://svnweb.freebsd.org/changeset/base/347088 Log: Fix regression issue after r346645 in the LinuxKPI. Properly handle error case when mapping DMA address fails. Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Sat May 4 09:28:11 2019 (r347087) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Sat May 4 09:30:03 2019 (r347088) @@ -480,10 +480,15 @@ linux_dma_alloc_coherent(struct device *dev, size_t si align = PAGE_SIZE << get_order(size); mem = (void *)kmem_alloc_contig(size, flag, 0, high, align, 0, VM_MEMATTR_DEFAULT); - if (mem) + if (mem != NULL) { *dma_handle = linux_dma_map_phys(dev, vtophys(mem), size); - else + if (*dma_handle == 0) { + kmem_free((vm_offset_t)mem, size); + mem = NULL; + } + } else { *dma_handle = 0; + } return (mem); } From owner-svn-src-all@freebsd.org Sat May 4 09:47:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 147911588637; Sat, 4 May 2019 09:47:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC7E281DB7; Sat, 4 May 2019 09:47:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 852DE6976; Sat, 4 May 2019 09:47:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x449l2A8087037; Sat, 4 May 2019 09:47:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x449l1j9087033; Sat, 4 May 2019 09:47:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905040947.x449l1j9087033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 4 May 2019 09:47:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347089 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys X-SVN-Commit-Revision: 347089 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AC7E281DB7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 09:47:03 -0000 Author: hselasky Date: Sat May 4 09:47:01 2019 New Revision: 347089 URL: https://svnweb.freebsd.org/changeset/base/347089 Log: Fix regression issue after r346645 in the LinuxKPI. The S/G list must be mapped AS-IS without any optimisations. This also implies that sg_dma_len() must be equal to sg->length. Many Linux drivers assume this and this fixes some DRM issues. Put the BUS DMA map pointer into the scatter-gather list to allow multiple mappings on the same physical memory address. The FreeBSD version has been bumped to force recompilation of external kernel modules. Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/scatterlist.h head/sys/compat/linuxkpi/common/src/linux_pci.c head/sys/sys/param.h Modified: head/sys/compat/linuxkpi/common/include/linux/scatterlist.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/scatterlist.h Sat May 4 09:30:03 2019 (r347088) +++ head/sys/compat/linuxkpi/common/include/linux/scatterlist.h Sat May 4 09:47:01 2019 (r347089) @@ -36,6 +36,7 @@ #include #include +struct bus_dmamap; struct scatterlist { unsigned long page_link; #define SG_PAGE_LINK_CHAIN 0x1UL @@ -44,7 +45,7 @@ struct scatterlist { unsigned int offset; unsigned int length; dma_addr_t dma_address; - unsigned int dma_length; + struct bus_dmamap *dma_map; /* FreeBSD specific */ }; CTASSERT((sizeof(struct scatterlist) & SG_PAGE_LINK_MASK) == 0); @@ -79,7 +80,7 @@ struct sg_page_iter { ((struct scatterlist *) ((sg)->page_link & ~SG_PAGE_LINK_MASK)) #define sg_dma_address(sg) (sg)->dma_address -#define sg_dma_len(sg) (sg)->dma_length +#define sg_dma_len(sg) (sg)->length #define for_each_sg_page(sgl, iter, nents, pgoffset) \ for (_sg_iter_init(sgl, iter, nents, pgoffset); \ Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Sat May 4 09:30:03 2019 (r347088) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Sat May 4 09:47:01 2019 (r347089) @@ -562,70 +562,39 @@ linux_dma_map_sg_attrs(struct device *dev, struct scat enum dma_data_direction dir, struct dma_attrs *attrs) { struct linux_dma_priv *priv; - struct linux_dma_obj *obj; - struct scatterlist *dma_sg, *sg; - int dma_nents, error, nseg; - size_t seg_len; - vm_paddr_t seg_phys, prev_phys_end; + struct scatterlist *sg; + int i, nseg; bus_dma_segment_t seg; priv = dev->dma_priv; - obj = uma_zalloc(linux_dma_obj_zone, 0); - DMA_PRIV_LOCK(priv); - if (bus_dmamap_create(priv->dmat, 0, &obj->dmamap) != 0) { + + /* create common DMA map in the first S/G entry */ + if (bus_dmamap_create(priv->dmat, 0, &sgl->dma_map) != 0) { DMA_PRIV_UNLOCK(priv); - uma_zfree(linux_dma_obj_zone, obj); return (0); } - sg = sgl; - dma_sg = sg; - dma_nents = 0; - - while (nents > 0) { - seg_phys = sg_phys(sg); - seg_len = sg->length; - while (--nents > 0) { - prev_phys_end = sg_phys(sg) + sg->length; - sg = sg_next(sg); - if (prev_phys_end != sg_phys(sg)) - break; - seg_len += sg->length; - } - + /* load all S/G list entries */ + for_each_sg(sgl, sg, nents, i) { nseg = -1; - if (_bus_dmamap_load_phys(priv->dmat, obj->dmamap, - seg_phys, seg_len, BUS_DMA_NOWAIT, + if (_bus_dmamap_load_phys(priv->dmat, sgl->dma_map, + sg_phys(sg), sg->length, BUS_DMA_NOWAIT, &seg, &nseg) != 0) { - bus_dmamap_unload(priv->dmat, obj->dmamap); - bus_dmamap_destroy(priv->dmat, obj->dmamap); + bus_dmamap_unload(priv->dmat, sgl->dma_map); + bus_dmamap_destroy(priv->dmat, sgl->dma_map); DMA_PRIV_UNLOCK(priv); - uma_zfree(linux_dma_obj_zone, obj); return (0); } - KASSERT(++nseg == 1, ("More than one segment (nseg=%d)", nseg)); + KASSERT(nseg == 0, + ("More than one segment (nseg=%d)", nseg + 1)); - sg_dma_address(dma_sg) = seg.ds_addr; - sg_dma_len(dma_sg) = seg.ds_len; - - dma_sg = sg_next(dma_sg); - dma_nents++; - } - - obj->dma_addr = sg_dma_address(sgl); - - error = LINUX_DMA_PCTRIE_INSERT(&priv->ptree, obj); - if (error != 0) { - bus_dmamap_unload(priv->dmat, obj->dmamap); - bus_dmamap_destroy(priv->dmat, obj->dmamap); - DMA_PRIV_UNLOCK(priv); - uma_zfree(linux_dma_obj_zone, obj); - return (0); + sg_dma_address(sg) = seg.ds_addr; } DMA_PRIV_UNLOCK(priv); - return (dma_nents); + + return (nents); } void @@ -633,22 +602,13 @@ linux_dma_unmap_sg_attrs(struct device *dev, struct sc int nents, enum dma_data_direction dir, struct dma_attrs *attrs) { struct linux_dma_priv *priv; - struct linux_dma_obj *obj; priv = dev->dma_priv; DMA_PRIV_LOCK(priv); - obj = LINUX_DMA_PCTRIE_LOOKUP(&priv->ptree, sg_dma_address(sgl)); - if (obj == NULL) { - DMA_PRIV_UNLOCK(priv); - return; - } - LINUX_DMA_PCTRIE_REMOVE(&priv->ptree, sg_dma_address(sgl)); - bus_dmamap_unload(priv->dmat, obj->dmamap); - bus_dmamap_destroy(priv->dmat, obj->dmamap); + bus_dmamap_unload(priv->dmat, sgl->dma_map); + bus_dmamap_destroy(priv->dmat, sgl->dma_map); DMA_PRIV_UNLOCK(priv); - - uma_zfree(linux_dma_obj_zone, obj); } struct dma_pool { Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat May 4 09:30:03 2019 (r347088) +++ head/sys/sys/param.h Sat May 4 09:47:01 2019 (r347089) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300021 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300022 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Sat May 4 10:04:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2687E1588C6E; Sat, 4 May 2019 10:04:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC05A827A3; Sat, 4 May 2019 10:04:00 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93E1A6CF2; Sat, 4 May 2019 10:04:00 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44A40vu097624; Sat, 4 May 2019 10:04:00 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44A40IA097623; Sat, 4 May 2019 10:04:00 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041004.x44A40IA097623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 10:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347090 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347090 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BC05A827A3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 10:04:01 -0000 Author: tuexen Date: Sat May 4 10:04:00 2019 New Revision: 347090 URL: https://svnweb.freebsd.org/changeset/base/347090 Log: MFC r340179: Don't use a function when neither INET nor INET6 are defined. This is a valid case for the userland stack, where this fixes two set-but-not-used warnings in this case. Thanks to Christian Wright for reporting the issue. Modified: stable/12/sys/netinet/sctp_output.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_output.c ============================================================================== --- stable/12/sys/netinet/sctp_output.c Sat May 4 09:47:01 2019 (r347089) +++ stable/12/sys/netinet/sctp_output.c Sat May 4 10:04:00 2019 (r347090) @@ -3733,6 +3733,7 @@ sctp_process_cmsgs_for_init(struct sctp_tcb *stcb, str return (0); } +#if defined(INET) || defined(INET6) static struct sctp_tcb * sctp_findassociation_cmsgs(struct sctp_inpcb **inp_p, uint16_t port, @@ -3822,6 +3823,7 @@ sctp_findassociation_cmsgs(struct sctp_inpcb **inp_p, } return (NULL); } +#endif static struct mbuf * sctp_add_cookie(struct mbuf *init, int init_offset, @@ -12703,9 +12705,11 @@ sctp_lower_sosend(struct socket *so, SCTP_INP_WUNLOCK(inp); /* With the lock applied look again */ stcb = sctp_findassociation_ep_addr(&t_inp, addr, &net, NULL, NULL); +#if defined(INET) || defined(INET6) if ((stcb == NULL) && (control != NULL) && (port > 0)) { stcb = sctp_findassociation_cmsgs(&t_inp, port, control, &net, &error); } +#endif if (stcb == NULL) { SCTP_INP_WLOCK(inp); SCTP_INP_DECR_REF(inp); From owner-svn-src-all@freebsd.org Sat May 4 10:06:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6A201588D37; Sat, 4 May 2019 10:06:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C75E828E1; Sat, 4 May 2019 10:06:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ED826CF3; Sat, 4 May 2019 10:06:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44A6Ioa097779; Sat, 4 May 2019 10:06:18 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44A6Inw097778; Sat, 4 May 2019 10:06:18 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041006.x44A6Inw097778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 10:06:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347091 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347091 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C75E828E1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 10:06:18 -0000 Author: tuexen Date: Sat May 4 10:06:17 2019 New Revision: 347091 URL: https://svnweb.freebsd.org/changeset/base/347091 Log: MFC r343960: Fix a locking issue in the IPPROTO_SCTP level SCTP_PEER_ADDR_THLDS socket option. The problem affects only setsockopt with invalid parameters. This issue was found by syzkaller. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 10:04:00 2019 (r347090) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 10:06:17 2019 (r347091) @@ -6335,6 +6335,9 @@ sctp_setopt(struct socket *so, int optname, void *optv } } if (thlds->spt_pathcpthld != 0xffff) { + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); + } error = EINVAL; SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); break; From owner-svn-src-all@freebsd.org Sat May 4 10:09:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60F9D1588EE2; Sat, 4 May 2019 10:09:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01A7D82AF7; Sat, 4 May 2019 10:09:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEFD16CF6; Sat, 4 May 2019 10:09:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44A9PET097954; Sat, 4 May 2019 10:09:25 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44A9PL7097953; Sat, 4 May 2019 10:09:25 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041009.x44A9PL7097953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 10:09:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347092 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347092 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 01A7D82AF7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 10:09:26 -0000 Author: tuexen Date: Sat May 4 10:09:25 2019 New Revision: 347092 URL: https://svnweb.freebsd.org/changeset/base/347092 Log: MFC r343961: Fix a locking issue when reporing outbound messages. Modified: stable/12/sys/netinet/sctputil.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctputil.c ============================================================================== --- stable/12/sys/netinet/sctputil.c Sat May 4 10:06:17 2019 (r347091) +++ stable/12/sys/netinet/sctputil.c Sat May 4 10:09:25 2019 (r347092) @@ -3946,7 +3946,7 @@ sctp_report_all_outbound(struct sctp_tcb *stcb, uint16 TAILQ_FOREACH_SAFE(sp, &outs->outqueue, next, nsp) { atomic_subtract_int(&asoc->stream_queue_cnt, 1); TAILQ_REMOVE(&outs->outqueue, sp, next); - stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, outs, sp, holds_lock); + stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, outs, sp, 1); sctp_free_spbufspace(stcb, asoc, sp); if (sp->data) { sctp_ulp_notify(SCTP_NOTIFY_SPECIAL_SP_FAIL, stcb, From owner-svn-src-all@freebsd.org Sat May 4 10:13:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A93D91589296; Sat, 4 May 2019 10:13:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DD8682FB3; Sat, 4 May 2019 10:13:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 281D76E9B; Sat, 4 May 2019 10:13:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44ADcKn003066; Sat, 4 May 2019 10:13:38 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44ADc79003065; Sat, 4 May 2019 10:13:38 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041013.x44ADc79003065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 10:13:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347093 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347093 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4DD8682FB3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 10:13:39 -0000 Author: tuexen Date: Sat May 4 10:13:37 2019 New Revision: 347093 URL: https://svnweb.freebsd.org/changeset/base/347093 Log: MFC r344048: Improve input validation for raw IPv4 socket using the IP_HDRINCL option. This issue was found by running syzkaller on OpenBSD. Greg Steuck made me aware that the problem might also exist on FreeBSD. Reported by: Greg Steuck Differential Revision: https://reviews.freebsd.org/D18834 Modified: stable/12/sys/netinet/raw_ip.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/raw_ip.c ============================================================================== --- stable/12/sys/netinet/raw_ip.c Sat May 4 10:09:25 2019 (r347092) +++ stable/12/sys/netinet/raw_ip.c Sat May 4 10:13:37 2019 (r347093) @@ -454,6 +454,8 @@ rip_output(struct mbuf *m, struct socket *so, ...) u_long dst; int flags = ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0) | IP_ALLOWBROADCAST; + int cnt; + u_char opttype, optlen, *cp; va_start(ap, so); dst = va_arg(ap, u_long); @@ -527,6 +529,34 @@ rip_output(struct mbuf *m, struct socket *so, ...) INP_RUNLOCK(inp); m_freem(m); return (EINVAL); + } + /* + * Don't allow IP options which do not have the required + * structure as specified in section 3.1 of RFC 791 on + * pages 15-23. + */ + cp = (u_char *)(ip + 1); + cnt = (ip->ip_hl << 2) - sizeof (struct ip); + for (; cnt > 0; cnt -= optlen, cp += optlen) { + opttype = cp[IPOPT_OPTVAL]; + if (opttype == IPOPT_EOL) + break; + if (opttype == IPOPT_NOP) { + optlen = 1; + continue; + } + if (cnt < IPOPT_OLEN + sizeof(u_char)) { + INP_RUNLOCK(inp); + m_freem(m); + return (EINVAL); + } + optlen = cp[IPOPT_OLEN]; + if (optlen < IPOPT_OLEN + sizeof(u_char) || + optlen > cnt) { + INP_RUNLOCK(inp); + m_freem(m); + return (EINVAL); + } } /* * This doesn't allow application to specify ID of zero, From owner-svn-src-all@freebsd.org Sat May 4 10:33:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DE9D15898CF; Sat, 4 May 2019 10:33:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6E1083961; Sat, 4 May 2019 10:33:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F47B71F6; Sat, 4 May 2019 10:33:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44AXVft013530; Sat, 4 May 2019 10:33:31 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44AXVFG013529; Sat, 4 May 2019 10:33:31 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041033.x44AXVFG013529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 10:33:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347094 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A6E1083961 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 10:33:32 -0000 Author: tuexen Date: Sat May 4 10:33:31 2019 New Revision: 347094 URL: https://svnweb.freebsd.org/changeset/base/347094 Log: MFC r344148: Fix a byte ordering issue for the advertised receiver window in ACK segments sent in TIMEWAIT state, which I introduced in r336937. Sponsored by: Netflix, Inc. Modified: stable/12/sys/netinet/tcp_timewait.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_timewait.c ============================================================================== --- stable/12/sys/netinet/tcp_timewait.c Sat May 4 10:13:37 2019 (r347093) +++ stable/12/sys/netinet/tcp_timewait.c Sat May 4 10:33:31 2019 (r347094) @@ -302,7 +302,7 @@ tcp_twstart(struct tcpcb *tp) if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) && recwin < (tp->rcv_adv - tp->rcv_nxt)) recwin = (tp->rcv_adv - tp->rcv_nxt); - tw->last_win = htons((u_short)(recwin >> tp->rcv_scale)); + tw->last_win = (u_short)(recwin >> tp->rcv_scale); /* * Set t_recent if timestamps are used on the connection. From owner-svn-src-all@freebsd.org Sat May 4 10:36:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1387F1589970; Sat, 4 May 2019 10:36:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC66783A94; Sat, 4 May 2019 10:36:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 944BF71F7; Sat, 4 May 2019 10:36:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44AaHvC013708; Sat, 4 May 2019 10:36:17 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44AaGrU013705; Sat, 4 May 2019 10:36:16 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041036.x44AaGrU013705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 10:36:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347095 - in stable/12/sys/netinet: . tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 347095 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AC66783A94 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 10:36:18 -0000 Author: tuexen Date: Sat May 4 10:36:16 2019 New Revision: 347095 URL: https://svnweb.freebsd.org/changeset/base/347095 Log: MFC r344367: Use exponential backoff for retransmitting SYN segments as specified in the TCP RFCs. Reviewed by: rrs@, Richard Scheffenegger Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D18974 Modified: stable/12/sys/netinet/tcp_stacks/rack.c stable/12/sys/netinet/tcp_syncache.c stable/12/sys/netinet/tcp_timer.c stable/12/sys/netinet/tcp_timer.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Sat May 4 10:33:31 2019 (r347094) +++ stable/12/sys/netinet/tcp_stacks/rack.c Sat May 4 10:36:16 2019 (r347095) @@ -2882,7 +2882,7 @@ rack_timeout_rxt(struct tcpcb *tp, struct tcp_rack *ra TCPSTAT_INC(tcps_rexmttimeo); if ((tp->t_state == TCPS_SYN_SENT) || (tp->t_state == TCPS_SYN_RECEIVED)) - rexmt = MSEC_2_TICKS(RACK_INITIAL_RTO * tcp_syn_backoff[tp->t_rxtshift]); + rexmt = MSEC_2_TICKS(RACK_INITIAL_RTO * tcp_backoff[tp->t_rxtshift]); else rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift]; TCPT_RANGESET(tp->t_rxtcur, rexmt, Modified: stable/12/sys/netinet/tcp_syncache.c ============================================================================== --- stable/12/sys/netinet/tcp_syncache.c Sat May 4 10:33:31 2019 (r347094) +++ stable/12/sys/netinet/tcp_syncache.c Sat May 4 10:36:16 2019 (r347095) @@ -155,11 +155,11 @@ static int syncookie_cmp(struct in_conninfo *inc, str /* * Transmit the SYN,ACK fewer times than TCP_MAXRXTSHIFT specifies. * 3 retransmits corresponds to a timeout with default values of - * TCPTV_RTOBASE * ( 1 + - * tcp_syn_backoff[1] + - * tcp_syn_backoff[2] + - * tcp_syn_backoff[3]) + 3 * tcp_rexmit_slop, - * 3000 ms * (1 + 1 + 1 + 1) + 3 * 200 ms = 12600 ms, + * TCPTV_RTOBASE * ( 1 + + * tcp_backoff[1] + + * tcp_backoff[2] + + * tcp_backoff[3]) + 3 * tcp_rexmit_slop, + * 3000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms = 45600 ms, * the odds are that the user has given up attempting to connect by then. */ #define SYNCACHE_MAXREXMTS 3 @@ -426,7 +426,7 @@ syncache_timeout(struct syncache *sc, struct syncache_ if (sc->sc_rxmits == 0) rexmt = TCPTV_RTOBASE; else - TCPT_RANGESET(rexmt, TCPTV_RTOBASE * tcp_syn_backoff[sc->sc_rxmits], + TCPT_RANGESET(rexmt, TCPTV_RTOBASE * tcp_backoff[sc->sc_rxmits], tcp_rexmit_min, TCPTV_REXMTMAX); sc->sc_rxttime = ticks + rexmt; sc->sc_rxmits++; Modified: stable/12/sys/netinet/tcp_timer.c ============================================================================== --- stable/12/sys/netinet/tcp_timer.c Sat May 4 10:33:31 2019 (r347094) +++ stable/12/sys/netinet/tcp_timer.c Sat May 4 10:36:16 2019 (r347095) @@ -233,9 +233,6 @@ tcp_slowtimo(void) VNET_LIST_RUNLOCK_NOSLEEP(); } -int tcp_syn_backoff[TCP_MAXRXTSHIFT + 1] = - { 1, 1, 1, 1, 1, 2, 4, 8, 16, 32, 64, 64, 64 }; - int tcp_backoff[TCP_MAXRXTSHIFT + 1] = { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 512, 512, 512 }; @@ -671,7 +668,7 @@ tcp_timer_rexmt(void * xtp) TCPSTAT_INC(tcps_rexmttimeo); if ((tp->t_state == TCPS_SYN_SENT) || (tp->t_state == TCPS_SYN_RECEIVED)) - rexmt = TCPTV_RTOBASE * tcp_syn_backoff[tp->t_rxtshift]; + rexmt = TCPTV_RTOBASE * tcp_backoff[tp->t_rxtshift]; else rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift]; TCPT_RANGESET(tp->t_rxtcur, rexmt, Modified: stable/12/sys/netinet/tcp_timer.h ============================================================================== --- stable/12/sys/netinet/tcp_timer.h Sat May 4 10:33:31 2019 (r347094) +++ stable/12/sys/netinet/tcp_timer.h Sat May 4 10:36:16 2019 (r347095) @@ -199,7 +199,6 @@ extern int tcp_rexmit_slop; extern int tcp_msl; extern int tcp_ttl; /* time to live for TCP segs */ extern int tcp_backoff[]; -extern int tcp_syn_backoff[]; extern int tcp_totbackoff; extern int tcp_rexmit_drop_options; From owner-svn-src-all@freebsd.org Sat May 4 10:38:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C89EC1589A25; Sat, 4 May 2019 10:38:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6ABC583C1A; Sat, 4 May 2019 10:38:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F73771F9; Sat, 4 May 2019 10:38:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44ActCG013869; Sat, 4 May 2019 10:38:55 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44AcsW9013867; Sat, 4 May 2019 10:38:54 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041038.x44AcsW9013867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 10:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347096 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347096 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6ABC583C1A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 10:38:56 -0000 Author: tuexen Date: Sat May 4 10:38:54 2019 New Revision: 347096 URL: https://svnweb.freebsd.org/changeset/base/347096 Log: MFC r344368: Reduce the TCP initial retransmission timeout from 3 seconds to 1 second as allowed by RFC 6298. Reviewed by: kbowling@, Richard Scheffenegger Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D18941 Modified: stable/12/sys/netinet/tcp_syncache.c stable/12/sys/netinet/tcp_timer.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_syncache.c ============================================================================== --- stable/12/sys/netinet/tcp_syncache.c Sat May 4 10:36:16 2019 (r347095) +++ stable/12/sys/netinet/tcp_syncache.c Sat May 4 10:38:54 2019 (r347096) @@ -159,7 +159,7 @@ static int syncookie_cmp(struct in_conninfo *inc, str * tcp_backoff[1] + * tcp_backoff[2] + * tcp_backoff[3]) + 3 * tcp_rexmit_slop, - * 3000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms = 45600 ms, + * 1000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms = 15600 ms, * the odds are that the user has given up attempting to connect by then. */ #define SYNCACHE_MAXREXMTS 3 Modified: stable/12/sys/netinet/tcp_timer.h ============================================================================== --- stable/12/sys/netinet/tcp_timer.h Sat May 4 10:36:16 2019 (r347095) +++ stable/12/sys/netinet/tcp_timer.h Sat May 4 10:38:54 2019 (r347096) @@ -77,7 +77,7 @@ #define TCPTV_MSL ( 30*hz) /* max seg lifetime (hah!) */ #define TCPTV_SRTTBASE 0 /* base roundtrip time; if 0, no idea yet */ -#define TCPTV_RTOBASE ( 3*hz) /* assumed RTO if no info */ +#define TCPTV_RTOBASE ( 1*hz) /* assumed RTO if no info */ #define TCPTV_PERSMIN ( 5*hz) /* minimum persist interval */ #define TCPTV_PERSMAX ( 60*hz) /* maximum persist interval */ From owner-svn-src-all@freebsd.org Sat May 4 10:48:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB80B1589CAC; Sat, 4 May 2019 10:48:45 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82DA984046; Sat, 4 May 2019 10:48:45 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BA46739B; Sat, 4 May 2019 10:48:45 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44Amjsn019343; Sat, 4 May 2019 10:48:45 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44AmjMd019342; Sat, 4 May 2019 10:48:45 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201905041048.x44AmjMd019342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Sat, 4 May 2019 10:48:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347097 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: ganbold X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 347097 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 82DA984046 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 10:48:46 -0000 Author: ganbold Date: Sat May 4 10:48:44 2019 New Revision: 347097 URL: https://svnweb.freebsd.org/changeset/base/347097 Log: Add emmc clock definitions for Rockchip RK3399 SoC. Modified: head/sys/arm64/rockchip/clk/rk3399_cru.c Modified: head/sys/arm64/rockchip/clk/rk3399_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk3399_cru.c Sat May 4 10:38:54 2019 (r347096) +++ head/sys/arm64/rockchip/clk/rk3399_cru.c Sat May 4 10:48:44 2019 (r347097) @@ -52,6 +52,9 @@ __FBSDID("$FreeBSD$"); /* GATES */ +#define ACLK_EMMC_CORE 241 +#define ACLK_EMMC_NOC 242 +#define ACLK_EMMC_GRF 243 #define PCLK_GPIO2 336 #define PCLK_GPIO3 337 #define PCLK_GPIO4 338 @@ -80,6 +83,10 @@ static struct rk_cru_gate rk3399_gates[] = { CRU_GATE(0, "cpll_aclk_perihp_src", "cpll", 0x314, 0) CRU_GATE(0, "gpll_aclk_perihp_src", "gpll", 0x314, 1) + /* CRU_CLKGATE_CON6 */ + CRU_GATE(0, "gpll_aclk_emmc_src", "gpll", 0x318, 12) + CRU_GATE(0, "cpll_aclk_emmc_src", "cpll", 0x318, 13) + /* CRU_CLKGATE_CON7 */ CRU_GATE(0, "gpll_aclk_perilp0_src", "gpll", 0x31C, 0) CRU_GATE(0, "cpll_aclk_perilp0_src", "cpll", 0x31C, 1) @@ -101,6 +108,11 @@ static struct rk_cru_gate rk3399_gates[] = { CRU_GATE(PCLK_GPIO3, "pclk_gpio3", "pclk_alive", 0x37c, 4) CRU_GATE(PCLK_GPIO4, "pclk_gpio4", "pclk_alive", 0x37c, 5) + /* CRU_CLKGATE_CON32 */ + CRU_GATE(ACLK_EMMC_CORE, "aclk_emmccore", "aclk_emmc", 0x380, 8) + CRU_GATE(ACLK_EMMC_NOC, "aclk_emmc_noc", "aclk_emmc", 0x380, 9) + CRU_GATE(ACLK_EMMC_GRF, "aclk_emmcgrf", "aclk_emmc", 0x380, 10) + /* CRU_CLKGATE_CON33 */ CRU_GATE(HCLK_SDMMC, "hclk_sdmmc", "hclk_sd", 0x384, 8) }; @@ -1443,6 +1455,60 @@ static struct rk_clk_composite_def sclk_sdmmc = { .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, }; +/* + * emmc + */ + +#define SCLK_EMMC 78 + +static const char *sclk_emmc_parents[] = {"cpll", "gpll", "npll"}; + +static struct rk_clk_composite_def sclk_emmc = { + .clkdef = { + .id = SCLK_EMMC, + .name = "sclk_emmc", + .parent_names = sclk_emmc_parents, + .parent_cnt = nitems(sclk_emmc_parents), + }, + + .muxdiv_offset = 0x158, + .mux_shift = 8, + .mux_width = 3, + + .div_shift = 0, + .div_width = 7, + + .gate_offset = 0x318, + .gate_shift = 14, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, +}; + +#define ACLK_EMMC 240 + +static const char *aclk_emmc_parents[] = { + "cpll_aclk_emmc_src", + "gpll_aclk_emmc_src" +}; + +static struct rk_clk_composite_def aclk_emmc = { + .clkdef = { + .id = ACLK_EMMC, + .name = "aclk_emmc", + .parent_names = aclk_emmc_parents, + .parent_cnt = nitems(aclk_emmc_parents), + }, + + .muxdiv_offset = 0x154, + .mux_shift = 7, + .mux_width = 1, + + .div_shift = 0, + .div_width = 5, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX, +}; + static struct rk_clk rk3399_clks[] = { { .type = RK3399_CLK_PLL, @@ -1550,6 +1616,15 @@ static struct rk_clk rk3399_clks[] = { { .type = RK_CLK_COMPOSITE, .clk.composite = &sclk_sdmmc, + }, + + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &sclk_emmc, + }, + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &aclk_emmc, }, }; From owner-svn-src-all@freebsd.org Sat May 4 10:56:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A42741589FB6; Sat, 4 May 2019 10:56:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32A11844F9; Sat, 4 May 2019 10:56:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3512F753C; Sat, 4 May 2019 10:56:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44AuwD8024510; Sat, 4 May 2019 10:56:58 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44AuwVG024509; Sat, 4 May 2019 10:56:58 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041056.x44AuwVG024509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 10:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347098 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347098 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 32A11844F9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 10:56:59 -0000 Author: tuexen Date: Sat May 4 10:56:57 2019 New Revision: 347098 URL: https://svnweb.freebsd.org/changeset/base/347098 Log: MFC r344704: Improve consistency, no functional change. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 10:48:44 2019 (r347097) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 10:56:57 2019 (r347098) @@ -1128,10 +1128,10 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, actual += sizeof(struct sockaddr_in6); } else { #endif - memcpy(sas, sin, sizeof(*sin)); + memcpy(sas, sin, sizeof(struct sockaddr_in)); ((struct sockaddr_in *)sas)->sin_port = inp->sctp_lport; - sas = (struct sockaddr_storage *)((caddr_t)sas + sizeof(*sin)); - actual += sizeof(*sin); + sas = (struct sockaddr_storage *)((caddr_t)sas + sizeof(struct sockaddr_in)); + actual += sizeof(struct sockaddr_in); #ifdef INET6 } #endif @@ -1182,10 +1182,10 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))) { continue; } - memcpy(sas, sin6, sizeof(*sin6)); + memcpy(sas, sin6, sizeof(struct sockaddr_in6)); ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport; - sas = (struct sockaddr_storage *)((caddr_t)sas + sizeof(*sin6)); - actual += sizeof(*sin6); + sas = (struct sockaddr_storage *)((caddr_t)sas + sizeof(struct sockaddr_in6)); + actual += sizeof(struct sockaddr_in6); if (actual >= limit) { return (actual); } From owner-svn-src-all@freebsd.org Sat May 4 10:59:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DAE1158A080; Sat, 4 May 2019 10:59:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B306584668; Sat, 4 May 2019 10:59:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87B547540; Sat, 4 May 2019 10:59:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44AxDbw024662; Sat, 4 May 2019 10:59:13 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44AxDS0024661; Sat, 4 May 2019 10:59:13 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041059.x44AxDS0024661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 10:59:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347099 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347099 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B306584668 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 10:59:14 -0000 Author: tuexen Date: Sat May 4 10:59:13 2019 New Revision: 347099 URL: https://svnweb.freebsd.org/changeset/base/347099 Log: MFC r344708: Honor the memory limits provided when processing the IPPROTO_SCTP level socket option SCTP_GET_LOCAL_ADDRESSES in a getsockopt() call. Thanks to Thomas Barabosch for reporting the issue which was found by running syzkaller. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 10:56:57 2019 (r347098) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 10:59:13 2019 (r347099) @@ -1122,12 +1122,18 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, } #ifdef INET6 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) { + if (actual + sizeof(struct sockaddr_in6) > limit) { + return (actual); + } in6_sin_2_v4mapsin6(sin, (struct sockaddr_in6 *)sas); ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport; sas = (struct sockaddr_storage *)((caddr_t)sas + sizeof(struct sockaddr_in6)); actual += sizeof(struct sockaddr_in6); } else { #endif + if (actual + sizeof(struct sockaddr_in) > limit) { + return (actual); + } memcpy(sas, sin, sizeof(struct sockaddr_in)); ((struct sockaddr_in *)sas)->sin_port = inp->sctp_lport; sas = (struct sockaddr_storage *)((caddr_t)sas + sizeof(struct sockaddr_in)); @@ -1135,9 +1141,6 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, #ifdef INET6 } #endif - if (actual >= limit) { - return (actual); - } } else { continue; } @@ -1182,13 +1185,13 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))) { continue; } + if (actual + sizeof(struct sockaddr_in6) > limit) { + return (actual); + } memcpy(sas, sin6, sizeof(struct sockaddr_in6)); ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport; sas = (struct sockaddr_storage *)((caddr_t)sas + sizeof(struct sockaddr_in6)); actual += sizeof(struct sockaddr_in6); - if (actual >= limit) { - return (actual); - } } else { continue; } @@ -1202,6 +1205,7 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, } } else { struct sctp_laddr *laddr; + size_t sa_len; LIST_FOREACH(laddr, &inp->sctp_addr_list, sctp_nxt_addr) { if (stcb) { @@ -1209,6 +1213,10 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, continue; } } + sa_len = laddr->ifa->address.sa.sa_len; + if (actual + sa_len > limit) { + return (actual); + } if (sctp_fill_user_address(sas, &laddr->ifa->address.sa)) continue; switch (laddr->ifa->address.sa.sa_family) { @@ -1226,12 +1234,8 @@ sctp_fill_up_addresses_vrf(struct sctp_inpcb *inp, /* TSNH */ break; } - sas = (struct sockaddr_storage *)((caddr_t)sas + - laddr->ifa->address.sa.sa_len); - actual += laddr->ifa->address.sa.sa_len; - if (actual >= limit) { - return (actual); - } + sas = (struct sockaddr_storage *)((caddr_t)sas + sa_len); + actual += sa_len; } } return (actual); From owner-svn-src-all@freebsd.org Sat May 4 11:01:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25BF4158A18C; Sat, 4 May 2019 11:01:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0ED484863; Sat, 4 May 2019 11:01:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9924D758D; Sat, 4 May 2019 11:01:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44B1V9Q025786; Sat, 4 May 2019 11:01:31 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44B1VY9025785; Sat, 4 May 2019 11:01:31 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041101.x44B1VY9025785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 11:01:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347100 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347100 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C0ED484863 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:01:32 -0000 Author: tuexen Date: Sat May 4 11:01:31 2019 New Revision: 347100 URL: https://svnweb.freebsd.org/changeset/base/347100 Log: MFC r344721: Report the correct length when using the IPPROTO_SCTP level socket options SCTP_GET_PEER_ADDRESSES and SCTP_GET_LOCAL_ADDRESSES. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 10:59:13 2019 (r347099) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 11:01:31 2019 (r347100) @@ -2240,8 +2240,8 @@ flags_out: SCTP_FIND_STCB(inp, stcb, saddr->sget_assoc_id); if (stcb) { - left = (*optsize) - sizeof(struct sctp_getaddresses); - *optsize = sizeof(struct sctp_getaddresses); + left = (*optsize) - sizeof(sctp_assoc_t); + *optsize = sizeof(sctp_assoc_t); sas = (struct sockaddr_storage *)&saddr->addr[0]; TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { @@ -2315,7 +2315,7 @@ flags_out: if (stcb) { SCTP_TCB_UNLOCK(stcb); } - *optsize = sizeof(struct sockaddr_storage) + actual; + *optsize = sizeof(sctp_assoc_t) + actual; break; } case SCTP_PEER_ADDR_PARAMS: From owner-svn-src-all@freebsd.org Sat May 4 11:03:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2825158A40D; Sat, 4 May 2019 11:03:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 57DE784D39; Sat, 4 May 2019 11:03:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D77676FC; Sat, 4 May 2019 11:03:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44B3Bck029814; Sat, 4 May 2019 11:03:11 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44B3BVC029813; Sat, 4 May 2019 11:03:11 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041103.x44B3BVC029813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 11:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347101 - stable/12/lib/libc/net X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/lib/libc/net X-SVN-Commit-Revision: 347101 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 57DE784D39 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:03:11 -0000 Author: tuexen Date: Sat May 4 11:03:10 2019 New Revision: 347101 URL: https://svnweb.freebsd.org/changeset/base/347101 Log: MFC r344722: Use correct buffer sizes in sctp_get[lp]addrs(). Modified: stable/12/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/12/lib/libc/net/sctp_sys_calls.c Sat May 4 11:01:31 2019 (r347100) +++ stable/12/lib/libc/net/sctp_sys_calls.c Sat May 4 11:03:10 2019 (r347101) @@ -415,7 +415,7 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, struct sockadd return (-1); } /* size required is returned in 'asoc' */ - opt_len = (socklen_t) ((size_t)asoc + sizeof(struct sctp_getaddresses)); + opt_len = (socklen_t) ((size_t)asoc + sizeof(sctp_assoc_t)); addrs = calloc(1, (size_t)opt_len); if (addrs == NULL) { errno = ENOMEM; @@ -475,9 +475,7 @@ sctp_getladdrs(int sd, sctp_assoc_t id, struct sockadd errno = ENOTCONN; return (-1); } - opt_len = (socklen_t) (size_of_addresses + - sizeof(struct sockaddr_storage) + - sizeof(struct sctp_getaddresses)); + opt_len = (socklen_t) (size_of_addresses + sizeof(sctp_assoc_t)); addrs = calloc(1, (size_t)opt_len); if (addrs == NULL) { errno = ENOMEM; From owner-svn-src-all@freebsd.org Sat May 4 11:05:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3702B158A4BA; Sat, 4 May 2019 11:05:58 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D309D84E8C; Sat, 4 May 2019 11:05:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACEC37706; Sat, 4 May 2019 11:05:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44B5v8X029985; Sat, 4 May 2019 11:05:57 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44B5vD9029984; Sat, 4 May 2019 11:05:57 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041105.x44B5vD9029984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 11:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347102 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347102 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D309D84E8C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:05:58 -0000 Author: tuexen Date: Sat May 4 11:05:57 2019 New Revision: 347102 URL: https://svnweb.freebsd.org/changeset/base/347102 Log: MFC r344723: Handle the case when calling the IPPROTO_SCTP level socket option SCTP_STATUS on an association with no primary path (early state). This issue was found by running syzkaller. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 11:03:10 2019 (r347101) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 11:05:57 2019 (r347102) @@ -2644,42 +2644,47 @@ flags_out: sstat->sstat_instrms = stcb->asoc.streamincnt; sstat->sstat_outstrms = stcb->asoc.streamoutcnt; sstat->sstat_fragmentation_point = sctp_get_frag_point(stcb, &stcb->asoc); - memcpy(&sstat->sstat_primary.spinfo_address, - &stcb->asoc.primary_destination->ro._l_addr, - ((struct sockaddr *)(&stcb->asoc.primary_destination->ro._l_addr))->sa_len); net = stcb->asoc.primary_destination; - ((struct sockaddr_in *)&sstat->sstat_primary.spinfo_address)->sin_port = stcb->rport; - /* - * Again the user can get info from sctp_constants.h - * for what the state of the network is. - */ - if (net->dest_state & SCTP_ADDR_UNCONFIRMED) { - /* It's unconfirmed */ - sstat->sstat_primary.spinfo_state = SCTP_UNCONFIRMED; - } else if (net->dest_state & SCTP_ADDR_REACHABLE) { - /* It's active */ - sstat->sstat_primary.spinfo_state = SCTP_ACTIVE; - } else { - /* It's inactive */ - sstat->sstat_primary.spinfo_state = SCTP_INACTIVE; - } - sstat->sstat_primary.spinfo_cwnd = net->cwnd; - sstat->sstat_primary.spinfo_srtt = net->lastsa >> SCTP_RTT_SHIFT; - sstat->sstat_primary.spinfo_rto = net->RTO; - sstat->sstat_primary.spinfo_mtu = net->mtu; - switch (stcb->asoc.primary_destination->ro._l_addr.sa.sa_family) { + if (net != NULL) { + memcpy(&sstat->sstat_primary.spinfo_address, + &stcb->asoc.primary_destination->ro._l_addr, + ((struct sockaddr *)(&stcb->asoc.primary_destination->ro._l_addr))->sa_len); + ((struct sockaddr_in *)&sstat->sstat_primary.spinfo_address)->sin_port = stcb->rport; + /* + * Again the user can get info from + * sctp_constants.h for what the state of + * the network is. + */ + if (net->dest_state & SCTP_ADDR_UNCONFIRMED) { + /* It's unconfirmed */ + sstat->sstat_primary.spinfo_state = SCTP_UNCONFIRMED; + } else if (net->dest_state & SCTP_ADDR_REACHABLE) { + /* It's active */ + sstat->sstat_primary.spinfo_state = SCTP_ACTIVE; + } else { + /* It's inactive */ + sstat->sstat_primary.spinfo_state = SCTP_INACTIVE; + } + sstat->sstat_primary.spinfo_cwnd = net->cwnd; + sstat->sstat_primary.spinfo_srtt = net->lastsa >> SCTP_RTT_SHIFT; + sstat->sstat_primary.spinfo_rto = net->RTO; + sstat->sstat_primary.spinfo_mtu = net->mtu; + switch (stcb->asoc.primary_destination->ro._l_addr.sa.sa_family) { #if defined(INET) - case AF_INET: - sstat->sstat_primary.spinfo_mtu -= SCTP_MIN_V4_OVERHEAD; - break; + case AF_INET: + sstat->sstat_primary.spinfo_mtu -= SCTP_MIN_V4_OVERHEAD; + break; #endif #if defined(INET6) - case AF_INET6: - sstat->sstat_primary.spinfo_mtu -= SCTP_MIN_OVERHEAD; - break; + case AF_INET6: + sstat->sstat_primary.spinfo_mtu -= SCTP_MIN_OVERHEAD; + break; #endif - default: - break; + default: + break; + } + } else { + memset(&sstat->sstat_primary, 0, sizeof(struct sctp_paddrinfo)); } sstat->sstat_primary.spinfo_assoc_id = sctp_get_associd(stcb); SCTP_TCB_UNLOCK(stcb); From owner-svn-src-all@freebsd.org Sat May 4 11:07:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5019158A5CC; Sat, 4 May 2019 11:07:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7842E85032; Sat, 4 May 2019 11:07:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CB867707; Sat, 4 May 2019 11:07:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44B7aUs030107; Sat, 4 May 2019 11:07:36 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44B7aQT030106; Sat, 4 May 2019 11:07:36 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041107.x44B7aQT030106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 11:07:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347103 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347103 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7842E85032 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:07:37 -0000 Author: tuexen Date: Sat May 4 11:07:35 2019 New Revision: 347103 URL: https://svnweb.freebsd.org/changeset/base/347103 Log: MFC r344724: Allow SCTP stream reconfiguration operations only in ESTABLISHED state. This issue was found by running syzkaller. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 11:05:57 2019 (r347102) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 11:07:35 2019 (r347103) @@ -4631,6 +4631,12 @@ sctp_setopt(struct socket *so, int optname, void *optv SCTP_TCB_UNLOCK(stcb); break; } + if (SCTP_GET_STATE(stcb) != SCTP_STATE_OPEN) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + SCTP_TCB_UNLOCK(stcb); + break; + } if (sizeof(struct sctp_reset_streams) + strrst->srs_number_streams * sizeof(uint16_t) > optsize) { error = EINVAL; @@ -4745,6 +4751,12 @@ sctp_setopt(struct socket *so, int optname, void *optv SCTP_TCB_UNLOCK(stcb); break; } + if (SCTP_GET_STATE(stcb) != SCTP_STATE_OPEN) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + SCTP_TCB_UNLOCK(stcb); + break; + } if (stcb->asoc.stream_reset_outstanding) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EALREADY); error = EALREADY; @@ -4812,6 +4824,12 @@ sctp_setopt(struct socket *so, int optname, void *optv */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EOPNOTSUPP); error = EOPNOTSUPP; + SCTP_TCB_UNLOCK(stcb); + break; + } + if (SCTP_GET_STATE(stcb) != SCTP_STATE_OPEN) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; SCTP_TCB_UNLOCK(stcb); break; } From owner-svn-src-all@freebsd.org Sat May 4 11:11:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CED54158A84E; Sat, 4 May 2019 11:11:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 738AB851FD; Sat, 4 May 2019 11:11:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BDFB7735; Sat, 4 May 2019 11:11:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44BB4dg030360; Sat, 4 May 2019 11:11:04 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44BB43I030359; Sat, 4 May 2019 11:11:04 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041111.x44BB43I030359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 11:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347104 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347104 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 738AB851FD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:11:05 -0000 Author: tuexen Date: Sat May 4 11:11:03 2019 New Revision: 347104 URL: https://svnweb.freebsd.org/changeset/base/347104 Log: MFC r344726: Remove debug output. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 11:07:35 2019 (r347103) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 11:11:03 2019 (r347104) @@ -630,7 +630,6 @@ connected_type: /* now what about control */ if (control) { if (inp->control) { - SCTP_PRINTF("huh? control set?\n"); sctp_m_freem(inp->control); inp->control = NULL; } @@ -3751,13 +3750,11 @@ sctp_setopt(struct socket *so, int optname, void *optv uint32_t vrf_id; if (optval == NULL) { - SCTP_PRINTF("optval is NULL\n"); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (EINVAL); } inp = (struct sctp_inpcb *)so->so_pcb; if (inp == NULL) { - SCTP_PRINTF("inp is NULL?\n"); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (EINVAL); } From owner-svn-src-all@freebsd.org Sat May 4 11:13:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F336158A928; Sat, 4 May 2019 11:13:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ABF9085569; Sat, 4 May 2019 11:13:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 843C578B1; Sat, 4 May 2019 11:13:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44BD3pO035235; Sat, 4 May 2019 11:13:03 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44BD366035234; Sat, 4 May 2019 11:13:03 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041113.x44BD366035234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 11:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347105 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347105 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ABF9085569 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:13:04 -0000 Author: tuexen Date: Sat May 4 11:13:03 2019 New Revision: 347105 URL: https://svnweb.freebsd.org/changeset/base/347105 Log: MFC r344742: Allocate an assocition id and register the stcb with holding the lock. This avoids a race where stcbs can be found, which are not completely initialized. This was found by running syzkaller. Modified: stable/12/sys/netinet/sctp_pcb.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_pcb.c ============================================================================== --- stable/12/sys/netinet/sctp_pcb.c Sat May 4 11:11:03 2019 (r347104) +++ stable/12/sys/netinet/sctp_pcb.c Sat May 4 11:13:03 2019 (r347105) @@ -4157,11 +4157,9 @@ sctp_aloc_a_assoc_id(struct sctp_inpcb *inp, struct sc struct sctpasochead *head; struct sctp_tcb *lstcb; - SCTP_INP_WLOCK(inp); try_again: if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { /* TSNH */ - SCTP_INP_WUNLOCK(inp); return (0); } /* @@ -4180,8 +4178,7 @@ try_again: head = &inp->sctp_asocidhash[SCTP_PCBHASH_ASOC(id, inp->hashasocidmark)]; LIST_INSERT_HEAD(head, stcb, sctp_tcbasocidhash); stcb->asoc.in_asocid_hash = 1; - SCTP_INP_WUNLOCK(inp); - return id; + return (id); } /* @@ -4344,7 +4341,6 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd memset(stcb, 0, sizeof(*stcb)); asoc = &stcb->asoc; - asoc->assoc_id = sctp_aloc_a_assoc_id(inp, stcb); SCTP_TCB_LOCK_INIT(stcb); SCTP_TCB_SEND_LOCK_INIT(stcb); stcb->rport = rport; @@ -4355,7 +4351,6 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd /* failed */ SCTP_TCB_LOCK_DESTROY(stcb); SCTP_TCB_SEND_LOCK_DESTROY(stcb); - LIST_REMOVE(stcb, sctp_tcbasocidhash); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_asoc), stcb); SCTP_DECR_ASOC_COUNT(); *error = err; @@ -4368,7 +4363,6 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd /* inpcb freed while alloc going on */ SCTP_TCB_LOCK_DESTROY(stcb); SCTP_TCB_SEND_LOCK_DESTROY(stcb); - LIST_REMOVE(stcb, sctp_tcbasocidhash); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_asoc), stcb); SCTP_INP_WUNLOCK(inp); SCTP_INP_INFO_WUNLOCK(); @@ -4379,6 +4373,7 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd } SCTP_TCB_LOCK(stcb); + asoc->assoc_id = sctp_aloc_a_assoc_id(inp, stcb); /* now that my_vtag is set, add it to the hash */ head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(stcb->asoc.my_vtag, SCTP_BASE_INFO(hashasocmark))]; /* put it in the bucket in the vtag hash of assoc's for the system */ From owner-svn-src-all@freebsd.org Sat May 4 11:15:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 700BE158AB30; Sat, 4 May 2019 11:15:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17B9D85753; Sat, 4 May 2019 11:15:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4A4878B4; Sat, 4 May 2019 11:15:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44BF1no035386; Sat, 4 May 2019 11:15:01 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44BF1pB035385; Sat, 4 May 2019 11:15:01 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041115.x44BF1pB035385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 11:15:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347106 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347106 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 17B9D85753 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:15:02 -0000 Author: tuexen Date: Sat May 4 11:15:01 2019 New Revision: 347106 URL: https://svnweb.freebsd.org/changeset/base/347106 Log: MFC r344872: After removing an entry from the stream scheduler list, set the pointers to NULL, since we are checking for it in case the element gets inserted again. This issue was found by running syzkaller. Modified: stable/12/sys/netinet/sctp_ss_functions.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_ss_functions.c ============================================================================== --- stable/12/sys/netinet/sctp_ss_functions.c Sat May 4 11:13:03 2019 (r347105) +++ stable/12/sys/netinet/sctp_ss_functions.c Sat May 4 11:15:01 2019 (r347106) @@ -78,9 +78,10 @@ sctp_ss_default_clear(struct sctp_tcb *stcb, struct sc SCTP_TCB_SEND_LOCK(stcb); } while (!TAILQ_EMPTY(&asoc->ss_data.out.wheel)) { - struct sctp_stream_out *strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); + struct sctp_stream_out *strq; - TAILQ_REMOVE(&asoc->ss_data.out.wheel, TAILQ_FIRST(&asoc->ss_data.out.wheel), ss_params.rr.next_spoke); + strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); + TAILQ_REMOVE(&asoc->ss_data.out.wheel, strq, ss_params.rr.next_spoke); strq->ss_params.rr.next_spoke.tqe_next = NULL; strq->ss_params.rr.next_spoke.tqe_prev = NULL; } @@ -793,12 +794,17 @@ static void sctp_ss_fcfs_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, int clear_values, int holds_lock) { + struct sctp_stream_queue_pending *sp; + if (clear_values) { if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } while (!TAILQ_EMPTY(&asoc->ss_data.out.list)) { - TAILQ_REMOVE(&asoc->ss_data.out.list, TAILQ_FIRST(&asoc->ss_data.out.list), ss_next); + sp = TAILQ_FIRST(&asoc->ss_data.out.list); + TAILQ_REMOVE(&asoc->ss_data.out.list, sp, ss_next); + sp->ss_next.tqe_next = NULL; + sp->ss_next.tqe_prev = NULL; } if (holds_lock == 0) { SCTP_TCB_SEND_UNLOCK(stcb); @@ -861,6 +867,8 @@ sctp_ss_fcfs_remove(struct sctp_tcb *stcb, struct sctp ((sp->ss_next.tqe_next != NULL) || (sp->ss_next.tqe_prev != NULL))) { TAILQ_REMOVE(&asoc->ss_data.out.list, sp, ss_next); + sp->ss_next.tqe_next = NULL; + sp->ss_next.tqe_prev = NULL; } if (holds_lock == 0) { SCTP_TCB_SEND_UNLOCK(stcb); From owner-svn-src-all@freebsd.org Sat May 4 11:17:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66F87158ABD7; Sat, 4 May 2019 11:17:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF71F85892; Sat, 4 May 2019 11:17:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAD9478B5; Sat, 4 May 2019 11:17:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44BHK7p035535; Sat, 4 May 2019 11:17:20 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44BHKKK035534; Sat, 4 May 2019 11:17:20 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041117.x44BHKKK035534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 11:17:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347107 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347107 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DF71F85892 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:17:21 -0000 Author: tuexen Date: Sat May 4 11:17:20 2019 New Revision: 347107 URL: https://svnweb.freebsd.org/changeset/base/347107 Log: MFC r344924: Some cleanup and consistency improvements. Modified: stable/12/sys/netinet/sctp_ss_functions.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_ss_functions.c ============================================================================== --- stable/12/sys/netinet/sctp_ss_functions.c Sat May 4 11:15:01 2019 (r347106) +++ stable/12/sys/netinet/sctp_ss_functions.c Sat May 4 11:17:20 2019 (r347107) @@ -54,6 +54,9 @@ sctp_ss_default_init(struct sctp_tcb *stcb, struct sct { uint16_t i; + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } asoc->ss_data.locked_on_sending = NULL; asoc->ss_data.last_out_stream = NULL; TAILQ_INIT(&asoc->ss_data.out.wheel); @@ -65,8 +68,11 @@ sctp_ss_default_init(struct sctp_tcb *stcb, struct sct for (i = 0; i < stcb->asoc.streamoutcnt; i++) { stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, &stcb->asoc, &stcb->asoc.strmout[i], - NULL, holds_lock); + NULL, 1); } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } return; } @@ -396,12 +402,13 @@ sctp_ss_prio_clear(struct sctp_tcb *stcb, struct sctp_ SCTP_TCB_SEND_LOCK(stcb); } while (!TAILQ_EMPTY(&asoc->ss_data.out.wheel)) { - struct sctp_stream_out *strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); + struct sctp_stream_out *strq; + strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); if (clear_values) { strq->ss_params.prio.priority = 0; } - TAILQ_REMOVE(&asoc->ss_data.out.wheel, TAILQ_FIRST(&asoc->ss_data.out.wheel), ss_params.prio.next_spoke); + TAILQ_REMOVE(&asoc->ss_data.out.wheel, strq, ss_params.prio.next_spoke); strq->ss_params.prio.next_spoke.tqe_next = NULL; strq->ss_params.prio.next_spoke.tqe_prev = NULL; @@ -586,12 +593,13 @@ sctp_ss_fb_clear(struct sctp_tcb *stcb, struct sctp_as SCTP_TCB_SEND_LOCK(stcb); } while (!TAILQ_EMPTY(&asoc->ss_data.out.wheel)) { - struct sctp_stream_out *strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); + struct sctp_stream_out *strq; + strq = TAILQ_FIRST(&asoc->ss_data.out.wheel); if (clear_values) { strq->ss_params.fb.rounds = -1; } - TAILQ_REMOVE(&asoc->ss_data.out.wheel, TAILQ_FIRST(&asoc->ss_data.out.wheel), ss_params.fb.next_spoke); + TAILQ_REMOVE(&asoc->ss_data.out.wheel, strq, ss_params.fb.next_spoke); strq->ss_params.fb.next_spoke.tqe_next = NULL; strq->ss_params.fb.next_spoke.tqe_prev = NULL; } @@ -764,6 +772,9 @@ sctp_ss_fcfs_init(struct sctp_tcb *stcb, struct sctp_a struct sctp_stream_queue_pending *sp; uint16_t i; + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } TAILQ_INIT(&asoc->ss_data.out.list); /* * If there is data in the stream queues already, the scheduler of @@ -781,11 +792,14 @@ sctp_ss_fcfs_init(struct sctp_tcb *stcb, struct sctp_a x++; } if (sp != NULL) { - sctp_ss_fcfs_add(stcb, &stcb->asoc, &stcb->asoc.strmout[i], sp, holds_lock); + sctp_ss_fcfs_add(stcb, &stcb->asoc, &stcb->asoc.strmout[i], sp, 1); add_more = 1; } } n++; + } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); } return; } From owner-svn-src-all@freebsd.org Sat May 4 11:18:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23E71158ADB8; Sat, 4 May 2019 11:18:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A450A85A6B; Sat, 4 May 2019 11:18:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BBBC78B6; Sat, 4 May 2019 11:18:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44BIdDq035642; Sat, 4 May 2019 11:18:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44BIdlZ035641; Sat, 4 May 2019 11:18:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041118.x44BIdlZ035641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 11:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347108 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347108 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A450A85A6B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:18:40 -0000 Author: tuexen Date: Sat May 4 11:18:39 2019 New Revision: 347108 URL: https://svnweb.freebsd.org/changeset/base/347108 Log: MFC r344925: Fix locking bug. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 11:17:20 2019 (r347107) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 11:18:39 2019 (r347108) @@ -4069,10 +4069,12 @@ sctp_setopt(struct socket *so, int optname, void *optv } SCTP_FIND_STCB(inp, stcb, av->assoc_id); if (stcb) { + SCTP_TCB_SEND_LOCK(stcb); stcb->asoc.ss_functions.sctp_ss_clear(stcb, &stcb->asoc, 1, 1); stcb->asoc.ss_functions = sctp_ss_functions[av->assoc_value]; stcb->asoc.stream_scheduling_module = av->assoc_value; stcb->asoc.ss_functions.sctp_ss_init(stcb, &stcb->asoc, 1); + SCTP_TCB_SEND_UNLOCK(stcb); SCTP_TCB_UNLOCK(stcb); } else { if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || @@ -4088,10 +4090,12 @@ sctp_setopt(struct socket *so, int optname, void *optv SCTP_INP_RLOCK(inp); LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { SCTP_TCB_LOCK(stcb); + SCTP_TCB_SEND_LOCK(stcb); stcb->asoc.ss_functions.sctp_ss_clear(stcb, &stcb->asoc, 1, 1); stcb->asoc.ss_functions = sctp_ss_functions[av->assoc_value]; stcb->asoc.stream_scheduling_module = av->assoc_value; stcb->asoc.ss_functions.sctp_ss_init(stcb, &stcb->asoc, 1); + SCTP_TCB_SEND_UNLOCK(stcb); SCTP_TCB_UNLOCK(stcb); } SCTP_INP_RUNLOCK(inp); From owner-svn-src-all@freebsd.org Sat May 4 11:21:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46193158B003; Sat, 4 May 2019 11:21:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1A8B85DAA; Sat, 4 May 2019 11:21:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4D067914; Sat, 4 May 2019 11:21:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44BLfFO039988; Sat, 4 May 2019 11:21:41 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44BLfs5039987; Sat, 4 May 2019 11:21:41 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041121.x44BLfs5039987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 11:21:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347109 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E1A8B85DAA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:21:42 -0000 Author: tuexen Date: Sat May 4 11:21:41 2019 New Revision: 347109 URL: https://svnweb.freebsd.org/changeset/base/347109 Log: MFC r345441: Fix a KASSERT() in tcp_output(). When checking the length of the headers at this point, the IP level options have not been added to the mbuf chain. So don't take them into account. Reviewed by: rrs@ Sponsored by: Netflix, Inc. Modified: stable/12/sys/netinet/tcp_output.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_output.c ============================================================================== --- stable/12/sys/netinet/tcp_output.c Sat May 4 11:18:39 2019 (r347108) +++ stable/12/sys/netinet/tcp_output.c Sat May 4 11:21:41 2019 (r347109) @@ -1283,15 +1283,9 @@ send: m->m_pkthdr.tso_segsz = tp->t_maxseg - optlen; } -#if defined(IPSEC) || defined(IPSEC_SUPPORT) - KASSERT(len + hdrlen + ipoptlen - ipsec_optlen == m_length(m, NULL), - ("%s: mbuf chain shorter than expected: %d + %u + %u - %u != %u", - __func__, len, hdrlen, ipoptlen, ipsec_optlen, m_length(m, NULL))); -#else - KASSERT(len + hdrlen + ipoptlen == m_length(m, NULL), - ("%s: mbuf chain shorter than expected: %d + %u + %u != %u", - __func__, len, hdrlen, ipoptlen, m_length(m, NULL))); -#endif + KASSERT(len + hdrlen == m_length(m, NULL), + ("%s: mbuf chain shorter than expected: %d + %u != %u", + __func__, len, hdrlen, m_length(m, NULL))); #ifdef TCP_HHOOK /* Run HHOOK_TCP_ESTABLISHED_OUT helper hooks. */ From owner-svn-src-all@freebsd.org Sat May 4 11:24:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56E3E158B203; Sat, 4 May 2019 11:24:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F01D585FFB; Sat, 4 May 2019 11:24:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0FE87A5C; Sat, 4 May 2019 11:24:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44BOKve040980; Sat, 4 May 2019 11:24:20 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44BOJgx040975; Sat, 4 May 2019 11:24:19 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041124.x44BOJgx040975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 11:24:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347110 - in stable/12: share/man/man4 sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/netinet X-SVN-Commit-Revision: 347110 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F01D585FFB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:24:21 -0000 Author: tuexen Date: Sat May 4 11:24:19 2019 New Revision: 347110 URL: https://svnweb.freebsd.org/changeset/base/347110 Log: MFC r345458: Add sysctl variable net.inet.tcp.rexmit_initial for setting RTO.Initial used by TCP. Reviewed by: rrs@, 0mp@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D19355 Modified: stable/12/share/man/man4/tcp.4 stable/12/sys/netinet/tcp_subr.c stable/12/sys/netinet/tcp_syncache.c stable/12/sys/netinet/tcp_timer.c stable/12/sys/netinet/tcp_timer.h Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/tcp.4 ============================================================================== --- stable/12/share/man/man4/tcp.4 Sat May 4 11:21:41 2019 (r347109) +++ stable/12/share/man/man4/tcp.4 Sat May 4 11:24:19 2019 (r347110) @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd August 6, 2018 +.Dd March 23, 2019 .Dt TCP 4 .Os .Sh NAME @@ -459,7 +459,7 @@ The actual limit applied to a session's reassembly que the system-calculated automatic limit and the user-specified .Va reass.maxqueuelen limit. -.It Va rexmit_min , rexmit_slop +.It Va rexmit_initial , rexmit_min , rexmit_slop Adjust the retransmit timer calculation for .Tn TCP . The slop is @@ -481,6 +481,7 @@ code. For this reason, we use 200ms of slop and a near-0 minimum, which gives us an effective minimum of 200ms (similar to .Tn Linux ) . +The initial value is used before an RTT measurement has been performed. .It Va initcwnd_segments Enable the ability to specify initial congestion window in number of segments. The default value is 10 as suggested by RFC 6928. Modified: stable/12/sys/netinet/tcp_subr.c ============================================================================== --- stable/12/sys/netinet/tcp_subr.c Sat May 4 11:21:41 2019 (r347109) +++ stable/12/sys/netinet/tcp_subr.c Sat May 4 11:24:19 2019 (r347110) @@ -1082,6 +1082,9 @@ tcp_init(void) tcp_keepintvl = TCPTV_KEEPINTVL; tcp_maxpersistidle = TCPTV_KEEP_IDLE; tcp_msl = TCPTV_MSL; + tcp_rexmit_initial = TCPTV_RTOBASE; + if (tcp_rexmit_initial < 1) + tcp_rexmit_initial = 1; tcp_rexmit_min = TCPTV_MIN; if (tcp_rexmit_min < 1) tcp_rexmit_min = 1; @@ -1660,9 +1663,9 @@ tcp_newtcpcb(struct inpcb *inp) * reasonable initial retransmit time. */ tp->t_srtt = TCPTV_SRTTBASE; - tp->t_rttvar = ((TCPTV_RTOBASE - TCPTV_SRTTBASE) << TCP_RTTVAR_SHIFT) / 4; + tp->t_rttvar = ((tcp_rexmit_initial - TCPTV_SRTTBASE) << TCP_RTTVAR_SHIFT) / 4; tp->t_rttmin = tcp_rexmit_min; - tp->t_rxtcur = TCPTV_RTOBASE; + tp->t_rxtcur = tcp_rexmit_initial; tp->snd_cwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT; tp->snd_ssthresh = TCP_MAXWIN << TCP_MAX_WINSHIFT; tp->t_rcvtime = ticks; Modified: stable/12/sys/netinet/tcp_syncache.c ============================================================================== --- stable/12/sys/netinet/tcp_syncache.c Sat May 4 11:21:41 2019 (r347109) +++ stable/12/sys/netinet/tcp_syncache.c Sat May 4 11:24:19 2019 (r347110) @@ -155,10 +155,10 @@ static int syncookie_cmp(struct in_conninfo *inc, str /* * Transmit the SYN,ACK fewer times than TCP_MAXRXTSHIFT specifies. * 3 retransmits corresponds to a timeout with default values of - * TCPTV_RTOBASE * ( 1 + - * tcp_backoff[1] + - * tcp_backoff[2] + - * tcp_backoff[3]) + 3 * tcp_rexmit_slop, + * tcp_rexmit_initial * ( 1 + + * tcp_backoff[1] + + * tcp_backoff[2] + + * tcp_backoff[3]) + 3 * tcp_rexmit_slop, * 1000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms = 15600 ms, * the odds are that the user has given up attempting to connect by then. */ @@ -424,9 +424,10 @@ syncache_timeout(struct syncache *sc, struct syncache_ int rexmt; if (sc->sc_rxmits == 0) - rexmt = TCPTV_RTOBASE; + rexmt = tcp_rexmit_initial; else - TCPT_RANGESET(rexmt, TCPTV_RTOBASE * tcp_backoff[sc->sc_rxmits], + TCPT_RANGESET(rexmt, + tcp_rexmit_initial * tcp_backoff[sc->sc_rxmits], tcp_rexmit_min, TCPTV_REXMTMAX); sc->sc_rxttime = ticks + rexmt; sc->sc_rxmits++; Modified: stable/12/sys/netinet/tcp_timer.c ============================================================================== --- stable/12/sys/netinet/tcp_timer.c Sat May 4 11:21:41 2019 (r347109) +++ stable/12/sys/netinet/tcp_timer.c Sat May 4 11:24:19 2019 (r347110) @@ -110,6 +110,11 @@ int tcp_msl; SYSCTL_PROC(_net_inet_tcp, OID_AUTO, msl, CTLTYPE_INT|CTLFLAG_RW, &tcp_msl, 0, sysctl_msec_to_ticks, "I", "Maximum segment lifetime"); +int tcp_rexmit_initial; +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_initial, CTLTYPE_INT|CTLFLAG_RW, + &tcp_rexmit_initial, 0, sysctl_msec_to_ticks, "I", + "Initial Retransmission Timeout"); + int tcp_rexmit_min; SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_min, CTLTYPE_INT|CTLFLAG_RW, &tcp_rexmit_min, 0, sysctl_msec_to_ticks, "I", @@ -668,7 +673,7 @@ tcp_timer_rexmt(void * xtp) TCPSTAT_INC(tcps_rexmttimeo); if ((tp->t_state == TCPS_SYN_SENT) || (tp->t_state == TCPS_SYN_RECEIVED)) - rexmt = TCPTV_RTOBASE * tcp_backoff[tp->t_rxtshift]; + rexmt = tcp_rexmit_initial * tcp_backoff[tp->t_rxtshift]; else rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift]; TCPT_RANGESET(tp->t_rxtcur, rexmt, Modified: stable/12/sys/netinet/tcp_timer.h ============================================================================== --- stable/12/sys/netinet/tcp_timer.h Sat May 4 11:21:41 2019 (r347109) +++ stable/12/sys/netinet/tcp_timer.h Sat May 4 11:24:19 2019 (r347110) @@ -194,6 +194,7 @@ extern int tcp_keepintvl; /* time between keepalive p extern int tcp_keepcnt; /* number of keepalives */ extern int tcp_delacktime; /* time before sending a delayed ACK */ extern int tcp_maxpersistidle; +extern int tcp_rexmit_initial; extern int tcp_rexmit_min; extern int tcp_rexmit_slop; extern int tcp_msl; From owner-svn-src-all@freebsd.org Sat May 4 12:02:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C64E5158C30F; Sat, 4 May 2019 12:02:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C0A9871B4; Sat, 4 May 2019 12:02:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 447568102; Sat, 4 May 2019 12:02:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44C2g9Q062007; Sat, 4 May 2019 12:02:42 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44C2gsF062006; Sat, 4 May 2019 12:02:42 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041202.x44C2gsF062006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 12:02:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347111 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347111 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C0A9871B4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 12:02:43 -0000 Author: tuexen Date: Sat May 4 12:02:41 2019 New Revision: 347111 URL: https://svnweb.freebsd.org/changeset/base/347111 Log: MFC r345460: Limit the number of bytes which can be queued for SCTP sockets. This is joint work with rrs@. Modified: stable/12/sys/netinet/sctp_output.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_output.c ============================================================================== --- stable/12/sys/netinet/sctp_output.c Sat May 4 11:24:19 2019 (r347110) +++ stable/12/sys/netinet/sctp_output.c Sat May 4 12:02:41 2019 (r347111) @@ -13026,12 +13026,7 @@ sctp_lower_sosend(struct socket *so, /* Calculate the maximum we can send */ inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); if (SCTP_SB_LIMIT_SND(so) > inqueue_bytes) { - if (non_blocking) { - /* we already checked for non-blocking above. */ - max_len = sndlen; - } else { - max_len = SCTP_SB_LIMIT_SND(so) - inqueue_bytes; - } + max_len = SCTP_SB_LIMIT_SND(so) - inqueue_bytes; } else { max_len = 0; } From owner-svn-src-all@freebsd.org Sat May 4 12:07:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDAC6158C640; Sat, 4 May 2019 12:07:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83767873CD; Sat, 4 May 2019 12:07:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 508C48103; Sat, 4 May 2019 12:07:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44C719c062245; Sat, 4 May 2019 12:07:01 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44C70cu062244; Sat, 4 May 2019 12:07:00 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041207.x44C70cu062244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 12:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347112 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347112 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 83767873CD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 12:07:02 -0000 Author: tuexen Date: Sat May 4 12:07:00 2019 New Revision: 347112 URL: https://svnweb.freebsd.org/changeset/base/347112 Log: MFC r345461: Limit the size of messages sent on 1-to-many style SCTP sockets with the SCTP_SENDALL flag. Allow also only one operation per SCTP endpoint. This fixes an issue found by running syzkaller and is joint work with rrs@. Modified: stable/12/sys/netinet/sctp.h stable/12/sys/netinet/sctp_output.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp.h ============================================================================== --- stable/12/sys/netinet/sctp.h Sat May 4 12:02:41 2019 (r347111) +++ stable/12/sys/netinet/sctp.h Sat May 4 12:07:00 2019 (r347112) @@ -491,6 +491,7 @@ struct sctp_error_auth_invalid_hmac { * time */ #define SCTP_SAT_NETWORK_BURST_INCR 2 /* how many times to multiply maxburst * in sat */ +#define SCTP_MAX_SENDALL_LIMIT 1024 /* Data Chuck Specific Flags */ #define SCTP_DATA_FRAG_MASK 0x03 @@ -516,6 +517,7 @@ struct sctp_error_auth_invalid_hmac { #define SCTP_PCB_FLAGS_BOUNDALL 0x00000004 #define SCTP_PCB_FLAGS_ACCEPTING 0x00000008 #define SCTP_PCB_FLAGS_UNBOUND 0x00000010 +#define SCTP_PCB_FLAGS_SND_ITERATOR_UP 0x00000020 #define SCTP_PCB_FLAGS_CLOSE_IP 0x00040000 #define SCTP_PCB_FLAGS_WAS_CONNECTED 0x00080000 #define SCTP_PCB_FLAGS_WAS_ABORTED 0x00100000 Modified: stable/12/sys/netinet/sctp_output.c ============================================================================== --- stable/12/sys/netinet/sctp_output.c Sat May 4 12:02:41 2019 (r347111) +++ stable/12/sys/netinet/sctp_output.c Sat May 4 12:07:00 2019 (r347112) @@ -6804,6 +6804,10 @@ sctp_sendall_completes(void *ptr, uint32_t val SCTP_UN */ /* now free everything */ + if (ca->inp) { + /* Lets clear the flag to allow others to run. */ + ca->inp->sctp_flags &= ~SCTP_PCB_FLAGS_SND_ITERATOR_UP; + } sctp_m_freem(ca->m); SCTP_FREE(ca, SCTP_M_COPYAL); } @@ -6857,6 +6861,14 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, int ret; struct sctp_copy_all *ca; + if (inp->sctp_flags & SCTP_PCB_FLAGS_SND_ITERATOR_UP) { + /* There is another. */ + return (EBUSY); + } + if (uio->uio_resid > SCTP_MAX_SENDALL_LIMIT) { + /* You must be less than the max! */ + return (EMSGSIZE); + } SCTP_MALLOC(ca, struct sctp_copy_all *, sizeof(struct sctp_copy_all), SCTP_M_COPYAL); if (ca == NULL) { @@ -6893,6 +6905,7 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, ca->sndlen += SCTP_BUF_LEN(mat); } } + inp->sctp_flags |= SCTP_PCB_FLAGS_SND_ITERATOR_UP; ret = sctp_initiate_iterator(NULL, sctp_sendall_iterator, NULL, SCTP_PCB_ANY_FLAGS, SCTP_PCB_ANY_FEATURES, SCTP_ASOC_ANY_STATE, From owner-svn-src-all@freebsd.org Sat May 4 12:19:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2428A158C910; Sat, 4 May 2019 12:19:04 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BBDD987826; Sat, 4 May 2019 12:19:03 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A689482A4; Sat, 4 May 2019 12:19:03 +0000 (UTC) (envelope-from avatar@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44CJ3l8067342; Sat, 4 May 2019 12:19:03 GMT (envelope-from avatar@FreeBSD.org) Received: (from avatar@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44CJ34Q067339; Sat, 4 May 2019 12:19:03 GMT (envelope-from avatar@FreeBSD.org) Message-Id: <201905041219.x44CJ34Q067339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avatar set sender to avatar@FreeBSD.org using -f From: Tai-hwa Liang Date: Sat, 4 May 2019 12:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347113 - in stable/11/sys: dev/sound/midi dev/sound/pci modules/sound/driver/csa X-SVN-Group: stable-11 X-SVN-Commit-Author: avatar X-SVN-Commit-Paths: in stable/11/sys: dev/sound/midi dev/sound/pci modules/sound/driver/csa X-SVN-Commit-Revision: 347113 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BBDD987826 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 12:19:04 -0000 Author: avatar Date: Sat May 4 12:19:02 2019 New Revision: 347113 URL: https://svnweb.freebsd.org/changeset/base/347113 Log: MFC r338422: Adding support for CS46xx MIDI output. With this patch, users can play the MIDI files through /dev/sequencer device with tools like playmidi. The audio output will go through the external MIDI device such like wavetable synthesis card. Reviewed by: matk (a long time ago), kib Tested with: Terratec SiXPack 5.1+ + Yamaha DB50XG Added: stable/11/sys/dev/sound/pci/csamidi.c - copied unchanged from r338422, head/sys/dev/sound/pci/csamidi.c Modified: stable/11/sys/dev/sound/midi/midi.c stable/11/sys/modules/sound/driver/csa/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sound/midi/midi.c ============================================================================== --- stable/11/sys/dev/sound/midi/midi.c Sat May 4 12:07:00 2019 (r347112) +++ stable/11/sys/dev/sound/midi/midi.c Sat May 4 12:19:02 2019 (r347113) @@ -1465,18 +1465,14 @@ midi_modevent(module_t mod, int type, void *data) switch (type) { case MOD_LOAD: retval = midi_load(); -#if 0 if (retval == 0) retval = seq_modevent(mod, type, data); -#endif break; case MOD_UNLOAD: retval = midi_unload(); -#if 0 if (retval == 0) retval = seq_modevent(mod, type, data); -#endif break; default: Copied: stable/11/sys/dev/sound/pci/csamidi.c (from r338422, head/sys/dev/sound/pci/csamidi.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/sound/pci/csamidi.c Sat May 4 12:19:02 2019 (r347113, copy of r338422, head/sys/dev/sound/pci/csamidi.c) @@ -0,0 +1,290 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + + * Copyright (c) 2015-2018 Tai-hwa Liang + * All rights reserved + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY 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 +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_snd.h" +#endif + +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#include "mpufoi_if.h" + +SND_DECLARE_FILE("$FreeBSD$"); + +/* pulled from mpu401.c */ +#define MPU_DATAPORT 0 +#define MPU_CMDPORT 1 +#define MPU_STATPORT 1 +#define MPU_RESET 0xff +#define MPU_UART 0x3f +#define MPU_ACK 0xfe +#define MPU_STATMASK 0xc0 +#define MPU_OUTPUTBUSY 0x40 +#define MPU_INPUTBUSY 0x80 + +/* device private data */ +struct csa_midi_softc { + /* hardware resources */ + int io_rid; /* io rid */ + struct resource *io; /* io */ + + struct mtx mtx; + device_t dev; + struct mpu401 *mpu; + mpu401_intr_t *mpu_intr; + int mflags; /* MIDI flags */ +}; + +static struct kobj_class csamidi_mpu_class; +static devclass_t midicsa_devclass; + +static u_int32_t +csamidi_readio(struct csa_midi_softc *scp, u_long offset) +{ + if (offset < BA0_AC97_RESET) + return bus_space_read_4(rman_get_bustag(scp->io), rman_get_bushandle(scp->io), offset) & 0xffffffff; + else + return (0); +} + +static void +csamidi_writeio(struct csa_midi_softc *scp, u_long offset, u_int32_t data) +{ + if (offset < BA0_AC97_RESET) + bus_space_write_4(rman_get_bustag(scp->io), rman_get_bushandle(scp->io), offset, data); +} + +static void +csamidi_midi_intr(void *arg) +{ + struct csa_midi_softc *scp = (struct csa_midi_softc *)arg; + + if (scp->mpu_intr) + (scp->mpu_intr)(scp->mpu); +} + +static unsigned char +csamidi_mread(struct mpu401 *arg __unused, void *cookie, int reg) +{ + struct csa_midi_softc *scp = cookie; + unsigned int rc; + unsigned int uart_stat; + + rc = 0; + /* hacks to convert hardware status to MPU compatible ones */ + switch (reg) { + case MPU_STATPORT: + uart_stat = csamidi_readio(scp, BA0_MIDSR); + if (uart_stat & MIDSR_TBF) + rc |= MPU_OUTPUTBUSY; /* Tx buffer full */ + if (uart_stat & MIDSR_RBE) + rc |= MPU_INPUTBUSY; + break; + case MPU_DATAPORT: + rc = csamidi_readio(scp, BA0_MIDRP); + break; + default: + printf("csamidi_mread: unknown register %d\n", reg); + break; + } + return (rc); +} + +static void +csamidi_mwrite(struct mpu401 *arg __unused, void *cookie, int reg, unsigned char b) +{ + struct csa_midi_softc *scp = cookie; + unsigned int val; + + switch (reg) { + case MPU_CMDPORT: + switch (b) + { + case MPU_RESET: + /* preserve current operation mode */ + val = csamidi_readio(scp, BA0_MIDCR); + /* reset the MIDI port */ + csamidi_writeio(scp, BA0_MIDCR, MIDCR_MRST); + csamidi_writeio(scp, BA0_MIDCR, MIDCR_MLB); + csamidi_writeio(scp, BA0_MIDCR, 0x00); + /* restore previous operation mode */ + csamidi_writeio(scp, BA0_MIDCR, val); + break; + case MPU_UART: + /* switch to UART mode, no-op */ + default: + break; + } + break; + case MPU_DATAPORT: + /* put the MIDI databyte in the write port */ + csamidi_writeio(scp, BA0_MIDWP, b); + break; + default: + printf("csamidi_mwrite: unknown register %d\n", reg); + break; + } +} + +static int +csamidi_muninit(struct mpu401 *arg __unused, void *cookie) +{ + struct csa_midi_softc *scp = cookie; + + mtx_lock(&scp->mtx); + scp->mpu_intr = NULL; + mtx_unlock(&scp->mtx); + + return (0); +} + +static int +midicsa_probe(device_t dev) +{ + struct sndcard_func *func; + + /* The parent device has already been probed. */ + + func = device_get_ivars(dev); + if (func == NULL || func->func != SCF_MIDI) + return (ENXIO); + + device_set_desc(dev, "CS461x MIDI"); + return (0); +} + +static int +midicsa_attach(device_t dev) +{ + struct csa_midi_softc *scp; + struct sndcard_func *func; + int rc = ENXIO; + + scp = device_get_softc(dev); + func = device_get_ivars(dev); + + bzero(scp, sizeof(struct csa_midi_softc)); + scp->dev = dev; + + /* allocate the required resources */ + scp->io_rid = PCIR_BAR(0); + scp->io = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &scp->io_rid, RF_ACTIVE); + if (scp->io == NULL) + goto err0; + + /* init the fake MPU401 interface. */ + scp->mpu = mpu401_init(&csamidi_mpu_class, scp, csamidi_midi_intr, + &scp->mpu_intr); + if (scp->mpu == NULL) { + rc = ENOMEM; + goto err1; + } + + mtx_init(&scp->mtx, device_get_nameunit(dev), "csamidi softc", + MTX_DEF); + + /* reset the MIDI port */ + csamidi_writeio(scp, BA0_MIDCR, MIDCR_MRST); + /* MIDI transmit enable, no interrupt */ + csamidi_writeio(scp, BA0_MIDCR, MIDCR_TXE | MIDCR_RXE); + csamidi_writeio(scp, BA0_HICR, HICR_IEV | HICR_CHGM); + + return (0); +err1: + bus_release_resource(dev, SYS_RES_MEMORY, scp->io_rid, scp->io); + scp->io = NULL; +err0: + return (rc); +} + +static int +midicsa_detach(device_t dev) +{ + struct csa_midi_softc *scp; + int rc = 0; + + scp = device_get_softc(dev); + rc = mpu401_uninit(scp->mpu); + if (rc) + return (rc); + if (scp->io != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, scp->io_rid, + scp->io); + scp->io = NULL; + } + mtx_destroy(&scp->mtx); + return (rc); +} + +static kobj_method_t csamidi_mpu_methods[] = { + KOBJMETHOD(mpufoi_read, csamidi_mread), + KOBJMETHOD(mpufoi_write, csamidi_mwrite), + KOBJMETHOD(mpufoi_uninit, csamidi_muninit), + KOBJMETHOD_END +}; + +static DEFINE_CLASS(csamidi_mpu, csamidi_mpu_methods, 0); + +static device_method_t midicsa_methods[] = { + DEVMETHOD(device_probe, midicsa_probe), + DEVMETHOD(device_attach, midicsa_attach), + DEVMETHOD(device_detach, midicsa_detach), + + DEVMETHOD_END +}; + +static driver_t midicsa_driver = { + "midi", + midicsa_methods, + sizeof(struct csa_midi_softc), +}; +DRIVER_MODULE(snd_csa_midi, csa, midicsa_driver, midicsa_devclass, 0, 0); +MODULE_DEPEND(snd_csa_midi, snd_csa, 1, 1, 1); +MODULE_DEPEND(snd_csa_midi, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); +MODULE_VERSION(snd_csa_midi, 1); Modified: stable/11/sys/modules/sound/driver/csa/Makefile ============================================================================== --- stable/11/sys/modules/sound/driver/csa/Makefile Sat May 4 12:07:00 2019 (r347112) +++ stable/11/sys/modules/sound/driver/csa/Makefile Sat May 4 12:19:02 2019 (r347113) @@ -3,7 +3,7 @@ .PATH: ${SRCTOP}/sys/dev/sound/pci KMOD= snd_csa -SRCS= device_if.h bus_if.h pci_if.h -SRCS+= csa.c csapcm.c +SRCS= device_if.h bus_if.h mpufoi_if.h pci_if.h +SRCS+= csa.c csamidi.c csapcm.c .include From owner-svn-src-all@freebsd.org Sat May 4 12:34:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF259158D3C2; Sat, 4 May 2019 12:34:12 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 915AC8843A; Sat, 4 May 2019 12:34:12 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69B4285FC; Sat, 4 May 2019 12:34:12 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44CYCk8077937; Sat, 4 May 2019 12:34:12 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44CYCJw077935; Sat, 4 May 2019 12:34:12 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201905041234.x44CYCJw077935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Sat, 4 May 2019 12:34:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347114 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: rwatson X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 347114 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 915AC8843A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 12:34:13 -0000 Author: rwatson Date: Sat May 4 12:34:11 2019 New Revision: 347114 URL: https://svnweb.freebsd.org/changeset/base/347114 Log: Merge r346814 from head to stable/12: Add a man page for the DTrace Audit Provider, since we are now growing a set of provider man pages. Sponsored by: DARPA, AFRL Added: stable/12/share/man/man4/dtrace_audit.4 - copied unchanged from r346814, head/share/man/man4/dtrace_audit.4 Modified: stable/12/share/man/man4/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/Makefile ============================================================================== --- stable/12/share/man/man4/Makefile Sat May 4 12:19:02 2019 (r347113) +++ stable/12/share/man/man4/Makefile Sat May 4 12:34:11 2019 (r347114) @@ -893,7 +893,8 @@ _ccd.4= ccd.4 .endif .if ${MK_CDDL} != "no" -_dtrace_provs= dtrace_io.4 \ +_dtrace_provs= dtrace_audit.4 \ + dtrace_io.4 \ dtrace_ip.4 \ dtrace_lockstat.4 \ dtrace_proc.4 \ @@ -902,6 +903,8 @@ _dtrace_provs= dtrace_io.4 \ dtrace_tcp.4 \ dtrace_udp.4 \ dtrace_udplite.4 + +MLINKS+= dtrace_audit.4 dtaudit.4 .endif .if ${MK_EFI} != "no" Copied: stable/12/share/man/man4/dtrace_audit.4 (from r346814, head/share/man/man4/dtrace_audit.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/share/man/man4/dtrace_audit.4 Sat May 4 12:34:11 2019 (r347114, copy of r346814, head/share/man/man4/dtrace_audit.4) @@ -0,0 +1,178 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2019 Robert N. M. Watson +.\" +.\" This software was developed by BAE Systems, the University of Cambridge +.\" Computer Laboratory, and Memorial University under DARPA/AFRL contract +.\" FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing +.\" (TC) research program. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 28, 2019 +.Dt DTRACE_AUDIT 4 +.Os +.Sh NAME +.Nm dtrace_audit +.Nd A DTrace provider for tracing +.Xr audit 4 +events +.Sh SYNOPSIS +.Pp +.Fn audit:event:aue_*:commit "char *eventname" "struct audit_record *ar" +.Fn audit:event:aue_*:bsm "char *eventname" "struct audit_record *ar" "const void *" "size_t" +.Pp +To compile this module into the kernel, place the following in your kernel +configuration file: +.Pp +.Bd -literal -offset indent +.Cd "options DTAUDIT" +.Ed +.Pp +Alternatively, to load the module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dtaudit_load="YES" +.Ed +.Sh DESCRIPTION +The DTrace +.Nm dtaudit +provider allows users to trace events in the kernel security auditing +subsystem, +.Xr audit 4 . +.Xr audit 4 +provides detailed logging of a configurable set of security-relevant system +calls, including key arguments (such as file paths) and return values that are +copied race-free as the system call proceeds. +The +.Nm dtaudit +provider allows DTrace scripts to selectively enable in-kernel audit-record +capture for system calls, and then access those records in either the +in-kernel format or BSM format (\c +.Xr audit.log 5 ) +when the system call completes. +While the in-kernel audit record data structure is subject to change as the +kernel changes over time, it is a much more friendly interface for use in D +scripts than either those available via the DTrace system-call provider or the +BSM trail itself. +.Ss Configuration +The +.Nm dtaudit +provider relies on +.Xr audit 4 +being compiled into the kernel. +.Nm dtaudit +probes become available only once there is an event-to-name mapping installed +in the kernel, normally done by +.Xr auditd 8 +during the boot process, if audit is enabled in +.Xr rc.conf 5 : +.Bd -literal -offset indent +auditd_enable="YES" +.Ed +.Pp +If +.Nm dtaudit +probes are required earlier in boot -- for example, in single-user mode -- or +without enabling +.Xr audit 4 , +they can be preloaded in the boot loader by adding this line to +.Xr loader.conf 5 . +.Bd -literal -offset indent +audit_event_load="YES" +.Ed +.Ss Probes +The +.Fn audit:event:aue_*:commit +probes fire synchronously during system-call return, giving access to two +arguments: a +.Vt char * +audit event name, and +the +.Vt struct audit_record * +in-kernel audit record. +Because the probe fires in system-call return, the user thread has not yet +regained control, and additional information from the thread and process +remains available for capture by the script. +.Pp +The +.Fn audit:event:aue_*:bsm +probes fire asynchonously from system-call return, following BSM conversion +and just prior to being written to disk, giving access to four arguments: a +.Vt char * +audit event name, the +.Vt struct audit_record * +in-kernel audit record, a +.Vt const void * +pointer to the converted BSM record, and a +.Vt size_t +for the length of the BSM record. +.Sh IMPLEMENTATION NOTES +When a set of +.Nm dtaudit +probes are registered, corresponding in-kernel audit records will be captured +and their probes will fire regardless of whether the +.Xr audit 4 +subsystem itself would have captured the record for the purposes of writing it +to the audit trail, or for delivery to a +.Xr auditpipe 4 . +In-kernel audit records allocated only because of enabled +.Xr dtaudit 4 +probes will not be unnecessarily written to the audit trail or enabled pipes. +.Sh SEE ALSO +.Xr dtrace 1 , +.Xr audit 4 , +.Xr audit.log 5 , +.Xr loader.conf 5 , +.Xr rc.conf 5 , +.Xr auditd 8 +.Sh HISTORY +The +.Nm dtaudit +provider first appeared in +.Fx 12.0 . +.Sh AUTHORS +This software and this manual page were developed by BAE Systems, the +University of Cambridge Computer Laboratory, and Memorial University under +DARPA/AFRL contract +.Pq FA8650-15-C-7558 +.Pq Do CADETS Dc , +as part of the DARPA Transparent Computing (TC) research program. +The +.Nm dtaudit +provider and this manual page were written by +.An Robert Watson Aq Mt rwatson@FreeBSD.org . +.Sh BUGS +Because +.Xr audit 4 +maintains its primary event-to-name mapping database in userspace, that +database must be loaded into the kernel before +.Nm dtaudit +probes become available. +.Pp +.Nm dtaudit +is only able to provide access to system-call audit events, not the full +scope of userspace events, such as those relating to login, password change, +and so on. From owner-svn-src-all@freebsd.org Sat May 4 12:35:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18BA2158D43D; Sat, 4 May 2019 12:35:14 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B20568856C; Sat, 4 May 2019 12:35:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C11B85FD; Sat, 4 May 2019 12:35:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44CZDgP078052; Sat, 4 May 2019 12:35:13 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44CZDpu078050; Sat, 4 May 2019 12:35:13 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201905041235.x44CZDpu078050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Sat, 4 May 2019 12:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347115 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: rwatson X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 347115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B20568856C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 12:35:14 -0000 Author: rwatson Date: Sat May 4 12:35:12 2019 New Revision: 347115 URL: https://svnweb.freebsd.org/changeset/base/347115 Log: Merge r346846 from head to stable/12: Update the audit(4) man page to talk about dtaudit(4), and also add a dtaudit(4) cross reference to auditpipe(4). Sponsored by: DARPA, AFRL Modified: stable/12/share/man/man4/audit.4 stable/12/share/man/man4/auditpipe.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/audit.4 ============================================================================== --- stable/12/share/man/man4/audit.4 Sat May 4 12:34:11 2019 (r347114) +++ stable/12/share/man/man4/audit.4 Sat May 4 12:35:12 2019 (r347115) @@ -1,6 +1,11 @@ -.\" Copyright (c) 2006 Robert N. M. Watson +.\" Copyright (c) 2006, 2019 Robert N. M. Watson .\" All rights reserved. .\" +.\" This software was developed in part by BAE Systems, the University of +.\" Cambridge Computer Laboratory, and Memorial University under DARPA/AFRL +.\" contract FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent +.\" Computing (TC) research program. +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -24,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 31, 2009 +.Dd April 28, 2019 .Dt AUDIT 4 .Os .Sh NAME @@ -74,6 +79,12 @@ Audit pipe special devices, discussed in provide a configurable live tracking mechanism to allow applications to tee the audit trail, as well as to configure custom preselection parameters to track users and events in a fine-grained manner. +.Ss DTrace Audit Provider +The DTrace Audit Provider, +.Xr dtaudit 4 , +allows D scripts to enable capture of in-kernel audit records for kernel audit +event types, and then process their contents during audit commit or BSM +generation. .Sh SEE ALSO .Xr auditreduce 1 , .Xr praudit 1 , @@ -88,6 +99,7 @@ to track users and events in a fine-grained manner. .Xr setauid 2 , .Xr libbsm 3 , .Xr auditpipe 4 , +.Xr dtaudit 4 , .Xr audit.log 5 , .Xr audit_class 5 , .Xr audit_control 5 , Modified: stable/12/share/man/man4/auditpipe.4 ============================================================================== --- stable/12/share/man/man4/auditpipe.4 Sat May 4 12:34:11 2019 (r347114) +++ stable/12/share/man/man4/auditpipe.4 Sat May 4 12:35:12 2019 (r347115) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 30, 2018 +.Dd April 28, 2019 .Dt AUDITPIPE 4 .Os .Sh NAME @@ -221,6 +221,7 @@ to review the default audit trail. .Xr poll 2 , .Xr select 2 , .Xr audit 4 , +.Xr dtaudit 4 , .Xr audit_control 5 , .Xr audit 8 , .Xr auditd 8 From owner-svn-src-all@freebsd.org Sat May 4 12:49:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44CBA158D798; Sat, 4 May 2019 12:49:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE36288AED; Sat, 4 May 2019 12:49:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACEF187A9; Sat, 4 May 2019 12:49:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44Cnu5N083279; Sat, 4 May 2019 12:49:56 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44Cnt7K083274; Sat, 4 May 2019 12:49:55 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041249.x44Cnt7K083274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 12:49:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347116 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347116 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE36288AED X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 12:49:57 -0000 Author: tuexen Date: Sat May 4 12:49:55 2019 New Revision: 347116 URL: https://svnweb.freebsd.org/changeset/base/347116 Log: MFC r345465: Fix a signed/unsigned bug when receiving SCTP messages. This is joint work with rrs@. MFC r345466: Fox more signed unsigned issues. This time on the send path. This is joint work with rrs@ and was found by running syzkaller. MFC r345467: Fix build issue for the userland stack. Joint work with rrs@. Modified: stable/12/sys/netinet/sctp_output.c stable/12/sys/netinet/sctp_structs.h stable/12/sys/netinet/sctputil.c stable/12/sys/netinet/sctputil.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_output.c ============================================================================== --- stable/12/sys/netinet/sctp_output.c Sat May 4 12:35:12 2019 (r347115) +++ stable/12/sys/netinet/sctp_output.c Sat May 4 12:49:55 2019 (r347116) @@ -6813,10 +6813,10 @@ sctp_sendall_completes(void *ptr, uint32_t val SCTP_UN } static struct mbuf * -sctp_copy_out_all(struct uio *uio, int len) +sctp_copy_out_all(struct uio *uio, ssize_t len) { struct mbuf *ret, *at; - int left, willcpy, cancpy, error; + ssize_t left, willcpy, cancpy, error; ret = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_WAITOK, 1, MT_DATA); if (ret == NULL) { @@ -6831,17 +6831,17 @@ sctp_copy_out_all(struct uio *uio, int len) at = ret; while (left > 0) { /* Align data to the end */ - error = uiomove(mtod(at, caddr_t), willcpy, uio); + error = uiomove(mtod(at, caddr_t), (int)willcpy, uio); if (error) { err_out_now: sctp_m_freem(at); return (NULL); } - SCTP_BUF_LEN(at) = willcpy; + SCTP_BUF_LEN(at) = (int)willcpy; SCTP_BUF_NEXT_PKT(at) = SCTP_BUF_NEXT(at) = 0; left -= willcpy; if (left > 0) { - SCTP_BUF_NEXT(at) = sctp_get_mbuf_for_msg(left, 0, M_WAITOK, 1, MT_DATA); + SCTP_BUF_NEXT(at) = sctp_get_mbuf_for_msg((unsigned int)left, 0, M_WAITOK, 1, MT_DATA); if (SCTP_BUF_NEXT(at) == NULL) { goto err_out_now; } @@ -6889,7 +6889,7 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, ca->sndrcv.sinfo_flags &= ~SCTP_SENDALL; /* get length and mbuf chain */ if (uio) { - ca->sndlen = (int)uio->uio_resid; + ca->sndlen = uio->uio_resid; ca->m = sctp_copy_out_all(uio, ca->sndlen); if (ca->m == NULL) { SCTP_FREE(ca, SCTP_M_COPYAL); @@ -12387,7 +12387,7 @@ sctp_copy_it_in(struct sctp_tcb *stcb, struct sctp_sndrcvinfo *srcv, struct uio *uio, struct sctp_nets *net, - int max_send_len, + ssize_t max_send_len, int user_marks_eor, int *error) { @@ -12533,7 +12533,7 @@ sctp_lower_sosend(struct socket *so, struct thread *p ) { - unsigned int sndlen = 0, max_len; + ssize_t sndlen = 0, max_len; int error, len; struct mbuf *top = NULL; int queue_only = 0, queue_only_for_init = 0; @@ -12555,7 +12555,8 @@ sctp_lower_sosend(struct socket *so, int got_all_of_the_send = 0; int hold_tcblock = 0; int non_blocking = 0; - uint32_t local_add_more, local_soresv = 0; + uint32_t local_add_more; + ssize_t local_soresv = 0; uint16_t port; uint16_t sinfo_flags; sctp_assoc_t sinfo_assoc_id; @@ -12585,12 +12586,12 @@ sctp_lower_sosend(struct socket *so, SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); return (EINVAL); } - sndlen = (unsigned int)uio->uio_resid; + sndlen = uio->uio_resid; } else { top = SCTP_HEADER_TO_CHAIN(i_pak); sndlen = SCTP_HEADER_LEN(i_pak); } - SCTPDBG(SCTP_DEBUG_OUTPUT1, "Send called addr:%p send length %d\n", + SCTPDBG(SCTP_DEBUG_OUTPUT1, "Send called addr:%p send length %zu\n", (void *)addr, sndlen); if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && @@ -12859,7 +12860,7 @@ sctp_lower_sosend(struct socket *so, } /* would we block? */ if (non_blocking) { - uint32_t amount; + ssize_t amount; if (hold_tcblock == 0) { SCTP_TCB_LOCK(stcb); @@ -12880,7 +12881,7 @@ sctp_lower_sosend(struct socket *so, error = EWOULDBLOCK; goto out_unlocked; } - stcb->asoc.sb_send_resv += sndlen; + stcb->asoc.sb_send_resv += (uint32_t)sndlen; SCTP_TCB_UNLOCK(stcb); hold_tcblock = 0; } else { @@ -12944,7 +12945,7 @@ sctp_lower_sosend(struct socket *so, /* Are we aborting? */ if (srcv->sinfo_flags & SCTP_ABORT) { struct mbuf *mm; - int tot_demand, tot_out = 0, max_out; + ssize_t tot_demand, tot_out = 0, max_out; SCTP_STAT_INCR(sctps_sends_with_abort); if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || @@ -12978,7 +12979,7 @@ sctp_lower_sosend(struct socket *so, error = EMSGSIZE; goto out; } - mm = sctp_get_mbuf_for_msg(tot_demand, 0, M_WAITOK, 1, MT_DATA); + mm = sctp_get_mbuf_for_msg((unsigned int)tot_demand, 0, M_WAITOK, 1, MT_DATA); } if (mm == NULL) { SCTP_LTRACE_ERR_RET(NULL, stcb, net, SCTP_FROM_SCTP_OUTPUT, ENOMEM); @@ -12998,7 +12999,7 @@ sctp_lower_sosend(struct socket *so, ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); ph->param_length = htons((uint16_t)(sizeof(struct sctp_paramhdr) + tot_out)); ph++; - SCTP_BUF_LEN(mm) = tot_out + sizeof(struct sctp_paramhdr); + SCTP_BUF_LEN(mm) = (int)(tot_out + sizeof(struct sctp_paramhdr)); if (top == NULL) { error = uiomove((caddr_t)ph, (int)tot_out, uio); if (error) { @@ -13079,7 +13080,7 @@ sctp_lower_sosend(struct socket *so, * For non-eeor the whole message must fit in * the socket send buffer. */ - local_add_more = sndlen; + local_add_more = (uint32_t)sndlen; } len = 0; if (non_blocking) { @@ -13229,14 +13230,14 @@ skip_preblock: if ((max_len > SCTP_BASE_SYSCTL(sctp_add_more_threshold)) || (max_len && (SCTP_SB_LIMIT_SND(so) < SCTP_BASE_SYSCTL(sctp_add_more_threshold))) || - (uio->uio_resid && (uio->uio_resid <= (int)max_len))) { + (uio->uio_resid && (uio->uio_resid <= max_len))) { sndout = 0; new_tail = NULL; if (hold_tcblock) { SCTP_TCB_UNLOCK(stcb); hold_tcblock = 0; } - mm = sctp_copy_resume(uio, max_len, user_marks_eor, &error, &sndout, &new_tail); + mm = sctp_copy_resume(uio, (int)max_len, user_marks_eor, &error, &sndout, &new_tail); if ((mm == NULL) || error) { if (mm) { sctp_m_freem(mm); @@ -13299,7 +13300,7 @@ skip_preblock: SCTP_TCB_LOCK(stcb); hold_tcblock = 1; } - sctp_prune_prsctp(stcb, asoc, srcv, sndlen); + sctp_prune_prsctp(stcb, asoc, srcv, (int)sndlen); inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); if (SCTP_SB_LIMIT_SND(so) > inqueue_bytes) max_len = SCTP_SB_LIMIT_SND(so) - inqueue_bytes; @@ -13421,7 +13422,7 @@ skip_preblock: min(SCTP_BASE_SYSCTL(sctp_add_more_threshold), SCTP_SB_LIMIT_SND(so)))) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_BLK_LOGGING_ENABLE) { sctp_log_block(SCTP_BLOCK_LOG_INTO_BLK, - asoc, (size_t)uio->uio_resid); + asoc, uio->uio_resid); } be.error = 0; stcb->block_entry = &be; Modified: stable/12/sys/netinet/sctp_structs.h ============================================================================== --- stable/12/sys/netinet/sctp_structs.h Sat May 4 12:35:12 2019 (r347115) +++ stable/12/sys/netinet/sctp_structs.h Sat May 4 12:49:55 2019 (r347116) @@ -166,7 +166,7 @@ struct sctp_copy_all { struct sctp_inpcb *inp; /* ep */ struct mbuf *m; struct sctp_sndrcvinfo sndrcv; - int sndlen; + ssize_t sndlen; int cnt_sent; int cnt_failed; }; Modified: stable/12/sys/netinet/sctputil.c ============================================================================== --- stable/12/sys/netinet/sctputil.c Sat May 4 12:35:12 2019 (r347115) +++ stable/12/sys/netinet/sctputil.c Sat May 4 12:49:55 2019 (r347116) @@ -546,7 +546,7 @@ sctp_wakeup_log(struct sctp_tcb *stcb, uint32_t wake_c } void -sctp_log_block(uint8_t from, struct sctp_association *asoc, size_t sendlen) +sctp_log_block(uint8_t from, struct sctp_association *asoc, ssize_t sendlen) { #if defined(SCTP_LOCAL_TRACE_BUF) struct sctp_cwnd_log sctp_clog; @@ -5219,8 +5219,9 @@ sctp_sorecvmsg(struct socket *so, * */ struct sctp_inpcb *inp = NULL; - int my_len = 0; - int cp_len = 0, error = 0; + ssize_t my_len = 0; + ssize_t cp_len = 0; + int error = 0; struct sctp_queued_to_read *control = NULL, *ctl = NULL, *nxt = NULL; struct mbuf *m = NULL; struct sctp_tcb *stcb = NULL; @@ -5229,7 +5230,7 @@ sctp_sorecvmsg(struct socket *so, int out_flags = 0, in_flags = 0; int block_allowed = 1; uint32_t freed_so_far = 0; - uint32_t copied_so_far = 0; + ssize_t copied_so_far = 0; int in_eeor_mode = 0; int no_rcv_needed = 0; uint32_t rwnd_req = 0; @@ -5573,7 +5574,7 @@ found_one: * will go to the sctp_user_rcvd() that will not * lock until it KNOWs it MUST send a WUP-SACK. */ - freed_so_far = stcb->freed_by_sorcv_sincelast; + freed_so_far = (uint32_t)stcb->freed_by_sorcv_sincelast; stcb->freed_by_sorcv_sincelast = 0; } } @@ -5728,8 +5729,8 @@ get_more_data: m = control->data; while (m) { /* Move out all we can */ - cp_len = (int)uio->uio_resid; - my_len = (int)SCTP_BUF_LEN(m); + cp_len = uio->uio_resid; + my_len = SCTP_BUF_LEN(m); if (cp_len > my_len) { /* not enough in this buf */ cp_len = my_len; @@ -5739,7 +5740,7 @@ get_more_data: hold_rlock = 0; } if (cp_len > 0) - error = uiomove(mtod(m, char *), cp_len, uio); + error = uiomove(mtod(m, char *), (int)cp_len, uio); /* re-read */ if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { goto release; @@ -5784,7 +5785,7 @@ get_more_data: control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBRESULT, 0); } copied_so_far += cp_len; - freed_so_far += cp_len; + freed_so_far += (uint32_t)cp_len; freed_so_far += MSIZE; atomic_subtract_int(&control->length, cp_len); control->data = sctp_m_free(m); @@ -5824,9 +5825,9 @@ get_more_data: } if ((in_flags & MSG_PEEK) == 0) { SCTP_BUF_RESV_UF(m, cp_len); - SCTP_BUF_LEN(m) -= cp_len; + SCTP_BUF_LEN(m) -= (int)cp_len; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) { - sctp_sblog(&so->so_rcv, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBFREE, cp_len); + sctp_sblog(&so->so_rcv, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBFREE, (int)cp_len); } atomic_subtract_int(&so->so_rcv.sb_cc, cp_len); if ((control->do_not_ref_stcb == 0) && @@ -5834,7 +5835,7 @@ get_more_data: atomic_subtract_int(&stcb->asoc.sb_cc, cp_len); } copied_so_far += cp_len; - freed_so_far += cp_len; + freed_so_far += (uint32_t)cp_len; freed_so_far += MSIZE; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) { sctp_sblog(&so->so_rcv, control->do_not_ref_stcb ? NULL : stcb, @@ -6062,7 +6063,7 @@ wait_some_more: control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBFREE, SCTP_BUF_LEN(m)); } sctp_sbfree(control, stcb, &so->so_rcv, m); - freed_so_far += SCTP_BUF_LEN(m); + freed_so_far += (uint32_t)SCTP_BUF_LEN(m); freed_so_far += MSIZE; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) { sctp_sblog(&so->so_rcv, Modified: stable/12/sys/netinet/sctputil.h ============================================================================== --- stable/12/sys/netinet/sctputil.h Sat May 4 12:35:12 2019 (r347115) +++ stable/12/sys/netinet/sctputil.h Sat May 4 12:49:55 2019 (r347116) @@ -367,7 +367,7 @@ void sctp_log_closing(struct sctp_inpcb *inp, struct s void sctp_log_lock(struct sctp_inpcb *inp, struct sctp_tcb *stcb, uint8_t from); void sctp_log_maxburst(struct sctp_tcb *stcb, struct sctp_nets *, int, int, uint8_t); -void sctp_log_block(uint8_t, struct sctp_association *, size_t); +void sctp_log_block(uint8_t, struct sctp_association *, ssize_t); void sctp_log_rwnd(uint8_t, uint32_t, uint32_t, uint32_t); void sctp_log_rwnd_set(uint8_t, uint32_t, uint32_t, uint32_t, uint32_t); int sctp_fill_stat_log(void *, size_t *); From owner-svn-src-all@freebsd.org Sat May 4 12:52:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FFAF158D9A6; Sat, 4 May 2019 12:52:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 085A288EA7; Sat, 4 May 2019 12:52:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D379C893D; Sat, 4 May 2019 12:52:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44CqOKH087992; Sat, 4 May 2019 12:52:24 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44CqOlQ087991; Sat, 4 May 2019 12:52:24 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041252.x44CqOlQ087991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 12:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347117 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347117 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 085A288EA7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 12:52:25 -0000 Author: tuexen Date: Sat May 4 12:52:24 2019 New Revision: 347117 URL: https://svnweb.freebsd.org/changeset/base/347117 Log: MFC r345494: Fix the handling of fragmented unordered messages when using DATA chunks and FORWARD-TSN. This bug was reported in https://github.com/sctplab/usrsctp/issues/286 for the userland stack. This is joint work with rrs@. Modified: stable/12/sys/netinet/sctp_indata.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_indata.c ============================================================================== --- stable/12/sys/netinet/sctp_indata.c Sat May 4 12:49:55 2019 (r347116) +++ stable/12/sys/netinet/sctp_indata.c Sat May 4 12:52:24 2019 (r347117) @@ -947,6 +947,15 @@ sctp_inject_old_unordered_data(struct sctp_tcb *stcb, SCTPDBG(SCTP_DEBUG_XXX, "chunk is a first fsn: %u becomes fsn_included\n", chk->rec.data.fsn); + at = TAILQ_FIRST(&control->reasm); + if (at && SCTP_TSN_GT(chk->rec.data.fsn, at->rec.data.fsn)) { + /* + * The first chunk in the reassembly is a smaller + * TSN than this one, even though this has a first, + * it must be from a subsequent msg. + */ + goto place_chunk; + } if (control->first_frag_seen) { /* * In old un-ordered we can reassembly on one From owner-svn-src-all@freebsd.org Sat May 4 12:54:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3140B158DAC1; Sat, 4 May 2019 12:54:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDB8089121; Sat, 4 May 2019 12:54:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8B31894C; Sat, 4 May 2019 12:54:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44CsOGb088262; Sat, 4 May 2019 12:54:24 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44CsOcQ088261; Sat, 4 May 2019 12:54:24 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041254.x44CsOcQ088261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 12:54:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347118 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347118 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CDB8089121 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 12:54:25 -0000 Author: tuexen Date: Sat May 4 12:54:24 2019 New Revision: 347118 URL: https://svnweb.freebsd.org/changeset/base/347118 Log: MFC r345504: Improve locking when tearing down an SCTP association. This is joint work with rrs@ and the issue was found by syzkaller. Modified: stable/12/sys/netinet/sctp_pcb.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_pcb.c ============================================================================== --- stable/12/sys/netinet/sctp_pcb.c Sat May 4 12:52:24 2019 (r347117) +++ stable/12/sys/netinet/sctp_pcb.c Sat May 4 12:54:24 2019 (r347118) @@ -4982,6 +4982,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc * in case. */ /* anything on the wheel needs to be removed */ + SCTP_TCB_SEND_LOCK(stcb); for (i = 0; i < asoc->streamoutcnt; i++) { struct sctp_stream_out *outs; @@ -4990,7 +4991,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc TAILQ_FOREACH_SAFE(sp, &outs->outqueue, next, nsp) { atomic_subtract_int(&asoc->stream_queue_cnt, 1); TAILQ_REMOVE(&outs->outqueue, sp, next); - stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, outs, sp, 0); + stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, outs, sp, 1); sctp_free_spbufspace(stcb, asoc, sp); if (sp->data) { if (so) { @@ -5012,6 +5013,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, struct sctp_tc sctp_free_a_strmoq(stcb, sp, SCTP_SO_LOCKED); } } + SCTP_TCB_SEND_UNLOCK(stcb); /* sa_ignore FREED_MEMORY */ TAILQ_FOREACH_SAFE(strrst, &asoc->resetHead, next_resp, nstrrst) { TAILQ_REMOVE(&asoc->resetHead, strrst, next_resp); From owner-svn-src-all@freebsd.org Sat May 4 12:56:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AD26158DBB1; Sat, 4 May 2019 12:56:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2D5989341; Sat, 4 May 2019 12:56:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB200894F; Sat, 4 May 2019 12:56:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44Cu904088585; Sat, 4 May 2019 12:56:09 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44Cu9ZY088584; Sat, 4 May 2019 12:56:09 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041256.x44Cu9ZY088584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 12:56:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347119 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347119 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E2D5989341 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 12:56:10 -0000 Author: tuexen Date: Sat May 4 12:56:09 2019 New Revision: 347119 URL: https://svnweb.freebsd.org/changeset/base/347119 Log: MFC r345505: Initialize scheduler specific data for the FCFS scheduler. This is joint work with rrs@. The issue was reported by using syzkaller. Modified: stable/12/sys/netinet/sctp_ss_functions.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_ss_functions.c ============================================================================== --- stable/12/sys/netinet/sctp_ss_functions.c Sat May 4 12:54:24 2019 (r347118) +++ stable/12/sys/netinet/sctp_ss_functions.c Sat May 4 12:56:09 2019 (r347119) @@ -838,6 +838,8 @@ sctp_ss_fcfs_init_stream(struct sctp_tcb *stcb, struct stcb->asoc.ss_data.last_out_stream = strq; } } + strq->ss_params.fb.next_spoke.tqe_next = NULL; + strq->ss_params.fb.next_spoke.tqe_prev = NULL; return; } From owner-svn-src-all@freebsd.org Sat May 4 12:57:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1C65158DC79; Sat, 4 May 2019 12:57:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 291238955F; Sat, 4 May 2019 12:57:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 026D98952; Sat, 4 May 2019 12:57:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44Cvtrm088823; Sat, 4 May 2019 12:57:55 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44CvtV9088822; Sat, 4 May 2019 12:57:55 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041257.x44CvtV9088822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 12:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347120 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347120 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 291238955F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 12:57:57 -0000 Author: tuexen Date: Sat May 4 12:57:55 2019 New Revision: 347120 URL: https://svnweb.freebsd.org/changeset/base/347120 Log: MFC r345525: Fix a double free of an SCTP association in an error path. This is joint work with rrs@. The issue was found by running syzkaller. Modified: stable/12/sys/netinet/sctp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/12/sys/netinet/sctp_usrreq.c Sat May 4 12:56:09 2019 (r347119) +++ stable/12/sys/netinet/sctp_usrreq.c Sat May 4 12:57:55 2019 (r347120) @@ -1481,8 +1481,6 @@ sctp_do_connect_x(struct socket *so, struct sctp_inpcb sctp_connectx_helper_add(stcb, sa, (totaddr - 1), &error); /* Fill in the return id */ if (error) { - (void)sctp_free_assoc(inp, stcb, SCTP_PCBFREE_FORCE, - SCTP_FROM_SCTP_USRREQ + SCTP_LOC_7); goto out_now; } a_id = (sctp_assoc_t *)optval; From owner-svn-src-all@freebsd.org Sat May 4 13:00:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60F25158DF3A; Sat, 4 May 2019 13:00:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05191897E8; Sat, 4 May 2019 13:00:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2DEE8962; Sat, 4 May 2019 13:00:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44D0d9C089184; Sat, 4 May 2019 13:00:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44D0ddH089183; Sat, 4 May 2019 13:00:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041300.x44D0ddH089183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 13:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347121 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347121 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 05191897E8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 13:00:40 -0000 Author: tuexen Date: Sat May 4 13:00:39 2019 New Revision: 347121 URL: https://svnweb.freebsd.org/changeset/base/347121 Log: MFC r346134: Fix an SCTP related locking issue. Don't report that the TCB_SEND_LOCK is owned, when it is not. This issue was found by running syzkaller. Modified: stable/12/sys/netinet/sctputil.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/sctputil.c ============================================================================== --- stable/12/sys/netinet/sctputil.c Sat May 4 12:57:55 2019 (r347120) +++ stable/12/sys/netinet/sctputil.c Sat May 4 13:00:39 2019 (r347121) @@ -3995,7 +3995,7 @@ sctp_abort_notification(struct sctp_tcb *stcb, uint8_t return; } /* Tell them we lost the asoc */ - sctp_report_all_outbound(stcb, error, 1, so_locked); + sctp_report_all_outbound(stcb, error, 0, so_locked); if (from_peer) { sctp_ulp_notify(SCTP_NOTIFY_ASSOC_REM_ABORTED, stcb, error, abort, so_locked); } else { From owner-svn-src-all@freebsd.org Sat May 4 13:02:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7DF8158DFF9; Sat, 4 May 2019 13:02:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B5E189B93; Sat, 4 May 2019 13:02:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A4328B0D; Sat, 4 May 2019 13:02:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44D2kqv094412; Sat, 4 May 2019 13:02:46 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44D2k0c094411; Sat, 4 May 2019 13:02:46 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041302.x44D2k0c094411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 13:02:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347122 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 347122 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4B5E189B93 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 13:02:47 -0000 Author: tuexen Date: Sat May 4 13:02:46 2019 New Revision: 347122 URL: https://svnweb.freebsd.org/changeset/base/347122 Log: MFC r346182: When sending IPv4 packets on a SOCK_RAW socket using the IP_HDRINCL option, ensure that the ip_hl field is valid. Furthermore, ensure that the complete IPv4 header is contained in the first mbuf. Finally, move the length checks before relying on them when accessing fields of the IPv4 header. Reported by: jtl@ Reviewed by: jtl@ Differential Revision: https://reviews.freebsd.org/D19181 Modified: stable/12/sys/netinet/raw_ip.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/raw_ip.c ============================================================================== --- stable/12/sys/netinet/raw_ip.c Sat May 4 13:00:39 2019 (r347121) +++ stable/12/sys/netinet/raw_ip.c Sat May 4 13:02:46 2019 (r347122) @@ -454,7 +454,7 @@ rip_output(struct mbuf *m, struct socket *so, ...) u_long dst; int flags = ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0) | IP_ALLOWBROADCAST; - int cnt; + int cnt, hlen; u_char opttype, optlen, *cp; va_start(ap, so); @@ -510,33 +510,40 @@ rip_output(struct mbuf *m, struct socket *so, ...) m_freem(m); return(EMSGSIZE); } - INP_RLOCK(inp); ip = mtod(m, struct ip *); - error = prison_check_ip4(inp->inp_cred, &ip->ip_src); - if (error != 0) { - INP_RUNLOCK(inp); - m_freem(m); - return (error); + hlen = ip->ip_hl << 2; + if (m->m_len < hlen) { + m = m_pullup(m, hlen); + if (m == NULL) + return (EINVAL); + ip = mtod(m, struct ip *); } + INP_RLOCK(inp); /* * Don't allow both user specified and setsockopt options, * and don't allow packet length sizes that will crash. */ - if (((ip->ip_hl != (sizeof (*ip) >> 2)) && inp->inp_options) - || (ntohs(ip->ip_len) != m->m_pkthdr.len) - || (ntohs(ip->ip_len) < (ip->ip_hl << 2))) { + if ((hlen < sizeof (*ip)) + || ((hlen > sizeof (*ip)) && inp->inp_options) + || (ntohs(ip->ip_len) != m->m_pkthdr.len)) { INP_RUNLOCK(inp); m_freem(m); return (EINVAL); } + error = prison_check_ip4(inp->inp_cred, &ip->ip_src); + if (error != 0) { + INP_RUNLOCK(inp); + m_freem(m); + return (error); + } /* * Don't allow IP options which do not have the required * structure as specified in section 3.1 of RFC 791 on * pages 15-23. */ cp = (u_char *)(ip + 1); - cnt = (ip->ip_hl << 2) - sizeof (struct ip); + cnt = hlen - sizeof (struct ip); for (; cnt > 0; cnt -= optlen, cp += optlen) { opttype = cp[IPOPT_OPTVAL]; if (opttype == IPOPT_EOL) From owner-svn-src-all@freebsd.org Sat May 4 13:05:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81041158E145; Sat, 4 May 2019 13:05:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27A0589DCF; Sat, 4 May 2019 13:05:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F19BD8B0E; Sat, 4 May 2019 13:05:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44D5LOv094582; Sat, 4 May 2019 13:05:21 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44D5LvI094581; Sat, 4 May 2019 13:05:21 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041305.x44D5LvI094581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 13:05:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347123 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 347123 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 27A0589DCF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 13:05:22 -0000 Author: tuexen Date: Sat May 4 13:05:21 2019 New Revision: 347123 URL: https://svnweb.freebsd.org/changeset/base/347123 Log: MFC r346197: When sending a routing message, don't allow the user to set the RTF_RNH_LOCKED flag in rtm_flags, since this flag is used only internally. Reviewed by: ae@ Differential Revision: https://reviews.freebsd.org/D19898 Modified: stable/12/sys/net/rtsock.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/rtsock.c ============================================================================== --- stable/12/sys/net/rtsock.c Sat May 4 13:02:46 2019 (r347122) +++ stable/12/sys/net/rtsock.c Sat May 4 13:05:21 2019 (r347123) @@ -615,6 +615,8 @@ route_output(struct mbuf *m, struct socket *so, ...) if (rt_xaddrs((caddr_t)(rtm + 1), len + (caddr_t)rtm, &info)) senderr(EINVAL); + if (rtm->rtm_flags & RTF_RNH_LOCKED) + senderr(EINVAL); info.rti_flags = rtm->rtm_flags; if (info.rti_info[RTAX_DST] == NULL || info.rti_info[RTAX_DST]->sa_family >= AF_MAX || From owner-svn-src-all@freebsd.org Sat May 4 13:43:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC82B158F029; Sat, 4 May 2019 13:43:49 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E3488AE5A; Sat, 4 May 2019 13:43:49 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F5BA91A7; Sat, 4 May 2019 13:43:49 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44Dhm1l015368; Sat, 4 May 2019 13:43:48 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44DhmN7015367; Sat, 4 May 2019 13:43:48 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201905041343.x44DhmN7015367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Sat, 4 May 2019 13:43:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347124 - in stable: 11/usr.sbin/bhyve 12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: in stable: 11/usr.sbin/bhyve 12/usr.sbin/bhyve X-SVN-Commit-Revision: 347124 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5E3488AE5A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 13:43:50 -0000 Author: rgrimes Date: Sat May 4 13:43:48 2019 New Revision: 347124 URL: https://svnweb.freebsd.org/changeset/base/347124 Log: MFC: r346715: Acpi MADT table correction for VM_MAXCPU > 21 The bhyve acpi MADT table was given a static space of 256 (0x100) bytes, this is enough space to allow VM_MAXCPU to be 21, this patch changes that so VM_MAXCPU can be of arbitrary value and not overflow the space by actually calculating the space needed for the table. PR: 212782 Reviewed by: Patrick Mooney Approved by: bde (mentor, implicit), jhb (maintainer) Differential Revision: https://reviews.freebsd.org/D18815 Modified: stable/12/usr.sbin/bhyve/acpi.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.sbin/bhyve/acpi.c Directory Properties: stable/11/ (props changed) Modified: stable/12/usr.sbin/bhyve/acpi.c ============================================================================== --- stable/12/usr.sbin/bhyve/acpi.c Sat May 4 13:05:21 2019 (r347123) +++ stable/12/usr.sbin/bhyve/acpi.c Sat May 4 13:43:48 2019 (r347124) @@ -39,7 +39,9 @@ * The tables are placed in the guest's ROM area just below 1MB physical, * above the MPTable. * - * Layout + * Layout (No longer correct at FADT and beyond due to properly + * calculating the size of the MADT to allow for changes to + * VM_MAXCPU above 21 which overflows this layout.) * ------ * RSDP -> 0xf2400 (36 bytes fixed) * RSDT -> 0xf2440 (36 bytes + 4*7 table addrs, 4 used) @@ -74,18 +76,31 @@ __FBSDID("$FreeBSD$"); #include "pci_emul.h" /* - * Define the base address of the ACPI tables, and the offsets to - * the individual tables + * Define the base address of the ACPI tables, the sizes of some tables, + * and the offsets to the individual tables, */ #define BHYVE_ACPI_BASE 0xf2400 #define RSDT_OFFSET 0x040 #define XSDT_OFFSET 0x080 #define MADT_OFFSET 0x100 -#define FADT_OFFSET 0x200 -#define HPET_OFFSET 0x340 -#define MCFG_OFFSET 0x380 -#define FACS_OFFSET 0x3C0 -#define DSDT_OFFSET 0x400 +/* + * The MADT consists of: + * 44 Fixed Header + * 8 * maxcpu Processor Local APIC entries + * 12 I/O APIC entry + * 2 * 10 Interrupt Source Override entires + * 6 Local APIC NMI entry + */ +#define MADT_SIZE (44 + VM_MAXCPU*8 + 12 + 2*10 + 6) +#define FADT_OFFSET (MADT_OFFSET + MADT_SIZE) +#define FADT_SIZE 0x140 +#define HPET_OFFSET (FADT_OFFSET + FADT_SIZE) +#define HPET_SIZE 0x40 +#define MCFG_OFFSET (HPET_OFFSET + HPET_SIZE) +#define MCFG_SIZE 0x40 +#define FACS_OFFSET (MCFG_OFFSET + MCFG_SIZE) +#define FACS_SIZE 0x40 +#define DSDT_OFFSET (FACS_OFFSET + FACS_SIZE) #define BHYVE_ASL_TEMPLATE "bhyve.XXXXXXX" #define BHYVE_ASL_SUFFIX ".aml" From owner-svn-src-all@freebsd.org Sat May 4 13:43:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE9EB158F02A; Sat, 4 May 2019 13:43:49 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EC518AE5B; Sat, 4 May 2019 13:43:49 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6AB3491A8; Sat, 4 May 2019 13:43:49 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44Dhnlj015374; Sat, 4 May 2019 13:43:49 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44DhnSx015373; Sat, 4 May 2019 13:43:49 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201905041343.x44DhnSx015373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Sat, 4 May 2019 13:43:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347124 - in stable: 11/usr.sbin/bhyve 12/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: in stable: 11/usr.sbin/bhyve 12/usr.sbin/bhyve X-SVN-Commit-Revision: 347124 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7EC518AE5B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 13:43:50 -0000 Author: rgrimes Date: Sat May 4 13:43:48 2019 New Revision: 347124 URL: https://svnweb.freebsd.org/changeset/base/347124 Log: MFC: r346715: Acpi MADT table correction for VM_MAXCPU > 21 The bhyve acpi MADT table was given a static space of 256 (0x100) bytes, this is enough space to allow VM_MAXCPU to be 21, this patch changes that so VM_MAXCPU can be of arbitrary value and not overflow the space by actually calculating the space needed for the table. PR: 212782 Reviewed by: Patrick Mooney Approved by: bde (mentor, implicit), jhb (maintainer) Differential Revision: https://reviews.freebsd.org/D18815 Modified: stable/11/usr.sbin/bhyve/acpi.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.sbin/bhyve/acpi.c Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.sbin/bhyve/acpi.c ============================================================================== --- stable/11/usr.sbin/bhyve/acpi.c Sat May 4 13:05:21 2019 (r347123) +++ stable/11/usr.sbin/bhyve/acpi.c Sat May 4 13:43:48 2019 (r347124) @@ -39,7 +39,9 @@ * The tables are placed in the guest's ROM area just below 1MB physical, * above the MPTable. * - * Layout + * Layout (No longer correct at FADT and beyond due to properly + * calculating the size of the MADT to allow for changes to + * VM_MAXCPU above 21 which overflows this layout.) * ------ * RSDP -> 0xf2400 (36 bytes fixed) * RSDT -> 0xf2440 (36 bytes + 4*7 table addrs, 4 used) @@ -74,18 +76,31 @@ __FBSDID("$FreeBSD$"); #include "pci_emul.h" /* - * Define the base address of the ACPI tables, and the offsets to - * the individual tables + * Define the base address of the ACPI tables, the sizes of some tables, + * and the offsets to the individual tables, */ #define BHYVE_ACPI_BASE 0xf2400 #define RSDT_OFFSET 0x040 #define XSDT_OFFSET 0x080 #define MADT_OFFSET 0x100 -#define FADT_OFFSET 0x200 -#define HPET_OFFSET 0x340 -#define MCFG_OFFSET 0x380 -#define FACS_OFFSET 0x3C0 -#define DSDT_OFFSET 0x400 +/* + * The MADT consists of: + * 44 Fixed Header + * 8 * maxcpu Processor Local APIC entries + * 12 I/O APIC entry + * 2 * 10 Interrupt Source Override entires + * 6 Local APIC NMI entry + */ +#define MADT_SIZE (44 + VM_MAXCPU*8 + 12 + 2*10 + 6) +#define FADT_OFFSET (MADT_OFFSET + MADT_SIZE) +#define FADT_SIZE 0x140 +#define HPET_OFFSET (FADT_OFFSET + FADT_SIZE) +#define HPET_SIZE 0x40 +#define MCFG_OFFSET (HPET_OFFSET + HPET_SIZE) +#define MCFG_SIZE 0x40 +#define FACS_OFFSET (MCFG_OFFSET + MCFG_SIZE) +#define FACS_SIZE 0x40 +#define DSDT_OFFSET (FACS_OFFSET + FACS_SIZE) #define BHYVE_ASL_TEMPLATE "bhyve.XXXXXXX" #define BHYVE_ASL_SUFFIX ".aml" From owner-svn-src-all@freebsd.org Sat May 4 13:55:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A444158F44A; Sat, 4 May 2019 13:55:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1B6A8B49E; Sat, 4 May 2019 13:55:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A6314934C; Sat, 4 May 2019 13:55:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44DtqKj020771; Sat, 4 May 2019 13:55:52 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44Dtq8p020770; Sat, 4 May 2019 13:55:52 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041355.x44Dtq8p020770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 13:55:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347125 - stable/12/sys/netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet6 X-SVN-Commit-Revision: 347125 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C1B6A8B49E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 13:55:53 -0000 Author: tuexen Date: Sat May 4 13:55:51 2019 New Revision: 347125 URL: https://svnweb.freebsd.org/changeset/base/347125 Log: MFC r346400: Improve input validation for the socket option IPV6_CHECKSUM. When using the IPPROTO_IPV6 level socket option IPV6_CHECKSUM on a raw IPv6 socket, ensure that the value is either -1 or a non-negative even number. MFC r346401: Avoid a buffer overwrite in rip6_output() when computing the checksum as requested by the user via the IPPROTO_IPV6 level socket option IPV6_CHECKSUM. The check if there are enough bytes in the packet to store the checksum at the requested offset was wrong by 1. MFC r346402: When a checksum has to be computed for a received IPv6 packet because it is requested by the application using the IPPROTO_IPV6 level socket option IPV6_CHECKSUM on a raw socket, ensure that the packet contains enough bytes to contain the checksum at the specified offset. MFC r346406: When an IPv6 packet is received for a raw socket which has the IPPROTO_IPV6 level socket option IPV6_CHECKSUM enabled and the checksum check fails, drop the message. Without this fix, an ICMP6 message was sent indicating a parameter problem. Thanks to bz@ for suggesting a way to simplify this fix. Reviewed by: bz@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D19966 Differential Revision: https://reviews.freebsd.org/D19967 Differential Revision: https://reviews.freebsd.org/D19968 Differential Revision: https://reviews.freebsd.org/D19969 Modified: stable/12/sys/netinet6/ip6_output.c stable/12/sys/netinet6/raw_ip6.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet6/ip6_output.c ============================================================================== --- stable/12/sys/netinet6/ip6_output.c Sat May 4 13:43:48 2019 (r347124) +++ stable/12/sys/netinet6/ip6_output.c Sat May 4 13:55:51 2019 (r347125) @@ -2216,8 +2216,11 @@ ip6_raw_ctloutput(struct socket *so, struct sockopt *s sizeof(optval)); if (error) break; - if ((optval % 2) != 0) { - /* the API assumes even offset values */ + if (optval < -1 || (optval % 2) != 0) { + /* + * The API assumes non-negative even offset + * values or -1 as a special value. + */ error = EINVAL; } else if (so->so_proto->pr_protocol == IPPROTO_ICMPV6) { Modified: stable/12/sys/netinet6/raw_ip6.c ============================================================================== --- stable/12/sys/netinet6/raw_ip6.c Sat May 4 13:43:48 2019 (r347124) +++ stable/12/sys/netinet6/raw_ip6.c Sat May 4 13:55:51 2019 (r347125) @@ -239,9 +239,16 @@ rip6_input(struct mbuf **mp, int *offp, int proto) } if (in6p->in6p_cksum != -1) { RIP6STAT_INC(rip6s_isum); - if (in6_cksum(m, proto, *offp, + if (m->m_pkthdr.len - (*offp + in6p->in6p_cksum) < 2 || + in6_cksum(m, proto, *offp, m->m_pkthdr.len - *offp)) { RIP6STAT_INC(rip6s_badsum); + /* + * Drop the received message, don't send an + * ICMP6 message. Set proto to IPPROTO_NONE + * to achieve that. + */ + proto = IPPROTO_NONE; goto skip_2; } } @@ -495,7 +502,7 @@ rip6_output(struct mbuf *m, struct socket *so, ...) off = offsetof(struct icmp6_hdr, icmp6_cksum); else off = in6p->in6p_cksum; - if (plen < off + 1) { + if (plen < off + 2) { error = EINVAL; goto bad; } From owner-svn-src-all@freebsd.org Sat May 4 13:58:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91C6D158F4F9; Sat, 4 May 2019 13:58:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 367A38B5EF; Sat, 4 May 2019 13:58:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10917934E; Sat, 4 May 2019 13:58:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44Dwjao020945; Sat, 4 May 2019 13:58:45 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44Dwjbr020943; Sat, 4 May 2019 13:58:45 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905041358.x44Dwjbr020943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 4 May 2019 13:58:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347126 - stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip X-SVN-Commit-Revision: 347126 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 367A38B5EF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 13:58:46 -0000 Author: tuexen Date: Sat May 4 13:58:45 2019 New Revision: 347126 URL: https://svnweb.freebsd.org/changeset/base/347126 Log: MFC r346854: Some test scripts use ncat --sctp --listen port to run an SCTP discard server in the background. However, when running in the background, stdin is closed and ncat initiates a graceful shutdown of the SCTP association. This is not expected by the client. Therefore, the ncat-based discard server is replaced by a perl-based one. In addition, to remove the dependency from ncat, which needs to be installed via the nmap port, also the code testing for a free SCTP port is changed to use the perl-based client. Finally, remove some debug output from the report generated. Reviewed by: lwhsu@ Differential Revision: https://reviews.freebsd.org/D20086 Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh Sat May 4 13:55:51 2019 (r347125) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh Sat May 4 13:58:45 2019 (r347126) @@ -58,36 +58,52 @@ DIR=/var/tmp/dtest.$$ sctpport=1024 bound=5000 -while [ $sctpport -lt $bound ]; do - ncat --sctp -z $local $sctpport > /dev/null || break - sctpport=$(($sctpport + 1)) -done -if [ $sctpport -eq $bound ]; then - echo "couldn't find an available SCTP port" - exit 1 -fi mkdir $DIR cd $DIR -# ncat will exit when the association is closed. -ncat --sctp --listen $local $sctpport & - -cat > test.pl <<-EOPERL +cat > client.pl <<-EOPERL use IO::Socket; my \$s = IO::Socket::INET->new( Type => SOCK_STREAM, Proto => "sctp", LocalAddr => "$local", PeerAddr => "$local", - PeerPort => $sctpport, + PeerPort => \$ARGV[0], Timeout => 3); - die "Could not connect to host $local port $sctpport \$@" unless \$s; + die "Could not connect to host $local port \$ARGV[0] \$@" unless \$s; close \$s; - sleep(2); + sleep(\$ARGV[1]); EOPERL -$dtrace -c 'perl test.pl' -qs /dev/stdin <&- || break + sctpport=$(($sctpport + 1)) +done +if [ $sctpport -eq $bound ]; then + echo "couldn't find an available SCTP port" + exit 1 +fi + +cat > server.pl <<-EOPERL + use IO::Socket; + my \$l = IO::Socket::INET->new( + Type => SOCK_STREAM, + Proto => "sctp", + LocalAddr => "$local", + LocalPort => $sctpport, + Listen => 1, + Reuse => 1); + die "Could not listen on $local port $sctpport \$@" unless \$l; + my \$c = \$l->accept(); + close \$l; + while (<\$c>) {}; + close \$c; +EOPERL + +perl server.pl & + +$dtrace -c "perl client.pl $sctpport 2" -qs /dev/stdin <= 7 ? "yes" : "no"); - printf("ip:::receive (%d) - %s\n", ipreceive, ipreceive >= 7 ? "yes" : "no"); - printf("sctp:::send (%d) - %s\n", sctpsend, sctpsend >= 7 ? "yes" : "no"); - printf("sctp:::receive (%d) - %s\n", sctpreceive, sctpreceive >= 7 ? "yes" : "no"); + printf("ip:::send - %s\n", ipsend >= 7 ? "yes" : "no"); + printf("ip:::receive - %s\n", ipreceive >= 7 ? "yes" : "no"); + printf("sctp:::send - %s\n", sctpsend >= 7 ? "yes" : "no"); + printf("sctp:::receive - %s\n", sctpreceive >= 7 ? "yes" : "no"); } EODTRACE Modified: stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh ============================================================================== --- stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh Sat May 4 13:55:51 2019 (r347125) +++ stable/12/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh Sat May 4 13:58:45 2019 (r347126) @@ -61,36 +61,52 @@ DIR=/var/tmp/dtest.$$ sctpport=1024 bound=5000 -while [ $sctpport -lt $bound ]; do - ncat --sctp -z $local $sctpport > /dev/null || break - sctpport=$(($sctpport + 1)) -done -if [ $sctpport -eq $bound ]; then - echo "couldn't find an available SCTP port" - exit 1 -fi mkdir $DIR cd $DIR -# ncat will exit when the association is closed. -ncat --sctp --listen $local $sctpport & - -cat > test.pl <<-EOPERL +cat > client.pl <<-EOPERL use IO::Socket; my \$s = IO::Socket::INET->new( Type => SOCK_STREAM, Proto => "sctp", LocalAddr => "$local", PeerAddr => "$local", - PeerPort => $sctpport, + PeerPort => \$ARGV[0], Timeout => 3); - die "Could not connect to host $local port $sctpport \$@" unless \$s; + die "Could not connect to host $local port \$ARGV[0] \$@" unless \$s; close \$s; - sleep(2); + sleep(\$ARGV[1]); EOPERL -$dtrace -c 'perl test.pl' -qs /dev/stdin <&- || break + sctpport=$(($sctpport + 1)) +done +if [ $sctpport -eq $bound ]; then + echo "couldn't find an available SCTP port" + exit 1 +fi + +cat > server.pl <<-EOPERL + use IO::Socket; + my \$l = IO::Socket::INET->new( + Type => SOCK_STREAM, + Proto => "sctp", + LocalAddr => "$local", + LocalPort => $sctpport, + Listen => 1, + Reuse => 1); + die "Could not listen on $local port $sctpport \$@" unless \$l; + my \$c = \$l->accept(); + close \$l; + while (<\$c>) {}; + close \$c; +EOPERL + +perl server.pl & + +$dtrace -c "perl client.pl $sctpport 2" -qs /dev/stdin < Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2A281592EF5; Sat, 4 May 2019 16:24:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 785B98F4D5; Sat, 4 May 2019 16:24:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 466E6ACBE; Sat, 4 May 2019 16:24:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44GOitk098968; Sat, 4 May 2019 16:24:44 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44GOhBU098966; Sat, 4 May 2019 16:24:43 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905041624.x44GOhBU098966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 4 May 2019 16:24:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347127 - head/sys/powerpc/mpc85xx X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/mpc85xx X-SVN-Commit-Revision: 347127 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 785B98F4D5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 16:24:45 -0000 Author: jhibbits Date: Sat May 4 16:24:43 2019 New Revision: 347127 URL: https://svnweb.freebsd.org/changeset/base/347127 Log: powerpc/mpc85xx: Attach MPC85xx PCI bus and root complex at the right pass No signifcant change, just matches other PCI attachments, attaching at BUS_PASS_BUS. MFC after: 2 weeks Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_mpc85xx.c Sat May 4 13:58:45 2019 (r347126) +++ head/sys/powerpc/mpc85xx/pci_mpc85xx.c Sat May 4 16:24:43 2019 (r347127) @@ -225,7 +225,8 @@ static devclass_t fsl_pcib_devclass; DEFINE_CLASS_1(pcib, fsl_pcib_driver, fsl_pcib_methods, sizeof(struct fsl_pcib_softc), ofw_pci_driver); -DRIVER_MODULE(pcib, ofwbus, fsl_pcib_driver, fsl_pcib_devclass, 0, 0); +EARLY_DRIVER_MODULE(pcib, ofwbus, fsl_pcib_driver, fsl_pcib_devclass, 0, 0, + BUS_PASS_BUS); static int fsl_pcib_err_intr(void *v) Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c Sat May 4 13:58:45 2019 (r347126) +++ head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c Sat May 4 16:24:43 2019 (r347127) @@ -103,4 +103,5 @@ static device_method_t fsl_pcib_rc_methods[] = { static devclass_t fsl_pcib_rc_devclass; DEFINE_CLASS_1(pcib, fsl_pcib_rc_driver, fsl_pcib_rc_methods, sizeof(struct fsl_pcib_softc), ofw_pcib_pci_driver); -DRIVER_MODULE(rcpcib, pci, fsl_pcib_rc_driver, fsl_pcib_rc_devclass, 0, 0); +EARLY_DRIVER_MODULE(rcpcib, pci, fsl_pcib_rc_driver, fsl_pcib_rc_devclass, 0, 0, + BUS_PASS_BUS); From owner-svn-src-all@freebsd.org Sat May 4 17:35:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BE66159429E; Sat, 4 May 2019 17:35:15 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E12A06A90D; Sat, 4 May 2019 17:35:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5A8DB863; Sat, 4 May 2019 17:35:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44HZET6035829; Sat, 4 May 2019 17:35:14 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44HZErV035827; Sat, 4 May 2019 17:35:14 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905041735.x44HZErV035827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 4 May 2019 17:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347129 - in head/sys: amd64/include i386/include x86/x86 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: amd64/include i386/include x86/x86 X-SVN-Commit-Revision: 347129 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E12A06A90D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 17:35:15 -0000 Author: cem Date: Sat May 4 17:35:13 2019 New Revision: 347129 URL: https://svnweb.freebsd.org/changeset/base/347129 Log: x86: Define pc_monitorbuf as a logical structure Rather than just accessing it via pointer cast. No functional change intended. Discussed with: kib (earlier version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20135 Modified: head/sys/amd64/include/pcpu.h head/sys/i386/include/pcpu.h head/sys/x86/x86/cpu_machdep.c Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Sat May 4 16:27:58 2019 (r347128) +++ head/sys/amd64/include/pcpu.h Sat May 4 17:35:13 2019 (r347129) @@ -36,6 +36,13 @@ #endif #define PC_PTI_STACK_SZ 16 + +struct monitorbuf { + int idle_state; /* Used by cpu_idle_mwait. */ + char padding[128 - (1 * sizeof(int))]; +}; +_Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line"); + /* * The SMP parts are setup in pmap.c and locore.s for the BSP, and * mp_machdep.c sets up the data for the AP's to "see" when they awake. @@ -44,7 +51,7 @@ * other processors" */ #define PCPU_MD_FIELDS \ - char pc_monitorbuf[128] __aligned(128); /* cache line */ \ + struct monitorbuf pc_monitorbuf __aligned(128); /* cache line */\ struct pcpu *pc_prvspace; /* Self-reference */ \ struct pmap *pc_curpmap; \ struct amd64tss *pc_tssp; /* TSS segment active on CPU */ \ Modified: head/sys/i386/include/pcpu.h ============================================================================== --- head/sys/i386/include/pcpu.h Sat May 4 16:27:58 2019 (r347128) +++ head/sys/i386/include/pcpu.h Sat May 4 17:35:13 2019 (r347129) @@ -41,6 +41,12 @@ #include #include +struct monitorbuf { + int idle_state; /* Used by cpu_idle_mwait. */ + char padding[128 - (1 * sizeof(int))]; +}; +_Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line"); + /* * The SMP parts are setup in pmap.c and machdep.c for the BSP, and * pmap.c and mp_machdep.c sets up the data for the AP's to "see" when @@ -50,7 +56,7 @@ */ #define PCPU_MD_FIELDS \ - char pc_monitorbuf[128] __aligned(128); /* cache line */ \ + struct monitorbuf pc_monitorbuf __aligned(128); /* cache line */\ struct pcpu *pc_prvspace; /* Self-reference */ \ struct pmap *pc_curpmap; \ struct segment_descriptor pc_common_tssd; \ Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Sat May 4 16:27:58 2019 (r347128) +++ head/sys/x86/x86/cpu_machdep.c Sat May 4 17:35:13 2019 (r347129) @@ -164,7 +164,7 @@ acpi_cpu_idle_mwait(uint32_t mwait_hint) * but all Intel CPUs provide hardware coordination. */ - state = (int *)PCPU_PTR(monitorbuf); + state = &PCPU_PTR(monitorbuf)->idle_state; KASSERT(atomic_load_int(state) == STATE_SLEEPING, ("cpu_mwait_cx: wrong monitorbuf state")); atomic_store_int(state, STATE_MWAIT); @@ -422,7 +422,7 @@ cpu_idle_acpi(sbintime_t sbt) { int *state; - state = (int *)PCPU_PTR(monitorbuf); + state = &PCPU_PTR(monitorbuf)->idle_state; atomic_store_int(state, STATE_SLEEPING); /* See comments in cpu_idle_hlt(). */ @@ -441,7 +441,7 @@ cpu_idle_hlt(sbintime_t sbt) { int *state; - state = (int *)PCPU_PTR(monitorbuf); + state = &PCPU_PTR(monitorbuf)->idle_state; atomic_store_int(state, STATE_SLEEPING); /* @@ -473,7 +473,7 @@ cpu_idle_mwait(sbintime_t sbt) { int *state; - state = (int *)PCPU_PTR(monitorbuf); + state = &PCPU_PTR(monitorbuf)->idle_state; atomic_store_int(state, STATE_MWAIT); /* See comments in cpu_idle_hlt(). */ @@ -498,7 +498,7 @@ cpu_idle_spin(sbintime_t sbt) int *state; int i; - state = (int *)PCPU_PTR(monitorbuf); + state = &PCPU_PTR(monitorbuf)->idle_state; atomic_store_int(state, STATE_RUNNING); /* @@ -598,9 +598,11 @@ SYSCTL_INT(_machdep, OID_AUTO, idle_apl31, CTLFLAG_RW, int cpu_idle_wakeup(int cpu) { + struct monitorbuf *mb; int *state; - state = (int *)pcpu_find(cpu)->pc_monitorbuf; + mb = &pcpu_find(cpu)->pc_monitorbuf; + state = &mb->idle_state; switch (atomic_load_int(state)) { case STATE_SLEEPING: return (0); From owner-svn-src-all@freebsd.org Sat May 4 18:00:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E89F1594825; Sat, 4 May 2019 18:00:58 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0476B6B415; Sat, 4 May 2019 18:00:58 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D41DFBEBC; Sat, 4 May 2019 18:00:57 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44I0vne046789; Sat, 4 May 2019 18:00:57 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44I0v1B046788; Sat, 4 May 2019 18:00:57 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201905041800.x44I0v1B046788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sat, 4 May 2019 18:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347130 - head/sys/ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ufs X-SVN-Commit-Revision: 347130 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0476B6B415 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 18:00:58 -0000 Author: mckusick Date: Sat May 4 18:00:57 2019 New Revision: 347130 URL: https://svnweb.freebsd.org/changeset/base/347130 Log: Zero out the file directory entry metadata to reduce disk scavenging disclosure. Submitted by: David G. Lawrence MFC after: 1 week Modified: head/sys/ufs/ufs/ufs_lookup.c Modified: head/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- head/sys/ufs/ufs/ufs_lookup.c Sat May 4 17:35:13 2019 (r347129) +++ head/sys/ufs/ufs/ufs_lookup.c Sat May 4 18:00:57 2019 (r347130) @@ -1218,16 +1218,21 @@ ufs_dirremove(dvp, ip, flags, isrmdir) if (ip && rep->d_ino != ip->i_number) panic("ufs_dirremove: ip %ju does not match dirent ino %ju\n", (uintmax_t)ip->i_number, (uintmax_t)rep->d_ino); - if (dp->i_count == 0) { + /* + * Zero out the file directory entry metadata to reduce disk + * scavenging disclosure. + */ + bzero(&rep->d_name[0], rep->d_namlen); + rep->d_namlen = 0; + rep->d_type = 0; + rep->d_ino = 0; + + if (dp->i_count != 0) { /* - * First entry in block: set d_ino to zero. - */ - ep->d_ino = 0; - } else { - /* * Collapse new free space into previous entry. */ ep->d_reclen += rep->d_reclen; + rep->d_reclen = 0; } #ifdef UFS_DIRHASH if (dp->i_dirhash != NULL) From owner-svn-src-all@freebsd.org Sat May 4 19:04:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEF7A1595EC6; Sat, 4 May 2019 19:04:18 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5ECC56D7AE; Sat, 4 May 2019 19:04:18 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BCF6C958; Sat, 4 May 2019 19:04:18 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44J4IfY083076; Sat, 4 May 2019 19:04:18 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44J4IJp083075; Sat, 4 May 2019 19:04:18 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201905041904.x44J4IJp083075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 4 May 2019 19:04:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347131 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347131 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5ECC56D7AE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 19:04:19 -0000 Author: mjg Date: Sat May 4 19:04:17 2019 New Revision: 347131 URL: https://svnweb.freebsd.org/changeset/base/347131 Log: Annotate nprocs with __exclusive_cache_line Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_fork.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Sat May 4 18:00:57 2019 (r347130) +++ head/sys/kern/kern_fork.c Sat May 4 19:04:17 2019 (r347131) @@ -185,7 +185,7 @@ sys_rfork(struct thread *td, struct rfork_args *uap) return (error); } -int nprocs = 1; /* process 0 */ +int __exclusive_cache_line nprocs = 1; /* process 0 */ int lastpid = 0; SYSCTL_INT(_kern, OID_AUTO, lastpid, CTLFLAG_RD, &lastpid, 0, "Last used PID"); From owner-svn-src-all@freebsd.org Sat May 4 19:05:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 630351595F4C; Sat, 4 May 2019 19:05:31 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B9EE6D903; Sat, 4 May 2019 19:05:31 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB37CC95A; Sat, 4 May 2019 19:05:30 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44J5U2k083177; Sat, 4 May 2019 19:05:30 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44J5ULR083174; Sat, 4 May 2019 19:05:30 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201905041905.x44J5ULR083174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 4 May 2019 19:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347132 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347132 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B9EE6D903 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 19:05:31 -0000 Author: mjg Date: Sat May 4 19:05:30 2019 New Revision: 347132 URL: https://svnweb.freebsd.org/changeset/base/347132 Log: sysv: get rid of fork/exit hooks if the code is compiled in Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/sysv_ipc.c head/sys/kern/sysv_shm.c Modified: head/sys/kern/sysv_ipc.c ============================================================================== --- head/sys/kern/sysv_ipc.c Sat May 4 19:04:17 2019 (r347131) +++ head/sys/kern/sysv_ipc.c Sat May 4 19:05:30 2019 (r347132) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef SYSVSHM void (*shmfork_hook)(struct proc *, struct proc *) = NULL; void (*shmexit_hook)(struct vmspace *) = NULL; @@ -73,6 +74,7 @@ shmexit(struct vmspace *vm) shmexit_hook(vm); return; } +#endif /* * Check for IPC permission. Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Sat May 4 19:04:17 2019 (r347131) +++ head/sys/kern/sysv_shm.c Sat May 4 19:05:30 2019 (r347132) @@ -137,8 +137,10 @@ static void shmrealloc(void); static int shminit(void); static int sysvshm_modload(struct module *, int, void *); static int shmunload(void); +#ifndef SYSVSHM static void shmexit_myhook(struct vmspace *vm); static void shmfork_myhook(struct proc *p1, struct proc *p2); +#endif static int sysctl_shmsegs(SYSCTL_HANDLER_ARGS); static void shm_remove(struct shmid_kernel *, int); static struct prison *shm_find_prison(struct ucred *); @@ -810,8 +812,13 @@ sys_shmget(struct thread *td, struct shmget_args *uap) return (error); } +#ifdef SYSVSHM +void +shmfork(struct proc *p1, struct proc *p2) +#else static void shmfork_myhook(struct proc *p1, struct proc *p2) +#endif { struct shmmap_state *shmmap_s; size_t size; @@ -834,8 +841,13 @@ shmfork_myhook(struct proc *p1, struct proc *p2) SYSVSHM_UNLOCK(); } +#ifdef SYSVSHM +void +shmexit(struct vmspace *vm) +#else static void shmexit_myhook(struct vmspace *vm) +#endif { struct shmmap_state *base, *shm; int i; @@ -956,8 +968,10 @@ shminit(void) shm_nused = 0; shm_committed = 0; sx_init(&sysvshmsx, "sysvshmsx"); +#ifndef SYSVSHM shmexit_hook = &shmexit_myhook; shmfork_hook = &shmfork_myhook; +#endif /* Set current prisons according to their allow.sysvipc. */ shm_prison_slot = osd_jail_register(NULL, methods); @@ -1021,8 +1035,10 @@ shmunload(void) vm_object_deallocate(shmsegs[i].object); } free(shmsegs, M_SHM); +#ifndef SYSVSHM shmexit_hook = NULL; shmfork_hook = NULL; +#endif sx_destroy(&sysvshmsx); return (0); } From owner-svn-src-all@freebsd.org Sat May 4 19:40:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F24EA1596F5C; Sat, 4 May 2019 19:40:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 874D96EB3A; Sat, 4 May 2019 19:40:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75A88CE6A; Sat, 4 May 2019 19:40:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44JeV7q099740; Sat, 4 May 2019 19:40:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44JeV8q099723; Sat, 4 May 2019 19:40:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905041940.x44JeV8q099723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 4 May 2019 19:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347133 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 347133 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 874D96EB3A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 19:40:32 -0000 Author: kib Date: Sat May 4 19:40:30 2019 New Revision: 347133 URL: https://svnweb.freebsd.org/changeset/base/347133 Log: arm64: Properly restore PAN when done with userspace access in casueword. Approved by: andrew Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/arm64/arm64/support.S Modified: head/sys/arm64/arm64/support.S ============================================================================== --- head/sys/arm64/arm64/support.S Sat May 4 19:05:30 2019 (r347132) +++ head/sys/arm64/arm64/support.S Sat May 4 19:40:30 2019 (r347133) @@ -64,8 +64,8 @@ ENTRY(casueword32) b.ne 2f /* Not equal, exit */ stxr w5, w3, [x0] /* Store the new data */ cbnz w5, 1b /* Retry on failure */ - EXIT_USER_ACCESS(w6) -2: SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */ +2: EXIT_USER_ACCESS(w6) + SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */ str w4, [x2] /* Store the read data */ mov x0, #0 /* Success */ ret /* Return */ @@ -86,8 +86,8 @@ ENTRY(casueword) b.ne 2f /* Not equal, exit */ stxr w5, x3, [x0] /* Store the new data */ cbnz w5, 1b /* Retry on failure */ - EXIT_USER_ACCESS(w6) -2: SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */ +2: EXIT_USER_ACCESS(w6) + SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */ str x4, [x2] /* Store the read data */ mov x0, #0 /* Success */ ret /* Return */ From owner-svn-src-all@freebsd.org Sat May 4 20:34:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED3E5159816A; Sat, 4 May 2019 20:34:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EDF270726; Sat, 4 May 2019 20:34:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 705FDD846; Sat, 4 May 2019 20:34:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44KYSJC031544; Sat, 4 May 2019 20:34:28 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44KYRUn031538; Sat, 4 May 2019 20:34:27 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905042034.x44KYRUn031538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 4 May 2019 20:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347134 - in head/sys: amd64/include i386/include kern x86/include x86/x86 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: amd64/include i386/include kern x86/include x86/x86 X-SVN-Commit-Revision: 347134 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8EDF270726 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 20:34:29 -0000 Author: cem Date: Sat May 4 20:34:26 2019 New Revision: 347134 URL: https://svnweb.freebsd.org/changeset/base/347134 Log: x86: Implement MWAIT support for stopping a CPU IPI_STOP is used after panic or when ddb is entered manually. MONITOR/ MWAIT allows CPUs that support the feature to sleep in a low power way instead of spinning. Something similar is already used at idle. It is perhaps especially useful in oversubscribed VM environments, and is safe to use even if the panic/ddb thread is not the BSP. (Except in the presence of MWAIT errata, which are detected automatically on platforms with known wakeup problems.) It can be tuned/sysctled with "machdep.stop_mwait," which defaults to 0 (off). This commit also introduces the tunable "machdep.mwait_cpustop_broken," which defaults to 0, unless the CPU has known errata, but may be set to "1" in loader.conf to signal that mwait wakeup is broken on CPUs FreeBSD does not yet know about. Unfortunately, Bhyve doesn't yet support MONITOR extensions, so this doesn't help bhyve hypervisors running FreeBSD guests. Submitted by: Anton Rang (earlier version) Reviewed by: kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20135 Modified: head/sys/amd64/include/pcpu.h head/sys/i386/include/pcpu.h head/sys/kern/subr_smp.c head/sys/x86/include/x86_smp.h head/sys/x86/x86/cpu_machdep.c head/sys/x86/x86/mp_x86.c Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Sat May 4 19:40:30 2019 (r347133) +++ head/sys/amd64/include/pcpu.h Sat May 4 20:34:26 2019 (r347134) @@ -39,7 +39,8 @@ struct monitorbuf { int idle_state; /* Used by cpu_idle_mwait. */ - char padding[128 - (1 * sizeof(int))]; + int stop_state; /* Used by cpustop_handler. */ + char padding[128 - (2 * sizeof(int))]; }; _Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line"); @@ -89,6 +90,9 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x c #define PC_DBREG_CMD_LOAD 1 #ifdef _KERNEL + +#define MONITOR_STOPSTATE_RUNNING 0 +#define MONITOR_STOPSTATE_STOPPED 1 #if defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) Modified: head/sys/i386/include/pcpu.h ============================================================================== --- head/sys/i386/include/pcpu.h Sat May 4 19:40:30 2019 (r347133) +++ head/sys/i386/include/pcpu.h Sat May 4 20:34:26 2019 (r347134) @@ -43,7 +43,8 @@ struct monitorbuf { int idle_state; /* Used by cpu_idle_mwait. */ - char padding[128 - (1 * sizeof(int))]; + int stop_state; /* Used by cpustop_handler. */ + char padding[128 - (2 * sizeof(int))]; }; _Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line"); @@ -89,6 +90,9 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x c char __pad[3610] #ifdef _KERNEL + +#define MONITOR_STOPSTATE_RUNNING 0 +#define MONITOR_STOPSTATE_STOPPED 1 #if defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Sat May 4 19:40:30 2019 (r347133) +++ head/sys/kern/subr_smp.c Sat May 4 20:34:26 2019 (r347134) @@ -351,42 +351,68 @@ generic_restart_cpus(cpuset_t map, u_int type) #endif volatile cpuset_t *cpus; - KASSERT(type == IPI_STOP || type == IPI_STOP_HARD #if X86 - || type == IPI_SUSPEND -#endif - , ("%s: invalid stop type", __func__)); + KASSERT(type == IPI_STOP || type == IPI_STOP_HARD + || type == IPI_SUSPEND, ("%s: invalid stop type", __func__)); if (!smp_started) return (0); CTR1(KTR_SMP, "restart_cpus(%s)", cpusetobj_strprint(cpusetbuf, &map)); -#if X86 if (type == IPI_SUSPEND) cpus = &resuming_cpus; else -#endif cpus = &stopped_cpus; /* signal other cpus to restart */ -#if X86 if (type == IPI_SUSPEND) CPU_COPY_STORE_REL(&map, &toresume_cpus); else -#endif CPU_COPY_STORE_REL(&map, &started_cpus); -#if X86 + /* + * Wake up any CPUs stopped with MWAIT. From MI code we can't tell if + * MONITOR/MWAIT is enabled, but the potentially redundant writes are + * relatively inexpensive. + */ + if (type == IPI_STOP) { + struct monitorbuf *mb; + u_int id; + + CPU_FOREACH(id) { + if (!CPU_ISSET(id, &map)) + continue; + + mb = &pcpu_find(id)->pc_monitorbuf; + atomic_store_int(&mb->stop_state, + MONITOR_STOPSTATE_RUNNING); + } + } + if (!nmi_is_broadcast || nmi_kdb_lock == 0) { -#endif + /* wait for each to clear its bit */ + while (CPU_OVERLAP(cpus, &map)) + cpu_spinwait(); + } +#else /* !X86 */ + KASSERT(type == IPI_STOP || type == IPI_STOP_HARD, + ("%s: invalid stop type", __func__)); + + if (!smp_started) + return (0); + + CTR1(KTR_SMP, "restart_cpus(%s)", cpusetobj_strprint(cpusetbuf, &map)); + + cpus = &stopped_cpus; + + /* signal other cpus to restart */ + CPU_COPY_STORE_REL(&map, &started_cpus); + /* wait for each to clear its bit */ while (CPU_OVERLAP(cpus, &map)) cpu_spinwait(); -#if X86 - } #endif - return (1); } Modified: head/sys/x86/include/x86_smp.h ============================================================================== --- head/sys/x86/include/x86_smp.h Sat May 4 19:40:30 2019 (r347133) +++ head/sys/x86/include/x86_smp.h Sat May 4 20:34:26 2019 (r347134) @@ -61,6 +61,11 @@ struct cpu_info { }; extern struct cpu_info *cpu_info; +/* + * Set if MWAIT does not reliably wake when the MONITORed address is written. + */ +extern bool mwait_cpustop_broken; + #ifdef COUNT_IPIS extern u_long *ipi_invltlb_counts[MAXCPU]; extern u_long *ipi_invlrng_counts[MAXCPU]; Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Sat May 4 19:40:30 2019 (r347133) +++ head/sys/x86/x86/cpu_machdep.c Sat May 4 20:34:26 2019 (r347134) @@ -110,6 +110,13 @@ static u_int cpu_reset_proxyid; static volatile u_int cpu_reset_proxy_active; #endif +/* + * Automatically initialized per CPU errata in cpu_idle_tun below. + */ +bool mwait_cpustop_broken = false; +SYSCTL_BOOL(_machdep, OID_AUTO, mwait_cpustop_broken, CTLFLAG_RDTUN, + &mwait_cpustop_broken, 0, + "Can not reliably wake MONITOR/MWAIT cpus without interrupts"); /* * Machine dependent boot() routine @@ -358,6 +365,7 @@ void cpu_reset(void) { #ifdef SMP + struct monitorbuf *mb; cpuset_t map; u_int cnt; @@ -378,6 +386,9 @@ cpu_reset(void) /* Restart CPU #0. */ CPU_SETOF(0, &started_cpus); + mb = &pcpu_find(0)->pc_monitorbuf; + atomic_store_int(&mb->stop_state, + MONITOR_STOPSTATE_RUNNING); wmb(); cnt = 0; @@ -716,6 +727,7 @@ cpu_idle_tun(void *unused __unused) /* Ryzen erratas 1057, 1109. */ cpu_idle_selector("hlt"); idle_mwait = 0; + mwait_cpustop_broken = true; } if (cpu_vendor_id == CPU_VENDOR_INTEL && cpu_id == 0x506c9) { @@ -727,6 +739,7 @@ cpu_idle_tun(void *unused __unused) * sleep states. */ cpu_idle_apl31_workaround = 1; + mwait_cpustop_broken = true; } TUNABLE_INT_FETCH("machdep.idle_apl31", &cpu_idle_apl31_workaround); } Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Sat May 4 19:40:30 2019 (r347133) +++ head/sys/x86/x86/mp_x86.c Sat May 4 20:34:26 2019 (r347134) @@ -161,6 +161,10 @@ struct cache_info { unsigned int boot_address; +static bool stop_mwait = false; +SYSCTL_BOOL(_machdep, OID_AUTO, stop_mwait, CTLFLAG_RWTUN, &stop_mwait, 0, + "Use MONITOR/MWAIT when stopping CPU, if available"); + #define MiB(v) (v ## ULL << 20) void @@ -1390,23 +1394,41 @@ nmi_call_kdb_smp(u_int type, struct trapframe *frame) } /* - * Handle an IPI_STOP by saving our current context and spinning until we - * are resumed. + * Handle an IPI_STOP by saving our current context and spinning (or mwaiting, + * if available) until we are resumed. */ void cpustop_handler(void) { + struct monitorbuf *mb; u_int cpu; + bool use_mwait; cpu = PCPU_GET(cpuid); savectx(&stoppcbs[cpu]); + use_mwait = (stop_mwait && (cpu_feature2 & CPUID2_MON) != 0 && + !mwait_cpustop_broken); + if (use_mwait) { + mb = PCPU_PTR(monitorbuf); + atomic_store_int(&mb->stop_state, + MONITOR_STOPSTATE_STOPPED); + } + /* Indicate that we are stopped */ CPU_SET_ATOMIC(cpu, &stopped_cpus); /* Wait for restart */ while (!CPU_ISSET(cpu, &started_cpus)) { + if (use_mwait) { + cpu_monitor(mb, 0, 0); + if (atomic_load_int(&mb->stop_state) == + MONITOR_STOPSTATE_STOPPED) + cpu_mwait(0, MWAIT_C1); + continue; + } + ia32_pause(); /*