From owner-svn-src-all@freebsd.org Sun Jan 19 02:45:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 299C9224151; Sun, 19 Jan 2020 02:45:03 +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 480fKW04Phz3Ft2; Sun, 19 Jan 2020 02:45: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 F1D684240; Sun, 19 Jan 2020 02:45:02 +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 00J2j2kZ087464; Sun, 19 Jan 2020 02:45:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00J2j2Ds087463; Sun, 19 Jan 2020 02:45:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001190245.00J2j2Ds087463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 19 Jan 2020 02:45:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356876 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 356876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 02:45:03 -0000 Author: kevans Date: Sun Jan 19 02:45:02 2020 New Revision: 356876 URL: https://svnweb.freebsd.org/changeset/base/356876 Log: libzfs: add zfs_mount_at This will be used in libbe in place of the internal zmount(); libbe only wants to be able to mount a dataset at an arbitrary mountpoint without altering dataset/pool properties. The natural way to do this in a portable way is by creating a zfs_mount_at() interface that's effectively zfs_mount() + a mountpoint parameter. zfs_mount() is now a light wrapper around the new method. The interface and implementation have already been accepted into ZFS On Linux, and the next commit to switch libbe() over to this new interface will solve the last compatibility issue with ZoL. The next sysutils/openzfs rebase against ZoL should be able to build libbe/bectl with only minor adjustments to build glue. Reviewed by: Ryan Moeller MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D23132 Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Sat Jan 18 23:46:50 2020 (r356875) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Sun Jan 19 02:45:02 2020 (r356876) @@ -769,6 +769,7 @@ extern ulong_t get_system_hostid(void); extern boolean_t is_mounted(libzfs_handle_t *, const char *special, char **); extern boolean_t zfs_is_mounted(zfs_handle_t *, char **); extern int zfs_mount(zfs_handle_t *, const char *, int); +extern int zfs_mount_at(zfs_handle_t *, const char *, int, const char *); extern int zfs_unmount(zfs_handle_t *, const char *, int); extern int zfs_unmountall(zfs_handle_t *, int); Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Sat Jan 18 23:46:50 2020 (r356875) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Sun Jan 19 02:45:02 2020 (r356876) @@ -301,6 +301,17 @@ zfs_is_mounted(zfs_handle_t *zhp, char **where) return (is_mounted(zhp->zfs_hdl, zfs_get_name(zhp), where)); } +static boolean_t +zfs_is_mountable_internal(zfs_handle_t *zhp, const char *mountpoint) +{ + + if (zfs_prop_get_int(zhp, ZFS_PROP_ZONED) && + getzoneid() == GLOBAL_ZONEID) + return (B_FALSE); + + return (B_TRUE); +} + /* * Returns true if the given dataset is mountable, false otherwise. Returns the * mountpoint in 'buf'. @@ -325,8 +336,7 @@ zfs_is_mountable(zfs_handle_t *zhp, char *buf, size_t if (zfs_prop_get_int(zhp, ZFS_PROP_CANMOUNT) == ZFS_CANMOUNT_OFF) return (B_FALSE); - if (zfs_prop_get_int(zhp, ZFS_PROP_ZONED) && - getzoneid() == GLOBAL_ZONEID) + if (!zfs_is_mountable_internal(zhp, buf)) return (B_FALSE); if (source) @@ -341,8 +351,19 @@ zfs_is_mountable(zfs_handle_t *zhp, char *buf, size_t int zfs_mount(zfs_handle_t *zhp, const char *options, int flags) { - struct stat buf; char mountpoint[ZFS_MAXPROPLEN]; + + if (!zfs_is_mountable(zhp, mountpoint, sizeof (mountpoint), NULL)) + return (0); + + return (zfs_mount_at(zhp, options, flags, mountpoint)); +} + +int +zfs_mount_at(zfs_handle_t *zhp, const char *options, int flags, + const char *mountpoint) +{ + struct stat buf; char mntopts[MNT_LINE_MAX]; libzfs_handle_t *hdl = zhp->zfs_hdl; @@ -357,8 +378,8 @@ zfs_mount(zfs_handle_t *zhp, const char *options, int if (zpool_get_prop_int(zhp->zpool_hdl, ZPOOL_PROP_READONLY, NULL)) flags |= MS_RDONLY; - if (!zfs_is_mountable(zhp, mountpoint, sizeof (mountpoint), NULL)) - return (0); + if (!zfs_is_mountable_internal(zhp, mountpoint)) + return (B_FALSE); /* Create the directory if it doesn't already exist */ if (lstat(mountpoint, &buf) != 0) { From owner-svn-src-all@freebsd.org Sun Jan 19 02:48:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 35301224823; Sun, 19 Jan 2020 02:48: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 480fQ10FwTz3G3D; Sun, 19 Jan 2020 02:48: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 03FFF424D; Sun, 19 Jan 2020 02:48: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 00J2muSl087674; Sun, 19 Jan 2020 02:48:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00J2mumZ087673; Sun, 19 Jan 2020 02:48:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001190248.00J2mumZ087673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 19 Jan 2020 02:48:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356877 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 356877 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 02:48:57 -0000 Author: kevans Date: Sun Jan 19 02:48:56 2020 New Revision: 356877 URL: https://svnweb.freebsd.org/changeset/base/356877 Log: libbe: use the new zfs_mount_at() More background is available in r356876, but this new interface is more portable across ZFS implementations and cleaner for what libbe is attempting to achieve anyways. MFC after: 3 days Modified: head/lib/libbe/be_access.c Modified: head/lib/libbe/be_access.c ============================================================================== --- head/lib/libbe/be_access.c Sun Jan 19 02:45:02 2020 (r356876) +++ head/lib/libbe/be_access.c Sun Jan 19 02:48:56 2020 (r356877) @@ -82,7 +82,6 @@ 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; @@ -121,9 +120,7 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data) mountpoint); } - opt = '\0'; - if ((err = zmount(zfs_get_name(zfs_hdl), tmp, info->mntflags, - __DECONST(char *, MNTTYPE_ZFS), NULL, 0, &opt, 1)) != 0) { + if ((err = zfs_mount_at(zfs_hdl, NULL, info->mntflags, tmp)) != 0) { switch (errno) { case ENAMETOOLONG: return (set_error(info->lbh, BE_ERR_PATHLEN)); From owner-svn-src-all@freebsd.org Sun Jan 19 04:13:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5219222C12F; Sun, 19 Jan 2020 04:13:20 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 480hHN1TFKz3KhT; Sun, 19 Jan 2020 04:13:20 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DEC35350; Sun, 19 Jan 2020 04:13:20 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00J4DKEQ042358; Sun, 19 Jan 2020 04:13:20 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00J4DKRh042357; Sun, 19 Jan 2020 04:13:20 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202001190413.00J4DKRh042357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Sun, 19 Jan 2020 04:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356878 - head/stand/powerpc/uboot X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/stand/powerpc/uboot X-SVN-Commit-Revision: 356878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 04:13:20 -0000 Author: bdragon Date: Sun Jan 19 04:13:19 2020 New Revision: 356878 URL: https://svnweb.freebsd.org/changeset/base/356878 Log: [PowerPC] Fix 32-bit ubldr calling convention Due to the way u-boot for 32-bit powerpc is compiled, the interrupt code assumes that the GOT pointer (r30) on u-boot is always intact. When making syscalls to u-boot, ensure that we have restored r30 like we found it before we enable interrupts to prevent u-boot from crashing if a timer interrupt was pending. This fixes ubldr on e500 qemu (assuming you have recompiled qemu's u-boot with API support!) Reviewed by: jhibbits Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D23258 Modified: head/stand/powerpc/uboot/start.S Modified: head/stand/powerpc/uboot/start.S ============================================================================== --- head/stand/powerpc/uboot/start.S Sun Jan 19 02:48:56 2020 (r356877) +++ head/stand/powerpc/uboot/start.S Sun Jan 19 04:13:19 2020 (r356878) @@ -38,10 +38,11 @@ _start: lis %r11, uboot_address@ha addi %r11, %r11, uboot_address@l stw %r1, 0(%r11) - /* Save U-Boot's r14 */ + /* Save U-Boot's r14 and r30 */ lis %r11, saved_regs@ha addi %r11, %r11, saved_regs@l stw %r14, 0(%r11) + stw %r30, 4(%r11) /* Disable interrupts */ mfmsr %r11 andi. %r11, %r11, ~0x8000@l @@ -52,14 +53,16 @@ _start: * syscall() */ ENTRY(syscall) - stwu %r1, -16(%r1) + stwu %r1, -32(%r1) mflr %r0 stw %r14, 8(%r1) - stw %r0, 20(%r1) - /* Restore U-Boot's r14 */ + stw %r30, 12(%r1) + stw %r0, 36(%r1) + /* Restore U-Boot's r14 and r30 */ lis %r11, saved_regs@ha addi %r11, %r11, saved_regs@l lwz %r14, 0(%r11) + lwz %r30, 4(%r11) /* Enable interrupts */ mfmsr %r11 ori %r11, %r11, 0x8000@l @@ -79,6 +82,7 @@ ENTRY(syscall) lwz %r0, 4(%r11) mtlr %r0 lwz %r14, 8(%r1) + lwz %r30, 12(%r1) mr %r1, %r11 blr @@ -90,5 +94,6 @@ GLOBAL(syscall_ptr) .long 0 GLOBAL(saved_regs) .long 0 /* R14 */ + .long 0 /* R30 */ GLOBAL(uboot_address) .long 0 From owner-svn-src-all@freebsd.org Sun Jan 19 05:36:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 69C8423334C; Sun, 19 Jan 2020 05:36:46 +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 480k7f1yBDz3NSq; Sun, 19 Jan 2020 05:36:46 +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 3E4686201; Sun, 19 Jan 2020 05:36:46 +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 00J5ak3b090275; Sun, 19 Jan 2020 05:36:46 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00J5akOr090274; Sun, 19 Jan 2020 05:36:46 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001190536.00J5akOr090274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 19 Jan 2020 05:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356879 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 05:36:46 -0000 Author: mjg Date: Sun Jan 19 05:36:45 2020 New Revision: 356879 URL: https://svnweb.freebsd.org/changeset/base/356879 Log: vfs: plug a conditional assigment of lo_name in getnewvnode It only matters for witness. No functional changes. Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Jan 19 04:13:19 2020 (r356878) +++ head/sys/kern/vfs_subr.c Sun Jan 19 05:36:45 2020 (r356879) @@ -1669,11 +1669,15 @@ getnewvnode(const char *tag, struct mount *mp, struct * that we can compare pointers rather than doing a strcmp(). */ lo = &vp->v_vnlock->lock_object; +#ifdef WITNESS if (lo->lo_name != tag) { +#endif lo->lo_name = tag; +#ifdef WITNESS WITNESS_DESTROY(lo); WITNESS_INIT(lo, tag); } +#endif /* * By default, don't allow shared locks unless filesystems opt-in. */ From owner-svn-src-all@freebsd.org Sun Jan 19 05:37:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 421A423355A; Sun, 19 Jan 2020 05:37:28 +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 480k8S15Mlz3Nb5; Sun, 19 Jan 2020 05:37:28 +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 1CB016202; Sun, 19 Jan 2020 05:37:28 +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 00J5bRTT090355; Sun, 19 Jan 2020 05:37:27 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00J5bRw7090354; Sun, 19 Jan 2020 05:37:27 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001190537.00J5bRw7090354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 19 Jan 2020 05:37:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356880 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 05:37:28 -0000 Author: mjg Date: Sun Jan 19 05:37:27 2020 New Revision: 356880 URL: https://svnweb.freebsd.org/changeset/base/356880 Log: cache: convert numcachehv to counter(9) on 64-bit platforms Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun Jan 19 05:36:45 2020 (r356879) +++ head/sys/kern/vfs_cache.c Sun Jan 19 05:37:27 2020 (r356880) @@ -205,7 +205,6 @@ SYSCTL_ULONG(_vfs, OID_AUTO, ncnegfactor, CTLFLAG_RW, "Ratio of negative namecache entries"); static u_long __exclusive_cache_line numneg; /* number of negative entries allocated */ static u_long __exclusive_cache_line numcache;/* number of cache entries allocated */ -static u_long __exclusive_cache_line numcachehv;/* number of cache entries with vnodes held */ u_int ncsizefactor = 2; SYSCTL_UINT(_vfs, OID_AUTO, ncsizefactor, CTLFLAG_RW, &ncsizefactor, 0, "Size factor for namecache"); @@ -341,6 +340,16 @@ SYSCTL_INT(_debug_sizeof, OID_AUTO, namecache, CTLFLAG sizeof(struct namecache), "sizeof(struct namecache)"); /* + * Use counter(9) for numcachehv if the machine is 64-bit. + * + * Stick to an atomic for the rest since there is no long-sized equivalent and + * 64-bit size is both way more than needed and a pessimization. + */ +#ifdef __LP64__ +#define CACHE_NUMCACHEHV_U64 +#endif + +/* * The new name cache statistics */ static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW, 0, @@ -352,7 +361,12 @@ static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW, SYSCTL_COUNTER_U64(_vfs_cache, OID_AUTO, name, CTLFLAG_RD, &name, descr); STATNODE_ULONG(numneg, "Number of negative cache entries"); STATNODE_ULONG(numcache, "Number of cache entries"); +#ifdef CACHE_NUMCACHEHV_U64 +STATNODE_COUNTER(numcachehv, "Number of namecache entries with vnodes held"); +#else +static u_long __exclusive_cache_line numcachehv;/* number of cache entries with vnodes held */ STATNODE_ULONG(numcachehv, "Number of namecache entries with vnodes held"); +#endif STATNODE_COUNTER(numcalls, "Number of cache lookups"); STATNODE_COUNTER(dothits, "Number of '.' hits"); STATNODE_COUNTER(dotdothits, "Number of '..' hits"); @@ -393,6 +407,36 @@ static int vn_fullpath1(struct thread *td, struct vnod static MALLOC_DEFINE(M_VFSCACHE, "vfscache", "VFS name cache entries"); +#ifdef CACHE_NUMCACHEHV_U64 +static void +cache_numcachehv_inc(void) +{ + + counter_u64_add_protected(numcachehv, 1); +} + +static void +cache_numcachehv_dec(void) +{ + + counter_u64_add_protected(numcachehv, -1); +} +#else +static void +cache_numcachehv_inc(void) +{ + + atomic_add_long(&numcachehv, 1); +} + +static void +cache_numcachehv_dec(void) +{ + + atomic_subtract_long(&numcachehv, 1); +} +#endif + static int cache_yield; SYSCTL_INT(_vfs_cache, OID_AUTO, yield, CTLFLAG_RD, &cache_yield, 0, "Number of times cache called yield"); @@ -873,7 +917,7 @@ cache_zap_locked(struct namecache *ncp, bool neg_locke LIST_REMOVE(ncp, nc_src); if (LIST_EMPTY(&ncp->nc_dvp->v_cache_src)) { ncp->nc_flag |= NCF_DVDROP; - atomic_subtract_rel_long(&numcachehv, 1); + cache_numcachehv_dec(); } } atomic_subtract_rel_long(&numcache, 1); @@ -1742,7 +1786,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, held_dvp = false; if (LIST_EMPTY(&dvp->v_cache_src) && flag != NCF_ISDOTDOT) { vhold(dvp); - atomic_add_long(&numcachehv, 1); + cache_numcachehv_inc(); held_dvp = true; } @@ -1837,7 +1881,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, if (LIST_EMPTY(&dvp->v_cache_src)) { if (!held_dvp) { vhold(dvp); - atomic_add_long(&numcachehv, 1); + cache_numcachehv_inc(); } } else { if (held_dvp) { @@ -1848,7 +1892,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, * this from changing. */ vdrop(dvp); - atomic_subtract_long(&numcachehv, 1); + cache_numcachehv_dec(); } } LIST_INSERT_HEAD(&dvp->v_cache_src, ncp, nc_src); @@ -1886,7 +1930,7 @@ out_unlock_free: cache_free(ncp); if (held_dvp) { vdrop(dvp); - atomic_subtract_long(&numcachehv, 1); + cache_numcachehv_dec(); } return; } @@ -1957,6 +2001,9 @@ nchinit(void *dummy __unused) mtx_init(&ncneg_shrink_lock, "ncnegs", NULL, MTX_DEF); +#ifdef CACHE_NUMCACHEHV_U64 + numcachehv = counter_u64_alloc(M_WAITOK); +#endif numcalls = counter_u64_alloc(M_WAITOK); dothits = counter_u64_alloc(M_WAITOK); dotdothits = counter_u64_alloc(M_WAITOK); From owner-svn-src-all@freebsd.org Sun Jan 19 14:46:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 485FC1FBA83; Sun, 19 Jan 2020 14:46:29 +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 480yKx0rxrz4ML2; Sun, 19 Jan 2020 14:46:29 +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 18879C827; Sun, 19 Jan 2020 14:46:29 +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 00JEkShZ023586; Sun, 19 Jan 2020 14:46:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00JEkSXr023585; Sun, 19 Jan 2020 14:46:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001191446.00JEkSXr023585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 19 Jan 2020 14:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356881 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 356881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 14:46:29 -0000 Author: emaste Date: Sun Jan 19 14:46:28 2020 New Revision: 356881 URL: https://svnweb.freebsd.org/changeset/base/356881 Log: pkgbase: allow the pkg format to be overridden Compressing .txz packages can be rather slow, and speed is likely more important than disk space during development. Allow package format to be set via PKG_FORMAT make variable. Reviewed by: bapt Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23257 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Jan 19 05:37:27 2020 (r356880) +++ head/Makefile.inc1 Sun Jan 19 14:46:28 2020 (r356881) @@ -1853,6 +1853,7 @@ PORTSDIR?= /usr/ports WSTAGEDIR?= ${OBJTOP}/worldstage KSTAGEDIR?= ${OBJTOP}/kernelstage REPODIR?= ${OBJROOT}repo +PKG_FORMAT?= txz PKGSIGNKEY?= # empty .ORDER: stage-packages create-packages @@ -1943,7 +1944,7 @@ create-world-package-${pkgname}: .PHONY sed -i '' -e "s/%VCS_REVISION%/${VCS_REVISION}/" ${WSTAGEDIR}/${pkgname}.ucl ; \ fi ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname -o ALLOW_BASE_SHLIBS=yes \ - create -M ${WSTAGEDIR}/${pkgname}.ucl \ + create -f ${PKG_FORMAT} -M ${WSTAGEDIR}/${pkgname}.ucl \ -p ${WSTAGEDIR}/${pkgname}.plist \ -r ${WSTAGEDIR} \ -o ${REPODIR}/${PKG_ABI}/${PKG_VERSION} @@ -1975,7 +1976,8 @@ create-kernel-packages-flavor${flavor:C,^""$,${_defaul /version/ {print $$2; next } ' \ ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl ; \ ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname -o ALLOW_BASE_SHLIBS=yes \ - create -M ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl \ + create -f ${PKG_FORMAT} \ + -M ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl \ -p ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.plist \ -r ${KSTAGEDIR}/${DISTDIR} \ -o ${REPODIR}/${PKG_ABI}/${PKG_VERSION} @@ -2007,7 +2009,8 @@ create-kernel-packages-extra-flavor${flavor:C,^""$,${_ /version/ {print $$2; next } ' \ ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl ; \ ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname -o ALLOW_BASE_SHLIBS=yes \ - create -M ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl \ + create -f ${PKG_FORMAT} \ + -M ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl \ -p ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.plist \ -r ${KSTAGEDIR}/kernel.${_kernel} \ -o ${REPODIR}/${PKG_ABI}/${PKG_VERSION} @@ -2017,9 +2020,11 @@ create-kernel-packages-extra-flavor${flavor:C,^""$,${_ .endif sign-packages: _pkgbootstrap .PHONY + printf "version = 2;\npacking_format = \"${PKG_FORMAT}\";\n" > ${WSTAGEDIR}/meta @[ -L "${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/latest" ] && \ unlink ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/latest ; \ ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname repo \ + -m ${WSTAGEDIR}/meta \ -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION} \ ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION} \ ${PKGSIGNKEY} ; \ From owner-svn-src-all@freebsd.org Sun Jan 19 16:06:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BF2A51FD75A; Sun, 19 Jan 2020 16:06:37 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yb1-f172.google.com (mail-yb1-f172.google.com [209.85.219.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 48106P48m6z4QXd; Sun, 19 Jan 2020 16:06:37 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yb1-f172.google.com with SMTP id f136so8571594ybg.11; Sun, 19 Jan 2020 08:06:37 -0800 (PST) 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=ngKepDs+lI/PnZProLYT1hQrS1M99zxL/Tc1x8QOtMY=; b=CJdn2zPjZPZGqZbmbFiW9E0rPnsPOlCmmyQGwILgISqiu8kG7oNrCMcETE50UB0snm 9jMW2jxvPV7j3lVz+ng45jx+tvMc4D6tzyXf81HIkNO0Fz4LCBGhIdDM3ccB2cqsNI88 SlOCBi9Nc2Ud3PMUKdzID9QECaGjV6VOsglBWfOcmfLHoDzayTo5SzOmB7/P9h4/ePVe OG2oZzUnNBO0qCganvBKl+Le1PzzVBk9RRIJyNXzns4KnDfxLnGuzJ5oOTbp/E71UWqH wTRUvyyUjSknMWLlobCGviNlpjtYpQpJgJm3iZlts/ic+baacMLs42WzGFF/M6zC9TQu PgIQ== X-Gm-Message-State: APjAAAUgssLuYyA6KuepBqqg+BQfhmlb3CdNbaOyrt13l2PNCR8PidCV dCgkdKoXcc46+8viXYiAVhMExwJXgb9BmEm+45p2Hiot X-Google-Smtp-Source: APXvYqwKtAa5S7bIhQv18sMQFuERuKPdUwXQVQWpMXZjrpNbEYx4VaVMEwgWRfDwQjnBHlbm22K7DohrRnswG9sC+PQ= X-Received: by 2002:a25:1a55:: with SMTP id a82mr19777433yba.497.1579449996326; Sun, 19 Jan 2020 08:06:36 -0800 (PST) MIME-Version: 1.0 References: <202001190537.00J5bRw7090354@repo.freebsd.org> In-Reply-To: <202001190537.00J5bRw7090354@repo.freebsd.org> From: Li-Wen Hsu Date: Mon, 20 Jan 2020 00:06:24 +0800 Message-ID: Subject: Re: svn commit: r356880 - head/sys/kern To: Mateusz Guzik Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 48106P48m6z4QXd X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,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: Sun, 19 Jan 2020 16:06:37 -0000 On Sun, Jan 19, 2020 at 1:37 PM Mateusz Guzik wrote: > > Author: mjg > Date: Sun Jan 19 05:37:27 2020 > New Revision: 356880 > URL: https://svnweb.freebsd.org/changeset/base/356880 > > Log: > cache: convert numcachehv to counter(9) on 64-bit platforms This or r356879 seem to broke RISC-V booting. Can you check this error? Full log: https://ci.freebsd.org/job/FreeBSD-head-riscv64-test/13243/console Panic message and bt: Trying to mount root from ufs:/dev/vtbd0 []... WARNING: WITNESS option enabled, expect reduced performance. panic: Not in critical section cpuid = 1 time = 3 KDB: stack backtrace: db_trace_self() at db_fetch_ksymtab+0x12a pc = 0xffffffc00053915c ra = 0xffffffc0000f6848 sp = 0xffffffc017631010 fp = 0xffffffc017631230 db_fetch_ksymtab() at kdb_backtrace+0x2c pc = 0xffffffc0000f6848 ra = 0xffffffc0002a60ce sp = 0xffffffc017631230 fp = 0xffffffc0176312e0 kdb_backtrace() at vpanic+0x144 pc = 0xffffffc0002a60ce ra = 0xffffffc000263818 sp = 0xffffffc0176312e0 fp = 0xffffffc017631320 vpanic() at panic+0x26 pc = 0xffffffc000263818 ra = 0xffffffc000263626 sp = 0xffffffc017631320 fp = 0xffffffc017631340 panic() at cache_enter_time+0x11e8 pc = 0xffffffc000263626 ra = 0xffffffc00030b72a sp = 0xffffffc017631340 fp = 0xffffffc017631490 cache_enter_time() at ufs_lookup_ino+0xa4c pc = 0xffffffc00030b72a ra = 0xffffffc0004e2604 sp = 0xffffffc017631490 fp = 0xffffffc017631600 ufs_lookup_ino() at ufs_lookup+0x14 pc = 0xffffffc0004e2604 ra = 0xffffffc0004e1bac sp = 0xffffffc017631600 fp = 0xffffffc017631610 ufs_lookup() at VOP_CACHEDLOOKUP_APV+0x32 pc = 0xffffffc0004e1bac ra = 0xffffffc000549560 sp = 0xffffffc017631610 fp = 0xffffffc017631630 VOP_CACHEDLOOKUP_APV() at vfs_cache_lookup+0xd2 pc = 0xffffffc000549560 ra = 0xffffffc00030d350 sp = 0xffffffc017631630 fp = 0xffffffc017631680 vfs_cache_lookup() at VOP_LOOKUP_APV+0x32 pc = 0xffffffc00030d350 ra = 0xffffffc000549428 sp = 0xffffffc017631680 fp = 0xffffffc0176316a0 VOP_LOOKUP_APV() at lookup+0x560 pc = 0xffffffc000549428 ra = 0xffffffc0003163ba sp = 0xffffffc0176316a0 fp = 0xffffffc0176317b0 lookup() at namei+0x398 pc = 0xffffffc0003163ba ra = 0xffffffc000315974 sp = 0xffffffc0176317b0 fp = 0xffffffc0176318b0 namei() at vfs_mountroot+0x100e pc = 0xffffffc000315974 ra = 0xffffffc00031ce78 sp = 0xffffffc0176318b0 fp = 0xffffffc017631ac0 vfs_mountroot() at mi_startup+0xfee pc = 0xffffffc00031ce78 ra = 0xffffffc0002039fa sp = 0xffffffc017631ac0 fp = 0xffffffc017631b90 mi_startup() at fork_exit+0x68 pc = 0xffffffc0002039fa ra = 0xffffffc0002272e4 sp = 0xffffffc017631b90 fp = 0xffffffc017631bd0 fork_exit() at fork_trampoline+0xa pc = 0xffffffc0002272e4 ra = 0xffffffc000547baa sp = 0xffffffc017631bd0 fp = 0xffffffc0002039cc fork_trampoline() at 0xc3c080e700060093 pc = 0xffffffc000547baa ra = 0xc3c080e700060093 sp = 0xffffffc0002039cc fp = 0x5fc5051300398517 KDB: enter: panic From owner-svn-src-all@freebsd.org Sun Jan 19 16:24:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE2D81FDB35; Sun, 19 Jan 2020 16:24:25 +0000 (UTC) (envelope-from carlavilla@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4810Vx5n2nz4RBF; Sun, 19 Jan 2020 16:24:25 +0000 (UTC) (envelope-from carlavilla@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C19E1DA1F; Sun, 19 Jan 2020 16:24:25 +0000 (UTC) (envelope-from carlavilla@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00JGOPCw082867; Sun, 19 Jan 2020 16:24:25 GMT (envelope-from carlavilla@FreeBSD.org) Received: (from carlavilla@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00JGOP6T082866; Sun, 19 Jan 2020 16:24:25 GMT (envelope-from carlavilla@FreeBSD.org) Message-Id: <202001191624.00JGOP6T082866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: carlavilla set sender to carlavilla@FreeBSD.org using -f From: Sergio Carlavilla Delgado Date: Sun, 19 Jan 2020 16:24:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356882 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: carlavilla X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 356882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 16:24:26 -0000 Author: carlavilla (doc committer) Date: Sun Jan 19 16:24:25 2020 New Revision: 356882 URL: https://svnweb.freebsd.org/changeset/base/356882 Log: Add myself as a mentee of bcr Patch by: carlavilla@(doc-committer) Approved by: bcr@(mentor) Modified: head/share/misc/committers-doc.dot Modified: head/share/misc/committers-doc.dot ============================================================================== --- head/share/misc/committers-doc.dot Sun Jan 19 14:46:28 2020 (r356881) +++ head/share/misc/committers-doc.dot Sun Jan 19 16:24:25 2020 (r356882) @@ -112,6 +112,7 @@ bcr -> bhd bcr -> sevan bcr -> dexter bcr -> sg +bcr -> carlavilla blackend -> ale From owner-svn-src-all@freebsd.org Sun Jan 19 17:05:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 294B71FE7AE; Sun, 19 Jan 2020 17:05:27 +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 4811QH0KMdz4Skx; Sun, 19 Jan 2020 17:05:27 +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 06448E153; Sun, 19 Jan 2020 17:05:27 +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 00JH5QE4006756; Sun, 19 Jan 2020 17:05:26 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00JH5QRQ006755; Sun, 19 Jan 2020 17:05:26 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001191705.00JH5QRQ006755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 19 Jan 2020 17:05:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356883 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356883 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 17:05:27 -0000 Author: mjg Date: Sun Jan 19 17:05:26 2020 New Revision: 356883 URL: https://svnweb.freebsd.org/changeset/base/356883 Log: cache: counter_u64_add_protected -> counter_u64_add Fixes booting on RISC-V where it does happen to not be equivalent. Reported by: lwhsu Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun Jan 19 16:24:25 2020 (r356882) +++ head/sys/kern/vfs_cache.c Sun Jan 19 17:05:26 2020 (r356883) @@ -412,14 +412,14 @@ static void cache_numcachehv_inc(void) { - counter_u64_add_protected(numcachehv, 1); + counter_u64_add(numcachehv, 1); } static void cache_numcachehv_dec(void) { - counter_u64_add_protected(numcachehv, -1); + counter_u64_add(numcachehv, -1); } #else static void From owner-svn-src-all@freebsd.org Sun Jan 19 17:05:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 289501FE818; Sun, 19 Jan 2020 17:05:48 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (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 4811Qh0DCKz4SsD; Sun, 19 Jan 2020 17:05:47 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x42e.google.com with SMTP id t2so27171808wrr.1; Sun, 19 Jan 2020 09:05:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=MuJZ2KFIxP6eWdvqD7tf9+W0EMawxMRPi6jWOM1Dd30=; b=gCFR6NL8Poh3HYeo5n55LYl9dO9OStVr4j2BjNs6Ln48gY4EBx76XT7jqVlSY8uPOi MiMa2Nn1+0Kz8wzq4vQYB8iod0vFuFbaJiGGUTXetV21T2u6R3wdDmyLmHrSddE9tsLk XWwk/pU2SttxK8Fqs9oy1WHWb9ucprPl1QYseAlPONw3Hy3JDdX+T/8XORjmTOJbp5Js csBCzrT3sz71JsQFhaVpUIR/l+tidD2+gmIiFrJE2q3757TtpX5aj892unS2Dntbu9q8 3slJMp5dzEbKpOJ3IXeQLDUxfyWZpcbLKXl8+7WQwPzDcgzFlE3wzpiuNizcq4p1PSKp z7ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=MuJZ2KFIxP6eWdvqD7tf9+W0EMawxMRPi6jWOM1Dd30=; b=GnZsgyv5OEFl6P0gnc+tnpynjTxV093Uc8lwp/hcO1yVCaClFI1RFobaTu6bOguUpf cNu3MJjgj7R8bVBjI4gfT+pnx/xMUpV+TtNh+MwomL4W+azeiibr4DB7YYggcjfAc4od 5ANY+tZpmZJIsIg5U55WbJoYM1UjTl3JKTvxl3LslACjRohXSutRsKBBaynB1/yRLZLv 3JoANarrmWwh2vSGzlKOPnorG1YrlaxBPYFLhhTVtVygadxRVl3K9QxHdlJ15A3F1E4c HEJZUydKGMWJKGRSBMcHJUSdEpyEICaFRpQguzhaJvb+c7IJzSqIZuJ97Du95CMDqicc JPDA== X-Gm-Message-State: APjAAAWz61t3kNf4Y3E/bo1hv+PWTevvCoaX5OLl5Z7CbFBsF/3JTzO9 cjAUaQuAl8uvNGrSYyHzcIRyYxqh1qa9EkEskghCQw== X-Google-Smtp-Source: APXvYqyOuRzEmTl9GGkKvT/3cQd2SiZ+Ko87oZi2jnEjVmNY/6V5HN1cHpiT9b5MRyPXraOR+ALtEQX8Dht5PWSH7hM= X-Received: by 2002:adf:f6c1:: with SMTP id y1mr13805828wrp.17.1579453545532; Sun, 19 Jan 2020 09:05:45 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:6b02:0:0:0:0:0 with HTTP; Sun, 19 Jan 2020 09:05:44 -0800 (PST) In-Reply-To: References: <202001190537.00J5bRw7090354@repo.freebsd.org> From: Mateusz Guzik Date: Sun, 19 Jan 2020 18:05:44 +0100 Message-ID: Subject: Re: svn commit: r356880 - head/sys/kern To: Li-Wen Hsu Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4811Qh0DCKz4SsD X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,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: Sun, 19 Jan 2020 17:05:48 -0000 oops, see r356883. On 1/19/20, Li-Wen Hsu wrote: > On Sun, Jan 19, 2020 at 1:37 PM Mateusz Guzik wrote: >> >> Author: mjg >> Date: Sun Jan 19 05:37:27 2020 >> New Revision: 356880 >> URL: https://svnweb.freebsd.org/changeset/base/356880 >> >> Log: >> cache: convert numcachehv to counter(9) on 64-bit platforms > > This or r356879 seem to broke RISC-V booting. Can you check this error? > > Full log: > https://ci.freebsd.org/job/FreeBSD-head-riscv64-test/13243/console > > Panic message and bt: > Trying to mount root from ufs:/dev/vtbd0 []... > WARNING: WITNESS option enabled, expect reduced performance. > panic: Not in critical section > cpuid = 1 > time = 3 > KDB: stack backtrace: > db_trace_self() at db_fetch_ksymtab+0x12a > pc = 0xffffffc00053915c ra = 0xffffffc0000f6848 > sp = 0xffffffc017631010 fp = 0xffffffc017631230 > > db_fetch_ksymtab() at kdb_backtrace+0x2c > pc = 0xffffffc0000f6848 ra = 0xffffffc0002a60ce > sp = 0xffffffc017631230 fp = 0xffffffc0176312e0 > > kdb_backtrace() at vpanic+0x144 > pc = 0xffffffc0002a60ce ra = 0xffffffc000263818 > sp = 0xffffffc0176312e0 fp = 0xffffffc017631320 > > vpanic() at panic+0x26 > pc = 0xffffffc000263818 ra = 0xffffffc000263626 > sp = 0xffffffc017631320 fp = 0xffffffc017631340 > > panic() at cache_enter_time+0x11e8 > pc = 0xffffffc000263626 ra = 0xffffffc00030b72a > sp = 0xffffffc017631340 fp = 0xffffffc017631490 > > cache_enter_time() at ufs_lookup_ino+0xa4c > pc = 0xffffffc00030b72a ra = 0xffffffc0004e2604 > sp = 0xffffffc017631490 fp = 0xffffffc017631600 > > ufs_lookup_ino() at ufs_lookup+0x14 > pc = 0xffffffc0004e2604 ra = 0xffffffc0004e1bac > sp = 0xffffffc017631600 fp = 0xffffffc017631610 > > ufs_lookup() at VOP_CACHEDLOOKUP_APV+0x32 > pc = 0xffffffc0004e1bac ra = 0xffffffc000549560 > sp = 0xffffffc017631610 fp = 0xffffffc017631630 > > VOP_CACHEDLOOKUP_APV() at vfs_cache_lookup+0xd2 > pc = 0xffffffc000549560 ra = 0xffffffc00030d350 > sp = 0xffffffc017631630 fp = 0xffffffc017631680 > > vfs_cache_lookup() at VOP_LOOKUP_APV+0x32 > pc = 0xffffffc00030d350 ra = 0xffffffc000549428 > sp = 0xffffffc017631680 fp = 0xffffffc0176316a0 > > VOP_LOOKUP_APV() at lookup+0x560 > pc = 0xffffffc000549428 ra = 0xffffffc0003163ba > sp = 0xffffffc0176316a0 fp = 0xffffffc0176317b0 > > lookup() at namei+0x398 > pc = 0xffffffc0003163ba ra = 0xffffffc000315974 > sp = 0xffffffc0176317b0 fp = 0xffffffc0176318b0 > > namei() at vfs_mountroot+0x100e > pc = 0xffffffc000315974 ra = 0xffffffc00031ce78 > sp = 0xffffffc0176318b0 fp = 0xffffffc017631ac0 > > vfs_mountroot() at mi_startup+0xfee > pc = 0xffffffc00031ce78 ra = 0xffffffc0002039fa > sp = 0xffffffc017631ac0 fp = 0xffffffc017631b90 > > mi_startup() at fork_exit+0x68 > pc = 0xffffffc0002039fa ra = 0xffffffc0002272e4 > sp = 0xffffffc017631b90 fp = 0xffffffc017631bd0 > > fork_exit() at fork_trampoline+0xa > pc = 0xffffffc0002272e4 ra = 0xffffffc000547baa > sp = 0xffffffc017631bd0 fp = 0xffffffc0002039cc > > fork_trampoline() at 0xc3c080e700060093 > pc = 0xffffffc000547baa ra = 0xc3c080e700060093 > sp = 0xffffffc0002039cc fp = 0x5fc5051300398517 > > KDB: enter: panic > -- Mateusz Guzik From owner-svn-src-all@freebsd.org Sun Jan 19 17:10:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF33C1FEB5B for ; Sun, 19 Jan 2020 17:10:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) (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 4811XJ4Pb6z4TH2 for ; Sun, 19 Jan 2020 17:10:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x830.google.com with SMTP id d18so25864304qtj.10 for ; Sun, 19 Jan 2020 09:10:40 -0800 (PST) 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=OVd6oNx4bt0g1J/6NKdvExHYGXe4YkVsrsh+J+x1hz4=; b=DFoGUVSThaZmtsaxlD6gXKv5EUgQ34w7pfDhx2luSoaB9pyc0kgPPpUch9C/3Hwdui fC+38+KM/M6w/ev81nasbP0aSrsiW1GK2/HQIgMYNHv9DCmsBgTzv4lu6vAhMOplSMG7 6vebqSoZCmvqj/KsoDhzGlUM46OB6JnIg54B1SRuUeoxwxUw2jmvGQ7HE7pDJl3rPwPC wMcahKBHd/8wr9Cd1wK5026vHtc7z9V9XgtSUdwJ+wa1Lue4AgJKu5tVnFPsGkVvknTD rxnSOKlFpbYZoYdFQdtuE45kMHSaFVw70dRbgooxSeTsemaNezaV67Gg0J9eTh95qy6D T3Fw== 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=OVd6oNx4bt0g1J/6NKdvExHYGXe4YkVsrsh+J+x1hz4=; b=bX/umafvRsyv3hjfOz0KQUNowi6s4v4rLtnIaY0w1OYQ7i1+wcpITZQZCbXFffeLYD Gx+49g5+N2gC23zcpvXwJiWjf2pq/ejTDM6j+fLA1ktaH5hkcKcVRF+H81qhdloHvEod TOduVn3bQ2Xw23ZAE2vK7i751pJD8lNpeY/L8WK0XMAQf3rn+ruhQfbRsQ2LdPtbcpbU /jYkfjIdQPXTFn5H0NDv1So3LjLTiItMKccU+NxEakaJBd20RXqVKX15QLvtk8Py1Eq9 NI46BSc5JZj01L0j5QWCxiauHd1+QNcp+pVJqoFJOmmVFAwnXzxsfXKyVSHUAfgiWTtu Ohuw== X-Gm-Message-State: APjAAAU28eKF1IsmE5FlB3b/frPFB5e43C72LweJVj707KIPFuz3g99w HkKf8Pv4VfX710cIHAN0g3whlQHnUckzHjkDndqKPN37 X-Google-Smtp-Source: APXvYqyyK/b0BmJ2tz13nyMUkf3q+Ee9vM1pKgDPmbnUOyQbT87LmFgGWpZOHvUwpbYWZQa/ppueJoeQbcqG7PkLG8s= X-Received: by 2002:ac8:21ec:: with SMTP id 41mr17273492qtz.242.1579453839402; Sun, 19 Jan 2020 09:10:39 -0800 (PST) MIME-Version: 1.0 References: <202001191705.00JH5QRQ006755@repo.freebsd.org> In-Reply-To: <202001191705.00JH5QRQ006755@repo.freebsd.org> From: Warner Losh Date: Sun, 19 Jan 2020 10:10:28 -0700 Message-ID: Subject: Re: svn commit: r356883 - head/sys/kern To: Mateusz Guzik Cc: src-committers , svn-src-all , svn-src-head@freebsd.org X-Rspamd-Queue-Id: 4811XJ4Pb6z4TH2 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=DFoGUVST; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::830) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.64 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[0.3.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.64)[ip: (-9.26), ipnet: 2607:f8b0::/32(-2.08), asn: 15169(-1.82), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] 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: Sun, 19 Jan 2020 17:10:41 -0000 On Sun, Jan 19, 2020, 10:05 AM Mateusz Guzik wrote: > Author: mjg > Date: Sun Jan 19 17:05:26 2020 > New Revision: 356883 > URL: https://svnweb.freebsd.org/changeset/base/356883 > > Log: > cache: counter_u64_add_protected -> counter_u64_add > > Fixes booting on RISC-V where it does happen to not be equivalent. > Any reason we can't just have a counter64 API that works the same both places rather than hiding what looks to my eye to be just that behind ifdefs in vfs_cache.c? Warner Reported by: lwhsu > > Modified: > head/sys/kern/vfs_cache.c > > Modified: head/sys/kern/vfs_cache.c > > ============================================================================== > --- head/sys/kern/vfs_cache.c Sun Jan 19 16:24:25 2020 (r356882) > +++ head/sys/kern/vfs_cache.c Sun Jan 19 17:05:26 2020 (r356883) > @@ -412,14 +412,14 @@ static void > cache_numcachehv_inc(void) > { > > - counter_u64_add_protected(numcachehv, 1); > + counter_u64_add(numcachehv, 1); > } > > static void > cache_numcachehv_dec(void) > { > > - counter_u64_add_protected(numcachehv, -1); > + counter_u64_add(numcachehv, -1); > } > #else > static void > From owner-svn-src-all@freebsd.org Sun Jan 19 17:47:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8963F1FFAA6; Sun, 19 Jan 2020 17:47:05 +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 4812LK35Q4z4W7T; Sun, 19 Jan 2020 17:47:05 +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 655F6E8C5; Sun, 19 Jan 2020 17:47:05 +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 00JHl5Cd030796; Sun, 19 Jan 2020 17:47:05 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00JHl5c7030795; Sun, 19 Jan 2020 17:47:05 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001191747.00JHl5c7030795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 19 Jan 2020 17:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356884 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 17:47:05 -0000 Author: mjg Date: Sun Jan 19 17:47:04 2020 New Revision: 356884 URL: https://svnweb.freebsd.org/changeset/base/356884 Log: vfs: allow v_holdcnt to transition 0->1 without the interlock Since r356672 ("vfs: rework vnode list management") there is nothing to do apart from altering freevnodes count, but this much can be safely done based on the result of atomic_fetchadd. Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D23186 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Jan 19 17:05:26 2020 (r356883) +++ head/sys/kern/vfs_subr.c Sun Jan 19 17:47:04 2020 (r356884) @@ -2826,38 +2826,26 @@ v_decr_devcount(struct vnode *vp) * see doomed vnodes. If inactive processing was delayed in * vput try to do it here. * - * Both holdcnt and usecount can be manipulated using atomics without holding - * any locks except in these cases which require the vnode interlock: - * holdcnt: 1->0 and 0->1 - * usecount: 0->1 - * - * usecount is permitted to transition 1->0 without the interlock because - * vnode is kept live by holdcnt. + * usecount is manipulated using atomics without holding any locks, + * except when transitioning 0->1 in which case the interlock is held. + + * holdcnt is manipulated using atomics without holding any locks, + * except when transitioning 1->0 in which case the interlock is held. */ -static enum vgetstate __always_inline -_vget_prep(struct vnode *vp, bool interlock) +enum vgetstate +vget_prep(struct vnode *vp) { enum vgetstate vs; if (refcount_acquire_if_not_zero(&vp->v_usecount)) { vs = VGET_USECOUNT; } else { - if (interlock) - vholdl(vp); - else - vhold(vp); + vhold(vp); vs = VGET_HOLDCNT; } return (vs); } -enum vgetstate -vget_prep(struct vnode *vp) -{ - - return (_vget_prep(vp, false)); -} - int vget(struct vnode *vp, int flags, struct thread *td) { @@ -2865,7 +2853,7 @@ vget(struct vnode *vp, int flags, struct thread *td) MPASS(td == curthread); - vs = _vget_prep(vp, (flags & LK_INTERLOCK) != 0); + vs = vget_prep(vp); return (vget_finish(vp, flags, vs)); } @@ -3234,50 +3222,30 @@ vunref(struct vnode *vp) vputx(vp, VPUTX_VUNREF); } -/* - * Increase the hold count and activate if this is the first reference. - */ -static void -vhold_activate(struct vnode *vp) +void +vhold(struct vnode *vp) { struct vdbatch *vd; + int old; - ASSERT_VI_LOCKED(vp, __func__); - VNASSERT(vp->v_holdcnt == 0, vp, - ("%s: wrong hold count", __func__)); - VNASSERT(vp->v_op != NULL, vp, - ("%s: vnode already reclaimed.", __func__)); + CTR2(KTR_VFS, "%s: vp %p", __func__, vp); + old = atomic_fetchadd_int(&vp->v_holdcnt, 1); + VNASSERT(old >= 0, vp, ("%s: wrong hold count %d", __func__, old)); + if (old != 0) + return; critical_enter(); vd = DPCPU_PTR(vd); vd->freevnodes--; critical_exit(); - refcount_acquire(&vp->v_holdcnt); } void -vhold(struct vnode *vp) -{ - - ASSERT_VI_UNLOCKED(vp, __func__); - CTR2(KTR_VFS, "%s: vp %p", __func__, vp); - if (refcount_acquire_if_not_zero(&vp->v_holdcnt)) - return; - VI_LOCK(vp); - vholdl(vp); - VI_UNLOCK(vp); -} - -void vholdl(struct vnode *vp) { ASSERT_VI_LOCKED(vp, __func__); CTR2(KTR_VFS, "%s: vp %p", __func__, vp); - if (vp->v_holdcnt > 0) { - refcount_acquire(&vp->v_holdcnt); - return; - } - vhold_activate(vp); + vhold(vp); } void @@ -3417,8 +3385,6 @@ vdrop_deactivate(struct vnode *vp) ("vdrop: returning doomed vnode")); VNASSERT(vp->v_op != NULL, vp, ("vdrop: vnode already reclaimed.")); - VNASSERT(vp->v_holdcnt == 0, vp, - ("vdrop: freeing when we shouldn't")); VNASSERT((vp->v_iflag & VI_OWEINACT) == 0, vp, ("vnode with VI_OWEINACT set")); VNASSERT((vp->v_iflag & VI_DEFINACT) == 0, vp, @@ -3426,9 +3392,18 @@ vdrop_deactivate(struct vnode *vp) if (vp->v_mflag & VMP_LAZYLIST) { mp = vp->v_mount; mtx_lock(&mp->mnt_listmtx); - vp->v_mflag &= ~VMP_LAZYLIST; - TAILQ_REMOVE(&mp->mnt_lazyvnodelist, vp, v_lazylist); - mp->mnt_lazyvnodelistsize--; + VNASSERT(vp->v_mflag & VMP_LAZYLIST, vp, ("lost VMP_LAZYLIST")); + /* + * Don't remove the vnode from the lazy list if another thread + * has increased the hold count. It may have re-enqueued the + * vnode to the lazy list and is now responsible for its + * removal. + */ + if (vp->v_holdcnt == 0) { + vp->v_mflag &= ~VMP_LAZYLIST; + TAILQ_REMOVE(&mp->mnt_lazyvnodelist, vp, v_lazylist); + mp->mnt_lazyvnodelistsize--; + } mtx_unlock(&mp->mnt_listmtx); } vdbatch_enqueue(vp); From owner-svn-src-all@freebsd.org Sun Jan 19 18:18:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20AE9221548; Sun, 19 Jan 2020 18:18:18 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48132K5nFCz4XRt; Sun, 19 Jan 2020 18:18:17 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD2F4EE79; Sun, 19 Jan 2020 18:18:17 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00JIIHtj049445; Sun, 19 Jan 2020 18:18:17 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00JIIHOv049443; Sun, 19 Jan 2020 18:18:17 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001191818.00JIIHOv049443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 19 Jan 2020 18:18:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356885 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 356885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 18:18:18 -0000 Author: jeff Date: Sun Jan 19 18:18:17 2020 New Revision: 356885 URL: https://svnweb.freebsd.org/changeset/base/356885 Log: Provide an API for interlocked refcount sleeps. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D22908 Modified: head/sys/kern/kern_synch.c head/sys/sys/refcount.h Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Sun Jan 19 17:47:04 2020 (r356884) +++ head/sys/kern/kern_synch.c Sun Jan 19 18:18:17 2020 (r356885) @@ -381,15 +381,21 @@ refcount_release_last(volatile u_int *count, u_int n, * a precise answer should use refcount_wait(). */ void -refcount_sleep(volatile u_int *count, const char *wmesg, int pri) +_refcount_sleep(volatile u_int *count, struct lock_object *lock, + const char *wmesg, int pri) { void *wchan; u_int old; - if (REFCOUNT_COUNT(*count) == 0) + if (REFCOUNT_COUNT(*count) == 0) { + if (lock != NULL) + LOCK_CLASS(lock)->lc_unlock(lock); return; + } wchan = __DEVOLATILE(void *, count); sleepq_lock(wchan); + if (lock != NULL) + LOCK_CLASS(lock)->lc_unlock(lock); old = *count; for (;;) { if (REFCOUNT_COUNT(old) == 0) { Modified: head/sys/sys/refcount.h ============================================================================== --- head/sys/sys/refcount.h Sun Jan 19 17:47:04 2020 (r356884) +++ head/sys/sys/refcount.h Sun Jan 19 18:18:17 2020 (r356885) @@ -46,7 +46,6 @@ #define REFCOUNT_COUNT(x) ((x) & ~REFCOUNT_WAITER) bool refcount_release_last(volatile u_int *count, u_int n, u_int old); -void refcount_sleep(volatile u_int *count, const char *wmesg, int prio); /* * Attempt to handle reference count overflow and underflow. Force the counter @@ -135,13 +134,29 @@ refcount_release(volatile u_int *count) return (refcount_releasen(count, 1)); } +#ifdef _KERNEL +struct lock_object; +void _refcount_sleep(volatile u_int *count, struct lock_object *, + const char *wmesg, int prio); + static __inline void +refcount_sleep(volatile u_int *count, const char *wmesg, int prio) +{ + + _refcount_sleep(count, NULL, wmesg, prio); +} + +#define refcount_sleep_interlock(count, lock, wmesg, prio) \ + _refcount_sleep((count), (struct lock_object *)(lock), (wmesg), (prio)) + +static __inline void refcount_wait(volatile u_int *count, const char *wmesg, int prio) { while (*count != 0) refcount_sleep(count, wmesg, prio); } +#endif /* * This functions returns non-zero if the refcount was From owner-svn-src-all@freebsd.org Sun Jan 19 18:30:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 90F5122182D; Sun, 19 Jan 2020 18:30:24 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4813JJ3p0Pz4Xqq; Sun, 19 Jan 2020 18:30:24 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D5BBF04A; Sun, 19 Jan 2020 18:30:24 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00JIUOC9055369; Sun, 19 Jan 2020 18:30:24 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00JIUOFP055367; Sun, 19 Jan 2020 18:30:24 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001191830.00JIUOFP055367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 19 Jan 2020 18:30:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356886 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 356886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 18:30:24 -0000 Author: jeff Date: Sun Jan 19 18:30:23 2020 New Revision: 356886 URL: https://svnweb.freebsd.org/changeset/base/356886 Log: Make collapse synchronization more explicit and allow it to complete during paging. Shadow objects are marked with a COLLAPSING flag while they are collapsing with their backing object. This gives us an explicit test rather than overloading paging-in-progress. While split is on-going we mark an object with SPLIT. These two operations will modify the swap tree so they must be serialized and swap_pager_getpages() can now directly detect these conditions and page more conservatively. Callers to vm_object_collapse() now will reliably wait for a collapse to finish so that the backing chain is as short as possible before other decisions are made that may inflate the object chain. For example, split, coalesce, etc. It is now safe to run fault concurrently with collapse. It is safe to increase or decrease paging in progress with no lock so long as there is another valid ref on increase. This change makes collapse more reliable as a secondary benefit. The primary benefit is making it safe to drop the object lock much earlier in fault or never acquire it at all. This was tested with a new shadow chain test script that uncovered long standing bugs and will be integrated with stress2. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D22908 Modified: head/sys/vm/swap_pager.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Sun Jan 19 18:18:17 2020 (r356885) +++ head/sys/vm/swap_pager.c Sun Jan 19 18:30:23 2020 (r356886) @@ -974,15 +974,12 @@ swp_pager_xfer_source(vm_object_t srcobject, vm_object * Destination has no swapblk and is not resident, transfer source. * swp_pager_meta_build() can sleep. */ - vm_object_pip_add(srcobject, 1); VM_OBJECT_WUNLOCK(srcobject); - vm_object_pip_add(dstobject, 1); dstaddr = swp_pager_meta_build(dstobject, pindex, addr); KASSERT(dstaddr == SWAPBLK_NONE, ("Unexpected destination swapblk")); - vm_object_pip_wakeup(dstobject); VM_OBJECT_WLOCK(srcobject); - vm_object_pip_wakeup(srcobject); + return (true); } @@ -995,8 +992,7 @@ swp_pager_xfer_source(vm_object_t srcobject, vm_object * we keep the destination's. * * This routine is allowed to sleep. It may sleep allocating metadata - * indirectly through swp_pager_meta_build() or if paging is still in - * progress on the source. + * indirectly through swp_pager_meta_build(). * * The source object contains no vm_page_t's (which is just as well) * @@ -1019,18 +1015,14 @@ swap_pager_copy(vm_object_t srcobject, vm_object_t dst */ if (destroysource && (srcobject->flags & OBJ_ANON) == 0 && srcobject->handle != NULL) { - vm_object_pip_add(srcobject, 1); VM_OBJECT_WUNLOCK(srcobject); - vm_object_pip_add(dstobject, 1); VM_OBJECT_WUNLOCK(dstobject); sx_xlock(&sw_alloc_sx); TAILQ_REMOVE(NOBJLIST(srcobject->handle), srcobject, pager_object_list); sx_xunlock(&sw_alloc_sx); VM_OBJECT_WLOCK(dstobject); - vm_object_pip_wakeup(dstobject); VM_OBJECT_WLOCK(srcobject); - vm_object_pip_wakeup(srcobject); } /* @@ -1207,26 +1199,29 @@ swap_pager_getpages(vm_object_t object, vm_page_t *ma, reqcount = count; - /* - * Determine the final number of read-behind pages and - * allocate them BEFORE releasing the object lock. Otherwise, - * there can be a problematic race with vm_object_split(). - * Specifically, vm_object_split() might first transfer pages - * that precede ma[0] in the current object to a new object, - * and then this function incorrectly recreates those pages as - * read-behind pages in the current object. - */ KASSERT(object->type == OBJT_SWAP, ("%s: object not swappable", __func__)); if (!swap_pager_haspage(object, ma[0]->pindex, &maxbehind, &maxahead)) return (VM_PAGER_FAIL); + KASSERT(reqcount - 1 <= maxahead, + ("page count %d extends beyond swap block", reqcount)); + /* + * Do not transfer any pages other than those that are xbusied + * when running during a split or collapse operation. This + * prevents clustering from re-creating pages which are being + * moved into another object. + */ + if ((object->flags & (OBJ_SPLIT | OBJ_DEAD)) != 0) { + maxahead = reqcount - 1; + maxbehind = 0; + } + + /* * Clip the readahead and readbehind ranges to exclude resident pages. */ if (rahead != NULL) { - KASSERT(reqcount - 1 <= maxahead, - ("page count %d extends beyond swap block", reqcount)); *rahead = imin(*rahead, maxahead - (reqcount - 1)); pindex = ma[reqcount - 1]->pindex; msucc = TAILQ_NEXT(ma[reqcount - 1], listq); Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sun Jan 19 18:18:17 2020 (r356885) +++ head/sys/vm/vm_object.c Sun Jan 19 18:30:23 2020 (r356886) @@ -116,8 +116,6 @@ static int vm_object_page_collect_flush(vm_object_t ob boolean_t *eio); static boolean_t vm_object_page_remove_write(vm_page_t p, int flags, boolean_t *allclean); -static void vm_object_qcollapse(vm_object_t object); -static void vm_object_vndeallocate(vm_object_t object); static void vm_object_backing_remove(vm_object_t object); /* @@ -164,12 +162,18 @@ SYSCTL_COUNTER_U64(_vm_stats_object, OID_AUTO, bypasse &object_bypasses, "VM object bypasses"); +static counter_u64_t object_collapse_waits = EARLY_COUNTER; +SYSCTL_COUNTER_U64(_vm_stats_object, OID_AUTO, collapse_waits, CTLFLAG_RD, + &object_collapse_waits, + "Number of sleeps for collapse"); + static void counter_startup(void) { object_collapses = counter_u64_alloc(M_WAITOK); object_bypasses = counter_u64_alloc(M_WAITOK); + object_collapse_waits = counter_u64_alloc(M_WAITOK); } SYSINIT(object_counters, SI_SUB_CPU, SI_ORDER_ANY, counter_startup, NULL); @@ -376,6 +380,19 @@ vm_object_pip_wakeupn(vm_object_t object, short i) refcount_releasen(&object->paging_in_progress, i); } +/* + * Atomically drop the interlock and wait for pip to drain. This protects + * from sleep/wakeup races due to identity changes. The lock is not + * re-acquired on return. + */ +static void +vm_object_pip_sleep(vm_object_t object, char *waitid) +{ + + refcount_sleep_interlock(&object->paging_in_progress, + &object->lock, waitid, PVM); +} + void vm_object_pip_wait(vm_object_t object, char *waitid) { @@ -383,8 +400,7 @@ vm_object_pip_wait(vm_object_t object, char *waitid) VM_OBJECT_ASSERT_WLOCKED(object); while (REFCOUNT_COUNT(object->paging_in_progress) > 0) { - VM_OBJECT_WUNLOCK(object); - refcount_wait(&object->paging_in_progress, waitid, PVM); + vm_object_pip_sleep(object, waitid); VM_OBJECT_WLOCK(object); } } @@ -466,30 +482,17 @@ vm_object_allocate_anon(vm_pindex_t size, vm_object_t return (object); } - -/* - * vm_object_reference: - * - * Gets another reference to the given object. Note: OBJ_DEAD - * objects can be referenced during final cleaning. - */ -void -vm_object_reference(vm_object_t object) +static void +vm_object_reference_vnode(vm_object_t object) { struct vnode *vp; u_int old; - if (object == NULL) - return; - /* - * Many places assume exclusive access to objects with a single - * ref. vm_object_collapse() in particular will directly mainpulate - * references for objects in this state. vnode objects only need - * the lock for the first ref to reference the vnode. + * vnode objects need the lock for the first reference + * to serialize with vnode_object_deallocate(). */ - if (!refcount_acquire_if_gt(&object->ref_count, - object->type == OBJT_VNODE ? 0 : 1)) { + if (!refcount_acquire_if_gt(&object->ref_count, 0)) { VM_OBJECT_RLOCK(object); old = refcount_acquire(&object->ref_count); if (object->type == OBJT_VNODE && old == 0) { @@ -501,6 +504,26 @@ vm_object_reference(vm_object_t object) } /* + * vm_object_reference: + * + * Acquires a reference to the given object. + */ +void +vm_object_reference(vm_object_t object) +{ + + if (object == NULL) + return; + + if (object->type == OBJT_VNODE) + vm_object_reference_vnode(object); + else + refcount_acquire(&object->ref_count); + KASSERT((object->flags & OBJ_DEAD) == 0, + ("vm_object_reference: Referenced dead object.")); +} + +/* * vm_object_reference_locked: * * Gets another reference to the given object. @@ -516,23 +539,23 @@ vm_object_reference_locked(vm_object_t object) VM_OBJECT_ASSERT_LOCKED(object); old = refcount_acquire(&object->ref_count); if (object->type == OBJT_VNODE && old == 0) { - vp = object->handle; - vref(vp); - } + vp = object->handle; vref(vp); } + KASSERT((object->flags & OBJ_DEAD) == 0, + ("vm_object_reference: Referenced dead object.")); } /* * Handle deallocating an object of type OBJT_VNODE. */ static void -vm_object_vndeallocate(vm_object_t object) +vm_object_deallocate_vnode(vm_object_t object) { struct vnode *vp = (struct vnode *) object->handle; bool last; KASSERT(object->type == OBJT_VNODE, - ("vm_object_vndeallocate: not a vnode object")); - KASSERT(vp != NULL, ("vm_object_vndeallocate: missing vp")); + ("vm_object_deallocate_vnode: not a vnode object")); + KASSERT(vp != NULL, ("vm_object_deallocate_vnode: missing vp")); /* Object lock to protect handle lookup. */ last = refcount_release(&object->ref_count); @@ -548,7 +571,54 @@ vm_object_vndeallocate(vm_object_t object) vrele(vp); } + /* + * We dropped a reference on an object and discovered that it had a + * single remaining shadow. This is a sibling of the reference we + * dropped. Attempt to collapse the sibling and backing object. + */ +static vm_object_t +vm_object_deallocate_anon(vm_object_t backing_object) +{ + vm_object_t object; + + /* Fetch the final shadow. */ + object = LIST_FIRST(&backing_object->shadow_head); + KASSERT(object != NULL && backing_object->shadow_count == 1, + ("vm_object_anon_deallocate: ref_count: %d, shadow_count: %d", + backing_object->ref_count, backing_object->shadow_count)); + KASSERT((object->flags & (OBJ_TMPFS_NODE | OBJ_ANON)) == OBJ_ANON, + ("invalid shadow object %p", object)); + + if (!VM_OBJECT_TRYWLOCK(object)) { + /* + * Prevent object from disappearing since we do not have a + * reference. + */ + vm_object_pip_add(object, 1); + VM_OBJECT_WUNLOCK(backing_object); + VM_OBJECT_WLOCK(object); + vm_object_pip_wakeup(object); + } else + VM_OBJECT_WUNLOCK(backing_object); + + /* + * Check for a collapse/terminate race with the last reference holder. + */ + if ((object->flags & (OBJ_DEAD | OBJ_COLLAPSING)) != 0 || + !refcount_acquire_if_not_zero(&object->ref_count)) { + VM_OBJECT_WUNLOCK(object); + return (NULL); + } + backing_object = object->backing_object; + if (backing_object != NULL && (backing_object->flags & OBJ_ANON) != 0) + vm_object_collapse(object); + VM_OBJECT_WUNLOCK(object); + + return (object); +} + +/* * vm_object_deallocate: * * Release a reference to the specified object, @@ -562,7 +632,7 @@ vm_object_vndeallocate(vm_object_t object) void vm_object_deallocate(vm_object_t object) { - vm_object_t robject, temp; + vm_object_t temp; bool released; while (object != NULL) { @@ -583,7 +653,7 @@ vm_object_deallocate(vm_object_t object) if (object->type == OBJT_VNODE) { VM_OBJECT_RLOCK(object); if (object->type == OBJT_VNODE) { - vm_object_vndeallocate(object); + vm_object_deallocate_vnode(object); return; } VM_OBJECT_RUNLOCK(object); @@ -594,92 +664,30 @@ vm_object_deallocate(vm_object_t object) ("vm_object_deallocate: object deallocated too many times: %d", object->type)); - if (refcount_release(&object->ref_count)) - goto doterm; - if (object->ref_count > 1) { - VM_OBJECT_WUNLOCK(object); - return; - } else if (object->ref_count == 1) { - if (object->shadow_count == 0 && - (object->flags & OBJ_ANON) != 0) { - vm_object_set_flag(object, OBJ_ONEMAPPING); - } else if (object->shadow_count == 1) { - KASSERT((object->flags & OBJ_ANON) != 0, - ("obj %p with shadow_count > 0 is not anon", - object)); - robject = LIST_FIRST(&object->shadow_head); - KASSERT(robject != NULL, - ("vm_object_deallocate: ref_count: %d, " - "shadow_count: %d", object->ref_count, - object->shadow_count)); - KASSERT((robject->flags & OBJ_TMPFS_NODE) == 0, - ("shadowed tmpfs v_object %p", object)); - if (!VM_OBJECT_TRYWLOCK(robject)) { - /* - * Avoid a potential deadlock. - */ - refcount_acquire(&object->ref_count); - VM_OBJECT_WUNLOCK(object); - /* - * More likely than not the thread - * holding robject's lock has lower - * priority than the current thread. - * Let the lower priority thread run. - */ - pause("vmo_de", 1); - continue; - } - /* - * Collapse object into its shadow unless its - * shadow is dead. In that case, object will - * be deallocated by the thread that is - * deallocating its shadow. - */ - if ((robject->flags & - (OBJ_DEAD | OBJ_ANON)) == OBJ_ANON) { - - refcount_acquire(&robject->ref_count); -retry: - if (REFCOUNT_COUNT(robject->paging_in_progress) > 0) { - VM_OBJECT_WUNLOCK(object); - vm_object_pip_wait(robject, - "objde1"); - temp = robject->backing_object; - if (object == temp) { - VM_OBJECT_WLOCK(object); - goto retry; - } - } else if (REFCOUNT_COUNT(object->paging_in_progress) > 0) { - VM_OBJECT_WUNLOCK(robject); - VM_OBJECT_WUNLOCK(object); - refcount_wait( - &object->paging_in_progress, - "objde2", PVM); - VM_OBJECT_WLOCK(robject); - temp = robject->backing_object; - if (object == temp) { - VM_OBJECT_WLOCK(object); - goto retry; - } - } else - VM_OBJECT_WUNLOCK(object); - - if (robject->ref_count == 1) { - refcount_release(&robject->ref_count); - object = robject; - goto doterm; - } - object = robject; - vm_object_collapse(object); - VM_OBJECT_WUNLOCK(object); - continue; - } - VM_OBJECT_WUNLOCK(robject); + /* + * If this is not the final reference to an anonymous + * object we may need to collapse the shadow chain. + */ + if (!refcount_release(&object->ref_count)) { + if (object->ref_count > 1 || + object->shadow_count == 0) { + if ((object->flags & OBJ_ANON) != 0 && + object->ref_count == 1) + vm_object_set_flag(object, + OBJ_ONEMAPPING); + VM_OBJECT_WUNLOCK(object); + return; } - VM_OBJECT_WUNLOCK(object); - return; + + /* Handle collapsing last ref on anonymous objects. */ + object = vm_object_deallocate_anon(object); + continue; } -doterm: + + /* + * Handle the final reference to an object. We restart + * the loop with the backing object to avoid recursion. + */ umtx_shm_object_terminated(object); temp = object->backing_object; if (temp != NULL) { @@ -687,16 +695,11 @@ doterm: ("shadowed tmpfs v_object 2 %p", object)); vm_object_backing_remove(object); } - /* - * Don't double-terminate, we could be in a termination - * recursion due to the terminate having to sync data - * to disk. - */ - if ((object->flags & OBJ_DEAD) == 0) { - vm_object_set_flag(object, OBJ_DEAD); - vm_object_terminate(object); - } else - VM_OBJECT_WUNLOCK(object); + + KASSERT((object->flags & OBJ_DEAD) == 0, + ("vm_object_deallocate: Terminating dead object.")); + vm_object_set_flag(object, OBJ_DEAD); + vm_object_terminate(object); object = temp; } } @@ -734,6 +737,9 @@ vm_object_backing_remove_locked(vm_object_t object) VM_OBJECT_ASSERT_WLOCKED(object); VM_OBJECT_ASSERT_WLOCKED(backing_object); + KASSERT((object->flags & OBJ_COLLAPSING) == 0, + ("vm_object_backing_remove: Removing collapsing object.")); + if ((object->flags & OBJ_SHADOWLIST) != 0) { LIST_REMOVE(object, shadow_list); backing_object->shadow_count--; @@ -788,8 +794,100 @@ vm_object_backing_insert(vm_object_t object, vm_object object->backing_object = backing_object; } +/* + * Insert an object into a backing_object's shadow list with an additional + * reference to the backing_object added. + */ +static void +vm_object_backing_insert_ref(vm_object_t object, vm_object_t backing_object) +{ + VM_OBJECT_ASSERT_WLOCKED(object); + + if ((backing_object->flags & OBJ_ANON) != 0) { + VM_OBJECT_WLOCK(backing_object); + KASSERT((backing_object->flags & OBJ_DEAD) == 0, + ("shadowing dead anonymous object")); + vm_object_reference_locked(backing_object); + vm_object_backing_insert_locked(object, backing_object); + vm_object_clear_flag(backing_object, OBJ_ONEMAPPING); + VM_OBJECT_WUNLOCK(backing_object); + } else { + vm_object_reference(backing_object); + object->backing_object = backing_object; + } +} + /* + * Transfer a backing reference from backing_object to object. + */ +static void +vm_object_backing_transfer(vm_object_t object, vm_object_t backing_object) +{ + vm_object_t new_backing_object; + + /* + * Note that the reference to backing_object->backing_object + * moves from within backing_object to within object. + */ + vm_object_backing_remove_locked(object); + new_backing_object = backing_object->backing_object; + if (new_backing_object == NULL) + return; + if ((new_backing_object->flags & OBJ_ANON) != 0) { + VM_OBJECT_WLOCK(new_backing_object); + vm_object_backing_remove_locked(backing_object); + vm_object_backing_insert_locked(object, new_backing_object); + VM_OBJECT_WUNLOCK(new_backing_object); + } else { + object->backing_object = new_backing_object; + backing_object->backing_object = NULL; + } +} + +/* + * Wait for a concurrent collapse to settle. + */ +static void +vm_object_collapse_wait(vm_object_t object) +{ + + VM_OBJECT_ASSERT_WLOCKED(object); + + while ((object->flags & OBJ_COLLAPSING) != 0) { + vm_object_pip_wait(object, "vmcolwait"); + counter_u64_add(object_collapse_waits, 1); + } +} + +/* + * Waits for a backing object to clear a pending collapse and returns + * it locked if it is an ANON object. + */ +static vm_object_t +vm_object_backing_collapse_wait(vm_object_t object) +{ + vm_object_t backing_object; + + VM_OBJECT_ASSERT_WLOCKED(object); + + for (;;) { + backing_object = object->backing_object; + if (backing_object == NULL || + (backing_object->flags & OBJ_ANON) == 0) + return (NULL); + VM_OBJECT_WLOCK(backing_object); + if ((backing_object->flags & (OBJ_DEAD | OBJ_COLLAPSING)) == 0) + break; + VM_OBJECT_WUNLOCK(object); + vm_object_pip_sleep(backing_object, "vmbckwait"); + counter_u64_add(object_collapse_waits, 1); + VM_OBJECT_WLOCK(object); + } + return (backing_object); +} + +/* * vm_object_terminate_pages removes any remaining pageable pages * from the object and resets the object to an empty state. */ @@ -843,9 +941,14 @@ vm_object_terminate_pages(vm_object_t object) void vm_object_terminate(vm_object_t object) { + VM_OBJECT_ASSERT_WLOCKED(object); KASSERT((object->flags & OBJ_DEAD) != 0, ("terminating non-dead obj %p", object)); + KASSERT((object->flags & OBJ_COLLAPSING) == 0, + ("terminating collapsing obj %p", object)); + KASSERT(object->backing_object == NULL, + ("terminating shadow obj %p", object)); /* * wait for the pageout daemon to be done with the object @@ -853,11 +956,11 @@ vm_object_terminate(vm_object_t object) vm_object_pip_wait(object, "objtrm"); KASSERT(!REFCOUNT_COUNT(object->paging_in_progress), - ("vm_object_terminate: pageout in progress")); + ("vm_object_terminate: pageout in progress")); - KASSERT(object->ref_count == 0, - ("vm_object_terminate: object with references, ref_count=%d", - object->ref_count)); + KASSERT(object->ref_count == 0, + ("vm_object_terminate: object with references, ref_count=%d", + object->ref_count)); if ((object->flags & OBJ_PG_DTOR) == 0) vm_object_terminate_pages(object); @@ -1397,11 +1500,13 @@ void vm_object_split(vm_map_entry_t entry) { vm_page_t m, m_next; - vm_object_t orig_object, new_object, source; + vm_object_t orig_object, new_object, backing_object; vm_pindex_t idx, offidxstart; vm_size_t size; orig_object = entry->object.vm_object; + KASSERT((orig_object->flags & OBJ_ONEMAPPING) != 0, + ("vm_object_split: Splitting object with multiple mappings.")); if ((orig_object->flags & OBJ_ANON) == 0) return; if (orig_object->ref_count <= 1) @@ -1419,35 +1524,25 @@ vm_object_split(vm_map_entry_t entry) orig_object->cred, ptoa(size)); /* + * We must wait for the orig_object to complete any in-progress + * collapse so that the swap blocks are stable below. The + * additional reference on backing_object by new object will + * prevent further collapse operations until split completes. + */ + VM_OBJECT_WLOCK(orig_object); + vm_object_collapse_wait(orig_object); + + /* * At this point, the new object is still private, so the order in * which the original and new objects are locked does not matter. */ VM_OBJECT_WLOCK(new_object); - VM_OBJECT_WLOCK(orig_object); new_object->domain = orig_object->domain; - source = orig_object->backing_object; - if (source != NULL) { - if ((source->flags & (OBJ_ANON | OBJ_DEAD)) != 0) { - VM_OBJECT_WLOCK(source); - if ((source->flags & OBJ_DEAD) != 0) { - VM_OBJECT_WUNLOCK(source); - VM_OBJECT_WUNLOCK(orig_object); - VM_OBJECT_WUNLOCK(new_object); - new_object->cred = NULL; - vm_object_deallocate(new_object); - VM_OBJECT_WLOCK(orig_object); - return; - } - vm_object_backing_insert_locked(new_object, source); - vm_object_reference_locked(source); /* for new_object */ - vm_object_clear_flag(source, OBJ_ONEMAPPING); - VM_OBJECT_WUNLOCK(source); - } else { - vm_object_backing_insert(new_object, source); - vm_object_reference(source); - } + backing_object = orig_object->backing_object; + if (backing_object != NULL) { + vm_object_backing_insert_ref(new_object, backing_object); new_object->backing_object_offset = - orig_object->backing_object_offset + entry->offset; + orig_object->backing_object_offset + entry->offset; } if (orig_object->cred != NULL) { crhold(orig_object->cred); @@ -1455,6 +1550,12 @@ vm_object_split(vm_map_entry_t entry) ("orig_object->charge < 0")); orig_object->charge -= ptoa(size); } + + /* + * Mark the split operation so that swap_pager_getpages() knows + * that the object is in transition. + */ + vm_object_set_flag(orig_object, OBJ_SPLIT); retry: m = vm_page_find_least(orig_object, offidxstart); for (; m != NULL && (idx = m->pindex - offidxstart) < size; @@ -1523,6 +1624,7 @@ retry: TAILQ_FOREACH(m, &new_object->memq, listq) vm_page_xunbusy(m); } + vm_object_clear_flag(orig_object, OBJ_SPLIT); VM_OBJECT_WUNLOCK(orig_object); VM_OBJECT_WUNLOCK(new_object); entry->object.vm_object = new_object; @@ -1531,12 +1633,8 @@ retry: VM_OBJECT_WLOCK(new_object); } -#define OBSC_COLLAPSE_NOWAIT 0x0002 -#define OBSC_COLLAPSE_WAIT 0x0004 - static vm_page_t -vm_object_collapse_scan_wait(vm_object_t object, vm_page_t p, vm_page_t next, - int op) +vm_object_collapse_scan_wait(vm_object_t object, vm_page_t p) { vm_object_t backing_object; @@ -1546,8 +1644,6 @@ vm_object_collapse_scan_wait(vm_object_t object, vm_pa KASSERT(p == NULL || p->object == object || p->object == backing_object, ("invalid ownership %p %p %p", p, object, backing_object)); - if ((op & OBSC_COLLAPSE_NOWAIT) != 0) - return (next); /* The page is only NULL when rename fails. */ if (p == NULL) { VM_OBJECT_WUNLOCK(object); @@ -1632,8 +1728,8 @@ vm_object_scan_all_shadowed(vm_object_t object) return (true); } -static bool -vm_object_collapse_scan(vm_object_t object, int op) +static void +vm_object_collapse_scan(vm_object_t object) { vm_object_t backing_object; vm_page_t next, p, pp; @@ -1646,12 +1742,6 @@ vm_object_collapse_scan(vm_object_t object, int op) backing_offset_index = OFF_TO_IDX(object->backing_object_offset); /* - * Initial conditions - */ - if ((op & OBSC_COLLAPSE_WAIT) != 0) - vm_object_set_flag(backing_object, OBJ_DEAD); - - /* * Our scan */ for (p = TAILQ_FIRST(&backing_object->memq); p != NULL; p = next) { @@ -1662,12 +1752,16 @@ vm_object_collapse_scan(vm_object_t object, int op) * Check for busy page */ if (vm_page_tryxbusy(p) == 0) { - next = vm_object_collapse_scan_wait(object, p, next, op); + next = vm_object_collapse_scan_wait(object, p); continue; } + KASSERT(object->backing_object == backing_object, + ("vm_object_collapse_scan: backing object mismatch %p != %p", + object->backing_object, backing_object)); KASSERT(p->object == backing_object, - ("vm_object_collapse_scan: object mismatch")); + ("vm_object_collapse_scan: object mismatch %p != %p", + p->object, backing_object)); if (p->pindex < backing_offset_index || new_pindex >= object->size) { @@ -1689,16 +1783,9 @@ vm_object_collapse_scan(vm_object_t object, int op) * The page in the parent is busy and possibly not * (yet) valid. Until its state is finalized by the * busy bit owner, we can't tell whether it shadows the - * original page. Therefore, we must either skip it - * and the original (backing_object) page or wait for - * its state to be finalized. - * - * This is due to a race with vm_fault() where we must - * unbusy the original (backing_obj) page before we can - * (re)lock the parent. Hence we can get here. + * original page. */ - next = vm_object_collapse_scan_wait(object, pp, next, - op); + next = vm_object_collapse_scan_wait(object, pp); continue; } @@ -1742,10 +1829,7 @@ vm_object_collapse_scan(vm_object_t object, int op) */ if (vm_page_rename(p, object, new_pindex)) { vm_page_xunbusy(p); - if (pp != NULL) - vm_page_xunbusy(pp); - next = vm_object_collapse_scan_wait(object, NULL, next, - op); + next = vm_object_collapse_scan_wait(object, NULL); continue; } @@ -1763,30 +1847,10 @@ vm_object_collapse_scan(vm_object_t object, int op) #endif vm_page_xunbusy(p); } - return (true); + return; } - /* - * this version of collapse allows the operation to occur earlier and - * when paging_in_progress is true for an object... This is not a complete - * operation, but should plug 99.9% of the rest of the leaks. - */ -static void -vm_object_qcollapse(vm_object_t object) -{ - vm_object_t backing_object = object->backing_object; - - VM_OBJECT_ASSERT_WLOCKED(object); - VM_OBJECT_ASSERT_WLOCKED(backing_object); - - if (backing_object->ref_count != 1) - return; - - vm_object_collapse_scan(object, OBSC_COLLAPSE_NOWAIT); -} - -/* * vm_object_collapse: * * Collapse an object with the object backing it. @@ -1801,53 +1865,48 @@ vm_object_collapse(vm_object_t object) VM_OBJECT_ASSERT_WLOCKED(object); while (TRUE) { - /* - * Verify that the conditions are right for collapse: - * - * The object exists and the backing object exists. - */ - if ((backing_object = object->backing_object) == NULL) - break; + KASSERT((object->flags & (OBJ_DEAD | OBJ_ANON)) == OBJ_ANON, + ("collapsing invalid object")); /* - * we check the backing object first, because it is most likely - * not collapsable. + * Wait for the backing_object to finish any pending + * collapse so that the caller sees the shortest possible + * shadow chain. */ - if ((backing_object->flags & OBJ_ANON) == 0) - break; - VM_OBJECT_WLOCK(backing_object); - if ((backing_object->flags & OBJ_DEAD) != 0 || - (object->flags & (OBJ_DEAD | OBJ_ANON)) != OBJ_ANON) { - VM_OBJECT_WUNLOCK(backing_object); - break; - } + backing_object = vm_object_backing_collapse_wait(object); + if (backing_object == NULL) + return; - if (REFCOUNT_COUNT(object->paging_in_progress) > 0 || - REFCOUNT_COUNT(backing_object->paging_in_progress) > 0) { - vm_object_qcollapse(object); - VM_OBJECT_WUNLOCK(backing_object); - break; - } + KASSERT(object->ref_count > 0 && + object->ref_count > object->shadow_count, + ("collapse with invalid ref %d or shadow %d count.", + object->ref_count, object->shadow_count)); + KASSERT((backing_object->flags & + (OBJ_COLLAPSING | OBJ_DEAD)) == 0, + ("vm_object_collapse: Backing object already collapsing.")); + KASSERT((object->flags & (OBJ_COLLAPSING | OBJ_DEAD)) == 0, + ("vm_object_collapse: object is already collapsing.")); /* - * We know that we can either collapse the backing object (if - * the parent is the only reference to it) or (perhaps) have + * We know that we can either collapse the backing object if + * the parent is the only reference to it, or (perhaps) have * the parent bypass the object if the parent happens to shadow * all the resident pages in the entire backing object. - * - * This is ignoring pager-backed pages such as swap pages. - * vm_object_collapse_scan fails the shadowing test in this - * case. */ if (backing_object->ref_count == 1) { + KASSERT(backing_object->shadow_count == 1, + ("vm_object_collapse: shadow_count: %d", + backing_object->shadow_count)); vm_object_pip_add(object, 1); + vm_object_set_flag(object, OBJ_COLLAPSING); vm_object_pip_add(backing_object, 1); + vm_object_set_flag(backing_object, OBJ_DEAD); /* * If there is exactly one reference to the backing * object, we can collapse it into the parent. */ - vm_object_collapse_scan(object, OBSC_COLLAPSE_WAIT); + vm_object_collapse_scan(object); #if VM_NRESERVLEVEL > 0 /* @@ -1866,31 +1925,24 @@ vm_object_collapse(vm_object_t object) * the backing_object's and object's locks are * released and reacquired. * Since swap_pager_copy() is being asked to - * destroy the source, it will change the - * backing_object's type to OBJT_DEFAULT. + * destroy backing_object, it will change the + * type to OBJT_DEFAULT. */ swap_pager_copy( backing_object, object, OFF_TO_IDX(object->backing_object_offset), TRUE); } + /* * Object now shadows whatever backing_object did. - * Note that the reference to - * backing_object->backing_object moves from within - * backing_object to within object. */ - vm_object_backing_remove_locked(object); - new_backing_object = backing_object->backing_object; - if (new_backing_object != NULL) { - VM_OBJECT_WLOCK(new_backing_object); - vm_object_backing_remove_locked(backing_object); - vm_object_backing_insert_locked(object, - new_backing_object); - VM_OBJECT_WUNLOCK(new_backing_object); - } + vm_object_clear_flag(object, OBJ_COLLAPSING); + vm_object_backing_transfer(object, backing_object); object->backing_object_offset += backing_object->backing_object_offset; + VM_OBJECT_WUNLOCK(object); + vm_object_pip_wakeup(object); /* * Discard backing_object. @@ -1903,17 +1955,17 @@ vm_object_collapse(vm_object_t object) "backing_object %p was somehow re-referenced during collapse!", backing_object)); vm_object_pip_wakeup(backing_object); - backing_object->type = OBJT_DEAD; - refcount_release(&backing_object->ref_count); - VM_OBJECT_WUNLOCK(backing_object); - vm_object_destroy(backing_object); - - vm_object_pip_wakeup(object); + (void)refcount_release(&backing_object->ref_count); + vm_object_terminate(backing_object); counter_u64_add(object_collapses, 1); + VM_OBJECT_WLOCK(object); } else { /* * If we do not entirely shadow the backing object, * there is nothing we can do so we give up. + * + * The object lock and backing_object lock must not + * be dropped during this sequence. */ if (!vm_object_scan_all_shadowed(object)) { VM_OBJECT_WUNLOCK(backing_object); @@ -1926,21 +1978,22 @@ vm_object_collapse(vm_object_t object) * it, since its reference count is at least 2. */ vm_object_backing_remove_locked(object); - new_backing_object = backing_object->backing_object; if (new_backing_object != NULL) { - vm_object_backing_insert(object, + vm_object_backing_insert_ref(object, new_backing_object); - vm_object_reference(new_backing_object); object->backing_object_offset += - backing_object->backing_object_offset; + backing_object->backing_object_offset; } /* * Drop the reference count on backing_object. Since * its ref_count was at least 2, it will not vanish. */ - refcount_release(&backing_object->ref_count); + (void)refcount_release(&backing_object->ref_count); + KASSERT(backing_object->ref_count >= 1, ( +"backing_object %p was somehow dereferenced during collapse!", + backing_object)); VM_OBJECT_WUNLOCK(backing_object); counter_u64_add(object_bypasses, 1); } @@ -2155,7 +2208,7 @@ vm_object_coalesce(vm_object_t prev_object, vm_ooffset VM_OBJECT_WLOCK(prev_object); /* - * Try to collapse the object first + * Try to collapse the object first. */ vm_object_collapse(prev_object); Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Sun Jan 19 18:18:17 2020 (r356885) +++ head/sys/vm/vm_object.h Sun Jan 19 18:30:23 2020 (r356886) @@ -190,6 +190,8 @@ struct vm_object { #define OBJ_SIZEVNLOCK 0x0040 /* lock vnode to check obj size */ #define OBJ_PG_DTOR 0x0080 /* dont reset object, leave that for dtor */ #define OBJ_TMPFS_NODE 0x0200 /* object belongs to tmpfs VREG node */ +#define OBJ_SPLIT 0x0400 /* object is being split */ +#define OBJ_COLLAPSING 0x0800 /* Parent of collapse. */ #define OBJ_COLORED 0x1000 /* pg_color is defined */ #define OBJ_ONEMAPPING 0x2000 /* One USE (a single, non-forked) mapping flag */ #define OBJ_SHADOWLIST 0x4000 /* Object is on the shadow list. */ From owner-svn-src-all@freebsd.org Sun Jan 19 18:36:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 840AB221BD9; Sun, 19 Jan 2020 18:36:04 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4813Qr2pDsz4YNp; Sun, 19 Jan 2020 18:36:04 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5704EF259; Sun, 19 Jan 2020 18:36:04 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00JIa4lb061072; Sun, 19 Jan 2020 18:36:04 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00JIa4Rd061071; Sun, 19 Jan 2020 18:36:04 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001191836.00JIa4Rd061071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 19 Jan 2020 18:36:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356887 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 356887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 18:36:04 -0000 Author: jeff Date: Sun Jan 19 18:36:03 2020 New Revision: 356887 URL: https://svnweb.freebsd.org/changeset/base/356887 Log: It has not been possible to recursively terminate a vnode object for some time now. Eliminate the dead code that supports it. Approved by: kib, markj Differential Revision: https://reviews.freebsd.org/D22908 Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Sun Jan 19 18:30:23 2020 (r356886) +++ head/sys/vm/vnode_pager.c Sun Jan 19 18:36:03 2020 (r356887) @@ -200,36 +200,24 @@ vnode_destroy_vobject(struct vnode *vp) MPASS(obj->type == OBJT_VNODE); umtx_shm_object_terminated(obj); if (obj->ref_count == 0) { + KASSERT((obj->flags & OBJ_DEAD) == 0, + ("vnode_destroy_vobject: Terminating dead object")); + vm_object_set_flag(obj, OBJ_DEAD); + /* - * don't double-terminate the object + * Clean pages and flush buffers. */ - if ((obj->flags & OBJ_DEAD) == 0) { - vm_object_set_flag(obj, OBJ_DEAD); + vm_object_page_clean(obj, 0, 0, OBJPC_SYNC); + VM_OBJECT_WUNLOCK(obj); - /* - * Clean pages and flush buffers. - */ - vm_object_page_clean(obj, 0, 0, OBJPC_SYNC); - VM_OBJECT_WUNLOCK(obj); + vinvalbuf(vp, V_SAVE, 0, 0); - vinvalbuf(vp, V_SAVE, 0, 0); + BO_LOCK(&vp->v_bufobj); + vp->v_bufobj.bo_flag |= BO_DEAD; + BO_UNLOCK(&vp->v_bufobj); - BO_LOCK(&vp->v_bufobj); - vp->v_bufobj.bo_flag |= BO_DEAD; - BO_UNLOCK(&vp->v_bufobj); - - VM_OBJECT_WLOCK(obj); - vm_object_terminate(obj); - } else { - /* - * Waiters were already handled during object - * termination. The exclusive vnode lock hopefully - * prevented new waiters from referencing the dying - * object. - */ - vp->v_object = NULL; - VM_OBJECT_WUNLOCK(obj); - } + VM_OBJECT_WLOCK(obj); + vm_object_terminate(obj); } else { /* * Woe to the process that tries to page now :-). From owner-svn-src-all@freebsd.org Sun Jan 19 18:51:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 58013221EF9; Sun, 19 Jan 2020 18:51:37 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yw1-f46.google.com (mail-yw1-f46.google.com [209.85.161.46]) (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 4813mm2Nccz4Yw8; Sun, 19 Jan 2020 18:51:36 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yw1-f46.google.com with SMTP id l14so16919938ywj.9; Sun, 19 Jan 2020 10:51:36 -0800 (PST) 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=6xxuo2vQSZvxtQ8pmiX3R6hLAHUIOaVVolXrzfBcIy4=; b=LMtkGo7Q/R6fOefWa8pIxVybLamg94jjY+dHj2wSGwVUdtN/5IJxobleQFPJlC4mVA 96fYLa8Hd9Ag3ZAcF1sEedK/N9zkRZuIH5jlm/LYxW5Rc62D8xC6BFAmo/rtIsAocPNw cD1wpCLwRY/9SEitk9pnj70FUyrwyhmrFVG/1SImv0jpG3tY+0wmy2U8K/AJ7c+UFkD0 eK1vWrpoT9HOpXHL6O0qczjI+CAI5xKNdQ5x6bh5BvaKFQjlD45v7E2WfEb4iq75ApVt HDrkT3UEPnKziZmK/tzzISHrBfkNPDVk1BZdr+8Sv21sMc8ikfKLsTV6e90Odq6UbHLQ ifoQ== X-Gm-Message-State: APjAAAWJ7LYJFBMYZ5xhxUghD5kIUdEah3iIIXXfPQ2lqDBoNYcvaBQF r0dneJy5uNNRGoDcpcliqLVNrrg7hmTFozOx4wY= X-Google-Smtp-Source: APXvYqwu5siUjhaWfOX7bk1T7ZNpXzm1EfFOomjyqBj76lSSMC91U0mtVbSdW0XndD+Niu4csGVFUR3cfDLAom7yLvo= X-Received: by 2002:a0d:eb8e:: with SMTP id u136mr9855723ywe.17.1579459895117; Sun, 19 Jan 2020 10:51:35 -0800 (PST) MIME-Version: 1.0 References: <202001190537.00J5bRw7090354@repo.freebsd.org> In-Reply-To: From: Li-Wen Hsu Date: Mon, 20 Jan 2020 02:51:24 +0800 Message-ID: Subject: Re: svn commit: r356880 - head/sys/kern To: Mateusz Guzik Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4813mm2Nccz4Yw8 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of lwhsufreebsd@gmail.com designates 209.85.161.46 as permitted sender) smtp.mailfrom=lwhsufreebsd@gmail.com X-Spamd-Result: default: False [-3.85 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; MIME_TRACE(0.00)[0:+,1:+,2:~]; DMARC_NA(0.00)[freebsd.org]; RWL_MAILSPIKE_GOOD(0.00)[46.161.85.209.rep.mailspike.net : 127.0.0.18]; URI_COUNT_ODD(1.00)[11]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[46.161.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.85)[ip: (-9.29), ipnet: 209.85.128.0/17(-3.07), asn: 15169(-1.82), country: US(-0.05)]; FORGED_SENDER(0.30)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; FREEMAIL_TO(0.00)[gmail.com]; 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)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; TAGGED_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] 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: Sun, 19 Jan 2020 18:51:37 -0000 Thanks, the new build backed to normal. https://ci.freebsd.org/job/FreeBSD-head-riscv64-test/13246/ Li-Wen On Mon, Jan 20, 2020 at 01:05 Mateusz Guzik wrote: > oops, see r356883. > > On 1/19/20, Li-Wen Hsu wrote: > > On Sun, Jan 19, 2020 at 1:37 PM Mateusz Guzik wrote: > >> > >> Author: mjg > >> Date: Sun Jan 19 05:37:27 2020 > >> New Revision: 356880 > >> URL: https://svnweb.freebsd.org/changeset/base/356880 > >> > >> Log: > >> cache: convert numcachehv to counter(9) on 64-bit platforms > > > > This or r356879 seem to broke RISC-V booting. Can you check this error? > > > > Full log: > > https://ci.freebsd.org/job/FreeBSD-head-riscv64-test/13243/console > > > > Panic message and bt: > > Trying to mount root from ufs:/dev/vtbd0 []... > > WARNING: WITNESS option enabled, expect reduced performance. > > panic: Not in critical section > > cpuid = 1 > > time = 3 > > KDB: stack backtrace: > > db_trace_self() at db_fetch_ksymtab+0x12a > > pc = 0xffffffc00053915c ra = 0xffffffc0000f6848 > > sp = 0xffffffc017631010 fp = 0xffffffc017631230 > > > > db_fetch_ksymtab() at kdb_backtrace+0x2c > > pc = 0xffffffc0000f6848 ra = 0xffffffc0002a60ce > > sp = 0xffffffc017631230 fp = 0xffffffc0176312e0 > > > > kdb_backtrace() at vpanic+0x144 > > pc = 0xffffffc0002a60ce ra = 0xffffffc000263818 > > sp = 0xffffffc0176312e0 fp = 0xffffffc017631320 > > > > vpanic() at panic+0x26 > > pc = 0xffffffc000263818 ra = 0xffffffc000263626 > > sp = 0xffffffc017631320 fp = 0xffffffc017631340 > > > > panic() at cache_enter_time+0x11e8 > > pc = 0xffffffc000263626 ra = 0xffffffc00030b72a > > sp = 0xffffffc017631340 fp = 0xffffffc017631490 > > > > cache_enter_time() at ufs_lookup_ino+0xa4c > > pc = 0xffffffc00030b72a ra = 0xffffffc0004e2604 > > sp = 0xffffffc017631490 fp = 0xffffffc017631600 > > > > ufs_lookup_ino() at ufs_lookup+0x14 > > pc = 0xffffffc0004e2604 ra = 0xffffffc0004e1bac > > sp = 0xffffffc017631600 fp = 0xffffffc017631610 > > > > ufs_lookup() at VOP_CACHEDLOOKUP_APV+0x32 > > pc = 0xffffffc0004e1bac ra = 0xffffffc000549560 > > sp = 0xffffffc017631610 fp = 0xffffffc017631630 > > > > VOP_CACHEDLOOKUP_APV() at vfs_cache_lookup+0xd2 > > pc = 0xffffffc000549560 ra = 0xffffffc00030d350 > > sp = 0xffffffc017631630 fp = 0xffffffc017631680 > > > > vfs_cache_lookup() at VOP_LOOKUP_APV+0x32 > > pc = 0xffffffc00030d350 ra = 0xffffffc000549428 > > sp = 0xffffffc017631680 fp = 0xffffffc0176316a0 > > > > VOP_LOOKUP_APV() at lookup+0x560 > > pc = 0xffffffc000549428 ra = 0xffffffc0003163ba > > sp = 0xffffffc0176316a0 fp = 0xffffffc0176317b0 > > > > lookup() at namei+0x398 > > pc = 0xffffffc0003163ba ra = 0xffffffc000315974 > > sp = 0xffffffc0176317b0 fp = 0xffffffc0176318b0 > > > > namei() at vfs_mountroot+0x100e > > pc = 0xffffffc000315974 ra = 0xffffffc00031ce78 > > sp = 0xffffffc0176318b0 fp = 0xffffffc017631ac0 > > > > vfs_mountroot() at mi_startup+0xfee > > pc = 0xffffffc00031ce78 ra = 0xffffffc0002039fa > > sp = 0xffffffc017631ac0 fp = 0xffffffc017631b90 > > > > mi_startup() at fork_exit+0x68 > > pc = 0xffffffc0002039fa ra = 0xffffffc0002272e4 > > sp = 0xffffffc017631b90 fp = 0xffffffc017631bd0 > > > > fork_exit() at fork_trampoline+0xa > > pc = 0xffffffc0002272e4 ra = 0xffffffc000547baa > > sp = 0xffffffc017631bd0 fp = 0xffffffc0002039cc > > > > fork_trampoline() at 0xc3c080e700060093 > > pc = 0xffffffc000547baa ra = 0xc3c080e700060093 > > sp = 0xffffffc0002039cc fp = 0x5fc5051300398517 > > > > KDB: enter: panic > > > > > -- > Mateusz Guzik > From owner-svn-src-all@freebsd.org Sun Jan 19 19:14:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8CE18222521; Sun, 19 Jan 2020 19:14:52 +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 4814Hc3vP3z4ZvD; Sun, 19 Jan 2020 19:14:52 +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 7FF1FF9C3; Sun, 19 Jan 2020 19:14:52 +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 00JJEqDp084663; Sun, 19 Jan 2020 19:14:52 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00JJEnIM084649; Sun, 19 Jan 2020 19:14:49 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202001191914.00JJEnIM084649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 19 Jan 2020 19:14:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356888 - in head/sys/arm/allwinner: . a10 a13 a20 a31 a33 a64 a83t h3 h6 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/arm/allwinner: . a10 a13 a20 a31 a33 a64 a83t h3 h6 X-SVN-Commit-Revision: 356888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 19:14:52 -0000 Author: manu Date: Sun Jan 19 19:14:49 2020 New Revision: 356888 URL: https://svnweb.freebsd.org/changeset/base/356888 Log: arm: allwinner: Fix padconf for interrupts information Add a eint_bank member to the allwinner_pins structure. On Allwinner SoCs not all pins can do interrupt. Older SoC (A10/A13 and A20) there is a maximum number of interrupts set to 32 and all the configuration is done in the same registers. While on "newer" SoCs (>=A31) interrupts registers are splitted per pin bank (i.e. all interrupts available in bank B will be configured with a sets of registers and the one in bank G in another set). While here set the names to all interrupts function to pX_eintY where X is the bank name and Y the interrupt number. To whom ever in the future look at the H5 manual and notice that the bank F have interrupts support : This isn't true, trust me. MFC after: 1 month Modified: head/sys/arm/allwinner/a10/a10_padconf.c head/sys/arm/allwinner/a13/a13_padconf.c head/sys/arm/allwinner/a20/a20_padconf.c head/sys/arm/allwinner/a31/a31_padconf.c head/sys/arm/allwinner/a31/a31s_padconf.c head/sys/arm/allwinner/a33/a33_padconf.c head/sys/arm/allwinner/a64/a64_padconf.c head/sys/arm/allwinner/a64/a64_r_padconf.c head/sys/arm/allwinner/a83t/a83t_padconf.c head/sys/arm/allwinner/allwinner_pinctrl.h head/sys/arm/allwinner/h3/h3_padconf.c head/sys/arm/allwinner/h3/h3_r_padconf.c head/sys/arm/allwinner/h6/h6_padconf.c head/sys/arm/allwinner/h6/h6_r_padconf.c Modified: head/sys/arm/allwinner/a10/a10_padconf.c ============================================================================== --- head/sys/arm/allwinner/a10/a10_padconf.c Sun Jan 19 18:36:03 2020 (r356887) +++ head/sys/arm/allwinner/a10/a10_padconf.c Sun Jan 19 19:14:49 2020 (r356888) @@ -169,28 +169,28 @@ const static struct allwinner_pins a10_pins[] = { {"PG10", 6, 10, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}}, {"PG11", 6, 11, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}}, - {"PH0", 7, 0, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint0", "csi1"}, 6, 0}, - {"PH1", 7, 1, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint1", "csi1"}, 6, 1}, - {"PH2", 7, 2, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint2", "csi1"}, 6, 2}, - {"PH3", 7, 3, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint3", "csi1"}, 6, 3}, - {"PH4", 7, 4, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "eint4", "csi1"}, 6, 4}, - {"PH5", 7, 5, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "eint5", "csi1"}, 6, 5}, - {"PH6", 7, 6, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "eint6", "csi1"}, 6, 6}, - {"PH7", 7, 7, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "eint7", "csi1"}, 6, 7}, - {"PH8", 7, 8, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint8", "csi1"}, 6, 8}, - {"PH9", 7, 9, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint9", "csi1"}, 6, 9}, - {"PH10", 7, 10, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint10", "csi1"}, 6, 10}, - {"PH11", 7, 11, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint11", "csi1"}, 6, 11}, - {"PH12", 7, 12, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", NULL, "eint12", "csi1"}, 6, 12}, - {"PH13", 7, 13, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", "sim", "eint13", "csi1"}, 6, 13}, - {"PH14", 7, 14, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint14", "csi1"}, 6, 14}, - {"PH15", 7, 15, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint15", "csi1"}, 6, 15}, - {"PH16", 7, 16, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", NULL, "eint16", "csi1"}, 6, 16}, - {"PH17", 7, 17, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint17", "csi1"}, 6, 17}, - {"PH18", 7, 18, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint18", "csi1"}, 6, 18}, - {"PH19", 7, 19, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint19", "csi1"}, 6, 19}, - {"PH20", 7, 20, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "eint20", "csi1"}, 6, 20}, - {"PH21", 7, 21, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "eint21", "csi1"}, 6, 21}, + {"PH0", 7, 0, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "ph_eint0", "csi1"}, 6, 0, 0}, + {"PH1", 7, 1, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "ph_eint1", "csi1"}, 6, 1, 0}, + {"PH2", 7, 2, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "ph_eint2", "csi1"}, 6, 2, 0}, + {"PH3", 7, 3, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "ph_eint3", "csi1"}, 6, 3, 0}, + {"PH4", 7, 4, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "ph_eint4", "csi1"}, 6, 4, 0}, + {"PH5", 7, 5, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "ph_eint5", "csi1"}, 6, 5, 0}, + {"PH6", 7, 6, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "ph_eint6", "csi1"}, 6, 6, 0}, + {"PH7", 7, 7, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "ph_eint7", "csi1"}, 6, 7, 0}, + {"PH8", 7, 8, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "ph_eint8", "csi1"}, 6, 8, 0}, + {"PH9", 7, 9, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "ph_eint9", "csi1"}, 6, 9, 0}, + {"PH10", 7, 10, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "ph_eint10", "csi1"}, 6, 10, 0}, + {"PH11", 7, 11, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "ph_eint11", "csi1"}, 6, 11, 0}, + {"PH12", 7, 12, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", NULL, "ph_eint12", "csi1"}, 6, 12, 0}, + {"PH13", 7, 13, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", "sim", "ph_eint13", "csi1"}, 6, 13, 0}, + {"PH14", 7, 14, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "ph_eint14", "csi1"}, 6, 14, 0}, + {"PH15", 7, 15, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "ph_eint15", "csi1"}, 6, 15, 0}, + {"PH16", 7, 16, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", NULL, "ph_eint16", "csi1"}, 6, 16, 0}, + {"PH17", 7, 17, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "ph_eint17", "csi1"}, 6, 17, 0}, + {"PH18", 7, 18, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "ph_eint18", "csi1"}, 6, 18, 0}, + {"PH19", 7, 19, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "ph_eint19", "csi1"}, 6, 19, 0}, + {"PH20", 7, 20, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "ph_eint20", "csi1"}, 6, 20, 0}, + {"PH21", 7, 21, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "ph_eint21", "csi1"}, 6, 21, 0}, {"PH22", 7, 22, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, {"PH23", 7, 23, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, {"PH24", 7, 24, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, @@ -208,16 +208,16 @@ const static struct allwinner_pins a10_pins[] = { {"PI7", 8, 7, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, {"PI8", 8, 8, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, {"PI9", 8, 9, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, - {"PI10", 8, 10, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "eint22", NULL}, 6, 22}, - {"PI11", 8, 11, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "eint23", NULL}, 6, 23}, - {"PI12", 8, 12, {"gpio_in", "gpio_out", "spi0", "uart6", NULL, NULL, "eint24", NULL}, 6, 24}, - {"PI13", 8, 13, {"gpio_in", "gpio_out", "spi0", "uart6", NULL, NULL, "eint25", NULL}, 6, 25}, - {"PI14", 8, 14, {"gpio_in", "gpio_out", "spi0", "ps2", "timer4", NULL, "eint26", NULL}, 6, 26}, - {"PI15", 8, 15, {"gpio_in", "gpio_out", "spi1", "ps2", "timer5", NULL, "eint27", NULL}, 6, 27}, - {"PI16", 8, 16, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint28", NULL}, 6, 28}, - {"PI17", 8, 17, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint29", NULL}, 6, 29}, - {"PI18", 8, 18, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint30", NULL}, 6, 30}, - {"PI19", 8, 19, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint31", NULL}, 6, 31}, + {"PI10", 8, 10, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "pi_eint22", NULL}, 6, 22, 0}, + {"PI11", 8, 11, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "pi_eint23", NULL}, 6, 23, 0}, + {"PI12", 8, 12, {"gpio_in", "gpio_out", "spi0", "uart6", NULL, NULL, "pi_eint24", NULL}, 6, 24, 0}, + {"PI13", 8, 13, {"gpio_in", "gpio_out", "spi0", "uart6", NULL, NULL, "pi_eint25", NULL}, 6, 25, 0}, + {"PI14", 8, 14, {"gpio_in", "gpio_out", "spi0", "ps2", "timer4", NULL, "pi_eint26", NULL}, 6, 26, 0}, + {"PI15", 8, 15, {"gpio_in", "gpio_out", "spi1", "ps2", "timer5", NULL, "pi_eint27", NULL}, 6, 27, 0}, + {"PI16", 8, 16, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "pi_eint28", NULL}, 6, 28, 0}, + {"PI17", 8, 17, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "pi_eint29", NULL}, 6, 29, 0}, + {"PI18", 8, 18, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "pi_eint30", NULL}, 6, 30, 0}, + {"PI19", 8, 19, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "pi_eint31", NULL}, 6, 31, 0}, {"PI20", 8, 20, {"gpio_in", "gpio_out", "ps2", "uart7", "hdmi", NULL, NULL, NULL}}, {"PI21", 8, 21, {"gpio_in", "gpio_out", "ps2", "uart7", "hdmi", NULL, NULL, NULL}}, }; Modified: head/sys/arm/allwinner/a13/a13_padconf.c ============================================================================== --- head/sys/arm/allwinner/a13/a13_padconf.c Sun Jan 19 18:36:03 2020 (r356887) +++ head/sys/arm/allwinner/a13/a13_padconf.c Sun Jan 19 19:14:49 2020 (r356888) @@ -39,10 +39,10 @@ __FBSDID("$FreeBSD$"); const static struct allwinner_pins a13_pins[] = { {"PB0", 1, 0, {"gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, NULL, NULL}}, {"PB1", 1, 1, {"gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, NULL, NULL}}, - {"PB2", 1, 2, {"gpio_in", "gpio_out", "pwm", NULL, NULL, NULL, "eint16", NULL}, 6, 16}, - {"PB3", 1, 3, {"gpio_in", "gpio_out", "ir0", NULL, NULL, NULL, "eint17", NULL}, 6, 17}, - {"PB4", 1, 4, {"gpio_in", "gpio_out", "ir0", NULL, NULL, NULL, "eint18", NULL}, 6, 18}, - {"PB10", 1, 10, {"gpio_in", "gpio_out", "spi2", NULL, NULL, NULL, "eint24", NULL}, 6, 24}, + {"PB2", 1, 2, {"gpio_in", "gpio_out", "pwm", NULL, NULL, NULL, "pb_eint16", NULL}, 6, 16, 0}, + {"PB3", 1, 3, {"gpio_in", "gpio_out", "ir0", NULL, NULL, NULL, "pb_eint17", NULL}, 6, 17, 0}, + {"PB4", 1, 4, {"gpio_in", "gpio_out", "ir0", NULL, NULL, NULL, "pb_eint18", NULL}, 6, 18, 0}, + {"PB10", 1, 10, {"gpio_in", "gpio_out", "spi2", NULL, NULL, NULL, "pb_eint24", NULL}, 6, 24, 0}, {"PB15", 1, 15, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, {"PB16", 1, 16, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, {"PB17", 1, 17, {"gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, NULL, NULL}}, @@ -89,8 +89,8 @@ const static struct allwinner_pins a13_pins[] = { {"PD26", 3, 26, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, {"PD27", 3, 27, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, - {"PE0", 4, 0, {"gpio_in", NULL, NULL, "csi0", "spi2", NULL, "eint14", NULL}, 6, 14}, - {"PE1", 4, 1, {"gpio_in", NULL, NULL, "csi0", "spi2", NULL, "eint15", NULL}, 6, 15}, + {"PE0", 4, 0, {"gpio_in", NULL, NULL, "csi0", "spi2", NULL, "pe_eint14", NULL}, 6, 14, 0}, + {"PE1", 4, 1, {"gpio_in", NULL, NULL, "csi0", "spi2", NULL, "pe_eint15", NULL}, 6, 15, 0}, {"PE2", 4, 2, {"gpio_in", NULL, NULL, "csi0", "spi2", NULL, NULL, NULL}}, {"PE3", 4, 3, {"gpio_in", "gpio_out", NULL, "csi0", "spi2", NULL, NULL, NULL}}, {"PE4", 4, 4, {"gpio_in", "gpio_out", NULL, "csi0", "mmc2", NULL, NULL, NULL}}, @@ -109,15 +109,15 @@ const static struct allwinner_pins a13_pins[] = { {"PF4", 5, 4, {"gpio_in", "gpio_out", "mmc0", NULL, NULL, NULL, NULL, NULL}}, {"PF5", 5, 5, {"gpio_in", "gpio_out", "mmc0", NULL, NULL, NULL, NULL, NULL}}, - {"PG0", 6, 0, {"gpio_in", NULL, NULL, NULL, NULL, NULL, "eint0", NULL}, 6, 0}, - {"PG1", 6, 1, {"gpio_in", NULL, NULL, NULL, NULL, NULL, "eint1", NULL}, 6, 1}, - {"PG2", 6, 2, {"gpio_in", NULL, NULL, NULL, NULL, NULL, "eint2", NULL}, 6, 2}, - {"PG3", 6, 3, {"gpio_in", "gpio_out", "mmc1", NULL, "uart1", NULL, "eint3", NULL}, 6, 3}, - {"PG4", 6, 4, {"gpio_in", "gpio_out", "mmc1", NULL, "uart1", NULL, "eint4", NULL}, 6, 4}, - {"PG9", 6, 9, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint9", NULL}, 6, 9}, - {"PG10", 6, 10, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint10", NULL}, 6, 10}, - {"PG11", 6, 11, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint11", NULL}, 6, 11}, - {"PG12", 6, 12, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "eint12", NULL}, 6, 12}, + {"PG0", 6, 0, {"gpio_in", NULL, NULL, NULL, NULL, NULL, "pg_eint0", NULL}, 6, 0, 6}, + {"PG1", 6, 1, {"gpio_in", NULL, NULL, NULL, NULL, NULL, "pg_eint1", NULL}, 6, 1, 6}, + {"PG2", 6, 2, {"gpio_in", NULL, NULL, NULL, NULL, NULL, "pg_eint2", NULL}, 6, 2, 6}, + {"PG3", 6, 3, {"gpio_in", "gpio_out", "mmc1", NULL, "uart1", NULL, "pg_eint3", NULL}, 6, 3, 0}, + {"PG4", 6, 4, {"gpio_in", "gpio_out", "mmc1", NULL, "uart1", NULL, "pg_eint4", NULL}, 6, 4, 0}, + {"PG9", 6, 9, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "pg_eint9", NULL}, 6, 9, 0}, + {"PG10", 6, 10, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "pg_eint10", NULL}, 6, 10, 0}, + {"PG11", 6, 11, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "pg_eint11", NULL}, 6, 11, 0}, + {"PG12", 6, 12, {"gpio_in", "gpio_out", "spi1", "uart3", NULL, NULL, "pg_eint12", NULL}, 6, 12, 0}, }; const struct allwinner_padconf a13_padconf = { Modified: head/sys/arm/allwinner/a20/a20_padconf.c ============================================================================== --- head/sys/arm/allwinner/a20/a20_padconf.c Sun Jan 19 18:36:03 2020 (r356887) +++ head/sys/arm/allwinner/a20/a20_padconf.c Sun Jan 19 19:14:49 2020 (r356888) @@ -100,10 +100,10 @@ const static struct allwinner_pins a20_pins[] = { {"PC16", 2, 16, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, {"PC17", 2, 17, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, {"PC18", 2, 18, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, - {"PC19", 2, 19, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, "eint12", NULL}, 6, 12}, - {"PC20", 2, 20, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, "eint13", NULL}, 6, 13}, - {"PC21", 2, 21, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, "eint14", NULL}, 6, 14}, - {"PC22", 2, 22, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, "eint15", NULL}, 6, 15}, + {"PC19", 2, 19, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, NULL, NULL}}, + {"PC20", 2, 20, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, NULL, NULL}}, + {"PC21", 2, 21, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, NULL, NULL}}, + {"PC22", 2, 22, {"gpio_in", "gpio_out", "nand0", "spi2", NULL, NULL, NULL, NULL}}, {"PC23", 2, 23, {"gpio_in", "gpio_out", NULL, "spi0", NULL, NULL, NULL, NULL}}, {"PC24", 2, 24, {"gpio_in", "gpio_out", "nand0", NULL, NULL, NULL, NULL, NULL}}, @@ -169,28 +169,28 @@ const static struct allwinner_pins a20_pins[] = { {"PG10", 6, 10, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}}, {"PG11", 6, 11, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}}, - {"PH0", 7, 0, {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "eint0", "csi1"}, 6, 0}, - {"PH1", 7, 1, {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "eint1", "csi1"}, 6, 1}, - {"PH2", 7, 2, {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "eint2", "csi1"}, 6, 2}, - {"PH3", 7, 3, {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "eint3", "csi1"}, 6, 3}, - {"PH4", 7, 4, {"gpio_in", "gpio_out", "lcd1", NULL, "uart4", NULL, "eint4", "csi1"}, 6, 4}, - {"PH5", 7, 5, {"gpio_in", "gpio_out", "lcd1", NULL, "uart4", NULL, "eint5", "csi1"}, 6, 5}, - {"PH6", 7, 6, {"gpio_in", "gpio_out", "lcd1", NULL, "uart5", "ms", "eint6", "csi1"}, 6, 6}, - {"PH7", 7, 7, {"gpio_in", "gpio_out", "lcd1", NULL, "uart5", "ms", "eint7", "csi1"}, 6, 7}, - {"PH8", 7, 8, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "eint8", "csi1"}, 6, 8}, - {"PH9", 7, 9, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "eint9", "csi1"}, 6, 9}, - {"PH10", 7, 10, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "eint10", "csi1"}, 6, 10}, - {"PH11", 7, 11, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "eint11", "csi1"}, 6, 11}, - {"PH12", 7, 12, {"gpio_in", "gpio_out", "lcd1", NULL, "ps2", NULL, "eint12", "csi1"}, 6, 12}, - {"PH13", 7, 13, {"gpio_in", "gpio_out", "lcd1", NULL, "ps2", "sim", "eint13", "csi1"}, 6, 13}, - {"PH14", 7, 14, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint14", "csi1"}, 6, 14}, - {"PH15", 7, 15, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint15", "csi1"}, 6, 15}, - {"PH16", 7, 16, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint16", "csi1"}, 6, 16}, - {"PH17", 7, 17, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint17", "csi1"}, 6, 17}, - {"PH18", 7, 18, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint18", "csi1"}, 6, 18}, - {"PH19", 7, 19, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "eint19", "csi1"}, 6, 19}, - {"PH20", 7, 20, {"gpio_in", "gpio_out", "lcd1", NULL, "can", NULL, "eint20", "csi1"}, 6, 20}, - {"PH21", 7, 21, {"gpio_in", "gpio_out", "lcd1", NULL, "can", NULL, "eint21", "csi1"}, 6, 21}, + {"PH0", 7, 0, {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "ph_eint0", "csi1"}, 6, 0, 0}, + {"PH1", 7, 1, {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "ph_eint1", "csi1"}, 6, 1, 0}, + {"PH2", 7, 2, {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "ph_eint2", "csi1"}, 6, 2, 0}, + {"PH3", 7, 3, {"gpio_in", "gpio_out", "lcd1", NULL, "uart3", NULL, "ph_eint3", "csi1"}, 6, 3, 0}, + {"PH4", 7, 4, {"gpio_in", "gpio_out", "lcd1", NULL, "uart4", NULL, "ph_eint4", "csi1"}, 6, 4, 0}, + {"PH5", 7, 5, {"gpio_in", "gpio_out", "lcd1", NULL, "uart4", NULL, "ph_eint5", "csi1"}, 6, 5, 0}, + {"PH6", 7, 6, {"gpio_in", "gpio_out", "lcd1", NULL, "uart5", "ms", "ph_eint6", "csi1"}, 6, 6, 0}, + {"PH7", 7, 7, {"gpio_in", "gpio_out", "lcd1", NULL, "uart5", "ms", "ph_eint7", "csi1"}, 6, 7, 0}, + {"PH8", 7, 8, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "ph_eint8", "csi1"}, 6, 8, 0}, + {"PH9", 7, 9, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "ph_eint9", "csi1"}, 6, 9, 0}, + {"PH10", 7, 10, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "ph_eint10", "csi1"}, 6, 10, 0}, + {"PH11", 7, 11, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "ms", "ph_eint11", "csi1"}, 6, 11, 0}, + {"PH12", 7, 12, {"gpio_in", "gpio_out", "lcd1", NULL, "ps2", NULL, "ph_eint12", "csi1"}, 6, 12, 0}, + {"PH13", 7, 13, {"gpio_in", "gpio_out", "lcd1", NULL, "ps2", "sim", "ph_eint13", "csi1"}, 6, 13, 0}, + {"PH14", 7, 14, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "ph_eint14", "csi1"}, 6, 14, 0}, + {"PH15", 7, 15, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "ph_eint15", "csi1"}, 6, 15, 0}, + {"PH16", 7, 16, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "ph_eint16", "csi1"}, 6, 16, 0}, + {"PH17", 7, 17, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "ph_eint17", "csi1"}, 6, 17, 0}, + {"PH18", 7, 18, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "ph_eint18", "csi1"}, 6, 18, 0}, + {"PH19", 7, 19, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "sim", "ph_eint19", "csi1"}, 6, 19, 0}, + {"PH20", 7, 20, {"gpio_in", "gpio_out", "lcd1", NULL, "can", NULL, "ph_eint20", "csi1"}, 6, 20, 0}, + {"PH21", 7, 21, {"gpio_in", "gpio_out", "lcd1", NULL, "can", NULL, "ph_eint21", "csi1"}, 6, 21, 0}, {"PH22", 7, 22, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "mmc1", NULL, "csi1"}}, {"PH23", 7, 23, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "mmc1", NULL, "csi1"}}, {"PH24", 7, 24, {"gpio_in", "gpio_out", "lcd1", NULL, "keypad", "mmc1", NULL, "csi1"}}, @@ -208,16 +208,16 @@ const static struct allwinner_pins a20_pins[] = { {"PI7", 8, 7, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, {"PI8", 8, 8, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, {"PI9", 8, 9, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, - {"PI10", 8, 10, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "eint", NULL}}, - {"PI11", 8, 11, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "eint", NULL}}, - {"PI12", 8, 12, {"gpio_in", "gpio_out", "spi0", "uart6", "clk_out_a", NULL, "eint", NULL}}, - {"PI13", 8, 13, {"gpio_in", "gpio_out", "spi0", "uart6", "clk_out_b", NULL, "eint", NULL}}, - {"PI14", 8, 14, {"gpio_in", "gpio_out", "spi0", "ps2", "timer4", NULL, "eint", NULL}}, - {"PI15", 8, 15, {"gpio_in", "gpio_out", "spi1", "ps2", "timer5", NULL, "eint", NULL}}, - {"PI16", 8, 16, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, - {"PI17", 8, 17, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, - {"PI18", 8, 18, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, - {"PI19", 8, 19, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, + {"PI10", 8, 10, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "pi_eint22", NULL}, 6, 22, 0}, + {"PI11", 8, 11, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "pi_eint23", NULL}, 6, 23, 0}, + {"PI12", 8, 12, {"gpio_in", "gpio_out", "spi0", "uart6", "clk_out_a", NULL, "pi_eint24", NULL}, 6, 24, 0}, + {"PI13", 8, 13, {"gpio_in", "gpio_out", "spi0", "uart6", "clk_out_b", NULL, "pi_eint25", NULL}, 6, 25, 0}, + {"PI14", 8, 14, {"gpio_in", "gpio_out", "spi0", "ps2", "timer4", NULL, "pi_eint26", NULL}, 6, 26, 0}, + {"PI15", 8, 15, {"gpio_in", "gpio_out", "spi1", "ps2", "timer5", NULL, "pi_eint27", NULL}, 6, 27, 0}, + {"PI16", 8, 16, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "pi_eint28", NULL}, 6, 28, 0}, + {"PI17", 8, 17, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "pi_eint29", NULL}, 6, 29, 0}, + {"PI18", 8, 18, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "pi_eint30", NULL}, 6, 30, 0}, + {"PI19", 8, 19, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "pi_eint31", NULL}, 6, 31, 0}, {"PI20", 8, 20, {"gpio_in", "gpio_out", "ps2", "uart7", "hdmi", NULL, NULL, NULL}}, {"PI21", 8, 21, {"gpio_in", "gpio_out", "ps2", "uart7", "hdmi", NULL, NULL, NULL}}, }; Modified: head/sys/arm/allwinner/a31/a31_padconf.c ============================================================================== --- head/sys/arm/allwinner/a31/a31_padconf.c Sun Jan 19 18:36:03 2020 (r356887) +++ head/sys/arm/allwinner/a31/a31_padconf.c Sun Jan 19 19:14:49 2020 (r356888) @@ -37,43 +37,43 @@ __FBSDID("$FreeBSD$"); #ifdef SOC_ALLWINNER_A31 const static struct allwinner_pins a31_pins[] = { - {"PA0", 0, 0, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint0", NULL}, 6, 0}, - {"PA1", 0, 1, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint1", NULL}, 6, 1}, - {"PA2", 0, 2, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint2", NULL}, 6, 2}, - {"PA3", 0, 3, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint3", NULL}, 6, 3}, - {"PA4", 0, 4, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint4", NULL}, 6, 4}, - {"PA5", 0, 5, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint5", NULL}, 6, 5}, - {"PA6", 0, 6, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint6", NULL}, 6, 6}, - {"PA7", 0, 7, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint7", NULL}, 6, 7}, - {"PA8", 0, 8, {"gpio_in", "gpio_out", "gmac", "lcd1", NULL, NULL, "pa_eint8", NULL}, 6, 8}, - {"PA9", 0, 9, {"gpio_in", "gpio_out", "gmac", "lcd1", NULL, "mmc2", "pa_eint9", NULL}, 6, 9}, - {"PA10", 0, 10, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint10", NULL}, 6, 10}, - {"PA11", 0, 11, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint11", NULL}, 6, 11}, - {"PA12", 0, 12, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint12", NULL}, 6, 12}, - {"PA13", 0, 13, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint13", NULL}, 6, 13}, - {"PA14", 0, 14, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint14", NULL}, 6, 14}, - {"PA15", 0, 15, {"gpio_in", "gpio_out", "gmac", "lcd1", "clk_out_a", NULL, "pa_eint15", NULL}, 6, 15}, - {"PA16", 0, 16, {"gpio_in", "gpio_out", "gmac", "lcd1", "dmic", NULL, "pa_eint16", NULL}, 6, 16}, - {"PA17", 0, 17, {"gpio_in", "gpio_out", "gmac", "lcd1", "dmic", NULL, "pa_eint17", NULL}, 6, 17}, - {"PA18", 0, 18, {"gpio_in", "gpio_out", "gmac", "lcd1", "clk_out_b", NULL, "pa_eint18", NULL}, 6, 18}, - {"PA19", 0, 19, {"gpio_in", "gpio_out", "gmac", "lcd1", "pwm3", NULL, "pa_eint19", NULL}, 6, 19}, - {"PA20", 0, 20, {"gpio_in", "gpio_out", "gmac", "lcd1", "pwm3", NULL, "pa_eint20", NULL}, 6, 20}, - {"PA21", 0, 21, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint21", NULL}, 6, 21}, - {"PA22", 0, 22, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint22", NULL}, 6, 22}, - {"PA23", 0, 23, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint23", NULL}, 6, 23}, - {"PA24", 0, 24, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint24", NULL}, 6, 24}, - {"PA25", 0, 25, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint25", NULL}, 6, 25}, - {"PA26", 0, 26, {"gpio_in", "gpio_out", "gmac", "lcd1", "clk_out_c", NULL, "pa_eint26", NULL}, 6, 26}, - {"PA27", 0, 27, {"gpio_in", "gpio_out", "gmac", "lcd1", NULL, NULL, "pa_eint27", NULL}, 6, 27}, + {"PA0", 0, 0, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint0", NULL}, 6, 0, 0}, + {"PA1", 0, 1, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint1", NULL}, 6, 1, 0}, + {"PA2", 0, 2, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint2", NULL}, 6, 2, 0}, + {"PA3", 0, 3, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint3", NULL}, 6, 3, 0}, + {"PA4", 0, 4, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint4", NULL}, 6, 4, 0}, + {"PA5", 0, 5, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint5", NULL}, 6, 5, 0}, + {"PA6", 0, 6, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint6", NULL}, 6, 6, 0}, + {"PA7", 0, 7, {"gpio_in", "gpio_out", "gmac", "lcd1", "uart1", NULL, "pa_eint7", NULL}, 6, 7, 0}, + {"PA8", 0, 8, {"gpio_in", "gpio_out", "gmac", "lcd1", NULL, NULL, "pa_eint8", NULL}, 6, 8, 0}, + {"PA9", 0, 9, {"gpio_in", "gpio_out", "gmac", "lcd1", NULL, "mmc2", "pa_eint9", NULL}, 6, 9, 0}, + {"PA10", 0, 10, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint10", NULL}, 6, 10, 0}, + {"PA11", 0, 11, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint11", NULL}, 6, 11, 0}, + {"PA12", 0, 12, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint12", NULL}, 6, 12, 0}, + {"PA13", 0, 13, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint13", NULL}, 6, 13, 0}, + {"PA14", 0, 14, {"gpio_in", "gpio_out", "gmac", "lcd1", "mmc3", "mmc2", "pa_eint14", NULL}, 6, 14, 0}, + {"PA15", 0, 15, {"gpio_in", "gpio_out", "gmac", "lcd1", "clk_out_a", NULL, "pa_eint15", NULL}, 6, 15, 0}, + {"PA16", 0, 16, {"gpio_in", "gpio_out", "gmac", "lcd1", "dmic", NULL, "pa_eint16", NULL}, 6, 16, 0}, + {"PA17", 0, 17, {"gpio_in", "gpio_out", "gmac", "lcd1", "dmic", NULL, "pa_eint17", NULL}, 6, 17, 0}, + {"PA18", 0, 18, {"gpio_in", "gpio_out", "gmac", "lcd1", "clk_out_b", NULL, "pa_eint18", NULL}, 6, 18, 0}, + {"PA19", 0, 19, {"gpio_in", "gpio_out", "gmac", "lcd1", "pwm3", NULL, "pa_eint19", NULL}, 6, 19, 0}, + {"PA20", 0, 20, {"gpio_in", "gpio_out", "gmac", "lcd1", "pwm3", NULL, "pa_eint20", NULL}, 6, 20, 0}, + {"PA21", 0, 21, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint21", NULL}, 6, 21, 0}, + {"PA22", 0, 22, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint22", NULL}, 6, 22, 0}, + {"PA23", 0, 23, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint23", NULL}, 6, 23, 0}, + {"PA24", 0, 24, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint24", NULL}, 6, 24, 0}, + {"PA25", 0, 25, {"gpio_in", "gpio_out", "gmac", "lcd1", "spi3", NULL, "pa_eint25", NULL}, 6, 25, 0}, + {"PA26", 0, 26, {"gpio_in", "gpio_out", "gmac", "lcd1", "clk_out_c", NULL, "pa_eint26", NULL}, 6, 26, 0}, + {"PA27", 0, 27, {"gpio_in", "gpio_out", "gmac", "lcd1", NULL, NULL, "pa_eint27", NULL}, 6, 27, 0}, - {"PB0", 1, 0, {"gpio_in", "gpio_out", "i2s0", "uart3", "csi", NULL, "pb_eint0", NULL}, 6, 0}, - {"PB1", 1, 1, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint1", NULL}, 6, 1}, - {"PB2", 1, 2, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint2", NULL}, 6, 2}, - {"PB3", 1, 3, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint3", NULL}, 6, 3}, - {"PB4", 1, 4, {"gpio_in", "gpio_out", "i2s0", "uart3", NULL, NULL, "pb_eint4", NULL}, 6, 4}, - {"PB5", 1, 5, {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, "pb_eint5", NULL}, 6, 5}, - {"PB6", 1, 6, {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, "pb_eint6", NULL}, 6, 6}, - {"PB7", 1, 7, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint7", NULL}, 6, 7}, + {"PB0", 1, 0, {"gpio_in", "gpio_out", "i2s0", "uart3", "csi", NULL, "pb_eint0", NULL}, 6, 0, 1}, + {"PB1", 1, 1, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint1", NULL}, 6, 1, 1}, + {"PB2", 1, 2, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint2", NULL}, 6, 2, 1}, + {"PB3", 1, 3, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint3", NULL}, 6, 3, 1}, + {"PB4", 1, 4, {"gpio_in", "gpio_out", "i2s0", "uart3", NULL, NULL, "pb_eint4", NULL}, 6, 4, 1}, + {"PB5", 1, 5, {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, "pb_eint5", NULL}, 6, 5, 1}, + {"PB6", 1, 6, {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, "pb_eint6", NULL}, 6, 6, 1}, + {"PB7", 1, 7, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint7", NULL}, 6, 7, 1}, {"PC0", 2, 0, {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}}, {"PC1", 2, 1, {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}}, @@ -133,23 +133,23 @@ const static struct allwinner_pins a31_pins[] = { {"PD26", 3, 26, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, {"PD27", 3, 27, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, - {"PE0", 4, 0, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint0", NULL}, 6, 0}, - {"PE1", 4, 1, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint1", NULL}, 6, 1}, - {"PE2", 4, 2, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint2", NULL}, 6, 2}, - {"PE3", 4, 3, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint3", NULL}, 6, 3}, - {"PE4", 4, 4, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint4", NULL}, 6, 4}, - {"PE5", 4, 5, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint5", NULL}, 6, 5}, - {"PE6", 4, 6, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint6", NULL}, 6, 6}, - {"PE7", 4, 7, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint7", NULL}, 6, 7}, - {"PE8", 4, 8, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint8", NULL}, 6, 8}, - {"PE9", 4, 9, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint9", NULL}, 6, 9}, - {"PE10", 4, 10, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint10", NULL}, 6, 10}, - {"PE11", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint11", NULL}, 6, 11}, - {"PE12", 4, 12, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint12", NULL}, 6, 12}, - {"PE13", 4, 13, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint13", NULL}, 6, 13}, - {"PE14", 4, 14, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint14", NULL}, 6, 14}, - {"PE15", 4, 15, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint15", NULL}, 6, 15}, - {"PE16", 4, 16, {"gpio_in", "gpio_out", "csi", NULL, NULL, NULL, "pe_eint16", NULL}, 6, 16}, + {"PE0", 4, 0, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint0", NULL}, 6, 0, 4}, + {"PE1", 4, 1, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint1", NULL}, 6, 1, 4}, + {"PE2", 4, 2, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint2", NULL}, 6, 2, 4}, + {"PE3", 4, 3, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint3", NULL}, 6, 3, 4}, + {"PE4", 4, 4, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint4", NULL}, 6, 4, 4}, + {"PE5", 4, 5, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint5", NULL}, 6, 5, 4}, + {"PE6", 4, 6, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint6", NULL}, 6, 6, 4}, + {"PE7", 4, 7, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint7", NULL}, 6, 7, 4}, + {"PE8", 4, 8, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint8", NULL}, 6, 8, 4}, + {"PE9", 4, 9, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint9", NULL}, 6, 9, 4}, + {"PE10", 4, 10, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint10", NULL}, 6, 10, 4}, + {"PE11", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint11", NULL}, 6, 11, 4}, + {"PE12", 4, 12, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint12", NULL}, 6, 12, 4}, + {"PE13", 4, 13, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint13", NULL}, 6, 13, 4}, + {"PE14", 4, 14, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint14", NULL}, 6, 14, 4}, + {"PE15", 4, 15, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint15", NULL}, 6, 15, 4}, + {"PE16", 4, 16, {"gpio_in", "gpio_out", "csi", NULL, NULL, NULL, "pe_eint16", NULL}, 6, 16, 4}, {"PF0", 5, 0, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, {"PF1", 5, 1, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, @@ -158,25 +158,25 @@ const static struct allwinner_pins a31_pins[] = { {"PF4", 5, 4, {"gpio_in", "gpio_out", "mmc0", NULL, "uart0", NULL, NULL, NULL}}, {"PF5", 5, 5, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, - {"PG0", 6, 0, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0", NULL}, 6, 0}, - {"PG1", 6, 1, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1", NULL}, 6, 1}, - {"PG2", 6, 2, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2", NULL}, 6, 2}, - {"PG3", 6, 3, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3", NULL}, 6, 3}, - {"PG4", 6, 4, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4", NULL}, 6, 4}, - {"PG5", 6, 5, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5", NULL}, 6, 5}, - {"PG6", 6, 6, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint6", NULL}, 6, 6}, - {"PG7", 6, 7, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint7", NULL}, 6, 7}, - {"PG8", 6, 8, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint8", NULL}, 6, 8}, - {"PG9", 6, 9, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint9", NULL}, 6, 9}, - {"PG10", 6, 10, {"gpio_in", "gpio_out", "i2c3", "usb", NULL, NULL, "pg_eint10", NULL}, 6, 10}, - {"PG11", 6, 11, {"gpio_in", "gpio_out", "i2c3", "usb", NULL, NULL, "pg_eint11", NULL}, 6, 11}, - {"PG12", 6, 12, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint12", NULL}, 6, 12}, - {"PG13", 6, 13, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint13", NULL}, 6, 13}, - {"PG14", 6, 14, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint14", NULL}, 6, 14}, - {"PG15", 6, 15, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint15", NULL}, 6, 15}, - {"PG16", 6, 16, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint16", NULL}, 6, 16}, - {"PG17", 6, 17, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, "pg_eint17", NULL}, 6, 17}, - {"PG18", 6, 18, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, "pg_eint18", NULL}, 6, 18}, + {"PG0", 6, 0, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0", NULL}, 6, 0, 6}, + {"PG1", 6, 1, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1", NULL}, 6, 1, 6}, + {"PG2", 6, 2, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2", NULL}, 6, 2, 6}, + {"PG3", 6, 3, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3", NULL}, 6, 3, 6}, + {"PG4", 6, 4, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4", NULL}, 6, 4, 6}, + {"PG5", 6, 5, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5", NULL}, 6, 5, 6}, + {"PG6", 6, 6, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint6", NULL}, 6, 6, 6}, + {"PG7", 6, 7, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint7", NULL}, 6, 7, 6}, + {"PG8", 6, 8, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint8", NULL}, 6, 8, 6}, + {"PG9", 6, 9, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint9", NULL}, 6, 9, 6}, + {"PG10", 6, 10, {"gpio_in", "gpio_out", "i2c3", "usb", NULL, NULL, "pg_eint10", NULL}, 6, 10, 6}, + {"PG11", 6, 11, {"gpio_in", "gpio_out", "i2c3", "usb", NULL, NULL, "pg_eint11", NULL}, 6, 11, 6}, + {"PG12", 6, 12, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint12", NULL}, 6, 12, 6}, + {"PG13", 6, 13, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint13", NULL}, 6, 13, 6}, + {"PG14", 6, 14, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint14", NULL}, 6, 14, 6}, + {"PG15", 6, 15, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint15", NULL}, 6, 15, 6}, + {"PG16", 6, 16, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint16", NULL}, 6, 16, 6}, + {"PG17", 6, 17, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, "pg_eint17", NULL}, 6, 17, 6}, + {"PG18", 6, 18, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, "pg_eint18", NULL}, 6, 18, 6}, {"PH0", 7, 0, {"gpio_in", "gpio_out", "nand1", NULL, NULL, NULL, NULL, NULL}}, {"PH1", 7, 1, {"gpio_in", "gpio_out", "nand1", NULL, NULL, NULL, NULL, NULL}}, Modified: head/sys/arm/allwinner/a31/a31s_padconf.c ============================================================================== --- head/sys/arm/allwinner/a31/a31s_padconf.c Sun Jan 19 18:36:03 2020 (r356887) +++ head/sys/arm/allwinner/a31/a31s_padconf.c Sun Jan 19 19:14:49 2020 (r356888) @@ -37,43 +37,43 @@ __FBSDID("$FreeBSD$"); #ifdef SOC_ALLWINNER_A31S const static struct allwinner_pins a31s_pins[] = { - {"PA0", 0, 0, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint0", NULL}, 6, 0}, - {"PA1", 0, 1, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint1", NULL}, 6, 1}, - {"PA2", 0, 2, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint2", NULL}, 6, 2}, - {"PA3", 0, 3, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint3", NULL}, 6, 3}, - {"PA4", 0, 4, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint4", NULL}, 6, 4}, - {"PA5", 0, 5, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint5", NULL}, 6, 5}, - {"PA6", 0, 6, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint6", NULL}, 6, 6}, - {"PA7", 0, 7, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint7", NULL}, 6, 7}, - {"PA8", 0, 8, {"gpio_in", "gpio_out", "gmac", NULL, NULL, NULL, "pa_eint8", NULL}, 6, 8}, - {"PA9", 0, 9, {"gpio_in", "gpio_out", "gmac", NULL, NULL, NULL, "pa_eint9", NULL}, 6, 9}, - {"PA10", 0, 10, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint10", NULL}, 6, 10}, - {"PA11", 0, 11, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint11", NULL}, 6, 11}, - {"PA12", 0, 12, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint12", NULL}, 6, 12}, - {"PA13", 0, 13, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint13", NULL}, 6, 13}, - {"PA14", 0, 14, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint14", NULL}, 6, 14}, - {"PA15", 0, 15, {"gpio_in", "gpio_out", "gmac", NULL, "dmic", NULL, "pa_eint15", NULL}, 6, 15}, - {"PA16", 0, 16, {"gpio_in", "gpio_out", "gmac", NULL, "dmic", NULL, "pa_eint16", NULL}, 6, 16}, - {"PA17", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "clk_out_b", NULL, "pa_eint17", NULL}, 6, 17}, - {"PA18", 0, 18, {"gpio_in", "gpio_out", "gmac", NULL, "pwm3", NULL, "pa_eint18", NULL}, 6, 18}, - {"PA19", 0, 19, {"gpio_in", "gpio_out", "gmac", NULL, "pwm3", NULL, "pa_eint19", NULL}, 6, 19}, - {"PA20", 0, 20, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint20", NULL}, 6, 20}, - {"PA21", 0, 21, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint21", NULL}, 6, 21}, - {"PA22", 0, 22, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint22", NULL}, 6, 22}, - {"PA23", 0, 23, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint23", NULL}, 6, 23}, - {"PA24", 0, 24, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint24", NULL}, 6, 24}, - {"PA25", 0, 25, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint25", NULL}, 6, 25}, - {"PA26", 0, 26, {"gpio_in", "gpio_out", "gmac", NULL, "clk_out_c", NULL, "pa_eint26", NULL}, 6, 26}, - {"PA27", 0, 27, {"gpio_in", "gpio_out", "gmac", NULL, NULL, NULL, "pa_eint27", NULL}, 6, 27}, + {"PA0", 0, 0, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint0", NULL}, 6, 0, 0}, + {"PA1", 0, 1, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint1", NULL}, 6, 1, 0}, + {"PA2", 0, 2, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint2", NULL}, 6, 2, 0}, + {"PA3", 0, 3, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint3", NULL}, 6, 3, 0}, + {"PA4", 0, 4, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint4", NULL}, 6, 4, 0}, + {"PA5", 0, 5, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint5", NULL}, 6, 5, 0}, + {"PA6", 0, 6, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint6", NULL}, 6, 6, 0}, + {"PA7", 0, 7, {"gpio_in", "gpio_out", "gmac", NULL, "uart1", NULL, "pa_eint7", NULL}, 6, 7, 0}, + {"PA8", 0, 8, {"gpio_in", "gpio_out", "gmac", NULL, NULL, NULL, "pa_eint8", NULL}, 6, 8, 0}, + {"PA9", 0, 9, {"gpio_in", "gpio_out", "gmac", NULL, NULL, NULL, "pa_eint9", NULL}, 6, 9, 0}, + {"PA10", 0, 10, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint10", NULL}, 6, 10, 0}, + {"PA11", 0, 11, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint11", NULL}, 6, 11, 0}, + {"PA12", 0, 12, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint12", NULL}, 6, 12, 0}, + {"PA13", 0, 13, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint13", NULL}, 6, 13, 0}, + {"PA14", 0, 14, {"gpio_in", "gpio_out", "gmac", NULL, "mmc3", "mmc2", "pa_eint14", NULL}, 6, 14, 0}, + {"PA15", 0, 15, {"gpio_in", "gpio_out", "gmac", NULL, "dmic", NULL, "pa_eint15", NULL}, 6, 15, 0}, + {"PA16", 0, 16, {"gpio_in", "gpio_out", "gmac", NULL, "dmic", NULL, "pa_eint16", NULL}, 6, 16, 0}, + {"PA17", 0, 17, {"gpio_in", "gpio_out", "gmac", NULL, "clk_out_b", NULL, "pa_eint17", NULL}, 6, 17, 0}, + {"PA18", 0, 18, {"gpio_in", "gpio_out", "gmac", NULL, "pwm3", NULL, "pa_eint18", NULL}, 6, 18, 0}, + {"PA19", 0, 19, {"gpio_in", "gpio_out", "gmac", NULL, "pwm3", NULL, "pa_eint19", NULL}, 6, 19, 0}, + {"PA20", 0, 20, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint20", NULL}, 6, 20, 0}, + {"PA21", 0, 21, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint21", NULL}, 6, 21, 0}, + {"PA22", 0, 22, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint22", NULL}, 6, 22, 0}, + {"PA23", 0, 23, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint23", NULL}, 6, 23, 0}, + {"PA24", 0, 24, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint24", NULL}, 6, 24, 0}, + {"PA25", 0, 25, {"gpio_in", "gpio_out", "gmac", NULL, "spi3", NULL, "pa_eint25", NULL}, 6, 25, 0}, + {"PA26", 0, 26, {"gpio_in", "gpio_out", "gmac", NULL, "clk_out_c", NULL, "pa_eint26", NULL}, 6, 26, 0}, + {"PA27", 0, 27, {"gpio_in", "gpio_out", "gmac", NULL, NULL, NULL, "pa_eint27", NULL}, 6, 27, 0}, - {"PB0", 1, 0, {"gpio_in", "gpio_out", "i2s0", "uart3", NULL , NULL, "pb_eint0", NULL}, 6, 0}, - {"PB1", 1, 1, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint1", NULL}, 6, 1}, - {"PB2", 1, 2, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint2", NULL}, 6, 2}, - {"PB3", 1, 3, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint3", NULL}, 6, 3}, - {"PB4", 1, 4, {"gpio_in", "gpio_out", "i2s0", "uart3", NULL, NULL, "pb_eint4", NULL}, 6, 4}, - {"PB5", 1, 5, {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, "pb_eint5", NULL}, 6, 5}, - {"PB6", 1, 6, {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, "pb_eint6", NULL}, 6, 6}, - {"PB7", 1, 7, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint7", NULL}, 6, 7}, + {"PB0", 1, 0, {"gpio_in", "gpio_out", "i2s0", "uart3", NULL , NULL, "pb_eint0", NULL}, 6, 0, 1}, + {"PB1", 1, 1, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint1", NULL}, 6, 1, 1}, + {"PB2", 1, 2, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint2", NULL}, 6, 2, 1}, + {"PB3", 1, 3, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint3", NULL}, 6, 3, 1}, + {"PB4", 1, 4, {"gpio_in", "gpio_out", "i2s0", "uart3", NULL, NULL, "pb_eint4", NULL}, 6, 4, 1}, + {"PB5", 1, 5, {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, "pb_eint5", NULL}, 6, 5, 1}, + {"PB6", 1, 6, {"gpio_in", "gpio_out", "i2s0", "uart3", "i2c3", NULL, "pb_eint6", NULL}, 6, 6, 1}, + {"PB7", 1, 7, {"gpio_in", "gpio_out", "i2s0", NULL, NULL, NULL, "pb_eint7", NULL}, 6, 7, 1}, {"PC0", 2, 0, {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}}, {"PC1", 2, 1, {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}}, @@ -125,22 +125,22 @@ const static struct allwinner_pins a31s_pins[] = { {"PD26", 3, 26, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, {"PD27", 3, 27, {"gpio_in", "gpio_out", "lcd0", NULL, NULL, NULL, NULL, NULL}}, - {"PE0", 4, 0, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint0", NULL}, 6, 0}, - {"PE1", 4, 1, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint1", NULL}, 6, 1}, - {"PE2", 4, 2, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint2", NULL}, 6, 2}, - {"PE3", 4, 3, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint3", NULL}, 6, 3}, - {"PE4", 4, 4, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint4", NULL}, 6, 4}, - {"PE5", 4, 5, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint5", NULL}, 6, 5}, - {"PE6", 4, 6, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint6", NULL}, 6, 6}, - {"PE7", 4, 7, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint7", NULL}, 6, 7}, - {"PE8", 4, 8, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint8", NULL}, 6, 8}, - {"PE9", 4, 9, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint9", NULL}, 6, 9}, - {"PE10", 4, 10, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint10", NULL}, 6, 10}, - {"PE11", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint11", NULL}, 6, 11}, - {"PE12", 4, 12, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint12", NULL}, 6, 12}, - {"PE13", 4, 13, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint13", NULL}, 6, 13}, - {"PE14", 4, 14, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint14", NULL}, 6, 14}, - {"PE15", 4, 15, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint15", NULL}, 6, 15}, + {"PE0", 4, 0, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint0", NULL}, 6, 0, 4}, + {"PE1", 4, 1, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint1", NULL}, 6, 1, 4}, + {"PE2", 4, 2, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint2", NULL}, 6, 2, 4}, + {"PE3", 4, 3, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint3", NULL}, 6, 3, 4}, + {"PE4", 4, 4, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint4", NULL}, 6, 4, 4}, + {"PE5", 4, 5, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint5", NULL}, 6, 5, 4}, + {"PE6", 4, 6, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint6", NULL}, 6, 6, 4}, + {"PE7", 4, 7, {"gpio_in", "gpio_out", "csi", "uart5", NULL, NULL, "pe_eint7", NULL}, 6, 7, 4}, + {"PE8", 4, 8, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint8", NULL}, 6, 8, 4}, + {"PE9", 4, 9, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint9", NULL}, 6, 9, 4}, + {"PE10", 4, 10, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint10", NULL}, 6, 10, 4}, + {"PE11", 4, 11, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint11", NULL}, 6, 11, 4}, + {"PE12", 4, 12, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint12", NULL}, 6, 12, 4}, + {"PE13", 4, 13, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint13", NULL}, 6, 13, 4}, + {"PE14", 4, 14, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint14", NULL}, 6, 14, 4}, + {"PE15", 4, 15, {"gpio_in", "gpio_out", "csi", "ts", NULL, NULL, "pe_eint15", NULL}, 6, 15, 4}, {"PF0", 5, 0, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, {"PF1", 5, 1, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, @@ -149,25 +149,25 @@ const static struct allwinner_pins a31s_pins[] = { {"PF4", 5, 4, {"gpio_in", "gpio_out", "mmc0", NULL, "uart0", NULL, NULL, NULL}}, {"PF5", 5, 5, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, - {"PG0", 6, 0, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0", NULL}, 6, 0}, - {"PG1", 6, 1, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1", NULL}, 6, 1}, - {"PG2", 6, 2, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2", NULL}, 6, 2}, - {"PG3", 6, 3, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3", NULL}, 6, 3}, - {"PG4", 6, 4, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4", NULL}, 6, 4}, - {"PG5", 6, 5, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5", NULL}, 6, 5}, - {"PG6", 6, 6, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint6", NULL}, 6, 6}, - {"PG7", 6, 7, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint7", NULL}, 6, 7}, - {"PG8", 6, 8, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint8", NULL}, 6, 8}, - {"PG9", 6, 9, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint9", NULL}, 6, 9}, - {"PG10", 6, 10, {"gpio_in", "gpio_out", "i2c3", NULL, NULL, NULL, "pg_eint10", NULL}, 6, 10}, - {"PG11", 6, 11, {"gpio_in", "gpio_out", "i2c3", NULL, NULL, NULL, "pg_eint11", NULL}, 6, 11}, - {"PG12", 6, 12, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint12", NULL}, 6, 12}, - {"PG13", 6, 13, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint13", NULL}, 6, 13}, - {"PG14", 6, 14, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint14", NULL}, 6, 14}, - {"PG15", 6, 15, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint15", NULL}, 6, 15}, - {"PG16", 6, 16, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint16", NULL}, 6, 16}, - {"PG17", 6, 17, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, "pg_eint17", NULL}, 6, 17}, - {"PG18", 6, 18, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, "pg_eint18", NULL}, 6, 18}, + {"PG0", 6, 0, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0", NULL}, 6, 0, 6}, + {"PG1", 6, 1, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1", NULL}, 6, 1, 6}, + {"PG2", 6, 2, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2", NULL}, 6, 2, 6}, + {"PG3", 6, 3, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3", NULL}, 6, 3, 6}, + {"PG4", 6, 4, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4", NULL}, 6, 4, 6}, + {"PG5", 6, 5, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5", NULL}, 6, 5, 6}, + {"PG6", 6, 6, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint6", NULL}, 6, 6, 6}, + {"PG7", 6, 7, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint7", NULL}, 6, 7, 6}, + {"PG8", 6, 8, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint8", NULL}, 6, 8, 6}, + {"PG9", 6, 9, {"gpio_in", "gpio_out", "uart2", NULL, NULL, NULL, "pg_eint9", NULL}, 6, 9, 6}, + {"PG10", 6, 10, {"gpio_in", "gpio_out", "i2c3", NULL, NULL, NULL, "pg_eint10", NULL}, 6, 10, 6}, + {"PG11", 6, 11, {"gpio_in", "gpio_out", "i2c3", NULL, NULL, NULL, "pg_eint11", NULL}, 6, 11, 6}, + {"PG12", 6, 12, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint12", NULL}, 6, 12, 6}, + {"PG13", 6, 13, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint13", NULL}, 6, 13, 6}, + {"PG14", 6, 14, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint14", NULL}, 6, 14, 6}, + {"PG15", 6, 15, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint15", NULL}, 6, 15, 6}, + {"PG16", 6, 16, {"gpio_in", "gpio_out", "spi1", "i2s1", NULL, NULL, "pg_eint16", NULL}, 6, 16, 6}, + {"PG17", 6, 17, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, "pg_eint17", NULL}, 6, 17, 6}, + {"PG18", 6, 18, {"gpio_in", "gpio_out", "uart4", NULL, NULL, NULL, "pg_eint18", NULL}, 6, 18, 6}, {"PH9", 7, 9, {"gpio_in", "gpio_out", "spi2", "jtag", "pwm1", NULL, NULL, NULL}}, {"PH10", 7, 10, {"gpio_in", "gpio_out", "spi2", "jtag", "pwm1", NULL, NULL, NULL}}, Modified: head/sys/arm/allwinner/a33/a33_padconf.c ============================================================================== --- head/sys/arm/allwinner/a33/a33_padconf.c Sun Jan 19 18:36:03 2020 (r356887) +++ head/sys/arm/allwinner/a33/a33_padconf.c Sun Jan 19 19:14:49 2020 (r356888) @@ -37,14 +37,14 @@ __FBSDID("$FreeBSD$"); #ifdef SOC_ALLWINNER_A33 const static struct allwinner_pins a33_pins[] = { - {"PB0", 1, 0, {"gpio_in", "gpio_out", "uart2", "uart0", "pb_eint0", NULL}, 4, 0}, - {"PB1", 1, 1, {"gpio_in", "gpio_out", "uart2", "uart0", "pb_eint1", NULL}, 4, 1}, - {"PB2", 1, 2, {"gpio_in", "gpio_out", "uart2", NULL, "pb_eint2", NULL}, 4, 2}, - {"PB3", 1, 3, {"gpio_in", "gpio_out", "uart2", NULL, "pb_eint3", NULL}, 4, 3}, - {"PB4", 1, 4, {"gpio_in", "gpio_out", "i2s0", "aif2", "pb_eint4", NULL}, 4, 4}, - {"PB5", 1, 5, {"gpio_in", "gpio_out", "i2s0", "aif2", "pb_eint5", NULL}, 4, 5}, - {"PB6", 1, 6, {"gpio_in", "gpio_out", "i2s0", "aif2", "pb_eint6", NULL}, 4, 6}, - {"PB7", 1, 7, {"gpio_in", "gpio_out", "i2s0", "aif2", "pb_eint7", NULL}, 4, 7}, + {"PB0", 1, 0, {"gpio_in", "gpio_out", "uart2", "uart0", "pb_eint0", NULL}, 4, 0, 1}, + {"PB1", 1, 1, {"gpio_in", "gpio_out", "uart2", "uart0", "pb_eint1", NULL}, 4, 1, 1}, + {"PB2", 1, 2, {"gpio_in", "gpio_out", "uart2", NULL, "pb_eint2", NULL}, 4, 2, 1}, + {"PB3", 1, 3, {"gpio_in", "gpio_out", "uart2", NULL, "pb_eint3", NULL}, 4, 3, 1}, + {"PB4", 1, 4, {"gpio_in", "gpio_out", "i2s0", "aif2", "pb_eint4", NULL}, 4, 4, 1}, + {"PB5", 1, 5, {"gpio_in", "gpio_out", "i2s0", "aif2", "pb_eint5", NULL}, 4, 5, 1}, + {"PB6", 1, 6, {"gpio_in", "gpio_out", "i2s0", "aif2", "pb_eint6", NULL}, 4, 6, 1}, + {"PB7", 1, 7, {"gpio_in", "gpio_out", "i2s0", "aif2", "pb_eint7", NULL}, 4, 7, 1}, {"PC0", 2, 0, {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}}, {"PC1", 2, 1, {"gpio_in", "gpio_out", "nand0", "spi0", NULL, NULL, NULL, NULL}}, @@ -113,20 +113,20 @@ const static struct allwinner_pins a33_pins[] = { {"PF4", 5, 4, {"gpio_in", "gpio_out", "mmc0", "uart0", NULL, NULL, NULL}}, {"PF5", 5, 5, {"gpio_in", "gpio_out", "mmc0", "jtag", NULL, NULL, NULL}}, - {"PG0", 6, 0, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint0", NULL}, 4, 0}, - {"PG1", 6, 1, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint1", NULL}, 4, 1}, - {"PG2", 6, 2, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint2", NULL}, 4, 2}, - {"PG3", 6, 3, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint3", NULL}, 4, 3}, - {"PG4", 6, 4, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint4", NULL}, 4, 4}, - {"PG5", 6, 5, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint5", NULL}, 4, 5}, - {"PG6", 6, 6, {"gpio_in", "gpio_out", "uart1", NULL, "pg_eint6", NULL}, 4, 6}, - {"PG7", 6, 7, {"gpio_in", "gpio_out", "uart1", NULL, "pg_eint7", NULL}, 4, 7}, - {"PG8", 6, 8, {"gpio_in", "gpio_out", "uart1", NULL, "pg_eint8", NULL}, 4, 8}, - {"PG9", 6, 9, {"gpio_in", "gpio_out", "uart1", NULL, "pg_eint9", NULL}, 4, 9}, - {"PG10", 6, 10, {"gpio_in", "gpio_out", "i2s1", "aif3", "pg_eint10", NULL}, 4, 10}, - {"PG11", 6, 11, {"gpio_in", "gpio_out", "i2s1", "aif3", "pg_eint11", NULL}, 4, 11}, - {"PG12", 6, 12, {"gpio_in", "gpio_out", "i2s1", "aif3", "pg_eint12", NULL}, 4, 12}, - {"PG13", 6, 13, {"gpio_in", "gpio_out", "i2s1", "aif3", "pg_eint13", NULL}, 4, 13}, + {"PG0", 6, 0, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint0", NULL}, 4, 0, 6}, + {"PG1", 6, 1, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint1", NULL}, 4, 1, 6}, + {"PG2", 6, 2, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint2", NULL}, 4, 2, 6}, + {"PG3", 6, 3, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint3", NULL}, 4, 3, 6}, + {"PG4", 6, 4, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint4", NULL}, 4, 4, 6}, + {"PG5", 6, 5, {"gpio_in", "gpio_out", "mmc1", NULL, "pg_eint5", NULL}, 4, 5, 6}, + {"PG6", 6, 6, {"gpio_in", "gpio_out", "uart1", NULL, "pg_eint6", NULL}, 4, 6, 6}, + {"PG7", 6, 7, {"gpio_in", "gpio_out", "uart1", NULL, "pg_eint7", NULL}, 4, 7, 6}, + {"PG8", 6, 8, {"gpio_in", "gpio_out", "uart1", NULL, "pg_eint8", NULL}, 4, 8, 6}, + {"PG9", 6, 9, {"gpio_in", "gpio_out", "uart1", NULL, "pg_eint9", NULL}, 4, 9, 6}, + {"PG10", 6, 10, {"gpio_in", "gpio_out", "i2s1", "aif3", "pg_eint10", NULL}, 4, 10, 6}, + {"PG11", 6, 11, {"gpio_in", "gpio_out", "i2s1", "aif3", "pg_eint11", NULL}, 4, 11, 6}, + {"PG12", 6, 12, {"gpio_in", "gpio_out", "i2s1", "aif3", "pg_eint12", NULL}, 4, 12, 6}, + {"PG13", 6, 13, {"gpio_in", "gpio_out", "i2s1", "aif3", "pg_eint13", NULL}, 4, 13, 6}, {"PH0", 7, 0, {"gpio_in", "gpio_out", "pwm0", NULL, NULL, NULL, NULL, NULL}}, {"PH1", 7, 1, {"gpio_in", "gpio_out", "pwm1", NULL, NULL, NULL, NULL, NULL}}, Modified: head/sys/arm/allwinner/a64/a64_padconf.c ============================================================================== --- head/sys/arm/allwinner/a64/a64_padconf.c Sun Jan 19 18:36:03 2020 (r356887) +++ head/sys/arm/allwinner/a64/a64_padconf.c Sun Jan 19 19:14:49 2020 (r356888) @@ -40,16 +40,16 @@ __FBSDID("$FreeBSD$"); #ifdef SOC_ALLWINNER_A64 static const struct allwinner_pins a64_pins[] = { - { "PB0", 1, 0, { "gpio_in", "gpio_out", "uart2", NULL, "jtag", NULL, "pb_eint0" }, 6, 0}, - { "PB1", 1, 1, { "gpio_in", "gpio_out", "uart2", NULL, "jtag", "sim", "pb_eint1" }, 6, 1}, - { "PB2", 1, 2, { "gpio_in", "gpio_out", "uart2", NULL, "jtag", "sim", "pb_eint2" }, 6, 2}, - { "PB3", 1, 3, { "gpio_in", "gpio_out", "uart2", "i2s0", "jtag", "sim", "pb_eint3" }, 6, 3}, - { "PB4", 1, 4, { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint4" }, 6, 4}, - { "PB5", 1, 5, { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint5" }, 6, 5}, - { "PB6", 1, 6, { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint6" }, 6, 6}, - { "PB7", 1, 7, { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint7" }, 6, 7}, - { "PB8", 1, 8, { "gpio_in", "gpio_out", NULL, NULL, "uart0", NULL, "pb_eint8" }, 6, 8}, - { "PB9", 1, 9, { "gpio_in", "gpio_out", NULL, NULL, "uart0", NULL, "pb_eint9" }, 6, 9}, + { "PB0", 1, 0, { "gpio_in", "gpio_out", "uart2", NULL, "jtag", NULL, "pb_eint0" }, 6, 0, 0}, + { "PB1", 1, 1, { "gpio_in", "gpio_out", "uart2", NULL, "jtag", "sim", "pb_eint1" }, 6, 1, 0}, + { "PB2", 1, 2, { "gpio_in", "gpio_out", "uart2", NULL, "jtag", "sim", "pb_eint2" }, 6, 2, 0}, + { "PB3", 1, 3, { "gpio_in", "gpio_out", "uart2", "i2s0", "jtag", "sim", "pb_eint3" }, 6, 3, 0}, + { "PB4", 1, 4, { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint4" }, 6, 4, 0}, + { "PB5", 1, 5, { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint5" }, 6, 5, 0}, + { "PB6", 1, 6, { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint6" }, 6, 6, 0}, + { "PB7", 1, 7, { "gpio_in", "gpio_out", "aif2", "pcm0", NULL, "sim", "pb_eint7" }, 6, 7, 0}, + { "PB8", 1, 8, { "gpio_in", "gpio_out", NULL, NULL, "uart0", NULL, "pb_eint8" }, 6, 8, 0}, + { "PB9", 1, 9, { "gpio_in", "gpio_out", NULL, NULL, "uart0", NULL, "pb_eint9" }, 6, 9, 0}, { "PC0", 2, 0, { "gpio_in", "gpio_out", "nand", NULL, "spi0" } }, { "PC1", 2, 1, { "gpio_in", "gpio_out", "nand", "mmc2", "spi0" } }, @@ -122,33 +122,33 @@ static const struct allwinner_pins a64_pins[] = { { "PF5", 5, 5, { "gpio_in", "gpio_out", "mmc0", "jtag" } }, { "PF6", 5, 6, { "gpio_in", "gpio_out" } }, - { "PG0", 6, 0, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0" }, 6, 0}, - { "PG1", 6, 1, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1" }, 6, 1}, - { "PG2", 6, 2, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2" }, 6, 2}, - { "PG3", 6, 3, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3" }, 6, 3}, - { "PG4", 6, 4, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4" }, 6, 4}, - { "PG5", 6, 5, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5" }, 6, 5}, - { "PG6", 6, 6, { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint6" }, 6, 6}, - { "PG7", 6, 7, { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint7" }, 6, 7}, - { "PG8", 6, 8, { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint8" }, 6, 8}, - { "PG9", 6, 9, { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint9" }, 6, 9}, - { "PG10", 6, 10, { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint10" }, 6, 10}, - { "PG11", 6, 11, { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint11" }, 6, 11}, - { "PG12", 6, 12, { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint12" }, 6, 12}, - { "PG13", 6, 13, { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint13" }, 6, 13}, + { "PG0", 6, 0, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0" }, 6, 0, 1}, + { "PG1", 6, 1, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1" }, 6, 1, 1}, + { "PG2", 6, 2, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2" }, 6, 2, 1}, + { "PG3", 6, 3, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3" }, 6, 3, 1}, + { "PG4", 6, 4, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4" }, 6, 4, 1}, + { "PG5", 6, 5, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5" }, 6, 5, 1}, + { "PG6", 6, 6, { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint6" }, 6, 6, 1}, + { "PG7", 6, 7, { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint7" }, 6, 7, 1}, + { "PG8", 6, 8, { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint8" }, 6, 8, 1}, + { "PG9", 6, 9, { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint9" }, 6, 9, 1}, + { "PG10", 6, 10, { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint10" }, 6, 10, 1}, + { "PG11", 6, 11, { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint11" }, 6, 11, 1}, + { "PG12", 6, 12, { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint12" }, 6, 12, 1}, + { "PG13", 6, 13, { "gpio_in", "gpio_out", "aif3", "pcm1", NULL, NULL, "pg_eint13" }, 6, 13, 1}, - { "PH0", 7, 0, { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "ph_eint0" }, 6, 0}, - { "PH1", 7, 1, { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "ph_eint1" }, 6, 1}, - { "PH2", 7, 2, { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "ph_eint2" }, 6, 2}, - { "PH3", 7, 3, { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "ph_eint3" }, 6, 3}, - { "PH4", 7, 4, { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint4" }, 6, 4}, - { "PH5", 7, 5, { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint5" }, 6, 5}, - { "PH6", 7, 6, { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint6" }, 6, 6}, - { "PH7", 7, 7, { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint7" }, 6, 7}, - { "PH8", 7, 8, { "gpio_in", "gpio_out", "owa", NULL, NULL, NULL, "ph_eint8" }, 6, 8}, - { "PH9", 7, 9, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "ph_eint9" }, 6, 9}, - { "PH10", 7, 10, { "gpio_in", "gpio_out", "mic", NULL, NULL, NULL, "ph_eint10" }, 6, 10}, - { "PH11", 7, 11, { "gpio_in", "gpio_out", "mic", NULL, NULL, NULL, "ph_eint11" }, 6, 11}, + { "PH0", 7, 0, { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "ph_eint0" }, 6, 0, 2}, + { "PH1", 7, 1, { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "ph_eint1" }, 6, 1, 2}, + { "PH2", 7, 2, { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "ph_eint2" }, 6, 2, 2}, + { "PH3", 7, 3, { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "ph_eint3" }, 6, 3, 2}, + { "PH4", 7, 4, { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint4" }, 6, 4, 2}, + { "PH5", 7, 5, { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint5" }, 6, 5, 2}, + { "PH6", 7, 6, { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint6" }, 6, 6, 2}, + { "PH7", 7, 7, { "gpio_in", "gpio_out", "uart3", NULL, NULL, NULL, "ph_eint7" }, 6, 7, 2}, + { "PH8", 7, 8, { "gpio_in", "gpio_out", "owa", NULL, NULL, NULL, "ph_eint8" }, 6, 8, 2}, + { "PH9", 7, 9, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "ph_eint9" }, 6, 9, 2}, + { "PH10", 7, 10, { "gpio_in", "gpio_out", "mic", NULL, NULL, NULL, "ph_eint10" }, 6, 10, 2}, + { "PH11", 7, 11, { "gpio_in", "gpio_out", "mic", NULL, NULL, NULL, "ph_eint11" }, 6, 11, 2}, }; const struct allwinner_padconf a64_padconf = { Modified: head/sys/arm/allwinner/a64/a64_r_padconf.c ============================================================================== --- head/sys/arm/allwinner/a64/a64_r_padconf.c Sun Jan 19 18:36:03 2020 (r356887) +++ head/sys/arm/allwinner/a64/a64_r_padconf.c Sun Jan 19 19:14:49 2020 (r356888) @@ -40,19 +40,19 @@ __FBSDID("$FreeBSD$"); #ifdef SOC_ALLWINNER_A64 static const struct allwinner_pins a64_r_pins[] = { - { "PL0", 0, 0, { "gpio_in", "gpio_out", "s_rsb", "s_i2c", NULL, NULL, "pl_eint0" }, 6, 0}, - { "PL1", 0, 1, { "gpio_in", "gpio_out", "s_rsb", "s_i2c", NULL, NULL, "pl_eint1" }, 6, 1}, - { "PL2", 0, 2, { "gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "pl_eint2" }, 6, 2}, - { "PL3", 0, 3, { "gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "pl_eint3" }, 6, 3}, - { "PL4", 0, 4, { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint4" }, 6, 4}, - { "PL5", 0, 5, { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint5" }, 6, 5}, - { "PL6", 0, 6, { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint6" }, 6, 6}, - { "PL7", 0, 7, { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint7" }, 6, 7}, - { "PL8", 0, 8, { "gpio_in", "gpio_out", "s_i2c", NULL, NULL, NULL, "pl_eint8" }, 6, 8}, - { "PL9", 0, 9, { "gpio_in", "gpio_out", "s_i2c", NULL, NULL, NULL, "pl_eint9" }, 6, 9}, - { "PL10", 0, 10, { "gpio_in", "gpio_out", "s_pwm", NULL, NULL, NULL, "pl_eint10" }, 6, 10}, - { "PL11", 0, 11, { "gpio_in", "gpio_out", "s_cir", NULL, NULL, NULL, "pl_eint11" }, 6, 11}, - { "PL12", 0, 12, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "pl_eint12" }, 6, 12}, + { "PL0", 0, 0, { "gpio_in", "gpio_out", "s_rsb", "s_i2c", NULL, NULL, "pl_eint0" }, 6, 0, 0}, + { "PL1", 0, 1, { "gpio_in", "gpio_out", "s_rsb", "s_i2c", NULL, NULL, "pl_eint1" }, 6, 1, 0}, + { "PL2", 0, 2, { "gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "pl_eint2" }, 6, 2, 0}, + { "PL3", 0, 3, { "gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "pl_eint3" }, 6, 3, 0}, + { "PL4", 0, 4, { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint4" }, 6, 4, 0}, + { "PL5", 0, 5, { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint5" }, 6, 5, 0}, + { "PL6", 0, 6, { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint6" }, 6, 6, 0}, + { "PL7", 0, 7, { "gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint7" }, 6, 7, 0}, + { "PL8", 0, 8, { "gpio_in", "gpio_out", "s_i2c", NULL, NULL, NULL, "pl_eint8" }, 6, 8, 0}, + { "PL9", 0, 9, { "gpio_in", "gpio_out", "s_i2c", NULL, NULL, NULL, "pl_eint9" }, 6, 9, 0}, + { "PL10", 0, 10, { "gpio_in", "gpio_out", "s_pwm", NULL, NULL, NULL, "pl_eint10" }, 6, 10, 0}, + { "PL11", 0, 11, { "gpio_in", "gpio_out", "s_cir", NULL, NULL, NULL, "pl_eint11" }, 6, 11, 0}, + { "PL12", 0, 12, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "pl_eint12" }, 6, 12, 0}, }; const struct allwinner_padconf a64_r_padconf = { Modified: head/sys/arm/allwinner/a83t/a83t_padconf.c ============================================================================== --- head/sys/arm/allwinner/a83t/a83t_padconf.c Sun Jan 19 18:36:03 2020 (r356887) +++ head/sys/arm/allwinner/a83t/a83t_padconf.c Sun Jan 19 19:14:49 2020 (r356888) @@ -38,17 +38,17 @@ __FBSDID("$FreeBSD$"); #ifdef SOC_ALLWINNER_A83T static const struct allwinner_pins a83t_pins[] = { - { "PB0", 1, 0, { "gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "eint" } }, - { "PB1", 1, 1, { "gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "eint" } }, - { "PB2", 1, 2, { "gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "eint" } }, - { "PB3", 1, 3, { "gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "eint" } }, - { "PB4", 1, 4, { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "eint" } }, - { "PB5", 1, 5, { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "eint" } }, - { "PB6", 1, 6, { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "eint" } }, - { "PB7", 1, 7, { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "eint" } }, - { "PB8", 1, 8, { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "eint" } }, - { "PB9", 1, 9, { "gpio_in", "gpio_out", "uart0", NULL, NULL, NULL, "eint" } }, - { "PB10", 1, 10, { "gpio_in", "gpio_out", "uart0", NULL, NULL, NULL, "eint" } }, + { "PB0", 1, 0, { "gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "pb_eint0" }, 6, 0, 0}, + { "PB1", 1, 1, { "gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "pb_eint1" }, 6, 1, 0}, + { "PB2", 1, 2, { "gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "pb_eint2" }, 6, 2, 0}, + { "PB3", 1, 3, { "gpio_in", "gpio_out", "uart2", "jtag", NULL, NULL, "pb_eint3" }, 6, 3, 0}, + { "PB4", 1, 4, { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "pb_eint4" }, 6, 4, 0}, + { "PB5", 1, 5, { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "pb_eint5" }, 6, 5, 0}, + { "PB6", 1, 6, { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "pb_eint6" }, 6, 6, 0}, + { "PB7", 1, 7, { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "pb_eint7" }, 6, 7, 0}, + { "PB8", 1, 8, { "gpio_in", "gpio_out", "i2s0", "tdm", NULL, NULL, "pb_eint8" }, 6, 8, 0}, + { "PB9", 1, 9, { "gpio_in", "gpio_out", "uart0", NULL, NULL, NULL, "pb_eint9" }, 6, 9, 0}, + { "PB10", 1, 10, { "gpio_in", "gpio_out", "uart0", NULL, NULL, NULL, "pb_eint10" }, 6, 10, 0}, { "PC0", 2, 0, { "gpio_in", "gpio_out", "nand", "spi0" } }, { "PC1", 2, 1, { "gpio_in", "gpio_out", "nand", "spi0" } }, @@ -124,33 +124,33 @@ static const struct allwinner_pins a83t_pins[] = { { "PF5", 5, 5, { "gpio_in", "gpio_out", "mmc0", "jtag" } }, { "PF6", 5, 6, { "gpio_in", "gpio_out" } }, - { "PG0", 6, 0, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } }, - { "PG1", 6, 1, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } }, - { "PG2", 6, 2, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } }, - { "PG3", 6, 3, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } }, - { "PG4", 6, 4, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } }, - { "PG5", 6, 5, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "eint" } }, - { "PG6", 6, 6, { "gpio_in", "gpio_out", "uart1", "spi1", NULL, NULL, "eint" } }, - { "PG7", 6, 7, { "gpio_in", "gpio_out", "uart1", "spi1", NULL, NULL, "eint" } }, - { "PG8", 6, 8, { "gpio_in", "gpio_out", "uart1", "spi1", NULL, NULL, "eint" } }, - { "PG9", 6, 9, { "gpio_in", "gpio_out", "uart1", "spi1", NULL, NULL, "eint" } }, - { "PG10", 6, 10, { "gpio_in", "gpio_out", "i2s1", "uart3", NULL, NULL, "eint" } }, - { "PG11", 6, 11, { "gpio_in", "gpio_out", "i2s1", "uart3", NULL, NULL, "eint" } }, - { "PG12", 6, 12, { "gpio_in", "gpio_out", "i2s1", "uart3", NULL, NULL, "eint" } }, - { "PG13", 6, 13, { "gpio_in", "gpio_out", "i2s1", "uart3", NULL, NULL, "eint" } }, + { "PG0", 6, 0, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0" }, 6, 0, 1}, + { "PG1", 6, 1, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1" }, 6, 1, 1}, + { "PG2", 6, 2, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2" }, 6, 2, 1}, + { "PG3", 6, 3, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3" }, 6, 3, 1}, + { "PG4", 6, 4, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4" }, 6, 4, 1}, + { "PG5", 6, 5, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5" }, 6, 5, 1}, + { "PG6", 6, 6, { "gpio_in", "gpio_out", "uart1", "spi1", NULL, NULL, "pg_eint6" }, 6, 6, 1}, + { "PG7", 6, 7, { "gpio_in", "gpio_out", "uart1", "spi1", NULL, NULL, "pg_eint7" }, 6, 7, 1}, + { "PG8", 6, 8, { "gpio_in", "gpio_out", "uart1", "spi1", NULL, NULL, "pg_eint8" }, 6, 8, 1}, + { "PG9", 6, 9, { "gpio_in", "gpio_out", "uart1", "spi1", NULL, NULL, "pg_eint9" }, 6, 9, 1}, + { "PG10", 6, 10, { "gpio_in", "gpio_out", "i2s1", "uart3", NULL, NULL, "pg_eint10" }, 6, 10, 1}, + { "PG11", 6, 11, { "gpio_in", "gpio_out", "i2s1", "uart3", NULL, NULL, "pg_eint11" }, 6, 11, 1}, + { "PG12", 6, 12, { "gpio_in", "gpio_out", "i2s1", "uart3", NULL, NULL, "pg_eint12" }, 6, 12, 1}, + { "PG13", 6, 13, { "gpio_in", "gpio_out", "i2s1", "uart3", NULL, NULL, "pg_eint13" }, 6, 13, 1}, - { "PH0", 7, 0, { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "eint" } }, - { "PH1", 7, 1, { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "eint" } }, - { "PH2", 7, 2, { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "eint" } }, - { "PH3", 7, 3, { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "eint" } }, - { "PH4", 7, 4, { "gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, "eint" } }, - { "PH5", 7, 5, { "gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, "eint" } }, - { "PH6", 7, 6, { "gpio_in", "gpio_out", "hdmiddc", NULL, NULL, NULL, "eint" } }, - { "PH7", 7, 7, { "gpio_in", "gpio_out", "hdmiddc", NULL, NULL, NULL, "eint" } }, - { "PH8", 7, 8, { "gpio_in", "gpio_out", "hdmiddc", NULL, NULL, NULL, "eint" } }, - { "PH9", 7, 9, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "eint" } }, - { "PH10", 7, 10, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "eint" } }, - { "PH11", 7, 11, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "eint" } }, + { "PH0", 7, 0, { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "ph_eint0" }, 6, 0, 2}, + { "PH1", 7, 1, { "gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, "ph_eint1" }, 6, 1, 2}, + { "PH2", 7, 2, { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "ph_eint2" }, 6, 2, 2}, + { "PH3", 7, 3, { "gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, "ph_eint3" }, 6, 3, 2}, + { "PH4", 7, 4, { "gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, "ph_eint4" }, 6, 4, 2}, + { "PH5", 7, 5, { "gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, "ph_eint5" }, 6, 5, 2}, + { "PH6", 7, 6, { "gpio_in", "gpio_out", "hdmiddc", NULL, NULL, NULL, "ph_eint6" }, 6, 6, 2}, + { "PH7", 7, 7, { "gpio_in", "gpio_out", "hdmiddc", NULL, NULL, NULL, "ph_eint7" }, 6, 7, 2}, + { "PH8", 7, 8, { "gpio_in", "gpio_out", "hdmiddc", NULL, NULL, NULL, "ph_eint8" }, 6, 8, 2}, + { "PH9", 7, 9, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "ph_eint9" }, 6, 9, 2}, + { "PH10", 7, 10, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "ph_eint10" }, 6, 10, 2}, + { "PH11", 7, 11, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "ph_eint11" }, 6, 11, 2}, }; const struct allwinner_padconf a83t_padconf = { Modified: head/sys/arm/allwinner/allwinner_pinctrl.h ============================================================================== --- head/sys/arm/allwinner/allwinner_pinctrl.h Sun Jan 19 18:36:03 2020 (r356887) +++ head/sys/arm/allwinner/allwinner_pinctrl.h Sun Jan 19 19:14:49 2020 (r356888) @@ -37,6 +37,7 @@ struct allwinner_pins { const char *functions[8]; uint8_t eint_func; uint8_t eint_num; + uint8_t eint_bank; }; struct allwinner_padconf { Modified: head/sys/arm/allwinner/h3/h3_padconf.c ============================================================================== --- head/sys/arm/allwinner/h3/h3_padconf.c Sun Jan 19 18:36:03 2020 (r356887) +++ head/sys/arm/allwinner/h3/h3_padconf.c Sun Jan 19 19:14:49 2020 (r356888) @@ -126,20 +126,20 @@ const static struct allwinner_pins h3_pins[] = { {"PF5", 5, 5, {"gpio_in", "gpio_out", "mmc0", "jtag", NULL, NULL, NULL, NULL}}, {"PF6", 5, 6, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, - {"PG0", 6, 0, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0", NULL}, 6, 0}, - {"PG1", 6, 1, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1", NULL}, 6, 1}, - {"PG2", 6, 2, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2", NULL}, 6, 2}, - {"PG3", 6, 3, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3", NULL}, 6, 3}, - {"PG4", 6, 4, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4", NULL}, 6, 4}, - {"PG5", 6, 5, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5", NULL}, 6, 5}, - {"PG6", 6, 6, {"gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint6", NULL}, 6, 6}, - {"PG7", 6, 7, {"gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint7", NULL}, 6, 7}, - {"PG8", 6, 8, {"gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint8", NULL}, 6, 8}, - {"PG9", 6, 9, {"gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint9", NULL}, 6, 9}, - {"PG10", 6, 10, {"gpio_in", "gpio_out", "i2s1", NULL, NULL, NULL, "pg_eint10", NULL}, 6, 10}, - {"PG11", 6, 11, {"gpio_in", "gpio_out", "i2s1", NULL, NULL, NULL, "pg_eint11", NULL}, 6, 11}, - {"PG12", 6, 12, {"gpio_in", "gpio_out", "i2s1", NULL, NULL, NULL, "pg_eint12", NULL}, 6, 12}, - {"PG13", 6, 13, {"gpio_in", "gpio_out", "i2s1", NULL, NULL, NULL, "pg_eint13", NULL}, 6, 13}, + {"PG0", 6, 0, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0", NULL}, 6, 0, 1}, + {"PG1", 6, 1, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1", NULL}, 6, 1, 1}, + {"PG2", 6, 2, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2", NULL}, 6, 2, 1}, + {"PG3", 6, 3, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3", NULL}, 6, 3, 1}, + {"PG4", 6, 4, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4", NULL}, 6, 4, 1}, + {"PG5", 6, 5, {"gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5", NULL}, 6, 5, 1}, + {"PG6", 6, 6, {"gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint6", NULL}, 6, 6, 1}, + {"PG7", 6, 7, {"gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint7", NULL}, 6, 7, 1}, + {"PG8", 6, 8, {"gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint8", NULL}, 6, 8, 1}, + {"PG9", 6, 9, {"gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint9", NULL}, 6, 9, 1}, + {"PG10", 6, 10, {"gpio_in", "gpio_out", "i2s1", NULL, NULL, NULL, "pg_eint10", NULL}, 6, 10, 1}, + {"PG11", 6, 11, {"gpio_in", "gpio_out", "i2s1", NULL, NULL, NULL, "pg_eint11", NULL}, 6, 11, 1}, + {"PG12", 6, 12, {"gpio_in", "gpio_out", "i2s1", NULL, NULL, NULL, "pg_eint12", NULL}, 6, 12, 1}, + {"PG13", 6, 13, {"gpio_in", "gpio_out", "i2s1", NULL, NULL, NULL, "pg_eint13", NULL}, 6, 13, 1}, }; const struct allwinner_padconf h3_padconf = { Modified: head/sys/arm/allwinner/h3/h3_r_padconf.c ============================================================================== --- head/sys/arm/allwinner/h3/h3_r_padconf.c Sun Jan 19 18:36:03 2020 (r356887) +++ head/sys/arm/allwinner/h3/h3_r_padconf.c Sun Jan 19 19:14:49 2020 (r356888) @@ -41,18 +41,18 @@ __FBSDID("$FreeBSD$"); #if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5) const static struct allwinner_pins h3_r_pins[] = { - {"PL0", 0, 0, {"gpio_in", "gpio_out", "s_twi", NULL, NULL, NULL, "pl_eint0", NULL}, 6, 0}, - {"PL1", 0, 1, {"gpio_in", "gpio_out", "s_twi", NULL, NULL, NULL, "pl_eint1", NULL}, 6, 1}, - {"PL2", 0, 2, {"gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "pl_eint2", NULL}, 6, 2}, - {"PL3", 0, 3, {"gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "pl_eint3", NULL}, 6, 3}, - {"PL4", 0, 4, {"gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint4", NULL}, 6, 4}, - {"PL5", 0, 5, {"gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint5", NULL}, 6, 5}, - {"PL6", 0, 6, {"gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint6", NULL}, 6, 6}, - {"PL7", 0, 7, {"gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint7", NULL}, 6, 7}, - {"PL8", 0, 8, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "pl_eint8", NULL}, 6, 8}, - {"PL9", 0, 9, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "pl_eint9", NULL}, 6, 9}, - {"PL10", 0, 10, {"gpio_in", "gpio_out", "s_pwm", NULL, NULL, NULL, "pl_eint10", NULL}, 6, 10}, - {"PL11", 0, 11, {"gpio_in", "gpio_out", "s_cir_rx", NULL, NULL, NULL, "pl_eint11", NULL}, 6, 11}, + {"PL0", 0, 0, {"gpio_in", "gpio_out", "s_twi", NULL, NULL, NULL, "pl_eint0", NULL}, 6, 0, 0}, + {"PL1", 0, 1, {"gpio_in", "gpio_out", "s_twi", NULL, NULL, NULL, "pl_eint1", NULL}, 6, 1, 0}, + {"PL2", 0, 2, {"gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "pl_eint2", NULL}, 6, 2, 0}, + {"PL3", 0, 3, {"gpio_in", "gpio_out", "s_uart", NULL, NULL, NULL, "pl_eint3", NULL}, 6, 3, 0}, + {"PL4", 0, 4, {"gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint4", NULL}, 6, 4, 0}, + {"PL5", 0, 5, {"gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint5", NULL}, 6, 5, 0}, + {"PL6", 0, 6, {"gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint6", NULL}, 6, 6, 0}, + {"PL7", 0, 7, {"gpio_in", "gpio_out", "s_jtag", NULL, NULL, NULL, "pl_eint7", NULL}, 6, 7, 0}, + {"PL8", 0, 8, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "pl_eint8", NULL}, 6, 8, 0}, + {"PL9", 0, 9, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "pl_eint9", NULL}, 6, 9, 0}, + {"PL10", 0, 10, {"gpio_in", "gpio_out", "s_pwm", NULL, NULL, NULL, "pl_eint10", NULL}, 6, 10, 0}, + {"PL11", 0, 11, {"gpio_in", "gpio_out", "s_cir_rx", NULL, NULL, NULL, "pl_eint11", NULL}, 6, 11, 0}, }; const struct allwinner_padconf h3_r_padconf = { Modified: head/sys/arm/allwinner/h6/h6_padconf.c ============================================================================== --- head/sys/arm/allwinner/h6/h6_padconf.c Sun Jan 19 18:36:03 2020 (r356887) +++ head/sys/arm/allwinner/h6/h6_padconf.c Sun Jan 19 19:14:49 2020 (r356888) @@ -83,41 +83,41 @@ static const struct allwinner_pins h6_pins[] = { { "PD25", 3, 25, { "gpio_in", "gpio_out", "i2c0", "ts3", "uart3", "jtag" } }, { "PD26", 3, 26, { "gpio_in", "gpio_out", "i2c0", "ts3", "uart3", "jtag" } }, - { "PF0", 5, 0, { "gpio_in", "gpio_out", "mmc0", "jtag", NULL, NULL, "pf_eint0" } }, - { "PF1", 5, 1, { "gpio_in", "gpio_out", "mmc0", "jtag", NULL, NULL, "pf_eint1" } }, - { "PF2", 5, 2, { "gpio_in", "gpio_out", "mmc0", "uart0", NULL, NULL, "pf_eint2" } }, - { "PF3", 5, 3, { "gpio_in", "gpio_out", "mmc0", "jtag", NULL, NULL, "pf_eint3" } }, - { "PF4", 5, 4, { "gpio_in", "gpio_out", "mmc0", "uart0", NULL, NULL, "pf_eint4" } }, - { "PF5", 5, 5, { "gpio_in", "gpio_out", "mmc0", "jtag", NULL, NULL, "pf_eint5" } }, - { "PF6", 5, 6, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "pf_eint6" } }, + { "PF0", 5, 0, { "gpio_in", "gpio_out", "mmc0", "jtag", NULL, NULL, "pf_eint0" }, 6, 0, 5 }, + { "PF1", 5, 1, { "gpio_in", "gpio_out", "mmc0", "jtag", NULL, NULL, "pf_eint1" }, 6, 1, 5 }, + { "PF2", 5, 2, { "gpio_in", "gpio_out", "mmc0", "uart0", NULL, NULL, "pf_eint2" }, 6, 2, 5 }, + { "PF3", 5, 3, { "gpio_in", "gpio_out", "mmc0", "jtag", NULL, NULL, "pf_eint3" }, 6, 3, 5 }, + { "PF4", 5, 4, { "gpio_in", "gpio_out", "mmc0", "uart0", NULL, NULL, "pf_eint4" }, 6, 4, 5 }, + { "PF5", 5, 5, { "gpio_in", "gpio_out", "mmc0", "jtag", NULL, NULL, "pf_eint5" }, 6, 5, 5 }, + { "PF6", 5, 6, { "gpio_in", "gpio_out", NULL, NULL, NULL, NULL, "pf_eint6" }, 6, 6, 5 }, - { "PG0", 6, 0, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0" }, 6, 0 }, - { "PG1", 6, 1, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1" }, 6, 1 }, - { "PG2", 6, 2, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2" }, 6, 2 }, - { "PG3", 6, 3, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3" }, 6, 3 }, - { "PG4", 6, 4, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4" }, 6, 4 }, - { "PG5", 6, 5, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5" }, 6, 5 }, - { "PG6", 6, 6, { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint6" }, 6, 6 }, - { "PG7", 6, 7, { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint7" }, 6, 7 }, - { "PG8", 6, 8, { "gpio_in", "gpio_out", "uart1", NULL, "sim0", NULL, "pg_eint8" }, 6, 8 }, - { "PG9", 6, 9, { "gpio_in", "gpio_out", "uart1", NULL, "sim0", NULL, "pg_eint9" }, 6, 9 }, - { "PG10", 6, 10, { "gpio_in", "gpio_out", "i2s2", "h_i2s2", "sim0", NULL, "pg_eint10" }, 6, 10 }, - { "PG11", 6, 11, { "gpio_in", "gpio_out", "i2s2", "h_i2s2", "sim0", NULL, "pg_eint11" }, 6, 11 }, - { "PG12", 6, 12, { "gpio_in", "gpio_out", "i2s2", "h_i2s2", "sim0", NULL, "pg_eint12" }, 6, 12 }, - { "PG13", 6, 13, { "gpio_in", "gpio_out", "i2s2", "h_i2s2", "sim0", NULL, "pg_eint13" }, 6, 13 }, - { "PG14", 6, 14, { "gpio_in", "gpio_out", "i2s2", "h_i2s2", "sim0", NULL, "pg_eint14" }, 6, 13 }, + { "PG0", 6, 0, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint0" }, 6, 0, 6}, + { "PG1", 6, 1, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint1" }, 6, 1, 6}, + { "PG2", 6, 2, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint2" }, 6, 2, 6}, + { "PG3", 6, 3, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint3" }, 6, 3, 6}, + { "PG4", 6, 4, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint4" }, 6, 4, 6}, + { "PG5", 6, 5, { "gpio_in", "gpio_out", "mmc1", NULL, NULL, NULL, "pg_eint5" }, 6, 5, 6}, + { "PG6", 6, 6, { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint6" }, 6, 6, 6}, + { "PG7", 6, 7, { "gpio_in", "gpio_out", "uart1", NULL, NULL, NULL, "pg_eint7" }, 6, 7, 6}, + { "PG8", 6, 8, { "gpio_in", "gpio_out", "uart1", NULL, "sim0", NULL, "pg_eint8" }, 6, 8, 6}, + { "PG9", 6, 9, { "gpio_in", "gpio_out", "uart1", NULL, "sim0", NULL, "pg_eint9" }, 6, 9, 6}, + { "PG10", 6, 10, { "gpio_in", "gpio_out", "i2s2", "h_i2s2", "sim0", NULL, "pg_eint10" }, 6, 10, 6}, + { "PG11", 6, 11, { "gpio_in", "gpio_out", "i2s2", "h_i2s2", "sim0", NULL, "pg_eint11" }, 6, 11, 6}, + { "PG12", 6, 12, { "gpio_in", "gpio_out", "i2s2", "h_i2s2", "sim0", NULL, "pg_eint12" }, 6, 12, 6}, + { "PG13", 6, 13, { "gpio_in", "gpio_out", "i2s2", "h_i2s2", "sim0", NULL, "pg_eint13" }, 6, 13, 6}, + { "PG14", 6, 14, { "gpio_in", "gpio_out", "i2s2", "h_i2s2", "sim0", NULL, "pg_eint14" }, 6, 13, 6}, - { "PH0", 7, 0, { "gpio_in", "gpio_out", "uart0", "i2s0", "h_i2s0", "sim1", "ph_eint0" }, 6, 0 }, - { "PH1", 7, 1, { "gpio_in", "gpio_out", "uart0", "i2s0", "h_i2s0", "sim1", "ph_eint1" }, 6, 1 }, - { "PH2", 7, 2, { "gpio_in", "gpio_out", "cir", "i2s0", "h_i2s0", "sim1", "ph_eint2" }, 6, 2 }, - { "PH3", 7, 3, { "gpio_in", "gpio_out", "spi1", "i2s0", "h_i2s0", "sim1", "ph_eint3" }, 6, 3 }, - { "PH4", 7, 4, { "gpio_in", "gpio_out", "spi1", "i2s0", "h_i2s0", "sim1", "ph_eint4" }, 6, 4 }, - { "PH5", 7, 5, { "gpio_in", "gpio_out", "spi1", "spdif", "i2c1", "sim1", "ph_eint5" }, 6, 5 }, - { "PH6", 7, 6, { "gpio_in", "gpio_out", "spi1", "spdif", "i2c1", "sim1", "ph_eint6" }, 6, 6 }, - { "PH7", 7, 7, { "gpio_in", "gpio_out", NULL, "spdif", NULL, NULL, "ph_eint7" }, 6, 7 }, - { "PH8", 7, 8, { "gpio_in", "gpio_out", "hdmi", NULL, NULL, NULL, "ph_eint8" }, 6, 8 }, - { "PH9", 7, 9, { "gpio_in", "gpio_out", "hdmi", NULL, NULL, NULL, "ph_eint9" }, 6, 9 }, - { "PH10", 7, 10, { "gpio_in", "gpio_out", "hdmi", NULL, NULL, NULL, "ph_eint10" }, 6, 10 }, + { "PH0", 7, 0, { "gpio_in", "gpio_out", "uart0", "i2s0", "h_i2s0", "sim1", "ph_eint0" }, 6, 0, 7}, + { "PH1", 7, 1, { "gpio_in", "gpio_out", "uart0", "i2s0", "h_i2s0", "sim1", "ph_eint1" }, 6, 1, 7}, + { "PH2", 7, 2, { "gpio_in", "gpio_out", "cir", "i2s0", "h_i2s0", "sim1", "ph_eint2" }, 6, 2, 7}, + { "PH3", 7, 3, { "gpio_in", "gpio_out", "spi1", "i2s0", "h_i2s0", "sim1", "ph_eint3" }, 6, 3, 7}, + { "PH4", 7, 4, { "gpio_in", "gpio_out", "spi1", "i2s0", "h_i2s0", "sim1", "ph_eint4" }, 6, 4, 7}, + { "PH5", 7, 5, { "gpio_in", "gpio_out", "spi1", "spdif", "i2c1", "sim1", "ph_eint5" }, 6, 5, 7}, + { "PH6", 7, 6, { "gpio_in", "gpio_out", "spi1", "spdif", "i2c1", "sim1", "ph_eint6" }, 6, 6, 7}, + { "PH7", 7, 7, { "gpio_in", "gpio_out", NULL, "spdif", NULL, NULL, "ph_eint7" }, 6, 7, 7}, + { "PH8", 7, 8, { "gpio_in", "gpio_out", "hdmi", NULL, NULL, NULL, "ph_eint8" }, 6, 8, 7}, + { "PH9", 7, 9, { "gpio_in", "gpio_out", "hdmi", NULL, NULL, NULL, "ph_eint9" }, 6, 9, 7}, + { "PH10", 7, 10, { "gpio_in", "gpio_out", "hdmi", NULL, NULL, NULL, "ph_eint10" }, 6, 10, 7}, }; const struct allwinner_padconf h6_padconf = { Modified: head/sys/arm/allwinner/h6/h6_r_padconf.c ============================================================================== --- head/sys/arm/allwinner/h6/h6_r_padconf.c Sun Jan 19 18:36:03 2020 (r356887) +++ head/sys/arm/allwinner/h6/h6_r_padconf.c Sun Jan 19 19:14:49 2020 (r356888) @@ -35,23 +35,23 @@ __FBSDID("$FreeBSD$"); #include const static struct allwinner_pins h6_r_pins[] = { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Jan 19 19:16:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6554D2225E8; Sun, 19 Jan 2020 19:16:33 +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 4814KY21nSz4b3Y; Sun, 19 Jan 2020 19:16:33 +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 3C6F6F9C4; Sun, 19 Jan 2020 19:16:33 +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 00JJGXOK084795; Sun, 19 Jan 2020 19:16:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00JJGWpO084793; Sun, 19 Jan 2020 19:16:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001191916.00JJGWpO084793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 19 Jan 2020 19:16:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356889 - in head: gnu/usr.bin/binutils tools/build/options X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: gnu/usr.bin/binutils tools/build/options X-SVN-Commit-Revision: 356889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 19:16:33 -0000 Author: emaste Date: Sun Jan 19 19:16:32 2020 New Revision: 356889 URL: https://svnweb.freebsd.org/changeset/base/356889 Log: limit building GNU assembler (as) to x86 GNU as 2.17.50 is currently required by amd64 and i386 for at least one file that cannot be assembled by Clang's integrated assembler (IAS). Other supported CPU architectures either use Clang IAS for all assembly files, or rely on external toolchain. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23180 Modified: head/gnu/usr.bin/binutils/Makefile head/tools/build/options/WITH_BINUTILS head/tools/build/options/WITH_BINUTILS_BOOTSTRAP Modified: head/gnu/usr.bin/binutils/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/Makefile Sun Jan 19 19:14:49 2020 (r356888) +++ head/gnu/usr.bin/binutils/Makefile Sun Jan 19 19:16:32 2020 (r356889) @@ -8,8 +8,14 @@ SUBDIR= libiberty \ SUBDIR.${MK_BINUTILS}+= doc SUBDIR.${MK_BINUTILS}+= libbinutils -SUBDIR.${MK_BINUTILS}+= as SUBDIR.${MK_BINUTILS}+= objdump + +# GNU as is used on x86 only, for a few files that cannot be assembled by +# Clang IAS. Other archs either use Clang IAS for every assembly file, or +# use external toolchain. +.if ${TARGET} == "amd64" || ${TARGET} == "i386" +SUBDIR.${MK_BINUTILS}+= as +.endif # All archs except powerpc either use lld or require external toolchain. # powerpc still needs binutils ld to link 32-bit binaries. Modified: head/tools/build/options/WITH_BINUTILS ============================================================================== --- head/tools/build/options/WITH_BINUTILS Sun Jan 19 19:14:49 2020 (r356888) +++ head/tools/build/options/WITH_BINUTILS Sun Jan 19 19:16:32 2020 (r356889) @@ -1,8 +1,8 @@ .\" $FreeBSD$ -Set to build and install GNU -.Xr as 1 , +Build and install GNU +.Xr as 1 +on i386 and amd64, .Xr objdump 1 , -and, on powerpc, +and .Xr ld.bfd 1 -as part -of the normal system build. +on powerpc as part of the normal system build. Modified: head/tools/build/options/WITH_BINUTILS_BOOTSTRAP ============================================================================== --- head/tools/build/options/WITH_BINUTILS_BOOTSTRAP Sun Jan 19 19:14:49 2020 (r356888) +++ head/tools/build/options/WITH_BINUTILS_BOOTSTRAP Sun Jan 19 19:16:32 2020 (r356889) @@ -1,3 +1,3 @@ .\" $FreeBSD$ -Set build binutils (as, objdump, and on powerpc ld) +Build binutils (as on i386 and amd64, objdump, and ld on powerpc) as part of the bootstrap process. From owner-svn-src-all@freebsd.org Sun Jan 19 19:47:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 06063222EDF; Sun, 19 Jan 2020 19:47:05 +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 48150m6Kd3z4cC4; Sun, 19 Jan 2020 19:47:04 +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 D4836FFB1; Sun, 19 Jan 2020 19:47:04 +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 00JJl45A002505; Sun, 19 Jan 2020 19:47:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00JJl40p002503; Sun, 19 Jan 2020 19:47:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001191947.00JJl40p002503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 19 Jan 2020 19:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356890 - head/tools/build/options X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/build/options X-SVN-Commit-Revision: 356890 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 19:47:05 -0000 Author: emaste Date: Sun Jan 19 19:47:04 2020 New Revision: 356890 URL: https://svnweb.freebsd.org/changeset/base/356890 Log: remove caution notes from WITHOUT_BINUTILS* descriptions WITHOUT_BINUTILS and WITHOUT_BINUTILS_BOOTSTRAP previously included claims about being unable to build if set. Those cautions are no longer universally true, and most FreeBSD targets can function more or less without enabling GNU Binutils. Just remove the cautions. Sponsored by: The FreeBSD Foundation Modified: head/tools/build/options/WITHOUT_BINUTILS head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP Modified: head/tools/build/options/WITHOUT_BINUTILS ============================================================================== --- head/tools/build/options/WITHOUT_BINUTILS Sun Jan 19 19:16:32 2020 (r356889) +++ head/tools/build/options/WITHOUT_BINUTILS Sun Jan 19 19:47:04 2020 (r356890) @@ -5,4 +5,3 @@ Do not build or install GNU .Xr objdump 1 as part of the normal system build. -The resulting system cannot build programs from source. Modified: head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP ============================================================================== --- head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP Sun Jan 19 19:16:32 2020 (r356889) +++ head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP Sun Jan 19 19:47:04 2020 (r356890) @@ -1,7 +1,3 @@ .\" $FreeBSD$ Do not build binutils (as, ld.bfd, and objdump) as part of the bootstrap process. -.Bf -symbolic -The option does not work for build targets unless some alternative -toolchain is provided. -.Ef From owner-svn-src-all@freebsd.org Sun Jan 19 19:51:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E04C02230F9; Sun, 19 Jan 2020 19:51:20 +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 48155h6Knsz4cVH; Sun, 19 Jan 2020 19:51:20 +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 BBD4318104; Sun, 19 Jan 2020 19:51:20 +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 00JJpKYS005022; Sun, 19 Jan 2020 19:51:20 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00JJpKpW005021; Sun, 19 Jan 2020 19:51:20 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202001191951.00JJpKpW005021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 19 Jan 2020 19:51:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356891 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 356891 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 19:51:20 -0000 Author: manu Date: Sun Jan 19 19:51:20 2020 New Revision: 356891 URL: https://svnweb.freebsd.org/changeset/base/356891 Log: arm: allwinner: Add GPIO Interrupt support Not all pins in Allwinner have interrupts support so we rely on the padconf data to add the proper caps when pin_getcaps is called. The pin is switch to the specific "eint" function during setup_intr and switched back to its old function in teardown_intr. Only INTR_MAP_DATA_GPIO is supported for now. MFC after: 1 month Modified: head/sys/arm/allwinner/aw_gpio.c Modified: head/sys/arm/allwinner/aw_gpio.c ============================================================================== --- head/sys/arm/allwinner/aw_gpio.c Sun Jan 19 19:47:04 2020 (r356890) +++ head/sys/arm/allwinner/aw_gpio.c Sun Jan 19 19:51:20 2020 (r356891) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -61,11 +62,18 @@ __FBSDID("$FreeBSD$"); #include "opt_soc.h" #endif +#ifdef INTRNG +#include "pic_if.h" +#endif + #include "gpio_if.h" #define AW_GPIO_DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \ - GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN) + GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN); +#define AW_GPIO_INTR_CAPS (GPIO_INTR_LEVEL_LOW | GPIO_INTR_LEVEL_HIGH | \ + GPIO_INTR_EDGE_RISING | GPIO_INTR_EDGE_FALLING | GPIO_INTR_EDGE_BOTH) + #define AW_GPIO_NONE 0 #define AW_GPIO_PULLUP 1 #define AW_GPIO_PULLDOWN 2 @@ -249,19 +257,47 @@ struct clk_list { clk_t clk; }; +#ifdef INTRNG +struct gpio_irqsrc { + struct intr_irqsrc isrc; + u_int irq; + uint32_t mode; + uint32_t pin; + uint32_t bank; + uint32_t intnum; + uint32_t intfunc; + uint32_t oldfunc; + bool enabled; +}; +#endif + +#define AW_GPIO_MEMRES 0 +#define AW_GPIO_IRQRES 1 +#define AW_GPIO_RESSZ 2 + struct aw_gpio_softc { device_t sc_dev; device_t sc_busdev; + struct resource * sc_res[AW_GPIO_RESSZ]; struct mtx sc_mtx; struct resource * sc_mem_res; struct resource * sc_irq_res; - bus_space_tag_t sc_bst; - bus_space_handle_t sc_bsh; void * sc_intrhand; struct aw_gpio_conf *conf; TAILQ_HEAD(, clk_list) clk_list; + +#ifdef INTRNG + struct gpio_irqsrc *gpio_pic_irqsrc; + int nirqs; +#endif }; +static struct resource_spec aw_gpio_res_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE }, + { -1, 0, 0 } +}; + #define AW_GPIO_LOCK(_sc) mtx_lock_spin(&(_sc)->sc_mtx) #define AW_GPIO_UNLOCK(_sc) mtx_unlock_spin(&(_sc)->sc_mtx) #define AW_GPIO_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) @@ -271,15 +307,19 @@ struct aw_gpio_softc { #define AW_GPIO_GP_DRV(_bank, _idx) 0x14 + ((_bank) * 0x24) + ((_idx) << 2) #define AW_GPIO_GP_PUL(_bank, _idx) 0x1c + ((_bank) * 0x24) + ((_idx) << 2) -#define AW_GPIO_GP_INT_CFG0 0x200 -#define AW_GPIO_GP_INT_CFG1 0x204 -#define AW_GPIO_GP_INT_CFG2 0x208 -#define AW_GPIO_GP_INT_CFG3 0x20c +#define AW_GPIO_GP_INT_BASE(_bank) (0x200 + 0x20 * _bank) -#define AW_GPIO_GP_INT_CTL 0x210 -#define AW_GPIO_GP_INT_STA 0x214 -#define AW_GPIO_GP_INT_DEB 0x218 +#define AW_GPIO_GP_INT_CFG(_bank, _pin) (AW_GPIO_GP_INT_BASE(_bank) + (0x4 * ((_pin) / 8))) +#define AW_GPIO_GP_INT_CTL(_bank) (AW_GPIO_GP_INT_BASE(_bank) + 0x10) +#define AW_GPIO_GP_INT_STA(_bank) (AW_GPIO_GP_INT_BASE(_bank) + 0x14) +#define AW_GPIO_GP_INT_DEB(_bank) (AW_GPIO_GP_INT_BASE(_bank) + 0x18) +#define AW_GPIO_INT_EDGE_POSITIVE 0x0 +#define AW_GPIO_INT_EDGE_NEGATIVE 0x1 +#define AW_GPIO_INT_LEVEL_HIGH 0x2 +#define AW_GPIO_INT_LEVEL_LOW 0x3 +#define AW_GPIO_INT_EDGE_BOTH 0x4 + static char *aw_gpio_parse_function(phandle_t node); static const char **aw_gpio_parse_pins(phandle_t node, int *pins_nb); static uint32_t aw_gpio_parse_bias(phandle_t node); @@ -290,10 +330,16 @@ static int aw_gpio_pin_set(device_t dev, uint32_t pin, static int aw_gpio_pin_get_locked(struct aw_gpio_softc *sc, uint32_t pin, unsigned int *value); static int aw_gpio_pin_set_locked(struct aw_gpio_softc *sc, uint32_t pin, unsigned int value); +static void aw_gpio_intr(void *arg); +static void aw_gpio_pic_disable_intr(device_t dev, struct intr_irqsrc *isrc); +static void aw_gpio_pic_disable_intr_locked(struct aw_gpio_softc *sc, struct intr_irqsrc *isrc); +static void aw_gpio_pic_post_filter(device_t dev, struct intr_irqsrc *isrc); +static int aw_gpio_register_isrcs(struct aw_gpio_softc *sc); + #define AW_GPIO_WRITE(_sc, _off, _val) \ - bus_space_write_4(_sc->sc_bst, _sc->sc_bsh, _off, _val) + bus_write_4((_sc)->sc_res[AW_GPIO_MEMRES], _off, _val) #define AW_GPIO_READ(_sc, _off) \ - bus_space_read_4(_sc->sc_bst, _sc->sc_bsh, _off) + bus_read_4((_sc)->sc_res[AW_GPIO_MEMRES], _off) static uint32_t aw_gpio_get_function(struct aw_gpio_softc *sc, uint32_t pin) @@ -492,6 +538,8 @@ aw_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32 return (EINVAL); *caps = AW_GPIO_DEFAULT_CAPS; + if (sc->conf->padconf->pins[pin].eint_func != 0) + *caps |= AW_GPIO_INTR_CAPS; return (0); } @@ -807,6 +855,27 @@ aw_gpio_pin_config_32(device_t dev, uint32_t first_pin } static int +aw_gpio_map_gpios(device_t bus, phandle_t dev, phandle_t gparent, int gcells, + pcell_t *gpios, uint32_t *pin, uint32_t *flags) +{ + struct aw_gpio_softc *sc; + int i; + + sc = device_get_softc(bus); + + /* The GPIO pins are mapped as: . */ + for (i = 0; i < sc->conf->padconf->npins; i++) + if (sc->conf->padconf->pins[i].port == gpios[0] && + sc->conf->padconf->pins[i].pin == gpios[1]) { + *pin = i; + break; + } + *flags = gpios[gcells - 1]; + + return (0); +} + +static int aw_find_pinnum_by_name(struct aw_gpio_softc *sc, const char *pinname) { int i; @@ -938,7 +1007,7 @@ aw_gpio_probe(device_t dev) static int aw_gpio_attach(device_t dev) { - int rid, error; + int error; phandle_t gpio; struct aw_gpio_softc *sc; struct clk_list *clkp, *clkp_tmp; @@ -951,22 +1020,15 @@ aw_gpio_attach(device_t dev) mtx_init(&sc->sc_mtx, "aw gpio", "gpio", MTX_SPIN); - rid = 0; - sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, - RF_ACTIVE); - if (!sc->sc_mem_res) { - device_printf(dev, "cannot allocate memory window\n"); - goto fail; + if (bus_alloc_resources(dev, aw_gpio_res_spec, sc->sc_res) != 0) { + device_printf(dev, "cannot allocate device resources\n"); + return (ENXIO); } - sc->sc_bst = rman_get_bustag(sc->sc_mem_res); - sc->sc_bsh = rman_get_bushandle(sc->sc_mem_res); - - rid = 0; - sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_ACTIVE); - if (!sc->sc_irq_res) { - device_printf(dev, "cannot allocate interrupt\n"); + if (bus_setup_intr(dev, sc->sc_res[AW_GPIO_IRQRES], + INTR_TYPE_CLK | INTR_MPSAFE, NULL, aw_gpio_intr, sc, + &sc->sc_intrhand)) { + device_printf(dev, "cannot setup interrupt handler\n"); goto fail; } @@ -1009,6 +1071,11 @@ aw_gpio_attach(device_t dev) goto fail; } +#ifdef INTRNG + aw_gpio_register_isrcs(sc); + intr_pic_register(dev, OF_xref_from_node(ofw_bus_get_node(dev))); +#endif + sc->sc_busdev = gpiobus_attach_bus(dev); if (sc->sc_busdev == NULL) goto fail; @@ -1062,40 +1129,339 @@ aw_gpio_detach(device_t dev) return (EBUSY); } -static phandle_t -aw_gpio_get_node(device_t dev, device_t bus) +static void +aw_gpio_intr(void *arg) { + struct aw_gpio_softc *sc; + struct intr_irqsrc *isrc; + uint32_t reg; + int irq; - /* We only have one child, the GPIO bus, which needs our own node. */ - return (ofw_bus_get_node(dev)); + sc = (struct aw_gpio_softc *)arg; + + AW_GPIO_LOCK(sc); + for (irq = 0; irq < sc->nirqs; irq++) { + if (!sc->gpio_pic_irqsrc[irq].enabled) + continue; + + reg = AW_GPIO_READ(sc, AW_GPIO_GP_INT_STA(sc->gpio_pic_irqsrc[irq].bank)); + if (!(reg & (1 << sc->gpio_pic_irqsrc[irq].intnum))) + continue; + + isrc = &sc->gpio_pic_irqsrc[irq].isrc; + if (intr_isrc_dispatch(isrc, curthread->td_intr_frame) != 0) { + aw_gpio_pic_disable_intr_locked(sc, isrc); + aw_gpio_pic_post_filter(sc->sc_dev, isrc); + device_printf(sc->sc_dev, "Stray irq %u disabled\n", irq); + } + } + AW_GPIO_UNLOCK(sc); } +/* + * Interrupts support + */ + static int -aw_gpio_map_gpios(device_t bus, phandle_t dev, phandle_t gparent, int gcells, - pcell_t *gpios, uint32_t *pin, uint32_t *flags) +aw_gpio_register_isrcs(struct aw_gpio_softc *sc) { + const char *name; + int nirqs; + int pin; + int err; + + name = device_get_nameunit(sc->sc_dev); + + for (nirqs = 0, pin = 0; pin < sc->conf->padconf->npins; pin++) { + if (sc->conf->padconf->pins[pin].eint_func == 0) + continue; + + nirqs++; + } + + sc->gpio_pic_irqsrc = malloc(sizeof(*sc->gpio_pic_irqsrc) * nirqs, + M_DEVBUF, M_WAITOK | M_ZERO); + for (nirqs = 0, pin = 0; pin < sc->conf->padconf->npins; pin++) { + if (sc->conf->padconf->pins[pin].eint_func == 0) + continue; + + sc->gpio_pic_irqsrc[nirqs].pin = pin; + sc->gpio_pic_irqsrc[nirqs].bank = sc->conf->padconf->pins[pin].eint_bank; + sc->gpio_pic_irqsrc[nirqs].intnum = sc->conf->padconf->pins[pin].eint_num; + sc->gpio_pic_irqsrc[nirqs].intfunc = sc->conf->padconf->pins[pin].eint_func; + sc->gpio_pic_irqsrc[nirqs].irq = nirqs; + sc->gpio_pic_irqsrc[nirqs].mode = GPIO_INTR_CONFORM; + + err = intr_isrc_register(&sc->gpio_pic_irqsrc[nirqs].isrc, + sc->sc_dev, 0, "%s,%s", name, + sc->conf->padconf->pins[pin].functions[sc->conf->padconf->pins[pin].eint_func]); + if (err) { + device_printf(sc->sc_dev, "intr_isrs_register failed for irq %d\n", nirqs); + } + + nirqs++; + } + + sc->nirqs = nirqs; + + return (0); +} + +static void +aw_gpio_pic_disable_intr_locked(struct aw_gpio_softc *sc, struct intr_irqsrc *isrc) +{ + u_int irq; + uint32_t reg; + + AW_GPIO_LOCK_ASSERT(sc); + irq = ((struct gpio_irqsrc *)isrc)->irq; + reg = AW_GPIO_READ(sc, AW_GPIO_GP_INT_CTL(sc->gpio_pic_irqsrc[irq].bank)); + reg &= ~(1 << sc->gpio_pic_irqsrc[irq].intnum); + AW_GPIO_WRITE(sc, AW_GPIO_GP_INT_CTL(sc->gpio_pic_irqsrc[irq].bank), reg); + + sc->gpio_pic_irqsrc[irq].enabled = false; +} + +static void +aw_gpio_pic_disable_intr(device_t dev, struct intr_irqsrc *isrc) +{ struct aw_gpio_softc *sc; - int i; - sc = device_get_softc(bus); + sc = device_get_softc(dev); - /* The GPIO pins are mapped as: . */ - for (i = 0; i < sc->conf->padconf->npins; i++) - if (sc->conf->padconf->pins[i].port == gpios[0] && - sc->conf->padconf->pins[i].pin == gpios[1]) { - *pin = i; + AW_GPIO_LOCK(sc); + aw_gpio_pic_disable_intr_locked(sc, isrc); + AW_GPIO_UNLOCK(sc); +} + +static void +aw_gpio_pic_enable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct aw_gpio_softc *sc; + u_int irq; + uint32_t reg; + + sc = device_get_softc(dev); + irq = ((struct gpio_irqsrc *)isrc)->irq; + AW_GPIO_LOCK(sc); + reg = AW_GPIO_READ(sc, AW_GPIO_GP_INT_CTL(sc->gpio_pic_irqsrc[irq].bank)); + reg |= 1 << sc->gpio_pic_irqsrc[irq].intnum; + AW_GPIO_WRITE(sc, AW_GPIO_GP_INT_CTL(sc->gpio_pic_irqsrc[irq].bank), reg); + AW_GPIO_UNLOCK(sc); + + sc->gpio_pic_irqsrc[irq].enabled = true; +} + +static int +aw_gpio_pic_map_gpio(struct aw_gpio_softc *sc, struct intr_map_data_gpio *dag, + u_int *irqp, u_int *mode) +{ + u_int irq; + int pin; + + irq = dag->gpio_pin_num; + + for (pin = 0; pin < sc->nirqs; pin++) + if (sc->gpio_pic_irqsrc[pin].pin == irq) break; - } - *flags = gpios[gcells - 1]; + if (pin == sc->nirqs) { + device_printf(sc->sc_dev, "Invalid interrupt number %u\n", irq); + return (EINVAL); + } + switch (dag->gpio_intr_mode) { + case GPIO_INTR_LEVEL_LOW: + case GPIO_INTR_LEVEL_HIGH: + case GPIO_INTR_EDGE_RISING: + case GPIO_INTR_EDGE_FALLING: + case GPIO_INTR_EDGE_BOTH: + break; + default: + device_printf(sc->sc_dev, "Unsupported interrupt mode 0x%8x\n", + dag->gpio_intr_mode); + return (EINVAL); + } + + *irqp = pin; + if (mode != NULL) + *mode = dag->gpio_intr_mode; + return (0); } +static int +aw_gpio_pic_map_intr(device_t dev, struct intr_map_data *data, + struct intr_irqsrc **isrcp) +{ + struct aw_gpio_softc *sc; + u_int irq; + int err; + + sc = device_get_softc(dev); + switch (data->type) { + case INTR_MAP_DATA_GPIO: + err = aw_gpio_pic_map_gpio(sc, + (struct intr_map_data_gpio *)data, + &irq, NULL); + break; + default: + return (ENOTSUP); + }; + + if (err == 0) + *isrcp = &sc->gpio_pic_irqsrc[irq].isrc; + return (0); +} + +static int +aw_gpio_pic_setup_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + struct aw_gpio_softc *sc; + struct gpio_irqsrc *gi; + uint32_t irqcfg; + uint32_t pinidx, reg; + u_int irq, mode; + int err; + + sc = device_get_softc(dev); + gi = (struct gpio_irqsrc *)isrc; + + switch (data->type) { + case INTR_MAP_DATA_GPIO: + err = aw_gpio_pic_map_gpio(sc, + (struct intr_map_data_gpio *)data, + &irq, &mode); + break; + default: + return (ENOTSUP); + }; + + pinidx = (sc->gpio_pic_irqsrc[irq].intnum % 8) * 4; + + AW_GPIO_LOCK(sc); + switch (mode) { + case GPIO_INTR_LEVEL_LOW: + irqcfg = AW_GPIO_INT_LEVEL_LOW << pinidx; + break; + case GPIO_INTR_LEVEL_HIGH: + irqcfg = AW_GPIO_INT_LEVEL_HIGH << pinidx; + break; + case GPIO_INTR_EDGE_RISING: + irqcfg = AW_GPIO_INT_EDGE_POSITIVE << pinidx; + break; + case GPIO_INTR_EDGE_FALLING: + irqcfg = AW_GPIO_INT_EDGE_NEGATIVE << pinidx; + break; + case GPIO_INTR_EDGE_BOTH: + irqcfg = AW_GPIO_INT_EDGE_BOTH << pinidx; + break; + } + + /* Switch the pin to interrupt mode */ + sc->gpio_pic_irqsrc[irq].oldfunc = aw_gpio_get_function(sc, + sc->gpio_pic_irqsrc[irq].pin); + aw_gpio_set_function(sc, sc->gpio_pic_irqsrc[irq].pin, + sc->gpio_pic_irqsrc[irq].intfunc); + + /* Write interrupt mode */ + reg = AW_GPIO_READ(sc, + AW_GPIO_GP_INT_CFG(sc->gpio_pic_irqsrc[irq].bank, + sc->gpio_pic_irqsrc[irq].intnum)); + reg &= ~(0xF << pinidx); + reg |= irqcfg; + AW_GPIO_WRITE(sc, + AW_GPIO_GP_INT_CFG(sc->gpio_pic_irqsrc[irq].bank, + sc->gpio_pic_irqsrc[irq].intnum), + reg); + + AW_GPIO_UNLOCK(sc); + + return (0); +} + +static int +aw_gpio_pic_teardown_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + struct aw_gpio_softc *sc; + struct gpio_irqsrc *gi; + + sc = device_get_softc(dev); + gi = (struct gpio_irqsrc *)isrc; + + /* Switch back the pin to it's original function */ + AW_GPIO_LOCK(sc); + aw_gpio_set_function(sc, gi->pin, gi->oldfunc); + AW_GPIO_UNLOCK(sc); + + return (0); +} + +static void +aw_gpio_pic_post_filter(device_t dev, struct intr_irqsrc *isrc) +{ + struct aw_gpio_softc *sc; + struct gpio_irqsrc *gi; + + sc = device_get_softc(dev); + gi = (struct gpio_irqsrc *)isrc; + + arm_irq_memory_barrier(0); + AW_GPIO_WRITE(sc, AW_GPIO_GP_INT_STA(gi->bank), 1 << gi->intnum); +} + +static void +aw_gpio_pic_post_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + struct aw_gpio_softc *sc; + struct gpio_irqsrc *gi; + + sc = device_get_softc(dev); + gi = (struct gpio_irqsrc *)isrc; + + arm_irq_memory_barrier(0); + AW_GPIO_WRITE(sc, AW_GPIO_GP_INT_STA(gi->bank), 1 << gi->intnum); + aw_gpio_pic_enable_intr(dev, isrc); +} + +static void +aw_gpio_pic_pre_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + struct aw_gpio_softc *sc; + + sc = device_get_softc(dev); + aw_gpio_pic_disable_intr_locked(sc, isrc); +} + +/* + * OFWBUS Interface + */ +static phandle_t +aw_gpio_get_node(device_t dev, device_t bus) +{ + + /* We only have one child, the GPIO bus, which needs our own node. */ + return (ofw_bus_get_node(dev)); +} + static device_method_t aw_gpio_methods[] = { /* Device interface */ DEVMETHOD(device_probe, aw_gpio_probe), DEVMETHOD(device_attach, aw_gpio_attach), DEVMETHOD(device_detach, aw_gpio_detach), + +#ifdef INTRNG + /* Interrupt controller interface */ + DEVMETHOD(pic_disable_intr, aw_gpio_pic_disable_intr), + DEVMETHOD(pic_enable_intr, aw_gpio_pic_enable_intr), + DEVMETHOD(pic_map_intr, aw_gpio_pic_map_intr), + DEVMETHOD(pic_setup_intr, aw_gpio_pic_setup_intr), + DEVMETHOD(pic_teardown_intr, aw_gpio_pic_teardown_intr), + DEVMETHOD(pic_post_filter, aw_gpio_pic_post_filter), + DEVMETHOD(pic_post_ithread, aw_gpio_pic_post_ithread), + DEVMETHOD(pic_pre_ithread, aw_gpio_pic_pre_ithread), +#endif /* GPIO protocol */ DEVMETHOD(gpio_get_bus, aw_gpio_get_bus), From owner-svn-src-all@freebsd.org Sun Jan 19 19:51:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 950A7223171; Sun, 19 Jan 2020 19:51:43 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) (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 4815662lPTz4cdW; Sun, 19 Jan 2020 19:51:42 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x342.google.com with SMTP id f129so12615408wmf.2; Sun, 19 Jan 2020 11:51:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Uf0PsYM1gG7hxQbLYvxG6s7tzPG7npmvWLEfiysZNkU=; b=aMbNj/6xdAHQBffBkYmRJYjltTzLycHbQqPTiMjD1tDNoDV6+HXZZGqzXXRiiQ+BQg Wj2gBMKyXmlCZlWHPw/NQN4HHEmjVM9oj4HbI/9Nhe8zAdPsGPSu2CWHcFUSo+7rdxdD lRCooBKj4t/gMuNMHbYP5VRFEDKYlVrAE9qoPbOKFFUm+SoXXnKpWBQyMYuQe1fLBpp9 XRvG49fnJ7Q7YO1/f29wvTfPw1oilM20gDSg0kU7XyQu9ZmiAdShkVirAe4+25zipdnT ajYNcj6iLzc23noopxPAEPy1pApmInVpOjrreaJml19y32E78pbyx+WB2Nv8BuWyEGKr ZINQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Uf0PsYM1gG7hxQbLYvxG6s7tzPG7npmvWLEfiysZNkU=; b=sG5BlHRnvceCueRiyuV0uhfYyS6VIw2jOINeTHcAqpiFdcK/2xxw1bwDi99Ak5ERGL RGl8Lkgf9m2LLcVSA8Mz9XEgxu047ThFpcj1o9DaJfmumBqrGtic0bQQzT6VFng07WUv W8klq90QBpwMjva51wEpSKJy2oPOftvGHDVX9+ZOVk8CCLmd0tuw88Mk0wneIoseLvOg NHvFGY8ZdYgYagl11FTcO8AwZ+WYtaghUvnxqr6L+laHmMxElYLUyv1a6JFKKUjpkdan xrYh0zs3GlsM88r1B+5Qp+WiIk+d75L0IOmqZ2jC+Z0AByW4zd+NpJQj2hACOW8fSTLU vRZg== X-Gm-Message-State: APjAAAWwiQbj86S04SZAF3vePsLXJQ1kH+4OZMJBWOhYBA1jIP8OwD8m zV7HFgzBmP1LNfRKKqNZQ5PGcS1wX+ALoN6Gc80= X-Google-Smtp-Source: APXvYqzmdULNSVBDFLSj7lwJ3jbJutyMsKQof6ovezrAdItLP3JCkliGYPS99Fp5T17Fp0ujWfDxCt/eS/6jVs65zZk= X-Received: by 2002:a05:600c:295a:: with SMTP id n26mr15613679wmd.187.1579463500435; Sun, 19 Jan 2020 11:51:40 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:6b02:0:0:0:0:0 with HTTP; Sun, 19 Jan 2020 11:51:39 -0800 (PST) In-Reply-To: References: <202001191705.00JH5QRQ006755@repo.freebsd.org> From: Mateusz Guzik Date: Sun, 19 Jan 2020 20:51:39 +0100 Message-ID: Subject: Re: svn commit: r356883 - head/sys/kern To: Warner Losh Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4815662lPTz4cdW X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=aMbNj/6x; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::342 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (2.47), ipnet: 2a00:1450::/32(-2.59), asn: 15169(-1.82), country: US(-0.05)]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2.4.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.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, 19 Jan 2020 19:51:43 -0000 On 1/19/20, Warner Losh wrote: > On Sun, Jan 19, 2020, 10:05 AM Mateusz Guzik wrote: > >> Author: mjg >> Date: Sun Jan 19 17:05:26 2020 >> New Revision: 356883 >> URL: https://svnweb.freebsd.org/changeset/base/356883 >> >> Log: >> cache: counter_u64_add_protected -> counter_u64_add >> >> Fixes booting on RISC-V where it does happen to not be equivalent. >> > > Any reason we can't just have a counter64 API that works the same both > places rather than hiding what looks to my eye to be just that behind > ifdefs in vfs_cache.c? > Both as in 32 and 64-bit? Note the ifdef is there partially because the counter is not strictly 64-bit but long, meaning 32 bit on i386 and the like. Should someone want to spend time implementing a 32-bit per-cpu counter, they should start with implementing a new facility for counters which are known to always be there (which is vast majority). They can be stored in per-cpu area. Then the common case of just modifying the counter can compile to something fast. For example on amd64 this can be one instruction which uses %gs and an offset known at compilation time. In contrast counter(9) code explicitly allocates memory, meaning all consumers have to deference a pointer. On top of that there is extra computation to find the right address. This bit could be moved elsewhere so that the stored address already has it in, but the fundamental differnce remains. This plus maintaining coherent 64-bit counters requires extra provisions on 32-bit architectures, which could also be avoided for numcachehv. -- Mateusz Guzik From owner-svn-src-all@freebsd.org Sun Jan 19 19:56:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7912A223285; Sun, 19 Jan 2020 19:56:06 +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 4815CB2dWBz4d1l; Sun, 19 Jan 2020 19:56:06 +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 55A79181A2; Sun, 19 Jan 2020 19:56:06 +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 00JJu6Bw008505; Sun, 19 Jan 2020 19:56:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00JJu6Z2008504; Sun, 19 Jan 2020 19:56:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001191956.00JJu6Z2008504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 19 Jan 2020 19:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356892 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 356892 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 19:56:06 -0000 Author: emaste Date: Sun Jan 19 19:56:05 2020 New Revision: 356892 URL: https://svnweb.freebsd.org/changeset/base/356892 Log: src.opts.mk: default BINUTILS_BOOTSTRAP to NO except for x86 and powerpc x86 needs bootstrap GNU as for assembling a few files, and powerpc needs GNU ld.bfd for linking 32-bit objects. All other targets either fully use in-tree Clang and lld, or rely on external toolchain. Sponsored by: The FreeBSD Foundation Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sun Jan 19 19:51:20 2020 (r356891) +++ head/share/mk/src.opts.mk Sun Jan 19 19:56:05 2020 (r356892) @@ -63,7 +63,6 @@ __DEFAULT_YES_OPTIONS = \ AUTOFS \ BHYVE \ BINUTILS \ - BINUTILS_BOOTSTRAP \ BLACKLIST \ BLUETOOTH \ BOOT \ @@ -313,6 +312,11 @@ __DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_IS_C # In-tree binutils/gcc are older versions without modern architecture support. .if ${__T} == "aarch64" || ${__T:Mriscv*} != "" BROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GCC GCC_BOOTSTRAP GDB +.endif +.if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*} +__DEFAULT_YES_OPTIONS+=BINUTILS_BOOTSTRAP +.else +__DEFAULT_NO_OPTIONS+=BINUTILS_BOOTSTRAP .endif .if ${__T:Mriscv*} != "" BROKEN_OPTIONS+=OFED From owner-svn-src-all@freebsd.org Sun Jan 19 19:56:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3D88022332F; Sun, 19 Jan 2020 19:56:51 +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 4815D30tDnz4d8J; Sun, 19 Jan 2020 19:56:51 +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 18E73181A4; Sun, 19 Jan 2020 19:56:51 +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 00JJuoaO008584; Sun, 19 Jan 2020 19:56:50 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00JJuoTb008583; Sun, 19 Jan 2020 19:56:50 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202001191956.00JJuoTb008583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 19 Jan 2020 19:56:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356893 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 356893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 19:56:51 -0000 Author: manu Date: Sun Jan 19 19:56:50 2020 New Revision: 356893 URL: https://svnweb.freebsd.org/changeset/base/356893 Log: rk805: Add a regnode_init method This method will set the desired voltaged based on values in the DTS. It will not enable the regulator, this is the job of either a consumer or regnode_set_constraint SYSINIT if the regulator is boot_on or always_on. Reviewed by: mmel MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D23216 Modified: head/sys/arm64/rockchip/rk805.c Modified: head/sys/arm64/rockchip/rk805.c ============================================================================== --- head/sys/arm64/rockchip/rk805.c Sun Jan 19 19:56:05 2020 (r356892) +++ head/sys/arm64/rockchip/rk805.c Sun Jan 19 19:56:50 2020 (r356893) @@ -97,6 +97,9 @@ struct rk805_softc { int nregs; }; +static int rk805_regnode_set_voltage(struct regnode *regnode, int min_uvolt, + int max_uvolt, int *udelay); + static struct rk805_regdef rk805_regdefs[] = { { .id = RK805_DCDC1, @@ -354,7 +357,26 @@ rk805_write(device_t dev, uint8_t reg, uint8_t data) static int rk805_regnode_init(struct regnode *regnode) { - return (0); + struct rk805_reg_sc *sc; + struct regnode_std_param *param; + int rv, udelay; + + sc = regnode_get_softc(regnode); + param = regnode_get_stdparam(regnode); + if (param->min_uvolt == 0) + return (0); + + /* + * Set the regulator at the correct voltage + * Do not enable it, this is will be done either by a + * consumer or by regnode_set_constraint if boot_on is true + */ + rv = rk805_regnode_set_voltage(regnode, param->min_uvolt, + param->max_uvolt, &udelay); + if (rv != 0) + DELAY(udelay); + + return (rv); } static int From owner-svn-src-all@freebsd.org Sun Jan 19 19:57:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A84562233B0; Sun, 19 Jan 2020 19:57:15 +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 4815DW3d3Fz4dH9; Sun, 19 Jan 2020 19:57:15 +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 5D204181B3; Sun, 19 Jan 2020 19:57:15 +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 00JJvFB9008654; Sun, 19 Jan 2020 19:57:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00JJvFcK008653; Sun, 19 Jan 2020 19:57:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001191957.00JJvFcK008653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 19 Jan 2020 19:57:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356894 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 356894 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 19:57:15 -0000 Author: emaste Date: Sun Jan 19 19:57:14 2020 New Revision: 356894 URL: https://svnweb.freebsd.org/changeset/base/356894 Log: src.conf.5: regen after BINUTILS defaults and description changes Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sun Jan 19 19:56:50 2020 (r356893) +++ head/share/man/man5/src.conf.5 Sun Jan 19 19:57:14 2020 (r356894) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd January 17, 2020 +.Dd January 19, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -185,37 +185,32 @@ Do not build or install GNU .Xr objdump 1 as part of the normal system build. -The resulting system cannot build programs from source. .Pp This is a default setting on arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_BINUTILS -Set to build and install GNU -.Xr as 1 , +Build and install GNU +.Xr as 1 +on i386 and amd64, .Xr objdump 1 , -and, on powerpc, +and .Xr ld.bfd 1 -as part -of the normal system build. +on powerpc as part of the normal system build. .Pp This is a default setting on amd64/amd64, arm/armv6, arm/armv7, 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 sparc64/sparc64. .It Va WITHOUT_BINUTILS_BOOTSTRAP Do not build binutils (as, ld.bfd, and objdump) as part of the bootstrap process. -.Bf -symbolic -The option does not work for build targets unless some alternative -toolchain is provided. -.Ef .Pp This is a default setting on -arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_BINUTILS_BOOTSTRAP -Set build binutils (as, objdump, and on powerpc ld) +Build binutils (as on i386 and amd64, objdump, and ld on powerpc) as part of the bootstrap process. .Pp This is a default setting on -amd64/amd64, arm/armv6, arm/armv7, i386/i386, powerpc/powerpc and powerpc/powerpc64. +amd64/amd64, i386/i386, powerpc/powerpc and powerpc/powerpc64. .It Va WITHOUT_BLACKLIST Set this if you do not want to build .Xr blacklistd 8 From owner-svn-src-all@freebsd.org Sun Jan 19 20:04:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F14E622364E; Sun, 19 Jan 2020 20:04:46 +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 4815PB6hZ0z4dqh; Sun, 19 Jan 2020 20:04:46 +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 C7CD118392; Sun, 19 Jan 2020 20:04:46 +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 00JK4k9u014692; Sun, 19 Jan 2020 20:04:46 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00JK4jQi014685; Sun, 19 Jan 2020 20:04:45 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202001192004.00JK4jQi014685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 19 Jan 2020 20:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356895 - in head/sys: arm/conf arm/xilinx dev/flash dts/arm X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm/conf arm/xilinx dev/flash dts/arm X-SVN-Commit-Revision: 356895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 20:04:47 -0000 Author: manu Date: Sun Jan 19 20:04:44 2020 New Revision: 356895 URL: https://svnweb.freebsd.org/changeset/base/356895 Log: zilinx/zy7_qspi: Add a qspi driver for Zynq platforms. This is a qspi driver for the Xilinx Zynq-7000 chip. It could be useful for anyone wanting to boot a system from flash memory instead of SD cards. Submitted by: Thomas Skibo (thomasskibo@yahoo.com) Differential Revision: https://reviews.freebsd.org/D14698 Added: head/sys/arm/xilinx/zy7_qspi.c (contents, props changed) Modified: head/sys/arm/conf/GENERIC head/sys/arm/conf/ZEDBOARD head/sys/arm/xilinx/files.zynq7 head/sys/dev/flash/mx25lreg.h head/sys/dts/arm/zedboard.dts head/sys/dts/arm/zybo.dts head/sys/dts/arm/zynq-7000.dtsi Modified: head/sys/arm/conf/GENERIC ============================================================================== --- head/sys/arm/conf/GENERIC Sun Jan 19 19:57:14 2020 (r356894) +++ head/sys/arm/conf/GENERIC Sun Jan 19 20:04:44 2020 (r356895) @@ -172,6 +172,7 @@ device spigen device bcm2835_spi device mv_spi device ti_spi +device zy7_qspi # Xilinx Zynq QSPI controller # ADC support device ti_adc Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Sun Jan 19 19:57:14 2020 (r356894) +++ head/sys/arm/conf/ZEDBOARD Sun Jan 19 20:04:44 2020 (r356895) @@ -57,6 +57,10 @@ device pty device uart device gpio +device spibus +device mx25l +device zy7_qspi # Xilinx Zynq QSPI controller + device md device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards Modified: head/sys/arm/xilinx/files.zynq7 ============================================================================== --- head/sys/arm/xilinx/files.zynq7 Sun Jan 19 19:57:14 2020 (r356894) +++ head/sys/arm/xilinx/files.zynq7 Sun Jan 19 20:04:44 2020 (r356895) @@ -13,4 +13,5 @@ dev/cadence/if_cgem.c optional cgem arm/xilinx/zy7_ehci.c optional ehci arm/xilinx/uart_dev_cdnc.c optional uart arm/xilinx/zy7_gpio.c optional gpio +arm/xilinx/zy7_qspi.c optional zy7_qspi Added: head/sys/arm/xilinx/zy7_qspi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/xilinx/zy7_qspi.c Sun Jan 19 20:04:44 2020 (r356895) @@ -0,0 +1,763 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Thomas Skibo + * 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 +__FBSDID("$FreeBSD$"); + +/* + * This is a driver for the Quad-SPI Flash Controller in the Xilinx + * Zynq-7000 SoC. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include + +#include "spibus_if.h" + +static struct ofw_compat_data compat_data[] = { + {"xlnx,zy7_qspi", 1}, + {"xlnx,zynq-qspi-1.0", 1}, + {NULL, 0} +}; + +struct zy7_qspi_softc { + device_t dev; + device_t child; + struct mtx sc_mtx; + struct resource *mem_res; + struct resource *irq_res; + void *intrhandle; + + uint32_t cfg_reg_shadow; + uint32_t lqspi_cfg_shadow; + uint32_t spi_clock; + uint32_t ref_clock; + unsigned int spi_clk_real_freq; + unsigned int rx_overflows; + unsigned int tx_underflows; + unsigned int interrupts; + unsigned int stray_ints; + struct spi_command *cmd; + int tx_bytes; /* tx_cmd_sz + tx_data_sz */ + int tx_bytes_sent; + int rx_bytes; /* rx_cmd_sz + rx_data_sz */ + int rx_bytes_rcvd; + int busy; + int is_dual; + int is_stacked; + int is_dio; +}; + +#define ZY7_QSPI_DEFAULT_SPI_CLOCK 50000000 + +#define QSPI_SC_LOCK(sc) mtx_lock(&(sc)->sc_mtx) +#define QSPI_SC_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx) +#define QSPI_SC_LOCK_INIT(sc) \ + mtx_init(&(sc)->sc_mtx, device_get_nameunit((sc)->dev), NULL, MTX_DEF) +#define QSPI_SC_LOCK_DESTROY(sc) mtx_destroy(&(sc)->sc_mtx) +#define QSPI_SC_ASSERT_LOCKED(sc) mtx_assert(&(sc)->sc_mtx, MA_OWNED) + +#define RD4(sc, off) (bus_read_4((sc)->mem_res, (off))) +#define WR4(sc, off, val) (bus_write_4((sc)->mem_res, (off), (val))) + +/* + * QSPI device registers. + * Reference: Zynq-7000 All Programmable SoC Technical Reference Manual. + * (v1.12.2) July 1, 2018. Xilinx doc UG585. + */ +#define ZY7_QSPI_CONFIG_REG 0x0000 +#define ZY7_QSPI_CONFIG_IFMODE (1U << 31) +#define ZY7_QSPI_CONFIG_ENDIAN (1 << 26) +#define ZY7_QSPI_CONFIG_HOLDB_DR (1 << 19) +#define ZY7_QSPI_CONFIG_RSVD1 (1 << 17) /* must be 1 */ +#define ZY7_QSPI_CONFIG_MANSTRT (1 << 16) +#define ZY7_QSPI_CONFIG_MANSTRTEN (1 << 15) +#define ZY7_QSPI_CONFIG_SSFORCE (1 << 14) +#define ZY7_QSPI_CONFIG_PCS (1 << 10) +#define ZY7_QSPI_CONFIG_REF_CLK (1 << 8) +#define ZY7_QSPI_CONFIG_FIFO_WIDTH_MASK (3 << 6) +#define ZY7_QSPI_CONFIG_FIFO_WIDTH32 (3 << 6) +#define ZY7_QSPI_CONFIG_BAUD_RATE_DIV_MASK (7 << 3) +#define ZY7_QSPI_CONFIG_BAUD_RATE_DIV_SHIFT 3 +#define ZY7_QSPI_CONFIG_BAUD_RATE_DIV(x) ((x) << 3) /* divide by 2< 0) { + nvalid = MIN(4, nbytes); + data = 0xffffffff; + + /* + * A hardware bug forces us to wait until the tx fifo is + * empty before writing partial words. We'll come back + * next tx interrupt. + */ + if (nvalid < 4 && (RD4(sc, ZY7_QSPI_INTR_STAT_REG) & + ZY7_QSPI_INTR_TX_FIFO_NOT_FULL) == 0) + return; + + if (sc->tx_bytes_sent < sc->cmd->tx_cmd_sz) { + /* Writing command. */ + n = MIN(nvalid, sc->cmd->tx_cmd_sz - + sc->tx_bytes_sent); + memcpy(&data, (uint8_t *)sc->cmd->tx_cmd + + sc->tx_bytes_sent, n); + + if (nvalid > n) { + /* Writing start of data. */ + memcpy((uint8_t *)&data + n, + sc->cmd->tx_data, nvalid - n); + } + } else + /* Writing data. */ + memcpy(&data, (uint8_t *)sc->cmd->tx_data + + (sc->tx_bytes_sent - sc->cmd->tx_cmd_sz), nvalid); + + switch (nvalid) { + case 1: + WR4(sc, ZY7_QSPI_TXD1_REG, data); + break; + case 2: + WR4(sc, ZY7_QSPI_TXD2_REG, data); + break; + case 3: + WR4(sc, ZY7_QSPI_TXD3_REG, data); + break; + case 4: + WR4(sc, ZY7_QSPI_TXD0_REG, data); + break; + } + + sc->tx_bytes_sent += nvalid; + nbytes -= nvalid; + } +} + + +/* Read hardware fifo data into command response and data buffers. */ +static void +zy7_qspi_read_fifo(struct zy7_qspi_softc *sc) +{ + int n, nbytes; + uint32_t data; + + do { + data = RD4(sc, ZY7_QSPI_RX_DATA_REG); + nbytes = MIN(4, sc->rx_bytes - sc->rx_bytes_rcvd); + + /* + * Last word in non-word-multiple transfer is packed + * non-intuitively. + */ + if (nbytes < 4) + data >>= 8 * (4 - nbytes); + + if (sc->rx_bytes_rcvd < sc->cmd->rx_cmd_sz) { + /* Reading command. */ + n = MIN(nbytes, sc->cmd->rx_cmd_sz - + sc->rx_bytes_rcvd); + memcpy((uint8_t *)sc->cmd->rx_cmd + sc->rx_bytes_rcvd, + &data, n); + sc->rx_bytes_rcvd += n; + nbytes -= n; + data >>= 8 * n; + } + + if (nbytes > 0) { + /* Reading data. */ + memcpy((uint8_t *)sc->cmd->rx_data + + (sc->rx_bytes_rcvd - sc->cmd->rx_cmd_sz), + &data, nbytes); + sc->rx_bytes_rcvd += nbytes; + } + + } while (sc->rx_bytes_rcvd < sc->rx_bytes && + (RD4(sc, ZY7_QSPI_INTR_STAT_REG) & + ZY7_QSPI_INTR_RX_FIFO_NOT_EMPTY) != 0); +} + +/* End a transfer early by draining rx fifo and disabling interrupts. */ +static void +zy7_qspi_abort_transfer(struct zy7_qspi_softc *sc) +{ + /* Drain receive fifo. */ + while ((RD4(sc, ZY7_QSPI_INTR_STAT_REG) & + ZY7_QSPI_INTR_RX_FIFO_NOT_EMPTY) != 0) + (void)RD4(sc, ZY7_QSPI_RX_DATA_REG); + + /* Shut down interrupts. */ + WR4(sc, ZY7_QSPI_INTR_DIS_REG, + ZY7_QSPI_INTR_RX_OVERFLOW | + ZY7_QSPI_INTR_RX_FIFO_NOT_EMPTY | + ZY7_QSPI_INTR_TX_FIFO_NOT_FULL); +} + + +static void +zy7_qspi_intr(void *arg) +{ + struct zy7_qspi_softc *sc = (struct zy7_qspi_softc *)arg; + uint32_t istatus; + + QSPI_SC_LOCK(sc); + + sc->interrupts++; + + istatus = RD4(sc, ZY7_QSPI_INTR_STAT_REG); + + /* Stray interrupts can happen if a transfer gets interrupted. */ + if (!sc->busy) { + sc->stray_ints++; + QSPI_SC_UNLOCK(sc); + return; + } + + if ((istatus & ZY7_QSPI_INTR_RX_OVERFLOW) != 0) { + device_printf(sc->dev, "rx fifo overflow!\n"); + sc->rx_overflows++; + + /* Clear status bit. */ + WR4(sc, ZY7_QSPI_INTR_STAT_REG, + ZY7_QSPI_INTR_RX_OVERFLOW); + } + + /* Empty receive fifo before any more transmit data is sent. */ + if (sc->rx_bytes_rcvd < sc->rx_bytes && + (istatus & ZY7_QSPI_INTR_RX_FIFO_NOT_EMPTY) != 0) { + zy7_qspi_read_fifo(sc); + if (sc->rx_bytes_rcvd == sc->rx_bytes) + /* Disable receive interrupts. */ + WR4(sc, ZY7_QSPI_INTR_DIS_REG, + ZY7_QSPI_INTR_RX_FIFO_NOT_EMPTY | + ZY7_QSPI_INTR_RX_OVERFLOW); + } + + /* + * Transmit underflows aren't really a bug because a hardware + * bug forces us to allow the tx fifo to go empty between full + * and partial fifo writes. Why bother counting? + */ + if ((istatus & ZY7_QSPI_INTR_TX_FIFO_UNDERFLOW) != 0) { + sc->tx_underflows++; + + /* Clear status bit. */ + WR4(sc, ZY7_QSPI_INTR_STAT_REG, + ZY7_QSPI_INTR_TX_FIFO_UNDERFLOW); + } + + /* Fill transmit fifo. */ + if (sc->tx_bytes_sent < sc->tx_bytes && + (istatus & ZY7_QSPI_INTR_TX_FIFO_NOT_FULL) != 0) { + zy7_qspi_write_fifo(sc, MIN(240, sc->tx_bytes - + sc->tx_bytes_sent)); + + if (sc->tx_bytes_sent == sc->tx_bytes) { + /* + * Disable transmit FIFO interrupt, enable receive + * FIFO interrupt. + */ + WR4(sc, ZY7_QSPI_INTR_DIS_REG, + ZY7_QSPI_INTR_TX_FIFO_NOT_FULL); + WR4(sc, ZY7_QSPI_INTR_EN_REG, + ZY7_QSPI_INTR_RX_FIFO_NOT_EMPTY); + } + } + + /* Finished with transfer? */ + if (sc->tx_bytes_sent == sc->tx_bytes && + sc->rx_bytes_rcvd == sc->rx_bytes) { + + /* De-assert CS. */ + sc->cfg_reg_shadow |= ZY7_QSPI_CONFIG_PCS; + WR4(sc, ZY7_QSPI_CONFIG_REG, sc->cfg_reg_shadow); + + wakeup(sc->dev); + } + + QSPI_SC_UNLOCK(sc); +} + +/* Initialize hardware. */ +static int +zy7_qspi_init_hw(struct zy7_qspi_softc *sc) +{ + uint32_t baud_div; + + /* Configure LQSPI Config register. Disable linear mode. */ + sc->lqspi_cfg_shadow = RD4(sc, ZY7_QSPI_LQSPI_CFG_REG); + sc->lqspi_cfg_shadow &= ~(ZY7_QSPI_LQSPI_CFG_LINEAR | + ZY7_QSPI_LQSPI_CFG_TWO_MEM | + ZY7_QSPI_LQSPI_CFG_SEP_BUS); + if (sc->is_dual) { + sc->lqspi_cfg_shadow |= ZY7_QSPI_LQSPI_CFG_TWO_MEM; + if (sc->is_stacked) { + sc->lqspi_cfg_shadow &= + ~ZY7_QSPI_LQSPI_CFG_INST_CODE_MASK; + sc->lqspi_cfg_shadow |= + ZY7_QSPI_LQSPI_CFG_INST_CODE(sc->is_dio ? + CMD_READ_DUAL_IO : CMD_READ_QUAD_OUTPUT); + } else + sc->lqspi_cfg_shadow |= ZY7_QSPI_LQSPI_CFG_SEP_BUS; + } + WR4(sc, ZY7_QSPI_LQSPI_CFG_REG, sc->lqspi_cfg_shadow); + + /* Find best clock divider. */ + baud_div = 0; + while ((sc->ref_clock >> (baud_div + 1)) > sc->spi_clock && + baud_div < 8) + baud_div++; + if (baud_div >= 8) { + device_printf(sc->dev, "cannot configure clock divider: ref=%d" + " spi=%d.\n", sc->ref_clock, sc->spi_clock); + return (EINVAL); + } + sc->spi_clk_real_freq = sc->ref_clock >> (baud_div + 1); + + /* + * If divider is 2 (the max speed), use internal loopback master + * clock for read data. (See section 12.3.1 in ref man.) + */ + if (baud_div == 0) + WR4(sc, ZY7_QSPI_LPBK_DLY_ADJ_REG, + ZY7_QSPI_LPBK_DLY_ADJ_USE_LPBK | + ZY7_QSPI_LPBK_DLY_ADJ_DLY1(0) | + ZY7_QSPI_LPBK_DLY_ADJ_DLY0(0)); + else + WR4(sc, ZY7_QSPI_LPBK_DLY_ADJ_REG, 0); + + /* Set up configuration register. */ + sc->cfg_reg_shadow = + ZY7_QSPI_CONFIG_IFMODE | + ZY7_QSPI_CONFIG_HOLDB_DR | + ZY7_QSPI_CONFIG_RSVD1 | + ZY7_QSPI_CONFIG_SSFORCE | + ZY7_QSPI_CONFIG_PCS | + ZY7_QSPI_CONFIG_FIFO_WIDTH32 | + ZY7_QSPI_CONFIG_BAUD_RATE_DIV(baud_div) | + ZY7_QSPI_CONFIG_MODE_SEL; + WR4(sc, ZY7_QSPI_CONFIG_REG, sc->cfg_reg_shadow); + + /* + * Set thresholds. We must use 1 for tx threshold because there + * is no fifo empty flag and we need one to implement a bug + * workaround. + */ + WR4(sc, ZY7_QSPI_TX_THRESH_REG, 1); + WR4(sc, ZY7_QSPI_RX_THRESH_REG, 1); + + /* Clear and disable all interrupts. */ + WR4(sc, ZY7_QSPI_INTR_STAT_REG, ~0); + WR4(sc, ZY7_QSPI_INTR_DIS_REG, ~0); + + /* Enable SPI. */ + WR4(sc, ZY7_QSPI_EN_REG, ZY7_SPI_ENABLE); + + return (0); +} + + +static void +zy7_qspi_add_sysctls(device_t dev) +{ + struct zy7_qspi_softc *sc = device_get_softc(dev); + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *child; + + ctx = device_get_sysctl_ctx(dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); + + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "spi_clk_real_freq", CTLFLAG_RD, + &sc->spi_clk_real_freq, 0, "SPI clock real frequency"); + + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rx_overflows", CTLFLAG_RD, + &sc->rx_overflows, 0, "RX FIFO overflow events"); + + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "tx_underflows", CTLFLAG_RD, + &sc->tx_underflows, 0, "TX FIFO underflow events"); + + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "interrupts", CTLFLAG_RD, + &sc->interrupts, 0, "interrupt calls"); + + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "stray_ints", CTLFLAG_RD, + &sc->stray_ints, 0, "stray interrupts"); +} + + +static int +zy7_qspi_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Zynq Quad-SPI Flash Controller"); + + return (BUS_PROBE_DEFAULT); +} + + +static int +zy7_qspi_attach(device_t dev) +{ + struct zy7_qspi_softc *sc; + int rid, err; + phandle_t node; + pcell_t cell; + + sc = device_get_softc(dev); + sc->dev = dev; + + QSPI_SC_LOCK_INIT(sc); + + /* Get ref-clock, spi-clock, and other properties. */ + node = ofw_bus_get_node(dev); + if (OF_getprop(node, "ref-clock", &cell, sizeof(cell)) > 0) + sc->ref_clock = fdt32_to_cpu(cell); + else { + device_printf(dev, "must have ref-clock property\n"); + return (ENXIO); + } + if (OF_getprop(node, "spi-clock", &cell, sizeof(cell)) > 0) + sc->spi_clock = fdt32_to_cpu(cell); + else + sc->spi_clock = ZY7_QSPI_DEFAULT_SPI_CLOCK; + if (OF_getprop(node, "is-stacked", &cell, sizeof(cell)) > 0 && + fdt32_to_cpu(cell) != 0) { + sc->is_dual = 1; + sc->is_stacked = 1; + } else if (OF_getprop(node, "is-dual", &cell, sizeof(cell)) > 0 && + fdt32_to_cpu(cell) != 0) + sc->is_dual = 1; + if (OF_getprop(node, "is-dio", &cell, sizeof(cell)) > 0 && + fdt32_to_cpu(cell) != 0) + sc->is_dio = 1; + + /* Get memory resource. */ + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->mem_res == NULL) { + device_printf(dev, "could not allocate memory resources.\n"); + zy7_qspi_detach(dev); + return (ENOMEM); + } + + /* Allocate IRQ. */ + rid = 0; + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (sc->irq_res == NULL) { + device_printf(dev, "could not allocate IRQ resource.\n"); + zy7_qspi_detach(dev); + return (ENOMEM); + } + + /* Activate the interrupt. */ + err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, zy7_qspi_intr, sc, &sc->intrhandle); + if (err) { + device_printf(dev, "could not setup IRQ.\n"); + zy7_qspi_detach(dev); + return (err); + } + + /* Configure the device. */ + err = zy7_qspi_init_hw(sc); + if (err) { + zy7_qspi_detach(dev); + return (err); + } + + sc->child = device_add_child(dev, "spibus", -1); + + zy7_qspi_add_sysctls(dev); + + /* Attach spibus driver as a child later when interrupts work. */ + config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); + + return (0); +} + +static int +zy7_qspi_detach(device_t dev) +{ + struct zy7_qspi_softc *sc = device_get_softc(dev); + + if (device_is_attached(dev)) + bus_generic_detach(dev); + + /* Delete child bus. */ + if (sc->child) + device_delete_child(dev, sc->child); + + /* Disable hardware. */ + if (sc->mem_res != NULL) { + /* Disable SPI. */ + WR4(sc, ZY7_QSPI_EN_REG, 0); + + /* Clear and disable all interrupts. */ + WR4(sc, ZY7_QSPI_INTR_STAT_REG, ~0); + WR4(sc, ZY7_QSPI_INTR_DIS_REG, ~0); + } + + /* Teardown and release interrupt. */ + if (sc->irq_res != NULL) { + if (sc->intrhandle) + bus_teardown_intr(dev, sc->irq_res, sc->intrhandle); + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(sc->irq_res), sc->irq_res); + } + + /* Release memory resource. */ + if (sc->mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, + rman_get_rid(sc->mem_res), sc->mem_res); + + QSPI_SC_LOCK_DESTROY(sc); + + return (0); +} + + +static phandle_t +zy7_qspi_get_node(device_t bus, device_t dev) +{ + + return (ofw_bus_get_node(bus)); +} + + +static int +zy7_qspi_transfer(device_t dev, device_t child, struct spi_command *cmd) +{ + struct zy7_qspi_softc *sc = device_get_softc(dev); + int err = 0; + + KASSERT(cmd->tx_cmd_sz == cmd->rx_cmd_sz, + ("TX/RX command sizes should be equal")); + KASSERT(cmd->tx_data_sz == cmd->rx_data_sz, + ("TX/RX data sizes should be equal")); + + if (sc->is_dual && cmd->tx_data_sz % 2 != 0) { + device_printf(dev, "driver does not support odd byte data " + "transfers in dual mode. (sz=%d)\n", cmd->tx_data_sz); + return (EINVAL); + } + + QSPI_SC_LOCK(sc); + + /* Wait for controller available. */ + while (sc->busy != 0) { + err = mtx_sleep(dev, &sc->sc_mtx, 0, "zqspi0", 0); + if (err) { + QSPI_SC_UNLOCK(sc); + return (err); + } + } + + /* Start transfer. */ + sc->busy = 1; + sc->cmd = cmd; + sc->tx_bytes = sc->cmd->tx_cmd_sz + sc->cmd->tx_data_sz; + sc->tx_bytes_sent = 0; + sc->rx_bytes = sc->cmd->rx_cmd_sz + sc->cmd->rx_data_sz; + sc->rx_bytes_rcvd = 0; + + /* Enable interrupts. zy7_qspi_intr() will handle transfer. */ + WR4(sc, ZY7_QSPI_INTR_EN_REG, + ZY7_QSPI_INTR_TX_FIFO_NOT_FULL | + ZY7_QSPI_INTR_RX_OVERFLOW); + +#ifdef SPI_XFER_U_PAGE /* XXX: future support for stacked memories. */ + if (sc->is_stacked) { + if ((cmd->flags & SPI_XFER_U_PAGE) != 0) + sc->lqspi_cfg_shadow |= ZY7_QSPI_LQSPI_CFG_U_PAGE; + else + sc->lqspi_cfg_shadow &= ~ZY7_QSPI_LQSPI_CFG_U_PAGE; + WR4(sc, ZY7_QSPI_LQSPI_CFG_REG, sc->lqspi_cfg_shadow); + } +#endif + + /* Assert CS. */ + sc->cfg_reg_shadow &= ~ZY7_QSPI_CONFIG_PCS; + WR4(sc, ZY7_QSPI_CONFIG_REG, sc->cfg_reg_shadow); + + /* Wait for completion. */ + err = mtx_sleep(dev, &sc->sc_mtx, 0, "zqspi1", hz * 2); + if (err) + zy7_qspi_abort_transfer(sc); + + /* Release controller. */ + sc->busy = 0; + wakeup_one(dev); + + QSPI_SC_UNLOCK(sc); + + return (err); +} + +static device_method_t zy7_qspi_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, zy7_qspi_probe), + DEVMETHOD(device_attach, zy7_qspi_attach), + DEVMETHOD(device_detach, zy7_qspi_detach), + + /* SPI interface */ + DEVMETHOD(spibus_transfer, zy7_qspi_transfer), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, zy7_qspi_get_node), + + DEVMETHOD_END +}; + + +static driver_t zy7_qspi_driver = { + "zy7_qspi", + zy7_qspi_methods, + sizeof(struct zy7_qspi_softc), +}; +static devclass_t zy7_qspi_devclass; + +DRIVER_MODULE(zy7_qspi, simplebus, zy7_qspi_driver, zy7_qspi_devclass, 0, 0); +DRIVER_MODULE(ofw_spibus, zy7_qspi, ofw_spibus_driver, ofw_spibus_devclass, 0, 0); +SIMPLEBUS_PNP_INFO(compat_data); +MODULE_DEPEND(zy7_qspi, ofw_spibus, 1, 1, 1); Modified: head/sys/dev/flash/mx25lreg.h ============================================================================== --- head/sys/dev/flash/mx25lreg.h Sun Jan 19 19:57:14 2020 (r356894) +++ head/sys/dev/flash/mx25lreg.h Sun Jan 19 20:04:44 2020 (r356895) @@ -42,6 +42,8 @@ #define CMD_WRITE_STATUS 0x01 #define CMD_READ 0x03 #define CMD_FAST_READ 0x0B +#define CMD_READ_DUAL_IO 0xBB +#define CMD_READ_QUAD_OUTPUT 0x6B #define CMD_PAGE_PROGRAM 0x02 #define CMD_SECTOR_ERASE 0xD8 #define CMD_BULK_ERASE 0xC7 Modified: head/sys/dts/arm/zedboard.dts ============================================================================== --- head/sys/dts/arm/zedboard.dts Sun Jan 19 19:57:14 2020 (r356894) +++ head/sys/dts/arm/zedboard.dts Sun Jan 19 20:04:44 2020 (r356895) @@ -60,6 +60,15 @@ status = "okay"; }; +&qspi0 { + status = "okay"; + + flash0 { + compatible = "st,m25p", "s25fl128"; + spi-chipselect = <0>; + }; +}; + &sdhci0 { status = "okay"; }; Modified: head/sys/dts/arm/zybo.dts ============================================================================== --- head/sys/dts/arm/zybo.dts Sun Jan 19 19:57:14 2020 (r356894) +++ head/sys/dts/arm/zybo.dts Sun Jan 19 20:04:44 2020 (r356895) @@ -60,6 +60,15 @@ status = "okay"; }; +&qspi0 { + status = "okay"; + + flash0 { + compatible = "st,m25p", "s25fl128"; + spi-chipselect = <0>; + }; +}; + &sdhci0 { status = "okay"; }; Modified: head/sys/dts/arm/zynq-7000.dtsi ============================================================================== --- head/sys/dts/arm/zynq-7000.dtsi Sun Jan 19 19:57:14 2020 (r356894) +++ head/sys/dts/arm/zynq-7000.dtsi Sun Jan 19 20:04:44 2020 (r356895) @@ -202,7 +202,8 @@ reg = <0xd000 0x1000>; interrupts = <0 19 4>; interrupt-parent = <&GIC>; - spi-clock = <50000000>; + ref-clock = <200000000>; // 200 Mhz + spi-clock = <50000000>; // 50 Mhz }; // SDIO controllers From owner-svn-src-all@freebsd.org Sun Jan 19 20:44:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A7892240CC; Sun, 19 Jan 2020 20:44:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4816Gj65tBz3Cbg; Sun, 19 Jan 2020 20:44:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 00JKhwYP090825 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 19 Jan 2020 22:44:01 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 00JKhwYP090825 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 00JKhvKA090824; Sun, 19 Jan 2020 22:43:57 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 19 Jan 2020 22:43:57 +0200 From: Konstantin Belousov To: Mateusz Guzik Cc: Warner Losh , src-committers , svn-src-all , svn-src-head@freebsd.org Subject: Re: svn commit: r356883 - head/sys/kern Message-ID: <20200119204357.GF4808@kib.kiev.ua> References: <202001191705.00JH5QRQ006755@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.3 X-Spam-Checker-Version: SpamAssassin 3.4.3 (2019-12-06) on tom.home X-Rspamd-Queue-Id: 4816Gj65tBz3Cbg X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all:c]; RCPT_COUNT_FIVE(0.00)[5]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(0.00)[ip: (-3.05), ipnet: 2001:470::/32(-4.66), asn: 6939(-3.57), country: US(-0.05)]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 20:44:15 -0000 On Sun, Jan 19, 2020 at 08:51:39PM +0100, Mateusz Guzik wrote: > On 1/19/20, Warner Losh wrote: > > On Sun, Jan 19, 2020, 10:05 AM Mateusz Guzik wrote: > > > >> Author: mjg > >> Date: Sun Jan 19 17:05:26 2020 > >> New Revision: 356883 > >> URL: https://svnweb.freebsd.org/changeset/base/356883 > >> > >> Log: > >> cache: counter_u64_add_protected -> counter_u64_add > >> > >> Fixes booting on RISC-V where it does happen to not be equivalent. > >> > > > > Any reason we can't just have a counter64 API that works the same both > > places rather than hiding what looks to my eye to be just that behind > > ifdefs in vfs_cache.c? > > > > Both as in 32 and 64-bit? > > Note the ifdef is there partially because the counter is not strictly > 64-bit but long, meaning 32 bit on i386 and the like. > > Should someone want to spend time implementing a 32-bit per-cpu counter, > they should start with implementing a new facility for counters which are > known to always be there (which is vast majority). They can be stored in > per-cpu area. > > Then the common case of just modifying the counter can compile to something > fast. For example on amd64 this can be one instruction which uses %gs and > an offset known at compilation time. > > In contrast counter(9) code explicitly allocates memory, meaning all > consumers have to deference a pointer. On top of that there is extra > computation to find the right address. This bit could be moved elsewhere > so that the stored address already has it in, but the fundamental differnce > remains. This rant is unrelated to the point of Warner' followup. > > This plus maintaining coherent 64-bit counters requires extra provisions > on 32-bit architectures, which could also be avoided for numcachehv. If you want a facility that does long counting, then implement it, instead of making un unrelated code of maze of non-reasonable ifdefs. In fact, I would undertand the argument that counter(9) on all existing 32bit platforms should be just atomic_add_long(9) without any per-cpu complications. But again, this should be in counters code and not in the VFS. Please either use counter(9) for all arches, or atomic long, until such hypothetical long counters facility is implemented. From owner-svn-src-all@freebsd.org Sun Jan 19 21:17:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D34F225762; Sun, 19 Jan 2020 21:17: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 48171d75kdz3GCc; Sun, 19 Jan 2020 21:17:57 +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 EEEC31920E; Sun, 19 Jan 2020 21:17:57 +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 00JLHvxL057449; Sun, 19 Jan 2020 21:17:57 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00JLHvli057448; Sun, 19 Jan 2020 21:17:57 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202001192117.00JLHvli057448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 19 Jan 2020 21:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356896 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 356896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 21:17:58 -0000 Author: jhibbits Date: Sun Jan 19 21:17:57 2020 New Revision: 356896 URL: https://svnweb.freebsd.org/changeset/base/356896 Log: [PowerPC64] fix crash when using machdep.moea64_bpvo_pool_size tunable Summary: This fixes kernel crashing when tunable "machdep.moea64_bpvo_pool_size" is set to a value higher then 327680 (default value). Function moea64_mid_bootstrap() relies on moea64_bpvo_pool_size, but at time of the use the variable wan't yet updated with the new value provided by user. Problem was detected after trying to use a VM with 64GB of RAM, and default moea64_bpvo_pool_size is insufficient (kernel boot used more than 470000) . I think default value must be discussed to address this use case, or find a way to calculate pool size automatically based on amount of memory detected. Test Plan: Tested on QEMU VM with 64GB of RAM using "set machdep.moea64_bpvo_pool_size=655360" on loader prompt Submitted by: Alfredo Dal'Ava JĂşnior (alfredo.junior_eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D23233 Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sun Jan 19 20:04:44 2020 (r356895) +++ head/sys/powerpc/aim/mmu_oea64.c Sun Jan 19 21:17:57 2020 (r356896) @@ -185,7 +185,6 @@ uma_zone_t moea64_pvo_zone; /* zone for pvo entries */ static struct pvo_entry *moea64_bpvo_pool; static int moea64_bpvo_pool_index = 0; static int moea64_bpvo_pool_size = 327680; -TUNABLE_INT("machdep.moea64_bpvo_pool_size", &moea64_bpvo_pool_size); SYSCTL_INT(_machdep, OID_AUTO, moea64_allocated_bpvo_entries, CTLFLAG_RD, &moea64_bpvo_pool_index, 0, ""); @@ -390,9 +389,11 @@ alloc_pvo_entry(int bootstrap) if (!moea64_initialized || bootstrap) { if (moea64_bpvo_pool_index >= moea64_bpvo_pool_size) { - panic("moea64_enter: bpvo pool exhausted, %d, %d, %zd", - moea64_bpvo_pool_index, moea64_bpvo_pool_size, - moea64_bpvo_pool_size * sizeof(struct pvo_entry)); + panic("%s: bpvo pool exhausted, index=%d, size=%d, bytes=%zd." + "Try setting machdep.moea64_bpvo_pool_size tunable", + __func__, moea64_bpvo_pool_index, + moea64_bpvo_pool_size, + moea64_bpvo_pool_size * sizeof(struct pvo_entry)); } pvo = &moea64_bpvo_pool[ atomic_fetchadd_int(&moea64_bpvo_pool_index, 1)]; @@ -914,6 +915,7 @@ moea64_mid_bootstrap(mmu_t mmup, vm_offset_t kernelsta /* * Initialise the bootstrap pvo pool. */ + TUNABLE_INT_FETCH("machdep.moea64_bpvo_pool_size", &moea64_bpvo_pool_size); moea64_bpvo_pool = (struct pvo_entry *)moea64_bootstrap_alloc( moea64_bpvo_pool_size*sizeof(struct pvo_entry), PAGE_SIZE); moea64_bpvo_pool_index = 0; From owner-svn-src-all@freebsd.org Sun Jan 19 21:35:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6AE80225CA4; Sun, 19 Jan 2020 21:35:52 +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 4817QJ29P3z3H1g; Sun, 19 Jan 2020 21:35:52 +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 45C79195C5; Sun, 19 Jan 2020 21:35:52 +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 00JLZq9X069236; Sun, 19 Jan 2020 21:35:52 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00JLZqvE069235; Sun, 19 Jan 2020 21:35:52 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001192135.00JLZqvE069235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 19 Jan 2020 21:35:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356897 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 356897 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 21:35:52 -0000 Author: mjg Date: Sun Jan 19 21:35:51 2020 New Revision: 356897 URL: https://svnweb.freebsd.org/changeset/base/356897 Log: x86: fix assertion in ipi_send_cpu to range check the passed id Prior to the change for sufficiently bad id (and in particular NOCPU which is -1) it would access memory outside of the cpu_apic_ids array. Modified: head/sys/x86/x86/mp_x86.c Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Sun Jan 19 21:17:57 2020 (r356896) +++ head/sys/x86/x86/mp_x86.c Sun Jan 19 21:35:51 2020 (r356897) @@ -1233,7 +1233,8 @@ ipi_send_cpu(int cpu, u_int ipi) u_int bitmap, old, new; u_int *cpu_bitmap; - KASSERT(cpu_apic_ids[cpu] != -1, ("IPI to non-existent CPU %d", cpu)); + KASSERT((u_int)cpu < MAXCPU && cpu_apic_ids[cpu] != -1, + ("IPI to non-existent CPU %d", cpu)); if (IPI_IS_BITMAPED(ipi)) { bitmap = 1 << ipi; From owner-svn-src-all@freebsd.org Sun Jan 19 21:41:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 63301225F3F; Sun, 19 Jan 2020 21:41:35 +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 4817Xv1KvDz3HFC; Sun, 19 Jan 2020 21:41:35 +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 248681962F; Sun, 19 Jan 2020 21:41:35 +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 00JLfZTW072743; Sun, 19 Jan 2020 21:41:35 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00JLfZmq072742; Sun, 19 Jan 2020 21:41:35 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001192141.00JLfZmq072742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 19 Jan 2020 21:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356898 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356898 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 21:41:35 -0000 Author: mjg Date: Sun Jan 19 21:41:34 2020 New Revision: 356898 URL: https://svnweb.freebsd.org/changeset/base/356898 Log: vfs: switch vop_stdunlock to call lockmgr_unlock Since the flags argument is now alawys 0 the new call provides the same behavior. Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Sun Jan 19 21:35:51 2020 (r356897) +++ head/sys/kern/vfs_default.c Sun Jan 19 21:41:34 2020 (r356898) @@ -526,7 +526,7 @@ vop_stdunlock(ap) { struct vnode *vp = ap->a_vp; - return (lockmgr_unlock_fast_path(vp->v_vnlock, 0, NULL)); + return (lockmgr_unlock(vp->v_vnlock)); } /* See above. */ From owner-svn-src-all@freebsd.org Sun Jan 19 21:43:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8459E22606C; Sun, 19 Jan 2020 21:43:16 +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 4817Zr2lQVz3Hb7; Sun, 19 Jan 2020 21:43:16 +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 598C719794; Sun, 19 Jan 2020 21:43:16 +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 00JLhGnm075162; Sun, 19 Jan 2020 21:43:16 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00JLhFvo075159; Sun, 19 Jan 2020 21:43:15 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202001192143.00JLhFvo075159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 19 Jan 2020 21:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356899 - in head/sys: conf powerpc/amigaone X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys: conf powerpc/amigaone X-SVN-Commit-Revision: 356899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 21:43:16 -0000 Author: jhibbits Date: Sun Jan 19 21:43:15 2020 New Revision: 356899 URL: https://svnweb.freebsd.org/changeset/base/356899 Log: PowerPC: Add CPLD driver for AmigaOne X5000 Summary: The CPLD is the communications medium between the CPU and the XMOS "Xena" event coprocessor. It provides a mailbox communication feature, along with dual-port RAM to be used between the CPU and XMOS. Also, it provides basic board stats as well, such as PCIe presence, JTAG signals, and CPU fan speed reporting (in revolutions per second). Only fan speed reading is handled, as a sysctl. Reviewed by: bdragon Differential Revision: https://reviews.freebsd.org/D23136 Added: head/sys/powerpc/amigaone/cpld.h (contents, props changed) head/sys/powerpc/amigaone/cpld_x5000.c (contents, props changed) Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sun Jan 19 21:41:34 2020 (r356898) +++ head/sys/conf/files.powerpc Sun Jan 19 21:43:15 2020 (r356899) @@ -107,6 +107,7 @@ powerpc/aim/moea64_native.c optional aim powerpc/aim/mp_cpudep.c optional aim powerpc/aim/slb.c optional aim powerpc64 powerpc/amigaone/platform_amigaone.c optional amigaone +powerpc/amigaone/cpld_x5000.c optional powerpc amigaone | powerpc64 amigaone powerpc/booke/locore.S optional booke no-obj powerpc/booke/booke_machdep.c optional booke powerpc/booke/machdep_e500.c optional booke_e500 Added: head/sys/powerpc/amigaone/cpld.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/amigaone/cpld.h Sun Jan 19 21:43:15 2020 (r356899) @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2020 Justin Hibbits + * + * 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$ + */ + +#ifndef AMIGAONE_CPLD_H +#define AMIGAONE_CPLD_H + +#include + +/* + * Write 'words' to 'offset' offset in dual-port RAM, then write cmd to mailbox. + */ +struct cpld_cmd_data { + unsigned int cmd; + unsigned int len; + unsigned int offset; + void *words; +}; + +#define IOCCPLDSEND _IOW('c', 2, struct cpld_cmd_data) +#define IOCCPLDRECV _IOW('c', 3, struct cpld_cmd_data) + +#endif /* AMIGAONE_CPLD_H */ Added: head/sys/powerpc/amigaone/cpld_x5000.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/amigaone/cpld_x5000.c Sun Jan 19 21:43:15 2020 (r356899) @@ -0,0 +1,335 @@ +/*- + * Copyright (c) 2020 Justin Hibbits + * + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include "cpld.h" + +/* + * A driver for the AmigaOne X5000 "Cyrus+" CPLD. + * + * This is the interface between the CPU and the "Xena" (XMOS) chip. Since the + * XMOS is programmable via a SPI-attached flash memory, there's no direct + * driver written for the Xena attachment. Instead, a userspace process would + * communicate with the Xena by issuing ioctl()s to this CPLD. + */ + +/* Resource access addresses. */ +#define CPLD_MEM_ADDR 0x0000 +#define CPLD_MEM_DATA 0x8000 + +#define CPLD_MAX_DRAM_WORDS 0x800 + +/* CPLD Registers. */ +#define CPLD_REG_SIG1 0x00 +#define CPLD_REG_SIG2 0x01 +#define CPLD_REG_HWREV 0x02 +#define CPLD_REG_MBC2X 0x05 +#define CPLD_REG_MBX2C 0x06 +#define CPLD_REG_XDEBUG 0x0c +#define CPLD_REG_XJTAG 0x0d +#define CPLD_REG_FAN_TACHO 0x10 +#define CPLD_REG_DATE_LW 0x21 +#define CPLD_REG_DATE_UW 0x22 +#define CPLD_REG_TIME_LW 0x23 +#define CPLD_REG_TIME_UW 0x24 +#define CPLD_REG_SCR1 0x30 +#define CPLD_REG_SCR2 0x31 +#define CPLD_REG_RAM 0x8000 + +struct cpld_softc { + device_t sc_dev; + struct resource *sc_mem; + struct cdev *sc_cdev; + struct mtx sc_mutex; + bool sc_isopen; +}; + +static d_open_t cpld_open; +static d_close_t cpld_close; +static d_ioctl_t cpld_ioctl; + +static struct cdevsw cpld_cdevsw = { + .d_version = D_VERSION, + .d_open = cpld_open, + .d_close = cpld_close, + .d_ioctl = cpld_ioctl, + .d_name = "nvram", +}; + +static device_probe_t cpld_probe; +static device_attach_t cpld_attach; +static int cpld_fan_sysctl(SYSCTL_HANDLER_ARGS); + +static device_method_t cpld_methods[] = { + DEVMETHOD(device_probe, cpld_probe), + DEVMETHOD(device_attach, cpld_attach), + + DEVMETHOD_END +}; + +static driver_t cpld_driver = { + "cpld", + cpld_methods, + sizeof(struct cpld_softc) +}; + +static devclass_t cpld_devclass; +DRIVER_MODULE(cpld, lbc, cpld_driver, cpld_devclass, 0, 0); + +static void +cpld_write(struct cpld_softc *sc, int addr, int data) +{ + bus_write_2(sc->sc_mem, CPLD_MEM_ADDR, addr); + bus_write_2(sc->sc_mem, CPLD_MEM_DATA, data); +} + +static int +cpld_read(struct cpld_softc *sc, int addr) +{ + bus_write_2(sc->sc_mem, CPLD_MEM_ADDR, addr); + + return (bus_read_2(sc->sc_mem, CPLD_MEM_DATA)); +} + +static int +cpld_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "aeon,cyrus-cpld")) + return (ENXIO); + + device_set_desc(dev, "AmigaOne Cyrus CPLD"); + + return (BUS_PROBE_GENERIC); +} + +static int +cpld_attach(device_t dev) +{ + struct make_dev_args mda; + struct cpld_softc *sc; + int rid; + int date, time, tmp; + int err; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + rid = 0; + sc->sc_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE|RF_SHAREABLE); + if (sc->sc_mem == NULL) { + device_printf(dev, "Unable to allocate memory resource.\n"); + return (ENXIO); + } + mtx_init(&sc->sc_mutex, "cpld", NULL, MTX_DEF); + date = (cpld_read(sc, CPLD_REG_DATE_UW) << 16) | + cpld_read(sc, CPLD_REG_DATE_LW); + time = (cpld_read(sc, CPLD_REG_TIME_UW) << 16) | + cpld_read(sc, CPLD_REG_TIME_LW); + + device_printf(dev, "Build date: %04x-%02x-%02x\n", (date >> 16) & 0xffff, + (date >> 8) & 0xff, date & 0xff); + device_printf(dev, "Build time: %02x:%02x:%02x\n", (time >> 16) & 0xff, + (time >> 8) & 0xff, time & 0xff); + + tmp = cpld_read(sc, CPLD_REG_HWREV); + device_printf(dev, "Hardware revision: %d\n", tmp); + + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); + + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "cpu_fan", CTLTYPE_INT | CTLFLAG_RD, sc, 0, + cpld_fan_sysctl, "I", "CPU Fan speed in RPM"); + + make_dev_args_init(&mda); + mda.mda_flags = MAKEDEV_CHECKNAME; + mda.mda_devsw = &cpld_cdevsw; + mda.mda_uid = UID_ROOT; + mda.mda_gid = GID_WHEEL; + mda.mda_mode = 0660; + mda.mda_si_drv1 = sc; + err = make_dev_s(&mda, &sc->sc_cdev, "cpld"); + if (err != 0) { + device_printf(dev, "Error creating character device: %d\n", err); + device_printf(dev, "Only sysctl interfaces will be available.\n"); + } + + return (0); +} + +static int +cpld_fan_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct cpld_softc *sc; + int error, old, rpm; + + sc = arg1; + mtx_lock(&sc->sc_mutex); + /* Read until we get some level of read stability. */ + rpm = cpld_read(sc, CPLD_REG_FAN_TACHO); + do { + old = rpm; + rpm = cpld_read(sc, CPLD_REG_FAN_TACHO); + } while (abs(rpm - old) > 10); + mtx_unlock(&sc->sc_mutex); + + /* Convert RPS->RPM. */ + rpm *= 60; + error = sysctl_handle_int(oidp, &rpm, 0, req); + + return (error); +} + +static int +cpld_open(struct cdev *dev, int flags, int fmt, struct thread *td) +{ + struct cpld_softc *sc = dev->si_drv1; + + if (sc->sc_isopen) + return (EBUSY); + sc->sc_isopen = 1; + return (0); +} + +static int +cpld_close(struct cdev *dev, int fflag, int devtype, struct thread *td) +{ + struct cpld_softc *sc = dev->si_drv1; + + sc->sc_isopen = 0; + return (0); +} + +static int +cpld_send(device_t dev, struct cpld_cmd_data *d) +{ + struct cpld_softc *sc; + uint16_t *word; + int i; + + if (d->cmd > USHRT_MAX) + return (EINVAL); + + sc = device_get_softc(dev); + + mtx_lock(&sc->sc_mutex); + for (i = 0, word = d->words; i < d->len; i++, word++) { + if (i == 0) + cpld_write(sc, CPLD_REG_RAM, *word); + else + bus_write_4(sc->sc_mem, CPLD_MEM_DATA, *word); + } + + cpld_write(sc, CPLD_REG_MBC2X, d->cmd); + mtx_unlock(&sc->sc_mutex); + + return (0); +} + +static int +cpld_recv(device_t dev, struct cpld_cmd_data *d) +{ + struct cpld_softc *sc; + uint16_t *word; + int i; + + sc = device_get_softc(dev); + + mtx_lock(&sc->sc_mutex); + d->cmd = cpld_read(sc, CPLD_REG_MBX2C); + + for (i = 0, word = d->words; i < d->len; i++, word++) { + if (i == 0) + *word = cpld_read(sc, CPLD_REG_RAM); + else + *word = bus_read_4(sc->sc_mem, CPLD_MEM_DATA); + } + mtx_unlock(&sc->sc_mutex); + + return (0); +} + +static int +cpld_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) +{ + struct cpld_softc *sc; + struct cpld_cmd_data *d; + void *xfer_data, *tmp; + int err; + + sc = dev->si_drv1; + + err = 0; + d = (struct cpld_cmd_data *)data; + if (d->len + d->offset > CPLD_MAX_DRAM_WORDS) { + return (EINVAL); + } + xfer_data = malloc(d->len * sizeof(uint16_t), M_TEMP, M_WAITOK); + + switch (cmd) { + case IOCCPLDSEND: + err = copyin(d->words, xfer_data, d->len * sizeof(uint16_t)); + d->words = xfer_data; + if (err == 0) + err = cpld_send(sc->sc_dev, d); + break; + case IOCCPLDRECV: + tmp = d->words; + d->words = xfer_data; + err = cpld_recv(sc->sc_dev, d); + d->words = tmp; + if (err == 0) + err = copyout(xfer_data, d->words, + d->len * sizeof(uint16_t)); + break; + default: + err = ENOTTY; + break; + } + free(xfer_data, M_TEMP); + + return (err); +} From owner-svn-src-all@freebsd.org Sun Jan 19 22:29:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CDB20226BD4; Sun, 19 Jan 2020 22:29:22 +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 4818c256jWz3KLG; Sun, 19 Jan 2020 22:29:22 +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 AAD5919EEE; Sun, 19 Jan 2020 22:29:22 +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 00JMTMVq099492; Sun, 19 Jan 2020 22:29:22 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00JMTMxm099491; Sun, 19 Jan 2020 22:29:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001192229.00JMTMxm099491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 19 Jan 2020 22:29:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356900 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 356900 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 22:29:22 -0000 Author: emaste Date: Sun Jan 19 22:29:22 2020 New Revision: 356900 URL: https://svnweb.freebsd.org/changeset/base/356900 Log: Cirrus-CI: add `make packages` to CI test Now that we can override the format to avoid the time spent compressing pkgbase packages we can test `make packages` with only 5 minutes or so added to the CI cycle time. A future change should switch the CI smoke test to using these packages. Sponsored by: The FreeBSD Foundation Modified: head/.cirrus.yml Modified: head/.cirrus.yml ============================================================================== --- head/.cirrus.yml Sun Jan 19 21:43:15 2020 (r356899) +++ head/.cirrus.yml Sun Jan 19 22:29:22 2020 (r356900) @@ -14,5 +14,7 @@ task: - pkg install -y qemu-devel uefi-edk2-qemu-x86_64 script: - make -j$(sysctl -n hw.ncpu) WITHOUT_TOOLCHAIN=yes buildworld buildkernel + package_script: + - make WITHOUT_TOOLCHAIN=yes PKG_FORMAT=tar packages test_script: - sh tools/boot/ci-qemu-test.sh From owner-svn-src-all@freebsd.org Sun Jan 19 22:52:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8260622736E; Sun, 19 Jan 2020 22:52:37 +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 48196s30F9z3LK2; Sun, 19 Jan 2020 22:52:37 +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 620F41A476; Sun, 19 Jan 2020 22:52:37 +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 00JMqb04017103; Sun, 19 Jan 2020 22:52:37 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00JMqb3c017102; Sun, 19 Jan 2020 22:52:37 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001192252.00JMqb3c017102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sun, 19 Jan 2020 22:52:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356901 - head/sys/dev/mps X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/mps X-SVN-Commit-Revision: 356901 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 22:52:37 -0000 Author: cem Date: Sun Jan 19 22:52:36 2020 New Revision: 356901 URL: https://svnweb.freebsd.org/changeset/base/356901 Log: mps(4): add missing cam(4) dependency On a MINIMAL kernel, mps.ko wouldn't load because it uses the xpt_hold_boot symbol from CAM, but didn't have a dependency on cam(4). (CEM: Some context: when linking loaded modules, the kernel dynamic linker only looks for definitions in explictly marked dependency modules. Also, the identical mpr(4) driver uses the same CAM function, but already had the correct MODULE_DEPEND(), so no similar change is needed there.) Submitted by: Greg V Reviewed by: imp, myself Differential Revision: https://reviews.freebsd.org/D23272 Modified: head/sys/dev/mps/mps_pci.c Modified: head/sys/dev/mps/mps_pci.c ============================================================================== --- head/sys/dev/mps/mps_pci.c Sun Jan 19 22:29:22 2020 (r356900) +++ head/sys/dev/mps/mps_pci.c Sun Jan 19 22:52:36 2020 (r356901) @@ -145,6 +145,7 @@ struct mps_ident { static devclass_t mps_devclass; DRIVER_MODULE(mps, pci, mps_pci_driver, mps_devclass, 0, 0); +MODULE_DEPEND(mps, cam, 1, 1, 1); MODULE_PNP_INFO("U16:vendor;U16:device;U16:subvendor;U16:subdevice", pci, mps, mps_identifiers, nitems(mps_identifiers) - 1); static struct mps_ident * From owner-svn-src-all@freebsd.org Sun Jan 19 23:47:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4A81227F86; Sun, 19 Jan 2020 23:47:35 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 481BLH6F4xz3NFD; Sun, 19 Jan 2020 23:47:35 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCF011ADA0; Sun, 19 Jan 2020 23:47:35 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00JNlZ4F046427; Sun, 19 Jan 2020 23:47:35 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00JNlWMN046412; Sun, 19 Jan 2020 23:47:32 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001192347.00JNlWMN046412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 19 Jan 2020 23:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356902 - in head/sys: dev/md fs/tmpfs kern vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: dev/md fs/tmpfs kern vm X-SVN-Commit-Revision: 356902 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2020 23:47:36 -0000 Author: jeff Date: Sun Jan 19 23:47:32 2020 New Revision: 356902 URL: https://svnweb.freebsd.org/changeset/base/356902 Log: Don't hold the object lock while calling getpages. The vnode pager does not want the object lock held. Moving this out allows further object lock scope reduction in callers. While here add some missing paging in progress calls and an assert. The object handle is now protected explicitly with pip. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D23033 Modified: head/sys/dev/md/md.c head/sys/fs/tmpfs/tmpfs_subr.c head/sys/kern/kern_sendfile.c head/sys/kern/uipc_shm.c head/sys/vm/device_pager.c head/sys/vm/phys_pager.c head/sys/vm/sg_pager.c head/sys/vm/swap_pager.c head/sys/vm/vm_fault.c head/sys/vm/vm_object.h head/sys/vm/vm_page.c head/sys/vm/vm_pager.c head/sys/vm/vm_swapout.c head/sys/vm/vnode_pager.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Sun Jan 19 22:52:36 2020 (r356901) +++ head/sys/dev/md/md.c Sun Jan 19 23:47:32 2020 (r356902) @@ -1057,11 +1057,12 @@ mdstart_swap(struct md_s *sc, struct bio *bp) lastend = (bp->bio_offset + bp->bio_length - 1) % PAGE_SIZE + 1; rv = VM_PAGER_OK; - VM_OBJECT_WLOCK(sc->object); vm_object_pip_add(sc->object, 1); for (i = bp->bio_offset / PAGE_SIZE; i <= lastp; i++) { len = ((i == lastp) ? lastend : PAGE_SIZE) - offs; + VM_OBJECT_WLOCK(sc->object); m = vm_page_grab(sc->object, i, VM_ALLOC_SYSTEM); + VM_OBJECT_WUNLOCK(sc->object); if (bp->bio_cmd == BIO_READ) { if (vm_page_all_valid(m)) rv = VM_PAGER_OK; @@ -1069,7 +1070,9 @@ mdstart_swap(struct md_s *sc, struct bio *bp) rv = vm_pager_get_pages(sc->object, &m, 1, NULL, NULL); if (rv == VM_PAGER_ERROR) { + VM_OBJECT_WLOCK(sc->object); vm_page_free(m); + VM_OBJECT_WUNLOCK(sc->object); break; } else if (rv == VM_PAGER_FAIL) { /* @@ -1099,7 +1102,9 @@ mdstart_swap(struct md_s *sc, struct bio *bp) rv = vm_pager_get_pages(sc->object, &m, 1, NULL, NULL); if (rv == VM_PAGER_ERROR) { + VM_OBJECT_WLOCK(sc->object); vm_page_free(m); + VM_OBJECT_WUNLOCK(sc->object); break; } else if (rv == VM_PAGER_FAIL) pmap_zero_page(m); @@ -1122,8 +1127,10 @@ mdstart_swap(struct md_s *sc, struct bio *bp) else rv = vm_pager_get_pages(sc->object, &m, 1, NULL, NULL); + VM_OBJECT_WLOCK(sc->object); if (rv == VM_PAGER_ERROR) { vm_page_free(m); + VM_OBJECT_WUNLOCK(sc->object); break; } else if (rv == VM_PAGER_FAIL) { vm_page_free(m); @@ -1139,6 +1146,7 @@ mdstart_swap(struct md_s *sc, struct bio *bp) m = NULL; } } + VM_OBJECT_WUNLOCK(sc->object); } if (m != NULL) { vm_page_xunbusy(m); @@ -1160,7 +1168,6 @@ mdstart_swap(struct md_s *sc, struct bio *bp) ma_offs += len; } vm_object_pip_wakeup(sc->object); - VM_OBJECT_WUNLOCK(sc->object); return (rv != VM_PAGER_ERROR ? 0 : ENOSPC); } Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Sun Jan 19 22:52:36 2020 (r356901) +++ head/sys/fs/tmpfs/tmpfs_subr.c Sun Jan 19 23:47:32 2020 (r356902) @@ -1480,8 +1480,12 @@ retry: VM_ALLOC_WAITFAIL); if (m == NULL) goto retry; + vm_object_pip_add(uobj, 1); + VM_OBJECT_WUNLOCK(uobj); rv = vm_pager_get_pages(uobj, &m, 1, NULL, NULL); + VM_OBJECT_WLOCK(uobj); + vm_object_pip_wakeup(uobj); if (rv == VM_PAGER_OK) { /* * Since the page was not resident, Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Sun Jan 19 22:52:36 2020 (r356901) +++ head/sys/kern/kern_sendfile.c Sun Jan 19 23:47:32 2020 (r356902) @@ -89,6 +89,7 @@ struct sf_io { int npages; struct socket *so; struct mbuf *m; + vm_object_t obj; #ifdef KERN_TLS struct ktls_session *tls; #endif @@ -269,6 +270,8 @@ sendfile_iodone(void *arg, vm_page_t *pg, int count, i if (!refcount_release(&sfio->nios)) return; + vm_object_pip_wakeup(sfio->obj); + if (__predict_false(sfio->error && sfio->m == NULL)) { /* * I/O operation failed, but pru_send hadn't been executed - @@ -421,9 +424,11 @@ sendfile_swapin(vm_object_t obj, struct sf_io *sfio, i } refcount_acquire(&sfio->nios); + VM_OBJECT_WUNLOCK(obj); rv = vm_pager_get_pages_async(obj, pa + i, count, NULL, i + count == npages ? &rhpages : NULL, &sendfile_iodone, sfio); + VM_OBJECT_WLOCK(obj); if (__predict_false(rv != VM_PAGER_OK)) { /* * Perform full pages recovery before returning EIO. @@ -815,7 +820,9 @@ retry_space: npages * sizeof(vm_page_t), M_TEMP, M_WAITOK); refcount_init(&sfio->nios, 1); sfio->so = so; + sfio->obj = obj; sfio->error = 0; + vm_object_pip_add(obj, 1); #ifdef KERN_TLS /* @@ -1053,6 +1060,7 @@ prepend_header: * we can send data right now without the * PRUS_NOTREADY flag. */ + vm_object_pip_wakeup(sfio->obj); free(sfio, M_TEMP); #ifdef KERN_TLS if (tls != NULL && tls->mode == TCP_TLS_MODE_SW) { Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Sun Jan 19 22:52:36 2020 (r356901) +++ head/sys/kern/uipc_shm.c Sun Jan 19 23:47:32 2020 (r356902) @@ -504,8 +504,12 @@ retry: VM_ALLOC_NORMAL | VM_ALLOC_WAITFAIL); if (m == NULL) goto retry; + vm_object_pip_add(object, 1); + VM_OBJECT_WUNLOCK(object); rv = vm_pager_get_pages(object, &m, 1, NULL, NULL); + VM_OBJECT_WLOCK(object); + vm_object_pip_wakeup(object); if (rv == VM_PAGER_OK) { /* * Since the page was not resident, Modified: head/sys/vm/device_pager.c ============================================================================== --- head/sys/vm/device_pager.c Sun Jan 19 22:52:36 2020 (r356901) +++ head/sys/vm/device_pager.c Sun Jan 19 23:47:32 2020 (r356902) @@ -289,9 +289,9 @@ dev_pager_getpages(vm_object_t object, vm_page_t *ma, /* Since our haspage reports zero after/before, the count is 1. */ KASSERT(count == 1, ("%s: count %d", __func__, count)); - VM_OBJECT_ASSERT_WLOCKED(object); if (object->un_pager.devp.ops->cdev_pg_fault == NULL) return (VM_PAGER_FAIL); + VM_OBJECT_WLOCK(object); error = object->un_pager.devp.ops->cdev_pg_fault(object, IDX_TO_OFF(ma[0]->pindex), PROT_READ, &ma[0]); @@ -312,6 +312,7 @@ dev_pager_getpages(vm_object_t object, vm_page_t *ma, if (rahead) *rahead = 0; } + VM_OBJECT_WUNLOCK(object); return (error); } Modified: head/sys/vm/phys_pager.c ============================================================================== --- head/sys/vm/phys_pager.c Sun Jan 19 22:52:36 2020 (r356901) +++ head/sys/vm/phys_pager.c Sun Jan 19 23:47:32 2020 (r356902) @@ -143,7 +143,6 @@ phys_pager_getpages(vm_object_t object, vm_page_t *m, { int i; - VM_OBJECT_ASSERT_WLOCKED(object); for (i = 0; i < count; i++) { if (vm_page_none_valid(m[i])) { if ((m[i]->flags & PG_ZERO) == 0) Modified: head/sys/vm/sg_pager.c ============================================================================== --- head/sys/vm/sg_pager.c Sun Jan 19 22:52:36 2020 (r356901) +++ head/sys/vm/sg_pager.c Sun Jan 19 23:47:32 2020 (r356902) @@ -155,10 +155,9 @@ sg_pager_getpages(vm_object_t object, vm_page_t *m, in /* Since our haspage reports zero after/before, the count is 1. */ KASSERT(count == 1, ("%s: count %d", __func__, count)); - VM_OBJECT_ASSERT_WLOCKED(object); + /* Handle is stable while paging is in progress. */ sg = object->handle; memattr = object->memattr; - VM_OBJECT_WUNLOCK(object); offset = m[0]->pindex; /* @@ -196,6 +195,7 @@ sg_pager_getpages(vm_object_t object, vm_page_t *m, in VM_OBJECT_WLOCK(object); TAILQ_INSERT_TAIL(&object->un_pager.sgp.sgp_pglist, page, plinks.q); vm_page_replace(page, object, offset, m[0]); + VM_OBJECT_WUNLOCK(object); m[0] = page; vm_page_valid(page); Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Sun Jan 19 22:52:36 2020 (r356901) +++ head/sys/vm/swap_pager.c Sun Jan 19 23:47:32 2020 (r356902) @@ -1197,12 +1197,15 @@ swap_pager_getpages(vm_object_t object, vm_page_t *ma, daddr_t blk; int i, maxahead, maxbehind, reqcount; + VM_OBJECT_WLOCK(object); reqcount = count; KASSERT(object->type == OBJT_SWAP, ("%s: object not swappable", __func__)); - if (!swap_pager_haspage(object, ma[0]->pindex, &maxbehind, &maxahead)) + if (!swap_pager_haspage(object, ma[0]->pindex, &maxbehind, &maxahead)) { + VM_OBJECT_WUNLOCK(object); return (VM_PAGER_FAIL); + } KASSERT(reqcount - 1 <= maxahead, ("page count %d extends beyond swap block", reqcount)); @@ -1319,6 +1322,7 @@ swap_pager_getpages(vm_object_t object, vm_page_t *ma, * is set in the metadata for each page in the request. */ VM_OBJECT_WLOCK(object); + /* This could be implemented more efficiently with aflags */ while ((ma[0]->oflags & VPO_SWAPINPROG) != 0) { ma[0]->oflags |= VPO_SWAPSLEEP; VM_CNT_INC(v_intrans); @@ -1329,6 +1333,7 @@ swap_pager_getpages(vm_object_t object, vm_page_t *ma, bp->b_bufobj, (intmax_t)bp->b_blkno, bp->b_bcount); } } + VM_OBJECT_WUNLOCK(object); /* * If we had an unrecoverable read error pages will not be valid. @@ -1360,7 +1365,6 @@ swap_pager_getpages_async(vm_object_t object, vm_page_ int r, error; r = swap_pager_getpages(object, ma, count, rbehind, rahead); - VM_OBJECT_WUNLOCK(object); switch (r) { case VM_PAGER_OK: error = 0; @@ -1375,7 +1379,6 @@ swap_pager_getpages_async(vm_object_t object, vm_page_ panic("unhandled swap_pager_getpages() error %d", r); } (iodone)(arg, ma, count, error); - VM_OBJECT_WLOCK(object); return (r); } @@ -1756,10 +1759,12 @@ swp_pager_force_pagein(vm_object_t object, vm_pindex_t if (i < npages && ma[i]->valid != VM_PAGE_BITS_ALL) continue; if (j < i) { + VM_OBJECT_WUNLOCK(object); /* Page-in nonresident pages. Mark for laundering. */ if (swap_pager_getpages(object, &ma[j], i - j, NULL, NULL) != VM_PAGER_OK) panic("%s: read from swap failed", __func__); + VM_OBJECT_WLOCK(object); do { swp_pager_force_launder(ma[j]); } while (++j < i); Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sun Jan 19 22:52:36 2020 (r356901) +++ head/sys/vm/vm_fault.c Sun Jan 19 23:47:32 2020 (r356902) @@ -1080,8 +1080,10 @@ readrest: } ahead = ulmin(ahead, atop(e_end - vaddr) - 1); } + VM_OBJECT_WUNLOCK(fs.object); rv = vm_pager_get_pages(fs.object, &fs.m, 1, &behind, &ahead); + VM_OBJECT_WLOCK(fs.object); if (rv == VM_PAGER_OK) { faultcount = behind + 1 + ahead; hardfault = true; Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Sun Jan 19 22:52:36 2020 (r356901) +++ head/sys/vm/vm_object.h Sun Jan 19 23:47:32 2020 (r356902) @@ -264,6 +264,13 @@ extern struct vm_object kernel_object_store; #define VM_OBJECT_PICKUP(object, state) \ lock_class_rw.lc_lock(&(object)->lock.lock_object, (state)) +#define VM_OBJECT_ASSERT_PAGING(object) \ + KASSERT((object)->paging_in_progress != 0, \ + ("vm_object %p is not paging", object)) +#define VM_OBJECT_ASSERT_REFERENCE(object) \ + KASSERT((object)->reference_count != 0, \ + ("vm_object %p is not referenced", object)) + struct vnode; /* Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Jan 19 22:52:36 2020 (r356901) +++ head/sys/vm/vm_page.c Sun Jan 19 23:47:32 2020 (r356902) @@ -4398,7 +4398,11 @@ retrylookup: } } after = i; + vm_object_pip_add(object, after); + VM_OBJECT_WUNLOCK(object); rv = vm_pager_get_pages(object, ma, after, NULL, NULL); + VM_OBJECT_WLOCK(object); + vm_object_pip_wakeupn(object, after); /* Pager may have replaced a page. */ m = ma[0]; if (rv != VM_PAGER_OK) { Modified: head/sys/vm/vm_pager.c ============================================================================== --- head/sys/vm/vm_pager.c Sun Jan 19 22:52:36 2020 (r356901) +++ head/sys/vm/vm_pager.c Sun Jan 19 23:47:32 2020 (r356902) @@ -263,7 +263,8 @@ vm_pager_assert_in(vm_object_t object, vm_page_t *m, i * bogus page, but the first and last pages must be a real ones. */ - VM_OBJECT_ASSERT_WLOCKED(object); + VM_OBJECT_ASSERT_UNLOCKED(object); + VM_OBJECT_ASSERT_PAGING(object); KASSERT(count > 0, ("%s: 0 count", __func__)); for (int i = 0 ; i < count; i++) { if (m[i] == bogus_page) { @@ -311,9 +312,13 @@ vm_pager_get_pages(vm_object_t object, vm_page_t *m, i * If pager has replaced a page, assert that it had * updated the array. */ +#ifdef INVARIANTS + VM_OBJECT_RLOCK(object); KASSERT(m[i] == vm_page_lookup(object, pindex++), ("%s: mismatch page %p pindex %ju", __func__, m[i], (uintmax_t )pindex - 1)); + VM_OBJECT_RUNLOCK(object); +#endif /* * Zero out partially filled data. */ Modified: head/sys/vm/vm_swapout.c ============================================================================== --- head/sys/vm/vm_swapout.c Sun Jan 19 22:52:36 2020 (r356901) +++ head/sys/vm/vm_swapout.c Sun Jan 19 23:47:32 2020 (r356902) @@ -560,6 +560,7 @@ vm_thread_swapin(struct thread *td, int oom_alloc) VM_OBJECT_WLOCK(ksobj); (void)vm_page_grab_pages(ksobj, 0, oom_alloc | VM_ALLOC_WIRED, ma, pages); + VM_OBJECT_WUNLOCK(ksobj); for (i = 0; i < pages;) { vm_page_assert_xbusied(ma[i]); if (vm_page_all_valid(ma[i])) { @@ -571,7 +572,9 @@ vm_thread_swapin(struct thread *td, int oom_alloc) for (j = i + 1; j < pages; j++) if (vm_page_all_valid(ma[j])) break; + VM_OBJECT_WLOCK(ksobj); rv = vm_pager_has_page(ksobj, ma[i]->pindex, NULL, &a); + VM_OBJECT_WUNLOCK(ksobj); KASSERT(rv == 1, ("%s: missing page %p", __func__, ma[i])); count = min(a + 1, j - i); rv = vm_pager_get_pages(ksobj, ma + i, count, NULL, NULL); @@ -582,7 +585,6 @@ vm_thread_swapin(struct thread *td, int oom_alloc) vm_page_xunbusy(ma[j]); i += count; } - VM_OBJECT_WUNLOCK(ksobj); pmap_qenter(td->td_kstack, ma, pages); cpu_thread_swapin(td); } Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Sun Jan 19 22:52:36 2020 (r356901) +++ head/sys/vm/vnode_pager.c Sun Jan 19 23:47:32 2020 (r356902) @@ -735,12 +735,11 @@ vnode_pager_getpages(vm_object_t object, vm_page_t *m, struct vnode *vp; int rtval; + /* Handle is stable with paging in progress. */ vp = object->handle; - VM_OBJECT_WUNLOCK(object); rtval = VOP_GETPAGES(vp, m, count, rbehind, rahead); KASSERT(rtval != EOPNOTSUPP, ("vnode_pager: FS getpages not implemented\n")); - VM_OBJECT_WLOCK(object); return rtval; } @@ -752,11 +751,9 @@ vnode_pager_getpages_async(vm_object_t object, vm_page int rtval; vp = object->handle; - VM_OBJECT_WUNLOCK(object); rtval = VOP_GETPAGES_ASYNC(vp, m, count, rbehind, rahead, iodone, arg); KASSERT(rtval != EOPNOTSUPP, ("vnode_pager: FS getpages_async not implemented\n")); - VM_OBJECT_WLOCK(object); return (rtval); } From owner-svn-src-all@freebsd.org Mon Jan 20 01:38:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3601229FBC; Mon, 20 Jan 2020 01:38:03 +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 481Dnl4lSRz3x2V; Mon, 20 Jan 2020 01:38:03 +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 9E2CB1C19B; Mon, 20 Jan 2020 01:38:03 +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 00K1c3Kx011543; Mon, 20 Jan 2020 01:38:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00K1c330011542; Mon, 20 Jan 2020 01:38:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001200138.00K1c330011542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 20 Jan 2020 01:38: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: r356903 - stable/12/usr.bin/diff X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/usr.bin/diff X-SVN-Commit-Revision: 356903 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 01:38:03 -0000 Author: markj Date: Mon Jan 20 01:38:03 2020 New Revision: 356903 URL: https://svnweb.freebsd.org/changeset/base/356903 Log: MFC r356695, r356731: Optimize diff -q. PR: 242828 Modified: stable/12/usr.bin/diff/diffreg.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/diff/diffreg.c ============================================================================== --- stable/12/usr.bin/diff/diffreg.c Sun Jan 19 23:47:32 2020 (r356902) +++ stable/12/usr.bin/diff/diffreg.c Mon Jan 20 01:38:03 2020 (r356903) @@ -349,6 +349,11 @@ diffreg(char *file1, char *file2, int flags, int capsi goto closem; } + if (diff_format == D_BRIEF && ignore_pats == NULL) { + rval = D_DIFFER; + status |= 1; + goto closem; + } if ((flags & D_FORCEASCII) == 0 && (!asciifile(f1) || !asciifile(f2))) { rval = D_BINARY; From owner-svn-src-all@freebsd.org Mon Jan 20 04:01:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D243222C57A; Mon, 20 Jan 2020 04:01:35 +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 481HzM5GM3z43dk; Mon, 20 Jan 2020 04:01:35 +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 B00771DD6F; Mon, 20 Jan 2020 04:01:35 +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 00K41ZLn001347; Mon, 20 Jan 2020 04:01:35 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00K41ZDS001346; Mon, 20 Jan 2020 04:01:35 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202001200401.00K41ZDS001346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 20 Jan 2020 04:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356904 - head/sys/powerpc/amigaone X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/amigaone X-SVN-Commit-Revision: 356904 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 04:01:35 -0000 Author: jhibbits Date: Mon Jan 20 04:01:35 2020 New Revision: 356904 URL: https://svnweb.freebsd.org/changeset/base/356904 Log: powerpc/amiga: Hide CPLD date and time printing behind bootverbose There's no need to see the CPLD build date and time every boot. Modified: head/sys/powerpc/amigaone/cpld_x5000.c Modified: head/sys/powerpc/amigaone/cpld_x5000.c ============================================================================== --- head/sys/powerpc/amigaone/cpld_x5000.c Mon Jan 20 01:38:03 2020 (r356903) +++ head/sys/powerpc/amigaone/cpld_x5000.c Mon Jan 20 04:01:35 2020 (r356904) @@ -164,15 +164,17 @@ cpld_attach(device_t dev) return (ENXIO); } mtx_init(&sc->sc_mutex, "cpld", NULL, MTX_DEF); - date = (cpld_read(sc, CPLD_REG_DATE_UW) << 16) | - cpld_read(sc, CPLD_REG_DATE_LW); - time = (cpld_read(sc, CPLD_REG_TIME_UW) << 16) | - cpld_read(sc, CPLD_REG_TIME_LW); + if (bootverbose) { + date = (cpld_read(sc, CPLD_REG_DATE_UW) << 16) | + cpld_read(sc, CPLD_REG_DATE_LW); + time = (cpld_read(sc, CPLD_REG_TIME_UW) << 16) | + cpld_read(sc, CPLD_REG_TIME_LW); - device_printf(dev, "Build date: %04x-%02x-%02x\n", (date >> 16) & 0xffff, - (date >> 8) & 0xff, date & 0xff); - device_printf(dev, "Build time: %02x:%02x:%02x\n", (time >> 16) & 0xff, - (time >> 8) & 0xff, time & 0xff); + device_printf(dev, "Build date: %04x-%02x-%02x\n", + (date >> 16) & 0xffff, (date >> 8) & 0xff, date & 0xff); + device_printf(dev, "Build time: %02x:%02x:%02x\n", + (time >> 16) & 0xff, (time >> 8) & 0xff, time & 0xff); + } tmp = cpld_read(sc, CPLD_REG_HWREV); device_printf(dev, "Hardware revision: %d\n", tmp); From owner-svn-src-all@freebsd.org Mon Jan 20 08:28:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9FED1F210D; Mon, 20 Jan 2020 08:28:55 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 481Pvq4zfZz4F4D; Mon, 20 Jan 2020 08:28:55 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A63BF20C81; Mon, 20 Jan 2020 08:28:55 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00K8Stwf056858; Mon, 20 Jan 2020 08:28:55 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00K8SteN056855; Mon, 20 Jan 2020 08:28:55 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202001200828.00K8SteN056855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 20 Jan 2020 08:28: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: r356905 - in stable/11: sbin/fsck_ffs sbin/newfs sys/ufs/ffs X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: in stable/11: sbin/fsck_ffs sbin/newfs sys/ufs/ffs X-SVN-Commit-Revision: 356905 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 08:28:55 -0000 Author: eugen Date: Mon Jan 20 08:28:54 2020 New Revision: 356905 URL: https://svnweb.freebsd.org/changeset/base/356905 Log: MFC r323157 by 323157: fix recovery information with sector sizes up to 64K. Original commit log: The new fsck recovery information to enable it to find backup superblocks created in revision 322297 only works on disks with sector sizes up to 4K. This update allows the recovery information to be created by newfs and used by fsck on disks with sector sizes up to 64K. Note that FFS currently limits filesystem to be mounted from disks with up to 8K sectors. Expanding this limitation will be the subject of another commit. For example, this allows newfs to work on GELI volumes with 8K sectors. PR: 243413 Approved by: mckusick Relnotes: Yes Modified: stable/11/sbin/fsck_ffs/setup.c stable/11/sbin/newfs/mkfs.c stable/11/sys/ufs/ffs/fs.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/fsck_ffs/setup.c ============================================================================== --- stable/11/sbin/fsck_ffs/setup.c Mon Jan 20 04:01:35 2020 (r356904) +++ stable/11/sbin/fsck_ffs/setup.c Mon Jan 20 08:28:54 2020 (r356905) @@ -36,6 +36,7 @@ static const char sccsid[] = "@(#)setup.c 8.10 (Berkel __FBSDID("$FreeBSD$"); #include +#include #include #define FSTYPENAMES #include @@ -466,7 +467,9 @@ sblock_init(void) static int calcsb(char *dev, int devfd, struct fs *fs) { - struct fsrecovery fsr; + struct fsrecovery *fsr; + char *fsrbuf; + u_int secsize; /* * We need fragments-per-group and the partition-size. @@ -476,32 +479,62 @@ calcsb(char *dev, int devfd, struct fs *fs) * overwritten by a boot block, we fail. But usually they are * there and we can use them. */ - if (blread(devfd, (char *)&fsr, - (SBLOCK_UFS2 - sizeof(fsr)) / dev_bsize, sizeof(fsr)) || - fsr.fsr_magic != FS_UFS2_MAGIC) + if (ioctl(devfd, DIOCGSECTORSIZE, &secsize) == -1) return (0); + fsrbuf = Malloc(secsize); + if (fsrbuf == NULL) + errx(EEXIT, "calcsb: cannot allocate recovery buffer"); + if (blread(devfd, fsrbuf, + (SBLOCK_UFS2 - secsize) / dev_bsize, secsize) != 0) + return (0); + fsr = (struct fsrecovery *)&fsrbuf[secsize - sizeof *fsr]; + if (fsr->fsr_magic != FS_UFS2_MAGIC) + return (0); memset(fs, 0, sizeof(struct fs)); - fs->fs_fpg = fsr.fsr_fpg; - fs->fs_fsbtodb = fsr.fsr_fsbtodb; - fs->fs_sblkno = fsr.fsr_sblkno; - fs->fs_magic = fsr.fsr_magic; - fs->fs_ncg = fsr.fsr_ncg; + fs->fs_fpg = fsr->fsr_fpg; + fs->fs_fsbtodb = fsr->fsr_fsbtodb; + fs->fs_sblkno = fsr->fsr_sblkno; + fs->fs_magic = fsr->fsr_magic; + fs->fs_ncg = fsr->fsr_ncg; + free(fsrbuf); return (1); } /* * Check to see if recovery information exists. + * Return 1 if it exists or cannot be created. + * Return 0 if it does not exist and can be created. */ static int chkrecovery(int devfd) { - struct fsrecovery fsr; + struct fsrecovery *fsr; + char *fsrbuf; + u_int secsize; - if (blread(devfd, (char *)&fsr, - (SBLOCK_UFS2 - sizeof(fsr)) / dev_bsize, sizeof(fsr)) || - fsr.fsr_magic != FS_UFS2_MAGIC) - return (0); - return (1); + /* + * Could not determine if backup material exists, so do not + * offer to create it. + */ + if (ioctl(devfd, DIOCGSECTORSIZE, &secsize) == -1 || + (fsrbuf = Malloc(secsize)) == NULL || + blread(devfd, fsrbuf, (SBLOCK_UFS2 - secsize) / dev_bsize, + secsize) != 0) + return (1); + /* + * Recovery material has already been created, so do not + * need to create it again. + */ + fsr = (struct fsrecovery *)&fsrbuf[secsize - sizeof *fsr]; + if (fsr->fsr_magic == FS_UFS2_MAGIC) { + free(fsrbuf); + return (1); + } + /* + * Recovery material has not been created and can be if desired. + */ + free(fsrbuf); + return (0); } /* @@ -512,17 +545,24 @@ chkrecovery(int devfd) static void saverecovery(int readfd, int writefd) { - struct fsrecovery fsr; + struct fsrecovery *fsr; + char *fsrbuf; + u_int secsize; if (sblock.fs_magic != FS_UFS2_MAGIC || - blread(readfd, (char *)&fsr, - (SBLOCK_UFS2 - sizeof(fsr)) / dev_bsize, sizeof(fsr))) + ioctl(readfd, DIOCGSECTORSIZE, &secsize) == -1 || + (fsrbuf = Malloc(secsize)) == NULL || + blread(readfd, fsrbuf, (SBLOCK_UFS2 - secsize) / dev_bsize, + secsize) != 0) { + printf("RECOVERY DATA COULD NOT BE CREATED\n"); return; - fsr.fsr_magic = sblock.fs_magic; - fsr.fsr_fpg = sblock.fs_fpg; - fsr.fsr_fsbtodb = sblock.fs_fsbtodb; - fsr.fsr_sblkno = sblock.fs_sblkno; - fsr.fsr_ncg = sblock.fs_ncg; - blwrite(writefd, (char *)&fsr, (SBLOCK_UFS2 - sizeof(fsr)) / dev_bsize, - sizeof(fsr)); + } + fsr = (struct fsrecovery *)&fsrbuf[secsize - sizeof *fsr]; + fsr->fsr_magic = sblock.fs_magic; + fsr->fsr_fpg = sblock.fs_fpg; + fsr->fsr_fsbtodb = sblock.fs_fsbtodb; + fsr->fsr_sblkno = sblock.fs_sblkno; + fsr->fsr_ncg = sblock.fs_ncg; + blwrite(writefd, fsrbuf, (SBLOCK_UFS2 - secsize) / secsize, secsize); + free(fsrbuf); } Modified: stable/11/sbin/newfs/mkfs.c ============================================================================== --- stable/11/sbin/newfs/mkfs.c Mon Jan 20 04:01:35 2020 (r356904) +++ stable/11/sbin/newfs/mkfs.c Mon Jan 20 08:28:54 2020 (r356905) @@ -121,7 +121,8 @@ mkfs(struct partition *pp, char *fsys) ino_t maxinum; int minfragsperinode; /* minimum ratio of frags to inodes */ char tmpbuf[100]; /* XXX this will break in about 2,500 years */ - struct fsrecovery fsr; + struct fsrecovery *fsr; + char *fsrbuf; union { struct fs fdummy; char cdummy[SBLOCKSIZE]; @@ -442,6 +443,8 @@ restart: sblock.fs_sbsize = fragroundup(&sblock, sizeof(struct fs)); if (sblock.fs_sbsize > SBLOCKSIZE) sblock.fs_sbsize = SBLOCKSIZE; + if (sblock.fs_sbsize < realsectorsize) + sblock.fs_sbsize = realsectorsize; sblock.fs_minfree = minfree; if (metaspace > 0 && metaspace < sblock.fs_fpg / 2) sblock.fs_metaspace = blknum(&sblock, metaspace); @@ -513,7 +516,7 @@ restart: /* * Wipe out old UFS1 superblock(s) if necessary. */ - if (!Nflag && Oflag != 1) { + if (!Nflag && Oflag != 1 && realsectorsize <= SBLOCK_UFS1) { i = bread(&disk, part_ofs + SBLOCK_UFS1 / disk.d_bsize, chdummy, SBLOCKSIZE); if (i == -1) err(1, "can't read old UFS1 superblock: %s", disk.d_error); @@ -622,18 +625,20 @@ restart: * The recovery information only works for UFS2 filesystems. */ if (sblock.fs_magic == FS_UFS2_MAGIC) { - i = bread(&disk, - part_ofs + (SBLOCK_UFS2 - sizeof(fsr)) / disk.d_bsize, - (char *)&fsr, sizeof(fsr)); - if (i == -1) + if ((fsrbuf = malloc(realsectorsize)) == NULL || bread(&disk, + part_ofs + (SBLOCK_UFS2 - realsectorsize) / disk.d_bsize, + fsrbuf, realsectorsize) == -1) err(1, "can't read recovery area: %s", disk.d_error); - fsr.fsr_magic = sblock.fs_magic; - fsr.fsr_fpg = sblock.fs_fpg; - fsr.fsr_fsbtodb = sblock.fs_fsbtodb; - fsr.fsr_sblkno = sblock.fs_sblkno; - fsr.fsr_ncg = sblock.fs_ncg; - wtfs((SBLOCK_UFS2 - sizeof(fsr)) / disk.d_bsize, sizeof(fsr), - (char *)&fsr); + fsr = + (struct fsrecovery *)&fsrbuf[realsectorsize - sizeof *fsr]; + fsr->fsr_magic = sblock.fs_magic; + fsr->fsr_fpg = sblock.fs_fpg; + fsr->fsr_fsbtodb = sblock.fs_fsbtodb; + fsr->fsr_sblkno = sblock.fs_sblkno; + fsr->fsr_ncg = sblock.fs_ncg; + wtfs((SBLOCK_UFS2 - realsectorsize) / disk.d_bsize, + realsectorsize, fsrbuf); + free(fsrbuf); } /* * Update information about this partition in pack Modified: stable/11/sys/ufs/ffs/fs.h ============================================================================== --- stable/11/sys/ufs/ffs/fs.h Mon Jan 20 04:01:35 2020 (r356904) +++ stable/11/sys/ufs/ffs/fs.h Mon Jan 20 08:28:54 2020 (r356905) @@ -238,9 +238,7 @@ struct fsck_cmd { * A recovery structure placed at the end of the boot block area by newfs * that can be used by fsck to search for alternate superblocks. */ -#define RESID (4096 - 20) /* disk sector size minus recovery area size */ struct fsrecovery { - char block[RESID]; /* unused part of sector */ int32_t fsr_magic; /* magic number */ int32_t fsr_fsbtodb; /* fsbtodb and dbtofsb shift constant */ int32_t fsr_sblkno; /* offset of super-block in filesys */ From owner-svn-src-all@freebsd.org Mon Jan 20 08:55:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A3B41F2D81; Mon, 20 Jan 2020 08:55:28 +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 481QVS1hRLz4GPd; Mon, 20 Jan 2020 08:55:28 +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 30C3E211F7; Mon, 20 Jan 2020 08:55:28 +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 00K8tS36074407; Mon, 20 Jan 2020 08:55:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00K8tRIV074405; Mon, 20 Jan 2020 08:55:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202001200855.00K8tRIV074405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 20 Jan 2020 08:55:27 +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: r356906 - in stable/12/sys: compat/linuxkpi/common/src kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: compat/linuxkpi/common/src kern X-SVN-Commit-Revision: 356906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 08:55:28 -0000 Author: kib Date: Mon Jan 20 08:55:27 2020 New Revision: 356906 URL: https://svnweb.freebsd.org/changeset/base/356906 Log: MFC r356682: Code must not unlock a mutex while owning the thread lock. Modified: stable/12/sys/compat/linuxkpi/common/src/linux_rcu.c stable/12/sys/kern/subr_epoch.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/src/linux_rcu.c ============================================================================== --- stable/12/sys/compat/linuxkpi/common/src/linux_rcu.c Mon Jan 20 08:28:54 2020 (r356905) +++ stable/12/sys/compat/linuxkpi/common/src/linux_rcu.c Mon Jan 20 08:55:27 2020 (r356906) @@ -297,14 +297,13 @@ linux_synchronize_rcu(void) "linux_synchronize_rcu() can sleep"); td = curthread; + DROP_GIANT(); /* * Synchronizing RCU might change the CPU core this function * is running on. Save current values: */ thread_lock(td); - - DROP_GIANT(); old_cpu = PCPU_GET(cpuid); old_pinned = td->td_pinned; Modified: stable/12/sys/kern/subr_epoch.c ============================================================================== --- stable/12/sys/kern/subr_epoch.c Mon Jan 20 08:28:54 2020 (r356905) +++ stable/12/sys/kern/subr_epoch.c Mon Jan 20 08:55:27 2020 (r356906) @@ -499,8 +499,8 @@ epoch_wait_preempt(epoch_t epoch) KASSERT(!in_epoch(epoch), ("epoch_wait_preempt() called in the middle " "of an epoch section of the same epoch")); #endif - thread_lock(td); DROP_GIANT(); + thread_lock(td); old_cpu = PCPU_GET(cpuid); old_pinned = td->td_pinned; From owner-svn-src-all@freebsd.org Mon Jan 20 09:16:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E61D1F34CD; Mon, 20 Jan 2020 09:16:07 +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 481QyG6vS5z4H9h; Mon, 20 Jan 2020 09:16:06 +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 E3BAA21582; Mon, 20 Jan 2020 09:16:06 +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 00K9G6ON086491; Mon, 20 Jan 2020 09:16:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00K9G6pR086490; Mon, 20 Jan 2020 09:16:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202001200916.00K9G6pR086490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 20 Jan 2020 09:16: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: r356907 - stable/11/sys/compat/linuxkpi/common/src X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 356907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 09:16:07 -0000 Author: kib Date: Mon Jan 20 09:16:06 2020 New Revision: 356907 URL: https://svnweb.freebsd.org/changeset/base/356907 Log: MFC r356682: Code must not unlock a mutex while owning the thread lock. Modified: stable/11/sys/compat/linuxkpi/common/src/linux_rcu.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/src/linux_rcu.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_rcu.c Mon Jan 20 08:55:27 2020 (r356906) +++ stable/11/sys/compat/linuxkpi/common/src/linux_rcu.c Mon Jan 20 09:16:06 2020 (r356907) @@ -296,14 +296,13 @@ linux_synchronize_rcu(void) "linux_synchronize_rcu() can sleep"); td = curthread; + DROP_GIANT(); /* * Synchronizing RCU might change the CPU core this function * is running on. Save current values: */ thread_lock(td); - - DROP_GIANT(); old_cpu = PCPU_GET(cpuid); old_pinned = td->td_pinned; From owner-svn-src-all@freebsd.org Mon Jan 20 11:19:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C73E01F6531; Mon, 20 Jan 2020 11:19:56 +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 481Tj84zSwz4NNh; Mon, 20 Jan 2020 11:19:56 +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 A615122BD6; Mon, 20 Jan 2020 11:19:56 +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 00KBJuq2058215; Mon, 20 Jan 2020 11:19:56 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KBJulX058214; Mon, 20 Jan 2020 11:19:56 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001201119.00KBJulX058214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 20 Jan 2020 11:19: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: r356908 - in stable: 11/sys/opencrypto 12/sys/opencrypto X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/opencrypto 12/sys/opencrypto X-SVN-Commit-Revision: 356908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 11:19:56 -0000 Author: jhb Date: Mon Jan 20 11:19:55 2020 New Revision: 356908 URL: https://svnweb.freebsd.org/changeset/base/356908 Log: MFC 356507,356520: Add a reference count to cryptodev sessions. 356507: Add a reference count to cryptodev sessions. This prevents use-after-free races with crypto requests (which may sleep) and CIOCFSESSION as well as races from current CIOCFSESSION requests. 356520: Remove no-longer-used function prototype. admbugs: 949 Sponsored by: Chelsio Communications Modified: stable/11/sys/opencrypto/cryptodev.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/opencrypto/cryptodev.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/opencrypto/cryptodev.c ============================================================================== --- stable/11/sys/opencrypto/cryptodev.c Mon Jan 20 09:16:06 2020 (r356907) +++ stable/11/sys/opencrypto/cryptodev.c Mon Jan 20 11:19:55 2020 (r356908) @@ -268,6 +268,7 @@ crypt_kop_to_32(const struct crypt_kop *from, struct c struct csession { TAILQ_ENTRY(csession) next; u_int64_t sid; + volatile u_int refs; u_int32_t ses; struct mtx lock; /* for op submission */ @@ -294,6 +295,7 @@ struct cryptop_data { struct fcrypt { TAILQ_HEAD(csessionlist, csession) csessions; int sesn; + struct mtx lock; }; static struct timeval warninterval = { .tv_sec = 60, .tv_usec = 0 }; @@ -325,8 +327,7 @@ static struct fileops cryptofops = { }; static struct csession *csefind(struct fcrypt *, u_int); -static int csedelete(struct fcrypt *, struct csession *); -static struct csession *cseadd(struct fcrypt *, struct csession *); +static int csedelete(struct fcrypt *, u_int); static struct csession *csecreate(struct fcrypt *, u_int64_t, caddr_t, u_int64_t, caddr_t, u_int64_t, u_int32_t, u_int32_t, struct enc_xform *, struct auth_hash *); @@ -617,13 +618,9 @@ bail: break; case CIOCFSESSION: ses = *(u_int32_t *)data; - cse = csefind(fcr, ses); - if (cse == NULL) { + error = csedelete(fcr, ses); + if (error != 0) SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); - return (EINVAL); - } - csedelete(fcr, cse); - error = csefree(cse); break; case CIOCCRYPT: #ifdef COMPAT_FREEBSD32 @@ -640,6 +637,7 @@ bail: return (EINVAL); } error = cryptodev_op(cse, cop, active_cred, td); + (void)csefree(cse); #ifdef COMPAT_FREEBSD32 if (error == 0 && cmd == CIOCCRYPT32) crypt_op_to_32(cop, data); @@ -706,6 +704,7 @@ bail: return (EINVAL); } error = cryptodev_aead(cse, caead, active_cred, td); + (void)csefree(cse); break; default: error = EINVAL; @@ -1323,6 +1322,9 @@ cryptof_close(struct file *fp, struct thread *td) while ((cse = TAILQ_FIRST(&fcr->csessions))) { TAILQ_REMOVE(&fcr->csessions, cse, next); + KASSERT(cse->refs == 1, + ("%s: crypto session %p with %d refs", __func__, cse, + cse->refs)); (void)csefree(cse); } free(fcr, M_XDATA); @@ -1343,34 +1345,35 @@ csefind(struct fcrypt *fcr, u_int ses) { struct csession *cse; - TAILQ_FOREACH(cse, &fcr->csessions, next) - if (cse->ses == ses) + mtx_lock(&fcr->lock); + TAILQ_FOREACH(cse, &fcr->csessions, next) { + if (cse->ses == ses) { + refcount_acquire(&cse->refs); + mtx_unlock(&fcr->lock); return (cse); + } + } + mtx_unlock(&fcr->lock); return (NULL); } static int -csedelete(struct fcrypt *fcr, struct csession *cse_del) +csedelete(struct fcrypt *fcr, u_int ses) { struct csession *cse; + mtx_lock(&fcr->lock); TAILQ_FOREACH(cse, &fcr->csessions, next) { - if (cse == cse_del) { + if (cse->ses == ses) { TAILQ_REMOVE(&fcr->csessions, cse, next); - return (1); + mtx_unlock(&fcr->lock); + return (csefree(cse)); } } - return (0); + mtx_unlock(&fcr->lock); + return (EINVAL); } -static struct csession * -cseadd(struct fcrypt *fcr, struct csession *cse) -{ - TAILQ_INSERT_TAIL(&fcr->csessions, cse, next); - cse->ses = fcr->sesn++; - return (cse); -} - struct csession * csecreate(struct fcrypt *fcr, u_int64_t sid, caddr_t key, u_int64_t keylen, caddr_t mackey, u_int64_t mackeylen, u_int32_t cipher, u_int32_t mac, @@ -1382,6 +1385,7 @@ csecreate(struct fcrypt *fcr, u_int64_t sid, caddr_t k if (cse == NULL) return NULL; mtx_init(&cse->lock, "cryptodev", "crypto session lock", MTX_DEF); + refcount_init(&cse->refs, 1); cse->key = key; cse->keylen = keylen/8; cse->mackey = mackey; @@ -1391,7 +1395,10 @@ csecreate(struct fcrypt *fcr, u_int64_t sid, caddr_t k cse->mac = mac; cse->txform = txform; cse->thash = thash; - cseadd(fcr, cse); + mtx_lock(&fcr->lock); + TAILQ_INSERT_TAIL(&fcr->csessions, cse, next); + cse->ses = fcr->sesn++; + mtx_unlock(&fcr->lock); return (cse); } @@ -1400,6 +1407,8 @@ csefree(struct csession *cse) { int error; + if (!refcount_release(&cse->refs)) + return (0); error = crypto_freesession(cse->sid); mtx_destroy(&cse->lock); if (cse->key) @@ -1437,13 +1446,14 @@ cryptoioctl(struct cdev *dev, u_long cmd, caddr_t data switch (cmd) { case CRIOGET: - fcr = malloc(sizeof(struct fcrypt), M_XDATA, M_WAITOK); + fcr = malloc(sizeof(struct fcrypt), M_XDATA, M_WAITOK | M_ZERO); TAILQ_INIT(&fcr->csessions); - fcr->sesn = 0; + mtx_init(&fcr->lock, "fcrypt", NULL, MTX_DEF); error = falloc(td, &f, &fd, 0); if (error) { + mtx_destroy(&fcr->lock); free(fcr, M_XDATA); return (error); } From owner-svn-src-all@freebsd.org Mon Jan 20 11:19:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8AF8F1F652D; Mon, 20 Jan 2020 11:19:56 +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 481Tj82ySjz4NNg; Mon, 20 Jan 2020 11:19:56 +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 5CA2622BD5; Mon, 20 Jan 2020 11:19:56 +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 00KBJuOp058209; Mon, 20 Jan 2020 11:19:56 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KBJuRl058208; Mon, 20 Jan 2020 11:19:56 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001201119.00KBJuRl058208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 20 Jan 2020 11:19: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: r356908 - in stable: 11/sys/opencrypto 12/sys/opencrypto X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/opencrypto 12/sys/opencrypto X-SVN-Commit-Revision: 356908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 11:19:56 -0000 Author: jhb Date: Mon Jan 20 11:19:55 2020 New Revision: 356908 URL: https://svnweb.freebsd.org/changeset/base/356908 Log: MFC 356507,356520: Add a reference count to cryptodev sessions. 356507: Add a reference count to cryptodev sessions. This prevents use-after-free races with crypto requests (which may sleep) and CIOCFSESSION as well as races from current CIOCFSESSION requests. 356520: Remove no-longer-used function prototype. admbugs: 949 Sponsored by: Chelsio Communications Modified: stable/12/sys/opencrypto/cryptodev.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/opencrypto/cryptodev.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/opencrypto/cryptodev.c ============================================================================== --- stable/12/sys/opencrypto/cryptodev.c Mon Jan 20 09:16:06 2020 (r356907) +++ stable/12/sys/opencrypto/cryptodev.c Mon Jan 20 11:19:55 2020 (r356908) @@ -266,6 +266,7 @@ crypt_kop_to_32(const struct crypt_kop *from, struct c struct csession { TAILQ_ENTRY(csession) next; crypto_session_t cses; + volatile u_int refs; u_int32_t ses; struct mtx lock; /* for op submission */ @@ -292,6 +293,7 @@ struct cryptop_data { struct fcrypt { TAILQ_HEAD(csessionlist, csession) csessions; int sesn; + struct mtx lock; }; static struct timeval warninterval = { .tv_sec = 60, .tv_usec = 0 }; @@ -323,8 +325,7 @@ static struct fileops cryptofops = { }; static struct csession *csefind(struct fcrypt *, u_int); -static int csedelete(struct fcrypt *, struct csession *); -static struct csession *cseadd(struct fcrypt *, struct csession *); +static bool csedelete(struct fcrypt *, u_int); static struct csession *csecreate(struct fcrypt *, crypto_session_t, caddr_t, u_int64_t, caddr_t, u_int64_t, u_int32_t, u_int32_t, struct enc_xform *, struct auth_hash *); @@ -668,13 +669,10 @@ bail: break; case CIOCFSESSION: ses = *(u_int32_t *)data; - cse = csefind(fcr, ses); - if (cse == NULL) { + if (!csedelete(fcr, ses)) { SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EINVAL); } - csedelete(fcr, cse); - csefree(cse); break; case CIOCCRYPT: #ifdef COMPAT_FREEBSD32 @@ -691,6 +689,7 @@ bail: return (EINVAL); } error = cryptodev_op(cse, cop, active_cred, td); + csefree(cse); #ifdef COMPAT_FREEBSD32 if (error == 0 && cmd == CIOCCRYPT32) crypt_op_to_32(cop, data); @@ -757,6 +756,7 @@ bail: return (EINVAL); } error = cryptodev_aead(cse, caead, active_cred, td); + csefree(cse); break; default: error = EINVAL; @@ -1375,6 +1375,9 @@ cryptof_close(struct file *fp, struct thread *td) while ((cse = TAILQ_FIRST(&fcr->csessions))) { TAILQ_REMOVE(&fcr->csessions, cse, next); + KASSERT(cse->refs == 1, + ("%s: crypto session %p with %d refs", __func__, cse, + cse->refs)); csefree(cse); } free(fcr, M_XDATA); @@ -1395,34 +1398,36 @@ csefind(struct fcrypt *fcr, u_int ses) { struct csession *cse; - TAILQ_FOREACH(cse, &fcr->csessions, next) - if (cse->ses == ses) + mtx_lock(&fcr->lock); + TAILQ_FOREACH(cse, &fcr->csessions, next) { + if (cse->ses == ses) { + refcount_acquire(&cse->refs); + mtx_unlock(&fcr->lock); return (cse); + } + } + mtx_unlock(&fcr->lock); return (NULL); } -static int -csedelete(struct fcrypt *fcr, struct csession *cse_del) +static bool +csedelete(struct fcrypt *fcr, u_int ses) { struct csession *cse; + mtx_lock(&fcr->lock); TAILQ_FOREACH(cse, &fcr->csessions, next) { - if (cse == cse_del) { + if (cse->ses == ses) { TAILQ_REMOVE(&fcr->csessions, cse, next); - return (1); + mtx_unlock(&fcr->lock); + csefree(cse); + return (true); } } - return (0); + mtx_unlock(&fcr->lock); + return (false); } -static struct csession * -cseadd(struct fcrypt *fcr, struct csession *cse) -{ - TAILQ_INSERT_TAIL(&fcr->csessions, cse, next); - cse->ses = fcr->sesn++; - return (cse); -} - struct csession * csecreate(struct fcrypt *fcr, crypto_session_t cses, caddr_t key, u_int64_t keylen, caddr_t mackey, u_int64_t mackeylen, u_int32_t cipher, u_int32_t mac, @@ -1434,6 +1439,7 @@ csecreate(struct fcrypt *fcr, crypto_session_t cses, c if (cse == NULL) return NULL; mtx_init(&cse->lock, "cryptodev", "crypto session lock", MTX_DEF); + refcount_init(&cse->refs, 1); cse->key = key; cse->keylen = keylen/8; cse->mackey = mackey; @@ -1443,7 +1449,10 @@ csecreate(struct fcrypt *fcr, crypto_session_t cses, c cse->mac = mac; cse->txform = txform; cse->thash = thash; - cseadd(fcr, cse); + mtx_lock(&fcr->lock); + TAILQ_INSERT_TAIL(&fcr->csessions, cse, next); + cse->ses = fcr->sesn++; + mtx_unlock(&fcr->lock); return (cse); } @@ -1451,6 +1460,8 @@ static void csefree(struct csession *cse) { + if (!refcount_release(&cse->refs)) + return; crypto_freesession(cse->cses); mtx_destroy(&cse->lock); if (cse->key) @@ -1487,13 +1498,14 @@ cryptoioctl(struct cdev *dev, u_long cmd, caddr_t data switch (cmd) { case CRIOGET: - fcr = malloc(sizeof(struct fcrypt), M_XDATA, M_WAITOK); + fcr = malloc(sizeof(struct fcrypt), M_XDATA, M_WAITOK | M_ZERO); TAILQ_INIT(&fcr->csessions); - fcr->sesn = 0; + mtx_init(&fcr->lock, "fcrypt", NULL, MTX_DEF); error = falloc(td, &f, &fd, 0); if (error) { + mtx_destroy(&fcr->lock); free(fcr, M_XDATA); return (error); } From owner-svn-src-all@freebsd.org Mon Jan 20 11:40:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD2461F6B17; Mon, 20 Jan 2020 11:40:09 +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 481V8T4CTzz4PHQ; Mon, 20 Jan 2020 11:40:09 +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 8748422FA3; Mon, 20 Jan 2020 11:40:09 +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 00KBe9oi069918; Mon, 20 Jan 2020 11:40:09 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KBe8P3069911; Mon, 20 Jan 2020 11:40:08 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202001201140.00KBe8P3069911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 20 Jan 2020 11:40:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356909 - in head: include lib/libc/stdlib lib/libc/tests/stdlib X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: include lib/libc/stdlib lib/libc/tests/stdlib X-SVN-Commit-Revision: 356909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 11:40:09 -0000 Author: trasz Date: Mon Jan 20 11:40:07 2020 New Revision: 356909 URL: https://svnweb.freebsd.org/changeset/base/356909 Log: Add qsort_s(3). Apart from the constraints, it also makes it easier to port software written for Linux variant of qsort_r(3). Reviewed by: kib, arichardson MFC after: 2 weeks Relnotes: yes Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23174 Added: head/lib/libc/stdlib/qsort_s.c (contents, props changed) head/lib/libc/tests/stdlib/qsort_s_test.c (contents, props changed) Modified: head/include/stdlib.h head/lib/libc/stdlib/Makefile.inc head/lib/libc/stdlib/Symbol.map head/lib/libc/stdlib/qsort.3 head/lib/libc/stdlib/qsort.c head/lib/libc/tests/stdlib/Makefile Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Mon Jan 20 11:19:55 2020 (r356908) +++ head/include/stdlib.h Mon Jan 20 11:40:07 2020 (r356909) @@ -324,6 +324,11 @@ extern char *suboptarg; /* getsubopt(3) external var #if __EXT1_VISIBLE +#ifndef _RSIZE_T_DEFINED +#define _RSIZE_T_DEFINED +typedef size_t rsize_t; +#endif + #ifndef _ERRNO_T_DEFINED #define _ERRNO_T_DEFINED typedef int errno_t; @@ -339,6 +344,9 @@ _Noreturn void abort_handler_s(const char * __restrict errno_t); /* K3.6.1.3 */ void ignore_handler_s(const char * __restrict, void * __restrict, errno_t); +/* K.3.6.3.2 */ +errno_t qsort_s(void *, rsize_t, rsize_t, + int (*)(const void *, const void *, void *), void *); #endif /* __EXT1_VISIBLE */ __END_DECLS Modified: head/lib/libc/stdlib/Makefile.inc ============================================================================== --- head/lib/libc/stdlib/Makefile.inc Mon Jan 20 11:19:55 2020 (r356908) +++ head/lib/libc/stdlib/Makefile.inc Mon Jan 20 11:40:07 2020 (r356909) @@ -11,8 +11,8 @@ MISRCS+=C99_Exit.c a64l.c abort.c abs.c atexit.c atof. getsubopt.c hcreate.c hcreate_r.c hdestroy_r.c heapsort.c heapsort_b.c \ hsearch_r.c imaxabs.c imaxdiv.c \ insque.c l64a.c labs.c ldiv.c llabs.c lldiv.c lsearch.c \ - merge.c mergesort_b.c ptsname.c qsort.c qsort_r.c quick_exit.c \ - radixsort.c rand.c \ + merge.c mergesort_b.c ptsname.c qsort.c qsort_r.c qsort_s.c \ + quick_exit.c radixsort.c rand.c \ random.c reallocarray.c reallocf.c realpath.c remque.c \ set_constraint_handler_s.c strfmon.c strtoimax.c \ strtol.c strtold.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \ @@ -51,7 +51,8 @@ MLINKS+=hcreate.3 hcreate_r.3 hcreate.3 hdestroy_r.3 h MLINKS+=insque.3 remque.3 MLINKS+=lsearch.3 lfind.3 MLINKS+=ptsname.3 grantpt.3 ptsname.3 unlockpt.3 -MLINKS+=qsort.3 heapsort.3 qsort.3 mergesort.3 qsort.3 qsort_r.3 +MLINKS+=qsort.3 heapsort.3 qsort.3 mergesort.3 qsort.3 qsort_r.3 \ + qsort.3 qsort_s.3 MLINKS+=rand.3 rand_r.3 rand.3 srand.3 MLINKS+=random.3 initstate.3 random.3 setstate.3 random.3 srandom.3 \ random.3 srandomdev.3 Modified: head/lib/libc/stdlib/Symbol.map ============================================================================== --- head/lib/libc/stdlib/Symbol.map Mon Jan 20 11:19:55 2020 (r356908) +++ head/lib/libc/stdlib/Symbol.map Mon Jan 20 11:40:07 2020 (r356909) @@ -123,6 +123,10 @@ FBSD_1.5 { set_constraint_handler_s; }; +FBSD_1.6 { + qsort_s; +}; + FBSDprivate_1.0 { __system; _system; Modified: head/lib/libc/stdlib/qsort.3 ============================================================================== --- head/lib/libc/stdlib/qsort.3 Mon Jan 20 11:19:55 2020 (r356908) +++ head/lib/libc/stdlib/qsort.3 Mon Jan 20 11:40:07 2020 (r356909) @@ -32,7 +32,7 @@ .\" @(#)qsort.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 20, 2013 +.Dd January 14, 2020 .Dt QSORT 3 .Os .Sh NAME @@ -98,6 +98,15 @@ .Fa "size_t size" .Fa "int \*[lp]^compar\*[rp]\*[lp]const void *, const void *\*[rp]" .Fc +.Fd #define __STDC_WANT_LIB_EXT1__ 1 +.Ft errno_t +.Fo qsort_s +.Fa "void *base" +.Fa "rsize_t nmemb" +.Fa "rsize_t size" +.Fa "int \*[lp]*compar\*[rp]\*[lp]const void *, const void *, void *\*[rp]" +.Fa "void *thunk" +.Fc .Sh DESCRIPTION The .Fn qsort @@ -238,6 +247,36 @@ is faster than .Fn heapsort . Memory availability and pre-existing order in the data can make this untrue. +.Pp +The +.Fn qsort_s +function behaves the same as +.Fn qsort_r , except that: +.Bl -dash +.It +The order of arguments is different +.It +The order of arguments to +.Fa compar +is different +.It +if +.Fa nmemb +or +.Fa size +are greater than +.Dv RSIZE_MAX , +or +.Fa nmemb +is not zero and +.Fa compar +is NULL, then the runtime-constraint handler is called, and +.Fn qsort_s +returns an error. +Note that the handler is called before +.Fn qsort_s +returns the error, and the handler function might not return. +.El .Sh RETURN VALUES The .Fn qsort @@ -245,6 +284,9 @@ and .Fn qsort_r functions return no value. +The +.Fn qsort_s +function returns zero on success, non-zero on error. .Pp .Rv -std heapsort mergesort .Sh EXAMPLES @@ -288,6 +330,19 @@ main(void) } .Ed .Sh COMPATIBILITY +The order of arguments for the comparison function used with +.Fn qsort_r +is different from the one used by +.Fn qsort_s , +and the GNU libc implementation of +.Fn qsort_r . +When porting software written for GNU libc, it is usually possible +to replace +.Fn qsort_r +with +.Fn qsort_s +to work around this problem. +.Pp Previous versions of .Fn qsort did not permit the comparison routine itself to call @@ -366,6 +421,10 @@ The function conforms to .St -isoC . +.Fn qsort_s +conforms to +.St -isoC-2011 +K.3.6.3.2. .Sh HISTORY The variants of these functions that take blocks as arguments first appeared in Mac OS X. Modified: head/lib/libc/stdlib/qsort.c ============================================================================== --- head/lib/libc/stdlib/qsort.c Mon Jan 20 11:19:55 2020 (r356908) +++ head/lib/libc/stdlib/qsort.c Mon Jan 20 11:40:07 2020 (r356909) @@ -35,10 +35,16 @@ static char sccsid[] = "@(#)qsort.c 8.1 (Berkeley) 6/4 #include __FBSDID("$FreeBSD$"); +#include +#include #include +#include +#include "libc_private.h" -#ifdef I_AM_QSORT_R +#if defined(I_AM_QSORT_R) typedef int cmp_t(void *, const void *, const void *); +#elif defined(I_AM_QSORT_S) +typedef int cmp_t(const void *, const void *, void *); #else typedef int cmp_t(const void *, const void *); #endif @@ -65,15 +71,17 @@ swapfunc(char *a, char *b, size_t es) #define vecswap(a, b, n) \ if ((n) > 0) swapfunc(a, b, n) -#ifdef I_AM_QSORT_R +#if defined(I_AM_QSORT_R) #define CMP(t, x, y) (cmp((t), (x), (y))) +#elif defined(I_AM_QSORT_S) +#define CMP(t, x, y) (cmp((x), (y), (t))) #else #define CMP(t, x, y) (cmp((x), (y))) #endif static inline char * med3(char *a, char *b, char *c, cmp_t *cmp, void *thunk -#ifndef I_AM_QSORT_R +#if !defined(I_AM_QSORT_R) && !defined(I_AM_QSORT_S) __unused #endif ) @@ -83,9 +91,12 @@ __unused :(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c )); } -#ifdef I_AM_QSORT_R +#if defined(I_AM_QSORT_R) void qsort_r(void *a, size_t n, size_t es, void *thunk, cmp_t *cmp) +#elif defined(I_AM_QSORT_S) +errno_t +qsort_s(void *a, rsize_t n, rsize_t es, cmp_t *cmp, void *thunk) #else #define thunk NULL void @@ -97,6 +108,24 @@ qsort(void *a, size_t n, size_t es, cmp_t *cmp) int cmp_result; int swap_cnt; +#ifdef I_AM_QSORT_S + if (n > RSIZE_MAX) { + __throw_constraint_handler_s("qsort_s : n > RSIZE_MAX", EINVAL); + return (EINVAL); + } else if (es > RSIZE_MAX) { + __throw_constraint_handler_s("qsort_s : es > RSIZE_MAX", EINVAL); + return (EINVAL); + } else if (n != 0) { + if (a == NULL) { + __throw_constraint_handler_s("qsort_s : a == NULL", EINVAL); + return (EINVAL); + } else if (cmp == NULL) { + __throw_constraint_handler_s("qsort_s : cmp == NULL", EINVAL); + return (EINVAL); + } + } +#endif + loop: swap_cnt = 0; if (n < 7) { @@ -105,7 +134,11 @@ loop: pl > (char *)a && CMP(thunk, pl - es, pl) > 0; pl -= es) swapfunc(pl, pl - es, es); +#ifdef I_AM_QSORT_S + return (0); +#else return; +#endif } pm = (char *)a + (n / 2) * es; if (n > 7) { @@ -154,7 +187,11 @@ loop: pl > (char *)a && CMP(thunk, pl - es, pl) > 0; pl -= es) swapfunc(pl, pl - es, es); +#ifdef I_AM_QSORT_S + return (0); +#else return; +#endif } pn = (char *)a + n * es; @@ -168,8 +205,10 @@ loop: if (d1 <= d2) { /* Recurse on left partition, then iterate on right partition */ if (d1 > es) { -#ifdef I_AM_QSORT_R +#if defined(I_AM_QSORT_R) qsort_r(a, d1 / es, es, thunk, cmp); +#elif defined(I_AM_QSORT_S) + qsort_s(a, d1 / es, es, cmp, thunk); #else qsort(a, d1 / es, es, cmp); #endif @@ -184,8 +223,10 @@ loop: } else { /* Recurse on right partition, then iterate on left partition */ if (d2 > es) { -#ifdef I_AM_QSORT_R +#if defined(I_AM_QSORT_R) qsort_r(pn - d2, d2 / es, es, thunk, cmp); +#elif defined(I_AM_QSORT_S) + qsort_s(pn - d2, d2 / es, es, cmp, thunk); #else qsort(pn - d2, d2 / es, es, cmp); #endif @@ -197,4 +238,8 @@ loop: goto loop; } } + +#ifdef I_AM_QSORT_S + return (0); +#endif } Added: head/lib/libc/stdlib/qsort_s.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/stdlib/qsort_s.c Mon Jan 20 11:40:07 2020 (r356909) @@ -0,0 +1,8 @@ +/* + * This file is in the public domain. Originally written by Garrett + * A. Wollman. + * + * $FreeBSD$ + */ +#define I_AM_QSORT_S +#include "qsort.c" Modified: head/lib/libc/tests/stdlib/Makefile ============================================================================== --- head/lib/libc/tests/stdlib/Makefile Mon Jan 20 11:19:55 2020 (r356908) +++ head/lib/libc/tests/stdlib/Makefile Mon Jan 20 11:40:07 2020 (r356909) @@ -6,6 +6,7 @@ ATF_TESTS_C+= dynthr_test ATF_TESTS_C+= heapsort_test ATF_TESTS_C+= mergesort_test ATF_TESTS_C+= qsort_test +ATF_TESTS_C+= qsort_s_test ATF_TESTS_C+= set_constraint_handler_s_test ATF_TESTS_C+= strfmon_test ATF_TESTS_C+= tsearch_test Added: head/lib/libc/tests/stdlib/qsort_s_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/stdlib/qsort_s_test.c Mon Jan 20 11:40:07 2020 (r356909) @@ -0,0 +1,257 @@ +/*- + * Copyright (C) 2020 Edward Tomasz Napierala + * Copyright (c) 2017 Juniper Networks. All rights reserved. + * Copyright (C) 2004 Maxim Sobolev + * 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. + */ + +/* + * Test for qsort_s(3) routine. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#define THUNK 42 + +#include "test-sort.h" + +static errno_t e; + +static int +sorthelp_s(const void *a, const void *b, void *thunk) +{ + const int *oa, *ob; + + ATF_REQUIRE_EQ(*(int *)thunk, THUNK); + + oa = a; + ob = b; + /* Don't use "return *oa - *ob" since it's easy to cause overflow! */ + if (*oa > *ob) + return (1); + if (*oa < *ob) + return (-1); + return (0); +} + +void +h(const char * restrict msg __unused, void * restrict ptr __unused, errno_t error) +{ + e = error; +} + +/* nmemb < 0 */ +ATF_TC_WITHOUT_HEAD(qsort_s_nmemb_lt_zero); +ATF_TC_BODY(qsort_s_nmemb_lt_zero, tc) +{ + int thunk = THUNK; + int b; + + ATF_CHECK(qsort_s(&b, -1, sizeof(int), sorthelp_s, &thunk) != 0); +} + +/* nmemb > rmax */ +ATF_TC_WITHOUT_HEAD(qsort_s_nmemb_gt_rmax); +ATF_TC_BODY(qsort_s_nmemb_gt_rmax, tc) +{ + int thunk = THUNK; + int b; + + ATF_CHECK(qsort_s(&b, RSIZE_MAX + 1, sizeof(int), sorthelp_s, &thunk) != 0); +} + +/* size < 0 */ +ATF_TC_WITHOUT_HEAD(qsort_s_size_lt_zero); +ATF_TC_BODY(qsort_s_size_lt_zero, tc) +{ + int thunk = THUNK; + int b; + + ATF_CHECK(qsort_s(&b, 1, -1, sorthelp_s, &thunk) != 0); +} + +/* size > rmax */ +ATF_TC_WITHOUT_HEAD(qsort_s_size_gt_rmax); +ATF_TC_BODY(qsort_s_size_gt_rmax, tc) +{ + int thunk = THUNK; + int b; + + ATF_CHECK(qsort_s(&b, 1, RSIZE_MAX + 1, sorthelp_s, &thunk) != 0); +} + +/* NULL compar */ +ATF_TC_WITHOUT_HEAD(qsort_s_null_compar); +ATF_TC_BODY(qsort_s_null_compar, tc) +{ + int thunk = THUNK; + int b; + + ATF_CHECK(qsort_s(&b, 1, sizeof(int), NULL, &thunk) != 0); +} + +/* nmemb < 0, handler */ +ATF_TC_WITHOUT_HEAD(qsort_s_nmemb_lt_zero_h); +ATF_TC_BODY(qsort_s_nmemb_lt_zero_h, tc) +{ + int thunk = THUNK; + int b[] = {81, 4, 7}; + + e = 0; + set_constraint_handler_s(h); + ATF_CHECK(qsort_s(&b, -1, sizeof(int), sorthelp_s, &thunk) != 0); + ATF_CHECK(e > 0); + ATF_CHECK_EQ(b[0], 81); + ATF_CHECK_EQ(b[1], 4); + ATF_CHECK_EQ(b[2], 7); +} + +/* nmemb > rmax, handler */ +ATF_TC_WITHOUT_HEAD(qsort_s_nmemb_gt_rmax_h); +ATF_TC_BODY(qsort_s_nmemb_gt_rmax_h, tc) +{ + int thunk = THUNK; + int b[] = {81, 4, 7}; + + e = 0; + set_constraint_handler_s(h); + ATF_CHECK(qsort_s(&b, RSIZE_MAX + 1, sizeof(int), sorthelp_s, &thunk) != 0); + ATF_CHECK(e > 0); + ATF_CHECK_EQ(b[0], 81); + ATF_CHECK_EQ(b[1], 4); + ATF_CHECK_EQ(b[2], 7); +} + +/* size < 0, handler */ +ATF_TC_WITHOUT_HEAD(qsort_s_size_lt_zero_h); +ATF_TC_BODY(qsort_s_size_lt_zero_h, tc) +{ + int thunk = THUNK; + int b[] = {81, 4, 7}; + + e = 0; + set_constraint_handler_s(h); + ATF_CHECK(qsort_s(&b, nitems(b), -1, sorthelp_s, &thunk) != 0); + ATF_CHECK(e > 0); + ATF_CHECK_EQ(b[0], 81); + ATF_CHECK_EQ(b[1], 4); + ATF_CHECK_EQ(b[2], 7); +} + +/* size > rmax, handler */ +ATF_TC_WITHOUT_HEAD(qsort_s_size_gt_rmax_h); +ATF_TC_BODY(qsort_s_size_gt_rmax_h, tc) +{ + int thunk = THUNK; + int b[] = {81, 4, 7}; + + e = 0; + set_constraint_handler_s(h); + ATF_CHECK(qsort_s(&b, nitems(b), RSIZE_MAX + 1, sorthelp_s, &thunk) != 0); + ATF_CHECK(e > 0); + ATF_CHECK_EQ(b[0], 81); + ATF_CHECK_EQ(b[1], 4); + ATF_CHECK_EQ(b[2], 7); +} + +/* NULL compar, handler */ +ATF_TC_WITHOUT_HEAD(qsort_s_null_compar_h); +ATF_TC_BODY(qsort_s_null_compar_h, tc) +{ + int thunk = THUNK; + int b[] = {81, 4, 7}; + + e = 0; + set_constraint_handler_s(h); + ATF_CHECK(qsort_s(&b, nitems(b), sizeof(int), NULL, &thunk) != 0); + ATF_CHECK(e > 0); + ATF_CHECK_EQ(b[0], 81); + ATF_CHECK_EQ(b[1], 4); + ATF_CHECK_EQ(b[2], 7); +} + +ATF_TC_WITHOUT_HEAD(qsort_s_h); +ATF_TC_BODY(qsort_s_h, tc) +{ + int thunk = THUNK; + int b[] = {81, 4, 7}; + + e = 0; + set_constraint_handler_s(h); + ATF_CHECK(qsort_s(&b, nitems(b), sizeof(int), sorthelp_s, &thunk) == 0); + ATF_CHECK(e == 0); + ATF_CHECK_EQ(b[0], 4); + ATF_CHECK_EQ(b[1], 7); + ATF_CHECK_EQ(b[2], 81); +} + +ATF_TC_WITHOUT_HEAD(qsort_s_test); +ATF_TC_BODY(qsort_s_test, tc) +{ + int testvector[IVEC_LEN]; + int sresvector[IVEC_LEN]; + int i, j; + int thunk = THUNK; + + for (j = 2; j < IVEC_LEN; j++) { + /* Populate test vectors */ + for (i = 0; i < j; i++) + testvector[i] = sresvector[i] = initvector[i]; + + /* Sort using qsort_s(3) */ + qsort_s(testvector, j, sizeof(testvector[0]), + sorthelp_s, &thunk); + /* Sort using reference slow sorting routine */ + ssort(sresvector, j); + + /* Compare results */ + for (i = 0; i < j; i++) + ATF_CHECK_MSG(testvector[i] == sresvector[i], + "item at index %d didn't match: %d != %d", + i, testvector[i], sresvector[i]); + } +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, qsort_s_nmemb_lt_zero); + ATF_TP_ADD_TC(tp, qsort_s_nmemb_gt_rmax); + ATF_TP_ADD_TC(tp, qsort_s_size_lt_zero); + ATF_TP_ADD_TC(tp, qsort_s_size_gt_rmax); + ATF_TP_ADD_TC(tp, qsort_s_null_compar); + ATF_TP_ADD_TC(tp, qsort_s_nmemb_lt_zero_h); + ATF_TP_ADD_TC(tp, qsort_s_nmemb_gt_rmax_h); + ATF_TP_ADD_TC(tp, qsort_s_size_lt_zero_h); + ATF_TP_ADD_TC(tp, qsort_s_size_gt_rmax_h); + ATF_TP_ADD_TC(tp, qsort_s_null_compar_h); + ATF_TP_ADD_TC(tp, qsort_s_h); + ATF_TP_ADD_TC(tp, qsort_s_test); + + return (atf_no_error()); +} From owner-svn-src-all@freebsd.org Mon Jan 20 11:45:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E73EE1F6D9A; Mon, 20 Jan 2020 11:45:18 +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 481VGQ5s7Tz4Pgq; Mon, 20 Jan 2020 11:45:18 +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 BFBE823196; Mon, 20 Jan 2020 11:45:18 +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 00KBjIFr075760; Mon, 20 Jan 2020 11:45:18 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KBjIBU075759; Mon, 20 Jan 2020 11:45:18 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202001201145.00KBjIBU075759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 20 Jan 2020 11:45:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356910 - head/lib/libc/tests/stdlib X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/lib/libc/tests/stdlib X-SVN-Commit-Revision: 356910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 11:45:19 -0000 Author: trasz Date: Mon Jan 20 11:45:18 2020 New Revision: 356910 URL: https://svnweb.freebsd.org/changeset/base/356910 Log: Add qsort_r(3) regression test. MFC after: 2 weeks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23206 Added: head/lib/libc/tests/stdlib/qsort_r_test.c (contents, props changed) Modified: head/lib/libc/tests/stdlib/Makefile Modified: head/lib/libc/tests/stdlib/Makefile ============================================================================== --- head/lib/libc/tests/stdlib/Makefile Mon Jan 20 11:40:07 2020 (r356909) +++ head/lib/libc/tests/stdlib/Makefile Mon Jan 20 11:45:18 2020 (r356910) @@ -6,6 +6,7 @@ ATF_TESTS_C+= dynthr_test ATF_TESTS_C+= heapsort_test ATF_TESTS_C+= mergesort_test ATF_TESTS_C+= qsort_test +ATF_TESTS_C+= qsort_r_test ATF_TESTS_C+= qsort_s_test ATF_TESTS_C+= set_constraint_handler_s_test ATF_TESTS_C+= strfmon_test Added: head/lib/libc/tests/stdlib/qsort_r_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/stdlib/qsort_r_test.c Mon Jan 20 11:45:18 2020 (r356910) @@ -0,0 +1,92 @@ +/*- + * Copyright (C) 2020 Edward Tomasz Napierala + * Copyright (C) 2004 Maxim Sobolev + * 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. + */ + +/* + * Test for qsort_r(3) routine. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include "test-sort.h" + +#define THUNK 42 + +static int +sorthelp_r(void *thunk, const void *a, const void *b) +{ + const int *oa, *ob; + + ATF_REQUIRE_EQ(*(int *)thunk, THUNK); + + oa = a; + ob = b; + /* Don't use "return *oa - *ob" since it's easy to cause overflow! */ + if (*oa > *ob) + return (1); + if (*oa < *ob) + return (-1); + return (0); +} + +ATF_TC_WITHOUT_HEAD(qsort_r_test); +ATF_TC_BODY(qsort_r_test, tc) +{ + int testvector[IVEC_LEN]; + int sresvector[IVEC_LEN]; + int i, j; + int thunk = THUNK; + + for (j = 2; j < IVEC_LEN; j++) { + /* Populate test vectors */ + for (i = 0; i < j; i++) + testvector[i] = sresvector[i] = initvector[i]; + + /* Sort using qsort_r(3) */ + qsort_r(testvector, j, sizeof(testvector[0]), &thunk, + sorthelp_r); + /* Sort using reference slow sorting routine */ + ssort(sresvector, j); + + /* Compare results */ + for (i = 0; i < j; i++) + ATF_CHECK_MSG(testvector[i] == sresvector[i], + "item at index %d didn't match: %d != %d", + i, testvector[i], sresvector[i]); + } +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, qsort_r_test); + + return (atf_no_error()); +} From owner-svn-src-all@freebsd.org Mon Jan 20 11:54:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2032E1F7132; Mon, 20 Jan 2020 11:54:01 +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 481VST00H6z4Q78; Mon, 20 Jan 2020 11:54:01 +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 EF2172335B; Mon, 20 Jan 2020 11:54:00 +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 00KBs0ZM081664; Mon, 20 Jan 2020 11:54:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KBs0tT081663; Mon, 20 Jan 2020 11:54:00 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001201154.00KBs0tT081663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 20 Jan 2020 11:54: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: r356911 - stable/12/sys/opencrypto X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/opencrypto X-SVN-Commit-Revision: 356911 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 11:54:01 -0000 Author: jhb Date: Mon Jan 20 11:54:00 2020 New Revision: 356911 URL: https://svnweb.freebsd.org/changeset/base/356911 Log: MFC 356561: Add stricter checking on mac key lengths. Negative lengths are always invalid. The key length should also be zero for hash algorithms that do not accept a key. admbugs: 949 Modified: stable/12/sys/opencrypto/cryptodev.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/opencrypto/cryptodev.c ============================================================================== --- stable/12/sys/opencrypto/cryptodev.c Mon Jan 20 11:45:18 2020 (r356910) +++ stable/12/sys/opencrypto/cryptodev.c Mon Jan 20 11:54:00 2020 (r356911) @@ -585,8 +585,8 @@ cryptof_ioctl( if (thash) { cria.cri_alg = thash->type; cria.cri_klen = sop->mackeylen * 8; - if (thash->keysize != 0 && - sop->mackeylen > thash->keysize) { + if (sop->mackeylen > thash->keysize || + sop->mackeylen < 0) { CRYPTDEB("invalid mac key length"); error = EINVAL; SDT_PROBE1(opencrypto, dev, ioctl, error, From owner-svn-src-all@freebsd.org Mon Jan 20 12:16:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 04B8E1F8A37; Mon, 20 Jan 2020 12:16:33 +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 481VyS6PYzz4RyN; Mon, 20 Jan 2020 12:16:32 +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 D6F8423701; Mon, 20 Jan 2020 12:16:32 +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 00KCGWTF094853; Mon, 20 Jan 2020 12:16:32 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KCGW7N094850; Mon, 20 Jan 2020 12:16:32 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202001201216.00KCGW7N094850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 20 Jan 2020 12:16:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356912 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 356912 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 12:16:33 -0000 Author: trasz Date: Mon Jan 20 12:16:32 2020 New Revision: 356912 URL: https://svnweb.freebsd.org/changeset/base/356912 Log: Properly translate MNT_FORCE flag to Linux umount2(2). Previously it worked by accident. MFC after: 2 weeks Sponsored by: DARPA Modified: head/sys/compat/linux/linux_file.c head/sys/compat/linux/linux_file.h Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Mon Jan 20 11:54:00 2020 (r356911) +++ head/sys/compat/linux/linux_file.c Mon Jan 20 12:16:32 2020 (r356912) @@ -1078,9 +1078,14 @@ int linux_umount(struct thread *td, struct linux_umount_args *args) { struct unmount_args bsd; + int flags; + flags = 0; + if ((args->flags & LINUX_MNT_FORCE) != 0) + flags |= MNT_FORCE; + bsd.path = args->path; - bsd.flags = args->flags; /* XXX correct? */ + bsd.flags = flags; return (sys_unmount(td, &bsd)); } #endif Modified: head/sys/compat/linux/linux_file.h ============================================================================== --- head/sys/compat/linux/linux_file.h Mon Jan 20 11:54:00 2020 (r356911) +++ head/sys/compat/linux/linux_file.h Mon Jan 20 12:16:32 2020 (r356912) @@ -57,6 +57,11 @@ #define LINUX_MS_REMOUNT 0x0020 /* + * umount2 flags + */ +#define LINUX_MNT_FORCE 0x0001 + +/* * common open/fcntl flags */ #define LINUX_O_RDONLY 00000000 From owner-svn-src-all@freebsd.org Mon Jan 20 12:53:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 875D61F9825; Mon, 20 Jan 2020 12:53:03 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 481Wmb322cz4TpP; Mon, 20 Jan 2020 12:53:03 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AD7323E6D; Mon, 20 Jan 2020 12:53:03 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00KCr3Z2020937; Mon, 20 Jan 2020 12:53:03 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KCr2lm020934; Mon, 20 Jan 2020 12:53:02 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <202001201253.00KCr2lm020934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Mon, 20 Jan 2020 12:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356913 - head/sys/dev/e1000 X-SVN-Group: head X-SVN-Commit-Author: gnn X-SVN-Commit-Paths: head/sys/dev/e1000 X-SVN-Commit-Revision: 356913 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 12:53:03 -0000 Author: gnn Date: Mon Jan 20 12:53:02 2020 New Revision: 356913 URL: https://svnweb.freebsd.org/changeset/base/356913 Log: Add support for latest Intel I219 device, supported in Lenovo Carbon X1 v7 MFC after: 2 weeks Modified: head/sys/dev/e1000/e1000_api.c head/sys/dev/e1000/e1000_hw.h head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/e1000_api.c ============================================================================== --- head/sys/dev/e1000/e1000_api.c Mon Jan 20 12:16:32 2020 (r356912) +++ head/sys/dev/e1000/e1000_api.c Mon Jan 20 12:53:02 2020 (r356913) @@ -319,6 +319,7 @@ s32 e1000_set_mac_type(struct e1000_hw *hw) case E1000_DEV_ID_PCH_ICP_I219_V8: case E1000_DEV_ID_PCH_ICP_I219_LM9: case E1000_DEV_ID_PCH_ICP_I219_V9: + case E1000_DEV_ID_PCH_ICP_I219_V10: mac->type = e1000_pch_cnp; break; case E1000_DEV_ID_82575EB_COPPER: Modified: head/sys/dev/e1000/e1000_hw.h ============================================================================== --- head/sys/dev/e1000/e1000_hw.h Mon Jan 20 12:16:32 2020 (r356912) +++ head/sys/dev/e1000/e1000_hw.h Mon Jan 20 12:53:02 2020 (r356913) @@ -155,6 +155,7 @@ struct e1000_hw; #define E1000_DEV_ID_PCH_ICP_I219_V8 0x15E0 #define E1000_DEV_ID_PCH_ICP_I219_LM9 0x15E1 #define E1000_DEV_ID_PCH_ICP_I219_V9 0x15E2 +#define E1000_DEV_ID_PCH_ICP_I219_V10 0x0D4F #define E1000_DEV_ID_82576 0x10C9 #define E1000_DEV_ID_82576_FIBER 0x10E6 #define E1000_DEV_ID_82576_SERDES 0x10E7 Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Mon Jan 20 12:16:32 2020 (r356912) +++ head/sys/dev/e1000/if_em.c Mon Jan 20 12:53:02 2020 (r356913) @@ -174,6 +174,7 @@ static pci_vendor_info_t em_vendor_info_array[] = PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V8, "Intel(R) PRO/1000 Network Connection"), PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_LM9, "Intel(R) PRO/1000 Network Connection"), PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V9, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_ICP_I219_V10, "Intel(R) PRO/1000 Network Connection"), /* required last entry */ PVID_END }; From owner-svn-src-all@freebsd.org Mon Jan 20 13:46:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4B5E1FA833; Mon, 20 Jan 2020 13:46:11 +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 481Xxv4LpJz4X37; Mon, 20 Jan 2020 13:46:11 +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 8C1002479D; Mon, 20 Jan 2020 13:46:11 +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 00KDkBkH056527; Mon, 20 Jan 2020 13:46:11 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KDkA06056518; Mon, 20 Jan 2020 13:46:10 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202001201346.00KDkA06056518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 20 Jan 2020 13:46:10 +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: r356914 - in stable: 11/contrib/unbound 11/lib/libunbound 11/usr.sbin/unbound 11/usr.sbin/unbound/anchor 11/usr.sbin/unbound/checkconf 11/usr.sbin/unbound/control 11/usr.sbin/unbound/da... X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/unbound 11/lib/libunbound 11/usr.sbin/unbound 11/usr.sbin/unbound/anchor 11/usr.sbin/unbound/checkconf 11/usr.sbin/unbound/control 11/usr.sbin/unbound/daemon 12/contrib/unbound 1... X-SVN-Commit-Revision: 356914 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 13:46:11 -0000 Author: cy Date: Mon Jan 20 13:46:09 2020 New Revision: 356914 URL: https://svnweb.freebsd.org/changeset/base/356914 Log: MFC r356676: Unbound's config.h is manually maintained, using a ./configure produced config.h as a guide. In practice contributed software maintains a copy of config.h within its build directory tree containing its Makefile. usr.sbin/unbound is the home for its config.h. Differential Revision: https://reviews.freebsd.org/D22983 Added: stable/11/usr.sbin/unbound/config.h (contents, props changed) - copied, changed from r356913, stable/11/contrib/unbound/config.h Deleted: stable/11/contrib/unbound/config.h Modified: stable/11/lib/libunbound/Makefile stable/11/usr.sbin/unbound/anchor/Makefile stable/11/usr.sbin/unbound/checkconf/Makefile stable/11/usr.sbin/unbound/control/Makefile stable/11/usr.sbin/unbound/daemon/Makefile Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Added: stable/12/usr.sbin/unbound/config.h - copied unchanged from r356676, head/usr.sbin/unbound/config.h Deleted: stable/12/contrib/unbound/config.h Modified: stable/12/lib/libunbound/Makefile stable/12/usr.sbin/unbound/anchor/Makefile stable/12/usr.sbin/unbound/checkconf/Makefile stable/12/usr.sbin/unbound/control/Makefile stable/12/usr.sbin/unbound/daemon/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/11/lib/libunbound/Makefile ============================================================================== --- stable/11/lib/libunbound/Makefile Mon Jan 20 12:53:02 2020 (r356913) +++ stable/11/lib/libunbound/Makefile Mon Jan 20 13:46:09 2020 (r356914) @@ -13,6 +13,7 @@ PRIVATELIB= PACKAGE= unbound CFLAGS+= -I${UNBOUNDDIR} -I${LDNSDIR} -I${.OBJDIR} +CFLAGS+= -I${SRCTOP}/usr.sbin/unbound SRCS= alloc.c as112.c authzone.c autotrust.c cachedb.c config_file.c \ configlexer.l configparser.y context.c dname.c dns.c dns64.c \ Modified: stable/11/usr.sbin/unbound/anchor/Makefile ============================================================================== --- stable/11/usr.sbin/unbound/anchor/Makefile Mon Jan 20 12:53:02 2020 (r356913) +++ stable/11/usr.sbin/unbound/anchor/Makefile Mon Jan 20 13:46:09 2020 (r356914) @@ -10,6 +10,7 @@ EXPATDIR= ${SRCTOP}/contrib/expat PROG= local-unbound-anchor SRCS= unbound-anchor.c CFLAGS+= -I${UNBOUNDDIR} -I${LDNSDIR} -I${EXPATDIR}/lib +CFLAGS+= -I${.CURDIR:H} -I${.CURDIR} LIBADD= unbound bsdxml ssl crypto pthread MAN= local-unbound-anchor.8 Modified: stable/11/usr.sbin/unbound/checkconf/Makefile ============================================================================== --- stable/11/usr.sbin/unbound/checkconf/Makefile Mon Jan 20 12:53:02 2020 (r356913) +++ stable/11/usr.sbin/unbound/checkconf/Makefile Mon Jan 20 13:46:09 2020 (r356914) @@ -9,6 +9,7 @@ UNBOUNDDIR= ${SRCTOP}/contrib/unbound PROG= local-unbound-checkconf SRCS= ub_event.c unbound-checkconf.c worker_cb.c CFLAGS+= -I${UNBOUNDDIR} -I${LDNSDIR} +CFLAGS+= -I${.CURDIR:H} -I${.CURDIR} LIBADD= unbound pthread MAN= local-unbound-checkconf.8 Copied and modified: stable/11/usr.sbin/unbound/config.h (from r356913, stable/11/contrib/unbound/config.h) ============================================================================== --- stable/11/contrib/unbound/config.h Mon Jan 20 12:53:02 2020 (r356913, copy source) +++ stable/11/usr.sbin/unbound/config.h Mon Jan 20 13:46:09 2020 (r356914) @@ -1,5 +1,6 @@ /* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ +/* $FreeBSD$ */ /* apply the noreturn attribute to a function that exits the program */ #define ATTR_NORETURN __attribute__((__noreturn__)) Modified: stable/11/usr.sbin/unbound/control/Makefile ============================================================================== --- stable/11/usr.sbin/unbound/control/Makefile Mon Jan 20 12:53:02 2020 (r356913) +++ stable/11/usr.sbin/unbound/control/Makefile Mon Jan 20 13:46:09 2020 (r356914) @@ -9,6 +9,7 @@ UNBOUNDDIR= ${SRCTOP}/contrib/unbound PROG= local-unbound-control SRCS= ub_event.c unbound-control.c worker_cb.c CFLAGS+= -I${UNBOUNDDIR} -I${LDNSDIR} +CFLAGS+= -I${.CURDIR:H} -I${.CURDIR} LIBADD= unbound crypto ssl pthread MAN= local-unbound-control.8 Modified: stable/11/usr.sbin/unbound/daemon/Makefile ============================================================================== --- stable/11/usr.sbin/unbound/daemon/Makefile Mon Jan 20 12:53:02 2020 (r356913) +++ stable/11/usr.sbin/unbound/daemon/Makefile Mon Jan 20 13:46:09 2020 (r356914) @@ -10,6 +10,7 @@ PROG= local-unbound SRCS= acl_list.c cachedump.c daemon.c remote.c shm_main.c stats.c \ ub_event.c unbound.c worker.c CFLAGS+= -I${UNBOUNDDIR} -I${LDNSDIR} +CFLAGS+= -I${.CURDIR:H} -I${.CURDIR} LIBADD= unbound util ssl crypto pthread MAN= local-unbound.8 local-unbound.conf.5 From owner-svn-src-all@freebsd.org Mon Jan 20 13:46:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 70C711FA839; Mon, 20 Jan 2020 13:46:12 +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 481Xxw2xjgz4X38; Mon, 20 Jan 2020 13:46:12 +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 601CB2479E; Mon, 20 Jan 2020 13:46:12 +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 00KDkC3X056539; Mon, 20 Jan 2020 13:46:12 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KDkBgN056533; Mon, 20 Jan 2020 13:46:11 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202001201346.00KDkBgN056533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 20 Jan 2020 13:46: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: r356914 - in stable: 11/contrib/unbound 11/lib/libunbound 11/usr.sbin/unbound 11/usr.sbin/unbound/anchor 11/usr.sbin/unbound/checkconf 11/usr.sbin/unbound/control 11/usr.sbin/unbound/da... X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/unbound 11/lib/libunbound 11/usr.sbin/unbound 11/usr.sbin/unbound/anchor 11/usr.sbin/unbound/checkconf 11/usr.sbin/unbound/control 11/usr.sbin/unbound/daemon 12/contrib/unbound 1... X-SVN-Commit-Revision: 356914 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 13:46:12 -0000 Author: cy Date: Mon Jan 20 13:46:09 2020 New Revision: 356914 URL: https://svnweb.freebsd.org/changeset/base/356914 Log: MFC r356676: Unbound's config.h is manually maintained, using a ./configure produced config.h as a guide. In practice contributed software maintains a copy of config.h within its build directory tree containing its Makefile. usr.sbin/unbound is the home for its config.h. Differential Revision: https://reviews.freebsd.org/D22983 Added: stable/12/usr.sbin/unbound/config.h - copied unchanged from r356676, head/usr.sbin/unbound/config.h Deleted: stable/12/contrib/unbound/config.h Modified: stable/12/lib/libunbound/Makefile stable/12/usr.sbin/unbound/anchor/Makefile stable/12/usr.sbin/unbound/checkconf/Makefile stable/12/usr.sbin/unbound/control/Makefile stable/12/usr.sbin/unbound/daemon/Makefile Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Added: stable/11/usr.sbin/unbound/config.h (contents, props changed) - copied, changed from r356913, stable/11/contrib/unbound/config.h Deleted: stable/11/contrib/unbound/config.h Modified: stable/11/lib/libunbound/Makefile stable/11/usr.sbin/unbound/anchor/Makefile stable/11/usr.sbin/unbound/checkconf/Makefile stable/11/usr.sbin/unbound/control/Makefile stable/11/usr.sbin/unbound/daemon/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/12/lib/libunbound/Makefile ============================================================================== --- stable/12/lib/libunbound/Makefile Mon Jan 20 12:53:02 2020 (r356913) +++ stable/12/lib/libunbound/Makefile Mon Jan 20 13:46:09 2020 (r356914) @@ -13,6 +13,7 @@ PRIVATELIB= PACKAGE= unbound CFLAGS+= -I${UNBOUNDDIR} -I${LDNSDIR} -I${.OBJDIR} +CFLAGS+= -I${SRCTOP}/usr.sbin/unbound SRCS= alloc.c as112.c authzone.c autotrust.c cachedb.c config_file.c \ configlexer.l configparser.y context.c dname.c dns.c dns64.c \ Modified: stable/12/usr.sbin/unbound/anchor/Makefile ============================================================================== --- stable/12/usr.sbin/unbound/anchor/Makefile Mon Jan 20 12:53:02 2020 (r356913) +++ stable/12/usr.sbin/unbound/anchor/Makefile Mon Jan 20 13:46:09 2020 (r356914) @@ -10,6 +10,7 @@ EXPATDIR= ${SRCTOP}/contrib/expat PROG= local-unbound-anchor SRCS= unbound-anchor.c CFLAGS+= -I${UNBOUNDDIR} -I${LDNSDIR} -I${EXPATDIR}/lib +CFLAGS+= -I${.CURDIR:H} -I${.CURDIR} LIBADD= unbound bsdxml ssl crypto pthread MAN= local-unbound-anchor.8 Modified: stable/12/usr.sbin/unbound/checkconf/Makefile ============================================================================== --- stable/12/usr.sbin/unbound/checkconf/Makefile Mon Jan 20 12:53:02 2020 (r356913) +++ stable/12/usr.sbin/unbound/checkconf/Makefile Mon Jan 20 13:46:09 2020 (r356914) @@ -9,6 +9,7 @@ UNBOUNDDIR= ${SRCTOP}/contrib/unbound PROG= local-unbound-checkconf SRCS= ub_event.c unbound-checkconf.c worker_cb.c CFLAGS+= -I${UNBOUNDDIR} -I${LDNSDIR} +CFLAGS+= -I${.CURDIR:H} -I${.CURDIR} LIBADD= unbound pthread MAN= local-unbound-checkconf.8 Copied: stable/12/usr.sbin/unbound/config.h (from r356676, head/usr.sbin/unbound/config.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/usr.sbin/unbound/config.h Mon Jan 20 13:46:09 2020 (r356914, copy of r356676, head/usr.sbin/unbound/config.h) @@ -0,0 +1,1338 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ +/* $FreeBSD$ */ + +/* apply the noreturn attribute to a function that exits the program */ +#define ATTR_NORETURN __attribute__((__noreturn__)) + +/* apply the weak attribute to a symbol */ +#define ATTR_WEAK __attribute__((weak)) + +/* Directory to chroot to */ +#define CHROOT_DIR "/var/unbound" + +/* Define this to enable client subnet option. */ +/* #undef CLIENT_SUBNET */ + +/* Do sha512 definitions in config.h */ +/* #undef COMPAT_SHA512 */ + +/* Command line arguments used with configure */ +#define CONFCMDLINE "--with-ssl=/usr --with-libexpat=/usr --disable-dnscrypt --disable-dnstap --enable-ecdsa --disable-event-api --enable-gost --with-libevent --disable-subnet --disable-tfo-client --disable-tfo-server --with-pthreads--prefix=/usr --localstatedir=/var/unbound --mandir=/usr/share/man --build=freebsd" + +/* Pathname to the Unbound configuration file */ +#define CONFIGFILE "/var/unbound/unbound.conf" + +/* Define this if on macOSX10.4-darwin8 and setreuid and setregid do not work + */ +/* #undef DARWIN_BROKEN_SETREUID */ + +/* Whether daemon is deprecated */ +/* #undef DEPRECATED_DAEMON */ + +/* default dnstap socket path */ +/* #undef DNSTAP_SOCKET_PATH */ + +/* Define if you want to use debug lock checking (slow). */ +/* #undef ENABLE_LOCK_CHECKS */ + +/* Define this if you enabled-allsymbols from libunbound to link binaries to + it for smaller install size, but the libunbound export table is polluted by + internal symbols */ +/* #undef EXPORT_ALL_SYMBOLS */ + +/* Define to 1 if you have the `accept4' function. */ +#define HAVE_ACCEPT4 1 + +/* Define to 1 if you have the `arc4random' function. */ +#define HAVE_ARC4RANDOM 1 + +/* Define to 1 if you have the `arc4random_uniform' function. */ +#define HAVE_ARC4RANDOM_UNIFORM 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Whether the C compiler accepts the "format" attribute */ +#define HAVE_ATTR_FORMAT 1 + +/* Whether the C compiler accepts the "noreturn" attribute */ +#define HAVE_ATTR_NORETURN 1 + +/* Whether the C compiler accepts the "unused" attribute */ +#define HAVE_ATTR_UNUSED 1 + +/* Whether the C compiler accepts the "weak" attribute */ +#define HAVE_ATTR_WEAK 1 + +/* Define to 1 if you have the `chown' function. */ +#define HAVE_CHOWN 1 + +/* Define to 1 if you have the `chroot' function. */ +#define HAVE_CHROOT 1 + +/* Define to 1 if you have the `CRYPTO_cleanup_all_ex_data' function. */ +/* #undef HAVE_CRYPTO_CLEANUP_ALL_EX_DATA */ + +/* Define to 1 if you have the `CRYPTO_THREADID_set_callback' function. */ +/* #undef HAVE_CRYPTO_THREADID_SET_CALLBACK */ + +/* Define to 1 if you have the `ctime_r' function. */ +#define HAVE_CTIME_R 1 + +/* Define to 1 if you have the `daemon' function. */ +#define HAVE_DAEMON 1 + +/* Define to 1 if you have the declaration of `arc4random', and to 0 if you + don't. */ +/* #undef HAVE_DECL_ARC4RANDOM */ + +/* Define to 1 if you have the declaration of `arc4random_uniform', and to 0 + if you don't. */ +/* #undef HAVE_DECL_ARC4RANDOM_UNIFORM */ + +/* Define to 1 if you have the declaration of `evsignal_assign', and to 0 if + you don't. */ +/* #undef HAVE_DECL_EVSIGNAL_ASSIGN */ + +/* Define to 1 if you have the declaration of `inet_ntop', and to 0 if you + don't. */ +#define HAVE_DECL_INET_NTOP 1 + +/* Define to 1 if you have the declaration of `inet_pton', and to 0 if you + don't. */ +#define HAVE_DECL_INET_PTON 1 + +/* Define to 1 if you have the declaration of `NID_ED25519', and to 0 if you + don't. */ +#define HAVE_DECL_NID_ED25519 1 + +/* Define to 1 if you have the declaration of `NID_ED448', and to 0 if you + don't. */ +#define HAVE_DECL_NID_ED448 1 + +/* Define to 1 if you have the declaration of `NID_secp384r1', and to 0 if you + don't. */ +#define HAVE_DECL_NID_SECP384R1 1 + +/* Define to 1 if you have the declaration of `NID_X9_62_prime256v1', and to 0 + if you don't. */ +#define HAVE_DECL_NID_X9_62_PRIME256V1 1 + +/* Define to 1 if you have the declaration of `reallocarray', and to 0 if you + don't. */ +#define HAVE_DECL_REALLOCARRAY 1 + +/* Define to 1 if you have the declaration of `redisConnect', and to 0 if you + don't. */ +/* #undef HAVE_DECL_REDISCONNECT */ + +/* Define to 1 if you have the declaration of `sk_SSL_COMP_pop_free', and to 0 + if you don't. */ +#define HAVE_DECL_SK_SSL_COMP_POP_FREE 1 + +/* Define to 1 if you have the declaration of + `SSL_COMP_get_compression_methods', and to 0 if you don't. */ +#define HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS 1 + +/* Define to 1 if you have the declaration of `SSL_CTX_set_ecdh_auto', and to + 0 if you don't. */ +#define HAVE_DECL_SSL_CTX_SET_ECDH_AUTO 1 + +/* Define to 1 if you have the declaration of `strlcat', and to 0 if you + don't. */ +/* #undef HAVE_DECL_STRLCAT */ + +/* Define to 1 if you have the declaration of `strlcpy', and to 0 if you + don't. */ +/* #undef HAVE_DECL_STRLCPY */ + +/* Define to 1 if you have the declaration of `XML_StopParser', and to 0 if + you don't. */ +#define HAVE_DECL_XML_STOPPARSER 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the `DSA_SIG_set0' function. */ +#define HAVE_DSA_SIG_SET0 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ENDIAN_H */ + +/* Define to 1 if you have the `endprotoent' function. */ +#define HAVE_ENDPROTOENT 1 + +/* Define to 1 if you have the `endpwent' function. */ +#define HAVE_ENDPWENT 1 + +/* Define to 1 if you have the `endservent' function. */ +#define HAVE_ENDSERVENT 1 + +/* Define to 1 if you have the `ERR_free_strings' function. */ +/* #undef HAVE_ERR_FREE_STRINGS */ + +/* Define to 1 if you have the `ERR_load_crypto_strings' function. */ +/* #undef HAVE_ERR_LOAD_CRYPTO_STRINGS */ + +/* Define to 1 if you have the `event_assign' function. */ +/* #undef HAVE_EVENT_ASSIGN */ + +/* Define to 1 if you have the `event_base_free' function. */ +/* #undef HAVE_EVENT_BASE_FREE */ + +/* Define to 1 if you have the `event_base_get_method' function. */ +/* #undef HAVE_EVENT_BASE_GET_METHOD */ + +/* Define to 1 if you have the `event_base_new' function. */ +/* #undef HAVE_EVENT_BASE_NEW */ + +/* Define to 1 if you have the `event_base_once' function. */ +/* #undef HAVE_EVENT_BASE_ONCE */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_EVENT_H */ + +/* Define to 1 if you have the `EVP_aes_256_cbc' function. */ +#define HAVE_EVP_AES_256_CBC 1 + +/* Define to 1 if you have the `EVP_cleanup' function. */ +/* #undef HAVE_EVP_CLEANUP */ + +/* Define to 1 if you have the `EVP_DigestVerify' function. */ +#define HAVE_EVP_DIGESTVERIFY 1 + +/* Define to 1 if you have the `EVP_dss1' function. */ +/* #undef HAVE_EVP_DSS1 */ + +/* Define to 1 if you have the `EVP_EncryptInit_ex' function. */ +#define HAVE_EVP_ENCRYPTINIT_EX 1 + +/* Define to 1 if you have the `EVP_MD_CTX_new' function. */ +#define HAVE_EVP_MD_CTX_NEW 1 + +/* Define to 1 if you have the `EVP_sha1' function. */ +#define HAVE_EVP_SHA1 1 + +/* Define to 1 if you have the `EVP_sha256' function. */ +#define HAVE_EVP_SHA256 1 + +/* Define to 1 if you have the `EVP_sha512' function. */ +#define HAVE_EVP_SHA512 1 + +/* Define to 1 if you have the `ev_default_loop' function. */ +/* #undef HAVE_EV_DEFAULT_LOOP */ + +/* Define to 1 if you have the `ev_loop' function. */ +/* #undef HAVE_EV_LOOP */ + +/* Define to 1 if you have the header file. */ +#define HAVE_EXPAT_H 1 + +/* Define to 1 if you have the `explicit_bzero' function. */ +#define HAVE_EXPLICIT_BZERO 1 + +/* Define to 1 if you have the `fcntl' function. */ +#define HAVE_FCNTL 1 + +/* Define to 1 if you have the `FIPS_mode' function. */ +#define HAVE_FIPS_MODE 1 + +/* Define to 1 if you have the `fork' function. */ +#define HAVE_FORK 1 + +/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ +#define HAVE_FSEEKO 1 + +/* Define to 1 if you have the `fsync' function. */ +#define HAVE_FSYNC 1 + +/* Whether getaddrinfo is available */ +#define HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the `getauxval' function. */ +/* #undef HAVE_GETAUXVAL */ + +/* Define to 1 if you have the `getentropy' function. */ +/* #undef HAVE_GETENTROPY */ + +/* Define to 1 if you have the header file. */ +#define HAVE_GETOPT_H 1 + +/* Define to 1 if you have the `getpwnam' function. */ +#define HAVE_GETPWNAM 1 + +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + +/* Define to 1 if you have the `glob' function. */ +#define HAVE_GLOB 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_GLOB_H 1 + +/* Define to 1 if you have the `gmtime_r' function. */ +#define HAVE_GMTIME_R 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_GRP_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_HIREDIS_HIREDIS_H */ + +/* Define to 1 if you have the `HMAC_Init_ex' function. */ +#define HAVE_HMAC_INIT_EX 1 + +/* If you have HMAC_Update */ +#define HAVE_HMAC_UPDATE 1 + +/* Define to 1 if you have the `inet_aton' function. */ +#define HAVE_INET_ATON 1 + +/* Define to 1 if you have the `inet_ntop' function. */ +#define HAVE_INET_NTOP 1 + +/* Define to 1 if you have the `inet_pton' function. */ +#define HAVE_INET_PTON 1 + +/* Define to 1 if you have the `initgroups' function. */ +#define HAVE_INITGROUPS 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* if the function 'ioctlsocket' is available */ +/* #undef HAVE_IOCTLSOCKET */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_IPHLPAPI_H */ + +/* Define to 1 if you have the `isblank' function. */ +#define HAVE_ISBLANK 1 + +/* Define to 1 if you have the `kill' function. */ +#define HAVE_KILL 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBKERN_OSBYTEORDER_H */ + +/* Define if we have LibreSSL */ +/* #undef HAVE_LIBRESSL */ + +/* Define to 1 if you have the `localtime_r' function. */ +#define HAVE_LOCALTIME_R 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LOGIN_CAP_H 1 + +/* If have GNU libc compatible malloc */ +#define HAVE_MALLOC 1 + +/* Define to 1 if you have the `memmove' function. */ +#define HAVE_MEMMOVE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_TCP_H 1 + +/* Use libnettle for crypto */ +/* #undef HAVE_NETTLE */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETTLE_DSA_COMPAT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETTLE_EDDSA_H */ + +/* Use libnss for crypto */ +/* #undef HAVE_NSS */ + +/* Define to 1 if you have the `OpenSSL_add_all_digests' function. */ +/* #undef HAVE_OPENSSL_ADD_ALL_DIGESTS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_BN_H 1 + +/* Define to 1 if you have the `OPENSSL_config' function. */ +#define HAVE_OPENSSL_CONFIG 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_CONF_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_DH_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_DSA_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_ENGINE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_ERR_H 1 + +/* Define to 1 if you have the `OPENSSL_init_crypto' function. */ +#define HAVE_OPENSSL_INIT_CRYPTO 1 + +/* Define to 1 if you have the `OPENSSL_init_ssl' function. */ +#define HAVE_OPENSSL_INIT_SSL 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_RAND_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_RSA_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_SSL_H 1 + +/* Define if you have POSIX threads libraries and header files. */ +#define HAVE_PTHREAD 1 + +/* Have PTHREAD_PRIO_INHERIT. */ +#define HAVE_PTHREAD_PRIO_INHERIT 1 + +/* Define to 1 if the system has the type `pthread_rwlock_t'. */ +#define HAVE_PTHREAD_RWLOCK_T 1 + +/* Define to 1 if the system has the type `pthread_spinlock_t'. */ +#define HAVE_PTHREAD_SPINLOCK_T 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_PWD_H 1 + +/* Define if you have Python libraries and header files. */ +/* #undef HAVE_PYTHON */ + +/* Define to 1 if you have the `random' function. */ +#define HAVE_RANDOM 1 + +/* Define to 1 if you have the `RAND_cleanup' function. */ +/* #undef HAVE_RAND_CLEANUP */ + +/* If we have reallocarray(3) */ +#define HAVE_REALLOCARRAY 1 + +/* Define to 1 if you have the `recvmsg' function. */ +#define HAVE_RECVMSG 1 + +/* Define to 1 if you have the `sendmsg' function. */ +#define HAVE_SENDMSG 1 + +/* Define to 1 if you have the `setregid' function. */ +/* #undef HAVE_SETREGID */ + +/* Define to 1 if you have the `setresgid' function. */ +#define HAVE_SETRESGID 1 + +/* Define to 1 if you have the `setresuid' function. */ +#define HAVE_SETRESUID 1 + +/* Define to 1 if you have the `setreuid' function. */ +/* #undef HAVE_SETREUID */ + +/* Define to 1 if you have the `setrlimit' function. */ +#define HAVE_SETRLIMIT 1 + +/* Define to 1 if you have the `setsid' function. */ +#define HAVE_SETSID 1 + +/* Define to 1 if you have the `setusercontext' function. */ +#define HAVE_SETUSERCONTEXT 1 + +/* Define to 1 if you have the `SHA512_Update' function. */ +/* #undef HAVE_SHA512_UPDATE */ + +/* Define to 1 if you have the `shmget' function. */ +#define HAVE_SHMGET 1 + +/* Define to 1 if you have the `sigprocmask' function. */ +#define HAVE_SIGPROCMASK 1 + +/* Define to 1 if you have the `sleep' function. */ +#define HAVE_SLEEP 1 + +/* Define to 1 if you have the `snprintf' function. */ +#define HAVE_SNPRINTF 1 + +/* Define to 1 if you have the `socketpair' function. */ +#define HAVE_SOCKETPAIR 1 + +/* Using Solaris threads */ +/* #undef HAVE_SOLARIS_THREADS */ + +/* Define to 1 if you have the `srandom' function. */ +#define HAVE_SRANDOM 1 + +/* Define if you have the SSL libraries installed. */ +#define HAVE_SSL /**/ + +/* Define to 1 if you have the `SSL_CTX_set_ciphersuites' function. */ +#define HAVE_SSL_CTX_SET_CIPHERSUITES 1 + +/* Define to 1 if you have the `SSL_CTX_set_security_level' function. */ +#define HAVE_SSL_CTX_SET_SECURITY_LEVEL 1 + +/* Define to 1 if you have the `SSL_CTX_set_tlsext_ticket_key_cb' function. */ +/* #undef HAVE_SSL_CTX_SET_TLSEXT_TICKET_KEY_CB */ + +/* Define to 1 if you have the `SSL_get0_peername' function. */ +#define HAVE_SSL_GET0_PEERNAME 1 + +/* Define to 1 if you have the `SSL_set1_host' function. */ +#define HAVE_SSL_SET1_HOST 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDARG_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDBOOL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strftime' function. */ +#define HAVE_STRFTIME 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlcat' function. */ +#define HAVE_STRLCAT 1 + +/* Define to 1 if you have the `strlcpy' function. */ +#define HAVE_STRLCPY 1 + +/* Define to 1 if you have the `strptime' function. */ +#define HAVE_STRPTIME 1 + +/* Define to 1 if you have the `strsep' function. */ +#define HAVE_STRSEP 1 + +/* Define to 1 if `ipi_spec_dst' is a member of `struct in_pktinfo'. */ +/* #undef HAVE_STRUCT_IN_PKTINFO_IPI_SPEC_DST */ + +/* Define to 1 if `sun_len' is a member of `struct sockaddr_un'. */ +#define HAVE_STRUCT_SOCKADDR_UN_SUN_LEN 1 + +/* Define if you have Swig libraries and header files. */ +/* #undef HAVE_SWIG */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYSLOG_H 1 + +/* Define to 1 if systemd should be used */ +/* #undef HAVE_SYSTEMD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_ENDIAN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_IPC_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SHA2_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SHM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SYSCTL_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_UIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_UN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TIME_H 1 + +/* Define to 1 if you have the `tzset' function. */ +#define HAVE_TZSET 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `usleep' function. */ +#define HAVE_USLEEP 1 + +/* Define to 1 if you have the `vfork' function. */ +#define HAVE_VFORK 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_VFORK_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + +/* Using Windows threads */ +/* #undef HAVE_WINDOWS_THREADS */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINSOCK2_H */ + +/* Define to 1 if `fork' works. */ +#define HAVE_WORKING_FORK 1 + +/* Define to 1 if `vfork' works. */ +#define HAVE_WORKING_VFORK 1 + +/* Define to 1 if you have the `writev' function. */ +#define HAVE_WRITEV 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WS2TCPIP_H */ + +/* Define to 1 if you have the `X509_VERIFY_PARAM_set1_host' function. */ +#define HAVE_X509_VERIFY_PARAM_SET1_HOST 1 + +/* Define to 1 if you have the `_beginthreadex' function. */ +/* #undef HAVE__BEGINTHREADEX */ + +/* If HMAC_Init_ex() returns void */ +/* #undef HMAC_INIT_EX_RETURNS_VOID */ + +/* if lex has yylex_destroy */ +#define LEX_HAS_YYLEX_DESTROY 1 + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* Define to the maximum message length to pass to syslog. */ +#define MAXSYSLOGMSGLEN 10240 + +/* Define if memcmp() does not compare unsigned bytes */ +/* #undef MEMCMP_IS_BROKEN */ + +/* Define if mkdir has one argument. */ +/* #undef MKDIR_HAS_ONE_ARG */ + +/* Define if the network stack does not fully support nonblocking io (causes + lower performance). */ +/* #undef NONBLOCKING_IS_BROKEN */ + +/* Put -D_ALL_SOURCE define in config.h */ +/* #undef OMITTED__D_ALL_SOURCE */ + +/* Put -D_BSD_SOURCE define in config.h */ +/* #undef OMITTED__D_BSD_SOURCE */ + +/* Put -D_DEFAULT_SOURCE define in config.h */ +/* #undef OMITTED__D_DEFAULT_SOURCE */ + +/* Put -D_GNU_SOURCE define in config.h */ +/* #undef OMITTED__D_GNU_SOURCE */ + +/* Put -D_LARGEFILE_SOURCE=1 define in config.h */ +/* #undef OMITTED__D_LARGEFILE_SOURCE_1 */ + +/* Put -D_POSIX_C_SOURCE=200112 define in config.h */ +/* #undef OMITTED__D_POSIX_C_SOURCE_200112 */ + +/* Put -D_XOPEN_SOURCE=600 define in config.h */ +/* #undef OMITTED__D_XOPEN_SOURCE_600 */ + +/* Put -D_XOPEN_SOURCE_EXTENDED=1 define in config.h */ +/* #undef OMITTED__D_XOPEN_SOURCE_EXTENDED_1 */ + +/* Put -D__EXTENSIONS__ define in config.h */ +/* #undef OMITTED__D__EXTENSIONS__ */ + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "unbound-bugs@nlnetlabs.nl or https://github.com/NLnetLabs/unbound/issues" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "unbound" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "unbound 1.9.6" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "unbound" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.9.6" + +/* default pidfile location */ +#define PIDFILE "/var/unbound/unbound.pid" + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +/* #undef PTHREAD_CREATE_JOINABLE */ + +/* Define as the return type of signal handlers (`int' or `void'). */ +#define RETSIGTYPE void + +/* if REUSEPORT is enabled by default */ +#define REUSEPORT_DEFAULT 0 + +/* default rootkey location */ +#define ROOT_ANCHOR_FILE "/var/unbound/root.key" + +/* default rootcert location */ +#define ROOT_CERT_FILE "/var/unbound/icannbundle.pem" + +/* version number for resource files */ +#define RSRC_PACKAGE_VERSION 1,9,6,0 + +/* Directory to chdir to */ +#define RUN_DIR "/var/unbound" + +/* Shared data */ +#define SHARE_DIR "/var/unbound" + +/* The size of `size_t'. */ +#ifdef __LP64__ +#define SIZEOF_SIZE_T 8 +#else +#define SIZEOF_SIZE_T 4 +#endif + +/* The size of `time_t', as computed by sizeof. */ +#ifdef __i386__ +#define SIZEOF_TIME_T 4 +#else +#define SIZEOF_TIME_T 8 +#endif + +/* define if (v)snprintf does not return length needed, (but length used) */ +/* #undef SNPRINTF_RET_BROKEN */ + +/* Define to 1 if libsodium supports sodium_set_misuse_handler */ +/* #undef SODIUM_MISUSE_HANDLER */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* use default strptime. */ +#define STRPTIME_WORKS 1 + +/* Use win32 resources and API */ +/* #undef UB_ON_WINDOWS */ + +/* the SYSLOG_FACILITY to use, default LOG_DAEMON */ +#define UB_SYSLOG_FACILITY LOG_DAEMON + +/* default username */ +#define UB_USERNAME "unbound" + +/* use to enable lightweight alloc assertions, for debug use */ +/* #undef UNBOUND_ALLOC_LITE */ + +/* use malloc not regions, for debug use */ +/* #undef UNBOUND_ALLOC_NONREGIONAL */ + +/* use statistics for allocs and frees, for debug use */ +/* #undef UNBOUND_ALLOC_STATS */ + +/* define this to enable debug checks. */ +/* #undef UNBOUND_DEBUG */ + +/* Define to 1 to use cachedb support */ +/* #undef USE_CACHEDB */ + +/* Define to 1 to enable dnscrypt support */ +/* #undef USE_DNSCRYPT */ + +/* Define to 1 to enable dnscrypt with xchacha20 support */ +/* #undef USE_DNSCRYPT_XCHACHA20 */ + +/* Define to 1 to enable dnstap support */ +/* #undef USE_DNSTAP */ + +/* Define this to enable DSA support. */ +#define USE_DSA 1 + +/* Define this to enable ECDSA support. */ +#define USE_ECDSA 1 + +/* Define this to enable an EVP workaround for older openssl */ +/* #undef USE_ECDSA_EVP_WORKAROUND */ + +/* Define this to enable ED25519 support. */ +#define USE_ED25519 1 + +/* Define this to enable ED448 support. */ +#define USE_ED448 1 + +/* Define this to enable GOST support. */ +/* #undef USE_GOST */ + +/* Define to 1 to use ipsecmod support. */ +/* #undef USE_IPSECMOD */ + +/* Define to 1 to use ipset support */ +/* #undef USE_IPSET */ + +/* Define if you want to use internal select based events */ +#define USE_MINI_EVENT 1 + +/* Define this to enable client TCP Fast Open. */ +/* #undef USE_MSG_FASTOPEN */ + +/* Define this to enable client TCP Fast Open. */ +/* #undef USE_OSX_MSG_FASTOPEN */ + +/* Define this to use hiredis client. */ +/* #undef USE_REDIS */ + +/* Define this to enable SHA1 support. */ +#define USE_SHA1 1 + +/* Define this to enable SHA256 and SHA512 support. */ +#define USE_SHA2 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Define this to enable server TCP Fast Open. */ +/* #undef USE_TCP_FASTOPEN */ + +/* Whether the windows socket API is used */ +/* #undef USE_WINSOCK */ + +/* the version of the windows API enabled */ +#define WINVER 0x0502 + +/* Define if you want Python module. */ +/* #undef WITH_PYTHONMODULE */ + +/* Define if you want PyUnbound. */ +/* #undef WITH_PYUNBOUND */ + +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +#define YYTEXT_POINTER 1 + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ +/* #undef _LARGEFILE_SOURCE */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Enable for compile on Minix */ +/* #undef _NETBSD_SOURCE */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `int' if doesn't define. */ +/* #undef gid_t */ + +/* in_addr_t */ +/* #undef in_addr_t */ + +/* in_port_t */ +/* #undef in_port_t */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `short' if does not define. */ +/* #undef int16_t */ + +/* Define to `int' if does not define. */ +/* #undef int32_t */ + +/* Define to `long long' if does not define. */ +/* #undef int64_t */ + +/* Define to `signed char' if does not define. */ +/* #undef int8_t */ + +/* Define if replacement function should be used. */ +/* #undef malloc */ + +/* Define to `long int' if does not define. */ +/* #undef off_t */ + +/* Define to `int' if does not define. */ +/* #undef pid_t */ + +/* Define to 'int' if not defined */ +/* #undef rlim_t */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ + +/* Define to 'int' if not defined */ +/* #undef socklen_t */ + +/* Define to `int' if does not define. */ +/* #undef ssize_t */ + +/* Define to 'unsigned char if not defined */ +/* #undef u_char */ + +/* Define to `int' if doesn't define. */ +/* #undef uid_t */ + +/* Define to `unsigned short' if does not define. */ +/* #undef uint16_t */ + +/* Define to `unsigned int' if does not define. */ +/* #undef uint32_t */ + +/* Define to `unsigned long long' if does not define. */ +/* #undef uint64_t */ + +/* Define to `unsigned char' if does not define. */ +/* #undef uint8_t */ + +/* Define as `fork' if `vfork' does not work. */ +/* #undef vfork */ + +#if defined(OMITTED__D_GNU_SOURCE) && !defined(_GNU_SOURCE) +#define _GNU_SOURCE 1 +#endif + +#if defined(OMITTED__D_BSD_SOURCE) && !defined(_BSD_SOURCE) +#define _BSD_SOURCE 1 +#endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jan 20 14:42:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 30A851FCC27; Mon, 20 Jan 2020 14:42:12 +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 481ZBX0Y6lz4bqG; Mon, 20 Jan 2020 14:42:12 +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 0E223252AB; Mon, 20 Jan 2020 14:42:12 +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 00KEgBQG096684; Mon, 20 Jan 2020 14:42:11 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KEgBVT096683; Mon, 20 Jan 2020 14:42:11 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001201442.00KEgBVT096683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 20 Jan 2020 14:42:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356915 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356915 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 14:42:12 -0000 Author: mjg Date: Mon Jan 20 14:42:11 2020 New Revision: 356915 URL: https://svnweb.freebsd.org/changeset/base/356915 Log: cache: make numcachehv use counter(9) on all archs Requested by: kib Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Mon Jan 20 13:46:09 2020 (r356914) +++ head/sys/kern/vfs_cache.c Mon Jan 20 14:42:11 2020 (r356915) @@ -340,16 +340,6 @@ SYSCTL_INT(_debug_sizeof, OID_AUTO, namecache, CTLFLAG sizeof(struct namecache), "sizeof(struct namecache)"); /* - * Use counter(9) for numcachehv if the machine is 64-bit. - * - * Stick to an atomic for the rest since there is no long-sized equivalent and - * 64-bit size is both way more than needed and a pessimization. - */ -#ifdef __LP64__ -#define CACHE_NUMCACHEHV_U64 -#endif - -/* * The new name cache statistics */ static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW, 0, @@ -361,12 +351,7 @@ static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW, SYSCTL_COUNTER_U64(_vfs_cache, OID_AUTO, name, CTLFLAG_RD, &name, descr); STATNODE_ULONG(numneg, "Number of negative cache entries"); STATNODE_ULONG(numcache, "Number of cache entries"); -#ifdef CACHE_NUMCACHEHV_U64 STATNODE_COUNTER(numcachehv, "Number of namecache entries with vnodes held"); -#else -static u_long __exclusive_cache_line numcachehv;/* number of cache entries with vnodes held */ -STATNODE_ULONG(numcachehv, "Number of namecache entries with vnodes held"); -#endif STATNODE_COUNTER(numcalls, "Number of cache lookups"); STATNODE_COUNTER(dothits, "Number of '.' hits"); STATNODE_COUNTER(dotdothits, "Number of '..' hits"); @@ -407,36 +392,6 @@ static int vn_fullpath1(struct thread *td, struct vnod static MALLOC_DEFINE(M_VFSCACHE, "vfscache", "VFS name cache entries"); -#ifdef CACHE_NUMCACHEHV_U64 -static void -cache_numcachehv_inc(void) -{ - - counter_u64_add(numcachehv, 1); -} - -static void -cache_numcachehv_dec(void) -{ - - counter_u64_add(numcachehv, -1); -} -#else -static void -cache_numcachehv_inc(void) -{ - - atomic_add_long(&numcachehv, 1); -} - -static void -cache_numcachehv_dec(void) -{ - - atomic_subtract_long(&numcachehv, 1); -} -#endif - static int cache_yield; SYSCTL_INT(_vfs_cache, OID_AUTO, yield, CTLFLAG_RD, &cache_yield, 0, "Number of times cache called yield"); @@ -917,7 +872,7 @@ cache_zap_locked(struct namecache *ncp, bool neg_locke LIST_REMOVE(ncp, nc_src); if (LIST_EMPTY(&ncp->nc_dvp->v_cache_src)) { ncp->nc_flag |= NCF_DVDROP; - cache_numcachehv_dec(); + counter_u64_add(numcachehv, -1); } } atomic_subtract_rel_long(&numcache, 1); @@ -1786,7 +1741,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, held_dvp = false; if (LIST_EMPTY(&dvp->v_cache_src) && flag != NCF_ISDOTDOT) { vhold(dvp); - cache_numcachehv_inc(); + counter_u64_add(numcachehv, 1); held_dvp = true; } @@ -1881,7 +1836,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, if (LIST_EMPTY(&dvp->v_cache_src)) { if (!held_dvp) { vhold(dvp); - cache_numcachehv_inc(); + counter_u64_add(numcachehv, 1); } } else { if (held_dvp) { @@ -1892,7 +1847,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, * this from changing. */ vdrop(dvp); - cache_numcachehv_dec(); + counter_u64_add(numcachehv, -1); } } LIST_INSERT_HEAD(&dvp->v_cache_src, ncp, nc_src); @@ -1930,7 +1885,7 @@ out_unlock_free: cache_free(ncp); if (held_dvp) { vdrop(dvp); - cache_numcachehv_dec(); + counter_u64_add(numcachehv, -1); } return; } @@ -2001,9 +1956,7 @@ nchinit(void *dummy __unused) mtx_init(&ncneg_shrink_lock, "ncnegs", NULL, MTX_DEF); -#ifdef CACHE_NUMCACHEHV_U64 numcachehv = counter_u64_alloc(M_WAITOK); -#endif numcalls = counter_u64_alloc(M_WAITOK); dothits = counter_u64_alloc(M_WAITOK); dotdothits = counter_u64_alloc(M_WAITOK); From owner-svn-src-all@freebsd.org Mon Jan 20 15:19:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD2841FDBBB; Mon, 20 Jan 2020 15:19:56 +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 481b2440bJz4dYM; Mon, 20 Jan 2020 15:19:56 +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 8457B2585A; Mon, 20 Jan 2020 15:19:56 +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 00KFJuWo016039; Mon, 20 Jan 2020 15:19:56 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KFJuWp016038; Mon, 20 Jan 2020 15:19:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001201519.00KFJuWp016038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 20 Jan 2020 15:19:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356916 - head/tools/build/options X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/build/options X-SVN-Commit-Revision: 356916 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 15:19:56 -0000 Author: emaste Date: Mon Jan 20 15:19:56 2020 New Revision: 356916 URL: https://svnweb.freebsd.org/changeset/base/356916 Log: remove unused WITHOUT_PC_SYSINSTALL description pc-sysinstall was moved from the base system to ports in r351781. Submitted by: driesm.michiels gmail com Differential Revision: https://reviews.freebsd.org/D21647 Deleted: head/tools/build/options/WITHOUT_PC_SYSINSTALL From owner-svn-src-all@freebsd.org Mon Jan 20 15:38:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF13B1FE26B; Mon, 20 Jan 2020 15:38:05 +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 481bR15Pmrz4fSS; Mon, 20 Jan 2020 15:38:05 +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 B090725C0D; Mon, 20 Jan 2020 15:38:05 +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 00KFc5Ke028059; Mon, 20 Jan 2020 15:38:05 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KFc5We028058; Mon, 20 Jan 2020 15:38:05 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202001201538.00KFc5We028058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 20 Jan 2020 15:38: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: r356917 - in stable: 11/share/man/man7 12/share/man/man7 X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 11/share/man/man7 12/share/man/man7 X-SVN-Commit-Revision: 356917 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 15:38:05 -0000 Author: gjb Date: Mon Jan 20 15:38:05 2020 New Revision: 356917 URL: https://svnweb.freebsd.org/changeset/base/356917 Log: MFC r356792: Update release(7) to note OSRELEASE is only relevant when the 'install' target is invoked. While here, bump the sample output version name, and explicitly add the 'obj' target to avoid polluting the src checkout. PR: 243287 (related) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: stable/11/share/man/man7/release.7 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/share/man/man7/release.7 Directory Properties: stable/12/ (props changed) Modified: stable/11/share/man/man7/release.7 ============================================================================== --- stable/11/share/man/man7/release.7 Mon Jan 20 15:19:56 2020 (r356916) +++ stable/11/share/man/man7/release.7 Mon Jan 20 15:38:05 2020 (r356917) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 28, 2018 +.Dd January 16, 2020 .Dt RELEASE 7 .Os .Sh NAME @@ -570,8 +570,10 @@ target invoked by Optional variables: .Bl -tag -width ".Ev TARGET_ARCH" .It Ev OSRELEASE -Optional base name for generated media images -.Pq e.g., FreeBSD-9.0-RC2-amd64 . +Optional base name for generated media images when invoking the +.Cm install +target +.Pq e.g., FreeBSD-12.1-RELEASE-amd64 . Defaults to the output of .Ic `uname -s`-`uname -r`-`uname -p` within the chroot. @@ -659,6 +661,7 @@ svn co svn://svn.freebsd.org/base/head src cd src make buildworld buildkernel cd release +make obj make release make install DESTDIR=/var/freebsd-snapshot .Ed From owner-svn-src-all@freebsd.org Mon Jan 20 15:38:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1460F1FE270; Mon, 20 Jan 2020 15:38:06 +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 481bR16tYbz4fST; Mon, 20 Jan 2020 15:38:05 +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 E405D25C0E; Mon, 20 Jan 2020 15:38:05 +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 00KFc5fB028065; Mon, 20 Jan 2020 15:38:05 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KFc5r3028064; Mon, 20 Jan 2020 15:38:05 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202001201538.00KFc5r3028064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 20 Jan 2020 15:38:05 +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: r356917 - in stable: 11/share/man/man7 12/share/man/man7 X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 11/share/man/man7 12/share/man/man7 X-SVN-Commit-Revision: 356917 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 15:38:06 -0000 Author: gjb Date: Mon Jan 20 15:38:05 2020 New Revision: 356917 URL: https://svnweb.freebsd.org/changeset/base/356917 Log: MFC r356792: Update release(7) to note OSRELEASE is only relevant when the 'install' target is invoked. While here, bump the sample output version name, and explicitly add the 'obj' target to avoid polluting the src checkout. PR: 243287 (related) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: stable/12/share/man/man7/release.7 Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/share/man/man7/release.7 Directory Properties: stable/11/ (props changed) Modified: stable/12/share/man/man7/release.7 ============================================================================== --- stable/12/share/man/man7/release.7 Mon Jan 20 15:19:56 2020 (r356916) +++ stable/12/share/man/man7/release.7 Mon Jan 20 15:38:05 2020 (r356917) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 28, 2018 +.Dd January 16, 2020 .Dt RELEASE 7 .Os .Sh NAME @@ -570,8 +570,10 @@ target invoked by Optional variables: .Bl -tag -width ".Ev TARGET_ARCH" .It Ev OSRELEASE -Optional base name for generated media images -.Pq e.g., FreeBSD-9.0-RC2-amd64 . +Optional base name for generated media images when invoking the +.Cm install +target +.Pq e.g., FreeBSD-12.1-RELEASE-amd64 . Defaults to the output of .Ic `uname -s`-`uname -r`-`uname -p` within the chroot. @@ -659,6 +661,7 @@ svn co svn://svn.freebsd.org/base/head src cd src make buildworld buildkernel cd release +make obj make release make install DESTDIR=/var/freebsd-snapshot .Ed From owner-svn-src-all@freebsd.org Mon Jan 20 15:49:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C1C5D1FE6D6; Mon, 20 Jan 2020 15:49:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 481bgm3jBPz4g4t; Mon, 20 Jan 2020 15:49:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 00KFn0tk060802 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 20 Jan 2020 17:49:03 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 00KFn0tk060802 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 00KFn0rD060801; Mon, 20 Jan 2020 17:49:00 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 20 Jan 2020 17:49:00 +0200 From: Konstantin Belousov To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r356915 - head/sys/kern Message-ID: <20200120154900.GI4808@kib.kiev.ua> References: <202001201442.00KEgBVT096683@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202001201442.00KEgBVT096683@repo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.3 X-Spam-Checker-Version: SpamAssassin 3.4.3 (2019-12-06) on tom.home X-Rspamd-Queue-Id: 481bgm3jBPz4g4t X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-0.94)[-0.943,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, 20 Jan 2020 15:49:08 -0000 On Mon, Jan 20, 2020 at 02:42:11PM +0000, Mateusz Guzik wrote: > Author: mjg > Date: Mon Jan 20 14:42:11 2020 > New Revision: 356915 > URL: https://svnweb.freebsd.org/changeset/base/356915 > > Log: > cache: make numcachehv use counter(9) on all archs > > Requested by: kib Thank you. > > Modified: > head/sys/kern/vfs_cache.c > > Modified: head/sys/kern/vfs_cache.c > ============================================================================== > --- head/sys/kern/vfs_cache.c Mon Jan 20 13:46:09 2020 (r356914) > +++ head/sys/kern/vfs_cache.c Mon Jan 20 14:42:11 2020 (r356915) > @@ -340,16 +340,6 @@ SYSCTL_INT(_debug_sizeof, OID_AUTO, namecache, CTLFLAG > sizeof(struct namecache), "sizeof(struct namecache)"); > > /* > - * Use counter(9) for numcachehv if the machine is 64-bit. > - * > - * Stick to an atomic for the rest since there is no long-sized equivalent and > - * 64-bit size is both way more than needed and a pessimization. > - */ > -#ifdef __LP64__ > -#define CACHE_NUMCACHEHV_U64 > -#endif > - > -/* > * The new name cache statistics > */ > static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW, 0, > @@ -361,12 +351,7 @@ static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW, > SYSCTL_COUNTER_U64(_vfs_cache, OID_AUTO, name, CTLFLAG_RD, &name, descr); > STATNODE_ULONG(numneg, "Number of negative cache entries"); > STATNODE_ULONG(numcache, "Number of cache entries"); > -#ifdef CACHE_NUMCACHEHV_U64 > STATNODE_COUNTER(numcachehv, "Number of namecache entries with vnodes held"); > -#else > -static u_long __exclusive_cache_line numcachehv;/* number of cache entries with vnodes held */ > -STATNODE_ULONG(numcachehv, "Number of namecache entries with vnodes held"); > -#endif > STATNODE_COUNTER(numcalls, "Number of cache lookups"); > STATNODE_COUNTER(dothits, "Number of '.' hits"); > STATNODE_COUNTER(dotdothits, "Number of '..' hits"); > @@ -407,36 +392,6 @@ static int vn_fullpath1(struct thread *td, struct vnod > > static MALLOC_DEFINE(M_VFSCACHE, "vfscache", "VFS name cache entries"); > > -#ifdef CACHE_NUMCACHEHV_U64 > -static void > -cache_numcachehv_inc(void) > -{ > - > - counter_u64_add(numcachehv, 1); > -} > - > -static void > -cache_numcachehv_dec(void) > -{ > - > - counter_u64_add(numcachehv, -1); > -} > -#else > -static void > -cache_numcachehv_inc(void) > -{ > - > - atomic_add_long(&numcachehv, 1); > -} > - > -static void > -cache_numcachehv_dec(void) > -{ > - > - atomic_subtract_long(&numcachehv, 1); > -} > -#endif > - > static int cache_yield; > SYSCTL_INT(_vfs_cache, OID_AUTO, yield, CTLFLAG_RD, &cache_yield, 0, > "Number of times cache called yield"); > @@ -917,7 +872,7 @@ cache_zap_locked(struct namecache *ncp, bool neg_locke > LIST_REMOVE(ncp, nc_src); > if (LIST_EMPTY(&ncp->nc_dvp->v_cache_src)) { > ncp->nc_flag |= NCF_DVDROP; > - cache_numcachehv_dec(); > + counter_u64_add(numcachehv, -1); > } > } > atomic_subtract_rel_long(&numcache, 1); > @@ -1786,7 +1741,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, > held_dvp = false; > if (LIST_EMPTY(&dvp->v_cache_src) && flag != NCF_ISDOTDOT) { > vhold(dvp); > - cache_numcachehv_inc(); > + counter_u64_add(numcachehv, 1); > held_dvp = true; > } > > @@ -1881,7 +1836,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, > if (LIST_EMPTY(&dvp->v_cache_src)) { > if (!held_dvp) { > vhold(dvp); > - cache_numcachehv_inc(); > + counter_u64_add(numcachehv, 1); > } > } else { > if (held_dvp) { > @@ -1892,7 +1847,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, > * this from changing. > */ > vdrop(dvp); > - cache_numcachehv_dec(); > + counter_u64_add(numcachehv, -1); > } > } > LIST_INSERT_HEAD(&dvp->v_cache_src, ncp, nc_src); > @@ -1930,7 +1885,7 @@ out_unlock_free: > cache_free(ncp); > if (held_dvp) { > vdrop(dvp); > - cache_numcachehv_dec(); > + counter_u64_add(numcachehv, -1); > } > return; > } > @@ -2001,9 +1956,7 @@ nchinit(void *dummy __unused) > > mtx_init(&ncneg_shrink_lock, "ncnegs", NULL, MTX_DEF); > > -#ifdef CACHE_NUMCACHEHV_U64 > numcachehv = counter_u64_alloc(M_WAITOK); > -#endif > numcalls = counter_u64_alloc(M_WAITOK); > dothits = counter_u64_alloc(M_WAITOK); > dotdothits = counter_u64_alloc(M_WAITOK); From owner-svn-src-all@freebsd.org Mon Jan 20 16:03:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 443E91FED7D for ; Mon, 20 Jan 2020 16:03:36 +0000 (UTC) (envelope-from johnluis021@gmail.com) Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) (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 481c0R3rH0z4grg for ; Mon, 20 Jan 2020 16:03:35 +0000 (UTC) (envelope-from johnluis021@gmail.com) Received: by mail-lf1-x142.google.com with SMTP id y19so24475054lfl.9 for ; Mon, 20 Jan 2020 08:03:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:from:subject:to:mime-version:reply-to:organization:date; bh=1NAWyzXLCqC7H3LePjGDz7N0tBNSSd6RLXCqpbE5wS8=; b=pIjBRgyqst0e8uHs7S9wmVKyJEZNfOXIjE9CLyIjNc+2I4z9o35msmAlb8jAuBsdCH eYqOrFu4lV21QTjt2D/KV0C42H0fQb4JKi/4vLhfHA71JprvqeuyXUTI+2Ka6T6hB3WA vDqMQ2kyQfn+awJRREcOR/bsps45kao0jExGfqxLKHe5oH//pe6h1V2LFgEtWUEFKcZ3 2K4maaLMnLddErATKUPZNzY4TUcbBsiSir3jg6Y32tMPnXx4XttHzQMRyMKeBC2NhPd7 LZJe+Ubc0s5LolVrQOGOT6yY4VRIvMRVMB5/dTzXWteHfBMm2H928ixn4KkJ0pG+Xh9g bZxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:from:subject:to:mime-version:reply-to :organization:date; bh=1NAWyzXLCqC7H3LePjGDz7N0tBNSSd6RLXCqpbE5wS8=; b=q4gLPi0tZkqOdXJG+qZlFwW4k/JEUlFzXkuBccyG608sF58i5vqEck3PORbxAet6ud EfCnZDv4qGMdc01VCjF1HVGX1UE1sC22Rcl+S/mWbp3gkebc1/sYIObgh+7G9yo7fi51 tXNxQ09j0SToH7q4p+Ys7Vg6U4FdO4NTmaNhQAL4Vz83EsiaW3nHxoyn3Q8oGi6QZjF1 YPF3Xq6XSQhvTDq9+cns/yhUUDxi/iAfLMwcyXIuj8umkIQQv+DBRYKXd8NHPXZWQa3w LUkKe+6bG/PotVd5ctO5GuTMaIS+yG7+kWN7lGJ1Tjfe+Z3EvUv41FaPCYR+dG7LzuQz BmCA== X-Gm-Message-State: APjAAAVqUpayIpK1LwPB/gPeeQQj7ejgIF94W00xhWkrS8F127S15V8C j8sO4/3HdJR69JmMU1xx1a9SJNs= X-Google-Smtp-Source: APXvYqyNXQKNKUF/GHJpkYVrnlpM4QKq5IMM0YCYiA+W1Mw6P6Cu0SJXEg/03w7zk5siyiDh2ClO6w== X-Received: by 2002:ac2:4a91:: with SMTP id l17mr13877278lfp.75.1579535894636; Mon, 20 Jan 2020 07:58:14 -0800 (PST) Received: from 8ta-246-30-248.telkomadsl.co.za (8ta-246-29-75.telkomadsl.co.za. [41.246.29.75]) by smtp.gmail.com with ESMTPSA id z22sm17046186ljm.24.2020.01.20.07.58.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jan 2020 07:58:14 -0800 (PST) Message-ID: <5e25ce16.1c69fb81.c7493.2d7f@mx.google.com> From: "Katuma Salif" Subject: 20-01-2020 BUSINESS INVESTMENT PROPOSAL To: svn-src-all@freebsd.org MIME-Version: 1.0 Reply-To: "Katuma Salif" Organization: Investment Proposal. Date: Mon, 20 Jan 2020 07:58:14 -0800 X-Rspamd-Queue-Id: 481c0R3rH0z4grg X-Spamd-Bar: +++++++++++ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=pIjBRgyq; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of johnluis021@gmail.com designates 2a00:1450:4864:20::142 as permitted sender) smtp.mailfrom=johnluis021@gmail.com X-Spamd-Result: default: False [11.92 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[katumasalif@gmail.com]; R_SPF_ALLOW(0.00)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; REPLYTO_DN_EQ_FROM_DN(0.00)[]; TO_DN_NONE(0.00)[]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(0.00)[gmail.com,none]; SUBJ_ALL_CAPS(2.93)[39]; FROM_EQ_ENVFROM(0.00)[]; INTRODUCTION(2.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; RECEIVED_SPAMHAUS_XBL(5.00)[75.29.246.41.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.4]; R_DKIM_ALLOW(0.00)[gmail.com:s=20161025]; RECEIVED_SPAMHAUS_PBL(0.00)[75.29.246.41.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; FREEMAIL_REPLYTO(0.00)[gmail.com]; NEURAL_SPAM_MEDIUM(1.00)[1.000,0]; RCPT_COUNT_ONE(0.00)[1]; BAD_REP_POLICIES(0.10)[]; IP_SCORE_FREEMAIL(0.00)[]; REPLYTO_DOM_EQ_FROM_DOM(0.00)[]; NEURAL_SPAM_LONG(1.00)[1.000,0]; RCVD_IN_DNSWL_NONE(0.00)[2.4.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(0.00)[ip: (2.56), ipnet: 2a00:1450::/32(-2.59), asn: 15169(-1.82), country: US(-0.05)]; RCVD_TLS_ALL(0.00)[]; GREYLIST(0.00)[pass,body] X-Spam: Yes Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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, 20 Jan 2020 16:03:36 -0000 Good Day, My name is Mr Salif Katuma, I am actually looking for an investable business opportunity to financ= e or come in as partner . I wouldn't mind investing in your business o= r any existing company. I will appreciate if we can have a telephone communications for more d= etails and clarifications. Kindly email me your direct contact number to phone you. I look forward to hear from you. Regard, Mr Salif Katuma From owner-svn-src-all@freebsd.org Mon Jan 20 16:59:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E891B1FFB8C; Mon, 20 Jan 2020 16:59:39 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 481dF75YhDz4jjL; Mon, 20 Jan 2020 16:59:39 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4E1326A94; Mon, 20 Jan 2020 16:59:39 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00KGxduI075279; Mon, 20 Jan 2020 16:59:39 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KGxddI075278; Mon, 20 Jan 2020 16:59:39 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202001201659.00KGxddI075278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 20 Jan 2020 16:59:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356918 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 356918 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 16:59:40 -0000 Author: bapt Date: Mon Jan 20 16:59:39 2020 New Revision: 356918 URL: https://svnweb.freebsd.org/changeset/base/356918 Log: The ports tree now accepts /usr/local/share/man as a directory for manpage and will slowly transition from /usr/local/man to it. To reflect this remove the documentation of the manpages being an exception in the layout of /usr/local Reported by: Dan Nelson (via IRC) MFC after: 3 days Modified: head/share/man/man7/hier.7 Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Mon Jan 20 15:38:05 2020 (r356917) +++ head/share/man/man7/hier.7 Mon Jan 20 16:59:39 2020 (r356918) @@ -28,7 +28,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd September 10, 2019 +.Dd January 20, 2020 .Dt HIER 7 .Os .Sh NAME @@ -420,12 +420,6 @@ for .Pa /usr should be used. Exceptions are the -.Pa man -directory -.Po directly under -.Pa local/ -rather than under -.Pa local/share/ Ns Pc , ports documentation .Po in .Pa share/doc// Ns Pc , From owner-svn-src-all@freebsd.org Mon Jan 20 17:22:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DBC3221583 for ; Mon, 20 Jan 2020 17:22:39 +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 481dlg0QcSz4l66; Mon, 20 Jan 2020 17:22:39 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 06FBF16B32; Mon, 20 Jan 2020 17:22:39 +0000 (UTC) Date: Mon, 20 Jan 2020 17:22:38 +0000 From: Alexey Dokuchaev To: Eugene Grosbein Cc: Slawa Olhovchenkov , "svn-src-all@freebsd.org" Subject: Re: svn commit: r356758 - in head/usr.sbin/bsdinstall: . scripts Message-ID: <20200120172238.GA59489@FreeBSD.org> References: <20200117000333.GI38096@zxy.spb.ru> <3b4b4bda-75a3-3019-bc02-ecd6acacd77f@grosbein.net> <20200117112151.GJ38096@zxy.spb.ru> <0f117603-d995-b32d-68fb-36cc319d9b79@grosbein.net> <20200117125851.GK38096@zxy.spb.ru> <798ef101-c9e5-093b-8a0c-7fd3cb9a07b1@grosbein.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <798ef101-c9e5-093b-8a0c-7fd3cb9a07b1@grosbein.net> User-Agent: Mutt/1.11.4 (2019-03-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 17:22:39 -0000 On Fri, Jan 17, 2020 at 08:17:11PM +0700, Eugene Grosbein wrote: > ... > It was fine before clang-[78]. Buy nowadays, yes, I'm forced to use > multiple knobs for src.conf > > WITHOUT_LLVM_TARGET_ALL= > WITH_LLVM_TARGET_X86= > WITHOUT_CLANG_FULL= Thanks, I've added them (with =yes part) to my /etc/src.conf as well. I've noticed I also have WITHOUT_CLANG_EXTRAS=yes there, is this one still needed/does any good? ./danfe From owner-svn-src-all@freebsd.org Mon Jan 20 17:23:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 43BD222161F; Mon, 20 Jan 2020 17:23:04 +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 481dm80svdz4lDM; Mon, 20 Jan 2020 17:23:04 +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 1895A2701E; Mon, 20 Jan 2020 17:23:04 +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 00KHN3vo093433; Mon, 20 Jan 2020 17:23:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KHN3tX093432; Mon, 20 Jan 2020 17:23:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202001201723.00KHN3tX093432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 20 Jan 2020 17:23:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356919 - 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: 356919 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 17:23:04 -0000 Author: kib Date: Mon Jan 20 17:23:03 2020 New Revision: 356919 URL: https://svnweb.freebsd.org/changeset/base/356919 Log: x86: Wait for curthread to be set up as an indicator that the boot stack is no longer used. pc_curthread is set by cpu_switch after it stopped using the old thread (or boot) stack. This makes the smp_after_idle_runnable() function not dependent on the internals of the scheduler operations. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D23276 Modified: head/sys/x86/x86/mp_x86.c Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Mon Jan 20 16:59:39 2020 (r356918) +++ head/sys/x86/x86/mp_x86.c Mon Jan 20 17:23:03 2020 (r356919) @@ -1092,13 +1092,12 @@ init_secondary_tail(void) static void smp_after_idle_runnable(void *arg __unused) { - struct thread *idle_td; + struct pcpu *pc; int cpu; for (cpu = 1; cpu < mp_ncpus; cpu++) { - idle_td = pcpu_find(cpu)->pc_idlethread; - while (atomic_load_int(&idle_td->td_lastcpu) == NOCPU && - atomic_load_int(&idle_td->td_oncpu) == NOCPU) + pc = pcpu_find(cpu); + while (atomic_load_ptr(&pc->pc_curthread) == (uintptr_t)NULL) cpu_spinwait(); kmem_free((vm_offset_t)bootstacks[cpu], kstack_pages * PAGE_SIZE); From owner-svn-src-all@freebsd.org Mon Jan 20 17:33:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC16922197D for ; Mon, 20 Jan 2020 17:33:46 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:c2c:26d8::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 481f0T1C0lz4lgP; Mon, 20 Jan 2020 17:33:44 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id 00KHXL9O001913 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Jan 2020 17:33:26 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: danfe@freebsd.org Received: from [10.58.0.10] (dadvw [10.58.0.10]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id 00KHXKBt082651 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 21 Jan 2020 00:33:20 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r356758 - in head/usr.sbin/bsdinstall: . scripts To: Alexey Dokuchaev References: <20200117000333.GI38096@zxy.spb.ru> <3b4b4bda-75a3-3019-bc02-ecd6acacd77f@grosbein.net> <20200117112151.GJ38096@zxy.spb.ru> <0f117603-d995-b32d-68fb-36cc319d9b79@grosbein.net> <20200117125851.GK38096@zxy.spb.ru> <798ef101-c9e5-093b-8a0c-7fd3cb9a07b1@grosbein.net> <20200120172238.GA59489@FreeBSD.org> Cc: "svn-src-all@freebsd.org" From: Eugene Grosbein Message-ID: Date: Tue, 21 Jan 2020 00:33:11 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20200120172238.GA59489@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 481f0T1C0lz4lgP X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=permerror (mx1.freebsd.org: domain of eugen@grosbein.net uses mechanism not recognized by this client) smtp.mailfrom=eugen@grosbein.net X-Spamd-Result: default: False [-3.89 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grosbein.net]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-1.79)[ip: (-4.91), ipnet: 2a01:4f8::/29(-2.49), asn: 24940(-1.53), country: DE(-0.02)]; R_SPF_PERMFAIL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; 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)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 17:33:46 -0000 21.01.2020 0:22, Alexey Dokuchaev wrote: > On Fri, Jan 17, 2020 at 08:17:11PM +0700, Eugene Grosbein wrote: >> ... >> It was fine before clang-[78]. Buy nowadays, yes, I'm forced to use >> multiple knobs for src.conf >> >> WITHOUT_LLVM_TARGET_ALL= >> WITH_LLVM_TARGET_X86= >> WITHOUT_CLANG_FULL= > > Thanks, I've added them (with =yes part) to my /etc/src.conf as well. > I've noticed I also have WITHOUT_CLANG_EXTRAS=yes there, is this one > still needed/does any good? Take a look at src/usr.bin/clang/Makefile, it seems WITH_CLANG_EXTRAS enables building multiple utilities like llvm versions of ar, as, nm, objcopy, objdump etc. From owner-svn-src-all@freebsd.org Mon Jan 20 17:38:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4531221AF9 for ; Mon, 20 Jan 2020 17:38:18 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) 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 481f5k4M3Jz4lmf; Mon, 20 Jan 2020 17:38:18 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 8C53D16EC7; Mon, 20 Jan 2020 17:38:18 +0000 (UTC) Date: Mon, 20 Jan 2020 17:38:18 +0000 From: Alexey Dokuchaev To: Eugene Grosbein Cc: "svn-src-all@freebsd.org" Subject: Re: svn commit: r356758 - in head/usr.sbin/bsdinstall: . scripts Message-ID: <20200120173818.GA25886@FreeBSD.org> References: <20200117000333.GI38096@zxy.spb.ru> <3b4b4bda-75a3-3019-bc02-ecd6acacd77f@grosbein.net> <20200117112151.GJ38096@zxy.spb.ru> <0f117603-d995-b32d-68fb-36cc319d9b79@grosbein.net> <20200117125851.GK38096@zxy.spb.ru> <798ef101-c9e5-093b-8a0c-7fd3cb9a07b1@grosbein.net> <20200120172238.GA59489@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 17:38:18 -0000 On Tue, Jan 21, 2020 at 12:33:11AM +0700, Eugene Grosbein wrote: > 21.01.2020 0:22, Alexey Dokuchaev wrote: > > On Fri, Jan 17, 2020 at 08:17:11PM +0700, Eugene Grosbein wrote: > >> ... > >> It was fine before clang-[78]. Buy nowadays, yes, I'm forced to use > >> multiple knobs for src.conf > >> > >> WITHOUT_LLVM_TARGET_ALL= > >> WITH_LLVM_TARGET_X86= > >> WITHOUT_CLANG_FULL= > > > > Thanks, I've added them (with =yes part) to my /etc/src.conf as well. > > I've noticed I also have WITHOUT_CLANG_EXTRAS=yes there, is this one > > still needed/does any good? > > Take a look at src/usr.bin/clang/Makefile, it seems WITH_CLANG_EXTRAS > enables building multiple utilities like llvm versions of ar, as, nm, > objcopy, objdump etc. Hmm, I do have those (under /usr/bin) and they don't seem like being *extras* but rather essential part of the toolchain. I'll take a closer look, perhaps I've added WITHOUT_CLANG_EXTRAS=yes *after* my last build of the world, thanks. ./danfe From owner-svn-src-all@freebsd.org Mon Jan 20 18:43:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5CC9D223118; Mon, 20 Jan 2020 18:43:11 +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 481gXb1tnxz4qCT; Mon, 20 Jan 2020 18:43:11 +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 3B52427FA2; Mon, 20 Jan 2020 18:43:11 +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 00KIhB6L041851; Mon, 20 Jan 2020 18:43:11 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KIhBh8041850; Mon, 20 Jan 2020 18:43:11 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001201843.00KIhBh8041850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 20 Jan 2020 18:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356922 - head/lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libc/stdlib X-SVN-Commit-Revision: 356922 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 18:43:11 -0000 Author: cem Date: Mon Jan 20 18:43:10 2020 New Revision: 356922 URL: https://svnweb.freebsd.org/changeset/base/356922 Log: qsort.3: Bump Dd and note that Annex K is optional Modified: head/lib/libc/stdlib/qsort.3 Modified: head/lib/libc/stdlib/qsort.3 ============================================================================== --- head/lib/libc/stdlib/qsort.3 Mon Jan 20 18:21:55 2020 (r356921) +++ head/lib/libc/stdlib/qsort.3 Mon Jan 20 18:43:10 2020 (r356922) @@ -32,7 +32,7 @@ .\" @(#)qsort.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd January 14, 2020 +.Dd January 20, 2020 .Dt QSORT 3 .Os .Sh NAME @@ -342,6 +342,13 @@ to replace with .Fn qsort_s to work around this problem. +.Pp +.Fn qsort_s +is part of the +.Em optional +Annex K portion of +.St -isoC-2011 +and may not be portable to other standards-conforming platforms. .Pp Previous versions of .Fn qsort From owner-svn-src-all@freebsd.org Mon Jan 20 18:54:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E655B22348C; Mon, 20 Jan 2020 18:54:20 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 481gnS22Hdz4qlR; Mon, 20 Jan 2020 18:54:20 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40DB01C3; Mon, 20 Jan 2020 18:54:20 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00KIsK7N048221; Mon, 20 Jan 2020 18:54:20 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KIsJoo048219; Mon, 20 Jan 2020 18:54:19 GMT (envelope-from loos@FreeBSD.org) Message-Id: <202001201854.00KIsJoo048219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 20 Jan 2020 18:54: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: r356923 - stable/11/sys/dev/uart X-SVN-Group: stable-11 X-SVN-Commit-Author: loos X-SVN-Commit-Paths: stable/11/sys/dev/uart X-SVN-Commit-Revision: 356923 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 18:54:21 -0000 Author: loos Date: Mon Jan 20 18:54:19 2020 New Revision: 356923 URL: https://svnweb.freebsd.org/changeset/base/356923 Log: MFC r336623 by mmacy: Fixes the interrupt storm in UART during the boot on ARMADA38X. The missing attribution of ns8250->busy_detect breaks the UART support. Original commit log: Add busy detect quirk to list of console options This change allows one to set the busy_detect flag required by the synopsys UART at the loader prompt. This is needed by the EPYC 3000 SoC. This will give users a working console up to the point where getty is required: hw.uart.console="mm:0xfedc9000,rs:2,bd:1" Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/sys/dev/uart/uart_dev_ns8250.c stable/11/sys/dev/uart/uart_subr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- stable/11/sys/dev/uart/uart_dev_ns8250.c Mon Jan 20 18:43:10 2020 (r356922) +++ stable/11/sys/dev/uart/uart_dev_ns8250.c Mon Jan 20 18:54:19 2020 (r356923) @@ -479,6 +479,7 @@ ns8250_bus_attach(struct uart_softc *sc) bas = &sc->sc_bas; + ns8250->busy_detect = bas->busy_detect; ns8250->mcr = uart_getreg(bas, REG_MCR); ns8250->fcr = FCR_ENABLE; if (!resource_int_value("uart", device_get_unit(sc->sc_dev), "flags", Modified: stable/11/sys/dev/uart/uart_subr.c ============================================================================== --- stable/11/sys/dev/uart/uart_subr.c Mon Jan 20 18:43:10 2020 (r356922) +++ stable/11/sys/dev/uart/uart_subr.c Mon Jan 20 18:54:19 2020 (r356923) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #define UART_TAG_RS 7 #define UART_TAG_SB 8 #define UART_TAG_XO 9 +#define UART_TAG_BD 10 static struct uart_class *uart_classes[] = { &uart_ns8250_class, @@ -122,6 +123,10 @@ uart_parse_tag(const char **p) { int tag; + if ((*p)[0] == 'b' && (*p)[1] == 'd') { + tag = UART_TAG_BD; + goto out; + } if ((*p)[0] == 'b' && (*p)[1] == 'r') { tag = UART_TAG_BR; goto out; @@ -177,6 +182,7 @@ out: * separated by commas. Each attribute is a tag-value pair with the tag and * value separated by a colon. Supported tags are: * + * bd = Busy Detect * br = Baudrate * ch = Channel * db = Data bits @@ -240,6 +246,9 @@ uart_getenv(int devtype, struct uart_devinfo *di, stru spec = cp; for (;;) { switch (uart_parse_tag(&spec)) { + case UART_TAG_BD: + di->bas.busy_detect = uart_parse_long(&spec); + break; case UART_TAG_BR: di->baudrate = uart_parse_long(&spec); break; From owner-svn-src-all@freebsd.org Mon Jan 20 19:38:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC9E2224642; Mon, 20 Jan 2020 19:38:29 +0000 (UTC) (envelope-from mikael@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 481hmP5Sbmz4syV; Mon, 20 Jan 2020 19:38:29 +0000 (UTC) (envelope-from mikael@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6AF7924; Mon, 20 Jan 2020 19:38:29 +0000 (UTC) (envelope-from mikael@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00KJcTs1072692; Mon, 20 Jan 2020 19:38:29 GMT (envelope-from mikael@FreeBSD.org) Received: (from mikael@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KJcTKx072691; Mon, 20 Jan 2020 19:38:29 GMT (envelope-from mikael@FreeBSD.org) Message-Id: <202001201938.00KJcTKx072691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mikael set sender to mikael@FreeBSD.org using -f From: Mikael Urankar Date: Mon, 20 Jan 2020 19:38:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356924 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: mikael X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 356924 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 19:38:29 -0000 Author: mikael (ports committer) Date: Mon Jan 20 19:38:29 2020 New Revision: 356924 URL: https://svnweb.freebsd.org/changeset/base/356924 Log: Add myself (mikael) as a ports committer Approved by: manu (mentor) Differential Revision: https://reviews.freebsd.org/D23227 Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Mon Jan 20 18:54:19 2020 (r356923) +++ head/share/misc/committers-ports.dot Mon Jan 20 19:38:29 2020 (r356924) @@ -193,6 +193,7 @@ meta [label="Koichiro Iwao\nmeta@FreeBSD.org\n2018/03/ mezz [label="Jeremy Messenger\nmezz@FreeBSD.org\n2004/04/30"] mfechner [label="Matthias Fechner\nmfechner@FreeBSD.org\n2018/03/01"] mharo [label="Michael Haro\nmharo@FreeBSD.org\n1999/04/13"] +mikael [label="Mikael Urankar\nmikael@FreeBSD.org\n2020/01/16"] milki [label="Jonathan Chu\nmilki@FreeBSD.org\n2013/12/15"] misha [label="Mikhail Pchelin\nmisha@FreeBSD.org\n2016/11/15"] miwi [label="Martin Wilke\nmiwi@FreeBSD.org\n2006/06/04"] @@ -539,6 +540,8 @@ lwhsu -> yzlin maho -> stephen maho -> tota + +manu -> mikael marcus -> ahze marcus -> bland From owner-svn-src-all@freebsd.org Mon Jan 20 19:47:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D2B4B2248CC; Mon, 20 Jan 2020 19:47:58 +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 481hzL59jgz4tN2; Mon, 20 Jan 2020 19:47:58 +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 AC8D9B03; Mon, 20 Jan 2020 19:47:58 +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 00KJlw9E078741; Mon, 20 Jan 2020 19:47:58 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KJlw6U078740; Mon, 20 Jan 2020 19:47:58 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <202001201947.00KJlw6U078740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 20 Jan 2020 19:47:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356925 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 356925 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 19:47:58 -0000 Author: oshogbo Date: Mon Jan 20 19:47:58 2020 New Revision: 356925 URL: https://svnweb.freebsd.org/changeset/base/356925 Log: Those files are already removed in ObsoleteFiles.\ There is no need to remove them twice. PR: 242971 MFC after: 2 weeks Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon Jan 20 19:38:29 2020 (r356924) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Jan 20 19:47:58 2020 (r356925) @@ -1141,44 +1141,7 @@ OLD_DIRS+=usr/tests/usr.bin/calendar .endif .if ${MK_CASPER} == no -OLD_FILES+=etc/casper/system.dns -OLD_FILES+=etc/casper/system.grp -OLD_FILES+=etc/casper/system.pwd -OLD_FILES+=etc/casper/system.random -OLD_FILES+=etc/casper/system.sysctl -OLD_DIRS+=etc/casper -OLD_FILES+=etc/rc.d/casperd -OLD_LIBS+=lib/libcapsicum.so.0 -OLD_LIBS+=lib/libcasper.so.0 -OLD_FILES+=libexec/casper/dns -OLD_FILES+=libexec/casper/grp -OLD_FILES+=libexec/casper/pwd -OLD_FILES+=libexec/casper/random -OLD_FILES+=libexec/casper/sysctl -OLD_FILES+=sbin/casper -OLD_FILES+=sbin/casperd -OLD_FILES+=usr/include/libcapsicum.h -OLD_FILES+=usr/include/libcapsicum_dns.h -OLD_FILES+=usr/include/libcapsicum_grp.h -OLD_FILES+=usr/include/libcapsicum_pwd.h -OLD_FILES+=usr/include/libcapsicum_random.h -OLD_FILES+=usr/include/libcapsicum_service.h -OLD_FILES+=usr/include/libcapsicum_sysctl.h OLD_FILES+=usr/include/libcasper.h -OLD_FILES+=usr/lib/libcapsicum.a -OLD_FILES+=usr/lib/libcapsicum.so -OLD_FILES+=usr/lib/libcapsicum_p.a -OLD_FILES+=usr/lib/libcasper.a -OLD_FILES+=usr/lib/libcasper.so -OLD_FILES+=usr/lib/libcasper_p.a -OLD_FILES+=usr/lib32/libcapsicum.a -OLD_FILES+=usr/lib32/libcapsicum.so -OLD_LIBS+=usr/lib32/libcapsicum.so.0 -OLD_FILES+=usr/lib32/libcapsicum_p.a -OLD_FILES+=usr/lib32/libcasper.a -OLD_FILES+=usr/lib32/libcasper.so -OLD_LIBS+=usr/lib32/libcasper.so.0 -OLD_FILES+=usr/lib32/libcasper_p.a OLD_FILES+=usr/share/man/man3/cap_clone.3.gz OLD_FILES+=usr/share/man/man3/cap_close.3.gz OLD_FILES+=usr/share/man/man3/cap_init.3.gz @@ -1191,8 +1154,6 @@ OLD_FILES+=usr/share/man/man3/cap_sock.3.gz OLD_FILES+=usr/share/man/man3/cap_unwrap.3.gz OLD_FILES+=usr/share/man/man3/cap_wrap.3.gz OLD_FILES+=usr/share/man/man3/cap_xfer_nvlist.3.gz -OLD_FILES+=usr/share/man/man3/libcapsicum.3.gz -OLD_FILES+=usr/share/man/man8/casperd.8.gz .endif .if ${MK_CCD} == no From owner-svn-src-all@freebsd.org Mon Jan 20 19:51:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 415FD224B7B; Mon, 20 Jan 2020 19:51:54 +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 481j3t127Fz4tlN; Mon, 20 Jan 2020 19:51:54 +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 1EA9DC88; Mon, 20 Jan 2020 19:51:54 +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 00KJps7k082820; Mon, 20 Jan 2020 19:51:54 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KJprHR082819; Mon, 20 Jan 2020 19:51:53 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <202001201951.00KJprHR082819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 20 Jan 2020 19:51:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356926 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 356926 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 19:51:54 -0000 Author: oshogbo Date: Mon Jan 20 19:51:53 2020 New Revision: 356926 URL: https://svnweb.freebsd.org/changeset/base/356926 Log: Even when the MK_CASPER is set to "no" we still want to install man pages and the headers. If the user decides to install the system without Casper support, then the Casper functions are mocked, but they still exist in the system. PR: 242971 MFC after: 2 weeks Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon Jan 20 19:47:58 2020 (r356925) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Jan 20 19:51:53 2020 (r356926) @@ -1141,19 +1141,6 @@ OLD_DIRS+=usr/tests/usr.bin/calendar .endif .if ${MK_CASPER} == no -OLD_FILES+=usr/include/libcasper.h -OLD_FILES+=usr/share/man/man3/cap_clone.3.gz -OLD_FILES+=usr/share/man/man3/cap_close.3.gz -OLD_FILES+=usr/share/man/man3/cap_init.3.gz -OLD_FILES+=usr/share/man/man3/cap_limit_get.3.gz -OLD_FILES+=usr/share/man/man3/cap_limit_set.3.gz -OLD_FILES+=usr/share/man/man3/cap_recv_nvlist.3.gz -OLD_FILES+=usr/share/man/man3/cap_send_nvlist.3.gz -OLD_FILES+=usr/share/man/man3/cap_service_open.3.gz -OLD_FILES+=usr/share/man/man3/cap_sock.3.gz -OLD_FILES+=usr/share/man/man3/cap_unwrap.3.gz -OLD_FILES+=usr/share/man/man3/cap_wrap.3.gz -OLD_FILES+=usr/share/man/man3/cap_xfer_nvlist.3.gz .endif .if ${MK_CCD} == no From owner-svn-src-all@freebsd.org Mon Jan 20 19:52:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B6A19224C01; Mon, 20 Jan 2020 19:52:23 +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 481j4R4SMFz4tvC; Mon, 20 Jan 2020 19:52:23 +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 9427DCBB; Mon, 20 Jan 2020 19:52:23 +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 00KJqN5F083618; Mon, 20 Jan 2020 19:52:23 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KJqNT9083617; Mon, 20 Jan 2020 19:52:23 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001201952.00KJqNT9083617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 20 Jan 2020 19:52:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356927 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356927 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 19:52:23 -0000 Author: mjg Date: Mon Jan 20 19:52:23 2020 New Revision: 356927 URL: https://svnweb.freebsd.org/changeset/base/356927 Log: cache: revert r352613 now that vhold does not take locks Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Mon Jan 20 19:51:53 2020 (r356926) +++ head/sys/kern/vfs_cache.c Mon Jan 20 19:52:23 2020 (r356927) @@ -1701,7 +1701,6 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, uint32_t hash; int flag; int len; - bool held_dvp; u_long lnumcache; CTR3(KTR_VFS, "cache_enter(%p, %p, %s)", dvp, vp, cnp->cn_nameptr); @@ -1738,13 +1737,6 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, ndd = NULL; ncp_ts = NULL; - held_dvp = false; - if (LIST_EMPTY(&dvp->v_cache_src) && flag != NCF_ISDOTDOT) { - vhold(dvp); - counter_u64_add(numcachehv, 1); - held_dvp = true; - } - /* * Calculate the hash key and setup as much of the new * namecache entry as possible before acquiring the lock. @@ -1834,21 +1826,8 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, if (flag != NCF_ISDOTDOT) { if (LIST_EMPTY(&dvp->v_cache_src)) { - if (!held_dvp) { - vhold(dvp); - counter_u64_add(numcachehv, 1); - } - } else { - if (held_dvp) { - /* - * This will not take the interlock as someone - * else already holds the vnode on account of - * the namecache and we hold locks preventing - * this from changing. - */ - vdrop(dvp); - counter_u64_add(numcachehv, -1); - } + vhold(dvp); + counter_u64_add(numcachehv, 1); } LIST_INSERT_HEAD(&dvp->v_cache_src, ncp, nc_src); } @@ -1883,10 +1862,6 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, out_unlock_free: cache_enter_unlock(&cel); cache_free(ncp); - if (held_dvp) { - vdrop(dvp); - counter_u64_add(numcachehv, -1); - } return; } From owner-svn-src-all@freebsd.org Mon Jan 20 19:56:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D8FF0224D43; Mon, 20 Jan 2020 19:56:22 +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 481j925QdKz4v6b; Mon, 20 Jan 2020 19:56:22 +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 B5769CD8; Mon, 20 Jan 2020 19:56:22 +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 00KJuMj0084539; Mon, 20 Jan 2020 19:56:22 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KJuMIu084538; Mon, 20 Jan 2020 19:56:22 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <202001201956.00KJuMIu084538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 20 Jan 2020 19:56:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356928 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 356928 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 19:56:22 -0000 Author: oshogbo Date: Mon Jan 20 19:56:22 2020 New Revision: 356928 URL: https://svnweb.freebsd.org/changeset/base/356928 Log: When MK_CASPER=no is set remove files which are not needed to run system. PR: 242971 Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon Jan 20 19:52:23 2020 (r356927) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Jan 20 19:56:22 2020 (r356928) @@ -1141,6 +1141,15 @@ OLD_DIRS+=usr/tests/usr.bin/calendar .endif .if ${MK_CASPER} == no +OLD_LIBS+=lib/libcasper.so.1 +OLD_LIBS+=lib/casper/libcap_dns.so.2 +OLD_LIBS+=lib/casper/libcap_fileargs.so.1 +OLD_LIBS+=lib/casper/libcap_grp.so.1 +OLD_LIBS+=lib/casper/libcap_net.so.1 +OLD_LIBS+=lib/casper/libcap_pwd.so.1 +OLD_LIBS+=lib/casper/libcap_sysctl.so.1 +OLD_LIBS+=lib/casper/libcap_sysctl.so.2 +OLD_LIBS+=lib/casper/libcap_syslog.so.1 .endif .if ${MK_CCD} == no From owner-svn-src-all@freebsd.org Mon Jan 20 20:10:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53D6F225572; Mon, 20 Jan 2020 20:10:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 481jTL1d06z3CsK; Mon, 20 Jan 2020 20:10:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32962ECD; Mon, 20 Jan 2020 20:10:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00KKAUiR093316; Mon, 20 Jan 2020 20:10:30 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KKAS5J093308; Mon, 20 Jan 2020 20:10:28 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001202010.00KKAS5J093308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 20 Jan 2020 20:10:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356929 - in head/contrib/llvm-project: clang/lib/Basic/Targets clang/lib/Driver/ToolChains/Arch llvm/include/llvm/ADT llvm/lib/Support llvm/lib/Target/PowerPC X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head/contrib/llvm-project: clang/lib/Basic/Targets clang/lib/Driver/ToolChains/Arch llvm/include/llvm/ADT llvm/lib/Support llvm/lib/Target/PowerPC X-SVN-Commit-Revision: 356929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 20:10:30 -0000 Author: dim Date: Mon Jan 20 20:10:28 2020 New Revision: 356929 URL: https://svnweb.freebsd.org/changeset/base/356929 Log: Merge commit bc4bc5aa0 from llvm git (by Justin Hibbits): Add 8548 CPU definition and attributes 8548 CPU is GCC's name for the e500v2, so accept this in clang. The e500v2 doesn't support lwsync, so define __NO_LWSYNC__ for this as well, as GCC does. Differential Revision: https://reviews.llvm.org/D67787 Merge commit ff0311c4b from llvm git (by Justin Hibbits): [PowerPC]: Add powerpcspe target triple subarch component Summary: This allows the use of '-target powerpcspe-unknown-linux-gnu' or 'powerpcspe-unknown-freebsd' to be used, instead of '-target powerpc-unknown-linux-gnu -mspe'. Reviewed By: dim Differential Revision: https://reviews.llvm.org/D72014 Merge commit ba91dffaf from llvm git (by Fangrui Song): [Driver][PowerPC] Move powerpcspe logic from cc1 to Driver Follow-up of D72014. It is more appropriate to use a target feature instead of a SubTypeArch to express the difference. Reviewed By: #powerpc, jhibbits Differential Revision: https://reviews.llvm.org/D72433 commit 36eedfcb3 from llvm git (by Justin Hibbits): [PowerPC] Fix powerpcspe subtarget enablement in llvm backend Summary: As currently written, -target powerpcspe will enable SPE regardless of disabling the feature later on in the command line. Instead, change this to just set a default CPU to 'e500' instead of a generic CPU. As part of this, add FeatureSPE to the e500 definition. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D72673 These are needed to unbreak the build for powerpcspe. Requested by: jhibbits MFC after: 1 week Modified: head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/PPC.cpp head/contrib/llvm-project/llvm/include/llvm/ADT/Triple.h head/contrib/llvm-project/llvm/lib/Support/Triple.cpp head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPC.td head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCSubtarget.cpp Modified: head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp Mon Jan 20 19:56:22 2020 (r356928) +++ head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp Mon Jan 20 20:10:28 2020 (r356929) @@ -157,6 +157,8 @@ void PPCTargetInfo::getTargetDefines(const LangOptions Builder.defineMacro("_ARCH_A2Q"); Builder.defineMacro("_ARCH_QP"); } + if (ArchDefs & ArchDefineE500) + Builder.defineMacro("__NO_LWSYNC__"); if (getTriple().getVendor() == llvm::Triple::BGQ) { Builder.defineMacro("__bg__"); @@ -312,6 +314,11 @@ bool PPCTargetInfo::initFeatureMap( .Case("pwr8", true) .Default(false); + Features["spe"] = llvm::StringSwitch(CPU) + .Case("8548", true) + .Case("e500", true) + .Default(false); + if (!ppcUserFeaturesCheck(Diags, FeaturesVec)) return false; @@ -449,16 +456,16 @@ ArrayRef PPCTargetInfo::getGC } static constexpr llvm::StringLiteral ValidCPUNames[] = { - {"generic"}, {"440"}, {"450"}, {"601"}, {"602"}, - {"603"}, {"603e"}, {"603ev"}, {"604"}, {"604e"}, - {"620"}, {"630"}, {"g3"}, {"7400"}, {"g4"}, - {"7450"}, {"g4+"}, {"750"}, {"970"}, {"g5"}, - {"a2"}, {"a2q"}, {"e500mc"}, {"e5500"}, {"power3"}, - {"pwr3"}, {"power4"}, {"pwr4"}, {"power5"}, {"pwr5"}, - {"power5x"}, {"pwr5x"}, {"power6"}, {"pwr6"}, {"power6x"}, - {"pwr6x"}, {"power7"}, {"pwr7"}, {"power8"}, {"pwr8"}, - {"power9"}, {"pwr9"}, {"powerpc"}, {"ppc"}, {"powerpc64"}, - {"ppc64"}, {"powerpc64le"}, {"ppc64le"}, + {"generic"}, {"440"}, {"450"}, {"601"}, {"602"}, + {"603"}, {"603e"}, {"603ev"}, {"604"}, {"604e"}, + {"620"}, {"630"}, {"g3"}, {"7400"}, {"g4"}, + {"7450"}, {"g4+"}, {"750"}, {"8548"}, {"970"}, + {"g5"}, {"a2"}, {"a2q"}, {"e500"}, {"e500mc"}, + {"e5500"}, {"power3"}, {"pwr3"}, {"power4"}, {"pwr4"}, + {"power5"}, {"pwr5"}, {"power5x"}, {"pwr5x"}, {"power6"}, + {"pwr6"}, {"power6x"}, {"pwr6x"}, {"power7"}, {"pwr7"}, + {"power8"}, {"pwr8"}, {"power9"}, {"pwr9"}, {"powerpc"}, + {"ppc"}, {"powerpc64"}, {"ppc64"}, {"powerpc64le"}, {"ppc64le"}, }; bool PPCTargetInfo::isValidCPUName(StringRef Name) const { Modified: head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h ============================================================================== --- head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h Mon Jan 20 19:56:22 2020 (r356928) +++ head/contrib/llvm-project/clang/lib/Basic/Targets/PPC.h Mon Jan 20 20:10:28 2020 (r356929) @@ -44,7 +44,8 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public T ArchDefinePwr8 = 1 << 12, ArchDefinePwr9 = 1 << 13, ArchDefineA2 = 1 << 14, - ArchDefineA2q = 1 << 15 + ArchDefineA2q = 1 << 15, + ArchDefineE500 = 1 << 16 } ArchDefineTypes; @@ -85,8 +86,7 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public T // Note: GCC recognizes the following additional cpus: // 401, 403, 405, 405fp, 440fp, 464, 464fp, 476, 476fp, 505, 740, 801, - // 821, 823, 8540, 8548, e300c2, e300c3, e500mc64, e6500, 860, cell, - // titan, rs64. + // 821, 823, 8540, e300c2, e300c3, e500mc64, e6500, 860, cell, titan, rs64. bool isValidCPUName(StringRef Name) const override; void fillValidCPUList(SmallVectorImpl &Values) const override; @@ -145,6 +145,7 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public T ArchDefinePwr9 | ArchDefinePwr8 | ArchDefinePwr7 | ArchDefinePwr6 | ArchDefinePwr5x | ArchDefinePwr5 | ArchDefinePwr4 | ArchDefinePpcgr | ArchDefinePpcsq) + .Cases("8548", "e500", ArchDefineE500) .Default(ArchDefineNone); } return CPUKnown; Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/PPC.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/PPC.cpp Mon Jan 20 19:56:22 2020 (r356928) +++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/PPC.cpp Mon Jan 20 20:10:28 2020 (r356929) @@ -52,10 +52,12 @@ std::string ppc::getPPCTargetCPU(const ArgList &Args) .Case("7450", "7450") .Case("G4+", "g4+") .Case("750", "750") + .Case("8548", "e500") .Case("970", "970") .Case("G5", "g5") .Case("a2", "a2") .Case("a2q", "a2q") + .Case("e500", "e500") .Case("e500mc", "e500mc") .Case("e5500", "e5500") .Case("power3", "pwr3") @@ -100,6 +102,9 @@ const char *ppc::getPPCAsmModeForCPU(StringRef Name) { void ppc::getPPCTargetFeatures(const Driver &D, const llvm::Triple &Triple, const ArgList &Args, std::vector &Features) { + if (Triple.getSubArch() == llvm::Triple::PPCSubArch_spe) + Features.push_back("+spe"); + handleTargetFeaturesGroup(Args, Features, options::OPT_m_ppc_Features_Group); ppc::FloatABI FloatABI = ppc::getPPCFloatABI(D, Args); Modified: head/contrib/llvm-project/llvm/include/llvm/ADT/Triple.h ============================================================================== --- head/contrib/llvm-project/llvm/include/llvm/ADT/Triple.h Mon Jan 20 19:56:22 2020 (r356928) +++ head/contrib/llvm-project/llvm/include/llvm/ADT/Triple.h Mon Jan 20 20:10:28 2020 (r356929) @@ -128,7 +128,9 @@ class Triple { (public) KalimbaSubArch_v4, KalimbaSubArch_v5, - MipsSubArch_r6 + MipsSubArch_r6, + + PPCSubArch_spe }; enum VendorType { UnknownVendor, Modified: head/contrib/llvm-project/llvm/lib/Support/Triple.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/Support/Triple.cpp Mon Jan 20 19:56:22 2020 (r356928) +++ head/contrib/llvm-project/llvm/lib/Support/Triple.cpp Mon Jan 20 20:10:28 2020 (r356929) @@ -389,7 +389,7 @@ static Triple::ArchType parseArch(StringRef ArchName) // FIXME: Do we need to support these? .Cases("i786", "i886", "i986", Triple::x86) .Cases("amd64", "x86_64", "x86_64h", Triple::x86_64) - .Cases("powerpc", "ppc", "ppc32", Triple::ppc) + .Cases("powerpc", "powerpcspe", "ppc", "ppc32", Triple::ppc) .Cases("powerpc64", "ppu", "ppc64", Triple::ppc64) .Cases("powerpc64le", "ppc64le", Triple::ppc64le) .Case("xscale", Triple::arm) @@ -562,6 +562,9 @@ static Triple::SubArchType parseSubArch(StringRef SubA if (SubArchName.startswith("mips") && (SubArchName.endswith("r6el") || SubArchName.endswith("r6"))) return Triple::MipsSubArch_r6; + + if (SubArchName == "powerpcspe") + return Triple::PPCSubArch_spe; StringRef ARMSubArch = ARM::getCanonicalArchName(SubArchName); Modified: head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPC.td ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPC.td Mon Jan 20 19:56:22 2020 (r356928) +++ head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPC.td Mon Jan 20 20:10:28 2020 (r356929) @@ -378,7 +378,7 @@ def : ProcessorModel<"g5", G5Model, def : ProcessorModel<"e500", PPCE500Model, [DirectiveE500, FeatureICBT, FeatureBookE, - FeatureISEL, FeatureMFTB]>; + FeatureISEL, FeatureMFTB, FeatureSPE]>; def : ProcessorModel<"e500mc", PPCE500mcModel, [DirectiveE500mc, FeatureSTFIWX, FeatureICBT, FeatureBookE, Modified: head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCSubtarget.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCSubtarget.cpp Mon Jan 20 19:56:22 2020 (r356928) +++ head/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCSubtarget.cpp Mon Jan 20 20:10:28 2020 (r356929) @@ -126,6 +126,8 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU // If cross-compiling with -march=ppc64le without -mcpu if (TargetTriple.getArch() == Triple::ppc64le) CPUName = "ppc64le"; + else if (TargetTriple.getSubArch() == Triple::PPCSubArch_spe) + CPUName = "e500"; else CPUName = "generic"; } From owner-svn-src-all@freebsd.org Mon Jan 20 20:26:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3993222613C; Mon, 20 Jan 2020 20:26:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 481jqK0mtyz3HGG; Mon, 20 Jan 2020 20:26:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15CD112DF; Mon, 20 Jan 2020 20:26:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00KKQ4BB008623; Mon, 20 Jan 2020 20:26:04 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KKQ4PY008622; Mon, 20 Jan 2020 20:26:04 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001202026.00KKQ4PY008622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 20 Jan 2020 20:26:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356930 - in head/contrib/llvm-project: clang compiler-rt libcxx libunwind lld lldb llvm openmp X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head/contrib/llvm-project: clang compiler-rt libcxx libunwind lld lldb llvm openmp X-SVN-Commit-Revision: 356930 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 20:26:05 -0000 Author: dim Date: Mon Jan 20 20:26:04 2020 New Revision: 356930 URL: https://svnweb.freebsd.org/changeset/base/356930 Log: Add more Subversion mergeinfo bootstrap information, to hopefully increase the probability of merging in vendor changes. Modified: Directory Properties: head/contrib/llvm-project/clang/ (props changed) head/contrib/llvm-project/compiler-rt/ (props changed) head/contrib/llvm-project/libcxx/ (props changed) head/contrib/llvm-project/libunwind/ (props changed) head/contrib/llvm-project/lld/ (props changed) head/contrib/llvm-project/lldb/ (props changed) head/contrib/llvm-project/llvm/ (props changed) head/contrib/llvm-project/openmp/ (props changed) From owner-svn-src-all@freebsd.org Mon Jan 20 22:15:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E27452288F4; Mon, 20 Jan 2020 22:15:33 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 481mFd5TSpz3N6b; Mon, 20 Jan 2020 22:15:33 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B317D273D; Mon, 20 Jan 2020 22:15:33 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00KMFXOb074536; Mon, 20 Jan 2020 22:15:33 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KMFXkE074535; Mon, 20 Jan 2020 22:15:33 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202001202215.00KMFXkE074535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 20 Jan 2020 22:15: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: r356932 - stable/12/sys/dev/vmware/vmxnet3 X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/sys/dev/vmware/vmxnet3 X-SVN-Commit-Revision: 356932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 22:15:34 -0000 Author: vmaffione Date: Mon Jan 20 22:15:33 2020 New Revision: 356932 URL: https://svnweb.freebsd.org/changeset/base/356932 Log: MFC r356703 vmx: fix initialization of TSO related descriptor fields Fix a mistake introduced by r343291, which ported the vmx(4) driver to iflib. In case of TSO, the hlen field of the (first) tx descriptor must be initialized to the cumulative length of Ethernet, IP and TCP headers. The length of the TCP header was missing. PR: 236999 Reported by: pkelsey Reviewed by: avg Differential Revision: https://reviews.freebsd.org/D22967 Modified: stable/12/sys/dev/vmware/vmxnet3/if_vmx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- stable/12/sys/dev/vmware/vmxnet3/if_vmx.c Mon Jan 20 20:27:51 2020 (r356931) +++ stable/12/sys/dev/vmware/vmxnet3/if_vmx.c Mon Jan 20 22:15:33 2020 (r356932) @@ -1320,7 +1320,7 @@ vmxnet3_isc_txd_encap(void *vsc, if_pkt_info_t pi) hdrlen = pi->ipi_ehdrlen + pi->ipi_ip_hlen; if (pi->ipi_csum_flags & CSUM_TSO) { sop->offload_mode = VMXNET3_OM_TSO; - sop->hlen = hdrlen; + sop->hlen = hdrlen + pi->ipi_tcp_hlen; sop->offload_pos = pi->ipi_tso_segsz; } else if (pi->ipi_csum_flags & (VMXNET3_CSUM_OFFLOAD | VMXNET3_CSUM_OFFLOAD_IPV6)) { From owner-svn-src-all@freebsd.org Mon Jan 20 22:49:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E477D22902F; Mon, 20 Jan 2020 22:49:52 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 481n1D5jp9z3PLB; Mon, 20 Jan 2020 22:49:52 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAF312D3B; Mon, 20 Jan 2020 22:49:52 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00KMnqMP092698; Mon, 20 Jan 2020 22:49:52 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KMnqBF092697; Mon, 20 Jan 2020 22:49:52 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001202249.00KMnqBF092697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Mon, 20 Jan 2020 22:49:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356933 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 356933 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 22:49:53 -0000 Author: jeff Date: Mon Jan 20 22:49:52 2020 New Revision: 356933 URL: https://svnweb.freebsd.org/changeset/base/356933 Log: Reduce object locking in vm_fault. Once we have an exclusively busied page we no longer need an object lock. This reduces the longest hold times and eliminates some trylock code blocks. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D23034 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Mon Jan 20 22:15:33 2020 (r356932) +++ head/sys/vm/vm_fault.c Mon Jan 20 22:49:52 2020 (r356933) @@ -342,10 +342,10 @@ vm_fault_soft_fast(struct faultstate *fs, vm_offset_t *m_hold = m; vm_page_wire(m); } - vm_fault_dirty(fs->entry, m, prot, fault_type, fault_flags); if (psind == 0 && !wired) vm_fault_prefault(fs, vaddr, PFBAK, PFFOR, true); VM_OBJECT_RUNLOCK(fs->first_object); + vm_fault_dirty(fs->entry, m, prot, fault_type, fault_flags); vm_map_lookup_done(fs->map, fs->entry); curthread->td_ru.ru_minflt++; @@ -632,7 +632,7 @@ vm_fault_trap(vm_map_t map, vm_offset_t vaddr, vm_prot } static int -vm_fault_lock_vnode(struct faultstate *fs) +vm_fault_lock_vnode(struct faultstate *fs, bool objlocked) { struct vnode *vp; int error, locked; @@ -668,7 +668,10 @@ vm_fault_lock_vnode(struct faultstate *fs) } vhold(vp); - unlock_and_deallocate(fs); + if (objlocked) + unlock_and_deallocate(fs); + else + fault_deallocate(fs); error = vget(vp, locked | LK_RETRY | LK_CANRECURSE, curthread); vdrop(vp); fs->vp = vp; @@ -863,9 +866,11 @@ RetryFault_oom: */ if (!vm_page_all_valid(fs.m)) goto readrest; - break; /* break to PAGE HAS BEEN FOUND */ + VM_OBJECT_WUNLOCK(fs.object); + break; /* break to PAGE HAS BEEN FOUND. */ } KASSERT(fs.m == NULL, ("fs.m should be NULL, not %p", fs.m)); + VM_OBJECT_ASSERT_WLOCKED(fs.object); /* * Page is not resident. If the pager might contain the page @@ -876,7 +881,7 @@ RetryFault_oom: if (fs.object->type != OBJT_DEFAULT || fs.object == fs.first_object) { if ((fs.object->flags & OBJ_SIZEVNLOCK) != 0) { - rv = vm_fault_lock_vnode(&fs); + rv = vm_fault_lock_vnode(&fs, true); MPASS(rv == KERN_SUCCESS || rv == KERN_RESOURCE_SHORTAGE); if (rv == KERN_RESOURCE_SHORTAGE) @@ -956,12 +961,23 @@ RetryFault_oom: readrest: /* + * Default objects have no pager so no exclusive busy exists + * to protect this page in the chain. Skip to the next + * object without dropping the lock to preserve atomicity of + * shadow faults. + */ + if (fs.object->type == OBJT_DEFAULT) + goto next; + + /* * At this point, we have either allocated a new page or found * an existing page that is only partially valid. * * We hold a reference on the current object and the page is - * exclusive busied. + * exclusive busied. The exclusive busy prevents simultaneous + * faults and collapses while the object lock is dropped. */ + VM_OBJECT_WUNLOCK(fs.object); /* * If the pager for the current object might have the page, @@ -972,8 +988,7 @@ readrest: * have the page, the number of additional pages to read will * apply to subsequent objects in the shadow chain. */ - if (fs.object->type != OBJT_DEFAULT && nera == -1 && - !P_KILLED(curproc)) { + if (nera == -1 && !P_KILLED(curproc)) { KASSERT(fs.lookup_still_valid, ("map unlocked")); era = fs.entry->read_ahead; behavior = vm_map_entry_behavior(fs.entry); @@ -1039,7 +1054,7 @@ readrest: */ unlock_map(&fs); - rv = vm_fault_lock_vnode(&fs); + rv = vm_fault_lock_vnode(&fs, false); MPASS(rv == KERN_SUCCESS || rv == KERN_RESOURCE_SHORTAGE); if (rv == KERN_RESOURCE_SHORTAGE) @@ -1080,15 +1095,14 @@ readrest: } ahead = ulmin(ahead, atop(e_end - vaddr) - 1); } - VM_OBJECT_WUNLOCK(fs.object); rv = vm_pager_get_pages(fs.object, &fs.m, 1, &behind, &ahead); - VM_OBJECT_WLOCK(fs.object); if (rv == VM_PAGER_OK) { faultcount = behind + 1 + ahead; hardfault = true; - break; /* break to PAGE HAS BEEN FOUND */ + break; /* break to PAGE HAS BEEN FOUND. */ } + VM_OBJECT_WLOCK(fs.object); if (rv == VM_PAGER_ERROR) printf("vm_fault: pager read error, pid %d (%s)\n", curproc->p_pid, curproc->p_comm); @@ -1106,6 +1120,7 @@ readrest: } +next: /* * The requested page does not exist at this object/ * offset. Remove the invalid page from the object, @@ -1126,19 +1141,18 @@ readrest: * Move on to the next object. Lock the next object before * unlocking the current one. */ + VM_OBJECT_ASSERT_WLOCKED(fs.object); next_object = fs.object->backing_object; if (next_object == NULL) { /* * If there's no object left, fill the page in the top * object with zeros. */ + VM_OBJECT_WUNLOCK(fs.object); if (fs.object != fs.first_object) { vm_object_pip_wakeup(fs.object); - VM_OBJECT_WUNLOCK(fs.object); - fs.object = fs.first_object; fs.pindex = fs.first_pindex; - VM_OBJECT_WLOCK(fs.object); } MPASS(fs.first_m != NULL); MPASS(fs.m == NULL); @@ -1157,7 +1171,7 @@ readrest: vm_page_valid(fs.m); /* Don't try to prefault neighboring pages. */ faultcount = 1; - break; /* break to PAGE HAS BEEN FOUND */ + break; /* break to PAGE HAS BEEN FOUND. */ } else { MPASS(fs.first_m != NULL); KASSERT(fs.object != next_object, @@ -1173,12 +1187,12 @@ readrest: } } - vm_page_assert_xbusied(fs.m); - /* - * PAGE HAS BEEN FOUND. [Loop invariant still holds -- the object lock - * is held.] + * PAGE HAS BEEN FOUND. A valid page has been found and exclusively + * busied. The object lock must no longer be held. */ + vm_page_assert_xbusied(fs.m); + VM_OBJECT_ASSERT_UNLOCKED(fs.object); /* * If the page is being written, but isn't already owned by the @@ -1202,27 +1216,28 @@ readrest: */ is_first_object_locked = false; if ( - /* - * Only one shadow object - */ - (fs.object->shadow_count == 1) && - /* - * No COW refs, except us - */ - (fs.object->ref_count == 1) && - /* - * No one else can look this object up - */ - (fs.object->handle == NULL) && - /* - * No other ways to look the object up - */ - ((fs.object->flags & OBJ_ANON) != 0) && + /* + * Only one shadow object + */ + fs.object->shadow_count == 1 && + /* + * No COW refs, except us + */ + fs.object->ref_count == 1 && + /* + * No one else can look this object up + */ + fs.object->handle == NULL && + /* + * No other ways to look the object up + */ + (fs.object->flags & OBJ_ANON) != 0 && (is_first_object_locked = VM_OBJECT_TRYWLOCK(fs.first_object)) && - /* - * We don't chase down the shadow chain - */ - fs.object == fs.first_object->backing_object) { + /* + * We don't chase down the shadow chain + */ + fs.object == fs.first_object->backing_object && + VM_OBJECT_TRYWLOCK(fs.object)) { /* * Remove but keep xbusy for replace. fs.m is @@ -1242,11 +1257,13 @@ readrest: fs.first_object->backing_object_offset)); #endif VM_OBJECT_WUNLOCK(fs.object); + VM_OBJECT_WUNLOCK(fs.first_object); fs.first_m = fs.m; fs.m = NULL; VM_CNT_INC(v_cow_optim); } else { - VM_OBJECT_WUNLOCK(fs.object); + if (is_first_object_locked) + VM_OBJECT_WUNLOCK(fs.first_object); /* * Oh, well, lets copy it. */ @@ -1285,8 +1302,6 @@ readrest: fs.object = fs.first_object; fs.pindex = fs.first_pindex; fs.m = fs.first_m; - if (!is_first_object_locked) - VM_OBJECT_WLOCK(fs.object); VM_CNT_INC(v_cow_faults); curthread->td_cow++; } else { @@ -1300,7 +1315,7 @@ readrest: */ if (!fs.lookup_still_valid) { if (!vm_map_trylock_read(fs.map)) { - unlock_and_deallocate(&fs); + fault_deallocate(&fs); goto RetryFault; } fs.lookup_still_valid = true; @@ -1314,7 +1329,7 @@ readrest: * pageout will grab it eventually. */ if (result != KERN_SUCCESS) { - unlock_and_deallocate(&fs); + fault_deallocate(&fs); /* * If retry of map lookup would have blocked then @@ -1326,7 +1341,7 @@ readrest: } if ((retry_object != fs.first_object) || (retry_pindex != fs.first_pindex)) { - unlock_and_deallocate(&fs); + fault_deallocate(&fs); goto RetryFault; } @@ -1341,7 +1356,7 @@ readrest: prot &= retry_prot; fault_type &= retry_prot; if (prot == 0) { - unlock_and_deallocate(&fs); + fault_deallocate(&fs); goto RetryFault; } @@ -1350,6 +1365,7 @@ readrest: ("!wired && VM_FAULT_WIRE")); } } + VM_OBJECT_ASSERT_UNLOCKED(fs.object); /* * If the page was filled by a pager, save the virtual address that @@ -1360,17 +1376,16 @@ readrest: if (hardfault) fs.entry->next_read = vaddr + ptoa(ahead) + PAGE_SIZE; - vm_page_assert_xbusied(fs.m); - vm_fault_dirty(fs.entry, fs.m, prot, fault_type, fault_flags); - /* * Page must be completely valid or it is not fit to * map into user space. vm_pager_get_pages() ensures this. */ + vm_page_assert_xbusied(fs.m); KASSERT(vm_page_all_valid(fs.m), ("vm_fault: page %p partially invalid", fs.m)); - VM_OBJECT_WUNLOCK(fs.object); + vm_fault_dirty(fs.entry, fs.m, prot, fault_type, fault_flags); + /* * Put this page into the physical map. We had to do the unlock above * because pmap_enter() may sleep. We don't put the page @@ -1451,17 +1466,11 @@ vm_fault_dontneed(const struct faultstate *fs, vm_offs vm_size_t size; object = fs->object; - VM_OBJECT_ASSERT_WLOCKED(object); + VM_OBJECT_ASSERT_UNLOCKED(object); first_object = fs->first_object; - if (first_object != object) { - if (!VM_OBJECT_TRYWLOCK(first_object)) { - VM_OBJECT_WUNLOCK(object); - VM_OBJECT_WLOCK(first_object); - VM_OBJECT_WLOCK(object); - } - } /* Neither fictitious nor unmanaged pages can be reclaimed. */ if ((first_object->flags & (OBJ_FICTITIOUS | OBJ_UNMANAGED)) == 0) { + VM_OBJECT_RLOCK(first_object); size = VM_FAULT_DONTNEED_MIN; if (MAXPAGESIZES > 1 && size < pagesizes[1]) size = pagesizes[1]; @@ -1501,9 +1510,8 @@ vm_fault_dontneed(const struct faultstate *fs, vm_offs vm_page_deactivate(m); } } + VM_OBJECT_RUNLOCK(first_object); } - if (first_object != object) - VM_OBJECT_WUNLOCK(first_object); } /* From owner-svn-src-all@freebsd.org Mon Jan 20 23:43:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6470A22A303; Mon, 20 Jan 2020 23:43:48 +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 481pCS1lx7z3wsG; Mon, 20 Jan 2020 23:43:48 +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 378F13A73; Mon, 20 Jan 2020 23:43:48 +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 00KNhmov028306; Mon, 20 Jan 2020 23:43:48 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KNhl9A028305; Mon, 20 Jan 2020 23:43:47 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001202343.00KNhl9A028305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 20 Jan 2020 23:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356934 - head/lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libc/stdlib X-SVN-Commit-Revision: 356934 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 23:43:48 -0000 Author: cem Date: Mon Jan 20 23:43:47 2020 New Revision: 356934 URL: https://svnweb.freebsd.org/changeset/base/356934 Log: libc: Delete unused rand.c ifdef TEST code Modified: head/lib/libc/stdlib/rand.c Modified: head/lib/libc/stdlib/rand.c ============================================================================== --- head/lib/libc/stdlib/rand.c Mon Jan 20 22:49:52 2020 (r356933) +++ head/lib/libc/stdlib/rand.c Mon Jan 20 23:43:47 2020 (r356934) @@ -45,10 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include "un-namespace.h" -#ifdef TEST -#include -#endif /* TEST */ - static int do_rand(unsigned long *ctx) { @@ -116,33 +112,3 @@ __sranddev_fbsd12(void) } } __sym_compat(sranddev, __sranddev_fbsd12, FBSD_1.0); - - -#ifdef TEST - -main() -{ - int i; - unsigned myseed; - - printf("seeding rand with 0x19610910: \n"); - srand(0x19610910); - - printf("generating three pseudo-random numbers:\n"); - for (i = 0; i < 3; i++) - { - printf("next random number = %d\n", rand()); - } - - printf("generating the same sequence with rand_r:\n"); - myseed = 0x19610910; - for (i = 0; i < 3; i++) - { - printf("next random number = %d\n", rand_r(&myseed)); - } - - return 0; -} - -#endif /* TEST */ - From owner-svn-src-all@freebsd.org Mon Jan 20 23:44:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 735E522A372; Mon, 20 Jan 2020 23:44:11 +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 481pCv2FPXz3x0Y; Mon, 20 Jan 2020 23:44:11 +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 486523A8A; Mon, 20 Jan 2020 23:44:11 +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 00KNiBcZ028395; Mon, 20 Jan 2020 23:44:11 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00KNiBfs028394; Mon, 20 Jan 2020 23:44:11 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001202344.00KNiBfs028394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 20 Jan 2020 23:44:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356935 - head/lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libc/stdlib X-SVN-Commit-Revision: 356935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2020 23:44:11 -0000 Author: cem Date: Mon Jan 20 23:44:10 2020 New Revision: 356935 URL: https://svnweb.freebsd.org/changeset/base/356935 Log: random.3: Some minor improvements to wording/clarity Modified: head/lib/libc/stdlib/random.3 Modified: head/lib/libc/stdlib/random.3 ============================================================================== --- head/lib/libc/stdlib/random.3 Mon Jan 20 23:43:47 2020 (r356934) +++ head/lib/libc/stdlib/random.3 Mon Jan 20 23:44:10 2020 (r356935) @@ -28,7 +28,7 @@ .\" @(#)random.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 22, 2019 +.Dd January 20, 2020 .Dt RANDOM 3 .Os .Sh NAME @@ -60,7 +60,7 @@ Applications which require unpredictable random number instead. .Ef .Pp -The +Unless initialized with less than 32 bytes of state, the .Fn random function uses a non-linear additive feedback random number generator employing a @@ -72,53 +72,51 @@ The period of this random number generator is very lar .if t 16\(mu(2\u\s731\s10\d\(mi1). .if n 16*((2**31)\(mi1). .Pp +If initialized with less than 32 bytes of state, +.Fn random +uses the same poor-quality Park-Miller LCG as +.Xr rand 3 . +.Pp The .Fn random and .Fn srandom -functions have (almost) the same calling sequence and initialization properties as the +functions are analagous to .Xr rand 3 and -.Xr srand 3 -functions. +.Xr srand 3 . The difference is that .Xr rand 3 -produces a much less random sequence \(em in fact, the low dozen bits -generated by rand go through a cyclic pattern. -All the bits generated by -.Fn random -are usable. -For example, -.Sq Li random()&01 -will produce a random binary -value. +is a worse pseudo-random number generator. .Pp Like .Xr rand 3 , .Fn random -will by default produce a sequence of numbers that can be duplicated -by calling -.Fn srandom -with -.Ql 1 -as the seed. +is implicitly initialized as if +.Fn srandom "1" +had been invoked explicitly. .Pp The .Fn srandomdev -routine initializes a state array using -pseudo-random numbers obtained from the kernel. -Note that this particular seeding -procedure can generate states which are impossible to reproduce by -calling -.Fn srandom -with any value, since the succeeding terms in the -state buffer are no longer derived from the LC algorithm applied to -a fixed seed. +routine initializes the state array using random numbers obtained from the +kernel. +This can generate states which are impossible to reproduce by calling +.Fn srandom , +because the succeeding terms in the state buffer are no longer derived from the +Park-Miller LCG algorithm applied to a fixed seed. .Pp The .Fn initstate -routine allows a state array, passed in as an argument, to be initialized -for future use. +routine initializes the provided state array of +.Vt uint32_t +values and uses it in future +.Fn random +invocations. +(Despite the +.Vt char * +type of +.Fa state , +the underlying object must be a naturally aligned array of 32-bit values.) The size of the state array (in bytes) is used by .Fn initstate to decide how sophisticated a random number generator it should use \(em the @@ -127,26 +125,21 @@ more state, the better the random numbers will be. 8, 32, 64, 128, and 256 bytes; other amounts will be rounded down to the nearest known amount. Using less than 8 bytes will cause an error.) -The seed for the initialization (which specifies a starting point for -the random number sequence, and provides for restarting at the same -point) is also an argument. The +.Fa seed +is used as in +.Fn srandom . +The .Fn initstate function returns a pointer to the previous state information array. .Pp -Once a state has been initialized, the -.Fn setstate -routine provides for rapid switching between states. The .Fn setstate -function -returns a pointer to the previous state array; its -argument state array is used for further random number generation -until the next call to -.Fn initstate -or -.Fn setstate . +routine switches +.Fn random +to using the provided state. +It returns a pointer to the previous state. .Pp Once a state array has been initialized, it may be restarted at a different point either by calling From owner-svn-src-all@freebsd.org Tue Jan 21 00:12:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62BDE22ACC4; Tue, 21 Jan 2020 00:12:58 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 481ps61wsJz3xxB; Tue, 21 Jan 2020 00:12:58 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D844407B; Tue, 21 Jan 2020 00:12:58 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00L0CwGj045913; Tue, 21 Jan 2020 00:12:58 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00L0Cwnf045912; Tue, 21 Jan 2020 00:12:58 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001210012.00L0Cwnf045912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Tue, 21 Jan 2020 00:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356936 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 356936 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 21 Jan 2020 00:12:58 -0000 Author: jeff Date: Tue Jan 21 00:12:57 2020 New Revision: 356936 URL: https://svnweb.freebsd.org/changeset/base/356936 Log: Move readahead and dropbehind fault functionality into a helper routine for clarity. Reviewed by: dougm, kib, markj Differential Revision: https://reviews.freebsd.org/D23282 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Mon Jan 20 23:44:10 2020 (r356935) +++ head/sys/vm/vm_fault.c Tue Jan 21 00:12:57 2020 (r356936) @@ -120,6 +120,7 @@ __FBSDID("$FreeBSD$"); #define VM_FAULT_DONTNEED_MIN 1048576 struct faultstate { + vm_offset_t vaddr; vm_page_t m; vm_page_t m_cow; vm_object_t object; @@ -680,6 +681,59 @@ vm_fault_lock_vnode(struct faultstate *fs, bool objloc } /* + * Calculate the desired readahead. Handle drop-behind. + * + * Returns the number of readahead blocks to pass to the pager. + */ +static int +vm_fault_readahead(struct faultstate *fs) +{ + int era, nera; + u_char behavior; + + KASSERT(fs->lookup_still_valid, ("map unlocked")); + era = fs->entry->read_ahead; + behavior = vm_map_entry_behavior(fs->entry); + if (behavior == MAP_ENTRY_BEHAV_RANDOM) { + nera = 0; + } else if (behavior == MAP_ENTRY_BEHAV_SEQUENTIAL) { + nera = VM_FAULT_READ_AHEAD_MAX; + if (fs->vaddr == fs->entry->next_read) + vm_fault_dontneed(fs, fs->vaddr, nera); + } else if (fs->vaddr == fs->entry->next_read) { + /* + * This is a sequential fault. Arithmetically + * increase the requested number of pages in + * the read-ahead window. The requested + * number of pages is "# of sequential faults + * x (read ahead min + 1) + read ahead min" + */ + nera = VM_FAULT_READ_AHEAD_MIN; + if (era > 0) { + nera += era + 1; + if (nera > VM_FAULT_READ_AHEAD_MAX) + nera = VM_FAULT_READ_AHEAD_MAX; + } + if (era == VM_FAULT_READ_AHEAD_MAX) + vm_fault_dontneed(fs, fs->vaddr, nera); + } else { + /* + * This is a non-sequential fault. + */ + nera = 0; + } + if (era != nera) { + /* + * A read lock on the map suffices to update + * the read ahead count safely. + */ + fs->entry->read_ahead = nera; + } + + return (nera); +} + +/* * Wait/Retry if the page is busy. We have to do this if the page is * either exclusive or shared busy because the vm_pager may be using * read busy for pageouts (and even pageins if it is the vnode pager), @@ -725,7 +779,7 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fa vm_offset_t e_end, e_start; vm_pindex_t retry_pindex; vm_prot_t prot, retry_prot; - int ahead, alloc_req, behind, cluster_offset, era, faultcount; + int ahead, alloc_req, behind, cluster_offset, faultcount; int nera, oom, result, rv; u_char behavior; boolean_t wired; /* Passed by reference. */ @@ -737,6 +791,7 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fa return (KERN_PROTECTION_FAILURE); fs.vp = NULL; + fs.vaddr = vaddr; faultcount = 0; nera = -1; hardfault = false; @@ -989,45 +1044,7 @@ readrest: * apply to subsequent objects in the shadow chain. */ if (nera == -1 && !P_KILLED(curproc)) { - KASSERT(fs.lookup_still_valid, ("map unlocked")); - era = fs.entry->read_ahead; - behavior = vm_map_entry_behavior(fs.entry); - if (behavior == MAP_ENTRY_BEHAV_RANDOM) { - nera = 0; - } else if (behavior == MAP_ENTRY_BEHAV_SEQUENTIAL) { - nera = VM_FAULT_READ_AHEAD_MAX; - if (vaddr == fs.entry->next_read) - vm_fault_dontneed(&fs, vaddr, nera); - } else if (vaddr == fs.entry->next_read) { - /* - * This is a sequential fault. Arithmetically - * increase the requested number of pages in - * the read-ahead window. The requested - * number of pages is "# of sequential faults - * x (read ahead min + 1) + read ahead min" - */ - nera = VM_FAULT_READ_AHEAD_MIN; - if (era > 0) { - nera += era + 1; - if (nera > VM_FAULT_READ_AHEAD_MAX) - nera = VM_FAULT_READ_AHEAD_MAX; - } - if (era == VM_FAULT_READ_AHEAD_MAX) - vm_fault_dontneed(&fs, vaddr, nera); - } else { - /* - * This is a non-sequential fault. - */ - nera = 0; - } - if (era != nera) { - /* - * A read lock on the map suffices to update - * the read ahead count safely. - */ - fs.entry->read_ahead = nera; - } - + nera = vm_fault_readahead(&fs); /* * Prepare for unlocking the map. Save the map * entry's start and end addresses, which are used to @@ -1038,6 +1055,7 @@ readrest: */ e_start = fs.entry->start; e_end = fs.entry->end; + behavior = vm_map_entry_behavior(fs.entry); } /* From owner-svn-src-all@freebsd.org Tue Jan 21 05:01:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9519231644; Tue, 21 Jan 2020 05:01:11 +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 481xFg44vNz4BS1; Tue, 21 Jan 2020 05:01:11 +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 877FE75C6; Tue, 21 Jan 2020 05:01:11 +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 00L51B4X015086; Tue, 21 Jan 2020 05:01:11 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00L51BWm015085; Tue, 21 Jan 2020 05:01:11 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001210501.00L51BWm015085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 21 Jan 2020 05:01:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356937 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 356937 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 21 Jan 2020 05:01:11 -0000 Author: kevans Date: Tue Jan 21 05:01:11 2020 New Revision: 356937 URL: https://svnweb.freebsd.org/changeset/base/356937 Log: sysent.mk: split interpreter out of target command The main objective here is to make it easy to identify what needs to change in order to use a different sysent generator than the current Lua-based one, which may be used to MFC some of the changes that have happened so we can avoid parallel accidents in stable branches, for instance. As a secondary objective, it's now feasible to override the generator on a per-Makefile basis if needed, so that one could refactor their Makefile to use this while pinning generation to the legacy makesyscalls.sh. I don't anticipate any consistent need for such a thing, but it's low-effort to achieve. Modified: head/sys/conf/sysent.mk Modified: head/sys/conf/sysent.mk ============================================================================== --- head/sys/conf/sysent.mk Tue Jan 21 00:12:57 2020 (r356936) +++ head/sys/conf/sysent.mk Tue Jan 21 05:01:11 2020 (r356937) @@ -21,8 +21,11 @@ SYSENT_CONF?= syscalls.conf # and set GENERATED. SRCS+= ${SYSENT_FILE} SRCS+= ${SYSENT_CONF} -MAKESYSCALLS= ${SYSDIR}/tools/makesyscalls.lua +MAKESYSCALLS_INTERP?= ${LUA} +MAKESYSCALLS_SCRIPT?= ${SYSDIR}/tools/makesyscalls.lua +MAKESYSCALLS= ${MAKESYSCALLS_INTERP} ${MAKESYSCALLS_SCRIPT} + all: @echo "make sysent only" @@ -31,5 +34,5 @@ all: .ORDER: ${GENERATED} sysent: ${GENERATED} -${GENERATED}: ${MAKESYSCALLS} ${SRCS} - ${LUA} ${MAKESYSCALLS} ${SYSENT_FILE} ${SYSENT_CONF} +${GENERATED}: ${MAKESYSCALLS_SCRIPT} ${SRCS} + ${MAKESYSCALLS} ${SYSENT_FILE} ${SYSENT_CONF} From owner-svn-src-all@freebsd.org Tue Jan 21 11:43:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 554C91F25BA; Tue, 21 Jan 2020 11:43:26 +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 48269p1f41z4V6x; Tue, 21 Jan 2020 11:43:26 +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 32F71C296; Tue, 21 Jan 2020 11:43:26 +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 00LBhQH7059273; Tue, 21 Jan 2020 11:43:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00LBhQfT059272; Tue, 21 Jan 2020 11:43:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202001211143.00LBhQfT059272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 21 Jan 2020 11:43:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356938 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 356938 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 21 Jan 2020 11:43:26 -0000 Author: hselasky Date: Tue Jan 21 11:43:25 2020 New Revision: 356938 URL: https://svnweb.freebsd.org/changeset/base/356938 Log: Make sure the VNET is properly set when calling tcp_drop() from the ktls taskqueue callback function. A valid VNET is needed when updating statistics. panic() tcp_state_change() tcp_drop() ktls_reset_send_tag() taskqueue_run_locked() taskqueue_thread_loop() Sponsored by: Mellanox Technologies Modified: head/sys/kern/uipc_ktls.c Modified: head/sys/kern/uipc_ktls.c ============================================================================== --- head/sys/kern/uipc_ktls.c Tue Jan 21 05:01:11 2020 (r356937) +++ head/sys/kern/uipc_ktls.c Tue Jan 21 11:43:25 2020 (r356938) @@ -1141,7 +1141,9 @@ ktls_reset_send_tag(void *context, int pending) if (!(inp->inp_flags & INP_TIMEWAIT) && !(inp->inp_flags & INP_DROPPED)) { tp = intotcpcb(inp); + CURVNET_SET(tp->t_vnet); tp = tcp_drop(tp, ECONNABORTED); + CURVNET_RESTORE(); if (tp != NULL) INP_WUNLOCK(inp); counter_u64_add(ktls_ifnet_reset_dropped, 1); From owner-svn-src-all@freebsd.org Tue Jan 21 12:00:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FB701F3493; Tue, 21 Jan 2020 12:00:35 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4826Yb0Y4Wz4W1L; Tue, 21 Jan 2020 12:00:35 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E98BCC46C; Tue, 21 Jan 2020 12:00:34 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00LC0YMr066388; Tue, 21 Jan 2020 12:00:34 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00LC0YXn066386; Tue, 21 Jan 2020 12:00:34 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202001211200.00LC0YXn066386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Tue, 21 Jan 2020 12:00:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356939 - in head/sys: net netinet6 X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/sys: net netinet6 X-SVN-Commit-Revision: 356939 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 21 Jan 2020 12:00:35 -0000 Author: melifaro Date: Tue Jan 21 12:00:34 2020 New Revision: 356939 URL: https://svnweb.freebsd.org/changeset/base/356939 Log: Document requirements for the 'struct route' variations. MFC after: 2 weeks Modified: head/sys/net/route_var.h head/sys/netinet6/in6_fib.c Modified: head/sys/net/route_var.h ============================================================================== --- head/sys/net/route_var.h Tue Jan 21 11:43:25 2020 (r356938) +++ head/sys/net/route_var.h Tue Jan 21 12:00:34 2020 (r356939) @@ -61,6 +61,30 @@ struct rib_head { #define RIB_LOCK_ASSERT(rh) rm_assert(&(rh)->rib_lock, RA_LOCKED) #define RIB_WLOCK_ASSERT(rh) rm_assert(&(rh)->rib_lock, RA_WLOCKED) +/* Macro for verifying fields in af-specific 'struct route' structures */ +#define CHK_STRUCT_FIELD_GENERIC(_s1, _f1, _s2, _f2) \ +_Static_assert(sizeof(((_s1 *)0)->_f1) == sizeof(((_s2 *)0)->_f2), \ + "Fields " #_f1 " and " #_f2 " size differs"); \ +_Static_assert(__offsetof(_s1, _f1) == __offsetof(_s2, _f2), \ + "Fields " #_f1 " and " #_f2 " offset differs"); + +#define _CHK_ROUTE_FIELD(_route_new, _field) \ + CHK_STRUCT_FIELD_GENERIC(struct route, _field, _route_new, _field) + +#define CHK_STRUCT_ROUTE_FIELDS(_route_new) \ + _CHK_ROUTE_FIELD(_route_new, ro_rt) \ + _CHK_ROUTE_FIELD(_route_new, ro_lle) \ + _CHK_ROUTE_FIELD(_route_new, ro_prepend)\ + _CHK_ROUTE_FIELD(_route_new, ro_plen) \ + _CHK_ROUTE_FIELD(_route_new, ro_flags) \ + _CHK_ROUTE_FIELD(_route_new, ro_mtu) \ + _CHK_ROUTE_FIELD(_route_new, spare) + +#define CHK_STRUCT_ROUTE_COMPAT(_ro_new, _dst_new) \ +CHK_STRUCT_ROUTE_FIELDS(_ro_new); \ +_Static_assert(__offsetof(struct route, ro_dst) == __offsetof(_ro_new, _dst_new),\ + "ro_dst and " #_dst_new " are at different offset") + struct rib_head *rt_tables_get_rnh(int fib, int family); /* rte<>nhop translation */ Modified: head/sys/netinet6/in6_fib.c ============================================================================== --- head/sys/netinet6/in6_fib.c Tue Jan 21 11:43:25 2020 (r356938) +++ head/sys/netinet6/in6_fib.c Tue Jan 21 12:00:34 2020 (r356939) @@ -75,6 +75,8 @@ static void fib6_rte_to_nh_basic(struct rtentry *rte, static struct ifnet *fib6_get_ifaifp(struct rtentry *rte); #define RNTORT(p) ((struct rtentry *)(p)) +CHK_STRUCT_ROUTE_COMPAT(struct route_in6, ro_dst); + /* * Gets real interface for the @rte. * Returns rt_ifp for !IFF_LOOPBACK routers. From owner-svn-src-all@freebsd.org Tue Jan 21 13:22:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 387D91F5DED; Tue, 21 Jan 2020 13:22:39 +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 4828NH0jd4z4ZxL; Tue, 21 Jan 2020 13:22: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 EDBC0D502; Tue, 21 Jan 2020 13:22:38 +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 00LDMc0X019130; Tue, 21 Jan 2020 13:22:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00LDMaGQ019117; Tue, 21 Jan 2020 13:22:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202001211322.00LDMaGQ019117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 21 Jan 2020 13:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356940 - in head: stand/i386/libi386 sys/amd64/amd64 sys/i386/i386 sys/x86/cpufreq sys/x86/include sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: stand/i386/libi386 sys/amd64/amd64 sys/i386/i386 sys/x86/cpufreq sys/x86/include sys/x86/x86 X-SVN-Commit-Revision: 356940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 21 Jan 2020 13:22:39 -0000 Author: kib Date: Tue Jan 21 13:22:35 2020 New Revision: 356940 URL: https://svnweb.freebsd.org/changeset/base/356940 Log: Add support for Hygon Dhyana Family 18h processor. As a new x86 CPU vendor, Chengdu Haiguang IC Design Co., Ltd (Hygon) is a joint venture between AMD and Haiguang Information Technology Co., Ltd., aims at providing x86 processors for China server market. The first generation Hygon processor(Dhyana) shares most architecture with AMD's family 17h, but with different CPU vendor ID("HygonGenuine") and PCI vendor ID(0x1d94) and family series number 18h(Hygon negotiated with AMD to confirm that only Hygon use family 18h). To enable Hygon Dhyana support in FreeBSD, add new definitions HYGON_VENDOR_ID("HygonGenuine") and X86_VENDOR_HYGON(0x1d94) to identify Hygon Dhyana CPU. Initialize the CPU features(topology, local APIC ext, MSI, TSC, hwpstate, MCA, DEBUG_CTL, etc) for amd64 and i386 mode by sharing the code path of AMD family 17h. The changes have been applied on FreeBSD 13.0-CURRENT and tested successfully on Hygon Dhyana processor. References: [1] Linux kernel patches for Hygon Dhyana, merged in 4.20: https://git.kernel.org/tip/c9661c1e80b609cd038db7c908e061f0535804ef [2] MSR and CPUID definition: https://www.amd.com/system/files/TechDocs/54945_PPR_Family_17h_Models_00h-0Fh.pdf Submitted by: Pu Wen MFC after: 1 week Differential revision: https://reviews.freebsd.org/D23163 Modified: head/stand/i386/libi386/bootinfo64.c head/sys/amd64/amd64/initcpu.c head/sys/i386/i386/machdep.c head/sys/x86/cpufreq/hwpstate.c head/sys/x86/include/cputypes.h head/sys/x86/include/specialreg.h head/sys/x86/x86/identcpu.c head/sys/x86/x86/local_apic.c head/sys/x86/x86/mca.c head/sys/x86/x86/mp_x86.c head/sys/x86/x86/msi.c head/sys/x86/x86/tsc.c Modified: head/stand/i386/libi386/bootinfo64.c ============================================================================== --- head/stand/i386/libi386/bootinfo64.c Tue Jan 21 12:00:34 2020 (r356939) +++ head/stand/i386/libi386/bootinfo64.c Tue Jan 21 13:22:35 2020 (r356940) @@ -158,6 +158,7 @@ bi_checkcpu(void) /* Check for vendors that support AMD features. */ if (strncmp(cpu_vendor, INTEL_VENDOR_ID, 12) != 0 && strncmp(cpu_vendor, AMD_VENDOR_ID, 12) != 0 && + strncmp(cpu_vendor, HYGON_VENDOR_ID, 12) != 0 && strncmp(cpu_vendor, CENTAUR_VENDOR_ID, 12) != 0) return (0); Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Tue Jan 21 12:00:34 2020 (r356939) +++ head/sys/amd64/amd64/initcpu.c Tue Jan 21 13:22:35 2020 (r356940) @@ -171,7 +171,8 @@ init_amd(void) */ if (lower_sharedpage_init == 0) { lower_sharedpage_init = 1; - if (CPUID_TO_FAMILY(cpu_id) == 0x17) { + if (CPUID_TO_FAMILY(cpu_id) == 0x17 || + CPUID_TO_FAMILY(cpu_id) == 0x18) { hw_lower_amd64_sharedpage = 1; } } @@ -259,6 +260,7 @@ initializecpu(void) amd64_syscall_ret_flush_l1d_recalc(); switch (cpu_vendor_id) { case CPU_VENDOR_AMD: + case CPU_VENDOR_HYGON: init_amd(); break; case CPU_VENDOR_CENTAUR: Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Tue Jan 21 12:00:34 2020 (r356939) +++ head/sys/i386/i386/machdep.c Tue Jan 21 13:22:35 2020 (r356940) @@ -1607,8 +1607,9 @@ DB_SHOW_COMMAND(sysregs, db_show_sysregs) if (cpu_feature2 & (CPUID2_VMX | CPUID2_SMX)) db_printf("FEATURES_CTL\t0x%016llx\n", rdmsr(MSR_IA32_FEATURE_CONTROL)); - if ((cpu_vendor_id == CPU_VENDOR_INTEL || - cpu_vendor_id == CPU_VENDOR_AMD) && CPUID_TO_FAMILY(cpu_id) >= 6) + if (((cpu_vendor_id == CPU_VENDOR_INTEL || + cpu_vendor_id == CPU_VENDOR_AMD) && CPUID_TO_FAMILY(cpu_id) >= 6) || + cpu_vendor_id == CPU_VENDOR_HYGON) db_printf("DEBUG_CTL\t0x%016llx\n", rdmsr(MSR_DEBUGCTLMSR)); if (cpu_feature & CPUID_PAT) db_printf("PAT\t0x%016llx\n", rdmsr(MSR_PAT)); Modified: head/sys/x86/cpufreq/hwpstate.c ============================================================================== --- head/sys/x86/cpufreq/hwpstate.c Tue Jan 21 12:00:34 2020 (r356939) +++ head/sys/x86/cpufreq/hwpstate.c Tue Jan 21 13:22:35 2020 (r356940) @@ -315,7 +315,8 @@ hwpstate_identify(driver_t *driver, device_t parent) if (device_find_child(parent, "hwpstate", -1) != NULL) return; - if (cpu_vendor_id != CPU_VENDOR_AMD || CPUID_TO_FAMILY(cpu_id) < 0x10) + if ((cpu_vendor_id != CPU_VENDOR_AMD || CPUID_TO_FAMILY(cpu_id) < 0x10) && + cpu_vendor_id != CPU_VENDOR_HYGON) return; /* @@ -446,6 +447,7 @@ hwpstate_get_info_from_msr(device_t dev) hwpstate_set[i].freq = (100 * (fid + 0x10)) >> did; break; case 0x17: + case 0x18: did = AMD_17H_CUR_DID(msr); if (did == 0) { HWPSTATE_DEBUG(dev, "unexpected did: 0\n"); @@ -455,8 +457,10 @@ hwpstate_get_info_from_msr(device_t dev) hwpstate_set[i].freq = (200 * fid) / did; break; default: - HWPSTATE_DEBUG(dev, "get_info_from_msr: AMD family" - " 0x%02x CPUs are not supported yet\n", family); + HWPSTATE_DEBUG(dev, "get_info_from_msr: %s family" + " 0x%02x CPUs are not supported yet\n", + cpu_vendor_id == CPU_VENDOR_HYGON ? "Hygon" : "AMD", + family); return (ENXIO); } hwpstate_set[i].pstate_id = i; Modified: head/sys/x86/include/cputypes.h ============================================================================== --- head/sys/x86/include/cputypes.h Tue Jan 21 12:00:34 2020 (r356939) +++ head/sys/x86/include/cputypes.h Tue Jan 21 13:22:35 2020 (r356940) @@ -45,5 +45,6 @@ #define CPU_VENDOR_INTEL 0x8086 /* Intel */ #define CPU_VENDOR_RISE 0xdead2bad /* Rise */ #define CPU_VENDOR_CENTAUR CPU_VENDOR_IDT +#define CPU_VENDOR_HYGON 0x1d94 /* Hygon */ #endif /* !_X86_CPUTYPES_H_ */ Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Tue Jan 21 12:00:34 2020 (r356939) +++ head/sys/x86/include/specialreg.h Tue Jan 21 13:22:35 2020 (r356940) @@ -511,6 +511,7 @@ #define SIS_VENDOR_ID "SiS SiS SiS " #define TRANSMETA_VENDOR_ID "GenuineTMx86" #define UMC_VENDOR_ID "UMC UMC UMC " +#define HYGON_VENDOR_ID "HygonGenuine" /* * Model-specific registers for the i386 family Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Tue Jan 21 12:00:34 2020 (r356939) +++ head/sys/x86/x86/identcpu.c Tue Jan 21 13:22:35 2020 (r356940) @@ -223,6 +223,7 @@ static struct { } cpu_vendors[] = { { INTEL_VENDOR_ID, CPU_VENDOR_INTEL }, /* GenuineIntel */ { AMD_VENDOR_ID, CPU_VENDOR_AMD }, /* AuthenticAMD */ + { HYGON_VENDOR_ID, CPU_VENDOR_HYGON }, /* HygonGenuine*/ { CENTAUR_VENDOR_ID, CPU_VENDOR_CENTAUR }, /* CentaurHauls */ #ifdef __i386__ { NSC_VENDOR_ID, CPU_VENDOR_NSC }, /* Geode by NSC */ @@ -682,6 +683,18 @@ printcpuinfo(void) } break; #endif + case CPU_VENDOR_HYGON: + strcpy(cpu_model, "Hygon "); +#ifdef __i386__ + strcat(cpu_model, "Unknown"); +#else + if ((cpu_id & 0xf00) == 0xf00) + strcat(cpu_model, "AMD64 Processor"); + else + strcat(cpu_model, "Unknown"); +#endif + break; + default: strcat(cpu_model, "Unknown"); break; @@ -741,6 +754,7 @@ printcpuinfo(void) if (cpu_vendor_id == CPU_VENDOR_INTEL || cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_HYGON || cpu_vendor_id == CPU_VENDOR_CENTAUR || #ifdef __i386__ cpu_vendor_id == CPU_VENDOR_TRANSMETA || @@ -1095,7 +1109,8 @@ printcpuinfo(void) print_svm_info(); if ((cpu_feature & CPUID_HTT) && - cpu_vendor_id == CPU_VENDOR_AMD) + (cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_HYGON)) cpu_feature &= ~CPUID_HTT; /* @@ -1125,7 +1140,8 @@ printcpuinfo(void) printf("\n"); if (bootverbose) { - if (cpu_vendor_id == CPU_VENDOR_AMD) + if (cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_HYGON) print_AMD_info(); else if (cpu_vendor_id == CPU_VENDOR_INTEL) print_INTEL_info(); @@ -1631,6 +1647,7 @@ finishidentcpu(void) if (cpu_high > 0 && (cpu_vendor_id == CPU_VENDOR_INTEL || cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_HYGON || cpu_vendor_id == CPU_VENDOR_TRANSMETA || cpu_vendor_id == CPU_VENDOR_CENTAUR || cpu_vendor_id == CPU_VENDOR_NSC)) { @@ -1641,6 +1658,7 @@ finishidentcpu(void) #else if (cpu_vendor_id == CPU_VENDOR_INTEL || cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_HYGON || cpu_vendor_id == CPU_VENDOR_CENTAUR) { do_cpuid(0x80000000, regs); cpu_exthigh = regs[0]; @@ -1760,7 +1778,8 @@ int pti_get_default(void) { - if (strcmp(cpu_vendor, AMD_VENDOR_ID) == 0) + if (strcmp(cpu_vendor, AMD_VENDOR_ID) == 0 || + strcmp(cpu_vendor, HYGON_VENDOR_ID) == 0) return (0); if ((cpu_ia32_arch_caps & IA32_ARCH_CAP_RDCL_NO) != 0) return (0); Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Tue Jan 21 12:00:34 2020 (r356939) +++ head/sys/x86/x86/local_apic.c Tue Jan 21 13:22:35 2020 (r356940) @@ -669,7 +669,8 @@ amd_read_ext_features(void) { uint32_t version; - if (cpu_vendor_id != CPU_VENDOR_AMD) + if (cpu_vendor_id != CPU_VENDOR_AMD && + cpu_vendor_id != CPU_VENDOR_HYGON) return (0); version = lapic_read32(LAPIC_VERSION); if ((version & APIC_VER_AMD_EXT_SPACE) != 0) Modified: head/sys/x86/x86/mca.c ============================================================================== --- head/sys/x86/x86/mca.c Tue Jan 21 12:00:34 2020 (r356939) +++ head/sys/x86/x86/mca.c Tue Jan 21 13:22:35 2020 (r356940) @@ -197,7 +197,8 @@ static int amd_elvt = -1; static inline bool amd_thresholding_supported(void) { - if (cpu_vendor_id != CPU_VENDOR_AMD) + if (cpu_vendor_id != CPU_VENDOR_AMD && + cpu_vendor_id != CPU_VENDOR_HYGON) return (false); /* * The RASCap register is wholly reserved in families 0x10-0x15 (through model 1F). Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Tue Jan 21 12:00:34 2020 (r356939) +++ head/sys/x86/x86/mp_x86.c Tue Jan 21 13:22:35 2020 (r356940) @@ -515,7 +515,8 @@ topo_probe(void) if (mp_ncpus <= 1) ; /* nothing */ - else if (cpu_vendor_id == CPU_VENDOR_AMD) + else if (cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_HYGON) topo_probe_amd(); else if (cpu_vendor_id == CPU_VENDOR_INTEL) topo_probe_intel(); Modified: head/sys/x86/x86/msi.c ============================================================================== --- head/sys/x86/x86/msi.c Tue Jan 21 12:00:34 2020 (r356939) +++ head/sys/x86/x86/msi.c Tue Jan 21 13:22:35 2020 (r356940) @@ -321,6 +321,7 @@ msi_init(void) switch (cpu_vendor_id) { case CPU_VENDOR_INTEL: case CPU_VENDOR_AMD: + case CPU_VENDOR_HYGON: break; case CPU_VENDOR_CENTAUR: if (CPUID_TO_FAMILY(cpu_id) == 0x6 && Modified: head/sys/x86/x86/tsc.c ============================================================================== --- head/sys/x86/x86/tsc.c Tue Jan 21 12:00:34 2020 (r356939) +++ head/sys/x86/x86/tsc.c Tue Jan 21 13:22:35 2020 (r356940) @@ -250,6 +250,7 @@ probe_tsc_freq(void) switch (cpu_vendor_id) { case CPU_VENDOR_AMD: + case CPU_VENDOR_HYGON: if ((amd_pminfo & AMDPM_TSC_INVARIANT) != 0 || (vm_guest == VM_GUEST_NO && CPUID_TO_FAMILY(cpu_id) >= 0x10)) @@ -513,6 +514,7 @@ retry: if (smp_tsc && tsc_is_invariant) { switch (cpu_vendor_id) { case CPU_VENDOR_AMD: + case CPU_VENDOR_HYGON: /* * Starting with Family 15h processors, TSC clock * source is in the north bridge. Check whether @@ -610,7 +612,8 @@ init: for (shift = 0; shift <= 31 && (tsc_freq >> shift) > max_freq; shift++) ; if ((cpu_feature & CPUID_SSE2) != 0 && mp_ncpus > 1) { - if (cpu_vendor_id == CPU_VENDOR_AMD) { + if (cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_HYGON) { tsc_timecounter.tc_get_timecount = shift > 0 ? tsc_get_timecount_low_mfence : tsc_get_timecount_mfence; From owner-svn-src-all@freebsd.org Tue Jan 21 15:07:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 078EC1F8DEB; Tue, 21 Jan 2020 15:07: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 482Bj76FByz4gL6; Tue, 21 Jan 2020 15:07: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 D1932E782; Tue, 21 Jan 2020 15:07: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 00LF7Nia078904; Tue, 21 Jan 2020 15:07:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00LF7Nk7078903; Tue, 21 Jan 2020 15:07:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001211507.00LF7Nk7078903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 21 Jan 2020 15:07: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: r356941 - stable/12/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Commit-Revision: 356941 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 21 Jan 2020 15:07:24 -0000 Author: markj Date: Tue Jan 21 15:07:23 2020 New Revision: 356941 URL: https://svnweb.freebsd.org/changeset/base/356941 Log: MFC r356477: Use a deterministic hash for USDT symbol names. Modified: stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Tue Jan 21 13:22:35 2020 (r356940) +++ stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Tue Jan 21 15:07:23 2020 (r356941) @@ -57,7 +57,6 @@ #include #endif #include -#include #include #include @@ -1249,13 +1248,32 @@ dt_link_error(dtrace_hdl_t *dtp, Elf *elf, int fd, dt_ return (dt_set_errno(dtp, EDT_COMPILER)); } +/* + * Provide a unique identifier used when adding global symbols to an object. + * This is the FNV-1a hash of an absolute path for the file. + */ +static unsigned int +hash_obj(const char *obj, int fd) +{ + char path[PATH_MAX]; + unsigned int h; + + if (realpath(obj, path) == NULL) + return (-1); + + for (h = 2166136261u, obj = &path[0]; *obj != '\0'; obj++) + h = (h ^ *obj) * 16777619; + h &= 0x7fffffff; + return (h); +} + static int process_obj(dtrace_hdl_t *dtp, const char *obj, int *eprobesp) { static const char dt_prefix[] = "__dtrace"; static const char dt_enabled[] = "enabled"; static const char dt_symprefix[] = "$dtrace"; - static const char dt_symfmt[] = "%s%ld.%s"; + static const char dt_symfmt[] = "%s%u.%s"; static const char dt_weaksymfmt[] = "%s.%s"; char probename[DTRACE_NAMELEN]; int fd, i, ndx, eprobe, mod = 0; @@ -1272,7 +1290,7 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e dt_probe_t *prp; uint32_t off, eclass, emachine1, emachine2; size_t symsize, osym, nsym, isym, istr, len; - key_t objkey; + unsigned int objkey; dt_link_pair_t *pair, *bufs = NULL; dt_strtab_t *strtab; void *tmp; @@ -1350,10 +1368,9 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e * system in order to disambiguate potential conflicts between files of * the same name which contain identially named local symbols. */ - if ((objkey = ftok(obj, 0)) == (key_t)-1) { + if ((objkey = hash_obj(obj, fd)) == (unsigned int)-1) return (dt_link_error(dtp, elf, fd, bufs, "failed to generate unique key for object file: %s", obj)); - } scn_rel = NULL; while ((scn_rel = elf_nextscn(elf, scn_rel)) != NULL) { From owner-svn-src-all@freebsd.org Tue Jan 21 16:31:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D42A1FBA68; Tue, 21 Jan 2020 16:31:09 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482DYn2KJfz3H0N; Tue, 21 Jan 2020 16:31:09 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AF68F6E5; Tue, 21 Jan 2020 16:31:09 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00LGV99K026699; Tue, 21 Jan 2020 16:31:09 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00LGV9el026698; Tue, 21 Jan 2020 16:31:09 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202001211631.00LGV9el026698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 21 Jan 2020 16:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356942 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 356942 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 21 Jan 2020 16:31:09 -0000 Author: brooks Date: Tue Jan 21 16:31:08 2020 New Revision: 356942 URL: https://svnweb.freebsd.org/changeset/base/356942 Log: Correct a misleading indent. This dates to before the beginning of our repo and was found clang 10. MFC after: 3 days Sponsored by: DARPA Modified: head/lib/libc/gen/ualarm.c Modified: head/lib/libc/gen/ualarm.c ============================================================================== --- head/lib/libc/gen/ualarm.c Tue Jan 21 15:07:23 2020 (r356941) +++ head/lib/libc/gen/ualarm.c Tue Jan 21 16:31:08 2020 (r356942) @@ -56,6 +56,5 @@ ualarm(useconds_t usecs, useconds_t reload) if (setitimer(ITIMER_REAL, &new, &old) == 0) return (old.it_value.tv_sec * USPS + old.it_value.tv_usec); - /* else */ - return (-1); + return (-1); } From owner-svn-src-all@freebsd.org Tue Jan 21 17:02:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6CEA01FC42E; Tue, 21 Jan 2020 17:02:58 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482FGV2339z3JTl; Tue, 21 Jan 2020 17:02:58 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 419F8FDEC; Tue, 21 Jan 2020 17:02:58 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00LH2wTJ050406; Tue, 21 Jan 2020 17:02:58 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00LH2wTr050405; Tue, 21 Jan 2020 17:02:58 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202001211702.00LH2wTr050405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Tue, 21 Jan 2020 17:02:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356943 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 356943 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 21 Jan 2020 17:02:58 -0000 Author: eugen Date: Tue Jan 21 17:02:57 2020 New Revision: 356943 URL: https://svnweb.freebsd.org/changeset/base/356943 Log: Correct "service ipfw status" for INET6-only systems. MFC after: 1 month Modified: head/libexec/rc/rc.d/ipfw Modified: head/libexec/rc/rc.d/ipfw ============================================================================== --- head/libexec/rc/rc.d/ipfw Tue Jan 21 16:31:08 2020 (r356942) +++ head/libexec/rc/rc.d/ipfw Tue Jan 21 17:02:57 2020 (r356943) @@ -127,6 +127,9 @@ ipfw_stop() ipfw_status() { status=$(sysctl -i -n net.inet.ip.fw.enable) + if afexists inet6; then + status=$(( $status + $(sysctl -i -n net.inet6.ip6.fw.enable) )) + fi if [ ${status:-0} -eq 0 ]; then echo "ipfw is not enabled" exit 1 From owner-svn-src-all@freebsd.org Tue Jan 21 17:16:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B25081FC728; Tue, 21 Jan 2020 17:16:02 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482FYZ4C18z3K2j; Tue, 21 Jan 2020 17:16:02 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B4E3FFB3; Tue, 21 Jan 2020 17:16:02 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00LHG2q1056497; Tue, 21 Jan 2020 17:16:02 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00LHG2fJ056496; Tue, 21 Jan 2020 17:16:02 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202001211716.00LHG2fJ056496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Tue, 21 Jan 2020 17:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356944 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 356944 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 21 Jan 2020 17:16:02 -0000 Author: eugen Date: Tue Jan 21 17:16:02 2020 New Revision: 356944 URL: https://svnweb.freebsd.org/changeset/base/356944 Log: libexec/rc/rc.d/ipfw: style fix after r356943 Also, make sure it does not break for systems without ipfw code loaded. MFC after: 1 months X-MFC-with: 356943 Modified: head/libexec/rc/rc.d/ipfw Modified: head/libexec/rc/rc.d/ipfw ============================================================================== --- head/libexec/rc/rc.d/ipfw Tue Jan 21 17:02:57 2020 (r356943) +++ head/libexec/rc/rc.d/ipfw Tue Jan 21 17:16:02 2020 (r356944) @@ -127,10 +127,11 @@ ipfw_stop() ipfw_status() { status=$(sysctl -i -n net.inet.ip.fw.enable) + : ${status:=0} if afexists inet6; then - status=$(( $status + $(sysctl -i -n net.inet6.ip6.fw.enable) )) + status=$((${status} + $(sysctl -i -n net.inet6.ip6.fw.enable))) fi - if [ ${status:-0} -eq 0 ]; then + if [ ${status} -eq 0 ]; then echo "ipfw is not enabled" exit 1 else From owner-svn-src-all@freebsd.org Tue Jan 21 17:28:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F22121FCF4D; Tue, 21 Jan 2020 17:28:23 +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 482Fqq5x8yz3KvZ; Tue, 21 Jan 2020 17: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 C293F18197; Tue, 21 Jan 2020 17: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 00LHSNQP062502; Tue, 21 Jan 2020 17:28:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00LHSMXd062498; Tue, 21 Jan 2020 17:28:22 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001211728.00LHSMXd062498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 21 Jan 2020 17:28:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356945 - in head/sys: amd64/linux32 compat/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/linux32 compat/linux i386/linux X-SVN-Commit-Revision: 356945 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 21 Jan 2020 17:28:24 -0000 Author: markj Date: Tue Jan 21 17:28:22 2020 New Revision: 356945 URL: https://svnweb.freebsd.org/changeset/base/356945 Log: Fix 64-bit syscall argument fetching in 32-bit Linux syscall handlers. The Linux32 system call argument fetcher places each argument (passed in registers in the Linux x86 system call convention) into an entry in the generic system call args array. Each member of this array is 8 bytes wide, so this approach is broken for system calls that take off_t arguments. Fix the problem by splitting l_loff_t arguments in the 32-bit system call descriptions, the same as we do for FreeBSD32. Change entry points to handle this using the PAIR32TO64 macro. Move linux_ftruncate64() into compat/linux. PR: 243155 Reported by: Alex S Reviewed by: kib (previous version) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23210 Modified: head/sys/amd64/linux32/linux32_machdep.c head/sys/amd64/linux32/syscalls.master head/sys/compat/linux/linux_file.c head/sys/i386/linux/linux_machdep.c Modified: head/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- head/sys/amd64/linux32/linux32_machdep.c Tue Jan 21 17:16:02 2020 (r356944) +++ head/sys/amd64/linux32/linux32_machdep.c Tue Jan 21 17:28:22 2020 (r356945) @@ -593,13 +593,6 @@ linux_sigaltstack(struct thread *td, struct linux_siga } int -linux_ftruncate64(struct thread *td, struct linux_ftruncate64_args *args) -{ - - return (kern_ftruncate(td, args->fd, args->length)); -} - -int linux_gettimeofday(struct thread *td, struct linux_gettimeofday_args *uap) { struct timeval atv; Modified: head/sys/amd64/linux32/syscalls.master ============================================================================== --- head/sys/amd64/linux32/syscalls.master Tue Jan 21 17:16:02 2020 (r356944) +++ head/sys/amd64/linux32/syscalls.master Tue Jan 21 17:28:22 2020 (r356945) @@ -325,9 +325,9 @@ l_sigset_t *newset, \ l_size_t sigsetsize); } 180 AUE_PREAD STD { int linux_pread(l_uint fd, char *buf, \ - l_size_t nbyte, l_loff_t offset); } + l_size_t nbyte, uint32_t offset1, uint32_t offset2); } 181 AUE_PWRITE STD { int linux_pwrite(l_uint fd, char *buf, \ - l_size_t nbyte, l_loff_t offset); } + l_size_t nbyte, uint32_t offset1, uint32_t offset2); } 182 AUE_CHOWN STD { int linux_chown16(char *path, \ l_uid16_t uid, l_gid16_t gid); } 183 AUE_GETCWD STD { int linux_getcwd(char *buf, \ @@ -349,9 +349,9 @@ l_ulong prot, l_ulong flags, l_ulong fd, \ l_ulong pgoff); } 193 AUE_TRUNCATE STD { int linux_truncate64(char *path, \ - l_loff_t length); } + uint32_t length1, uint32_t length2); } 194 AUE_FTRUNCATE STD { int linux_ftruncate64(l_uint fd, \ - l_loff_t length); } + uint32_t length1, uint32_t length2); } 195 AUE_STAT STD { int linux_stat64(const char *filename, \ struct l_stat64 *statbuf); } 196 AUE_LSTAT STD { int linux_lstat64(const char *filename, \ @@ -426,7 +426,7 @@ 247 AUE_NULL UNIMPL linux_io_getevents 248 AUE_NULL UNIMPL linux_io_submit 249 AUE_NULL UNIMPL linux_io_cancel -250 AUE_NULL STD { int linux_fadvise64(int fd, l_loff_t offset, \ +250 AUE_NULL STD { int linux_fadvise64(int fd, uint32_t offset1, uint32_t offset2, \ l_size_t len, int advice); } 251 AUE_NULL UNIMPL 252 AUE_EXIT STD { int linux_exit_group(int error_code); } @@ -456,7 +456,8 @@ 271 AUE_UTIMES STD { int linux_utimes(char *fname, \ struct l_timeval *tptr); } 272 AUE_NULL STD { int linux_fadvise64_64(int fd, \ - l_loff_t offset, l_loff_t len, \ + uint32_t offset1, uint32_t offset2, \ + uint32_t len1, uint32_t len2, \ int advice); } 273 AUE_NULL UNIMPL vserver 274 AUE_NULL STD { int linux_mbind(void); } @@ -524,8 +525,9 @@ 312 AUE_NULL STD { int linux_get_robust_list(l_int pid, \ struct linux_robust_list_head **head, l_size_t *len); } 313 AUE_NULL STD { int linux_splice(void); } -314 AUE_NULL STD { int linux_sync_file_range(l_int fd, l_loff_t offset, - l_loff_t nbytes, unsigned int flags); } +314 AUE_NULL STD { int linux_sync_file_range(l_int fd, uint32_t offset1, + uint32_t offset2, uint32_t nbytes1, uint32_t nbytes2, + unsigned int flags); } 315 AUE_NULL STD { int linux_tee(void); } 316 AUE_NULL STD { int linux_vmsplice(void); } ; Linux 2.6.18: @@ -544,7 +546,8 @@ 323 AUE_NULL STD { int linux_eventfd(l_uint initval); } ; 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); } + uint32_t offset1, uint32_t offset2, uint32_t len1, + uint32_t len2); } ; Linux 2.6.25: 325 AUE_NULL STD { int linux_timerfd_settime(l_int fd, l_int flags, \ const struct l_itimerspec *new_value, \ Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Tue Jan 21 17:16:02 2020 (r356944) +++ head/sys/compat/linux/linux_file.c Tue Jan 21 17:28:22 2020 (r356945) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef COMPAT_LINUX32 +#include #include #include #else @@ -67,7 +68,6 @@ __FBSDID("$FreeBSD$"); static int linux_common_open(struct thread *, int, char *, int, int); static int linux_getdents_error(struct thread *, int, int); - #ifdef LINUX_LEGACY_SYSCALLS int linux_creat(struct thread *td, struct linux_creat_args *args) @@ -820,7 +820,6 @@ linux_truncate(struct thread *td, struct linux_truncat int error; LCONVPATHEXIST(td, args->path, &path); - error = kern_truncate(td, path, UIO_SYSSPACE, args->length); LFREEPATH(path); return (error); @@ -831,11 +830,17 @@ int linux_truncate64(struct thread *td, struct linux_truncate64_args *args) { char *path; + off_t length; int error; - LCONVPATHEXIST(td, args->path, &path); +#if defined(__amd64__) && defined(COMPAT_LINUX32) + length = PAIR32TO64(off_t, args->length); +#else + length = args->length; +#endif - error = kern_truncate(td, path, UIO_SYSSPACE, args->length); + LCONVPATHEXIST(td, args->path, &path); + error = kern_truncate(td, path, UIO_SYSSPACE, length); LFREEPATH(path); return (error); } @@ -848,6 +853,22 @@ linux_ftruncate(struct thread *td, struct linux_ftrunc return (kern_ftruncate(td, args->fd, args->length)); } +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) +int +linux_ftruncate64(struct thread *td, struct linux_ftruncate64_args *args) +{ + off_t length; + +#if defined(__amd64__) && defined(COMPAT_LINUX32) + length = PAIR32TO64(off_t, args->length); +#else + length = args->length; +#endif + + return (kern_ftruncate(td, args->fd, length)); +} +#endif + #ifdef LINUX_LEGACY_SYSCALLS int linux_link(struct thread *td, struct linux_link_args *args) @@ -908,8 +929,17 @@ linux_fdatasync(struct thread *td, struct linux_fdatas int linux_sync_file_range(struct thread *td, struct linux_sync_file_range_args *uap) { + off_t nbytes, offset; - if (uap->offset < 0 || uap->nbytes < 0 || +#if defined(__amd64__) && defined(COMPAT_LINUX32) + nbytes = PAIR32TO64(off_t, uap->nbytes); + offset = PAIR32TO64(off_t, uap->offset); +#else + nbytes = uap->nbytes; + offset = uap->offset; +#endif + + if (offset < 0 || nbytes < 0 || (uap->flags & ~(LINUX_SYNC_FILE_RANGE_WAIT_BEFORE | LINUX_SYNC_FILE_RANGE_WRITE | LINUX_SYNC_FILE_RANGE_WAIT_AFTER)) != 0) { @@ -923,18 +953,23 @@ int linux_pread(struct thread *td, struct linux_pread_args *uap) { struct vnode *vp; + off_t offset; int error; - error = kern_pread(td, uap->fd, uap->buf, uap->nbyte, uap->offset); +#if defined(__amd64__) && defined(COMPAT_LINUX32) + offset = PAIR32TO64(off_t, uap->offset); +#else + offset = uap->offset; +#endif + + error = kern_pread(td, uap->fd, uap->buf, uap->nbyte, offset); if (error == 0) { /* This seems to violate POSIX but Linux does it. */ error = fgetvp(td, uap->fd, &cap_pread_rights, &vp); if (error != 0) return (error); - if (vp->v_type == VDIR) { - vrele(vp); - return (EISDIR); - } + if (vp->v_type == VDIR) + error = EISDIR; vrele(vp); } return (error); @@ -943,8 +978,15 @@ linux_pread(struct thread *td, struct linux_pread_args int linux_pwrite(struct thread *td, struct linux_pwrite_args *uap) { + off_t offset; - return (kern_pwrite(td, uap->fd, uap->buf, uap->nbyte, uap->offset)); +#if defined(__amd64__) && defined(COMPAT_LINUX32) + offset = PAIR32TO64(off_t, uap->offset); +#else + offset = uap->offset; +#endif + + return (kern_pwrite(td, uap->fd, uap->buf, uap->nbyte, offset)); } int @@ -1466,26 +1508,40 @@ convert_fadvice(int advice) int linux_fadvise64(struct thread *td, struct linux_fadvise64_args *args) { + off_t offset; int advice; +#if defined(__amd64__) && defined(COMPAT_LINUX32) + offset = PAIR32TO64(off_t, args->offset); +#else + offset = args->offset; +#endif + advice = convert_fadvice(args->advice); if (advice == -1) return (EINVAL); - return (kern_posix_fadvise(td, args->fd, args->offset, args->len, - advice)); + return (kern_posix_fadvise(td, args->fd, offset, args->len, advice)); } #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) int linux_fadvise64_64(struct thread *td, struct linux_fadvise64_64_args *args) { + off_t len, offset; int advice; +#if defined(__amd64__) && defined(COMPAT_LINUX32) + len = PAIR32TO64(off_t, args->len); + offset = PAIR32TO64(off_t, args->offset); +#else + len = args->len; + offset = args->offset; +#endif + advice = convert_fadvice(args->advice); if (advice == -1) return (EINVAL); - return (kern_posix_fadvise(td, args->fd, args->offset, args->len, - advice)); + return (kern_posix_fadvise(td, args->fd, offset, len, advice)); } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ @@ -1559,6 +1615,7 @@ linux_dup3(struct thread *td, struct linux_dup3_args * int linux_fallocate(struct thread *td, struct linux_fallocate_args *args) { + off_t len, offset; /* * We emulate only posix_fallocate system call for which @@ -1567,8 +1624,15 @@ linux_fallocate(struct thread *td, struct linux_falloc if (args->mode != 0) return (ENOSYS); - return (kern_posix_fallocate(td, args->fd, args->offset, - args->len)); +#if defined(__amd64__) && defined(COMPAT_LINUX32) + len = PAIR32TO64(off_t, args->len); + offset = PAIR32TO64(off_t, args->offset); +#else + len = args->len; + offset = args->offset; +#endif + + return (kern_posix_fallocate(td, args->fd, offset, len)); } int Modified: head/sys/i386/linux/linux_machdep.c ============================================================================== --- head/sys/i386/linux/linux_machdep.c Tue Jan 21 17:16:02 2020 (r356944) +++ head/sys/i386/linux/linux_machdep.c Tue Jan 21 17:28:22 2020 (r356945) @@ -553,13 +553,6 @@ linux_sigaltstack(struct thread *td, struct linux_siga } int -linux_ftruncate64(struct thread *td, struct linux_ftruncate64_args *args) -{ - - return (kern_ftruncate(td, args->fd, args->length)); -} - -int linux_set_thread_area(struct thread *td, struct linux_set_thread_area_args *args) { struct l_user_desc info; From owner-svn-src-all@freebsd.org Tue Jan 21 17:28:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF48C1FCFA5; Tue, 21 Jan 2020 17:28:37 +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 482Fr549Hnz3L2t; Tue, 21 Jan 2020 17:28:37 +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 8A2FC1819E; Tue, 21 Jan 2020 17:28:37 +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 00LHSbAp062569; Tue, 21 Jan 2020 17:28:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00LHSbC7062567; Tue, 21 Jan 2020 17:28:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001211728.00LHSbC7062567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 21 Jan 2020 17:28:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356946 - head/sys/amd64/linux32 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/amd64/linux32 X-SVN-Commit-Revision: 356946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 21 Jan 2020 17:28:37 -0000 Author: markj Date: Tue Jan 21 17:28:36 2020 New Revision: 356946 URL: https://svnweb.freebsd.org/changeset/base/356946 Log: Regen. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/linux32/linux32_proto.h head/sys/amd64/linux32/linux32_systrace_args.c Modified: head/sys/amd64/linux32/linux32_proto.h ============================================================================== --- head/sys/amd64/linux32/linux32_proto.h Tue Jan 21 17:28:22 2020 (r356945) +++ head/sys/amd64/linux32/linux32_proto.h Tue Jan 21 17:28:36 2020 (r356946) @@ -574,13 +574,15 @@ struct linux_pread_args { char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; char nbyte_l_[PADL_(l_size_t)]; l_size_t nbyte; char nbyte_r_[PADR_(l_size_t)]; - char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; }; struct linux_pwrite_args { char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; char nbyte_l_[PADL_(l_size_t)]; l_size_t nbyte; char nbyte_r_[PADR_(l_size_t)]; - char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; }; struct linux_chown16_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; @@ -623,11 +625,13 @@ struct linux_mmap2_args { }; struct linux_truncate64_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char length_l_[PADL_(l_loff_t)]; l_loff_t length; char length_r_[PADR_(l_loff_t)]; + char length1_l_[PADL_(uint32_t)]; uint32_t length1; char length1_r_[PADR_(uint32_t)]; + char length2_l_[PADL_(uint32_t)]; uint32_t length2; char length2_r_[PADR_(uint32_t)]; }; struct linux_ftruncate64_args { char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; - char length_l_[PADL_(l_loff_t)]; l_loff_t length; char length_r_[PADR_(l_loff_t)]; + char length1_l_[PADL_(uint32_t)]; uint32_t length1; char length1_r_[PADR_(uint32_t)]; + char length2_l_[PADL_(uint32_t)]; uint32_t length2; char length2_r_[PADR_(uint32_t)]; }; struct linux_stat64_args { char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; @@ -756,7 +760,8 @@ struct linux_set_thread_area_args { }; struct linux_fadvise64_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_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)]; }; @@ -847,8 +852,10 @@ struct linux_utimes_args { }; struct linux_fadvise64_64_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; - char len_l_[PADL_(l_loff_t)]; l_loff_t len; char len_r_[PADR_(l_loff_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; + char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)]; + char len2_l_[PADL_(uint32_t)]; uint32_t len2; char len2_r_[PADR_(uint32_t)]; char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; }; struct linux_mbind_args { @@ -1021,8 +1028,10 @@ struct linux_splice_args { }; struct linux_sync_file_range_args { 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 nbytes_l_[PADL_(l_loff_t)]; l_loff_t nbytes; char nbytes_r_[PADR_(l_loff_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; + char nbytes1_l_[PADL_(uint32_t)]; uint32_t nbytes1; char nbytes1_r_[PADR_(uint32_t)]; + char nbytes2_l_[PADL_(uint32_t)]; uint32_t nbytes2; char nbytes2_r_[PADR_(uint32_t)]; char flags_l_[PADL_(unsigned int)]; unsigned int flags; char flags_r_[PADR_(unsigned int)]; }; struct linux_tee_args { @@ -1066,8 +1075,10 @@ struct linux_eventfd_args { struct linux_fallocate_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; char mode_l_[PADL_(l_int)]; l_int mode; char mode_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_loff_t)]; l_loff_t len; char len_r_[PADR_(l_loff_t)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; + char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)]; + char len2_l_[PADL_(uint32_t)]; uint32_t len2; char len2_r_[PADR_(uint32_t)]; }; struct linux_timerfd_settime_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; Modified: head/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- head/sys/amd64/linux32/linux32_systrace_args.c Tue Jan 21 17:28:22 2020 (r356945) +++ head/sys/amd64/linux32/linux32_systrace_args.c Tue Jan 21 17:28:36 2020 (r356946) @@ -1235,8 +1235,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg iarg[0] = p->fd; /* l_uint */ uarg[1] = (intptr_t) p->buf; /* char * */ iarg[2] = p->nbyte; /* l_size_t */ - iarg[3] = p->offset; /* l_loff_t */ - *n_args = 4; + uarg[3] = p->offset1; /* uint32_t */ + uarg[4] = p->offset2; /* uint32_t */ + *n_args = 5; break; } /* linux_pwrite */ @@ -1245,8 +1246,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg iarg[0] = p->fd; /* l_uint */ uarg[1] = (intptr_t) p->buf; /* char * */ iarg[2] = p->nbyte; /* l_size_t */ - iarg[3] = p->offset; /* l_loff_t */ - *n_args = 4; + uarg[3] = p->offset1; /* uint32_t */ + uarg[4] = p->offset2; /* uint32_t */ + *n_args = 5; break; } /* linux_chown16 */ @@ -1324,16 +1326,18 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 193: { struct linux_truncate64_args *p = params; uarg[0] = (intptr_t) p->path; /* char * */ - iarg[1] = p->length; /* l_loff_t */ - *n_args = 2; + uarg[1] = p->length1; /* uint32_t */ + uarg[2] = p->length2; /* uint32_t */ + *n_args = 3; break; } /* linux_ftruncate64 */ case 194: { struct linux_ftruncate64_args *p = params; iarg[0] = p->fd; /* l_uint */ - iarg[1] = p->length; /* l_loff_t */ - *n_args = 2; + uarg[1] = p->length1; /* uint32_t */ + uarg[2] = p->length2; /* uint32_t */ + *n_args = 3; break; } /* linux_stat64 */ @@ -1657,10 +1661,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 250: { struct linux_fadvise64_args *p = params; iarg[0] = p->fd; /* int */ - iarg[1] = p->offset; /* l_loff_t */ - iarg[2] = p->len; /* l_size_t */ - iarg[3] = p->advice; /* int */ - *n_args = 4; + uarg[1] = p->offset1; /* uint32_t */ + uarg[2] = p->offset2; /* uint32_t */ + iarg[3] = p->len; /* l_size_t */ + iarg[4] = p->advice; /* int */ + *n_args = 5; break; } /* linux_exit_group */ @@ -1828,10 +1833,12 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 272: { struct linux_fadvise64_64_args *p = params; iarg[0] = p->fd; /* int */ - iarg[1] = p->offset; /* l_loff_t */ - iarg[2] = p->len; /* l_loff_t */ - iarg[3] = p->advice; /* int */ - *n_args = 4; + uarg[1] = p->offset1; /* uint32_t */ + uarg[2] = p->offset2; /* uint32_t */ + uarg[3] = p->len1; /* uint32_t */ + uarg[4] = p->len2; /* uint32_t */ + iarg[5] = p->advice; /* int */ + *n_args = 6; break; } /* linux_mbind */ @@ -2120,10 +2127,12 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 314: { struct linux_sync_file_range_args *p = params; iarg[0] = p->fd; /* l_int */ - iarg[1] = p->offset; /* l_loff_t */ - iarg[2] = p->nbytes; /* l_loff_t */ - uarg[3] = p->flags; /* unsigned int */ - *n_args = 4; + uarg[1] = p->offset1; /* uint32_t */ + uarg[2] = p->offset2; /* uint32_t */ + uarg[3] = p->nbytes1; /* uint32_t */ + uarg[4] = p->nbytes2; /* uint32_t */ + uarg[5] = p->flags; /* unsigned int */ + *n_args = 6; break; } /* linux_tee */ @@ -2197,9 +2206,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg struct linux_fallocate_args *p = params; iarg[0] = p->fd; /* l_int */ iarg[1] = p->mode; /* l_int */ - iarg[2] = p->offset; /* l_loff_t */ - iarg[3] = p->len; /* l_loff_t */ - *n_args = 4; + uarg[2] = p->offset1; /* uint32_t */ + uarg[3] = p->offset2; /* uint32_t */ + uarg[4] = p->len1; /* uint32_t */ + uarg[5] = p->len2; /* uint32_t */ + *n_args = 6; break; } /* linux_timerfd_settime */ @@ -4875,8 +4886,11 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "l_size_t"; break; case 3: - p = "l_loff_t"; + p = "uint32_t"; break; + case 4: + p = "uint32_t"; + break; default: break; }; @@ -4894,8 +4908,11 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "l_size_t"; break; case 3: - p = "l_loff_t"; + p = "uint32_t"; break; + case 4: + p = "uint32_t"; + break; default: break; }; @@ -5019,8 +5036,11 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "userland char *"; break; case 1: - p = "l_loff_t"; + p = "uint32_t"; break; + case 2: + p = "uint32_t"; + break; default: break; }; @@ -5032,8 +5052,11 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "l_uint"; break; case 1: - p = "l_loff_t"; + p = "uint32_t"; break; + case 2: + p = "uint32_t"; + break; default: break; }; @@ -5483,12 +5506,15 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "int"; break; case 1: - p = "l_loff_t"; + p = "uint32_t"; break; case 2: - p = "l_size_t"; + p = "uint32_t"; break; case 3: + p = "l_size_t"; + break; + case 4: p = "int"; break; default: @@ -5763,12 +5789,18 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "int"; break; case 1: - p = "l_loff_t"; + p = "uint32_t"; break; case 2: - p = "l_loff_t"; + p = "uint32_t"; break; case 3: + p = "uint32_t"; + break; + case 4: + p = "uint32_t"; + break; + case 5: p = "int"; break; default: @@ -6178,12 +6210,18 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "l_int"; break; case 1: - p = "l_loff_t"; + p = "uint32_t"; break; case 2: - p = "l_loff_t"; + p = "uint32_t"; break; case 3: + p = "uint32_t"; + break; + case 4: + p = "uint32_t"; + break; + case 5: p = "unsigned int"; break; default: @@ -6295,10 +6333,16 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "l_int"; break; case 2: - p = "l_loff_t"; + p = "uint32_t"; break; case 3: - p = "l_loff_t"; + p = "uint32_t"; + break; + case 4: + p = "uint32_t"; + break; + case 5: + p = "uint32_t"; break; default: break; From owner-svn-src-all@freebsd.org Tue Jan 21 17:45:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 00A191FDA46; Tue, 21 Jan 2020 17:45:50 +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 482GCx67q9z3MJh; Tue, 21 Jan 2020 17:45:49 +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 B3E3018549; Tue, 21 Jan 2020 17:45:49 +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 00LHjn2B074897; Tue, 21 Jan 2020 17:45:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00LHjnbK074896; Tue, 21 Jan 2020 17:45:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001211745.00LHjnbK074896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 21 Jan 2020 17:45:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356947 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 356947 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 21 Jan 2020 17:45:50 -0000 Author: markj Date: Tue Jan 21 17:45:49 2020 New Revision: 356947 URL: https://svnweb.freebsd.org/changeset/base/356947 Log: Add relocation handling required for -zifunc-noplt to work on arm64. Static relocations for the immediate operand of a branch instruction must be applied. In a patch which implements LSE-based atomic(9) operations using ifuncs, -zifunc-noplt reduces system CPU usage during a buildkernel by several percent. Also fix elf_reloc_internal() to return an error if symbol lookup fails. Reviewed by: andrew MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17392 Modified: head/sys/arm64/arm64/elf_machdep.c Modified: head/sys/arm64/arm64/elf_machdep.c ============================================================================== --- head/sys/arm64/arm64/elf_machdep.c Tue Jan 21 17:28:36 2020 (r356946) +++ head/sys/arm64/arm64/elf_machdep.c Tue Jan 21 17:45:49 2020 (r356947) @@ -125,6 +125,23 @@ elf_is_ifunc_reloc(Elf_Size r_info __unused) } static int +reloc_instr_imm(Elf32_Addr *where, Elf_Addr val, u_int msb, u_int lsb) +{ + + /* Check bounds: upper bits must be all ones or all zeros. */ + if ((uint64_t)((int64_t)val >> (msb + 1)) + 1 > 1) + return (-1); + val >>= lsb; + val &= (1 << (msb - lsb + 1)) - 1; + *where |= (Elf32_Addr)val; + return (0); +} + +/* + * Process a relocation. Support for some static relocations is required + * in order for the -zifunc-noplt optimization to work. + */ +static int elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, int type, int local, elf_lookup_fn lookup) { @@ -159,10 +176,33 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas return (0); } + error = 0; switch (rtype) { case R_AARCH64_NONE: case R_AARCH64_RELATIVE: break; + case R_AARCH64_TSTBR14: + error = lookup(lf, symidx, 1, &addr); + if (error != 0) + return (-1); + error = reloc_instr_imm((Elf32_Addr *)where, + addr + addend - (Elf_Addr)where, 15, 2); + break; + case R_AARCH64_CONDBR19: + error = lookup(lf, symidx, 1, &addr); + if (error != 0) + return (-1); + error = reloc_instr_imm((Elf32_Addr *)where, + addr + addend - (Elf_Addr)where, 20, 2); + break; + case R_AARCH64_JUMP26: + case R_AARCH64_CALL26: + error = lookup(lf, symidx, 1, &addr); + if (error != 0) + return (-1); + error = reloc_instr_imm((Elf32_Addr *)where, + addr + addend - (Elf_Addr)where, 27, 2); + break; case R_AARCH64_ABS64: case R_AARCH64_GLOB_DAT: case R_AARCH64_JUMP_SLOT: @@ -181,7 +221,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas printf("kldload: unexpected relocation type %d\n", rtype); return (-1); } - return (0); + return (error); } int From owner-svn-src-all@freebsd.org Tue Jan 21 19:19:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1DCD1FF024; Tue, 21 Jan 2020 19:19:03 +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 482JHW40SYz3Qvb; Tue, 21 Jan 2020 19:19:03 +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 8490D19683; Tue, 21 Jan 2020 19:19: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 00LJJ3BF028309; Tue, 21 Jan 2020 19:19:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00LJJ3gW028307; Tue, 21 Jan 2020 19:19:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202001211919.00LJJ3gW028307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 21 Jan 2020 19:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356948 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 356948 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 21 Jan 2020 19:19:03 -0000 Author: trasz Date: Tue Jan 21 19:19:02 2020 New Revision: 356948 URL: https://svnweb.freebsd.org/changeset/base/356948 Log: Make linux(4) handle MAP_32BIT. This unbreaks Mono (mono-devel-4.6.2.7+dfsg-1ubuntu1 from Ubuntu Bionic); previously would crash on "amd64_is_imm32" assert. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/compat/linux/linux_mmap.c head/sys/compat/linux/linux_mmap.h Modified: head/sys/compat/linux/linux_mmap.c ============================================================================== --- head/sys/compat/linux/linux_mmap.c Tue Jan 21 17:45:49 2020 (r356947) +++ head/sys/compat/linux/linux_mmap.c Tue Jan 21 19:19:02 2020 (r356948) @@ -114,6 +114,13 @@ linux_mmap_common(struct thread *td, uintptr_t addr, s bsd_flags |= MAP_STACK; /* + * According to the Linux mmap(2) man page, "MAP_32BIT flag + * is ignored when MAP_FIXED is set." + */ + if ((flags & LINUX_MAP_32BIT) && (flags & LINUX_MAP_FIXED) == 0) + bsd_flags |= MAP_32BIT; + + /* * PROT_READ, PROT_WRITE, or PROT_EXEC implies PROT_READ and PROT_EXEC * on Linux/i386 if the binary requires executable stack. * We do this only for IA32 emulation as on native i386 this is does not Modified: head/sys/compat/linux/linux_mmap.h ============================================================================== --- head/sys/compat/linux/linux_mmap.h Tue Jan 21 17:45:49 2020 (r356947) +++ head/sys/compat/linux/linux_mmap.h Tue Jan 21 19:19:02 2020 (r356948) @@ -39,6 +39,7 @@ #define LINUX_MAP_PRIVATE 0x0002 #define LINUX_MAP_FIXED 0x0010 #define LINUX_MAP_ANON 0x0020 +#define LINUX_MAP_32BIT 0x0040 #define LINUX_MAP_GROWSDOWN 0x0100 #define LINUX_PROT_GROWSDOWN 0x01000000 From owner-svn-src-all@freebsd.org Tue Jan 21 20:21:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC329221D4B; Tue, 21 Jan 2020 20:21:52 +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 482Kh05Zcyz40qh; Tue, 21 Jan 2020 20:21: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 BAC591A363; Tue, 21 Jan 2020 20:21:52 +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 00LKLqoV067201; Tue, 21 Jan 2020 20:21:52 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00LKLqVs067200; Tue, 21 Jan 2020 20:21:52 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202001212021.00LKLqVs067200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 21 Jan 2020 20:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356949 - head/usr.sbin/wpa/wpa_supplicant X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/usr.sbin/wpa/wpa_supplicant X-SVN-Commit-Revision: 356949 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 21 Jan 2020 20:21:52 -0000 Author: cy Date: Tue Jan 21 20:21:52 2020 New Revision: 356949 URL: https://svnweb.freebsd.org/changeset/base/356949 Log: Fix build when WITHOUT_WPA_SUPPLICANT_EAPOL option used. The build failure was discoved by Michael Dexter's recent Build Options Survey run, at https://callfortesting.org/results/bos-2020-01-16/\ WITHOUT_WPA_SUPPLICANT_EAPOL-small.txt. Reported by: Michael Dexter via emaste MFC after: 2 weeks Modified: head/usr.sbin/wpa/wpa_supplicant/Makefile Modified: head/usr.sbin/wpa/wpa_supplicant/Makefile ============================================================================== --- head/usr.sbin/wpa/wpa_supplicant/Makefile Tue Jan 21 19:19:02 2020 (r356948) +++ head/usr.sbin/wpa/wpa_supplicant/Makefile Tue Jan 21 20:21:52 2020 (r356949) @@ -16,19 +16,15 @@ SRCS= base64.c bitfield.c blacklist.c bss.c cli.c comm ctrl_iface.c ctrl_iface_common.c ctrl_iface_unix.c \ dh_groups.c driver_bsd.c driver_common.c \ driver_ndis.c driver_wired.c driver_wired_common.c drivers.c \ - eap_register.c eap_wsc.c eap_wsc_common.c eloop.c \ - events.c gas.c gas_query.c hs20_supplicant.c \ + eap_register.c eloop.c \ + events.c gas.c gas_query.c \ http_client.c http_server.c \ httpread.c hw_features_common.c \ - ieee802_11_common.c interworking.c l2_packet_freebsd.c main.c \ + ieee802_11_common.c l2_packet_freebsd.c main.c \ notify.c offchannel.c op_classes.c os_unix.c pmksa_cache.c preauth.c \ - rrm.c scan.c upnp_xml.c uuid.c \ + rrm.c scan.c upnp_xml.c \ wmm_ac.c wpa.c wpa_common.c wpa_ctrl.c \ wpa_debug.c wpa_ft.c wpa_ie.c wpa_supplicant.c wpabuf.c wpas_glue.c \ - wps.c wps_attr_build.c wps_attr_parse.c wps_attr_process.c \ - wps_common.c wps_dev_attr.c wps_enrollee.c wps_registrar.c \ - wps_supplicant.c wps_upnp.c wps_upnp_ap.c wps_upnp_event.c \ - wps_upnp_ssdp.c wps_upnp_web.c \ Packet32.c MAN= wpa_supplicant.8 wpa_supplicant.conf.5 @@ -45,15 +41,12 @@ CFLAGS+=-DCONFIG_BACKEND_FILE \ -DCONFIG_DRIVER_NDIS \ -DCONFIG_DRIVER_WIRED \ -DCONFIG_GAS \ - -DCONFIG_HS20 \ -DCONFIG_IEEE80211R \ - -DCONFIG_INTERWORKING \ -DCONFIG_PEERKEY \ -DCONFIG_PRIVSEP \ -DCONFIG_SMARTCARD \ -DCONFIG_TERMINATE_ONLASTIF \ -DCONFIG_TLS=openssl \ - -DCONFIG_WPS \ -DCONFIG_WPS2 \ -DCONFIG_WPS_UPNP \ -DPKCS12_FUNCS @@ -67,7 +60,10 @@ LDADD+=${WPA_SUPPLICANT_LDADD} #LDFLAGS+=${WPA_SUPPLICANT_LDFLAGS} .if ${MK_WPA_SUPPLICANT_EAPOL} != "no" -CFLAGS+=-DEAP_GTC \ +CFLAGS+=-DCONFIG_WPS \ + -DCONFIG_HS20 \ + -DCONFIG_INTERWORKING \ + -DEAP_GTC \ -DEAP_LEAP \ -DEAP_MD5 \ -DEAP_MSCHAPv2 \ @@ -76,6 +72,7 @@ CFLAGS+=-DEAP_GTC \ -DEAP_PSK \ -DEAP_TLS \ -DEAP_TTLS \ + -DEAP_WSC \ -DIEEE8021X_EAPOL SRCS+= chap.c \ eap.c \ @@ -93,14 +90,23 @@ SRCS+= chap.c \ eap_tls.c \ eap_tls_common.c \ eap_ttls.c \ + eap_wsc.c \ eapol_supp_sm.c \ + eap_wsc_common.c \ + hs20_supplicant.c \ + interworking.c \ ms_funcs.c \ - mschapv2.c -TLS_FUNCS=y + mschapv2.c \ + uuid.c \ + wps.c wps_attr_build.c wps_attr_parse.c wps_attr_process.c \ + wps_common.c wps_dev_attr.c wps_enrollee.c wps_registrar.c \ + wps_supplicant.c wps_upnp.c wps_upnp_ap.c wps_upnp_event.c \ + wps_upnp_ssdp.c wps_upnp_web.c NEED_AES_EAX=y NEED_AES_ENCBLOCK=y NEED_AES_OMAC1=y .endif +TLS_FUNCS=y .if !empty(CFLAGS:M*-DEAP_AKA) SRCS+= eap_aka.c From owner-svn-src-all@freebsd.org Tue Jan 21 20:32:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F94C2220D9; Tue, 21 Jan 2020 20:32:50 +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 482Kwf2nhMz41Pr; Tue, 21 Jan 2020 20:32:50 +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 5B07A1A596; Tue, 21 Jan 2020 20:32:50 +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 00LKWog8075990; Tue, 21 Jan 2020 20:32:50 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00LKWofV075988; Tue, 21 Jan 2020 20:32:50 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202001212032.00LKWofV075988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 21 Jan 2020 20:32:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356950 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 356950 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 21 Jan 2020 20:32:50 -0000 Author: trasz Date: Tue Jan 21 20:32:49 2020 New Revision: 356950 URL: https://svnweb.freebsd.org/changeset/base/356950 Log: Revert r356948; breaks build somehow. Modified: head/sys/compat/linux/linux_mmap.c head/sys/compat/linux/linux_mmap.h Modified: head/sys/compat/linux/linux_mmap.c ============================================================================== --- head/sys/compat/linux/linux_mmap.c Tue Jan 21 20:21:52 2020 (r356949) +++ head/sys/compat/linux/linux_mmap.c Tue Jan 21 20:32:49 2020 (r356950) @@ -114,13 +114,6 @@ linux_mmap_common(struct thread *td, uintptr_t addr, s bsd_flags |= MAP_STACK; /* - * According to the Linux mmap(2) man page, "MAP_32BIT flag - * is ignored when MAP_FIXED is set." - */ - if ((flags & LINUX_MAP_32BIT) && (flags & LINUX_MAP_FIXED) == 0) - bsd_flags |= MAP_32BIT; - - /* * PROT_READ, PROT_WRITE, or PROT_EXEC implies PROT_READ and PROT_EXEC * on Linux/i386 if the binary requires executable stack. * We do this only for IA32 emulation as on native i386 this is does not Modified: head/sys/compat/linux/linux_mmap.h ============================================================================== --- head/sys/compat/linux/linux_mmap.h Tue Jan 21 20:21:52 2020 (r356949) +++ head/sys/compat/linux/linux_mmap.h Tue Jan 21 20:32:49 2020 (r356950) @@ -39,7 +39,6 @@ #define LINUX_MAP_PRIVATE 0x0002 #define LINUX_MAP_FIXED 0x0010 #define LINUX_MAP_ANON 0x0020 -#define LINUX_MAP_32BIT 0x0040 #define LINUX_MAP_GROWSDOWN 0x0100 #define LINUX_PROT_GROWSDOWN 0x01000000 From owner-svn-src-all@freebsd.org Tue Jan 21 22:02:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8182F224423; Tue, 21 Jan 2020 22:02:54 +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 482MwZ2vY3z461V; Tue, 21 Jan 2020 22:02:54 +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 5EF0E1B662; Tue, 21 Jan 2020 22:02:54 +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 00LM2smx030544; Tue, 21 Jan 2020 22:02:54 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00LM2sZS030543; Tue, 21 Jan 2020 22:02:54 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001212202.00LM2sZS030543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 21 Jan 2020 22:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356951 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 356951 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 21 Jan 2020 22:02:54 -0000 Author: kevans Date: Tue Jan 21 22:02:53 2020 New Revision: 356951 URL: https://svnweb.freebsd.org/changeset/base/356951 Log: posix_spawn: mark error as volatile In the case of an error, the RFSPAWN'd thread will write back to psa->error with the correct exit code. Mark this as volatile as the return value is being actively dorked up for erroneous exits on !x86. This fixes the following tests, tested on aarch64 (only under qemu, at the moment): - posix_spawn/spawn_test:t_spawn_missing - posix_spawn/spawn_test:t_spawn_nonexec - posix_spawn/spawn_test:t_spawn_zero Reported by: mikael MFC after: 3 days Modified: head/lib/libc/gen/posix_spawn.c Modified: head/lib/libc/gen/posix_spawn.c ============================================================================== --- head/lib/libc/gen/posix_spawn.c Tue Jan 21 20:32:49 2020 (r356950) +++ head/lib/libc/gen/posix_spawn.c Tue Jan 21 22:02:53 2020 (r356951) @@ -201,7 +201,7 @@ struct posix_spawn_args { char * const * argv; char * const * envp; int use_env_path; - int error; + volatile int error; }; #if defined(__i386__) || defined(__amd64__) From owner-svn-src-all@freebsd.org Tue Jan 21 22:28:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EAB95224EFB; Tue, 21 Jan 2020 22:28:16 +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 482NTr5jvxz48Bq; Tue, 21 Jan 2020 22:28:16 +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 BB0F61BA6B; Tue, 21 Jan 2020 22:28:16 +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 00LMSG0P043694; Tue, 21 Jan 2020 22:28:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00LMSGCT043692; Tue, 21 Jan 2020 22:28:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202001212228.00LMSGCT043692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 21 Jan 2020 22:28:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356952 - in head/sys/dev/usb: . serial X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/usb: . serial X-SVN-Commit-Revision: 356952 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 21 Jan 2020 22:28:17 -0000 Author: hselasky Date: Tue Jan 21 22:28:16 2020 New Revision: 356952 URL: https://svnweb.freebsd.org/changeset/base/356952 Log: Add new USB ID to uslcom(4). Submitted by: Oleg Sharoyko PR: 243494 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/serial/uslcom.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/uslcom.c ============================================================================== --- head/sys/dev/usb/serial/uslcom.c Tue Jan 21 22:02:53 2020 (r356951) +++ head/sys/dev/usb/serial/uslcom.c Tue Jan 21 22:28:16 2020 (r356952) @@ -313,6 +313,7 @@ static const STRUCT_USB_HOST_ID uslcom_devs[] = { USLCOM_DEV(SILABS, HAMLINKUSB), USLCOM_DEV(SILABS, HELICOM), USLCOM_DEV(SILABS, HUBZ), + USLCOM_DEV(SILABS, BV_AV2010_10), USLCOM_DEV(SILABS, IMS_USB_RS422), USLCOM_DEV(SILABS, INFINITY_MIC), USLCOM_DEV(SILABS, INGENI_ZIGBEE), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Jan 21 22:02:53 2020 (r356951) +++ head/sys/dev/usb/usbdevs Tue Jan 21 22:28:16 2020 (r356952) @@ -4339,6 +4339,7 @@ product SILABS AC_SERV_OBD 0x8665 AC-Services OBD Inte product SILABS MMB_ZIGBEE 0x88a4 MMB Networks ZigBee product SILABS INGENI_ZIGBEE 0x88a5 Planet Innovation Ingeni ZigBee product SILABS HUBZ 0x8a2a HubZ dual ZigBee and Z-Wave +product SILABS BV_AV2010_10 0x8b34 Bitron Video AV2010/10 ZigBee USB Stick product SILABS CP2102 0xea60 SILABS USB UART product SILABS CP210X_2 0xea61 CP210x Serial product SILABS CP210X_3 0xea70 CP210x Serial From owner-svn-src-all@freebsd.org Wed Jan 22 00:30:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBC022278D2; Wed, 22 Jan 2020 00:30: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 482RBq5Hq5z4G2n; Wed, 22 Jan 2020 00:30: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 B04BE1D05A; Wed, 22 Jan 2020 00:30: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 00M0URkL016589; Wed, 22 Jan 2020 00:30:27 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M0URvD016588; Wed, 22 Jan 2020 00:30:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001220030.00M0URvD016588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 22 Jan 2020 00:30:27 +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: r356953 - stable/12/sys/compat/linuxkpi/common/src X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 356953 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 00:30:27 -0000 Author: markj Date: Wed Jan 22 00:30:27 2020 New Revision: 356953 URL: https://svnweb.freebsd.org/changeset/base/356953 Log: MFC r356760: Handle a NULL thread pointer in linux_close_file(). PR: 242913 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 Tue Jan 21 22:28:16 2020 (r356952) +++ stable/12/sys/compat/linuxkpi/common/src/linux_compat.c Wed Jan 22 00:30:27 2020 (r356953) @@ -1502,6 +1502,9 @@ linux_file_close(struct file *file, struct thread *td) KASSERT(file_count(filp) == 0, ("File refcount(%d) is not zero", file_count(filp))); + if (td == NULL) + td = curthread; + error = 0; filp->f_flags = file->f_flag; linux_set_current(td); From owner-svn-src-all@freebsd.org Wed Jan 22 00:41:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 12CFD2280CC; Wed, 22 Jan 2020 00:41:19 +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 482RRL6nj0z4Gr8; Wed, 22 Jan 2020 00:41:18 +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 E40B51D378; Wed, 22 Jan 2020 00:41:18 +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 00M0fIZP026951; Wed, 22 Jan 2020 00:41:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M0fI1P026950; Wed, 22 Jan 2020 00:41:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202001220041.00M0fI1P026950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 22 Jan 2020 00:41: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: r356954 - stable/12/sys/dev/nvme X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/dev/nvme X-SVN-Commit-Revision: 356954 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 00:41:19 -0000 Author: mav Date: Wed Jan 22 00:41:18 2020 New Revision: 356954 URL: https://svnweb.freebsd.org/changeset/base/356954 Log: MFC r355465 (by imp): trackers always know what qpair they are on Don't needlessly pass around qpair pointers when the tracker knows what qpair it's on. This will simplify code and make it easier to split submission and completion queues in the future. Signed-off-by: John Meneghini Modified: stable/12/sys/dev/nvme/nvme_qpair.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nvme/nvme_qpair.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_qpair.c Wed Jan 22 00:30:27 2020 (r356953) +++ stable/12/sys/dev/nvme/nvme_qpair.c Wed Jan 22 00:41:18 2020 (r356954) @@ -418,9 +418,10 @@ nvme_completion_is_retry(const struct nvme_completion } static void -nvme_qpair_complete_tracker(struct nvme_qpair *qpair, struct nvme_tracker *tr, +nvme_qpair_complete_tracker(struct nvme_tracker *tr, struct nvme_completion *cpl, error_print_t print_on_error) { + struct nvme_qpair * qpair = tr->qpair; struct nvme_request *req; boolean_t retry, error, retriable; @@ -484,19 +485,22 @@ nvme_qpair_complete_tracker(struct nvme_qpair *qpair, } static void -nvme_qpair_manual_complete_tracker(struct nvme_qpair *qpair, +nvme_qpair_manual_complete_tracker( struct nvme_tracker *tr, uint32_t sct, uint32_t sc, uint32_t dnr, error_print_t print_on_error) { struct nvme_completion cpl; memset(&cpl, 0, sizeof(cpl)); + + struct nvme_qpair * qpair = tr->qpair; + cpl.sqid = qpair->id; cpl.cid = tr->cid; cpl.status |= (sct & NVME_STATUS_SCT_MASK) << NVME_STATUS_SCT_SHIFT; cpl.status |= (sc & NVME_STATUS_SC_MASK) << NVME_STATUS_SC_SHIFT; cpl.status |= (dnr & NVME_STATUS_DNR_MASK) << NVME_STATUS_DNR_SHIFT; - nvme_qpair_complete_tracker(qpair, tr, &cpl, print_on_error); + nvme_qpair_complete_tracker(tr, &cpl, print_on_error); } void @@ -589,7 +593,7 @@ nvme_qpair_process_completions(struct nvme_qpair *qpai tr = qpair->act_tr[cpl.cid]; if (tr != NULL) { - nvme_qpair_complete_tracker(qpair, tr, &cpl, ERROR_PRINT_ALL); + nvme_qpair_complete_tracker(tr, &cpl, ERROR_PRINT_ALL); qpair->sq_head = cpl.sqhd; done++; } else if (!in_panic) { @@ -842,7 +846,7 @@ nvme_admin_qpair_abort_aers(struct nvme_qpair *qpair) tr = TAILQ_FIRST(&qpair->outstanding_tr); while (tr != NULL) { if (tr->req->cmd.opc == NVME_OPC_ASYNC_EVENT_REQUEST) { - nvme_qpair_manual_complete_tracker(qpair, tr, + nvme_qpair_manual_complete_tracker(tr, NVME_SCT_GENERIC, NVME_SC_ABORTED_SQ_DELETION, 0, ERROR_PRINT_NONE); tr = TAILQ_FIRST(&qpair->outstanding_tr); @@ -886,7 +890,7 @@ nvme_abort_complete(void *arg, const struct nvme_compl */ nvme_printf(tr->qpair->ctrlr, "abort command failed, aborting command manually\n"); - nvme_qpair_manual_complete_tracker(tr->qpair, tr, + nvme_qpair_manual_complete_tracker(tr, NVME_SCT_GENERIC, NVME_SC_ABORTED_BY_REQUEST, 0, ERROR_PRINT_ALL); } } @@ -1104,7 +1108,7 @@ _nvme_qpair_submit_request(struct nvme_qpair *qpair, s * with the qpair lock held. */ mtx_unlock(&qpair->lock); - nvme_qpair_manual_complete_tracker(qpair, tr, NVME_SCT_GENERIC, + nvme_qpair_manual_complete_tracker(tr, NVME_SCT_GENERIC, NVME_SC_DATA_TRANSFER_ERROR, DO_NOT_RETRY, ERROR_PRINT_ALL); mtx_lock(&qpair->lock); } @@ -1162,7 +1166,7 @@ nvme_admin_qpair_enable(struct nvme_qpair *qpair) TAILQ_FOREACH_SAFE(tr, &qpair->outstanding_tr, tailq, tr_temp) { nvme_printf(qpair->ctrlr, "aborting outstanding admin command\n"); - nvme_qpair_manual_complete_tracker(qpair, tr, NVME_SCT_GENERIC, + nvme_qpair_manual_complete_tracker(tr, NVME_SCT_GENERIC, NVME_SC_ABORTED_BY_REQUEST, DO_NOT_RETRY, ERROR_PRINT_ALL); } @@ -1184,7 +1188,7 @@ nvme_io_qpair_enable(struct nvme_qpair *qpair) */ TAILQ_FOREACH_SAFE(tr, &qpair->outstanding_tr, tailq, tr_temp) { nvme_printf(qpair->ctrlr, "aborting outstanding i/o\n"); - nvme_qpair_manual_complete_tracker(qpair, tr, NVME_SCT_GENERIC, + nvme_qpair_manual_complete_tracker(tr, NVME_SCT_GENERIC, NVME_SC_ABORTED_BY_REQUEST, 0, ERROR_PRINT_NO_RETRY); } @@ -1263,11 +1267,10 @@ nvme_qpair_fail(struct nvme_qpair *qpair) */ nvme_printf(qpair->ctrlr, "failing outstanding i/o\n"); mtx_unlock(&qpair->lock); - nvme_qpair_manual_complete_tracker(qpair, tr, NVME_SCT_GENERIC, + nvme_qpair_manual_complete_tracker(tr, NVME_SCT_GENERIC, NVME_SC_ABORTED_BY_REQUEST, DO_NOT_RETRY, ERROR_PRINT_ALL); mtx_lock(&qpair->lock); } mtx_unlock(&qpair->lock); } - From owner-svn-src-all@freebsd.org Wed Jan 22 00:43:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A53C22828E; Wed, 22 Jan 2020 00:43:52 +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 482RVH6ynbz4H3G; Wed, 22 Jan 2020 00:43:51 +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 EA65D1D3F1; Wed, 22 Jan 2020 00:43:51 +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 00M0hpBD028976; Wed, 22 Jan 2020 00:43:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M0hp2B028975; Wed, 22 Jan 2020 00:43:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202001220043.00M0hp2B028975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 22 Jan 2020 00:43:51 +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: r356955 - stable/12/sys/dev/nvme X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/dev/nvme X-SVN-Commit-Revision: 356955 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 00:43:52 -0000 Author: mav Date: Wed Jan 22 00:43:51 2020 New Revision: 356955 URL: https://svnweb.freebsd.org/changeset/base/356955 Log: MFC r355631 (by imp): Move reset to the interrutp processing stage This trims the boot time a bit more for AWS and other platforms that have nvme drives. There's no reason too do this inline. This has been in my tree a while, but IIRC I talked to Jim Harris about this at one of our face to face meetings. Modified: stable/12/sys/dev/nvme/nvme.c stable/12/sys/dev/nvme/nvme_ctrlr.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nvme/nvme.c ============================================================================== --- stable/12/sys/dev/nvme/nvme.c Wed Jan 22 00:41:18 2020 (r356954) +++ stable/12/sys/dev/nvme/nvme.c Wed Jan 22 00:43:51 2020 (r356955) @@ -130,25 +130,6 @@ nvme_attach(device_t dev) int status; status = nvme_ctrlr_construct(ctrlr, dev); - - if (status != 0) { - nvme_ctrlr_destruct(ctrlr, dev); - return (status); - } - - /* - * Reset controller twice to ensure we do a transition from cc.en==1 to - * cc.en==0. This is because we don't really know what status the - * controller was left in when boot handed off to OS. Linux doesn't do - * this, however. If we adopt that policy, see also nvme_ctrlr_resume(). - */ - status = nvme_ctrlr_hw_reset(ctrlr); - if (status != 0) { - nvme_ctrlr_destruct(ctrlr, dev); - return (status); - } - - status = nvme_ctrlr_hw_reset(ctrlr); if (status != 0) { nvme_ctrlr_destruct(ctrlr, dev); return (status); Modified: stable/12/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_ctrlr.c Wed Jan 22 00:41:18 2020 (r356954) +++ stable/12/sys/dev/nvme/nvme_ctrlr.c Wed Jan 22 00:43:51 2020 (r356955) @@ -909,6 +909,25 @@ void nvme_ctrlr_start_config_hook(void *arg) { struct nvme_controller *ctrlr = arg; + int status; + + /* + * Reset controller twice to ensure we do a transition from cc.en==1 to + * cc.en==0. This is because we don't really know what status the + * controller was left in when boot handed off to OS. Linux doesn't do + * this, however. If we adopt that policy, see also nvme_ctrlr_resume(). + */ + status = nvme_ctrlr_hw_reset(ctrlr); + if (status != 0) { + nvme_ctrlr_fail(ctrlr); + return; + } + + status = nvme_ctrlr_hw_reset(ctrlr); + if (status != 0) { + nvme_ctrlr_fail(ctrlr); + return; + } nvme_qpair_reset(&ctrlr->adminq); nvme_admin_qpair_enable(&ctrlr->adminq); From owner-svn-src-all@freebsd.org Wed Jan 22 00:46:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41114228338; Wed, 22 Jan 2020 00:46:10 +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 482RXy0v48z4H9W; Wed, 22 Jan 2020 00:46:10 +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 19B5B1D3F3; Wed, 22 Jan 2020 00:46:10 +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 00M0k9UV029353; Wed, 22 Jan 2020 00:46:09 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M0k9Go029350; Wed, 22 Jan 2020 00:46:09 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202001220046.00M0k9Go029350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 22 Jan 2020 00:46: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: r356956 - stable/12/sys/dev/nvme X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/dev/nvme X-SVN-Commit-Revision: 356956 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 00:46:10 -0000 Author: mav Date: Wed Jan 22 00:46:09 2020 New Revision: 356956 URL: https://svnweb.freebsd.org/changeset/base/356956 Log: MFC r355721 (by imp): Move to using bool instead of boolean_t While there are subtle semantic differences between bool and boolean_t, none of them matter in these cases. Prefer true/false when dealing with bool type. Preserve a couple of TRUEs since they are passed into int args into CAM. Preserve a couple of FALSEs when used for status.done, an int. Differential Revision: https://reviews.freebsd.org/D20999 Modified: stable/12/sys/dev/nvme/nvme_ctrlr.c stable/12/sys/dev/nvme/nvme_private.h stable/12/sys/dev/nvme/nvme_qpair.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_ctrlr.c Wed Jan 22 00:43:51 2020 (r356955) +++ stable/12/sys/dev/nvme/nvme_ctrlr.c Wed Jan 22 00:46:09 2020 (r356956) @@ -181,7 +181,7 @@ nvme_ctrlr_fail(struct nvme_controller *ctrlr) { int i; - ctrlr->is_failed = TRUE; + ctrlr->is_failed = true; nvme_admin_qpair_disable(&ctrlr->adminq); nvme_qpair_fail(&ctrlr->adminq); if (ctrlr->ioq != NULL) { @@ -546,7 +546,7 @@ nvme_ctrlr_construct_namespaces(struct nvme_controller return (0); } -static boolean_t +static bool is_log_page_id_valid(uint8_t page_id) { @@ -558,10 +558,10 @@ is_log_page_id_valid(uint8_t page_id) case NVME_LOG_COMMAND_EFFECT: case NVME_LOG_RES_NOTIFICATION: case NVME_LOG_SANITIZE_STATUS: - return (TRUE); + return (true); } - return (FALSE); + return (false); } static uint32_t @@ -782,7 +782,7 @@ nvme_ctrlr_construct_and_submit_aer(struct nvme_contro * Disable timeout here, since asynchronous event requests should by * nature never be timed out. */ - req->timeout = FALSE; + req->timeout = false; req->cmd.opc = NVME_OPC_ASYNC_EVENT_REQUEST; nvme_ctrlr_submit_admin_request(ctrlr, req); } @@ -1198,7 +1198,7 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, de TASK_INIT(&ctrlr->reset_task, 0, nvme_ctrlr_reset_task, ctrlr); TASK_INIT(&ctrlr->fail_req_task, 0, nvme_ctrlr_fail_req_task, ctrlr); STAILQ_INIT(&ctrlr->fail_req); - ctrlr->is_failed = FALSE; + ctrlr->is_failed = false; make_dev_args_init(&md_args); md_args.mda_devsw = &nvme_ctrlr_cdevsw; Modified: stable/12/sys/dev/nvme/nvme_private.h ============================================================================== --- stable/12/sys/dev/nvme/nvme_private.h Wed Jan 22 00:43:51 2020 (r356955) +++ stable/12/sys/dev/nvme/nvme_private.h Wed Jan 22 00:46:09 2020 (r356956) @@ -141,7 +141,7 @@ struct nvme_request { } u; uint32_t type; uint32_t payload_size; - boolean_t timeout; + bool timeout; nvme_cb_fn_t cb_fn; void *cb_arg; int32_t retries; @@ -214,7 +214,7 @@ struct nvme_qpair { struct nvme_tracker **act_tr; - boolean_t is_enabled; + bool is_enabled; struct mtx lock __aligned(CACHE_LINE_SIZE); @@ -322,7 +322,7 @@ struct nvme_controller { uint32_t is_initialized; uint32_t notification_sent; - boolean_t is_failed; + bool is_failed; STAILQ_HEAD(, nvme_request) fail_req; }; @@ -487,7 +487,7 @@ _nvme_allocate_request(nvme_cb_fn_t cb_fn, void *cb_ar if (req != NULL) { req->cb_fn = cb_fn; req->cb_arg = cb_arg; - req->timeout = TRUE; + req->timeout = true; } return (req); } Modified: stable/12/sys/dev/nvme/nvme_qpair.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_qpair.c Wed Jan 22 00:43:51 2020 (r356955) +++ stable/12/sys/dev/nvme/nvme_qpair.c Wed Jan 22 00:46:09 2020 (r356956) @@ -357,7 +357,7 @@ nvme_qpair_print_completion(struct nvme_qpair *qpair, cpl->cdw0); } -static boolean_t +static bool nvme_completion_is_retry(const struct nvme_completion *cpl) { uint8_t sct, sc, dnr; @@ -423,7 +423,7 @@ nvme_qpair_complete_tracker(struct nvme_tracker *tr, { struct nvme_qpair * qpair = tr->qpair; struct nvme_request *req; - boolean_t retry, error, retriable; + bool retry, error, retriable; req = tr->req; error = nvme_completion_is_error(cpl); @@ -508,7 +508,7 @@ nvme_qpair_manual_complete_request(struct nvme_qpair * struct nvme_request *req, uint32_t sct, uint32_t sc) { struct nvme_completion cpl; - boolean_t error; + bool error; memset(&cpl, 0, sizeof(cpl)); cpl.sqid = qpair->id; @@ -1127,7 +1127,7 @@ static void nvme_qpair_enable(struct nvme_qpair *qpair) { - qpair->is_enabled = TRUE; + qpair->is_enabled = true; } void @@ -1215,7 +1215,7 @@ nvme_qpair_disable(struct nvme_qpair *qpair) { struct nvme_tracker *tr; - qpair->is_enabled = FALSE; + qpair->is_enabled = false; mtx_lock(&qpair->lock); TAILQ_FOREACH(tr, &qpair->outstanding_tr, tailq) callout_stop(&tr->timer); From owner-svn-src-all@freebsd.org Wed Jan 22 00:48:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 43DBA2283AF; Wed, 22 Jan 2020 00:48:55 +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 482Rc710mJz4HJG; Wed, 22 Jan 2020 00:48:55 +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 198571D3F5; Wed, 22 Jan 2020 00:48:55 +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 00M0msUK029699; Wed, 22 Jan 2020 00:48:54 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M0msG0029698; Wed, 22 Jan 2020 00:48:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202001220048.00M0msG0029698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 22 Jan 2020 00:48: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: r356957 - stable/12/sys/dev/nvme X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/dev/nvme X-SVN-Commit-Revision: 356957 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 00:48:55 -0000 Author: mav Date: Wed Jan 22 00:48:54 2020 New Revision: 356957 URL: https://svnweb.freebsd.org/changeset/base/356957 Log: MFC r355774 (by mmel): Properly synchronize completion DMA buffers. Within command completion processing the callback function may access DMAed data buffer. Synchronize it before use, not after. This allows to use NVMe disk on non-DMA coherent arm64 system. Modified: stable/12/sys/dev/nvme/nvme_qpair.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nvme/nvme_qpair.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_qpair.c Wed Jan 22 00:46:09 2020 (r356956) +++ stable/12/sys/dev/nvme/nvme_qpair.c Wed Jan 22 00:48:54 2020 (r356957) @@ -444,8 +444,15 @@ nvme_qpair_complete_tracker(struct nvme_tracker *tr, KASSERT(cpl->cid == req->cmd.cid, ("cpl cid does not match cmd cid\n")); - if (req->cb_fn && !retry) - req->cb_fn(req->cb_arg, cpl); + if (!retry) { + if (req->type != NVME_REQUEST_NULL) { + bus_dmamap_sync(qpair->dma_tag_payload, + tr->payload_dma_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + } + if (req->cb_fn) + req->cb_fn(req->cb_arg, cpl); + } mtx_lock(&qpair->lock); callout_stop(&tr->timer); @@ -455,9 +462,6 @@ nvme_qpair_complete_tracker(struct nvme_tracker *tr, nvme_qpair_submit_tracker(qpair, tr); } else { if (req->type != NVME_REQUEST_NULL) { - bus_dmamap_sync(qpair->dma_tag_payload, - tr->payload_dma_map, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(qpair->dma_tag_payload, tr->payload_dma_map); } From owner-svn-src-all@freebsd.org Wed Jan 22 00:52:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 15ADA228614; Wed, 22 Jan 2020 00:52:43 +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 482RhV6rHhz4Hm0; Wed, 22 Jan 2020 00:52:42 +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 E5A471D5CA; Wed, 22 Jan 2020 00:52:42 +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 00M0qgGb035781; Wed, 22 Jan 2020 00:52:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M0qgrH035780; Wed, 22 Jan 2020 00:52:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202001220052.00M0qgrH035780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 22 Jan 2020 00:52: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: r356958 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 356958 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 00:52:43 -0000 Author: mav Date: Wed Jan 22 00:52:42 2020 New Revision: 356958 URL: https://svnweb.freebsd.org/changeset/base/356958 Log: MFC r341709 (by imp): Add nda(4) cross reference to nvme(4) Modified: stable/12/share/man/man4/nvme.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/nvme.4 ============================================================================== --- stable/12/share/man/man4/nvme.4 Wed Jan 22 00:48:54 2020 (r356957) +++ stable/12/share/man/man4/nvme.4 Wed Jan 22 00:52:42 2020 (r356958) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 7, 2016 +.Dd December 7, 2018 .Dt NVME 4 .Os .Sh NAME @@ -70,6 +70,8 @@ Per-CPU IO queue pairs .It API for registering NVMe namespace consumers such as .Xr nvd 4 +or +.Xr nda 4 .It API for submitting NVM commands to namespaces .It @@ -174,6 +176,7 @@ with a completion entry that was posted by the control and completion queues to the console. .El .Sh SEE ALSO +.Xr nda 4 , .Xr nvd 4 , .Xr pci 4 , .Xr nvmecontrol 8 , From owner-svn-src-all@freebsd.org Wed Jan 22 01:03:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E323B228890; Wed, 22 Jan 2020 01:03:24 +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 482Rwr5Fzdz4J9K; Wed, 22 Jan 2020 01:03:24 +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 AFAA21D797; Wed, 22 Jan 2020 01:03:24 +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 00M13Og8042312; Wed, 22 Jan 2020 01:03:24 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M13OSm042310; Wed, 22 Jan 2020 01:03:24 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202001220103.00M13OSm042310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 22 Jan 2020 01:03: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: r356959 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 356959 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 01:03:25 -0000 Author: mav Date: Wed Jan 22 01:03:24 2020 New Revision: 356959 URL: https://svnweb.freebsd.org/changeset/base/356959 Log: MFC r347967 (by cem): nvd.4: Reference nda(4) Fix a totally minor typo in nvme.4 while here. Modified: stable/12/share/man/man4/nvd.4 stable/12/share/man/man4/nvme.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/nvd.4 ============================================================================== --- stable/12/share/man/man4/nvd.4 Wed Jan 22 00:52:42 2020 (r356958) +++ stable/12/share/man/man4/nvd.4 Wed Jan 22 01:03:24 2020 (r356959) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 28, 2016 +.Dd May 18, 2019 .Dt NVD 4 .Os .Sh NAME @@ -86,6 +86,7 @@ hw.nvd.delete_max= .Ed .Sh SEE ALSO .Xr GEOM 4 , +.Xr nda 4 , .Xr nvme 4 , .Xr geom 8 , .Xr nvmecontrol 8 , Modified: stable/12/share/man/man4/nvme.4 ============================================================================== --- stable/12/share/man/man4/nvme.4 Wed Jan 22 00:52:42 2020 (r356958) +++ stable/12/share/man/man4/nvme.4 Wed Jan 22 01:03:24 2020 (r356959) @@ -120,11 +120,28 @@ hw.nvme.force_intx=1 .Pp Note that use of INTx implies disabling of per-CPU I/O queue pairs. .Pp -When there is an error, -.Nm -prints only the most relevant information about the command by default. -To enable dumping of all information about the command, set the following tunable -value in +The +.Xr nvd 4 +driver is used to provide a disk driver to the system by default. +The +.Xr nda 4 +driver can also be used instead. +The +.Xr nvd 4 +driver performs better with smaller transactions and few TRIM +commands. +It sends all commands directly to the drive immediately. +The +.Xr nda 4 +driver performs better with larger transactions and also collapses +TRIM commands giving better performance. +It can queue commands to the drive; combine +.Dv BIO_DELETE +commands into a single trip; and +use the CAM I/O scheduler to bias one type of operation over another. +To select the +.Xr nda 4 +driver, set the following tunable value in .Xr loader.conf 5 : .Bd -literal -offset indent hw.nvme.verbose_cmd_dump=1 From owner-svn-src-all@freebsd.org Wed Jan 22 01:04:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB4F8228934; Wed, 22 Jan 2020 01:04:27 +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 482Ry353Pbz4JHs; Wed, 22 Jan 2020 01:04:27 +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 A8C7F1D79A; Wed, 22 Jan 2020 01:04:27 +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 00M14RnT042480; Wed, 22 Jan 2020 01:04:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M14RbB042479; Wed, 22 Jan 2020 01:04:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202001220104.00M14RbB042479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 22 Jan 2020 01:04:27 +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: r356960 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 356960 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 01:04:27 -0000 Author: mav Date: Wed Jan 22 01:04:26 2020 New Revision: 356960 URL: https://svnweb.freebsd.org/changeset/base/356960 Log: MFC r351357 (by imp): Document RST support in nvme(4) and ahci(4). Modified: stable/12/share/man/man4/ahci.4 stable/12/share/man/man4/nvme.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/ahci.4 ============================================================================== --- stable/12/share/man/man4/ahci.4 Wed Jan 22 01:03:24 2020 (r356959) +++ stable/12/share/man/man4/ahci.4 Wed Jan 22 01:04:26 2020 (r356960) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 2, 2018 +.Dd August 21, 2019 .Dt AHCI 4 .Os .Sh NAME @@ -153,6 +153,26 @@ subclass 6 (SATA) and programming interface 1 (AHCI). Also, in cooperation with atamarvell and atajmicron drivers of ata(4), it supports AHCI part of legacy-PATA + AHCI-SATA combined controllers, such as JMicron JMB36x and Marvell 88SE61xx. +.Pp +The +.Nm +driver also supports AHCI devices that act as PCI bridges for +.Xr nvme 4 +using Intel Rapid Storage Technology (RST). +To use the +.Xr nvme 4 +device, either one must set the SATA mode in the BIOS to AHCI (from RST), +or one must accept the performance with RST enabled due to interrupt sharing. +.Fx +will automatically detect AHCI devices with this extension that are in RST +mode. +When that happens, +.Nm +will attach +.Xr nvme 4 +children to the +.Xr ahci 4 +device. .Sh FILES .Bl -tag -width /dev/led/ahcich*.locate .It Pa /dev/led/ahci*.*.act Modified: stable/12/share/man/man4/nvme.4 ============================================================================== --- stable/12/share/man/man4/nvme.4 Wed Jan 22 01:03:24 2020 (r356959) +++ stable/12/share/man/man4/nvme.4 Wed Jan 22 01:04:26 2020 (r356960) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 7, 2018 +.Dd August 21, 2019 .Dt NVME 4 .Os .Sh NAME @@ -192,6 +192,23 @@ with a completion entry that was posted by the control (W) Writing 1 to this sysctl will dump the full contents of the submission and completion queues to the console. .El +.Pp +In addition to the typical pci attachment, the +.Nm +driver supports attaching to a +.Xr ahci 4 +device. +Intel's Rapid Storage Technology (RST) hides the nvme device +behind the AHCI device due to limitations in Windows. +However, this effectively hides it from the +.Fx +kernel. +To work around this limitation, +.Fx +detects that the AHCI device supports RST and when it is enabled. +See +.Xr ahci 4 +for more details. .Sh SEE ALSO .Xr nda 4 , .Xr nvd 4 , From owner-svn-src-all@freebsd.org Wed Jan 22 01:08:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3EBAF228A52; Wed, 22 Jan 2020 01:08:29 +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 482S2j0xl1z4JRh; Wed, 22 Jan 2020 01:08:29 +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 1B7571D79D; Wed, 22 Jan 2020 01:08:29 +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 00M18Sef043001; Wed, 22 Jan 2020 01:08:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M18STm042997; Wed, 22 Jan 2020 01:08:28 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202001220108.00M18STm042997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 22 Jan 2020 01:08:28 +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: r356961 - in stable/12: share/man/man4 sys/dev/nvme X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/dev/nvme X-SVN-Commit-Revision: 356961 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 01:08:29 -0000 Author: mav Date: Wed Jan 22 01:08:27 2020 New Revision: 356961 URL: https://svnweb.freebsd.org/changeset/base/356961 Log: MFC r356474, r356480, r356482, r356506: Add Host Memory Buffer support to nvme(4). This allows cheapest DRAM-less NVMe SSDs to use some of host RAM (about 1MB per 1GB on the devices I have) for its metadata cache, significantly improving random I/O performance. Device reports minimal and preferable size of the buffer. The code limits it to 5% of physical RAM by default. If the buffer can not be allocated or below minimal size, the device will just have to work without it. Modified: stable/12/share/man/man4/nvme.4 stable/12/sys/dev/nvme/nvme.h stable/12/sys/dev/nvme/nvme_ctrlr.c stable/12/sys/dev/nvme/nvme_ctrlr_cmd.c stable/12/sys/dev/nvme/nvme_private.h Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/nvme.4 ============================================================================== --- stable/12/share/man/man4/nvme.4 Wed Jan 22 01:04:26 2020 (r356960) +++ stable/12/share/man/man4/nvme.4 Wed Jan 22 01:08:27 2020 (r356961) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 21, 2019 +.Dd January 6, 2020 .Dt NVME 4 .Os .Sh NAME @@ -119,6 +119,14 @@ hw.nvme.force_intx=1 .Ed .Pp Note that use of INTx implies disabling of per-CPU I/O queue pairs. +.Pp +To control maximum amount of system RAM in bytes to use as Host Memory +Buffer for capable devices, set the following tunable: +.Bd -literal -offset indent +hw.nvme.hmb_max +.Ed +.Pp +The default value is 5% of physical memory size per device. .Pp The .Xr nvd 4 Modified: stable/12/sys/dev/nvme/nvme.h ============================================================================== --- stable/12/sys/dev/nvme/nvme.h Wed Jan 22 01:04:26 2020 (r356960) +++ stable/12/sys/dev/nvme/nvme.h Wed Jan 22 01:08:27 2020 (r356961) @@ -1531,6 +1531,12 @@ struct nvme_get_nsid { uint32_t nsid; }; +struct nvme_hmb_desc { + uint64_t addr; + uint32_t size; + uint32_t reserved; +}; + #define nvme_completion_is_error(cpl) \ (NVME_STATUS_GET_SC((cpl)->status) != 0 || NVME_STATUS_GET_SCT((cpl)->status) != 0) @@ -1566,6 +1572,8 @@ int nvme_ctrlr_passthrough_cmd(struct nvme_controller /* Admin functions */ void nvme_ctrlr_cmd_set_feature(struct nvme_controller *ctrlr, uint8_t feature, uint32_t cdw11, + uint32_t cdw12, uint32_t cdw13, + uint32_t cdw14, uint32_t cdw15, void *payload, uint32_t payload_size, nvme_cb_fn_t cb_fn, void *cb_arg); void nvme_ctrlr_cmd_get_feature(struct nvme_controller *ctrlr, Modified: stable/12/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_ctrlr.c Wed Jan 22 01:04:26 2020 (r356960) +++ stable/12/sys/dev/nvme/nvme_ctrlr.c Wed Jan 22 01:08:27 2020 (r356961) @@ -841,6 +841,169 @@ nvme_ctrlr_configure_int_coalescing(struct nvme_contro } static void +nvme_ctrlr_hmb_free(struct nvme_controller *ctrlr) +{ + struct nvme_hmb_chunk *hmbc; + int i; + + if (ctrlr->hmb_desc_paddr) { + bus_dmamap_unload(ctrlr->hmb_desc_tag, ctrlr->hmb_desc_map); + bus_dmamem_free(ctrlr->hmb_desc_tag, ctrlr->hmb_desc_vaddr, + ctrlr->hmb_desc_map); + ctrlr->hmb_desc_paddr = 0; + } + if (ctrlr->hmb_desc_tag) { + bus_dma_tag_destroy(ctrlr->hmb_desc_tag); + ctrlr->hmb_desc_tag = NULL; + } + for (i = 0; i < ctrlr->hmb_nchunks; i++) { + hmbc = &ctrlr->hmb_chunks[i]; + bus_dmamap_unload(ctrlr->hmb_tag, hmbc->hmbc_map); + bus_dmamem_free(ctrlr->hmb_tag, hmbc->hmbc_vaddr, + hmbc->hmbc_map); + } + ctrlr->hmb_nchunks = 0; + if (ctrlr->hmb_tag) { + bus_dma_tag_destroy(ctrlr->hmb_tag); + ctrlr->hmb_tag = NULL; + } + if (ctrlr->hmb_chunks) { + free(ctrlr->hmb_chunks, M_NVME); + ctrlr->hmb_chunks = NULL; + } +} + +static void +nvme_ctrlr_hmb_alloc(struct nvme_controller *ctrlr) +{ + struct nvme_hmb_chunk *hmbc; + size_t pref, min, minc, size; + int err, i; + uint64_t max; + + /* Limit HMB to 5% of RAM size per device by default. */ + max = (uint64_t)physmem * PAGE_SIZE / 20; + TUNABLE_UINT64_FETCH("hw.nvme.hmb_max", &max); + + min = (long long unsigned)ctrlr->cdata.hmmin * 4096; + if (max == 0 || max < min) + return; + pref = MIN((long long unsigned)ctrlr->cdata.hmpre * 4096, max); + minc = MAX(ctrlr->cdata.hmminds * 4096, PAGE_SIZE); + if (min > 0 && ctrlr->cdata.hmmaxd > 0) + minc = MAX(minc, min / ctrlr->cdata.hmmaxd); + ctrlr->hmb_chunk = pref; + +again: + ctrlr->hmb_chunk = roundup2(ctrlr->hmb_chunk, PAGE_SIZE); + ctrlr->hmb_nchunks = howmany(pref, ctrlr->hmb_chunk); + if (ctrlr->cdata.hmmaxd > 0 && ctrlr->hmb_nchunks > ctrlr->cdata.hmmaxd) + ctrlr->hmb_nchunks = ctrlr->cdata.hmmaxd; + ctrlr->hmb_chunks = malloc(sizeof(struct nvme_hmb_chunk) * + ctrlr->hmb_nchunks, M_NVME, M_WAITOK); + err = bus_dma_tag_create(bus_get_dma_tag(ctrlr->dev), + PAGE_SIZE, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + ctrlr->hmb_chunk, 1, ctrlr->hmb_chunk, 0, NULL, NULL, &ctrlr->hmb_tag); + if (err != 0) { + nvme_printf(ctrlr, "HMB tag create failed %d\n", err); + nvme_ctrlr_hmb_free(ctrlr); + return; + } + + for (i = 0; i < ctrlr->hmb_nchunks; i++) { + hmbc = &ctrlr->hmb_chunks[i]; + if (bus_dmamem_alloc(ctrlr->hmb_tag, + (void **)&hmbc->hmbc_vaddr, BUS_DMA_NOWAIT, + &hmbc->hmbc_map)) { + nvme_printf(ctrlr, "failed to alloc HMB\n"); + break; + } + if (bus_dmamap_load(ctrlr->hmb_tag, hmbc->hmbc_map, + hmbc->hmbc_vaddr, ctrlr->hmb_chunk, nvme_single_map, + &hmbc->hmbc_paddr, BUS_DMA_NOWAIT) != 0) { + bus_dmamem_free(ctrlr->hmb_tag, hmbc->hmbc_vaddr, + hmbc->hmbc_map); + nvme_printf(ctrlr, "failed to load HMB\n"); + break; + } + bus_dmamap_sync(ctrlr->hmb_tag, hmbc->hmbc_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + } + + if (i < ctrlr->hmb_nchunks && i * ctrlr->hmb_chunk < min && + ctrlr->hmb_chunk / 2 >= minc) { + ctrlr->hmb_nchunks = i; + nvme_ctrlr_hmb_free(ctrlr); + ctrlr->hmb_chunk /= 2; + goto again; + } + ctrlr->hmb_nchunks = i; + if (ctrlr->hmb_nchunks * ctrlr->hmb_chunk < min) { + nvme_ctrlr_hmb_free(ctrlr); + return; + } + + size = sizeof(struct nvme_hmb_desc) * ctrlr->hmb_nchunks; + err = bus_dma_tag_create(bus_get_dma_tag(ctrlr->dev), + 16, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + size, 1, size, 0, NULL, NULL, &ctrlr->hmb_desc_tag); + if (err != 0) { + nvme_printf(ctrlr, "HMB desc tag create failed %d\n", err); + nvme_ctrlr_hmb_free(ctrlr); + return; + } + if (bus_dmamem_alloc(ctrlr->hmb_desc_tag, + (void **)&ctrlr->hmb_desc_vaddr, BUS_DMA_WAITOK, + &ctrlr->hmb_desc_map)) { + nvme_printf(ctrlr, "failed to alloc HMB desc\n"); + nvme_ctrlr_hmb_free(ctrlr); + return; + } + if (bus_dmamap_load(ctrlr->hmb_desc_tag, ctrlr->hmb_desc_map, + ctrlr->hmb_desc_vaddr, size, nvme_single_map, + &ctrlr->hmb_desc_paddr, BUS_DMA_NOWAIT) != 0) { + bus_dmamem_free(ctrlr->hmb_desc_tag, ctrlr->hmb_desc_vaddr, + ctrlr->hmb_desc_map); + nvme_printf(ctrlr, "failed to load HMB desc\n"); + nvme_ctrlr_hmb_free(ctrlr); + return; + } + + for (i = 0; i < ctrlr->hmb_nchunks; i++) { + ctrlr->hmb_desc_vaddr[i].addr = + htole64(ctrlr->hmb_chunks[i].hmbc_paddr); + ctrlr->hmb_desc_vaddr[i].size = htole32(ctrlr->hmb_chunk / 4096); + } + bus_dmamap_sync(ctrlr->hmb_desc_tag, ctrlr->hmb_desc_map, + BUS_DMASYNC_PREWRITE); + + nvme_printf(ctrlr, "Allocated %lluMB host memory buffer\n", + (long long unsigned)ctrlr->hmb_nchunks * ctrlr->hmb_chunk + / 1024 / 1024); +} + +static void +nvme_ctrlr_hmb_enable(struct nvme_controller *ctrlr, bool enable, bool memret) +{ + struct nvme_completion_poll_status status; + uint32_t cdw11; + + cdw11 = 0; + if (enable) + cdw11 |= 1; + if (memret) + cdw11 |= 2; + status.done = 0; + nvme_ctrlr_cmd_set_feature(ctrlr, NVME_FEAT_HOST_MEMORY_BUFFER, cdw11, + ctrlr->hmb_nchunks * ctrlr->hmb_chunk / 4096, ctrlr->hmb_desc_paddr, + ctrlr->hmb_desc_paddr >> 32, ctrlr->hmb_nchunks, NULL, 0, + nvme_completion_poll_cb, &status); + nvme_completion_poll(&status); + if (nvme_completion_is_error(&status.cpl)) + nvme_printf(ctrlr, "nvme_ctrlr_hmb_enable failed!\n"); +} + +static void nvme_ctrlr_start(void *ctrlr_arg, bool resetting) { struct nvme_controller *ctrlr = ctrlr_arg; @@ -888,6 +1051,13 @@ nvme_ctrlr_start(void *ctrlr_arg, bool resetting) } } + if (ctrlr->cdata.hmpre > 0 && ctrlr->hmb_nchunks == 0) { + nvme_ctrlr_hmb_alloc(ctrlr); + if (ctrlr->hmb_nchunks > 0) + nvme_ctrlr_hmb_enable(ctrlr, true, false); + } else if (ctrlr->hmb_nchunks > 0) + nvme_ctrlr_hmb_enable(ctrlr, true, true); + if (nvme_ctrlr_create_qpairs(ctrlr) != 0) { nvme_ctrlr_fail(ctrlr); return; @@ -1240,11 +1410,15 @@ nvme_ctrlr_destruct(struct nvme_controller *ctrlr, dev destroy_dev(ctrlr->cdev); if (ctrlr->is_initialized) { - if (!gone) + if (!gone) { + if (ctrlr->hmb_nchunks > 0) + nvme_ctrlr_hmb_enable(ctrlr, false, false); nvme_ctrlr_delete_qpairs(ctrlr); + } for (i = 0; i < ctrlr->num_io_queues; i++) nvme_io_qpair_destroy(&ctrlr->ioq[i]); free(ctrlr->ioq, M_NVME); + nvme_ctrlr_hmb_free(ctrlr); nvme_admin_qpair_destroy(&ctrlr->adminq); } @@ -1367,6 +1541,9 @@ nvme_ctrlr_suspend(struct nvme_controller *ctrlr) "Competing reset task didn't finish. Try again later.\n"); return (EWOULDBLOCK); } + + if (ctrlr->hmb_nchunks > 0) + nvme_ctrlr_hmb_enable(ctrlr, false, false); /* * Per Section 7.6.2 of NVMe spec 1.4, to properly suspend, we need to Modified: stable/12/sys/dev/nvme/nvme_ctrlr_cmd.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_ctrlr_cmd.c Wed Jan 22 01:04:26 2020 (r356960) +++ stable/12/sys/dev/nvme/nvme_ctrlr_cmd.c Wed Jan 22 01:08:27 2020 (r356961) @@ -166,7 +166,8 @@ nvme_ctrlr_cmd_delete_io_sq(struct nvme_controller *ct void nvme_ctrlr_cmd_set_feature(struct nvme_controller *ctrlr, uint8_t feature, - uint32_t cdw11, void *payload, uint32_t payload_size, + uint32_t cdw11, uint32_t cdw12, uint32_t cdw13, uint32_t cdw14, + uint32_t cdw15, void *payload, uint32_t payload_size, nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; @@ -178,6 +179,10 @@ nvme_ctrlr_cmd_set_feature(struct nvme_controller *ctr cmd->opc = NVME_OPC_SET_FEATURES; cmd->cdw10 = htole32(feature); cmd->cdw11 = htole32(cdw11); + cmd->cdw12 = htole32(cdw12); + cmd->cdw13 = htole32(cdw13); + cmd->cdw14 = htole32(cdw14); + cmd->cdw15 = htole32(cdw15); nvme_ctrlr_submit_admin_request(ctrlr, req); } @@ -208,7 +213,7 @@ nvme_ctrlr_cmd_set_num_queues(struct nvme_controller * cdw11 = ((num_queues - 1) << 16) | (num_queues - 1); nvme_ctrlr_cmd_set_feature(ctrlr, NVME_FEAT_NUMBER_OF_QUEUES, cdw11, - NULL, 0, cb_fn, cb_arg); + 0, 0, 0, 0, NULL, 0, cb_fn, cb_arg); } void @@ -219,8 +224,8 @@ nvme_ctrlr_cmd_set_async_event_config(struct nvme_cont cdw11 = state; nvme_ctrlr_cmd_set_feature(ctrlr, - NVME_FEAT_ASYNC_EVENT_CONFIGURATION, cdw11, NULL, 0, cb_fn, - cb_arg); + NVME_FEAT_ASYNC_EVENT_CONFIGURATION, cdw11, 0, 0, 0, 0, NULL, 0, + cb_fn, cb_arg); } void @@ -245,7 +250,7 @@ nvme_ctrlr_cmd_set_interrupt_coalescing(struct nvme_co cdw11 = ((microseconds/100) << 8) | threshold; nvme_ctrlr_cmd_set_feature(ctrlr, NVME_FEAT_INTERRUPT_COALESCING, cdw11, - NULL, 0, cb_fn, cb_arg); + 0, 0, 0, 0, NULL, 0, cb_fn, cb_arg); } void Modified: stable/12/sys/dev/nvme/nvme_private.h ============================================================================== --- stable/12/sys/dev/nvme/nvme_private.h Wed Jan 22 01:04:26 2020 (r356960) +++ stable/12/sys/dev/nvme/nvme_private.h Wed Jan 22 01:08:27 2020 (r356961) @@ -279,9 +279,6 @@ struct nvme_controller { struct resource *res; void *tag; - bus_dma_tag_t hw_desc_tag; - bus_dmamap_t hw_desc_map; - /** maximum i/o size in bytes */ uint32_t max_xfer_size; @@ -324,6 +321,20 @@ struct nvme_controller { bool is_failed; STAILQ_HEAD(, nvme_request) fail_req; + + /* Host Memory Buffer */ + int hmb_nchunks; + size_t hmb_chunk; + bus_dma_tag_t hmb_tag; + struct nvme_hmb_chunk { + bus_dmamap_t hmbc_map; + void *hmbc_vaddr; + uint64_t hmbc_paddr; + } *hmb_chunks; + bus_dma_tag_t hmb_desc_tag; + bus_dmamap_t hmb_desc_map; + struct nvme_hmb_desc *hmb_desc_vaddr; + uint64_t hmb_desc_paddr; }; #define nvme_mmio_offsetof(reg) \ From owner-svn-src-all@freebsd.org Wed Jan 22 01:10:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39729228AFB; Wed, 22 Jan 2020 01:10:24 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482S4w0qzTz4JZP; Wed, 22 Jan 2020 01:10:24 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17C9F1D7A2; Wed, 22 Jan 2020 01:10:24 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00M1ANE9043300; Wed, 22 Jan 2020 01:10:23 GMT (envelope-from pjd@FreeBSD.org) Received: (from pjd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M1ANX9043299; Wed, 22 Jan 2020 01:10:23 GMT (envelope-from pjd@FreeBSD.org) Message-Id: <202001220110.00M1ANX9043299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pjd set sender to pjd@FreeBSD.org using -f From: Pawel Jakub Dawidek Date: Wed, 22 Jan 2020 01:10: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: r356962 - stable/12/contrib/openbsm/libauditd X-SVN-Group: stable-12 X-SVN-Commit-Author: pjd X-SVN-Commit-Paths: stable/12/contrib/openbsm/libauditd X-SVN-Commit-Revision: 356962 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 01:10:24 -0000 Author: pjd Date: Wed Jan 22 01:10:23 2020 New Revision: 356962 URL: https://svnweb.freebsd.org/changeset/base/356962 Log: MFC r342873: In r316006 the getstrfromtype_locked() function was modified to return an empty string, instead of NULL, if an entry is missing in the audit_control file. Because of that change the getachost() function started to return success even if the host name was not defined in the audit_control. This in turn led to auditd_hostlen always being set (for an empty host it was set to 0). If auditd_hostlen was not equal to -1 we were trying to append the host name to trail file name. All this led to situation where when host name is not defined in audit_control, auditd will create trail files with a leading '.', which breaks auditdistd as it doesn't work with longer audit trail file names. Fix this by appending host name to the trail file name only if the host name is not empty. Sponsored by: Fudo Security Modified: stable/12/contrib/openbsm/libauditd/auditd_lib.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/openbsm/libauditd/auditd_lib.c ============================================================================== --- stable/12/contrib/openbsm/libauditd/auditd_lib.c Wed Jan 22 01:08:27 2020 (r356961) +++ stable/12/contrib/openbsm/libauditd/auditd_lib.c Wed Jan 22 01:10:23 2020 (r356962) @@ -193,7 +193,7 @@ affixdir(char *name, struct dir_ent *dirent) /* * If the host is set then also add the hostname to the filename. */ - if (auditd_hostlen != -1) + if (auditd_hostlen > 0) asprintf(&fn, "%s/%s.%s", dirent->dirname, name, auditd_host); else asprintf(&fn, "%s/%s", dirent->dirname, name); From owner-svn-src-all@freebsd.org Wed Jan 22 01:15:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 871A9228CFB; Wed, 22 Jan 2020 01:15:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482SCM3jmCz4Jxy; Wed, 22 Jan 2020 01:15:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B8981D95F; Wed, 22 Jan 2020 01:15:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00M1FxXI049192; Wed, 22 Jan 2020 01:15:59 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M1FvYd049178; Wed, 22 Jan 2020 01:15:57 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <202001220115.00M1FvYd049178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 22 Jan 2020 01:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356963 - in head: etc/mtree secure/lib/libcrypto secure/lib/libcrypto/man secure/lib/libcrypto/man/man3 secure/lib/libcrypto/man/man5 secure/lib/libcrypto/man/man7 X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head: etc/mtree secure/lib/libcrypto secure/lib/libcrypto/man secure/lib/libcrypto/man/man3 secure/lib/libcrypto/man/man5 secure/lib/libcrypto/man/man7 X-SVN-Commit-Revision: 356963 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 01:15:59 -0000 Author: jkim Date: Wed Jan 22 01:15:57 2020 New Revision: 356963 URL: https://svnweb.freebsd.org/changeset/base/356963 Log: Install man5 and man7 for OpenSSL. Note config.5 and crypto.7 are not installed because we have conflicts. Requested by: phk MFC after: 1 month Added: head/secure/lib/libcrypto/man/man3/ head/secure/lib/libcrypto/man/man3/ADMISSIONS.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ADMISSIONS.3 head/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ASN1_INTEGER_get_int64.3 head/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ASN1_ITEM_lookup.3 head/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 head/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ASN1_STRING_TABLE_add.3 head/secure/lib/libcrypto/man/man3/ASN1_STRING_length.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ASN1_STRING_length.3 head/secure/lib/libcrypto/man/man3/ASN1_STRING_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ASN1_STRING_new.3 head/secure/lib/libcrypto/man/man3/ASN1_STRING_print_ex.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 head/secure/lib/libcrypto/man/man3/ASN1_TIME_set.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ASN1_TIME_set.3 head/secure/lib/libcrypto/man/man3/ASN1_TYPE_get.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ASN1_TYPE_get.3 head/secure/lib/libcrypto/man/man3/ASN1_generate_nconf.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 head/secure/lib/libcrypto/man/man3/ASYNC_WAIT_CTX_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ASYNC_WAIT_CTX_new.3 head/secure/lib/libcrypto/man/man3/ASYNC_start_job.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ASYNC_start_job.3 head/secure/lib/libcrypto/man/man3/BF_encrypt.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BF_encrypt.3 head/secure/lib/libcrypto/man/man3/BIO_ADDR.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_ADDR.3 head/secure/lib/libcrypto/man/man3/BIO_ADDRINFO.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_ADDRINFO.3 head/secure/lib/libcrypto/man/man3/BIO_connect.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_connect.3 head/secure/lib/libcrypto/man/man3/BIO_ctrl.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_ctrl.3 head/secure/lib/libcrypto/man/man3/BIO_f_base64.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_f_base64.3 head/secure/lib/libcrypto/man/man3/BIO_f_buffer.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_f_buffer.3 head/secure/lib/libcrypto/man/man3/BIO_f_cipher.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_f_cipher.3 head/secure/lib/libcrypto/man/man3/BIO_f_md.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_f_md.3 head/secure/lib/libcrypto/man/man3/BIO_f_null.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_f_null.3 head/secure/lib/libcrypto/man/man3/BIO_f_ssl.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_f_ssl.3 head/secure/lib/libcrypto/man/man3/BIO_find_type.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_find_type.3 head/secure/lib/libcrypto/man/man3/BIO_get_data.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_get_data.3 head/secure/lib/libcrypto/man/man3/BIO_get_ex_new_index.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_get_ex_new_index.3 head/secure/lib/libcrypto/man/man3/BIO_meth_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_meth_new.3 head/secure/lib/libcrypto/man/man3/BIO_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_new.3 head/secure/lib/libcrypto/man/man3/BIO_new_CMS.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_new_CMS.3 head/secure/lib/libcrypto/man/man3/BIO_parse_hostserv.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_parse_hostserv.3 head/secure/lib/libcrypto/man/man3/BIO_printf.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_printf.3 head/secure/lib/libcrypto/man/man3/BIO_push.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_push.3 head/secure/lib/libcrypto/man/man3/BIO_read.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_read.3 head/secure/lib/libcrypto/man/man3/BIO_s_accept.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_s_accept.3 head/secure/lib/libcrypto/man/man3/BIO_s_bio.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_s_bio.3 head/secure/lib/libcrypto/man/man3/BIO_s_connect.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_s_connect.3 head/secure/lib/libcrypto/man/man3/BIO_s_fd.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_s_fd.3 head/secure/lib/libcrypto/man/man3/BIO_s_file.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_s_file.3 head/secure/lib/libcrypto/man/man3/BIO_s_mem.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_s_mem.3 head/secure/lib/libcrypto/man/man3/BIO_s_null.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_s_null.3 head/secure/lib/libcrypto/man/man3/BIO_s_socket.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_s_socket.3 head/secure/lib/libcrypto/man/man3/BIO_set_callback.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_set_callback.3 head/secure/lib/libcrypto/man/man3/BIO_should_retry.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BIO_should_retry.3 head/secure/lib/libcrypto/man/man3/BN_BLINDING_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BN_BLINDING_new.3 head/secure/lib/libcrypto/man/man3/BN_CTX_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BN_CTX_new.3 head/secure/lib/libcrypto/man/man3/BN_CTX_start.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BN_CTX_start.3 head/secure/lib/libcrypto/man/man3/BN_add.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BN_add.3 head/secure/lib/libcrypto/man/man3/BN_add_word.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BN_add_word.3 head/secure/lib/libcrypto/man/man3/BN_bn2bin.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BN_bn2bin.3 head/secure/lib/libcrypto/man/man3/BN_cmp.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BN_cmp.3 head/secure/lib/libcrypto/man/man3/BN_copy.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BN_copy.3 head/secure/lib/libcrypto/man/man3/BN_generate_prime.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BN_generate_prime.3 head/secure/lib/libcrypto/man/man3/BN_mod_inverse.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BN_mod_inverse.3 head/secure/lib/libcrypto/man/man3/BN_mod_mul_montgomery.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 head/secure/lib/libcrypto/man/man3/BN_mod_mul_reciprocal.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 head/secure/lib/libcrypto/man/man3/BN_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BN_new.3 head/secure/lib/libcrypto/man/man3/BN_num_bytes.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BN_num_bytes.3 head/secure/lib/libcrypto/man/man3/BN_rand.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BN_rand.3 head/secure/lib/libcrypto/man/man3/BN_security_bits.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BN_security_bits.3 head/secure/lib/libcrypto/man/man3/BN_set_bit.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BN_set_bit.3 head/secure/lib/libcrypto/man/man3/BN_swap.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BN_swap.3 head/secure/lib/libcrypto/man/man3/BN_zero.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BN_zero.3 head/secure/lib/libcrypto/man/man3/BUF_MEM_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/BUF_MEM_new.3 head/secure/lib/libcrypto/man/man3/CMS_add0_cert.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CMS_add0_cert.3 head/secure/lib/libcrypto/man/man3/CMS_add1_recipient_cert.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 head/secure/lib/libcrypto/man/man3/CMS_add1_signer.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CMS_add1_signer.3 head/secure/lib/libcrypto/man/man3/CMS_compress.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CMS_compress.3 head/secure/lib/libcrypto/man/man3/CMS_decrypt.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CMS_decrypt.3 head/secure/lib/libcrypto/man/man3/CMS_encrypt.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CMS_encrypt.3 head/secure/lib/libcrypto/man/man3/CMS_final.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CMS_final.3 head/secure/lib/libcrypto/man/man3/CMS_get0_RecipientInfos.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 head/secure/lib/libcrypto/man/man3/CMS_get0_SignerInfos.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 head/secure/lib/libcrypto/man/man3/CMS_get0_type.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CMS_get0_type.3 head/secure/lib/libcrypto/man/man3/CMS_get1_ReceiptRequest.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 head/secure/lib/libcrypto/man/man3/CMS_sign.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CMS_sign.3 head/secure/lib/libcrypto/man/man3/CMS_sign_receipt.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CMS_sign_receipt.3 head/secure/lib/libcrypto/man/man3/CMS_uncompress.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CMS_uncompress.3 head/secure/lib/libcrypto/man/man3/CMS_verify.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CMS_verify.3 head/secure/lib/libcrypto/man/man3/CMS_verify_receipt.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CMS_verify_receipt.3 head/secure/lib/libcrypto/man/man3/CONF_modules_free.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CONF_modules_free.3 head/secure/lib/libcrypto/man/man3/CONF_modules_load_file.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CONF_modules_load_file.3 head/secure/lib/libcrypto/man/man3/CRYPTO_THREAD_run_once.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CRYPTO_THREAD_run_once.3 head/secure/lib/libcrypto/man/man3/CRYPTO_get_ex_new_index.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CRYPTO_get_ex_new_index.3 head/secure/lib/libcrypto/man/man3/CRYPTO_memcmp.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CRYPTO_memcmp.3 head/secure/lib/libcrypto/man/man3/CTLOG_STORE_get0_log_by_id.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CTLOG_STORE_get0_log_by_id.3 head/secure/lib/libcrypto/man/man3/CTLOG_STORE_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CTLOG_STORE_new.3 head/secure/lib/libcrypto/man/man3/CTLOG_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CTLOG_new.3 head/secure/lib/libcrypto/man/man3/CT_POLICY_EVAL_CTX_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/CT_POLICY_EVAL_CTX_new.3 head/secure/lib/libcrypto/man/man3/DEFINE_STACK_OF.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DEFINE_STACK_OF.3 head/secure/lib/libcrypto/man/man3/DES_random_key.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DES_random_key.3 head/secure/lib/libcrypto/man/man3/DH_generate_key.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DH_generate_key.3 head/secure/lib/libcrypto/man/man3/DH_generate_parameters.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DH_generate_parameters.3 head/secure/lib/libcrypto/man/man3/DH_get0_pqg.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DH_get0_pqg.3 head/secure/lib/libcrypto/man/man3/DH_get_1024_160.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DH_get_1024_160.3 head/secure/lib/libcrypto/man/man3/DH_meth_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DH_meth_new.3 head/secure/lib/libcrypto/man/man3/DH_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DH_new.3 head/secure/lib/libcrypto/man/man3/DH_new_by_nid.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DH_new_by_nid.3 head/secure/lib/libcrypto/man/man3/DH_set_method.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DH_set_method.3 head/secure/lib/libcrypto/man/man3/DH_size.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DH_size.3 head/secure/lib/libcrypto/man/man3/DSA_SIG_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DSA_SIG_new.3 head/secure/lib/libcrypto/man/man3/DSA_do_sign.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DSA_do_sign.3 head/secure/lib/libcrypto/man/man3/DSA_dup_DH.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DSA_dup_DH.3 head/secure/lib/libcrypto/man/man3/DSA_generate_key.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DSA_generate_key.3 head/secure/lib/libcrypto/man/man3/DSA_generate_parameters.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DSA_generate_parameters.3 head/secure/lib/libcrypto/man/man3/DSA_get0_pqg.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DSA_get0_pqg.3 head/secure/lib/libcrypto/man/man3/DSA_meth_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DSA_meth_new.3 head/secure/lib/libcrypto/man/man3/DSA_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DSA_new.3 head/secure/lib/libcrypto/man/man3/DSA_set_method.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DSA_set_method.3 head/secure/lib/libcrypto/man/man3/DSA_sign.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DSA_sign.3 head/secure/lib/libcrypto/man/man3/DSA_size.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DSA_size.3 head/secure/lib/libcrypto/man/man3/DTLS_get_data_mtu.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DTLS_get_data_mtu.3 head/secure/lib/libcrypto/man/man3/DTLS_set_timer_cb.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DTLS_set_timer_cb.3 head/secure/lib/libcrypto/man/man3/DTLSv1_listen.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/DTLSv1_listen.3 head/secure/lib/libcrypto/man/man3/ECDSA_SIG_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ECDSA_SIG_new.3 head/secure/lib/libcrypto/man/man3/ECPKParameters_print.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ECPKParameters_print.3 head/secure/lib/libcrypto/man/man3/EC_GFp_simple_method.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EC_GFp_simple_method.3 head/secure/lib/libcrypto/man/man3/EC_GROUP_copy.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EC_GROUP_copy.3 head/secure/lib/libcrypto/man/man3/EC_GROUP_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EC_GROUP_new.3 head/secure/lib/libcrypto/man/man3/EC_KEY_get_enc_flags.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EC_KEY_get_enc_flags.3 head/secure/lib/libcrypto/man/man3/EC_KEY_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EC_KEY_new.3 head/secure/lib/libcrypto/man/man3/EC_POINT_add.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EC_POINT_add.3 head/secure/lib/libcrypto/man/man3/EC_POINT_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EC_POINT_new.3 head/secure/lib/libcrypto/man/man3/ENGINE_add.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ENGINE_add.3 head/secure/lib/libcrypto/man/man3/ERR_GET_LIB.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ERR_GET_LIB.3 head/secure/lib/libcrypto/man/man3/ERR_clear_error.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ERR_clear_error.3 head/secure/lib/libcrypto/man/man3/ERR_error_string.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ERR_error_string.3 head/secure/lib/libcrypto/man/man3/ERR_get_error.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ERR_get_error.3 head/secure/lib/libcrypto/man/man3/ERR_load_crypto_strings.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 head/secure/lib/libcrypto/man/man3/ERR_load_strings.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ERR_load_strings.3 head/secure/lib/libcrypto/man/man3/ERR_print_errors.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ERR_print_errors.3 head/secure/lib/libcrypto/man/man3/ERR_put_error.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ERR_put_error.3 head/secure/lib/libcrypto/man/man3/ERR_remove_state.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ERR_remove_state.3 head/secure/lib/libcrypto/man/man3/ERR_set_mark.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/ERR_set_mark.3 head/secure/lib/libcrypto/man/man3/EVP_BytesToKey.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_BytesToKey.3 head/secure/lib/libcrypto/man/man3/EVP_CIPHER_CTX_get_cipher_data.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_CIPHER_CTX_get_cipher_data.3 head/secure/lib/libcrypto/man/man3/EVP_CIPHER_meth_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_CIPHER_meth_new.3 head/secure/lib/libcrypto/man/man3/EVP_DigestInit.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_DigestInit.3 head/secure/lib/libcrypto/man/man3/EVP_DigestSignInit.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_DigestSignInit.3 head/secure/lib/libcrypto/man/man3/EVP_DigestVerifyInit.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 head/secure/lib/libcrypto/man/man3/EVP_EncodeInit.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_EncodeInit.3 head/secure/lib/libcrypto/man/man3/EVP_EncryptInit.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_EncryptInit.3 head/secure/lib/libcrypto/man/man3/EVP_MD_meth_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_MD_meth_new.3 head/secure/lib/libcrypto/man/man3/EVP_OpenInit.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_OpenInit.3 head/secure/lib/libcrypto/man/man3/EVP_PKEY_ASN1_METHOD.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_PKEY_ASN1_METHOD.3 head/secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_ctrl.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 head/secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 head/secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_set1_pbe_pass.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set1_pbe_pass.3 head/secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_set_hkdf_md.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_hkdf_md.3 head/secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_set_rsa_pss_keygen_md.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_rsa_pss_keygen_md.3 head/secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_set_scrypt_N.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_scrypt_N.3 head/secure/lib/libcrypto/man/man3/EVP_PKEY_CTX_set_tls1_prf_md.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_tls1_prf_md.3 head/secure/lib/libcrypto/man/man3/EVP_PKEY_asn1_get_count.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_PKEY_asn1_get_count.3 head/secure/lib/libcrypto/man/man3/EVP_PKEY_cmp.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 head/secure/lib/libcrypto/man/man3/EVP_PKEY_decrypt.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 head/secure/lib/libcrypto/man/man3/EVP_PKEY_derive.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_PKEY_derive.3 head/secure/lib/libcrypto/man/man3/EVP_PKEY_encrypt.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 head/secure/lib/libcrypto/man/man3/EVP_PKEY_get_default_digest_nid.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest_nid.3 head/secure/lib/libcrypto/man/man3/EVP_PKEY_keygen.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 head/secure/lib/libcrypto/man/man3/EVP_PKEY_meth_get_count.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_PKEY_meth_get_count.3 head/secure/lib/libcrypto/man/man3/EVP_PKEY_meth_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_PKEY_meth_new.3 head/secure/lib/libcrypto/man/man3/EVP_PKEY_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_PKEY_new.3 head/secure/lib/libcrypto/man/man3/EVP_PKEY_print_private.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 head/secure/lib/libcrypto/man/man3/EVP_PKEY_set1_RSA.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 head/secure/lib/libcrypto/man/man3/EVP_PKEY_sign.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_PKEY_sign.3 head/secure/lib/libcrypto/man/man3/EVP_PKEY_verify.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_PKEY_verify.3 head/secure/lib/libcrypto/man/man3/EVP_PKEY_verify_recover.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 head/secure/lib/libcrypto/man/man3/EVP_SealInit.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_SealInit.3 head/secure/lib/libcrypto/man/man3/EVP_SignInit.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_SignInit.3 head/secure/lib/libcrypto/man/man3/EVP_VerifyInit.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_VerifyInit.3 head/secure/lib/libcrypto/man/man3/EVP_aes.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_aes.3 head/secure/lib/libcrypto/man/man3/EVP_aria.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_aria.3 head/secure/lib/libcrypto/man/man3/EVP_bf_cbc.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_bf_cbc.3 head/secure/lib/libcrypto/man/man3/EVP_blake2b512.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_blake2b512.3 head/secure/lib/libcrypto/man/man3/EVP_camellia.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_camellia.3 head/secure/lib/libcrypto/man/man3/EVP_cast5_cbc.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_cast5_cbc.3 head/secure/lib/libcrypto/man/man3/EVP_chacha20.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_chacha20.3 head/secure/lib/libcrypto/man/man3/EVP_des.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_des.3 head/secure/lib/libcrypto/man/man3/EVP_desx_cbc.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_desx_cbc.3 head/secure/lib/libcrypto/man/man3/EVP_idea_cbc.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_idea_cbc.3 head/secure/lib/libcrypto/man/man3/EVP_md2.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_md2.3 head/secure/lib/libcrypto/man/man3/EVP_md4.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_md4.3 head/secure/lib/libcrypto/man/man3/EVP_md5.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_md5.3 head/secure/lib/libcrypto/man/man3/EVP_mdc2.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_mdc2.3 head/secure/lib/libcrypto/man/man3/EVP_rc2_cbc.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_rc2_cbc.3 head/secure/lib/libcrypto/man/man3/EVP_rc4.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_rc4.3 head/secure/lib/libcrypto/man/man3/EVP_rc5_32_12_16_cbc.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_rc5_32_12_16_cbc.3 head/secure/lib/libcrypto/man/man3/EVP_ripemd160.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_ripemd160.3 head/secure/lib/libcrypto/man/man3/EVP_seed_cbc.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_seed_cbc.3 head/secure/lib/libcrypto/man/man3/EVP_sha1.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_sha1.3 head/secure/lib/libcrypto/man/man3/EVP_sha224.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_sha224.3 head/secure/lib/libcrypto/man/man3/EVP_sha3_224.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_sha3_224.3 head/secure/lib/libcrypto/man/man3/EVP_sm3.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_sm3.3 head/secure/lib/libcrypto/man/man3/EVP_sm4_cbc.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_sm4_cbc.3 head/secure/lib/libcrypto/man/man3/EVP_whirlpool.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/EVP_whirlpool.3 head/secure/lib/libcrypto/man/man3/HMAC.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/HMAC.3 head/secure/lib/libcrypto/man/man3/MD5.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/MD5.3 head/secure/lib/libcrypto/man/man3/MDC2_Init.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/MDC2_Init.3 head/secure/lib/libcrypto/man/man3/Makefile - copied unchanged from r356962, head/secure/lib/libcrypto/Makefile.man head/secure/lib/libcrypto/man/man3/OBJ_nid2obj.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OBJ_nid2obj.3 head/secure/lib/libcrypto/man/man3/OCSP_REQUEST_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OCSP_REQUEST_new.3 head/secure/lib/libcrypto/man/man3/OCSP_cert_to_id.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OCSP_cert_to_id.3 head/secure/lib/libcrypto/man/man3/OCSP_request_add1_nonce.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OCSP_request_add1_nonce.3 head/secure/lib/libcrypto/man/man3/OCSP_resp_find_status.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OCSP_resp_find_status.3 head/secure/lib/libcrypto/man/man3/OCSP_response_status.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OCSP_response_status.3 head/secure/lib/libcrypto/man/man3/OCSP_sendreq_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OCSP_sendreq_new.3 head/secure/lib/libcrypto/man/man3/OPENSSL_Applink.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OPENSSL_Applink.3 head/secure/lib/libcrypto/man/man3/OPENSSL_LH_COMPFUNC.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OPENSSL_LH_COMPFUNC.3 head/secure/lib/libcrypto/man/man3/OPENSSL_LH_stats.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OPENSSL_LH_stats.3 head/secure/lib/libcrypto/man/man3/OPENSSL_VERSION_NUMBER.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 head/secure/lib/libcrypto/man/man3/OPENSSL_config.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OPENSSL_config.3 head/secure/lib/libcrypto/man/man3/OPENSSL_fork_prepare.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OPENSSL_fork_prepare.3 head/secure/lib/libcrypto/man/man3/OPENSSL_ia32cap.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 head/secure/lib/libcrypto/man/man3/OPENSSL_init_crypto.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OPENSSL_init_crypto.3 head/secure/lib/libcrypto/man/man3/OPENSSL_init_ssl.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OPENSSL_init_ssl.3 head/secure/lib/libcrypto/man/man3/OPENSSL_instrument_bus.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3 head/secure/lib/libcrypto/man/man3/OPENSSL_load_builtin_modules.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 head/secure/lib/libcrypto/man/man3/OPENSSL_malloc.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OPENSSL_malloc.3 head/secure/lib/libcrypto/man/man3/OPENSSL_secure_malloc.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OPENSSL_secure_malloc.3 head/secure/lib/libcrypto/man/man3/OSSL_STORE_INFO.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OSSL_STORE_INFO.3 head/secure/lib/libcrypto/man/man3/OSSL_STORE_LOADER.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OSSL_STORE_LOADER.3 head/secure/lib/libcrypto/man/man3/OSSL_STORE_SEARCH.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OSSL_STORE_SEARCH.3 head/secure/lib/libcrypto/man/man3/OSSL_STORE_expect.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OSSL_STORE_expect.3 head/secure/lib/libcrypto/man/man3/OSSL_STORE_open.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OSSL_STORE_open.3 head/secure/lib/libcrypto/man/man3/OpenSSL_add_all_algorithms.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 head/secure/lib/libcrypto/man/man3/PEM_bytes_read_bio.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/PEM_bytes_read_bio.3 head/secure/lib/libcrypto/man/man3/PEM_read.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/PEM_read.3 head/secure/lib/libcrypto/man/man3/PEM_read_CMS.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/PEM_read_CMS.3 head/secure/lib/libcrypto/man/man3/PEM_read_bio_PrivateKey.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/PEM_read_bio_PrivateKey.3 head/secure/lib/libcrypto/man/man3/PEM_read_bio_ex.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/PEM_read_bio_ex.3 head/secure/lib/libcrypto/man/man3/PEM_write_bio_CMS_stream.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 head/secure/lib/libcrypto/man/man3/PEM_write_bio_PKCS7_stream.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 head/secure/lib/libcrypto/man/man3/PKCS12_create.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/PKCS12_create.3 head/secure/lib/libcrypto/man/man3/PKCS12_newpass.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/PKCS12_newpass.3 head/secure/lib/libcrypto/man/man3/PKCS12_parse.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/PKCS12_parse.3 head/secure/lib/libcrypto/man/man3/PKCS5_PBKDF2_HMAC.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/PKCS5_PBKDF2_HMAC.3 head/secure/lib/libcrypto/man/man3/PKCS7_decrypt.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/PKCS7_decrypt.3 head/secure/lib/libcrypto/man/man3/PKCS7_encrypt.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/PKCS7_encrypt.3 head/secure/lib/libcrypto/man/man3/PKCS7_sign.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/PKCS7_sign.3 head/secure/lib/libcrypto/man/man3/PKCS7_sign_add_signer.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 head/secure/lib/libcrypto/man/man3/PKCS7_verify.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/PKCS7_verify.3 head/secure/lib/libcrypto/man/man3/RAND_DRBG_generate.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RAND_DRBG_generate.3 head/secure/lib/libcrypto/man/man3/RAND_DRBG_get0_master.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RAND_DRBG_get0_master.3 head/secure/lib/libcrypto/man/man3/RAND_DRBG_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RAND_DRBG_new.3 head/secure/lib/libcrypto/man/man3/RAND_DRBG_reseed.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RAND_DRBG_reseed.3 head/secure/lib/libcrypto/man/man3/RAND_DRBG_set_callbacks.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RAND_DRBG_set_callbacks.3 head/secure/lib/libcrypto/man/man3/RAND_DRBG_set_ex_data.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RAND_DRBG_set_ex_data.3 head/secure/lib/libcrypto/man/man3/RAND_add.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RAND_add.3 head/secure/lib/libcrypto/man/man3/RAND_bytes.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RAND_bytes.3 head/secure/lib/libcrypto/man/man3/RAND_cleanup.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RAND_cleanup.3 head/secure/lib/libcrypto/man/man3/RAND_egd.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RAND_egd.3 head/secure/lib/libcrypto/man/man3/RAND_load_file.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RAND_load_file.3 head/secure/lib/libcrypto/man/man3/RAND_set_rand_method.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RAND_set_rand_method.3 head/secure/lib/libcrypto/man/man3/RC4_set_key.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RC4_set_key.3 head/secure/lib/libcrypto/man/man3/RIPEMD160_Init.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RIPEMD160_Init.3 head/secure/lib/libcrypto/man/man3/RSA_blinding_on.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RSA_blinding_on.3 head/secure/lib/libcrypto/man/man3/RSA_check_key.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RSA_check_key.3 head/secure/lib/libcrypto/man/man3/RSA_generate_key.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RSA_generate_key.3 head/secure/lib/libcrypto/man/man3/RSA_get0_key.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RSA_get0_key.3 head/secure/lib/libcrypto/man/man3/RSA_meth_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RSA_meth_new.3 head/secure/lib/libcrypto/man/man3/RSA_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RSA_new.3 head/secure/lib/libcrypto/man/man3/RSA_padding_add_PKCS1_type_1.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 head/secure/lib/libcrypto/man/man3/RSA_print.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RSA_print.3 head/secure/lib/libcrypto/man/man3/RSA_private_encrypt.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RSA_private_encrypt.3 head/secure/lib/libcrypto/man/man3/RSA_public_encrypt.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RSA_public_encrypt.3 head/secure/lib/libcrypto/man/man3/RSA_set_method.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RSA_set_method.3 head/secure/lib/libcrypto/man/man3/RSA_sign.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RSA_sign.3 head/secure/lib/libcrypto/man/man3/RSA_sign_ASN1_OCTET_STRING.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 head/secure/lib/libcrypto/man/man3/RSA_size.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/RSA_size.3 head/secure/lib/libcrypto/man/man3/SCT_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SCT_new.3 head/secure/lib/libcrypto/man/man3/SCT_print.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SCT_print.3 head/secure/lib/libcrypto/man/man3/SCT_validate.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SCT_validate.3 head/secure/lib/libcrypto/man/man3/SHA256_Init.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SHA256_Init.3 head/secure/lib/libcrypto/man/man3/SMIME_read_CMS.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SMIME_read_CMS.3 head/secure/lib/libcrypto/man/man3/SMIME_read_PKCS7.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 head/secure/lib/libcrypto/man/man3/SMIME_write_CMS.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SMIME_write_CMS.3 head/secure/lib/libcrypto/man/man3/SMIME_write_PKCS7.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 head/secure/lib/libcrypto/man/man3/SSL_CIPHER_get_name.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CIPHER_get_name.3 head/secure/lib/libcrypto/man/man3/SSL_COMP_add_compression_method.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_COMP_add_compression_method.3 head/secure/lib/libcrypto/man/man3/SSL_CONF_CTX_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CONF_CTX_new.3 head/secure/lib/libcrypto/man/man3/SSL_CONF_CTX_set1_prefix.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CONF_CTX_set1_prefix.3 head/secure/lib/libcrypto/man/man3/SSL_CONF_CTX_set_flags.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CONF_CTX_set_flags.3 head/secure/lib/libcrypto/man/man3/SSL_CONF_CTX_set_ssl_ctx.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CONF_CTX_set_ssl_ctx.3 head/secure/lib/libcrypto/man/man3/SSL_CONF_cmd.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CONF_cmd.3 head/secure/lib/libcrypto/man/man3/SSL_CONF_cmd_argv.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CONF_cmd_argv.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_add1_chain_cert.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_add1_chain_cert.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_add_extra_chain_cert.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_add_extra_chain_cert.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_add_session.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_add_session.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_config.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_config.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_ctrl.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_ctrl.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_dane_enable.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_dane_enable.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_flush_sessions.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_flush_sessions.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_free.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_free.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_get0_param.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_get0_param.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_get_verify_mode.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_get_verify_mode.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_has_client_custom_ext.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_has_client_custom_ext.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_load_verify_locations.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_load_verify_locations.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_new.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_sess_number.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_sess_number.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_sess_set_cache_size.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_sess_set_cache_size.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_sess_set_get_cb.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_sess_set_get_cb.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_sessions.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_sessions.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set0_CA_list.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set0_CA_list.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set1_curves.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set1_curves.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set1_sigalgs.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set1_sigalgs.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set1_verify_cert_store.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set1_verify_cert_store.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_alpn_select_cb.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_alpn_select_cb.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_cert_cb.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_cert_cb.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_cert_store.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_cert_store.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_cert_verify_callback.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_cert_verify_callback.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_cipher_list.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_cipher_list.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_client_cert_cb.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_client_cert_cb.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_client_hello_cb.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_client_hello_cb.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_ct_validation_callback.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_ct_validation_callback.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_ctlog_list_file.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_ctlog_list_file.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_default_passwd_cb.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_default_passwd_cb.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_ex_data.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_ex_data.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_generate_session_id.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_generate_session_id.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_info_callback.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_info_callback.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_keylog_callback.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_keylog_callback.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_max_cert_list.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_max_cert_list.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_min_proto_version.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_min_proto_version.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_mode.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_mode.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_msg_callback.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_msg_callback.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_num_tickets.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_num_tickets.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_options.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_options.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_psk_client_callback.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_psk_client_callback.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_quiet_shutdown.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_quiet_shutdown.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_read_ahead.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_read_ahead.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_record_padding_callback.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_record_padding_callback.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_security_level.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_security_level.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_session_cache_mode.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_session_cache_mode.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_session_id_context.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_session_id_context.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_session_ticket_cb.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_session_ticket_cb.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_split_send_fragment.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_split_send_fragment.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_ssl_version.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_ssl_version.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_stateless_cookie_generate_cb.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_stateless_cookie_generate_cb.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_timeout.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_timeout.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_tlsext_servername_callback.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_servername_callback.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_tlsext_status_cb.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_status_cb.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_tlsext_ticket_key_cb.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_ticket_key_cb.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_tlsext_use_srtp.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_use_srtp.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_tmp_dh_callback.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_tmp_dh_callback.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_set_verify.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_set_verify.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_use_certificate.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_use_certificate.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_use_psk_identity_hint.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_use_psk_identity_hint.3 head/secure/lib/libcrypto/man/man3/SSL_CTX_use_serverinfo.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_CTX_use_serverinfo.3 head/secure/lib/libcrypto/man/man3/SSL_SESSION_free.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_SESSION_free.3 head/secure/lib/libcrypto/man/man3/SSL_SESSION_get0_cipher.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_SESSION_get0_cipher.3 head/secure/lib/libcrypto/man/man3/SSL_SESSION_get0_hostname.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_SESSION_get0_hostname.3 head/secure/lib/libcrypto/man/man3/SSL_SESSION_get0_id_context.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_SESSION_get0_id_context.3 head/secure/lib/libcrypto/man/man3/SSL_SESSION_get0_peer.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_SESSION_get0_peer.3 head/secure/lib/libcrypto/man/man3/SSL_SESSION_get_compress_id.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_SESSION_get_compress_id.3 head/secure/lib/libcrypto/man/man3/SSL_SESSION_get_ex_data.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_SESSION_get_ex_data.3 head/secure/lib/libcrypto/man/man3/SSL_SESSION_get_protocol_version.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_SESSION_get_protocol_version.3 head/secure/lib/libcrypto/man/man3/SSL_SESSION_get_time.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_SESSION_get_time.3 head/secure/lib/libcrypto/man/man3/SSL_SESSION_has_ticket.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_SESSION_has_ticket.3 head/secure/lib/libcrypto/man/man3/SSL_SESSION_is_resumable.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_SESSION_is_resumable.3 head/secure/lib/libcrypto/man/man3/SSL_SESSION_print.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_SESSION_print.3 head/secure/lib/libcrypto/man/man3/SSL_SESSION_set1_id.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_SESSION_set1_id.3 head/secure/lib/libcrypto/man/man3/SSL_accept.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_accept.3 head/secure/lib/libcrypto/man/man3/SSL_alert_type_string.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_alert_type_string.3 head/secure/lib/libcrypto/man/man3/SSL_alloc_buffers.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_alloc_buffers.3 head/secure/lib/libcrypto/man/man3/SSL_check_chain.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_check_chain.3 head/secure/lib/libcrypto/man/man3/SSL_clear.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_clear.3 head/secure/lib/libcrypto/man/man3/SSL_connect.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_connect.3 head/secure/lib/libcrypto/man/man3/SSL_do_handshake.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_do_handshake.3 head/secure/lib/libcrypto/man/man3/SSL_export_keying_material.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_export_keying_material.3 head/secure/lib/libcrypto/man/man3/SSL_extension_supported.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_extension_supported.3 head/secure/lib/libcrypto/man/man3/SSL_free.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_free.3 head/secure/lib/libcrypto/man/man3/SSL_get0_peer_scts.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_get0_peer_scts.3 head/secure/lib/libcrypto/man/man3/SSL_get_SSL_CTX.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_get_SSL_CTX.3 head/secure/lib/libcrypto/man/man3/SSL_get_all_async_fds.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_get_all_async_fds.3 head/secure/lib/libcrypto/man/man3/SSL_get_ciphers.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_get_ciphers.3 head/secure/lib/libcrypto/man/man3/SSL_get_client_random.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_get_client_random.3 head/secure/lib/libcrypto/man/man3/SSL_get_current_cipher.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_get_current_cipher.3 head/secure/lib/libcrypto/man/man3/SSL_get_default_timeout.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_get_default_timeout.3 head/secure/lib/libcrypto/man/man3/SSL_get_error.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_get_error.3 head/secure/lib/libcrypto/man/man3/SSL_get_extms_support.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_get_extms_support.3 head/secure/lib/libcrypto/man/man3/SSL_get_fd.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_get_fd.3 head/secure/lib/libcrypto/man/man3/SSL_get_peer_cert_chain.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_get_peer_cert_chain.3 head/secure/lib/libcrypto/man/man3/SSL_get_peer_certificate.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_get_peer_certificate.3 head/secure/lib/libcrypto/man/man3/SSL_get_peer_signature_nid.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_get_peer_signature_nid.3 head/secure/lib/libcrypto/man/man3/SSL_get_peer_tmp_key.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_get_peer_tmp_key.3 head/secure/lib/libcrypto/man/man3/SSL_get_psk_identity.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_get_psk_identity.3 head/secure/lib/libcrypto/man/man3/SSL_get_rbio.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_get_rbio.3 head/secure/lib/libcrypto/man/man3/SSL_get_session.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_get_session.3 head/secure/lib/libcrypto/man/man3/SSL_get_shared_sigalgs.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_get_shared_sigalgs.3 head/secure/lib/libcrypto/man/man3/SSL_get_verify_result.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_get_verify_result.3 head/secure/lib/libcrypto/man/man3/SSL_get_version.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_get_version.3 head/secure/lib/libcrypto/man/man3/SSL_in_init.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_in_init.3 head/secure/lib/libcrypto/man/man3/SSL_key_update.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_key_update.3 head/secure/lib/libcrypto/man/man3/SSL_library_init.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_library_init.3 head/secure/lib/libcrypto/man/man3/SSL_load_client_CA_file.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_load_client_CA_file.3 head/secure/lib/libcrypto/man/man3/SSL_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_new.3 head/secure/lib/libcrypto/man/man3/SSL_pending.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_pending.3 head/secure/lib/libcrypto/man/man3/SSL_read.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_read.3 head/secure/lib/libcrypto/man/man3/SSL_read_early_data.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_read_early_data.3 head/secure/lib/libcrypto/man/man3/SSL_rstate_string.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_rstate_string.3 head/secure/lib/libcrypto/man/man3/SSL_session_reused.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_session_reused.3 head/secure/lib/libcrypto/man/man3/SSL_set1_host.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_set1_host.3 head/secure/lib/libcrypto/man/man3/SSL_set_bio.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_set_bio.3 head/secure/lib/libcrypto/man/man3/SSL_set_connect_state.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_set_connect_state.3 head/secure/lib/libcrypto/man/man3/SSL_set_fd.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_set_fd.3 head/secure/lib/libcrypto/man/man3/SSL_set_session.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_set_session.3 head/secure/lib/libcrypto/man/man3/SSL_set_shutdown.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_set_shutdown.3 head/secure/lib/libcrypto/man/man3/SSL_set_verify_result.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_set_verify_result.3 head/secure/lib/libcrypto/man/man3/SSL_shutdown.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_shutdown.3 head/secure/lib/libcrypto/man/man3/SSL_state_string.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_state_string.3 head/secure/lib/libcrypto/man/man3/SSL_want.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_want.3 head/secure/lib/libcrypto/man/man3/SSL_write.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/SSL_write.3 head/secure/lib/libcrypto/man/man3/UI_STRING.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/UI_STRING.3 head/secure/lib/libcrypto/man/man3/UI_UTIL_read_pw.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/UI_UTIL_read_pw.3 head/secure/lib/libcrypto/man/man3/UI_create_method.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/UI_create_method.3 head/secure/lib/libcrypto/man/man3/UI_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/UI_new.3 head/secure/lib/libcrypto/man/man3/X509V3_get_d2i.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509V3_get_d2i.3 head/secure/lib/libcrypto/man/man3/X509_ALGOR_dup.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_ALGOR_dup.3 head/secure/lib/libcrypto/man/man3/X509_CRL_get0_by_serial.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_CRL_get0_by_serial.3 head/secure/lib/libcrypto/man/man3/X509_EXTENSION_set_object.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_EXTENSION_set_object.3 head/secure/lib/libcrypto/man/man3/X509_LOOKUP_hash_dir.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_LOOKUP_hash_dir.3 head/secure/lib/libcrypto/man/man3/X509_LOOKUP_meth_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_LOOKUP_meth_new.3 head/secure/lib/libcrypto/man/man3/X509_NAME_ENTRY_get_object.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 head/secure/lib/libcrypto/man/man3/X509_NAME_add_entry_by_txt.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 head/secure/lib/libcrypto/man/man3/X509_NAME_get0_der.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_NAME_get0_der.3 head/secure/lib/libcrypto/man/man3/X509_NAME_get_index_by_NID.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 head/secure/lib/libcrypto/man/man3/X509_NAME_print_ex.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_NAME_print_ex.3 head/secure/lib/libcrypto/man/man3/X509_PUBKEY_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_PUBKEY_new.3 head/secure/lib/libcrypto/man/man3/X509_SIG_get0.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_SIG_get0.3 head/secure/lib/libcrypto/man/man3/X509_STORE_CTX_get_error.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 head/secure/lib/libcrypto/man/man3/X509_STORE_CTX_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 head/secure/lib/libcrypto/man/man3/X509_STORE_CTX_set_verify_cb.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 head/secure/lib/libcrypto/man/man3/X509_STORE_add_cert.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_STORE_add_cert.3 head/secure/lib/libcrypto/man/man3/X509_STORE_get0_param.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_STORE_get0_param.3 head/secure/lib/libcrypto/man/man3/X509_STORE_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_STORE_new.3 head/secure/lib/libcrypto/man/man3/X509_STORE_set_verify_cb_func.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 head/secure/lib/libcrypto/man/man3/X509_VERIFY_PARAM_set_flags.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 head/secure/lib/libcrypto/man/man3/X509_check_ca.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_check_ca.3 head/secure/lib/libcrypto/man/man3/X509_check_host.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_check_host.3 head/secure/lib/libcrypto/man/man3/X509_check_issued.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_check_issued.3 head/secure/lib/libcrypto/man/man3/X509_check_private_key.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_check_private_key.3 head/secure/lib/libcrypto/man/man3/X509_cmp.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_cmp.3 head/secure/lib/libcrypto/man/man3/X509_cmp_time.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_cmp_time.3 head/secure/lib/libcrypto/man/man3/X509_digest.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_digest.3 head/secure/lib/libcrypto/man/man3/X509_dup.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_dup.3 head/secure/lib/libcrypto/man/man3/X509_get0_notBefore.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_get0_notBefore.3 head/secure/lib/libcrypto/man/man3/X509_get0_signature.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_get0_signature.3 head/secure/lib/libcrypto/man/man3/X509_get0_uids.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_get0_uids.3 head/secure/lib/libcrypto/man/man3/X509_get_extension_flags.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_get_extension_flags.3 head/secure/lib/libcrypto/man/man3/X509_get_pubkey.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_get_pubkey.3 head/secure/lib/libcrypto/man/man3/X509_get_serialNumber.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_get_serialNumber.3 head/secure/lib/libcrypto/man/man3/X509_get_subject_name.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_get_subject_name.3 head/secure/lib/libcrypto/man/man3/X509_get_version.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_get_version.3 head/secure/lib/libcrypto/man/man3/X509_new.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_new.3 head/secure/lib/libcrypto/man/man3/X509_sign.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_sign.3 head/secure/lib/libcrypto/man/man3/X509_verify_cert.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509_verify_cert.3 head/secure/lib/libcrypto/man/man3/X509v3_get_ext_by_NID.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/X509v3_get_ext_by_NID.3 head/secure/lib/libcrypto/man/man3/d2i_DHparams.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/d2i_DHparams.3 head/secure/lib/libcrypto/man/man3/d2i_PKCS8PrivateKey_bio.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey_bio.3 head/secure/lib/libcrypto/man/man3/d2i_PrivateKey.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/d2i_PrivateKey.3 head/secure/lib/libcrypto/man/man3/d2i_SSL_SESSION.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/d2i_SSL_SESSION.3 head/secure/lib/libcrypto/man/man3/d2i_X509.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/d2i_X509.3 head/secure/lib/libcrypto/man/man3/i2d_CMS_bio_stream.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 head/secure/lib/libcrypto/man/man3/i2d_PKCS7_bio_stream.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 head/secure/lib/libcrypto/man/man3/i2d_re_X509_tbs.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/i2d_re_X509_tbs.3 head/secure/lib/libcrypto/man/man3/o2i_SCT_LIST.3 - copied unchanged from r356962, head/secure/lib/libcrypto/man/o2i_SCT_LIST.3 head/secure/lib/libcrypto/man/man5/ head/secure/lib/libcrypto/man/man5/Makefile (contents, props changed) head/secure/lib/libcrypto/man/man5/x509v3_config.5 (contents, props changed) head/secure/lib/libcrypto/man/man7/ head/secure/lib/libcrypto/man/man7/Ed25519.7 (contents, props changed) head/secure/lib/libcrypto/man/man7/Makefile (contents, props changed) head/secure/lib/libcrypto/man/man7/RAND.7 (contents, props changed) head/secure/lib/libcrypto/man/man7/RAND_DRBG.7 (contents, props changed) head/secure/lib/libcrypto/man/man7/RSA-PSS.7 (contents, props changed) head/secure/lib/libcrypto/man/man7/SM2.7 (contents, props changed) head/secure/lib/libcrypto/man/man7/X25519.7 (contents, props changed) head/secure/lib/libcrypto/man/man7/bio.7 (contents, props changed) head/secure/lib/libcrypto/man/man7/ct.7 (contents, props changed) head/secure/lib/libcrypto/man/man7/des_modes.7 (contents, props changed) head/secure/lib/libcrypto/man/man7/evp.7 (contents, props changed) head/secure/lib/libcrypto/man/man7/ossl_store-file.7 (contents, props changed) head/secure/lib/libcrypto/man/man7/ossl_store.7 (contents, props changed) head/secure/lib/libcrypto/man/man7/passphrase-encoding.7 (contents, props changed) head/secure/lib/libcrypto/man/man7/scrypt.7 (contents, props changed) head/secure/lib/libcrypto/man/man7/ssl.7 (contents, props changed) head/secure/lib/libcrypto/man/man7/x509.7 (contents, props changed) Replaced: head/secure/lib/libcrypto/Makefile.man (contents, props changed) Deleted: head/secure/lib/libcrypto/man/ADMISSIONS.3 head/secure/lib/libcrypto/man/ASN1_INTEGER_get_int64.3 head/secure/lib/libcrypto/man/ASN1_ITEM_lookup.3 head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_TABLE_add.3 head/secure/lib/libcrypto/man/ASN1_STRING_length.3 head/secure/lib/libcrypto/man/ASN1_STRING_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 head/secure/lib/libcrypto/man/ASN1_TIME_set.3 head/secure/lib/libcrypto/man/ASN1_TYPE_get.3 head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 head/secure/lib/libcrypto/man/ASYNC_WAIT_CTX_new.3 head/secure/lib/libcrypto/man/ASYNC_start_job.3 head/secure/lib/libcrypto/man/BF_encrypt.3 head/secure/lib/libcrypto/man/BIO_ADDR.3 head/secure/lib/libcrypto/man/BIO_ADDRINFO.3 head/secure/lib/libcrypto/man/BIO_connect.3 head/secure/lib/libcrypto/man/BIO_ctrl.3 head/secure/lib/libcrypto/man/BIO_f_base64.3 head/secure/lib/libcrypto/man/BIO_f_buffer.3 head/secure/lib/libcrypto/man/BIO_f_cipher.3 head/secure/lib/libcrypto/man/BIO_f_md.3 head/secure/lib/libcrypto/man/BIO_f_null.3 head/secure/lib/libcrypto/man/BIO_f_ssl.3 head/secure/lib/libcrypto/man/BIO_find_type.3 head/secure/lib/libcrypto/man/BIO_get_data.3 head/secure/lib/libcrypto/man/BIO_get_ex_new_index.3 head/secure/lib/libcrypto/man/BIO_meth_new.3 head/secure/lib/libcrypto/man/BIO_new.3 head/secure/lib/libcrypto/man/BIO_new_CMS.3 head/secure/lib/libcrypto/man/BIO_parse_hostserv.3 head/secure/lib/libcrypto/man/BIO_printf.3 head/secure/lib/libcrypto/man/BIO_push.3 head/secure/lib/libcrypto/man/BIO_read.3 head/secure/lib/libcrypto/man/BIO_s_accept.3 head/secure/lib/libcrypto/man/BIO_s_bio.3 head/secure/lib/libcrypto/man/BIO_s_connect.3 head/secure/lib/libcrypto/man/BIO_s_fd.3 head/secure/lib/libcrypto/man/BIO_s_file.3 head/secure/lib/libcrypto/man/BIO_s_mem.3 head/secure/lib/libcrypto/man/BIO_s_null.3 head/secure/lib/libcrypto/man/BIO_s_socket.3 head/secure/lib/libcrypto/man/BIO_set_callback.3 head/secure/lib/libcrypto/man/BIO_should_retry.3 head/secure/lib/libcrypto/man/BN_BLINDING_new.3 head/secure/lib/libcrypto/man/BN_CTX_new.3 head/secure/lib/libcrypto/man/BN_CTX_start.3 head/secure/lib/libcrypto/man/BN_add.3 head/secure/lib/libcrypto/man/BN_add_word.3 head/secure/lib/libcrypto/man/BN_bn2bin.3 head/secure/lib/libcrypto/man/BN_cmp.3 head/secure/lib/libcrypto/man/BN_copy.3 head/secure/lib/libcrypto/man/BN_generate_prime.3 head/secure/lib/libcrypto/man/BN_mod_inverse.3 head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 head/secure/lib/libcrypto/man/BN_new.3 head/secure/lib/libcrypto/man/BN_num_bytes.3 head/secure/lib/libcrypto/man/BN_rand.3 head/secure/lib/libcrypto/man/BN_security_bits.3 head/secure/lib/libcrypto/man/BN_set_bit.3 head/secure/lib/libcrypto/man/BN_swap.3 head/secure/lib/libcrypto/man/BN_zero.3 head/secure/lib/libcrypto/man/BUF_MEM_new.3 head/secure/lib/libcrypto/man/CMS_add0_cert.3 head/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 head/secure/lib/libcrypto/man/CMS_add1_signer.3 head/secure/lib/libcrypto/man/CMS_compress.3 head/secure/lib/libcrypto/man/CMS_decrypt.3 head/secure/lib/libcrypto/man/CMS_encrypt.3 head/secure/lib/libcrypto/man/CMS_final.3 head/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 head/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 head/secure/lib/libcrypto/man/CMS_get0_type.3 head/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 head/secure/lib/libcrypto/man/CMS_sign.3 head/secure/lib/libcrypto/man/CMS_sign_receipt.3 head/secure/lib/libcrypto/man/CMS_uncompress.3 head/secure/lib/libcrypto/man/CMS_verify.3 head/secure/lib/libcrypto/man/CMS_verify_receipt.3 head/secure/lib/libcrypto/man/CONF_modules_free.3 head/secure/lib/libcrypto/man/CONF_modules_load_file.3 head/secure/lib/libcrypto/man/CRYPTO_THREAD_run_once.3 head/secure/lib/libcrypto/man/CRYPTO_get_ex_new_index.3 head/secure/lib/libcrypto/man/CRYPTO_memcmp.3 head/secure/lib/libcrypto/man/CTLOG_STORE_get0_log_by_id.3 head/secure/lib/libcrypto/man/CTLOG_STORE_new.3 head/secure/lib/libcrypto/man/CTLOG_new.3 head/secure/lib/libcrypto/man/CT_POLICY_EVAL_CTX_new.3 head/secure/lib/libcrypto/man/DEFINE_STACK_OF.3 head/secure/lib/libcrypto/man/DES_random_key.3 head/secure/lib/libcrypto/man/DH_generate_key.3 head/secure/lib/libcrypto/man/DH_generate_parameters.3 head/secure/lib/libcrypto/man/DH_get0_pqg.3 head/secure/lib/libcrypto/man/DH_get_1024_160.3 head/secure/lib/libcrypto/man/DH_meth_new.3 head/secure/lib/libcrypto/man/DH_new.3 head/secure/lib/libcrypto/man/DH_new_by_nid.3 head/secure/lib/libcrypto/man/DH_set_method.3 head/secure/lib/libcrypto/man/DH_size.3 head/secure/lib/libcrypto/man/DSA_SIG_new.3 head/secure/lib/libcrypto/man/DSA_do_sign.3 head/secure/lib/libcrypto/man/DSA_dup_DH.3 head/secure/lib/libcrypto/man/DSA_generate_key.3 head/secure/lib/libcrypto/man/DSA_generate_parameters.3 head/secure/lib/libcrypto/man/DSA_get0_pqg.3 head/secure/lib/libcrypto/man/DSA_meth_new.3 head/secure/lib/libcrypto/man/DSA_new.3 head/secure/lib/libcrypto/man/DSA_set_method.3 head/secure/lib/libcrypto/man/DSA_sign.3 head/secure/lib/libcrypto/man/DSA_size.3 head/secure/lib/libcrypto/man/DTLS_get_data_mtu.3 head/secure/lib/libcrypto/man/DTLS_set_timer_cb.3 head/secure/lib/libcrypto/man/DTLSv1_listen.3 head/secure/lib/libcrypto/man/ECDSA_SIG_new.3 head/secure/lib/libcrypto/man/ECPKParameters_print.3 head/secure/lib/libcrypto/man/EC_GFp_simple_method.3 head/secure/lib/libcrypto/man/EC_GROUP_copy.3 head/secure/lib/libcrypto/man/EC_GROUP_new.3 head/secure/lib/libcrypto/man/EC_KEY_get_enc_flags.3 head/secure/lib/libcrypto/man/EC_KEY_new.3 head/secure/lib/libcrypto/man/EC_POINT_add.3 head/secure/lib/libcrypto/man/EC_POINT_new.3 head/secure/lib/libcrypto/man/ENGINE_add.3 head/secure/lib/libcrypto/man/ERR_GET_LIB.3 head/secure/lib/libcrypto/man/ERR_clear_error.3 head/secure/lib/libcrypto/man/ERR_error_string.3 head/secure/lib/libcrypto/man/ERR_get_error.3 head/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 head/secure/lib/libcrypto/man/ERR_load_strings.3 head/secure/lib/libcrypto/man/ERR_print_errors.3 head/secure/lib/libcrypto/man/ERR_put_error.3 head/secure/lib/libcrypto/man/ERR_remove_state.3 head/secure/lib/libcrypto/man/ERR_set_mark.3 head/secure/lib/libcrypto/man/EVP_BytesToKey.3 head/secure/lib/libcrypto/man/EVP_CIPHER_CTX_get_cipher_data.3 head/secure/lib/libcrypto/man/EVP_CIPHER_meth_new.3 head/secure/lib/libcrypto/man/EVP_DigestInit.3 head/secure/lib/libcrypto/man/EVP_DigestSignInit.3 head/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 head/secure/lib/libcrypto/man/EVP_EncodeInit.3 head/secure/lib/libcrypto/man/EVP_EncryptInit.3 head/secure/lib/libcrypto/man/EVP_MD_meth_new.3 head/secure/lib/libcrypto/man/EVP_OpenInit.3 head/secure/lib/libcrypto/man/EVP_PKEY_ASN1_METHOD.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set1_pbe_pass.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_hkdf_md.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_rsa_pss_keygen_md.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_scrypt_N.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_tls1_prf_md.3 head/secure/lib/libcrypto/man/EVP_PKEY_asn1_get_count.3 head/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 head/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_derive.3 head/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest_nid.3 head/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 head/secure/lib/libcrypto/man/EVP_PKEY_meth_get_count.3 head/secure/lib/libcrypto/man/EVP_PKEY_meth_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 head/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 head/secure/lib/libcrypto/man/EVP_PKEY_sign.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 head/secure/lib/libcrypto/man/EVP_SealInit.3 head/secure/lib/libcrypto/man/EVP_SignInit.3 head/secure/lib/libcrypto/man/EVP_VerifyInit.3 head/secure/lib/libcrypto/man/EVP_aes.3 head/secure/lib/libcrypto/man/EVP_aria.3 head/secure/lib/libcrypto/man/EVP_bf_cbc.3 head/secure/lib/libcrypto/man/EVP_blake2b512.3 head/secure/lib/libcrypto/man/EVP_camellia.3 head/secure/lib/libcrypto/man/EVP_cast5_cbc.3 head/secure/lib/libcrypto/man/EVP_chacha20.3 head/secure/lib/libcrypto/man/EVP_des.3 head/secure/lib/libcrypto/man/EVP_desx_cbc.3 head/secure/lib/libcrypto/man/EVP_idea_cbc.3 head/secure/lib/libcrypto/man/EVP_md2.3 head/secure/lib/libcrypto/man/EVP_md4.3 head/secure/lib/libcrypto/man/EVP_md5.3 head/secure/lib/libcrypto/man/EVP_mdc2.3 head/secure/lib/libcrypto/man/EVP_rc2_cbc.3 head/secure/lib/libcrypto/man/EVP_rc4.3 head/secure/lib/libcrypto/man/EVP_rc5_32_12_16_cbc.3 head/secure/lib/libcrypto/man/EVP_ripemd160.3 head/secure/lib/libcrypto/man/EVP_seed_cbc.3 head/secure/lib/libcrypto/man/EVP_sha1.3 head/secure/lib/libcrypto/man/EVP_sha224.3 head/secure/lib/libcrypto/man/EVP_sha3_224.3 head/secure/lib/libcrypto/man/EVP_sm3.3 head/secure/lib/libcrypto/man/EVP_sm4_cbc.3 head/secure/lib/libcrypto/man/EVP_whirlpool.3 head/secure/lib/libcrypto/man/HMAC.3 head/secure/lib/libcrypto/man/MD5.3 head/secure/lib/libcrypto/man/MDC2_Init.3 head/secure/lib/libcrypto/man/OBJ_nid2obj.3 head/secure/lib/libcrypto/man/OCSP_REQUEST_new.3 head/secure/lib/libcrypto/man/OCSP_cert_to_id.3 head/secure/lib/libcrypto/man/OCSP_request_add1_nonce.3 head/secure/lib/libcrypto/man/OCSP_resp_find_status.3 head/secure/lib/libcrypto/man/OCSP_response_status.3 head/secure/lib/libcrypto/man/OCSP_sendreq_new.3 head/secure/lib/libcrypto/man/OPENSSL_Applink.3 head/secure/lib/libcrypto/man/OPENSSL_LH_COMPFUNC.3 head/secure/lib/libcrypto/man/OPENSSL_LH_stats.3 head/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 head/secure/lib/libcrypto/man/OPENSSL_config.3 head/secure/lib/libcrypto/man/OPENSSL_fork_prepare.3 head/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 head/secure/lib/libcrypto/man/OPENSSL_init_crypto.3 head/secure/lib/libcrypto/man/OPENSSL_init_ssl.3 head/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3 head/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 head/secure/lib/libcrypto/man/OPENSSL_malloc.3 head/secure/lib/libcrypto/man/OPENSSL_secure_malloc.3 head/secure/lib/libcrypto/man/OSSL_STORE_INFO.3 head/secure/lib/libcrypto/man/OSSL_STORE_LOADER.3 head/secure/lib/libcrypto/man/OSSL_STORE_SEARCH.3 head/secure/lib/libcrypto/man/OSSL_STORE_expect.3 head/secure/lib/libcrypto/man/OSSL_STORE_open.3 head/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 head/secure/lib/libcrypto/man/PEM_bytes_read_bio.3 head/secure/lib/libcrypto/man/PEM_read.3 head/secure/lib/libcrypto/man/PEM_read_CMS.3 head/secure/lib/libcrypto/man/PEM_read_bio_PrivateKey.3 head/secure/lib/libcrypto/man/PEM_read_bio_ex.3 head/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 head/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 head/secure/lib/libcrypto/man/PKCS12_create.3 head/secure/lib/libcrypto/man/PKCS12_newpass.3 head/secure/lib/libcrypto/man/PKCS12_parse.3 head/secure/lib/libcrypto/man/PKCS5_PBKDF2_HMAC.3 head/secure/lib/libcrypto/man/PKCS7_decrypt.3 head/secure/lib/libcrypto/man/PKCS7_encrypt.3 head/secure/lib/libcrypto/man/PKCS7_sign.3 head/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 head/secure/lib/libcrypto/man/PKCS7_verify.3 head/secure/lib/libcrypto/man/RAND_DRBG_generate.3 head/secure/lib/libcrypto/man/RAND_DRBG_get0_master.3 head/secure/lib/libcrypto/man/RAND_DRBG_new.3 head/secure/lib/libcrypto/man/RAND_DRBG_reseed.3 head/secure/lib/libcrypto/man/RAND_DRBG_set_callbacks.3 head/secure/lib/libcrypto/man/RAND_DRBG_set_ex_data.3 head/secure/lib/libcrypto/man/RAND_add.3 head/secure/lib/libcrypto/man/RAND_bytes.3 head/secure/lib/libcrypto/man/RAND_cleanup.3 head/secure/lib/libcrypto/man/RAND_egd.3 head/secure/lib/libcrypto/man/RAND_load_file.3 head/secure/lib/libcrypto/man/RAND_set_rand_method.3 head/secure/lib/libcrypto/man/RC4_set_key.3 head/secure/lib/libcrypto/man/RIPEMD160_Init.3 head/secure/lib/libcrypto/man/RSA_blinding_on.3 head/secure/lib/libcrypto/man/RSA_check_key.3 head/secure/lib/libcrypto/man/RSA_generate_key.3 head/secure/lib/libcrypto/man/RSA_get0_key.3 head/secure/lib/libcrypto/man/RSA_meth_new.3 head/secure/lib/libcrypto/man/RSA_new.3 head/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 head/secure/lib/libcrypto/man/RSA_print.3 head/secure/lib/libcrypto/man/RSA_private_encrypt.3 head/secure/lib/libcrypto/man/RSA_public_encrypt.3 head/secure/lib/libcrypto/man/RSA_set_method.3 head/secure/lib/libcrypto/man/RSA_sign.3 head/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 head/secure/lib/libcrypto/man/RSA_size.3 head/secure/lib/libcrypto/man/SCT_new.3 head/secure/lib/libcrypto/man/SCT_print.3 head/secure/lib/libcrypto/man/SCT_validate.3 head/secure/lib/libcrypto/man/SHA256_Init.3 head/secure/lib/libcrypto/man/SMIME_read_CMS.3 head/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 head/secure/lib/libcrypto/man/SMIME_write_CMS.3 head/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 head/secure/lib/libcrypto/man/SSL_CIPHER_get_name.3 head/secure/lib/libcrypto/man/SSL_COMP_add_compression_method.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_new.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_set1_prefix.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_set_flags.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_set_ssl_ctx.3 head/secure/lib/libcrypto/man/SSL_CONF_cmd.3 head/secure/lib/libcrypto/man/SSL_CONF_cmd_argv.3 head/secure/lib/libcrypto/man/SSL_CTX_add1_chain_cert.3 head/secure/lib/libcrypto/man/SSL_CTX_add_extra_chain_cert.3 head/secure/lib/libcrypto/man/SSL_CTX_add_session.3 head/secure/lib/libcrypto/man/SSL_CTX_config.3 head/secure/lib/libcrypto/man/SSL_CTX_ctrl.3 head/secure/lib/libcrypto/man/SSL_CTX_dane_enable.3 head/secure/lib/libcrypto/man/SSL_CTX_flush_sessions.3 head/secure/lib/libcrypto/man/SSL_CTX_free.3 head/secure/lib/libcrypto/man/SSL_CTX_get0_param.3 head/secure/lib/libcrypto/man/SSL_CTX_get_verify_mode.3 head/secure/lib/libcrypto/man/SSL_CTX_has_client_custom_ext.3 head/secure/lib/libcrypto/man/SSL_CTX_load_verify_locations.3 head/secure/lib/libcrypto/man/SSL_CTX_new.3 head/secure/lib/libcrypto/man/SSL_CTX_sess_number.3 head/secure/lib/libcrypto/man/SSL_CTX_sess_set_cache_size.3 head/secure/lib/libcrypto/man/SSL_CTX_sess_set_get_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_sessions.3 head/secure/lib/libcrypto/man/SSL_CTX_set0_CA_list.3 head/secure/lib/libcrypto/man/SSL_CTX_set1_curves.3 head/secure/lib/libcrypto/man/SSL_CTX_set1_sigalgs.3 head/secure/lib/libcrypto/man/SSL_CTX_set1_verify_cert_store.3 head/secure/lib/libcrypto/man/SSL_CTX_set_alpn_select_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cert_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cert_store.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cert_verify_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cipher_list.3 head/secure/lib/libcrypto/man/SSL_CTX_set_client_cert_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_client_hello_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ct_validation_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ctlog_list_file.3 head/secure/lib/libcrypto/man/SSL_CTX_set_default_passwd_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ex_data.3 head/secure/lib/libcrypto/man/SSL_CTX_set_generate_session_id.3 head/secure/lib/libcrypto/man/SSL_CTX_set_info_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_keylog_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_max_cert_list.3 head/secure/lib/libcrypto/man/SSL_CTX_set_min_proto_version.3 head/secure/lib/libcrypto/man/SSL_CTX_set_mode.3 head/secure/lib/libcrypto/man/SSL_CTX_set_msg_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_num_tickets.3 head/secure/lib/libcrypto/man/SSL_CTX_set_options.3 head/secure/lib/libcrypto/man/SSL_CTX_set_psk_client_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_quiet_shutdown.3 head/secure/lib/libcrypto/man/SSL_CTX_set_read_ahead.3 head/secure/lib/libcrypto/man/SSL_CTX_set_record_padding_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_security_level.3 head/secure/lib/libcrypto/man/SSL_CTX_set_session_cache_mode.3 head/secure/lib/libcrypto/man/SSL_CTX_set_session_id_context.3 head/secure/lib/libcrypto/man/SSL_CTX_set_session_ticket_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_split_send_fragment.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ssl_version.3 head/secure/lib/libcrypto/man/SSL_CTX_set_stateless_cookie_generate_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_timeout.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_servername_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_status_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_ticket_key_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_use_srtp.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tmp_dh_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_verify.3 head/secure/lib/libcrypto/man/SSL_CTX_use_certificate.3 head/secure/lib/libcrypto/man/SSL_CTX_use_psk_identity_hint.3 head/secure/lib/libcrypto/man/SSL_CTX_use_serverinfo.3 head/secure/lib/libcrypto/man/SSL_SESSION_free.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_cipher.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_hostname.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_id_context.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_peer.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_compress_id.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_ex_data.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_protocol_version.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_time.3 head/secure/lib/libcrypto/man/SSL_SESSION_has_ticket.3 head/secure/lib/libcrypto/man/SSL_SESSION_is_resumable.3 head/secure/lib/libcrypto/man/SSL_SESSION_print.3 head/secure/lib/libcrypto/man/SSL_SESSION_set1_id.3 head/secure/lib/libcrypto/man/SSL_accept.3 head/secure/lib/libcrypto/man/SSL_alert_type_string.3 head/secure/lib/libcrypto/man/SSL_alloc_buffers.3 head/secure/lib/libcrypto/man/SSL_check_chain.3 head/secure/lib/libcrypto/man/SSL_clear.3 head/secure/lib/libcrypto/man/SSL_connect.3 head/secure/lib/libcrypto/man/SSL_do_handshake.3 head/secure/lib/libcrypto/man/SSL_export_keying_material.3 head/secure/lib/libcrypto/man/SSL_extension_supported.3 head/secure/lib/libcrypto/man/SSL_free.3 head/secure/lib/libcrypto/man/SSL_get0_peer_scts.3 head/secure/lib/libcrypto/man/SSL_get_SSL_CTX.3 head/secure/lib/libcrypto/man/SSL_get_all_async_fds.3 head/secure/lib/libcrypto/man/SSL_get_ciphers.3 head/secure/lib/libcrypto/man/SSL_get_client_random.3 head/secure/lib/libcrypto/man/SSL_get_current_cipher.3 head/secure/lib/libcrypto/man/SSL_get_default_timeout.3 head/secure/lib/libcrypto/man/SSL_get_error.3 head/secure/lib/libcrypto/man/SSL_get_extms_support.3 head/secure/lib/libcrypto/man/SSL_get_fd.3 head/secure/lib/libcrypto/man/SSL_get_peer_cert_chain.3 head/secure/lib/libcrypto/man/SSL_get_peer_certificate.3 head/secure/lib/libcrypto/man/SSL_get_peer_signature_nid.3 head/secure/lib/libcrypto/man/SSL_get_peer_tmp_key.3 head/secure/lib/libcrypto/man/SSL_get_psk_identity.3 head/secure/lib/libcrypto/man/SSL_get_rbio.3 head/secure/lib/libcrypto/man/SSL_get_session.3 head/secure/lib/libcrypto/man/SSL_get_shared_sigalgs.3 head/secure/lib/libcrypto/man/SSL_get_verify_result.3 head/secure/lib/libcrypto/man/SSL_get_version.3 head/secure/lib/libcrypto/man/SSL_in_init.3 head/secure/lib/libcrypto/man/SSL_key_update.3 head/secure/lib/libcrypto/man/SSL_library_init.3 head/secure/lib/libcrypto/man/SSL_load_client_CA_file.3 head/secure/lib/libcrypto/man/SSL_new.3 head/secure/lib/libcrypto/man/SSL_pending.3 head/secure/lib/libcrypto/man/SSL_read.3 head/secure/lib/libcrypto/man/SSL_read_early_data.3 head/secure/lib/libcrypto/man/SSL_rstate_string.3 head/secure/lib/libcrypto/man/SSL_session_reused.3 head/secure/lib/libcrypto/man/SSL_set1_host.3 head/secure/lib/libcrypto/man/SSL_set_bio.3 head/secure/lib/libcrypto/man/SSL_set_connect_state.3 head/secure/lib/libcrypto/man/SSL_set_fd.3 head/secure/lib/libcrypto/man/SSL_set_session.3 head/secure/lib/libcrypto/man/SSL_set_shutdown.3 head/secure/lib/libcrypto/man/SSL_set_verify_result.3 head/secure/lib/libcrypto/man/SSL_shutdown.3 head/secure/lib/libcrypto/man/SSL_state_string.3 head/secure/lib/libcrypto/man/SSL_want.3 head/secure/lib/libcrypto/man/SSL_write.3 head/secure/lib/libcrypto/man/UI_STRING.3 head/secure/lib/libcrypto/man/UI_UTIL_read_pw.3 head/secure/lib/libcrypto/man/UI_create_method.3 head/secure/lib/libcrypto/man/UI_new.3 head/secure/lib/libcrypto/man/X509V3_get_d2i.3 head/secure/lib/libcrypto/man/X509_ALGOR_dup.3 head/secure/lib/libcrypto/man/X509_CRL_get0_by_serial.3 head/secure/lib/libcrypto/man/X509_EXTENSION_set_object.3 head/secure/lib/libcrypto/man/X509_LOOKUP_hash_dir.3 head/secure/lib/libcrypto/man/X509_LOOKUP_meth_new.3 head/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 head/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 head/secure/lib/libcrypto/man/X509_NAME_get0_der.3 head/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 head/secure/lib/libcrypto/man/X509_NAME_print_ex.3 head/secure/lib/libcrypto/man/X509_PUBKEY_new.3 head/secure/lib/libcrypto/man/X509_SIG_get0.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 head/secure/lib/libcrypto/man/X509_STORE_add_cert.3 head/secure/lib/libcrypto/man/X509_STORE_get0_param.3 head/secure/lib/libcrypto/man/X509_STORE_new.3 head/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 head/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 head/secure/lib/libcrypto/man/X509_check_ca.3 head/secure/lib/libcrypto/man/X509_check_host.3 head/secure/lib/libcrypto/man/X509_check_issued.3 head/secure/lib/libcrypto/man/X509_check_private_key.3 head/secure/lib/libcrypto/man/X509_cmp.3 head/secure/lib/libcrypto/man/X509_cmp_time.3 head/secure/lib/libcrypto/man/X509_digest.3 head/secure/lib/libcrypto/man/X509_dup.3 head/secure/lib/libcrypto/man/X509_get0_notBefore.3 head/secure/lib/libcrypto/man/X509_get0_signature.3 head/secure/lib/libcrypto/man/X509_get0_uids.3 head/secure/lib/libcrypto/man/X509_get_extension_flags.3 head/secure/lib/libcrypto/man/X509_get_pubkey.3 head/secure/lib/libcrypto/man/X509_get_serialNumber.3 head/secure/lib/libcrypto/man/X509_get_subject_name.3 head/secure/lib/libcrypto/man/X509_get_version.3 head/secure/lib/libcrypto/man/X509_new.3 head/secure/lib/libcrypto/man/X509_sign.3 head/secure/lib/libcrypto/man/X509_verify_cert.3 head/secure/lib/libcrypto/man/X509v3_get_ext_by_NID.3 head/secure/lib/libcrypto/man/d2i_DHparams.3 head/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey_bio.3 head/secure/lib/libcrypto/man/d2i_PrivateKey.3 head/secure/lib/libcrypto/man/d2i_SSL_SESSION.3 head/secure/lib/libcrypto/man/d2i_X509.3 head/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 head/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 head/secure/lib/libcrypto/man/i2d_re_X509_tbs.3 head/secure/lib/libcrypto/man/o2i_SCT_LIST.3 Modified: head/etc/mtree/BSD.usr.dist head/secure/lib/libcrypto/Makefile Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Wed Jan 22 01:10:23 2020 (r356962) +++ head/etc/mtree/BSD.usr.dist Wed Jan 22 01:15:57 2020 (r356963) @@ -1176,6 +1176,10 @@ .. man3 .. + man5 + .. + man7 + .. .. .. security Modified: head/secure/lib/libcrypto/Makefile ============================================================================== --- head/secure/lib/libcrypto/Makefile Wed Jan 22 01:10:23 2020 (r356962) +++ head/secure/lib/libcrypto/Makefile Wed Jan 22 01:15:57 2020 (r356963) @@ -12,9 +12,7 @@ VERSION_MAP= ${.CURDIR}/Version.map NO_LINT= -.if exists(Makefile.man) .include "Makefile.man" -.endif .include "Makefile.inc" SRCS= cpt_err.c cryptlib.c ctype.c cversion.c ex_data.c getenv.c init.c @@ -531,5 +529,4 @@ PICFLAG+= -DOPENSSL_PIC ${LCRYPTO_SRC}/crypto/whrlpool \ ${LCRYPTO_SRC}/crypto/x509 \ ${LCRYPTO_SRC}/crypto/x509v3 \ - ${LCRYPTO_SRC}/include/openssl \ - ${.CURDIR}/man + ${LCRYPTO_SRC}/include/openssl Added: head/secure/lib/libcrypto/Makefile.man ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/lib/libcrypto/Makefile.man Wed Jan 22 01:15:57 2020 (r356963) @@ -0,0 +1,5 @@ +# $FreeBSD$ +.for m in 3 5 7 +.include "man/man${m}/Makefile" +.PATH: ${.CURDIR}/man/man${m} +.endfor Copied: head/secure/lib/libcrypto/man/man3/ADMISSIONS.3 (from r356962, head/secure/lib/libcrypto/man/ADMISSIONS.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/lib/libcrypto/man/man3/ADMISSIONS.3 Wed Jan 22 01:15:57 2020 (r356963, copy of r356962, head/secure/lib/libcrypto/man/ADMISSIONS.3) @@ -0,0 +1,280 @@ +.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.39) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +. ds C` +. ds C' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is >0, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.\" +.\" Avoid warning from groff about undefined register 'F'. +.de IX +.. +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{\ +. if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. if !\nF==2 \{\ +. nr % 0 +. nr F 2 +. \} +. \} +.\} +.rr rF +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ADMISSIONS 3" +.TH ADMISSIONS 3 "2019-09-10" "1.1.1d" "OpenSSL" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ADMISSIONS, ADMISSIONS_get0_admissionAuthority, ADMISSIONS_get0_namingAuthority, ADMISSIONS_get0_professionInfos, ADMISSIONS_set0_admissionAuthority, ADMISSIONS_set0_namingAuthority, ADMISSIONS_set0_professionInfos, ADMISSION_SYNTAX, ADMISSION_SYNTAX_get0_admissionAuthority, ADMISSION_SYNTAX_get0_contentsOfAdmissions, ADMISSION_SYNTAX_set0_admissionAuthority, ADMISSION_SYNTAX_set0_contentsOfAdmissions, NAMING_AUTHORITY, NAMING_AUTHORITY_get0_authorityId, NAMING_AUTHORITY_get0_authorityURL, NAMING_AUTHORITY_get0_authorityText, NAMING_AUTHORITY_set0_authorityId, NAMING_AUTHORITY_set0_authorityURL, NAMING_AUTHORITY_set0_authorityText, PROFESSION_INFO, PROFESSION_INFOS, PROFESSION_INFO_get0_addProfessionInfo, PROFESSION_INFO_get0_namingAuthority, PROFESSION_INFO_get0_professionItems, PROFESSION_INFO_get0_professionOIDs, PROFESSION_INFO_get0_registrationNumber, PROFESSION_INFO_set0_addProfessionInfo, PROFESSION_INFO_set0_namingAuthority, PROFESSION_INFO_set0_professionItems, PROFESSION_I NFO_set0_professionOIDs, PROFESSION_INFO_set0_registrationNumber \&\- Accessors and settors for ADMISSION_SYNTAX +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 5 +\& typedef struct NamingAuthority_st NAMING_AUTHORITY; +\& typedef struct ProfessionInfo_st PROFESSION_INFO; +\& typedef STACK_OF(PROFESSION_INFO) PROFESSION_INFOS; +\& typedef struct Admissions_st ADMISSIONS; +\& typedef struct AdmissionSyntax_st ADMISSION_SYNTAX; +\& +\& const ASN1_OBJECT *NAMING_AUTHORITY_get0_authorityId( +\& const NAMING_AUTHORITY *n); +\& void NAMING_AUTHORITY_set0_authorityId(NAMING_AUTHORITY *n, +\& ASN1_OBJECT* namingAuthorityId); +\& const ASN1_IA5STRING *NAMING_AUTHORITY_get0_authorityURL( +\& const NAMING_AUTHORITY *n); +\& void NAMING_AUTHORITY_set0_authorityURL(NAMING_AUTHORITY *n, +\& ASN1_IA5STRING* namingAuthorityUrl); +\& const ASN1_STRING *NAMING_AUTHORITY_get0_authorityText( +\& const NAMING_AUTHORITY *n); +\& void NAMING_AUTHORITY_set0_authorityText(NAMING_AUTHORITY *n, +\& ASN1_STRING* namingAuthorityText); +\& +\& const GENERAL_NAME *ADMISSION_SYNTAX_get0_admissionAuthority( +\& const ADMISSION_SYNTAX *as); +\& void ADMISSION_SYNTAX_set0_admissionAuthority( +\& ADMISSION_SYNTAX *as, GENERAL_NAME *aa); +\& const STACK_OF(ADMISSIONS) *ADMISSION_SYNTAX_get0_contentsOfAdmissions( +\& const ADMISSION_SYNTAX *as); +\& void ADMISSION_SYNTAX_set0_contentsOfAdmissions( +\& ADMISSION_SYNTAX *as, STACK_OF(ADMISSIONS) *a); +\& +\& const GENERAL_NAME *ADMISSIONS_get0_admissionAuthority(const ADMISSIONS *a); +\& void ADMISSIONS_set0_admissionAuthority(ADMISSIONS *a, GENERAL_NAME *aa); +\& const NAMING_AUTHORITY *ADMISSIONS_get0_namingAuthority(const ADMISSIONS *a); +\& void ADMISSIONS_set0_namingAuthority(ADMISSIONS *a, NAMING_AUTHORITY *na); +\& const PROFESSION_INFOS *ADMISSIONS_get0_professionInfos(const ADMISSIONS *a); +\& void ADMISSIONS_set0_professionInfos(ADMISSIONS *a, PROFESSION_INFOS *pi); +\& +\& const ASN1_OCTET_STRING *PROFESSION_INFO_get0_addProfessionInfo( +\& const PROFESSION_INFO *pi); +\& void PROFESSION_INFO_set0_addProfessionInfo( +\& PROFESSION_INFO *pi, ASN1_OCTET_STRING *aos); +\& const NAMING_AUTHORITY *PROFESSION_INFO_get0_namingAuthority( +\& const PROFESSION_INFO *pi); +\& void PROFESSION_INFO_set0_namingAuthority( +\& PROFESSION_INFO *pi, NAMING_AUTHORITY *na); +\& const STACK_OF(ASN1_STRING) *PROFESSION_INFO_get0_professionItems( +\& const PROFESSION_INFO *pi); +\& void PROFESSION_INFO_set0_professionItems( +\& PROFESSION_INFO *pi, STACK_OF(ASN1_STRING) *as); +\& const STACK_OF(ASN1_OBJECT) *PROFESSION_INFO_get0_professionOIDs( +\& const PROFESSION_INFO *pi); +\& void PROFESSION_INFO_set0_professionOIDs( +\& PROFESSION_INFO *pi, STACK_OF(ASN1_OBJECT) *po); +\& const ASN1_PRINTABLESTRING *PROFESSION_INFO_get0_registrationNumber( +\& const PROFESSION_INFO *pi); +\& void PROFESSION_INFO_set0_registrationNumber( +\& PROFESSION_INFO *pi, ASN1_PRINTABLESTRING *rn); +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +The \fB\s-1PROFESSION_INFOS\s0\fR, \fB\s-1ADMISSION_SYNTAX\s0\fR, \fB\s-1ADMISSIONS\s0\fR, and +\&\fB\s-1PROFESSION_INFO\s0\fR types are opaque structures representing the +analogous types defined in the Common \s-1PKI\s0 Specification published +by . +Knowledge of those structures and their semantics is assumed. +.PP +The conventional routines to convert between \s-1DER\s0 and the local format +are described in \fBd2i_X509\fR\|(3). +The conventional routines to allocate and free the types are defined +in \fBX509_dup\fR\|(3). +.PP +The \fB\s-1PROFESSION_INFOS\s0\fR type is a stack of \fB\s-1PROFESSION_INFO\s0\fR; see +\&\s-1\fBDEFINE_STACK_OF\s0\fR\|(3) for details. +.PP +The \fB\s-1NAMING_AUTHORITY\s0\fR type has an authority \s-1ID\s0 and \s-1URL,\s0 and text fields. +The \fBNAMING_AUTHORITY_get0_authorityId()\fR, +\&\fBNAMING_AUTHORITY_get0_get0_authorityURL()\fR, and +\&\fBNAMING_AUTHORITY_get0_get0_authorityText()\fR, functions return pointers +to those values within the object. +The \fBNAMING_AUTHORITY_set0_authorityId()\fR, +\&\fBNAMING_AUTHORITY_set0_get0_authorityURL()\fR, and +\&\fBNAMING_AUTHORITY_set0_get0_authorityText()\fR, +functions free any existing value and set the pointer to the specified value. +.PP +The \fB\s-1ADMISSION_SYNTAX\s0\fR type has an authority name and a stack of +\&\fB\s-1ADMISSION\s0\fR objects. +The \fBADMISSION_SYNTAX_get0_admissionAuthority()\fR +and \fBADMISSION_SYNTAX_get0_contentsOfAdmissions()\fR functions return pointers +to those values within the object. +The +\&\fBADMISSION_SYNTAX_set0_admissionAuthority()\fR and +\&\fBADMISSION_SYNTAX_set0_contentsOfAdmissions()\fR +functions free any existing value and set the pointer to the specified value. +.PP +The \fB\s-1ADMISSION\s0\fR type has an authority name, authority object, and a +stack of \fB\s-1PROFESSION_INFO\s0\fR items. +The \fBADMISSIONS_get0_admissionAuthority()\fR, \fBADMISSIONS_get0_namingAuthority()\fR, +and \fBADMISSIONS_get0_professionInfos()\fR +functions return pointers to those values within the object. +The +\&\fBADMISSIONS_set0_admissionAuthority()\fR, +\&\fBADMISSIONS_set0_namingAuthority()\fR, and +\&\fBADMISSIONS_set0_professionInfos()\fR +functions free any existing value and set the pointer to the specified value. +.PP +The \fB\s-1PROFESSION_INFO\s0\fR type has a name authority, stacks of +profession Items and OIDs, a registration number, and additional +profession info. +The functions \fBPROFESSION_INFO_get0_addProfessionInfo()\fR, +\&\fBPROFESSION_INFO_get0_namingAuthority()\fR, \fBPROFESSION_INFO_get0_professionItems()\fR, +\&\fBPROFESSION_INFO_get0_professionOIDs()\fR, and +\&\fBPROFESSION_INFO_get0_registrationNumber()\fR +functions return pointers to those values within the object. +The +\&\fBPROFESSION_INFO_set0_addProfessionInfo()\fR, +\&\fBPROFESSION_INFO_set0_namingAuthority()\fR, +\&\fBPROFESSION_INFO_set0_professionItems()\fR, +\&\fBPROFESSION_INFO_set0_professionOIDs()\fR, and +\&\fBPROFESSION_INFO_set0_registrationNumber()\fR +functions free any existing value and set the pointer to the specified value. +.SH "RETURN VALUES" +.IX Header "RETURN VALUES" +Described above. +Note that all of the \fIget0\fR functions return a pointer to the internal data +structure and must not be freed. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +\&\fBX509_dup\fR\|(3), +\&\fBd2i_X509\fR\|(3), +.SH "COPYRIGHT" +.IX Header "COPYRIGHT" +Copyright 2017\-2019 The OpenSSL Project Authors. All Rights Reserved. +.PP +Licensed under the OpenSSL license (the \*(L"License\*(R"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file \s-1LICENSE\s0 in the source distribution or at +. Copied: head/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 (from r356962, head/secure/lib/libcrypto/man/ASN1_INTEGER_get_int64.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/lib/libcrypto/man/man3/ASN1_INTEGER_get_int64.3 Wed Jan 22 01:15:57 2020 (r356963, copy of r356962, head/secure/lib/libcrypto/man/ASN1_INTEGER_get_int64.3) @@ -0,0 +1,260 @@ +.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.39) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +. ds C` +. ds C' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is >0, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.\" +.\" Avoid warning from groff about undefined register 'F'. +.de IX +.. +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{\ +. if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. if !\nF==2 \{\ +. nr % 0 +. nr F 2 +. \} +. \} +.\} +.rr rF +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ASN1_INTEGER_GET_INT64 3" +.TH ASN1_INTEGER_GET_INT64 3 "2019-09-10" "1.1.1d" "OpenSSL" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ASN1_INTEGER_get_uint64, ASN1_INTEGER_set_uint64, ASN1_INTEGER_get_int64, ASN1_INTEGER_get, ASN1_INTEGER_set_int64, ASN1_INTEGER_set, BN_to_ASN1_INTEGER, ASN1_INTEGER_to_BN, ASN1_ENUMERATED_get_int64, ASN1_ENUMERATED_get, ASN1_ENUMERATED_set_int64, ASN1_ENUMERATED_set, BN_to_ASN1_ENUMERATED, ASN1_ENUMERATED_to_BN \&\- ASN.1 INTEGER and ENUMERATED utilities +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 1 +\& #include +\& +\& int ASN1_INTEGER_get_int64(int64_t *pr, const ASN1_INTEGER *a); +\& long ASN1_INTEGER_get(const ASN1_INTEGER *a); +\& +\& int ASN1_INTEGER_set_int64(ASN1_INTEGER *a, int64_t r); +\& int ASN1_INTEGER_set(const ASN1_INTEGER *a, long v); +\& +\& int ASN1_INTEGER_get_uint64(uint64_t *pr, const ASN1_INTEGER *a); +\& int ASN1_INTEGER_set_uint64(ASN1_INTEGER *a, uint64_t r); +\& +\& ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai); +\& BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn); +\& +\& int ASN1_ENUMERATED_get_int64(int64_t *pr, const ASN1_INTEGER *a); +\& long ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a); +\& +\& int ASN1_ENUMERATED_set_int64(ASN1_INTEGER *a, int64_t r); +\& int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v); +\& +\& ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai); +\& BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn); +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +These functions convert to and from \fB\s-1ASN1_INTEGER\s0\fR and \fB\s-1ASN1_ENUMERATED\s0\fR +structures. +.PP +\&\fBASN1_INTEGER_get_int64()\fR converts an \fB\s-1ASN1_INTEGER\s0\fR into an \fBint64_t\fR type +If successful it returns 1 and sets \fB*pr\fR to the value of \fBa\fR. If it fails +(due to invalid type or the value being too big to fit into an \fBint64_t\fR type) +it returns 0. +.PP +\&\fBASN1_INTEGER_get_uint64()\fR is similar to \fBASN1_INTEGER_get_int64_t()\fR except it +converts to a \fBuint64_t\fR type and an error is returned if the passed integer +is negative. +.PP +\&\fBASN1_INTEGER_get()\fR also returns the value of \fBa\fR but it returns 0 if \fBa\fR is +\&\s-1NULL\s0 and \-1 on error (which is ambiguous because \-1 is a legitimate value for +an \fB\s-1ASN1_INTEGER\s0\fR). New applications should use \fBASN1_INTEGER_get_int64()\fR +instead. +.PP +\&\fBASN1_INTEGER_set_int64()\fR sets the value of \fB\s-1ASN1_INTEGER\s0\fR \fBa\fR to the +\&\fBint64_t\fR value \fBr\fR. +.PP +\&\fBASN1_INTEGER_set_uint64()\fR sets the value of \fB\s-1ASN1_INTEGER\s0\fR \fBa\fR to the +\&\fBuint64_t\fR value \fBr\fR. +.PP +\&\fBASN1_INTEGER_set()\fR sets the value of \fB\s-1ASN1_INTEGER\s0\fR \fBa\fR to the \fBlong\fR value +\&\fBv\fR. +.PP +\&\fBBN_to_ASN1_INTEGER()\fR converts \fB\s-1BIGNUM\s0\fR \fBbn\fR to an \fB\s-1ASN1_INTEGER\s0\fR. If \fBai\fR +is \s-1NULL\s0 a new \fB\s-1ASN1_INTEGER\s0\fR structure is returned. If \fBai\fR is not \s-1NULL\s0 then +the existing structure will be used instead. +.PP +\&\fBASN1_INTEGER_to_BN()\fR converts \s-1ASN1_INTEGER\s0 \fBai\fR into a \fB\s-1BIGNUM\s0\fR. If \fBbn\fR is +\&\s-1NULL\s0 a new \fB\s-1BIGNUM\s0\fR structure is returned. If \fBbn\fR is not \s-1NULL\s0 then the +existing structure will be used instead. +.PP +\&\fBASN1_ENUMERATED_get_int64()\fR, \fBASN1_ENUMERATED_set_int64()\fR, +\&\fBASN1_ENUMERATED_set()\fR, \fBBN_to_ASN1_ENUMERATED()\fR and \fBASN1_ENUMERATED_to_BN()\fR +behave in an identical way to their \s-1ASN1_INTEGER\s0 counterparts except they +operate on an \fB\s-1ASN1_ENUMERATED\s0\fR value. +.PP +\&\fBASN1_ENUMERATED_get()\fR returns the value of \fBa\fR in a similar way to +\&\fBASN1_INTEGER_get()\fR but it returns \fB0xffffffffL\fR if the value of \fBa\fR will not +fit in a long type. New applications should use \fBASN1_ENUMERATED_get_int64()\fR +instead. +.SH "NOTES" +.IX Header "NOTES" +In general an \fB\s-1ASN1_INTEGER\s0\fR or \fB\s-1ASN1_ENUMERATED\s0\fR type can contain an +integer of almost arbitrary size and so cannot always be represented by a C +\&\fBint64_t\fR type. However in many cases (for example version numbers) they +represent small integers which can be more easily manipulated if converted to +an appropriate C integer type. +.SH "BUGS" +.IX Header "BUGS" +The ambiguous return values of \fBASN1_INTEGER_get()\fR and \fBASN1_ENUMERATED_get()\fR +mean these functions should be avoided if possible. They are retained for +compatibility. Normally the ambiguous return values are not legitimate +values for the fields they represent. +.SH "RETURN VALUES" +.IX Header "RETURN VALUES" +\&\fBASN1_INTEGER_set_int64()\fR, \fBASN1_INTEGER_set()\fR, \fBASN1_ENUMERATED_set_int64()\fR and +\&\fBASN1_ENUMERATED_set()\fR return 1 for success and 0 for failure. They will only +fail if a memory allocation error occurs. +.PP +\&\fBASN1_INTEGER_get_int64()\fR and \fBASN1_ENUMERATED_get_int64()\fR return 1 for success +and 0 for failure. They will fail if the passed type is incorrect (this will +only happen if there is a programming error) or if the value exceeds the range +of an \fBint64_t\fR type. +.PP +\&\fBBN_to_ASN1_INTEGER()\fR and \fBBN_to_ASN1_ENUMERATED()\fR return an \fB\s-1ASN1_INTEGER\s0\fR or +\&\fB\s-1ASN1_ENUMERATED\s0\fR structure respectively or \s-1NULL\s0 if an error occurs. They will +only fail due to a memory allocation error. +.PP +\&\fBASN1_INTEGER_to_BN()\fR and \fBASN1_ENUMERATED_to_BN()\fR return a \fB\s-1BIGNUM\s0\fR structure +of \s-1NULL\s0 if an error occurs. They can fail if the passed type is incorrect +(due to programming error) or due to a memory allocation failure. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +\&\fBERR_get_error\fR\|(3) +.SH "HISTORY" +.IX Header "HISTORY" +\&\fBASN1_INTEGER_set_int64()\fR, \fBASN1_INTEGER_get_int64()\fR, +\&\fBASN1_ENUMERATED_set_int64()\fR and \fBASN1_ENUMERATED_get_int64()\fR +were added in OpenSSL 1.1.0. +.SH "COPYRIGHT" +.IX Header "COPYRIGHT" +Copyright 2015\-2018 The OpenSSL Project Authors. All Rights Reserved. +.PP +Licensed under the OpenSSL license (the \*(L"License\*(R"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file \s-1LICENSE\s0 in the source distribution or at +. Copied: head/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 (from r356962, head/secure/lib/libcrypto/man/ASN1_ITEM_lookup.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/lib/libcrypto/man/man3/ASN1_ITEM_lookup.3 Wed Jan 22 01:15:57 2020 (r356963, copy of r356962, head/secure/lib/libcrypto/man/ASN1_ITEM_lookup.3) @@ -0,0 +1,171 @@ +.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.39) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +. ds C` +. ds C' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is >0, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.\" +.\" Avoid warning from groff about undefined register 'F'. +.de IX +.. +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{\ +. if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. if !\nF==2 \{\ +. nr % 0 +. nr F 2 +. \} +. \} +.\} +.rr rF +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ASN1_ITEM_LOOKUP 3" +.TH ASN1_ITEM_LOOKUP 3 "2019-09-10" "1.1.1d" "OpenSSL" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ASN1_ITEM_lookup, ASN1_ITEM_get \- lookup ASN.1 structures +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 1 +\& #include +\& +\& const ASN1_ITEM *ASN1_ITEM_lookup(const char *name); +\& const ASN1_ITEM *ASN1_ITEM_get(size_t i); +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +\&\fBASN1_ITEM_lookup()\fR returns the \fB\s-1ASN1_ITEM\s0 name\fR. +.PP +\&\fBASN1_ITEM_get()\fR returns the \fB\s-1ASN1_ITEM\s0\fR with index \fBi\fR. This function +returns \fB\s-1NULL\s0\fR if the index \fBi\fR is out of range. +.SH "RETURN VALUES" +.IX Header "RETURN VALUES" +\&\fBASN1_ITEM_lookup()\fR and \fBASN1_ITEM_get()\fR return a valid \fB\s-1ASN1_ITEM\s0\fR structure +or \fB\s-1NULL\s0\fR if an error occurred. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +\&\fBERR_get_error\fR\|(3) +.SH "COPYRIGHT" +.IX Header "COPYRIGHT" +Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. +.PP +Licensed under the OpenSSL license (the \*(L"License\*(R"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file \s-1LICENSE\s0 in the source distribution or at +. Copied: head/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 (from r356962, head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/lib/libcrypto/man/man3/ASN1_OBJECT_new.3 Wed Jan 22 01:15:57 2020 (r356963, copy of r356962, head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3) @@ -0,0 +1,182 @@ +.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.39) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +. ds C` +. ds C' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is >0, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.\" +.\" Avoid warning from groff about undefined register 'F'. +.de IX +.. +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{\ +. if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. if !\nF==2 \{\ +. nr % 0 +. nr F 2 +. \} +. \} +.\} +.rr rF +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "ASN1_OBJECT_NEW 3" +.TH ASN1_OBJECT_NEW 3 "2019-09-10" "1.1.1d" "OpenSSL" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ASN1_OBJECT_new, ASN1_OBJECT_free \- object allocation functions +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 1 +\& #include +\& +\& ASN1_OBJECT *ASN1_OBJECT_new(void); +\& void ASN1_OBJECT_free(ASN1_OBJECT *a); +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +The \s-1ASN1_OBJECT\s0 allocation routines, allocate and free an +\&\s-1ASN1_OBJECT\s0 structure, which represents an \s-1ASN1 OBJECT IDENTIFIER.\s0 +.PP +\&\fBASN1_OBJECT_new()\fR allocates and initializes an \s-1ASN1_OBJECT\s0 structure. +.PP +\&\fBASN1_OBJECT_free()\fR frees up the \fB\s-1ASN1_OBJECT\s0\fR structure \fBa\fR. +If \fBa\fR is \s-1NULL,\s0 nothing is done. +.SH "NOTES" +.IX Header "NOTES" +Although \fBASN1_OBJECT_new()\fR allocates a new \s-1ASN1_OBJECT\s0 structure it +is almost never used in applications. The \s-1ASN1\s0 object utility functions +such as \fBOBJ_nid2obj()\fR are used instead. +.SH "RETURN VALUES" +.IX Header "RETURN VALUES" +If the allocation fails, \fBASN1_OBJECT_new()\fR returns \fB\s-1NULL\s0\fR and sets an error +code that can be obtained by \fBERR_get_error\fR\|(3). +Otherwise it returns a pointer to the newly allocated structure. +.PP +\&\fBASN1_OBJECT_free()\fR returns no value. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +\&\fBERR_get_error\fR\|(3), \fBd2i_ASN1_OBJECT\fR\|(3) +.SH "COPYRIGHT" +.IX Header "COPYRIGHT" +Copyright 2002\-2016 The OpenSSL Project Authors. All Rights Reserved. +.PP +Licensed under the OpenSSL license (the \*(L"License\*(R"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file \s-1LICENSE\s0 in the source distribution or at +. Copied: head/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 (from r356962, head/secure/lib/libcrypto/man/ASN1_STRING_TABLE_add.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/secure/lib/libcrypto/man/man3/ASN1_STRING_TABLE_add.3 Wed Jan 22 01:15:57 2020 (r356963, copy of r356962, head/secure/lib/libcrypto/man/ASN1_STRING_TABLE_add.3) @@ -0,0 +1,195 @@ +.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.39) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +. ds C` +. ds C' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is >0, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jan 22 01:28:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D386229063; Wed, 22 Jan 2020 01:28:38 +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 482STy1Hvwz4KW7; Wed, 22 Jan 2020 01:28:38 +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 27A921DB26; Wed, 22 Jan 2020 01:28:38 +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 00M1Sb5b056119; Wed, 22 Jan 2020 01:28:37 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M1Sbjb056118; Wed, 22 Jan 2020 01:28:37 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <202001220128.00M1Sbjb056118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Wed, 22 Jan 2020 01:28: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: r356964 - stable/12/sys/ufs/ufs X-SVN-Group: stable-12 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/12/sys/ufs/ufs X-SVN-Commit-Revision: 356964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 01:28:38 -0000 Author: mckusick Date: Wed Jan 22 01:28:37 2020 New Revision: 356964 URL: https://svnweb.freebsd.org/changeset/base/356964 Log: MFC of 356627 Reset link counts after directory update failures Modified: stable/12/sys/ufs/ufs/ufs_lookup.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/12/sys/ufs/ufs/ufs_lookup.c Wed Jan 22 01:15:57 2020 (r356963) +++ stable/12/sys/ufs/ufs/ufs_lookup.c Wed Jan 22 01:28:37 2020 (r356964) @@ -1169,6 +1169,7 @@ ufs_dirremove(dvp, ip, flags, isrmdir) struct inode *dp; struct direct *ep, *rep; struct buf *bp; + off_t offset; int error; dp = VTOI(dvp); @@ -1187,22 +1188,32 @@ ufs_dirremove(dvp, ip, flags, isrmdir) ip->i_flag |= IN_CHANGE; } } + if (flags & DOWHITEOUT) + offset = dp->i_offset; + else + offset = dp->i_offset - dp->i_count; + if ((error = UFS_BLKATOFF(dvp, offset, (char **)&ep, &bp)) != 0) { + if (ip) { + ip->i_effnlink++; + ip->i_flag |= IN_CHANGE; + if (DOINGSOFTDEP(dvp)) { + softdep_change_linkcnt(ip); + } else { + ip->i_nlink++; + DIP_SET(ip, i_nlink, ip->i_nlink); + ip->i_flag |= IN_CHANGE; + } + } + return (error); + } if (flags & DOWHITEOUT) { /* * Whiteout entry: set d_ino to UFS_WINO. */ - if ((error = - UFS_BLKATOFF(dvp, (off_t)dp->i_offset, (char **)&ep, &bp)) != 0) - return (error); ep->d_ino = UFS_WINO; ep->d_type = DT_WHT; goto out; } - - if ((error = UFS_BLKATOFF(dvp, - (off_t)(dp->i_offset - dp->i_count), (char **)&ep, &bp)) != 0) - return (error); - /* Set 'rep' to the entry being removed. */ if (dp->i_count == 0) rep = ep; @@ -1302,12 +1313,22 @@ ufs_dirrewrite(dp, oip, newinum, newtype, isrmdir) } error = UFS_BLKATOFF(vdp, (off_t)dp->i_offset, (char **)&ep, &bp); - if (error) - return (error); - if (ep->d_namlen == 2 && ep->d_name[1] == '.' && ep->d_name[0] == '.' && - ep->d_ino != oip->i_number) { + if (error == 0 && ep->d_namlen == 2 && ep->d_name[1] == '.' && + ep->d_name[0] == '.' && ep->d_ino != oip->i_number) { brelse(bp); - return (EIDRM); + error = EIDRM; + } + if (error) { + oip->i_effnlink++; + oip->i_flag |= IN_CHANGE; + if (DOINGSOFTDEP(vdp)) { + softdep_change_linkcnt(oip); + } else { + oip->i_nlink++; + DIP_SET(oip, i_nlink, oip->i_nlink); + oip->i_flag |= IN_CHANGE; + } + return (error); } ep->d_ino = newinum; if (!OFSFMT(vdp)) From owner-svn-src-all@freebsd.org Wed Jan 22 01:31:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 99E052290FC; Wed, 22 Jan 2020 01:31:03 +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 482SXl3Kjlz4Khp; Wed, 22 Jan 2020 01:31:03 +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 32F451DB65; Wed, 22 Jan 2020 01:31:03 +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 00M1V3e0057176; Wed, 22 Jan 2020 01:31:03 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M1V3BD057175; Wed, 22 Jan 2020 01:31:03 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <202001220131.00M1V3BD057175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Wed, 22 Jan 2020 01:31: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: r356965 - stable/11/sys/ufs/ufs X-SVN-Group: stable-11 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/11/sys/ufs/ufs X-SVN-Commit-Revision: 356965 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 01:31:03 -0000 Author: mckusick Date: Wed Jan 22 01:31:02 2020 New Revision: 356965 URL: https://svnweb.freebsd.org/changeset/base/356965 Log: MFC of 356627 Reset link counts after directory update failures Modified: stable/11/sys/ufs/ufs/ufs_lookup.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/11/sys/ufs/ufs/ufs_lookup.c Wed Jan 22 01:28:37 2020 (r356964) +++ stable/11/sys/ufs/ufs/ufs_lookup.c Wed Jan 22 01:31:02 2020 (r356965) @@ -1167,6 +1167,7 @@ ufs_dirremove(dvp, ip, flags, isrmdir) struct inode *dp; struct direct *ep, *rep; struct buf *bp; + off_t offset; int error; dp = VTOI(dvp); @@ -1185,22 +1186,32 @@ ufs_dirremove(dvp, ip, flags, isrmdir) ip->i_flag |= IN_CHANGE; } } + if (flags & DOWHITEOUT) + offset = dp->i_offset; + else + offset = dp->i_offset - dp->i_count; + if ((error = UFS_BLKATOFF(dvp, offset, (char **)&ep, &bp)) != 0) { + if (ip) { + ip->i_effnlink++; + ip->i_flag |= IN_CHANGE; + if (DOINGSOFTDEP(dvp)) { + softdep_change_linkcnt(ip); + } else { + ip->i_nlink++; + DIP_SET(ip, i_nlink, ip->i_nlink); + ip->i_flag |= IN_CHANGE; + } + } + return (error); + } if (flags & DOWHITEOUT) { /* * Whiteout entry: set d_ino to WINO. */ - if ((error = - UFS_BLKATOFF(dvp, (off_t)dp->i_offset, (char **)&ep, &bp)) != 0) - return (error); ep->d_ino = WINO; ep->d_type = DT_WHT; goto out; } - - if ((error = UFS_BLKATOFF(dvp, - (off_t)(dp->i_offset - dp->i_count), (char **)&ep, &bp)) != 0) - return (error); - /* Set 'rep' to the entry being removed. */ if (dp->i_count == 0) rep = ep; @@ -1300,12 +1311,22 @@ ufs_dirrewrite(dp, oip, newinum, newtype, isrmdir) } error = UFS_BLKATOFF(vdp, (off_t)dp->i_offset, (char **)&ep, &bp); - if (error) - return (error); - if (ep->d_namlen == 2 && ep->d_name[1] == '.' && ep->d_name[0] == '.' && - ep->d_ino != oip->i_number) { + if (error == 0 && ep->d_namlen == 2 && ep->d_name[1] == '.' && + ep->d_name[0] == '.' && ep->d_ino != oip->i_number) { brelse(bp); - return (EIDRM); + error = EIDRM; + } + if (error) { + oip->i_effnlink++; + oip->i_flag |= IN_CHANGE; + if (DOINGSOFTDEP(vdp)) { + softdep_change_linkcnt(oip); + } else { + oip->i_nlink++; + DIP_SET(oip, i_nlink, oip->i_nlink); + oip->i_flag |= IN_CHANGE; + } + return (error); } ep->d_ino = newinum; if (!OFSFMT(vdp)) From owner-svn-src-all@freebsd.org Wed Jan 22 02:06:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8520E229B90; Wed, 22 Jan 2020 02:06:35 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482TKl2yNqz4MFl; Wed, 22 Jan 2020 02:06:35 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60ABD1E25C; Wed, 22 Jan 2020 02:06:35 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00M26ZPR080186; Wed, 22 Jan 2020 02:06:35 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M26Zpa080185; Wed, 22 Jan 2020 02:06:35 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202001220206.00M26Zpa080185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Wed, 22 Jan 2020 02:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356966 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 356966 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 02:06:35 -0000 Author: bdragon Date: Wed Jan 22 02:06:34 2020 New Revision: 356966 URL: https://svnweb.freebsd.org/changeset/base/356966 Log: [PowerPC] libc backwards compatibility shim for auxv change As part of the FreeBSD powerpc* flag day (1300070), the auxv numbering was changed to match every other platform. See D20799 for more details on that change. While the kernel and rtld were adapted, libc was not, so old dynamic binaries broke for reasons other than the ABI change on powerpc64. Since it's possible to support nearly everything regarding old binaries by adding compatibility code to libc (as besides rtld, it is the main point where auxv is digested), we might as well provide compatibility code. The only unhandled case remaining should be "new format libraries that call elf_aux_info() which are dynamically linked to by old-format binaries", which should be quite rare. Reviewed by: jhibbits Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D23096 Modified: head/lib/libc/gen/auxv.c Modified: head/lib/libc/gen/auxv.c ============================================================================== --- head/lib/libc/gen/auxv.c Wed Jan 22 01:31:02 2020 (r356965) +++ head/lib/libc/gen/auxv.c Wed Jan 22 02:06:34 2020 (r356966) @@ -73,6 +73,12 @@ static char *canary, *pagesizes, *execpath; static void *timekeep; static u_long hwcap, hwcap2; +#ifdef __powerpc__ +static int powerpc_new_auxv_format = 0; +static void _init_aux_powerpc_fixup(void); +int _powerpc_elf_aux_info(int, void *, int); +#endif + static void init_aux(void) { @@ -125,11 +131,107 @@ init_aux(void) case AT_TIMEKEEP: timekeep = aux->a_un.a_ptr; break; +#ifdef __powerpc__ + /* + * Since AT_STACKPROT is always set, and the common + * value 23 is mutually exclusive with the legacy powerpc + * value 21, the existence of AT_STACKPROT proves we are + * on the common format. + */ + case AT_STACKPROT: /* 23 */ + powerpc_new_auxv_format = 1; + break; +#endif } } +#ifdef __powerpc__ + if (!powerpc_new_auxv_format) + _init_aux_powerpc_fixup(); +#endif } +#ifdef __powerpc__ +static void +_init_aux_powerpc_fixup(void) +{ + Elf_Auxinfo *aux; + + /* + * Before 1300070, PowerPC platforms had nonstandard numbering for + * the aux vector. When running old binaries, the kernel will pass + * the vector using the old numbering. Reload affected variables. + */ + for (aux = __elf_aux_vector; aux->a_type != AT_NULL; aux++) { + switch (aux->a_type) { + case AT_OLD_CANARY: + canary = (char *)(aux->a_un.a_ptr); + break; + case AT_OLD_CANARYLEN: + canary_len = aux->a_un.a_val; + break; + case AT_OLD_EXECPATH: + execpath = (char *)(aux->a_un.a_ptr); + break; + case AT_OLD_PAGESIZES: + pagesizes = (char *)(aux->a_un.a_ptr); + break; + case AT_OLD_PAGESIZESLEN: + pagesizes_len = aux->a_un.a_val; + break; + case AT_OLD_OSRELDATE: + osreldate = aux->a_un.a_val; + break; + case AT_OLD_NCPUS: + ncpus = aux->a_un.a_val; + break; + } + } +} + +int +_powerpc_elf_aux_info(int aux, void *buf, int buflen) +{ + + /* + * If we are in the old auxv format, we need to translate the aux + * parameter of elf_aux_info() calls into the common auxv format. + * Internal libc calls always use the common format, and they + * directly call _elf_aux_info instead of using the weak symbol. + */ + if (!powerpc_new_auxv_format) { + switch (aux) { + case AT_OLD_EXECPATH: + aux = AT_EXECPATH; + break; + case AT_OLD_CANARY: + aux = AT_CANARY; + break; + case AT_OLD_CANARYLEN: + aux = AT_CANARYLEN; + break; + case AT_OLD_OSRELDATE: + aux = AT_OSRELDATE; + break; + case AT_OLD_NCPUS: + aux = AT_NCPUS; + break; + case AT_OLD_PAGESIZES: + aux = AT_PAGESIZES; + break; + case AT_OLD_PAGESIZESLEN: + aux = AT_PAGESIZESLEN; + break; + case AT_OLD_STACKPROT: + aux = AT_STACKPROT; + break; + } + } + return _elf_aux_info(aux, buf, buflen); +} +__weak_reference(_powerpc_elf_aux_info, elf_aux_info); +#else __weak_reference(_elf_aux_info, elf_aux_info); +#endif int _elf_aux_info(int aux, void *buf, int buflen) From owner-svn-src-all@freebsd.org Wed Jan 22 02:28:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0D91229F53; Wed, 22 Jan 2020 02:28:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482TqC5l09z4Mxm; Wed, 22 Jan 2020 02:28:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB6601E601; Wed, 22 Jan 2020 02:28:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00M2SdUb092026; Wed, 22 Jan 2020 02:28:39 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M2SdnS092025; Wed, 22 Jan 2020 02:28:39 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001220228.00M2SdnS092025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 22 Jan 2020 02:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356967 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 356967 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 02:28:40 -0000 Author: glebius Date: Wed Jan 22 02:28:39 2020 New Revision: 356967 URL: https://svnweb.freebsd.org/changeset/base/356967 Log: Change argument order of epoch_call() to more natural, first function, then its argument. A miss from r356826. Modified: head/share/man/man9/epoch.9 Modified: head/share/man/man9/epoch.9 ============================================================================== --- head/share/man/man9/epoch.9 Wed Jan 22 02:06:34 2020 (r356966) +++ head/share/man/man9/epoch.9 Wed Jan 22 02:28:39 2020 (r356967) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 27, 2019 +.Dd January 16, 2020 .Dt EPOCH 9 .Os .Sh NAME @@ -60,6 +60,7 @@ struct epoch_context { }; .Ed .Vt typedef "struct epoch_context *epoch_context_t" ; +.Vt typedef "void epoch_callback_t(epoch_context_t)" ; .Bd -literal struct epoch_tracker; /* Opaque */ .Ed @@ -82,7 +83,7 @@ struct epoch_tracker; /* Opaque */ .Ft void .Fn epoch_wait_preempt "epoch_t epoch" .Ft void -.Fn epoch_call "epoch_t epoch" "epoch_context_t ctx" "void (*callback)(epoch_context_t)" +.Fn epoch_call "epoch_t epoch" "epoch_callback_t callback" "epoch_context_t ctx" .Ft void .Fn epoch_drain_callbacks "epoch_t epoch" .Ft int @@ -254,7 +255,7 @@ ifa_free(struct ifaddr *ifa) { if (refcount_release(&ifa->ifa_refcnt)) - epoch_call(net_epoch, &ifa->ifa_epoch_ctx, ifa_destroy); + epoch_call(net_epoch, ifa_destroy, &ifa->ifa_epoch_ctx); } void From owner-svn-src-all@freebsd.org Wed Jan 22 02:35:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 029FE22A168; Wed, 22 Jan 2020 02:35:40 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482TzH6JDfz4NL9; Wed, 22 Jan 2020 02:35:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D35831E7C7; Wed, 22 Jan 2020 02:35:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00M2Zdfo098064; Wed, 22 Jan 2020 02:35:39 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M2Zd0X098063; Wed, 22 Jan 2020 02:35:39 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001220235.00M2Zd0X098063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 22 Jan 2020 02:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356968 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 356968 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 02:35:40 -0000 Author: glebius Date: Wed Jan 22 02:35:39 2020 New Revision: 356968 URL: https://svnweb.freebsd.org/changeset/base/356968 Log: Unroll macro that is used just once. Not a functional change. Modified: head/sys/netinet6/ip6_mroute.c Modified: head/sys/netinet6/ip6_mroute.c ============================================================================== --- head/sys/netinet6/ip6_mroute.c Wed Jan 22 02:28:39 2020 (r356967) +++ head/sys/netinet6/ip6_mroute.c Wed Jan 22 02:35:39 2020 (r356968) @@ -1372,19 +1372,6 @@ ip6_mdq(struct mbuf *m, struct ifnet *ifp, struct mf6c u_int32_t iszone, idzone, oszone, odzone; int error = 0; -/* - * Macro to send packet on mif. Since RSVP packets don't get counted on - * input, they shouldn't get counted on output, so statistics keeping is - * separate. - */ - -#define MC6_SEND(ip6, mifp, m) do { \ - if ((mifp)->m6_flags & MIFF_REGISTER) \ - register_send((ip6), (mifp), (m)); \ - else \ - phyint_send((ip6), (mifp), (m)); \ -} while (/*CONSTCOND*/ 0) - /* * Don't forward if it didn't arrive from the parent mif * for its origin. @@ -1528,7 +1515,10 @@ ip6_mdq(struct mbuf *m, struct ifnet *ifp, struct mf6c mifp->m6_pkt_out++; mifp->m6_bytes_out += plen; - MC6_SEND(ip6, mifp, m); + if (mifp->m6_flags & MIFF_REGISTER) + register_send(ip6, mifp, m); + else + phyint_send(ip6, mifp, m); } } return (0); From owner-svn-src-all@freebsd.org Wed Jan 22 02:37:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AAF9122A1F3; Wed, 22 Jan 2020 02:37:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482V1m419Tz4NT6; Wed, 22 Jan 2020 02:37:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 80A2A1E7C8; Wed, 22 Jan 2020 02:37:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00M2bmGw098235; Wed, 22 Jan 2020 02:37:48 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M2bltO098231; Wed, 22 Jan 2020 02:37:47 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001220237.00M2bltO098231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 22 Jan 2020 02:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356969 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 356969 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 02:37:48 -0000 Author: glebius Date: Wed Jan 22 02:37:47 2020 New Revision: 356969 URL: https://svnweb.freebsd.org/changeset/base/356969 Log: Add some documenting NET_EPOCH_ASSERTs. Modified: head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet6/mld6.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Wed Jan 22 02:35:39 2020 (r356968) +++ head/sys/netinet/tcp_subr.c Wed Jan 22 02:37:47 2020 (r356969) @@ -1394,6 +1394,7 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcph bool incl_opts; KASSERT(tp != NULL || m != NULL, ("tcp_respond: tp and m both NULL")); + NET_EPOCH_ASSERT(); #ifdef INET6 isipv6 = ((struct ip *)ipgen)->ip_v == (IPV6_VERSION >> 4); Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Wed Jan 22 02:35:39 2020 (r356968) +++ head/sys/netinet/tcp_syncache.c Wed Jan 22 02:37:47 2020 (r356969) @@ -1751,6 +1751,9 @@ syncache_respond(struct syncache *sc, const struct mbu #ifdef INET6 struct ip6_hdr *ip6 = NULL; #endif + + NET_EPOCH_ASSERT(); + hlen = #ifdef INET6 (sc->sc_inc.inc_flags & INC_ISIPV6) ? sizeof(struct ip6_hdr) : Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Wed Jan 22 02:35:39 2020 (r356968) +++ head/sys/netinet6/mld6.c Wed Jan 22 02:37:47 2020 (r356969) @@ -3095,6 +3095,7 @@ mld_dispatch_packet(struct mbuf *m) uint32_t ifindex; CTR2(KTR_MLD, "%s: transmit %p", __func__, m); + NET_EPOCH_ASSERT(); /* * Set VNET image pointer from enqueued mbuf chain From owner-svn-src-all@freebsd.org Wed Jan 22 02:38:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F3FF922A27B; Wed, 22 Jan 2020 02:38:46 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482V2t68rwz4NbZ; Wed, 22 Jan 2020 02:38:46 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEB801E7C9; Wed, 22 Jan 2020 02:38:46 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00M2ck3b098337; Wed, 22 Jan 2020 02:38:46 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M2ckMH098336; Wed, 22 Jan 2020 02:38:46 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001220238.00M2ckMH098336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 22 Jan 2020 02:38:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356970 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 356970 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 02:38:47 -0000 Author: glebius Date: Wed Jan 22 02:38:46 2020 New Revision: 356970 URL: https://svnweb.freebsd.org/changeset/base/356970 Log: Add documenting NET_EPOCH_ASSERT() to tcp_drop(). Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Wed Jan 22 02:37:47 2020 (r356969) +++ head/sys/netinet/tcp_subr.c Wed Jan 22 02:38:46 2020 (r356970) @@ -1871,6 +1871,7 @@ tcp_drop(struct tcpcb *tp, int errno) { struct socket *so = tp->t_inpcb->inp_socket; + NET_EPOCH_ASSERT(); INP_INFO_LOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(tp->t_inpcb); From owner-svn-src-all@freebsd.org Wed Jan 22 05:31:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 83B1022CE47; Wed, 22 Jan 2020 05:31:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482YtL2yVBz4WMb; Wed, 22 Jan 2020 05:31:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60F0E2098F; Wed, 22 Jan 2020 05:31:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00M5VcTH008224; Wed, 22 Jan 2020 05:31:38 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M5VcC1008223; Wed, 22 Jan 2020 05:31:38 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001220531.00M5VcC1008223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 22 Jan 2020 05:31:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356971 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 356971 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 05:31:38 -0000 Author: glebius Date: Wed Jan 22 05:31:37 2020 New Revision: 356971 URL: https://svnweb.freebsd.org/changeset/base/356971 Log: In compatibility structure substitute 'struct callout_handle' to 'struct callout *' pointer of the same size. Modified: head/sys/cam/cam_compat.h Modified: head/sys/cam/cam_compat.h ============================================================================== --- head/sys/cam/cam_compat.h Wed Jan 22 02:38:46 2020 (r356970) +++ head/sys/cam/cam_compat.h Wed Jan 22 05:31:37 2020 (r356971) @@ -72,7 +72,7 @@ struct ccb_hdr_0x17 { ccb_ppriv_area periph_priv; ccb_spriv_area sim_priv; u_int32_t timeout; /* Hard timeout value in seconds */ - struct callout_handle timeout_ch; + struct callout *timeout_ch; }; struct ccb_pathinq_0x17 { From owner-svn-src-all@freebsd.org Wed Jan 22 05:32:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7AED522CED9; Wed, 22 Jan 2020 05:32:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482YvD2k0Jz4Wdr; Wed, 22 Jan 2020 05:32:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58597209D3; Wed, 22 Jan 2020 05:32:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00M5WOhn008947; Wed, 22 Jan 2020 05:32:24 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M5WOd2008946; Wed, 22 Jan 2020 05:32:24 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001220532.00M5WOd2008946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 22 Jan 2020 05:32:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356972 - head/sys/compat/ndis X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/compat/ndis X-SVN-Commit-Revision: 356972 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 05:32:24 -0000 Author: glebius Date: Wed Jan 22 05:32:23 2020 New Revision: 356972 URL: https://svnweb.freebsd.org/changeset/base/356972 Log: Remove comment that no longer describe reality. Modified: head/sys/compat/ndis/ntoskrnl_var.h Modified: head/sys/compat/ndis/ntoskrnl_var.h ============================================================================== --- head/sys/compat/ndis/ntoskrnl_var.h Wed Jan 22 05:31:37 2020 (r356971) +++ head/sys/compat/ndis/ntoskrnl_var.h Wed Jan 22 05:32:23 2020 (r356972) @@ -363,19 +363,6 @@ typedef struct nt_objref nt_objref; #define EVENT_TYPE_NOTIFY 0 #define EVENT_TYPE_SYNC 1 -/* - * We need to use the timeout()/untimeout() API for ktimers - * since timers can be initialized, but not destroyed (so - * malloc()ing our own callout structures would mean a leak, - * since there'd be no way to free() them). This means we - * need to use struct callout_handle, which is really just a - * pointer. To make it easier to deal with, we use a union - * to overlay the callout_handle over the k_timerlistentry. - * The latter is a list_entry, which is two pointers, so - * there's enough space available to hide a callout_handle - * there. - */ - struct ktimer { nt_dispatch_header k_header; uint64_t k_duetime; From owner-svn-src-all@freebsd.org Wed Jan 22 05:48:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0AB1B22D7C7; Wed, 22 Jan 2020 05:48:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482ZFD6YsBz4ZG5; Wed, 22 Jan 2020 05:48:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3C5920BE3; Wed, 22 Jan 2020 05:48:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00M5m08K017923; Wed, 22 Jan 2020 05:48:00 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M5m0hm017918; Wed, 22 Jan 2020 05:48:00 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001220548.00M5m0hm017918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 22 Jan 2020 05:48:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356973 - in head: . share/man/man9 sys/sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head: . share/man/man9 sys/sys X-SVN-Commit-Revision: 356973 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 05:48:01 -0000 Author: glebius Date: Wed Jan 22 05:47:59 2020 New Revision: 356973 URL: https://svnweb.freebsd.org/changeset/base/356973 Log: Remove struct callout_handle. Should have gone with r355732. Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile head/share/man/man9/callout.9 head/sys/sys/callout.h Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Jan 22 05:32:23 2020 (r356972) +++ head/ObsoleteFiles.inc Wed Jan 22 05:47:59 2020 (r356973) @@ -282,6 +282,7 @@ OLD_DIRS+=usr/lib/clang/9.0.0 # 20191214: Removal of sranddev(3) OLD_FILES+=usr/share/man/man3/sranddev.3.gz # 20191213: remove timeout(9) +OLD_FILES+=usr/share/man/man9/callout_handle_init.9.gz OLD_FILES+=usr/share/man/man9/timeout.9.gz OLD_FILES+=usr/share/man/man9/untimeout.9.gz # 20191128: Removal of trm(4) Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Wed Jan 22 05:32:23 2020 (r356972) +++ head/share/man/man9/Makefile Wed Jan 22 05:47:59 2020 (r356973) @@ -770,7 +770,6 @@ MLINKS+=callout.9 callout_active.9 \ callout.9 callout_async_drain.9 \ callout.9 callout_deactivate.9 \ callout.9 callout_drain.9 \ - callout.9 callout_handle_init.9 \ callout.9 callout_init.9 \ callout.9 callout_init_mtx.9 \ callout.9 callout_init_rm.9 \ Modified: head/share/man/man9/callout.9 ============================================================================== --- head/share/man/man9/callout.9 Wed Jan 22 05:32:23 2020 (r356972) +++ head/share/man/man9/callout.9 Wed Jan 22 05:47:59 2020 (r356973) @@ -37,7 +37,6 @@ .Nm callout_deactivate , .Nm callout_async_drain , .Nm callout_drain , -.Nm callout_handle_init , .Nm callout_init , .Nm callout_init_mtx , .Nm callout_init_rm , @@ -72,11 +71,6 @@ typedef void callout_func_t (void *); .Fn callout_async_drain "struct callout *c" "callout_func_t *drain" .Ft int .Fn callout_drain "struct callout *c" -.Ft void -.Fn callout_handle_init "struct callout_handle *handle" -.Bd -literal -struct callout_handle handle = CALLOUT_HANDLE_INITIALIZER(&handle); -.Ed .Ft void .Fn callout_init "struct callout *c" "int mpsafe" .Ft void Modified: head/sys/sys/callout.h ============================================================================== --- head/sys/sys/callout.h Wed Jan 22 05:32:23 2020 (r356972) +++ head/sys/sys/callout.h Wed Jan 22 05:47:59 2020 (r356973) @@ -62,10 +62,6 @@ #define C_PRECALC 0x0400 /* event time is pre-calculated. */ #define C_CATCH 0x0800 /* catch signals, used by pause_sbt(9) */ -struct callout_handle { - struct callout *callout; -}; - /* Flags for callout_stop_safe() */ #define CS_DRAIN 0x0001 /* callout_drain(), wait allowed */ #define CS_EXECUTING 0x0002 /* Positive return value indicates that From owner-svn-src-all@freebsd.org Wed Jan 22 05:51:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C90922DA79; Wed, 22 Jan 2020 05:51:25 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482ZK93jylz4Zc7; Wed, 22 Jan 2020 05:51:25 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A82220C41; Wed, 22 Jan 2020 05:51:25 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00M5pPRt018162; Wed, 22 Jan 2020 05:51:25 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M5pMjC018150; Wed, 22 Jan 2020 05:51:22 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001220551.00M5pMjC018150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 22 Jan 2020 05:51:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356974 - in head/sys: netinet netinet/tcp_stacks netinet6 X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: netinet netinet/tcp_stacks netinet6 X-SVN-Commit-Revision: 356974 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 05:51:25 -0000 Author: glebius Date: Wed Jan 22 05:51:22 2020 New Revision: 356974 URL: https://svnweb.freebsd.org/changeset/base/356974 Log: Make ip6_output() and ip_output() require network epoch. All callers that before may called into these functions without network epoch now must enter it. Modified: head/sys/netinet/ip_carp.c head/sys/netinet/ip_divert.c head/sys/netinet/ip_output.c head/sys/netinet/raw_ip.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_stacks/bbr.c head/sys/netinet/tcp_stacks/rack.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timer.c head/sys/netinet6/ip6_mroute.c head/sys/netinet6/ip6_output.c head/sys/netinet6/raw_ip6.c Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Wed Jan 22 05:47:59 2020 (r356973) +++ head/sys/netinet/ip_carp.c Wed Jan 22 05:51:22 2020 (r356974) @@ -904,6 +904,7 @@ carp_send_ad_locked(struct carp_softc *sc) { struct carp_header ch; struct timeval tv; + struct epoch_tracker et; struct ifaddr *ifa; struct carp_header *ch_ptr; struct mbuf *m; @@ -972,8 +973,10 @@ carp_send_ad_locked(struct carp_softc *sc) CARPSTATS_INC(carps_opackets); + NET_EPOCH_ENTER(et); carp_send_ad_error(sc, ip_output(m, NULL, NULL, IP_RAWOUTPUT, &sc->sc_carpdev->if_carp->cif_imo, NULL)); + NET_EPOCH_EXIT(et); } #endif /* INET */ #ifdef INET6 @@ -1031,8 +1034,10 @@ carp_send_ad_locked(struct carp_softc *sc) CARPSTATS_INC(carps_opackets6); + NET_EPOCH_ENTER(et); carp_send_ad_error(sc, ip6_output(m, NULL, NULL, 0, &sc->sc_carpdev->if_carp->cif_im6o, NULL, NULL)); + NET_EPOCH_EXIT(et); } #endif /* INET6 */ Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Wed Jan 22 05:47:59 2020 (r356973) +++ head/sys/netinet/ip_divert.c Wed Jan 22 05:51:22 2020 (r356974) @@ -307,6 +307,7 @@ static int div_output(struct socket *so, struct mbuf *m, struct sockaddr_in *sin, struct mbuf *control) { + struct epoch_tracker et; struct ip *const ip = mtod(m, struct ip *); struct m_tag *mtag; struct ipfw_rule_ref *dt; @@ -440,6 +441,7 @@ div_output(struct socket *so, struct mbuf *m, struct s } INP_RUNLOCK(inp); + NET_EPOCH_ENTER(et); switch (ip->ip_v) { case IPVERSION: error = ip_output(m, options, NULL, @@ -452,6 +454,7 @@ div_output(struct socket *so, struct mbuf *m, struct s break; #endif } + NET_EPOCH_EXIT(et); if (options != NULL) m_freem(options); } else { Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Wed Jan 22 05:47:59 2020 (r356973) +++ head/sys/netinet/ip_output.c Wed Jan 22 05:51:22 2020 (r356974) @@ -304,7 +304,6 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct rou struct ip_moptions *imo, struct inpcb *inp) { struct rm_priotracker in_ifa_tracker; - struct epoch_tracker et; struct ip *ip; struct ifnet *ifp = NULL; /* keep compiler happy */ struct mbuf *m0; @@ -323,6 +322,7 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct rou #endif M_ASSERTPKTHDR(m); + NET_EPOCH_ASSERT(); if (inp != NULL) { INP_LOCK_ASSERT(inp); @@ -375,7 +375,6 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct rou dst->sin_addr = ip->ip_dst; } gw = dst; - NET_EPOCH_ENTER(et); again: /* * Validate route against routing table additions; @@ -837,7 +836,6 @@ sendit: IPSTAT_INC(ips_fragmented); done: - NET_EPOCH_EXIT(et); return (error); bad: m_freem(m); Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Wed Jan 22 05:47:59 2020 (r356973) +++ head/sys/netinet/raw_ip.c Wed Jan 22 05:51:22 2020 (r356974) @@ -445,6 +445,7 @@ rip_input(struct mbuf **mp, int *offp, int proto) int rip_output(struct mbuf *m, struct socket *so, ...) { + struct epoch_tracker et; struct ip *ip; int error; struct inpcb *inp = sotoinpcb(so); @@ -584,8 +585,10 @@ rip_output(struct mbuf *m, struct socket *so, ...) mac_inpcb_create_mbuf(inp, m); #endif + NET_EPOCH_ENTER(et); error = ip_output(m, inp->inp_options, NULL, flags, inp->inp_moptions, inp); + NET_EPOCH_EXIT(et); INP_RUNLOCK(inp); return (error); } Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Wed Jan 22 05:47:59 2020 (r356973) +++ head/sys/netinet/tcp_output.c Wed Jan 22 05:51:22 2020 (r356974) @@ -193,6 +193,7 @@ cc_after_idle(struct tcpcb *tp) int tcp_output(struct tcpcb *tp) { + struct epoch_tracker et; struct socket *so = tp->t_inpcb->inp_socket; int32_t len; uint32_t recwin, sendwin; @@ -1371,6 +1372,7 @@ send: * m->m_pkthdr.len should have been set before checksum calculation, * because in6_cksum() need it. */ + NET_EPOCH_ENTER(et); #ifdef INET6 if (isipv6) { /* @@ -1456,6 +1458,7 @@ send: mtu = tp->t_inpcb->inp_route.ro_rt->rt_mtu; } #endif /* INET */ + NET_EPOCH_EXIT(et); out: /* Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Wed Jan 22 05:47:59 2020 (r356973) +++ head/sys/netinet/tcp_stacks/bbr.c Wed Jan 22 05:51:22 2020 (r356974) @@ -12091,6 +12091,7 @@ bbr_window_update_needed(struct tcpcb *tp, struct sock static int bbr_output_wtime(struct tcpcb *tp, const struct timeval *tv) { + struct epoch_tracker et; struct socket *so; int32_t len; uint32_t cts; @@ -13937,6 +13938,7 @@ send: * m->m_pkthdr.len should have been set before cksum calcuration, * because in6_cksum() need it. */ + NET_EPOCH_ENTER(et); #ifdef INET6 if (isipv6) { /* @@ -14014,6 +14016,7 @@ send: mtu = inp->inp_route.ro_rt->rt_mtu; } #endif /* INET */ + NET_EPOCH_EXIT(et); out: if (lgb) { Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Wed Jan 22 05:47:59 2020 (r356973) +++ head/sys/netinet/tcp_stacks/rack.c Wed Jan 22 05:51:22 2020 (r356974) @@ -8091,6 +8091,7 @@ old_method: static int rack_output(struct tcpcb *tp) { + struct epoch_tracker et; struct socket *so; uint32_t recwin, sendwin; uint32_t sb_offset; @@ -9733,6 +9734,7 @@ send: * m->m_pkthdr.len should have been set before cksum calcuration, * because in6_cksum() need it. */ + NET_EPOCH_ENTER(et); #ifdef INET6 if (isipv6) { /* @@ -9810,6 +9812,7 @@ send: mtu = inp->inp_route.ro_rt->rt_mtu; } #endif /* INET */ + NET_EPOCH_EXIT(et); out: if (lgb) { Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Wed Jan 22 05:47:59 2020 (r356973) +++ head/sys/netinet/tcp_syncache.c Wed Jan 22 05:51:22 2020 (r356974) @@ -467,6 +467,7 @@ syncache_timer(void *xsch) { struct syncache_head *sch = (struct syncache_head *)xsch; struct syncache *sc, *nsc; + struct epoch_tracker et; int tick = ticks; char *s; bool paused; @@ -526,7 +527,9 @@ syncache_timer(void *xsch) free(s, M_TCPLOG); } + NET_EPOCH_ENTER(et); syncache_respond(sc, NULL, TH_SYN|TH_ACK); + NET_EPOCH_EXIT(et); TCPSTAT_INC(tcps_sc_retransmitted); syncache_timeout(sc, sch, 0); } Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Wed Jan 22 05:47:59 2020 (r356973) +++ head/sys/netinet/tcp_timer.c Wed Jan 22 05:51:22 2020 (r356974) @@ -452,9 +452,11 @@ tcp_timer_keep(void *xtp) TCPSTAT_INC(tcps_keepprobe); t_template = tcpip_maketemplate(inp); if (t_template) { + NET_EPOCH_ENTER(et); tcp_respond(tp, t_template->tt_ipgen, &t_template->tt_t, (struct mbuf *)NULL, tp->rcv_nxt, tp->snd_una - 1, 0); + NET_EPOCH_EXIT(et); free(t_template, M_TEMP); } callout_reset(&tp->t_timers->tt_keep, TP_KEEPINTVL(tp), Modified: head/sys/netinet6/ip6_mroute.c ============================================================================== --- head/sys/netinet6/ip6_mroute.c Wed Jan 22 05:47:59 2020 (r356973) +++ head/sys/netinet6/ip6_mroute.c Wed Jan 22 05:51:22 2020 (r356974) @@ -1559,13 +1559,16 @@ phyint_send(struct ip6_hdr *ip6, struct mif6 *mifp, st */ if (m->m_pkthdr.rcvif == NULL) { struct ip6_moptions im6o; + struct epoch_tracker et; im6o.im6o_multicast_ifp = ifp; /* XXX: ip6_output will override ip6->ip6_hlim */ im6o.im6o_multicast_hlim = ip6->ip6_hlim; im6o.im6o_multicast_loop = 1; + NET_EPOCH_ENTER(et); error = ip6_output(mb_copy, NULL, NULL, IPV6_FORWARDING, &im6o, NULL, NULL); + NET_EPOCH_EXIT(et); MRT6_DLOG(DEBUG_XMIT, "mif %u err %d", (uint16_t)(mifp - mif6table), error); Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Wed Jan 22 05:47:59 2020 (r356973) +++ head/sys/netinet6/ip6_output.c Wed Jan 22 05:51:22 2020 (r356974) @@ -384,7 +384,6 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, struct mbuf *m = m0; struct mbuf *mprev = NULL; int hlen, tlen, len; - struct epoch_tracker et; struct route_in6 ip6route; struct rtentry *rt = NULL; struct sockaddr_in6 *dst, src_sa, dst_sa; @@ -405,7 +404,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, struct m_tag *fwd_tag = NULL; uint32_t id; - NET_EPOCH_ENTER(et); + NET_EPOCH_ASSERT(); if (inp != NULL) { INP_LOCK_ASSERT(inp); @@ -1189,7 +1188,6 @@ sendorfree: IP6STAT_INC(ip6s_fragmented); done: - NET_EPOCH_EXIT(et); if (ro == &ip6route) RO_RTFREE(ro); return (error); Modified: head/sys/netinet6/raw_ip6.c ============================================================================== --- head/sys/netinet6/raw_ip6.c Wed Jan 22 05:47:59 2020 (r356973) +++ head/sys/netinet6/raw_ip6.c Wed Jan 22 05:51:22 2020 (r356974) @@ -389,6 +389,7 @@ rip6_ctlinput(int cmd, struct sockaddr *sa, void *d) int rip6_output(struct mbuf *m, struct socket *so, ...) { + struct epoch_tracker et; struct mbuf *control; struct m_tag *mtag; struct sockaddr_in6 *dstsock; @@ -536,7 +537,9 @@ rip6_output(struct mbuf *m, struct socket *so, ...) } } + NET_EPOCH_ENTER(et); error = ip6_output(m, optp, NULL, 0, inp->in6p_moptions, &oifp, inp); + NET_EPOCH_EXIT(et); if (so->so_proto->pr_protocol == IPPROTO_ICMPV6) { if (oifp) icmp6_ifoutstat_inc(oifp, type, code); From owner-svn-src-all@freebsd.org Wed Jan 22 05:53:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBEAF22DC9F; Wed, 22 Jan 2020 05:53:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482ZML2r5Mz4Zxt; Wed, 22 Jan 2020 05:53:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CA6E20DB3; Wed, 22 Jan 2020 05:53:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00M5rIbb024734; Wed, 22 Jan 2020 05:53:18 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M5rHG4024077; Wed, 22 Jan 2020 05:53:17 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001220553.00M5rHG4024077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 22 Jan 2020 05:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356975 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 356975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 05:53:18 -0000 Author: glebius Date: Wed Jan 22 05:53:16 2020 New Revision: 356975 URL: https://svnweb.freebsd.org/changeset/base/356975 Log: Make tcp_output() require network epoch. Enter the epoch before calling into tcp_output() from those functions, that didn't do that before. This eliminates a bunch of epoch recursions in TCP. Modified: head/sys/netinet/tcp_output.c head/sys/netinet/tcp_stacks/bbr.c head/sys/netinet/tcp_stacks/rack.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/toecore.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Wed Jan 22 05:51:22 2020 (r356974) +++ head/sys/netinet/tcp_output.c Wed Jan 22 05:53:16 2020 (r356975) @@ -193,7 +193,6 @@ cc_after_idle(struct tcpcb *tp) int tcp_output(struct tcpcb *tp) { - struct epoch_tracker et; struct socket *so = tp->t_inpcb->inp_socket; int32_t len; uint32_t recwin, sendwin; @@ -233,6 +232,7 @@ tcp_output(struct tcpcb *tp) const bool hw_tls = false; #endif + NET_EPOCH_ASSERT(); INP_WLOCK_ASSERT(tp->t_inpcb); #ifdef TCP_OFFLOAD @@ -1372,7 +1372,6 @@ send: * m->m_pkthdr.len should have been set before checksum calculation, * because in6_cksum() need it. */ - NET_EPOCH_ENTER(et); #ifdef INET6 if (isipv6) { /* @@ -1458,7 +1457,6 @@ send: mtu = tp->t_inpcb->inp_route.ro_rt->rt_mtu; } #endif /* INET */ - NET_EPOCH_EXIT(et); out: /* Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Wed Jan 22 05:51:22 2020 (r356974) +++ head/sys/netinet/tcp_stacks/bbr.c Wed Jan 22 05:53:16 2020 (r356975) @@ -12091,7 +12091,6 @@ bbr_window_update_needed(struct tcpcb *tp, struct sock static int bbr_output_wtime(struct tcpcb *tp, const struct timeval *tv) { - struct epoch_tracker et; struct socket *so; int32_t len; uint32_t cts; @@ -13938,7 +13937,6 @@ send: * m->m_pkthdr.len should have been set before cksum calcuration, * because in6_cksum() need it. */ - NET_EPOCH_ENTER(et); #ifdef INET6 if (isipv6) { /* @@ -14016,7 +14014,6 @@ send: mtu = inp->inp_route.ro_rt->rt_mtu; } #endif /* INET */ - NET_EPOCH_EXIT(et); out: if (lgb) { @@ -14464,6 +14461,8 @@ bbr_output(struct tcpcb *tp) int32_t ret; struct timeval tv; struct tcp_bbr *bbr; + + NET_EPOCH_ASSERT(); bbr = (struct tcp_bbr *)tp->t_fb_ptr; INP_WLOCK_ASSERT(tp->t_inpcb); Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Wed Jan 22 05:51:22 2020 (r356974) +++ head/sys/netinet/tcp_stacks/rack.c Wed Jan 22 05:53:16 2020 (r356975) @@ -8091,7 +8091,6 @@ old_method: static int rack_output(struct tcpcb *tp) { - struct epoch_tracker et; struct socket *so; uint32_t recwin, sendwin; uint32_t sb_offset; @@ -8155,8 +8154,10 @@ rack_output(struct tcpcb *tp) #ifdef KERN_TLS hw_tls = (so->so_snd.sb_flags & SB_TLS_IFNET) != 0; #endif - + + NET_EPOCH_ASSERT(); INP_WLOCK_ASSERT(inp); + #ifdef TCP_OFFLOAD if (tp->t_flags & TF_TOE) return (tcp_offload_output(tp)); @@ -9734,7 +9735,6 @@ send: * m->m_pkthdr.len should have been set before cksum calcuration, * because in6_cksum() need it. */ - NET_EPOCH_ENTER(et); #ifdef INET6 if (isipv6) { /* @@ -9812,7 +9812,6 @@ send: mtu = inp->inp_route.ro_rt->rt_mtu; } #endif /* INET */ - NET_EPOCH_EXIT(et); out: if (lgb) { Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Wed Jan 22 05:51:22 2020 (r356974) +++ head/sys/netinet/tcp_timer.c Wed Jan 22 05:53:16 2020 (r356975) @@ -251,6 +251,7 @@ int tcp_totbackoff = 2559; /* sum of tcp_backoff[] */ void tcp_timer_delack(void *xtp) { + struct epoch_tracker et; struct tcpcb *tp = xtp; struct inpcb *inp; CURVNET_SET(tp->t_vnet); @@ -272,8 +273,10 @@ tcp_timer_delack(void *xtp) } tp->t_flags |= TF_ACKNOW; TCPSTAT_INC(tcps_delack); + NET_EPOCH_ENTER(et); (void) tp->t_fb->tfb_tcp_output(tp); INP_WUNLOCK(inp); + NET_EPOCH_EXIT(et); CURVNET_RESTORE(); } @@ -570,7 +573,9 @@ tcp_timer_persist(void *xtp) } tcp_setpersist(tp); tp->t_flags |= TF_FORCEDATA; + NET_EPOCH_ENTER(et); (void) tp->t_fb->tfb_tcp_output(tp); + NET_EPOCH_EXIT(et); tp->t_flags &= ~TF_FORCEDATA; #ifdef TCPDEBUG @@ -824,9 +829,9 @@ tcp_timer_rexmt(void * xtp) tp->t_rtttime = 0; cc_cong_signal(tp, NULL, CC_RTO); - + NET_EPOCH_ENTER(et); (void) tp->t_fb->tfb_tcp_output(tp); - + NET_EPOCH_EXIT(et); #ifdef TCPDEBUG if (tp != NULL && (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)) tcp_trace(TA_USER, ostate, tp, (void *)0, (struct tcphdr *)0, Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Wed Jan 22 05:51:22 2020 (r356974) +++ head/sys/netinet/tcp_usrreq.c Wed Jan 22 05:53:16 2020 (r356975) @@ -531,6 +531,7 @@ out: static int tcp_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td) { + struct epoch_tracker et; int error = 0; struct inpcb *inp; struct tcpcb *tp = NULL; @@ -571,7 +572,9 @@ tcp_usr_connect(struct socket *so, struct sockaddr *na goto out; #endif tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp)); + NET_EPOCH_ENTER(et); error = tp->t_fb->tfb_tcp_output(tp); + NET_EPOCH_EXIT(et); out: TCPDEBUG2(PRU_CONNECT); TCP_PROBE2(debug__user, tp, PRU_CONNECT); @@ -584,6 +587,7 @@ out: static int tcp6_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td) { + struct epoch_tracker et; int error = 0; struct inpcb *inp; struct tcpcb *tp = NULL; @@ -654,7 +658,9 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *n (error = tcp_offload_connect(so, nam)) == 0) goto out; #endif + NET_EPOCH_ENTER(et); error = tp->t_fb->tfb_tcp_output(tp); + NET_EPOCH_EXIT(et); goto out; } else { if ((inp->inp_vflag & INP_IPV6) == 0) { @@ -677,8 +683,9 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *n goto out; #endif tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp)); + NET_EPOCH_ENTER(et); error = tp->t_fb->tfb_tcp_output(tp); - + NET_EPOCH_EXIT(et); out: /* * If the implicit bind in the connect call fails, restore @@ -882,6 +889,7 @@ out: static int tcp_usr_rcvd(struct socket *so, int flags) { + struct epoch_tracker et; struct inpcb *inp; struct tcpcb *tp = NULL; int error = 0; @@ -911,8 +919,9 @@ tcp_usr_rcvd(struct socket *so, int flags) tcp_offload_rcvd(tp); else #endif + NET_EPOCH_ENTER(et); tp->t_fb->tfb_tcp_output(tp); - + NET_EPOCH_EXIT(et); out: TCPDEBUG2(PRU_RCVD); TCP_PROBE2(debug__user, tp, PRU_RCVD); @@ -953,8 +962,7 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf * We require the pcbinfo "read lock" if we will close the socket * as part of this call. */ - if (flags & PRUS_EOF) - NET_EPOCH_ENTER(et); + NET_EPOCH_ENTER(et); inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp_usr_send: inp == NULL")); INP_WLOCK(inp); @@ -1240,14 +1248,14 @@ out: TCP_PROBE2(debug__user, tp, (flags & PRUS_OOB) ? PRU_SENDOOB : ((flags & PRUS_EOF) ? PRU_SEND_EOF : PRU_SEND)); INP_WUNLOCK(inp); - if (flags & PRUS_EOF) - NET_EPOCH_EXIT(et); + NET_EPOCH_EXIT(et); return (error); } static int tcp_usr_ready(struct socket *so, struct mbuf *m, int count) { + struct epoch_tracker et; struct inpcb *inp; struct tcpcb *tp; int error; @@ -1264,8 +1272,11 @@ tcp_usr_ready(struct socket *so, struct mbuf *m, int c SOCKBUF_LOCK(&so->so_snd); error = sbready(&so->so_snd, m, count); SOCKBUF_UNLOCK(&so->so_snd); - if (error == 0) + if (error == 0) { + NET_EPOCH_ENTER(et); error = tp->t_fb->tfb_tcp_output(tp); + NET_EPOCH_EXIT(et); + } INP_WUNLOCK(inp); return (error); @@ -1921,8 +1932,13 @@ unlock_and_done: tp->t_flags |= TF_NOPUSH; else if (tp->t_flags & TF_NOPUSH) { tp->t_flags &= ~TF_NOPUSH; - if (TCPS_HAVEESTABLISHED(tp->t_state)) + if (TCPS_HAVEESTABLISHED(tp->t_state)) { + struct epoch_tracker et; + + NET_EPOCH_ENTER(et); error = tp->t_fb->tfb_tcp_output(tp); + NET_EPOCH_EXIT(et); + } } goto unlock_and_done; Modified: head/sys/netinet/toecore.c ============================================================================== --- head/sys/netinet/toecore.c Wed Jan 22 05:51:22 2020 (r356974) +++ head/sys/netinet/toecore.c Wed Jan 22 05:53:16 2020 (r356975) @@ -503,6 +503,7 @@ void toe_connect_failed(struct toedev *tod, struct inpcb *inp, int err) { + NET_EPOCH_ASSERT(); INP_WLOCK_ASSERT(inp); if (!(inp->inp_flags & INP_DROPPED)) { @@ -527,7 +528,6 @@ toe_connect_failed(struct toedev *tod, struct inpcb *i (void) tp->t_fb->tfb_tcp_output(tp); } else { - NET_EPOCH_ASSERT(); tp = tcp_drop(tp, err); if (tp == NULL) INP_WLOCK(inp); /* re-acquire */ From owner-svn-src-all@freebsd.org Wed Jan 22 05:54:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD9C222DDFF; Wed, 22 Jan 2020 05:54:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482ZPG56Vvz4bK6; Wed, 22 Jan 2020 05:54:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAC3B20DB8; Wed, 22 Jan 2020 05:54:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00M5sw9j025561; Wed, 22 Jan 2020 05:54:58 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M5swhR025560; Wed, 22 Jan 2020 05:54:58 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001220554.00M5swhR025560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 22 Jan 2020 05:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356976 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 356976 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 05:54:58 -0000 Author: glebius Date: Wed Jan 22 05:54:58 2020 New Revision: 356976 URL: https://svnweb.freebsd.org/changeset/base/356976 Log: Inline tcp_attach() into tcp_usr_attach(). Not a functional change. Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Wed Jan 22 05:53:16 2020 (r356975) +++ head/sys/netinet/tcp_usrreq.c Wed Jan 22 05:54:58 2020 (r356976) @@ -121,7 +121,6 @@ __FBSDID("$FreeBSD$"); /* * TCP protocol interface to socket abstraction. */ -static int tcp_attach(struct socket *); #ifdef INET static int tcp_connect(struct tcpcb *, struct sockaddr *, struct thread *td); @@ -152,6 +151,7 @@ static void tcp_fill_info(struct tcpcb *, struct tcp_i static int tcp_usr_attach(struct socket *so, int proto, struct thread *td) { + struct epoch_tracker et; struct inpcb *inp; struct tcpcb *tp = NULL; int error; @@ -161,19 +161,49 @@ tcp_usr_attach(struct socket *so, int proto, struct th KASSERT(inp == NULL, ("tcp_usr_attach: inp != NULL")); TCPDEBUG1(); - error = tcp_attach(so); - if (error) - goto out; + if (so->so_snd.sb_hiwat == 0 || so->so_rcv.sb_hiwat == 0) { + error = soreserve(so, V_tcp_sendspace, V_tcp_recvspace); + if (error) + goto out; + } + so->so_rcv.sb_flags |= SB_AUTOSIZE; + so->so_snd.sb_flags |= SB_AUTOSIZE; + NET_EPOCH_ENTER(et); + error = in_pcballoc(so, &V_tcbinfo); + if (error) { + NET_EPOCH_EXIT(et); + goto out; + } + inp = sotoinpcb(so); +#ifdef INET6 + if (inp->inp_vflag & INP_IPV6PROTO) { + inp->inp_vflag |= INP_IPV6; + if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0) + inp->inp_vflag |= INP_IPV4; + inp->in6p_hops = -1; /* use kernel default */ + } + else +#endif + inp->inp_vflag |= INP_IPV4; + tp = tcp_newtcpcb(inp); + if (tp == NULL) { + in_pcbdetach(inp); + in_pcbfree(inp); + NET_EPOCH_EXIT(et); + error = ENOBUFS; + goto out; + } + tp->t_state = TCPS_CLOSED; + INP_WUNLOCK(inp); + NET_EPOCH_EXIT(et); + TCPSTATES_INC(TCPS_CLOSED); if ((so->so_options & SO_LINGER) && so->so_linger == 0) so->so_linger = TCP_LINGERTIME; - - inp = sotoinpcb(so); - tp = intotcpcb(inp); out: TCPDEBUG2(PRU_ATTACH); TCP_PROBE2(debug__user, tp, PRU_ATTACH); - return error; + return (error); } /* @@ -2403,57 +2433,6 @@ unhold: } #undef INP_WLOCK_RECHECK #undef INP_WLOCK_RECHECK_CLEANUP - -/* - * Attach TCP protocol to socket, allocating - * internet protocol control block, tcp control block, - * bufer space, and entering LISTEN state if to accept connections. - */ -static int -tcp_attach(struct socket *so) -{ - struct tcpcb *tp; - struct inpcb *inp; - struct epoch_tracker et; - int error; - - if (so->so_snd.sb_hiwat == 0 || so->so_rcv.sb_hiwat == 0) { - error = soreserve(so, V_tcp_sendspace, V_tcp_recvspace); - if (error) - return (error); - } - so->so_rcv.sb_flags |= SB_AUTOSIZE; - so->so_snd.sb_flags |= SB_AUTOSIZE; - NET_EPOCH_ENTER(et); - error = in_pcballoc(so, &V_tcbinfo); - if (error) { - NET_EPOCH_EXIT(et); - return (error); - } - inp = sotoinpcb(so); -#ifdef INET6 - if (inp->inp_vflag & INP_IPV6PROTO) { - inp->inp_vflag |= INP_IPV6; - if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0) - inp->inp_vflag |= INP_IPV4; - inp->in6p_hops = -1; /* use kernel default */ - } - else -#endif - inp->inp_vflag |= INP_IPV4; - tp = tcp_newtcpcb(inp); - if (tp == NULL) { - in_pcbdetach(inp); - in_pcbfree(inp); - NET_EPOCH_EXIT(et); - return (ENOBUFS); - } - tp->t_state = TCPS_CLOSED; - INP_WUNLOCK(inp); - NET_EPOCH_EXIT(et); - TCPSTATES_INC(TCPS_CLOSED); - return (0); -} /* * Initiate (or continue) disconnect. From owner-svn-src-all@freebsd.org Wed Jan 22 05:58:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE83822DEF3; Wed, 22 Jan 2020 05:58:29 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482ZTK65vsz4bTX; Wed, 22 Jan 2020 05:58:29 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCB7F20DBD; Wed, 22 Jan 2020 05:58:29 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00M5wTxC025794; Wed, 22 Jan 2020 05:58:29 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M5wTP9025793; Wed, 22 Jan 2020 05:58:29 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001220558.00M5wTP9025793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 22 Jan 2020 05:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356977 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 356977 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 05:58:30 -0000 Author: glebius Date: Wed Jan 22 05:58:29 2020 New Revision: 356977 URL: https://svnweb.freebsd.org/changeset/base/356977 Log: Relax locking requirements for in_pcballoc(). All pcbinfo fields modified by this function are protected by the PCB list lock that is acquired inside the function. This could have been done even before epoch changes, after r286227. Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Wed Jan 22 05:54:58 2020 (r356976) +++ head/sys/netinet/in_pcb.c Wed Jan 22 05:58:29 2020 (r356977) @@ -512,14 +512,6 @@ in_pcballoc(struct socket *so, struct inpcbinfo *pcbin struct inpcb *inp; int error; -#ifdef INVARIANTS - if (pcbinfo == &V_tcbinfo) { - NET_EPOCH_ASSERT(); - } else { - INP_INFO_WLOCK_ASSERT(pcbinfo); - } -#endif - error = 0; inp = uma_zalloc(pcbinfo->ipi_zone, M_NOWAIT); if (inp == NULL) From owner-svn-src-all@freebsd.org Wed Jan 22 06:01:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A140A22E0FF; Wed, 22 Jan 2020 06:01:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482ZXk3qgZz4c3Q; Wed, 22 Jan 2020 06:01:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EA4320F39; Wed, 22 Jan 2020 06:01:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00M61QR4027812; Wed, 22 Jan 2020 06:01:26 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M61QVQ027811; Wed, 22 Jan 2020 06:01:26 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001220601.00M61QVQ027811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 22 Jan 2020 06:01:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356978 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 356978 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 06:01:26 -0000 Author: glebius Date: Wed Jan 22 06:01:26 2020 New Revision: 356978 URL: https://svnweb.freebsd.org/changeset/base/356978 Log: tcp_usr_attach() doesn't need network epoch. in_pcbfree() and in_pcbdetach() perform all necessary synchronization themselves. Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Wed Jan 22 05:58:29 2020 (r356977) +++ head/sys/netinet/tcp_usrreq.c Wed Jan 22 06:01:26 2020 (r356978) @@ -151,7 +151,6 @@ static void tcp_fill_info(struct tcpcb *, struct tcp_i static int tcp_usr_attach(struct socket *so, int proto, struct thread *td) { - struct epoch_tracker et; struct inpcb *inp; struct tcpcb *tp = NULL; int error; @@ -169,12 +168,9 @@ tcp_usr_attach(struct socket *so, int proto, struct th so->so_rcv.sb_flags |= SB_AUTOSIZE; so->so_snd.sb_flags |= SB_AUTOSIZE; - NET_EPOCH_ENTER(et); error = in_pcballoc(so, &V_tcbinfo); - if (error) { - NET_EPOCH_EXIT(et); + if (error) goto out; - } inp = sotoinpcb(so); #ifdef INET6 if (inp->inp_vflag & INP_IPV6PROTO) { @@ -188,15 +184,13 @@ tcp_usr_attach(struct socket *so, int proto, struct th inp->inp_vflag |= INP_IPV4; tp = tcp_newtcpcb(inp); if (tp == NULL) { + error = ENOBUFS; in_pcbdetach(inp); in_pcbfree(inp); - NET_EPOCH_EXIT(et); - error = ENOBUFS; goto out; } tp->t_state = TCPS_CLOSED; INP_WUNLOCK(inp); - NET_EPOCH_EXIT(et); TCPSTATES_INC(TCPS_CLOSED); if ((so->so_options & SO_LINGER) && so->so_linger == 0) so->so_linger = TCP_LINGERTIME; From owner-svn-src-all@freebsd.org Wed Jan 22 06:03:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF02522E402; Wed, 22 Jan 2020 06:03:45 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482ZbP540Qz4cbv; Wed, 22 Jan 2020 06:03:45 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A924F20FA5; Wed, 22 Jan 2020 06:03:45 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00M63jbW032939; Wed, 22 Jan 2020 06:03:45 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M63jTD032938; Wed, 22 Jan 2020 06:03:45 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001220603.00M63jTD032938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 22 Jan 2020 06:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356979 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 356979 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 06:03:45 -0000 Author: glebius Date: Wed Jan 22 06:03:45 2020 New Revision: 356979 URL: https://svnweb.freebsd.org/changeset/base/356979 Log: The network epoch changes in the TCP stack combined with old r286227, actually make removal of a PCB not needing ipi_lock in any form. The ipi_list_lock is sufficient. Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Wed Jan 22 06:01:26 2020 (r356978) +++ head/sys/netinet/in_pcb.c Wed Jan 22 06:03:45 2020 (r356979) @@ -1639,13 +1639,6 @@ in_pcbfree(struct inpcb *inp) return; } -#ifdef INVARIANTS - if (pcbinfo == &V_tcbinfo) { - INP_INFO_LOCK_ASSERT(pcbinfo); - } else { - INP_INFO_WLOCK_ASSERT(pcbinfo); - } -#endif INP_WLOCK_ASSERT(inp); INP_LIST_WLOCK(pcbinfo); in_pcbremlists(inp); @@ -2640,14 +2633,6 @@ static void in_pcbremlists(struct inpcb *inp) { struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; - -#ifdef INVARIANTS - if (pcbinfo == &V_tcbinfo) { - NET_EPOCH_ASSERT(); - } else { - INP_INFO_WLOCK_ASSERT(pcbinfo); - } -#endif INP_WLOCK_ASSERT(inp); INP_LIST_WLOCK_ASSERT(pcbinfo); From owner-svn-src-all@freebsd.org Wed Jan 22 06:04:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C0AD22E546; Wed, 22 Jan 2020 06:04:57 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482Zcn1L5cz4cp6; Wed, 22 Jan 2020 06:04:57 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 293B720FAB; Wed, 22 Jan 2020 06:04:57 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00M64uZa033031; Wed, 22 Jan 2020 06:04:56 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M64u7q033030; Wed, 22 Jan 2020 06:04:56 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001220604.00M64u7q033030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 22 Jan 2020 06:04:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356980 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 356980 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 06:04:57 -0000 Author: glebius Date: Wed Jan 22 06:04:56 2020 New Revision: 356980 URL: https://svnweb.freebsd.org/changeset/base/356980 Log: Don't enter network epoch in tcp_usr_detach. A PCB removal doesn't require that. Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Wed Jan 22 06:03:45 2020 (r356979) +++ head/sys/netinet/tcp_usrreq.c Wed Jan 22 06:04:56 2020 (r356980) @@ -214,7 +214,6 @@ tcp_detach(struct socket *so, struct inpcb *inp) { struct tcpcb *tp; - INP_INFO_LOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); KASSERT(so->so_pcb == inp, ("tcp_detach: so_pcb != inp")); @@ -311,21 +310,13 @@ static void tcp_usr_detach(struct socket *so) { struct inpcb *inp; - int rlock = 0; - struct epoch_tracker et; inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp_usr_detach: inp == NULL")); - if (!INP_INFO_WLOCKED(&V_tcbinfo)) { - NET_EPOCH_ENTER(et); - rlock = 1; - } INP_WLOCK(inp); KASSERT(inp->inp_socket != NULL, ("tcp_usr_detach: inp_socket == NULL")); tcp_detach(so, inp); - if (rlock) - NET_EPOCH_EXIT(et); } #ifdef INET From owner-svn-src-all@freebsd.org Wed Jan 22 06:06:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E3B522E5DF; Wed, 22 Jan 2020 06:06:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482ZfW756Jz4cyC; Wed, 22 Jan 2020 06:06:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE6D120FB4; Wed, 22 Jan 2020 06:06:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00M66RVE033161; Wed, 22 Jan 2020 06:06:27 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M66RIg033160; Wed, 22 Jan 2020 06:06:27 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001220606.00M66RIg033160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 22 Jan 2020 06:06:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356981 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 356981 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 06:06:28 -0000 Author: glebius Date: Wed Jan 22 06:06:27 2020 New Revision: 356981 URL: https://svnweb.freebsd.org/changeset/base/356981 Log: Re-absorb tcp_detach() back into tcp_usr_detach() as the comment suggests. Not a functional change. Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Wed Jan 22 06:04:56 2020 (r356980) +++ head/sys/netinet/tcp_usrreq.c Wed Jan 22 06:06:27 2020 (r356981) @@ -201,24 +201,23 @@ out: } /* - * tcp_detach is called when the socket layer loses its final reference + * tcp_usr_detach is called when the socket layer loses its final reference * to the socket, be it a file descriptor reference, a reference from TCP, * etc. At this point, there is only one case in which we will keep around * inpcb state: time wait. - * - * This function can probably be re-absorbed back into tcp_usr_detach() now - * that there is a single detach path. */ static void -tcp_detach(struct socket *so, struct inpcb *inp) +tcp_usr_detach(struct socket *so) { + struct inpcb *inp; struct tcpcb *tp; - INP_WLOCK_ASSERT(inp); + inp = sotoinpcb(so); + KASSERT(inp != NULL, ("%s: inp == NULL", __func__)); + INP_WLOCK(inp); + KASSERT(so->so_pcb == inp && inp->inp_socket == so, + ("%s: socket %p inp %p mismatch", __func__, so, inp)); - KASSERT(so->so_pcb == inp, ("tcp_detach: so_pcb != inp")); - KASSERT(inp->inp_socket == so, ("tcp_detach: inp_socket != so")); - tp = intotcpcb(inp); if (inp->inp_flags & INP_TIMEWAIT) { @@ -237,16 +236,16 @@ tcp_detach(struct socket *so, struct inpcb *inp) * Astute question indeed, from twtcp perspective there are * four cases to consider: * - * #1 tcp_detach is called at tcptw creation time by + * #1 tcp_usr_detach is called at tcptw creation time by * tcp_twstart, then do not discard the newly created tcptw * and leave inpcb present until timewait ends - * #2 tcp_detach is called at tcptw creation time by + * #2 tcp_usr_detach is called at tcptw creation time by * tcp_twstart, but connection is local and tw will be * discarded immediately - * #3 tcp_detach is called at timewait end (or reuse) by + * #3 tcp_usr_detach is called at timewait end (or reuse) by * tcp_twclose, then the tcptw has already been discarded * (or reused) and inpcb is freed here - * #4 tcp_detach is called() after timewait ends (or reuse) + * #4 tcp_usr_detach is called() after timewait ends (or reuse) * (e.g. by soclose), then tcptw has already been discarded * (or reused) and inpcb is freed here * @@ -297,26 +296,6 @@ tcp_detach(struct socket *so, struct inpcb *inp) INP_WUNLOCK(inp); } } -} - -/* - * pru_detach() detaches the TCP protocol from the socket. - * If the protocol state is non-embryonic, then can't - * do this directly: have to initiate a pru_disconnect(), - * which may finish later; embryonic TCB's can just - * be discarded here. - */ -static void -tcp_usr_detach(struct socket *so) -{ - struct inpcb *inp; - - inp = sotoinpcb(so); - KASSERT(inp != NULL, ("tcp_usr_detach: inp == NULL")); - INP_WLOCK(inp); - KASSERT(inp->inp_socket != NULL, - ("tcp_usr_detach: inp_socket == NULL")); - tcp_detach(so, inp); } #ifdef INET From owner-svn-src-all@freebsd.org Wed Jan 22 06:07:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41C1322E688; Wed, 22 Jan 2020 06:07:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482Zgh0xQzz4d6r; Wed, 22 Jan 2020 06:07:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B0B020FB9; Wed, 22 Jan 2020 06:07:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00M67Rw1033256; Wed, 22 Jan 2020 06:07:27 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M67RHH033255; Wed, 22 Jan 2020 06:07:27 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001220607.00M67RHH033255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 22 Jan 2020 06:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356982 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 356982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 06:07:28 -0000 Author: glebius Date: Wed Jan 22 06:07:27 2020 New Revision: 356982 URL: https://svnweb.freebsd.org/changeset/base/356982 Log: Remove extraneous NET_EPOCH_ASSERT - the full function is covered. Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Wed Jan 22 06:06:27 2020 (r356981) +++ head/sys/netinet/tcp_usrreq.c Wed Jan 22 06:07:27 2020 (r356982) @@ -1147,7 +1147,6 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf * Close the send side of the connection after * the data is sent. */ - NET_EPOCH_ASSERT(); socantsendmore(so); tcp_usrclosed(tp); } From owner-svn-src-all@freebsd.org Wed Jan 22 06:10:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBACB22E797; Wed, 22 Jan 2020 06:10:42 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482ZlQ4nMLz4dGg; Wed, 22 Jan 2020 06:10:42 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F74720FCB; Wed, 22 Jan 2020 06:10:42 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00M6AgG7034936; Wed, 22 Jan 2020 06:10:42 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00M6AfiD034933; Wed, 22 Jan 2020 06:10:41 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001220610.00M6AfiD034933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 22 Jan 2020 06:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356983 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 356983 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 06:10:42 -0000 Author: glebius Date: Wed Jan 22 06:10:41 2020 New Revision: 356983 URL: https://svnweb.freebsd.org/changeset/base/356983 Log: Make in_pcbladdr() require network epoch entered by its callers. Together with this widen network epoch coverage up to tcp_connect() and udp_connect(). Revisions from r356974 and up to this revision cover D23187. Differential Revision: https://reviews.freebsd.org/D23187 Modified: head/sys/netinet/in_pcb.c head/sys/netinet/raw_ip.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Wed Jan 22 06:07:27 2020 (r356982) +++ head/sys/netinet/in_pcb.c Wed Jan 22 06:10:41 2020 (r356983) @@ -1028,9 +1028,9 @@ in_pcbladdr(struct inpcb *inp, struct in_addr *faddr, struct sockaddr *sa; struct sockaddr_in *sin; struct route sro; - struct epoch_tracker et; int error; + NET_EPOCH_ASSERT(); KASSERT(laddr != NULL, ("%s: laddr NULL", __func__)); /* * Bypass source address selection and use the primary jail IP @@ -1064,7 +1064,6 @@ in_pcbladdr(struct inpcb *inp, struct in_addr *faddr, * network and try to find a corresponding interface to take * the source address from. */ - NET_EPOCH_ENTER(et); if (sro.ro_rt == NULL || sro.ro_rt->rt_ifp == NULL) { struct in_ifaddr *ia; struct ifnet *ifp; @@ -1228,7 +1227,6 @@ in_pcbladdr(struct inpcb *inp, struct in_addr *faddr, } done: - NET_EPOCH_EXIT(et); if (sro.ro_rt != NULL) RTFREE(sro.ro_rt); return (error); @@ -1266,6 +1264,7 @@ in_pcbconnect_setup(struct inpcb *inp, struct sockaddr * Because a global state change doesn't actually occur here, a read * lock is sufficient. */ + NET_EPOCH_ASSERT(); INP_LOCK_ASSERT(inp); INP_HASH_LOCK_ASSERT(inp->inp_pcbinfo); Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Wed Jan 22 06:07:27 2020 (r356982) +++ head/sys/netinet/raw_ip.c Wed Jan 22 06:10:41 2020 (r356983) @@ -491,8 +491,10 @@ rip_output(struct mbuf *m, struct socket *so, ...) * want to see from jails. */ if (ip->ip_src.s_addr == INADDR_ANY) { - error = in_pcbladdr(inp, &ip->ip_dst, &ip->ip_src, - inp->inp_cred); + NET_EPOCH_ENTER(et); + error = in_pcbladdr(inp, &ip->ip_dst, + &ip->ip_src, inp->inp_cred); + NET_EPOCH_EXIT(et); } else { error = prison_local_ip4(inp->inp_cred, &ip->ip_src); Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Wed Jan 22 06:07:27 2020 (r356982) +++ head/sys/netinet/tcp_usrreq.c Wed Jan 22 06:10:41 2020 (r356983) @@ -557,17 +557,18 @@ tcp_usr_connect(struct socket *so, struct sockaddr *na } tp = intotcpcb(inp); TCPDEBUG1(); + NET_EPOCH_ENTER(et); if ((error = tcp_connect(tp, nam, td)) != 0) - goto out; + goto out_in_epoch; #ifdef TCP_OFFLOAD if (registered_toedevs > 0 && (so->so_options & SO_NO_OFFLOAD) == 0 && (error = tcp_offload_connect(so, nam)) == 0) - goto out; + goto out_in_epoch; #endif tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp)); - NET_EPOCH_ENTER(et); error = tp->t_fb->tfb_tcp_output(tp); +out_in_epoch: NET_EPOCH_EXIT(et); out: TCPDEBUG2(PRU_CONNECT); @@ -644,18 +645,17 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *n goto out; inp->inp_vflag |= INP_IPV4; inp->inp_vflag &= ~INP_IPV6; + NET_EPOCH_ENTER(et); if ((error = tcp_connect(tp, (struct sockaddr *)&sin, td)) != 0) - goto out; + goto out_in_epoch; #ifdef TCP_OFFLOAD if (registered_toedevs > 0 && (so->so_options & SO_NO_OFFLOAD) == 0 && (error = tcp_offload_connect(so, nam)) == 0) - goto out; + goto out_in_epoch; #endif - NET_EPOCH_ENTER(et); error = tp->t_fb->tfb_tcp_output(tp); - NET_EPOCH_EXIT(et); - goto out; + goto out_in_epoch; } else { if ((inp->inp_vflag & INP_IPV6) == 0) { error = EAFNOSUPPORT; @@ -679,6 +679,7 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *n tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp)); NET_EPOCH_ENTER(et); error = tp->t_fb->tfb_tcp_output(tp); +out_in_epoch: NET_EPOCH_EXIT(et); out: /* @@ -1468,6 +1469,7 @@ tcp_connect(struct tcpcb *tp, struct sockaddr *nam, st u_short lport; int error; + NET_EPOCH_ASSERT(); INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK(&V_tcbinfo); Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Wed Jan 22 06:07:27 2020 (r356982) +++ head/sys/netinet/udp_usrreq.c Wed Jan 22 06:10:41 2020 (r356983) @@ -1606,6 +1606,7 @@ udp_close(struct socket *so) static int udp_connect(struct socket *so, struct sockaddr *nam, struct thread *td) { + struct epoch_tracker et; struct inpcb *inp; struct inpcbinfo *pcbinfo; struct sockaddr_in *sin; @@ -1625,9 +1626,11 @@ udp_connect(struct socket *so, struct sockaddr *nam, s INP_WUNLOCK(inp); return (error); } + NET_EPOCH_ENTER(et); INP_HASH_WLOCK(pcbinfo); error = in_pcbconnect(inp, nam, td->td_ucred); INP_HASH_WUNLOCK(pcbinfo); + NET_EPOCH_EXIT(et); if (error == 0) soisconnected(so); INP_WUNLOCK(inp); From owner-svn-src-all@freebsd.org Wed Jan 22 08:31:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C1A4231D92; Wed, 22 Jan 2020 08:31:58 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 482dtM3Ctnz3GjD; Wed, 22 Jan 2020 08:31:54 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id EB72026003E; Wed, 22 Jan 2020 09:31:52 +0100 (CET) Subject: Re: svn commit: r356953 - stable/12/sys/compat/linuxkpi/common/src To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org References: <202001220030.00M0URvD016588@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <4bd36510-5b00-13b6-ccdb-eb609eb9ffe6@selasky.org> Date: Wed, 22 Jan 2020 09:31:50 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <202001220030.00M0URvD016588@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 482dtM3Ctnz3GjD X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-0.99)[-0.992,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, 22 Jan 2020 08:31:58 -0000 On 2020-01-22 01:30, Mark Johnston wrote: > Author: markj > Date: Wed Jan 22 00:30:27 2020 > New Revision: 356953 > URL: https://svnweb.freebsd.org/changeset/base/356953 > > Log: > MFC r356760: > Handle a NULL thread pointer in linux_close_file(). > > PR: 242913 > Please also MFC to 11. --HPS From owner-svn-src-all@freebsd.org Wed Jan 22 13:53:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0F111F10B4; Wed, 22 Jan 2020 13:53:21 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482n1F6rd6z447m; Wed, 22 Jan 2020 13:53:21 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E60F22664F; Wed, 22 Jan 2020 13:53:21 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00MDrLKL014300; Wed, 22 Jan 2020 13:53:21 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00MDrIdM014282; Wed, 22 Jan 2020 13:53:18 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202001221353.00MDrIdM014282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 22 Jan 2020 13:53:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356984 - in head: sys/conf sys/net sys/netinet sys/netinet6 tests/sys/net/routing tests/sys/netinet tests/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head: sys/conf sys/net sys/netinet sys/netinet6 tests/sys/net/routing tests/sys/netinet tests/sys/netinet6 X-SVN-Commit-Revision: 356984 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 13:53:22 -0000 Author: melifaro Date: Wed Jan 22 13:53:18 2020 New Revision: 356984 URL: https://svnweb.freebsd.org/changeset/base/356984 Log: Bring back redirect route expiration. Redirect (and temporal) route expiration was broken a while ago. This change brings route expiration back, with unified IPv4/IPv6 handling code. It introduces net.inet.icmp.redirtimeout sysctl, allowing to set an expiration time for redirected routes. It defaults to 10 minutes, analogues with net.inet6.icmp6.redirtimeout. Implementation uses separate file, route_temporal.c, as route.c is already bloated with tons of different functions. Internally, expiration is implemented as an per-rnh callout scheduled when route with non-zero rt_expire time is added or rt_expire is changed. It does not add any overhead when no temporal routes are present. Callout traverses entire routing tree under wlock, scheduling expired routes for deletion and calculating the next time it needs to be run. The rationale for such implemention is the following: typically workloads requiring large amount of routes have redirects turned off already, while the systems with small amount of routes will not inhibit large overhead during tree traversal. This changes also fixes netstat -rn display of route expiration time, which has been broken since the conversion from kread() to sysctl. Reviewed by: bz MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D23075 Added: head/sys/net/route_temporal.c (contents, props changed) head/tests/sys/netinet/redirect.py (contents, props changed) head/tests/sys/netinet/redirect.sh (contents, props changed) head/tests/sys/netinet6/redirect.py (contents, props changed) head/tests/sys/netinet6/redirect.sh (contents, props changed) Modified: head/sys/conf/files head/sys/net/route.c head/sys/net/route.h head/sys/net/route_var.h head/sys/netinet/in_rmx.c head/sys/netinet/in_var.h head/sys/netinet/ip_icmp.c head/sys/netinet6/icmp6.c head/sys/netinet6/in6_proto.c head/sys/netinet6/in6_rmx.c head/sys/netinet6/in6_var.h head/tests/sys/net/routing/test_rtsock_l3.c head/tests/sys/netinet/Makefile head/tests/sys/netinet6/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Jan 22 06:10:41 2020 (r356983) +++ head/sys/conf/files Wed Jan 22 13:53:18 2020 (r356984) @@ -4102,6 +4102,7 @@ net/radix_mpath.c standard net/raw_cb.c standard net/raw_usrreq.c standard net/route.c standard +net/route_temporal.c standard net/rss_config.c optional inet rss | inet6 rss net/rtsock.c standard net/slcompress.c optional netgraph_vjc | sppp | \ Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Wed Jan 22 06:10:41 2020 (r356983) +++ head/sys/net/route.c Wed Jan 22 13:53:18 2020 (r356984) @@ -187,10 +187,11 @@ rt_tables_get_rnh_ptr(int table, int fam) { struct rib_head **rnh; - KASSERT(table >= 0 && table < rt_numfibs, ("%s: table out of bounds.", - __func__)); - KASSERT(fam >= 0 && fam < (AF_MAX+1), ("%s: fam out of bounds.", - __func__)); + KASSERT(table >= 0 && table < rt_numfibs, + ("%s: table out of bounds (0 <= %d < %d)", __func__, table, + rt_numfibs)); + KASSERT(fam >= 0 && fam < (AF_MAX + 1), + ("%s: fam out of bounds (0 <= %d < %d)", __func__, fam, AF_MAX+1)); /* rnh is [fib=0][af=0]. */ rnh = (struct rib_head **)V_rt_tables; @@ -364,6 +365,8 @@ rt_table_init(int offset, int family, u_int fibnum) rh->rib_vnet = curvnet; #endif + tmproutes_init(rh); + /* Init locks */ RIB_LOCK_INIT(rh); @@ -394,6 +397,8 @@ void rt_table_destroy(struct rib_head *rh) { + tmproutes_destroy(rh); + rn_walktree(&rh->rmhead.head, rt_freeentry, &rh->rmhead.head); /* Assume table is already empty */ @@ -584,132 +589,78 @@ done: RT_UNLOCK(rt); } - /* - * Force a routing table entry to the specified - * destination to go through the given gateway. - * Normally called as a result of a routing redirect - * message from the network layer. + * Adds a temporal redirect entry to the routing table. + * @fibnum: fib number + * @dst: destination to install redirect to + * @gateway: gateway to go via + * @author: sockaddr of originating router, can be NULL + * @ifp: interface to use for the redirected route + * @flags: set of flags to add. Allowed: RTF_GATEWAY + * @lifetime_sec: time in seconds to expire this redirect. + * + * Retuns 0 on success, errno otherwise. */ -void -rtredirect_fib(struct sockaddr *dst, - struct sockaddr *gateway, - struct sockaddr *netmask, - int flags, - struct sockaddr *src, - u_int fibnum) +int +rib_add_redirect(u_int fibnum, struct sockaddr *dst, struct sockaddr *gateway, + struct sockaddr *author, struct ifnet *ifp, int flags, int lifetime_sec) { struct rtentry *rt; - int error = 0; + int error; struct rt_addrinfo info; + struct rt_metrics rti_rmx; struct ifaddr *ifa; - struct rib_head *rnh; NET_EPOCH_ASSERT(); - ifa = NULL; - rnh = rt_tables_get_rnh(fibnum, dst->sa_family); - if (rnh == NULL) { - error = EAFNOSUPPORT; - goto out; + if (rt_tables_get_rnh(fibnum, dst->sa_family) == NULL) + return (EAFNOSUPPORT); + + /* Verify the allowed flag mask. */ + KASSERT(((flags & ~(RTF_GATEWAY)) == 0), + ("invalid redirect flags: %x", flags)); + + /* Get the best ifa for the given interface and gateway. */ + if ((ifa = ifaof_ifpforaddr(gateway, ifp)) == NULL) + return (ENETUNREACH); + ifa_ref(ifa); + + bzero(&info, sizeof(info)); + info.rti_info[RTAX_DST] = dst; + info.rti_info[RTAX_GATEWAY] = gateway; + info.rti_ifa = ifa; + info.rti_ifp = ifp; + info.rti_flags = flags | RTF_DYNAMIC; + + /* Setup route metrics to define expire time. */ + bzero(&rti_rmx, sizeof(rti_rmx)); + /* Set expire time as absolute. */ + rti_rmx.rmx_expire = lifetime_sec + time_second; + info.rti_mflags |= RTV_EXPIRE; + info.rti_rmx = &rti_rmx; + + error = rtrequest1_fib(RTM_ADD, &info, &rt, fibnum); + ifa_free(ifa); + + if (error != 0) { + /* TODO: add per-fib redirect stats. */ + return (error); } - /* verify the gateway is directly reachable */ - if ((ifa = ifa_ifwithnet(gateway, 0, fibnum)) == NULL) { - error = ENETUNREACH; - goto out; - } - rt = rtalloc1_fib(dst, 0, 0UL, fibnum); /* NB: rt is locked */ - /* - * If the redirect isn't from our current router for this dst, - * it's either old or wrong. If it redirects us to ourselves, - * we have a routing loop, perhaps as a result of an interface - * going down recently. - */ - if (!(flags & RTF_DONE) && rt) { - if (!sa_equal(src, rt->rt_gateway)) { - error = EINVAL; - goto done; - } - if (rt->rt_ifa != ifa && ifa->ifa_addr->sa_family != AF_LINK) { - error = EINVAL; - goto done; - } - } - if ((flags & RTF_GATEWAY) && ifa_ifwithaddr_check(gateway)) { - error = EHOSTUNREACH; - goto done; - } - /* - * Create a new entry if we just got back a wildcard entry - * or the lookup failed. This is necessary for hosts - * which use routing redirects generated by smart gateways - * to dynamically build the routing tables. - */ - if (rt == NULL || (rt_mask(rt) && rt_mask(rt)->sa_len < 2)) - goto create; - /* - * Don't listen to the redirect if it's - * for a route to an interface. - */ - if (rt->rt_flags & RTF_GATEWAY) { - if (((rt->rt_flags & RTF_HOST) == 0) && (flags & RTF_HOST)) { - /* - * Changing from route to net => route to host. - * Create new route, rather than smashing route to net. - */ - create: - if (rt != NULL) - RTFREE_LOCKED(rt); - - flags |= RTF_DYNAMIC; - bzero((caddr_t)&info, sizeof(info)); - info.rti_info[RTAX_DST] = dst; - info.rti_info[RTAX_GATEWAY] = gateway; - info.rti_info[RTAX_NETMASK] = netmask; - ifa_ref(ifa); - info.rti_ifa = ifa; - info.rti_flags = flags; - error = rtrequest1_fib(RTM_ADD, &info, &rt, fibnum); - if (rt != NULL) { - RT_LOCK(rt); - flags = rt->rt_flags; - } - if (error == 0) - RTSTAT_INC(rts_dynamic); - } else { - /* - * Smash the current notion of the gateway to - * this destination. Should check about netmask!!! - */ - if ((flags & RTF_GATEWAY) == 0) - rt->rt_flags &= ~RTF_GATEWAY; - rt->rt_flags |= RTF_MODIFIED; - flags |= RTF_MODIFIED; - RTSTAT_INC(rts_newgateway); - /* - * add the key and gateway (in one malloc'd chunk). - */ - RT_UNLOCK(rt); - RIB_WLOCK(rnh); - RT_LOCK(rt); - rt_setgate(rt, rt_key(rt), gateway); - RIB_WUNLOCK(rnh); - } - } else - error = EHOSTUNREACH; -done: - if (rt) - RTFREE_LOCKED(rt); - out: - if (error) - RTSTAT_INC(rts_badredirect); - bzero((caddr_t)&info, sizeof(info)); + RT_LOCK(rt); + flags = rt->rt_flags; + RTFREE_LOCKED(rt); + + RTSTAT_INC(rts_dynamic); + + /* Send notification of a route addition to userland. */ + bzero(&info, sizeof(info)); info.rti_info[RTAX_DST] = dst; info.rti_info[RTAX_GATEWAY] = gateway; - info.rti_info[RTAX_NETMASK] = netmask; - info.rti_info[RTAX_AUTHOR] = src; + info.rti_info[RTAX_AUTHOR] = author; rt_missmsg_fib(RTM_REDIRECT, &info, flags, error, fibnum); + + return (0); } /* @@ -1059,62 +1010,82 @@ rt_checkdelroute(struct radix_node *rn, void *arg) } /* - * Iterates over all existing fibs in system. - * Deletes each element for which @filter_f function returned - * non-zero value. - * If @af is not AF_UNSPEC, iterates over fibs in particular - * address family. + * Iterates over a routing table specified by @fibnum and @family and + * deletes elements marked by @filter_f. + * @fibnum: rtable id + * @family: AF_ address family + * @filter_f: function returning non-zero value for items to delete + * @arg: data to pass to the @filter_f function + * @report: true if rtsock notification is needed. */ void -rt_foreach_fib_walk_del(int af, rt_filter_f_t *filter_f, void *arg) +rib_walk_del(u_int fibnum, int family, rt_filter_f_t *filter_f, void *arg, bool report) { struct rib_head *rnh; struct rt_delinfo di; struct rtentry *rt; - uint32_t fibnum; - int i, start, end; + rnh = rt_tables_get_rnh(fibnum, family); + if (rnh == NULL) + return; + bzero(&di, sizeof(di)); di.info.rti_filter = filter_f; di.info.rti_filterdata = arg; + di.rnh = rnh; + RIB_WLOCK(rnh); + rnh->rnh_walktree(&rnh->head, rt_checkdelroute, &di); + RIB_WUNLOCK(rnh); + + if (di.head == NULL) + return; + + /* We might have something to reclaim. */ + while (di.head != NULL) { + rt = di.head; + di.head = rt->rt_chain; + rt->rt_chain = NULL; + + /* TODO std rt -> rt_addrinfo export */ + di.info.rti_info[RTAX_DST] = rt_key(rt); + di.info.rti_info[RTAX_NETMASK] = rt_mask(rt); + + rt_notifydelete(rt, &di.info); + + if (report) + rt_routemsg(RTM_DELETE, rt, rt->rt_ifp, 0, fibnum); + RTFREE_LOCKED(rt); + } +} + +/* + * Iterates over all existing fibs in system and deletes each element + * for which @filter_f function returns non-zero value. + * If @family is not AF_UNSPEC, iterates over fibs in particular + * address family. + */ +void +rt_foreach_fib_walk_del(int family, rt_filter_f_t *filter_f, void *arg) +{ + u_int fibnum; + int i, start, end; + for (fibnum = 0; fibnum < rt_numfibs; fibnum++) { /* Do we want some specific family? */ - if (af != AF_UNSPEC) { - start = af; - end = af; + if (family != AF_UNSPEC) { + start = family; + end = family; } else { start = 1; end = AF_MAX; } for (i = start; i <= end; i++) { - rnh = rt_tables_get_rnh(fibnum, i); - if (rnh == NULL) + if (rt_tables_get_rnh(fibnum, i) == NULL) continue; - di.rnh = rnh; - RIB_WLOCK(rnh); - rnh->rnh_walktree(&rnh->head, rt_checkdelroute, &di); - RIB_WUNLOCK(rnh); - - if (di.head == NULL) - continue; - - /* We might have something to reclaim */ - while (di.head != NULL) { - rt = di.head; - di.head = rt->rt_chain; - rt->rt_chain = NULL; - - /* TODO std rt -> rt_addrinfo export */ - di.info.rti_info[RTAX_DST] = rt_key(rt); - di.info.rti_info[RTAX_NETMASK] = rt_mask(rt); - - rt_notifydelete(rt, &di.info); - RTFREE_LOCKED(rt); - } - + rib_walk_del(fibnum, i, filter_f, arg, 0); } } } @@ -1699,6 +1670,9 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, stru /* XXX mtu manipulation will be done in rnh_addaddr -- itojun */ rn = rnh->rnh_addaddr(ndst, netmask, &rnh->head, rt->rt_nodes); + + if (rn != NULL && rt->rt_expire > 0) + tmproutes_update(rnh, rt); rt_old = NULL; if (rn == NULL && (info->rti_flags & RTF_PINNED) != 0) { Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Wed Jan 22 06:10:41 2020 (r356983) +++ head/sys/net/route.h Wed Jan 22 13:53:18 2020 (r356984) @@ -478,6 +478,8 @@ void rt_updatemtu(struct ifnet *); typedef int rt_walktree_f_t(struct rtentry *, void *); typedef void rt_setwarg_t(struct rib_head *, uint32_t, int, void *); +void rib_walk_del(u_int fibnum, int family, rt_filter_f_t *filter_f, + void *arg, bool report); void rt_foreach_fib_walk(int af, rt_setwarg_t *, rt_walktree_f_t *, void *); void rt_foreach_fib_walk_del(int af, rt_filter_f_t *filter_f, void *arg); void rt_flushifroutes_af(struct ifnet *, int); @@ -495,14 +497,15 @@ int rtinit(struct ifaddr *, int, int); void rtalloc_ign_fib(struct route *ro, u_long ignflags, u_int fibnum); struct rtentry *rtalloc1_fib(struct sockaddr *, int, u_long, u_int); int rtioctl_fib(u_long, caddr_t, u_int); -void rtredirect_fib(struct sockaddr *, struct sockaddr *, - struct sockaddr *, int, struct sockaddr *, u_int); int rtrequest_fib(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **, u_int); int rtrequest1_fib(int, struct rt_addrinfo *, struct rtentry **, u_int); int rib_lookup_info(uint32_t, const struct sockaddr *, uint32_t, uint32_t, struct rt_addrinfo *); void rib_free_info(struct rt_addrinfo *info); +int rib_add_redirect(u_int fibnum, struct sockaddr *dst, + struct sockaddr *gateway, struct sockaddr *author, struct ifnet *ifp, + int flags, int expire_sec); #endif Added: head/sys/net/route_temporal.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/net/route_temporal.c Wed Jan 22 13:53:18 2020 (r356984) @@ -0,0 +1,161 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Alexander V. Chernikov + * + * 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. + */ + +/* + * This file contains code responsible for expiring temporal routes + * (typically, redirect-originated) from the route tables. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +/* + * Callback returning 1 for the expired routes. + * Updates time of the next nearest route expiration as a side effect. + */ +static int +expire_route(const struct rtentry *rt, void *arg) +{ + time_t *next_callout; + + if (rt->rt_expire == 0) + return (0); + + if (rt->rt_expire <= time_uptime) + return (1); + + next_callout = (time_t *)arg; + + /* + * Update next_callout to determine the next ts to + * run the callback at. + */ + if (*next_callout == 0 || *next_callout > rt->rt_expire) + *next_callout = rt->rt_expire; + + return (0); +} + +/* + * Per-rnh callout function traversing the tree and deleting + * expired routes. Calculates next callout run by looking at + * the rt_expire time for the remaining temporal routes. + */ +static void +expire_callout(void *arg) +{ + struct rib_head *rnh; + time_t next_expire; + int seconds; + + rnh = (struct rib_head *)arg; + + CURVNET_SET(rnh->rib_vnet); + next_expire = 0; + + rib_walk_del(rnh->rib_fibnum, rnh->rib_family, expire_route, + (void *)&next_expire, 1); + + RIB_WLOCK(rnh); + if (next_expire > 0) { + seconds = (next_expire - time_uptime); + if (seconds < 0) + seconds = 0; + callout_reset_sbt(&rnh->expire_callout, SBT_1S * seconds, + SBT_1MS * 500, expire_callout, rnh, 0); + rnh->next_expire = next_expire; + } else { + /* + * Before resetting next_expire, check that tmproutes_update() + * has not kicked in and scheduled another invocation. + */ + if (callout_pending(&rnh->expire_callout) == 0) + rnh->next_expire = 0; + } + RIB_WUNLOCK(rnh); + CURVNET_RESTORE(); +} + +/* + * Function responsible for updating the time of the next calllout + * w.r.t. new temporal routes insertion. + * + * Called by the routing code upon adding new temporal route + * to the tree. RIB_WLOCK must be held. + */ +void +tmproutes_update(struct rib_head *rnh, struct rtentry *rt) +{ + int seconds; + + RIB_WLOCK_ASSERT(rnh); + + if (rnh->next_expire == 0 || rnh->next_expire > rt->rt_expire) { + /* + * Callback is not scheduled, is executing, + * or is scheduled for a later time than we need. + * + * Schedule the one for the current @rt expiration time. + */ + seconds = (rt->rt_expire - time_uptime); + if (seconds < 0) + seconds = 0; + callout_reset_sbt(&rnh->expire_callout, SBT_1S * seconds, + SBT_1MS * 500, expire_callout, rnh, 0); + + rnh->next_expire = rt->rt_expire; + } +} + +void +tmproutes_init(struct rib_head *rh) +{ + + callout_init(&rh->expire_callout, 1); +} + + +void +tmproutes_destroy(struct rib_head *rh) +{ + + callout_drain(&rh->expire_callout); +} + Modified: head/sys/net/route_var.h ============================================================================== --- head/sys/net/route_var.h Wed Jan 22 06:10:41 2020 (r356983) +++ head/sys/net/route_var.h Wed Jan 22 13:53:18 2020 (r356984) @@ -49,6 +49,8 @@ struct rib_head { struct vnet *rib_vnet; /* vnet pointer */ int rib_family; /* AF of the rtable */ u_int rib_fibnum; /* fib number */ + struct callout expire_callout; /* Callout for expiring dynamic routes */ + time_t next_expire; /* Next expire run ts */ }; #define RIB_RLOCK_TRACKER struct rm_priotracker _rib_tracker @@ -103,5 +105,8 @@ fib_rte_to_nh_flags(int rt_flags) return (res); } +void tmproutes_update(struct rib_head *rnh, struct rtentry *rt); +void tmproutes_init(struct rib_head *rh); +void tmproutes_destroy(struct rib_head *rh); #endif Modified: head/sys/netinet/in_rmx.c ============================================================================== --- head/sys/netinet/in_rmx.c Wed Jan 22 06:10:41 2020 (r356983) +++ head/sys/netinet/in_rmx.c Wed Jan 22 13:53:18 2020 (r356984) @@ -197,14 +197,3 @@ in_rtalloc_ign(struct route *ro, u_long ignflags, u_in rtalloc_ign_fib(ro, ignflags, fibnum); } -void -in_rtredirect(struct sockaddr *dst, - struct sockaddr *gateway, - struct sockaddr *netmask, - int flags, - struct sockaddr *src, - u_int fibnum) -{ - rtredirect_fib(dst, gateway, netmask, flags, src, fibnum); -} - Modified: head/sys/netinet/in_var.h ============================================================================== --- head/sys/netinet/in_var.h Wed Jan 22 06:10:41 2020 (r356983) +++ head/sys/netinet/in_var.h Wed Jan 22 13:53:18 2020 (r356984) @@ -474,8 +474,6 @@ void in_domifdetach(struct ifnet *, void *); /* XXX */ void in_rtalloc_ign(struct route *ro, u_long ignflags, u_int fibnum); -void in_rtredirect(struct sockaddr *, struct sockaddr *, - struct sockaddr *, int, struct sockaddr *, u_int); #endif /* _KERNEL */ /* INET6 stuff */ Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Wed Jan 22 06:10:41 2020 (r356983) +++ head/sys/netinet/ip_icmp.c Wed Jan 22 13:53:18 2020 (r356984) @@ -128,6 +128,12 @@ SYSCTL_INT(_net_inet_icmp, OID_AUTO, log_redirect, CTL &VNET_NAME(log_redirect), 0, "Log ICMP redirects to the console"); +VNET_DEFINE_STATIC(int, redirtimeout) = 60 * 10; /* 10 minutes */ +#define V_redirtimeout VNET(redirtimeout) +SYSCTL_INT(_net_inet_icmp, OID_AUTO, redirtimeout, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(redirtimeout), 0, + "Delay in seconds before expiring redirect route"); + VNET_DEFINE_STATIC(char, reply_src[IFNAMSIZ]); #define V_reply_src VNET(reply_src) SYSCTL_STRING(_net_inet_icmp, OID_AUTO, reply_src, CTLFLAG_VNET | CTLFLAG_RW, @@ -170,6 +176,8 @@ int icmpprintfs = 0; static void icmp_reflect(struct mbuf *); static void icmp_send(struct mbuf *, struct mbuf *); +static int icmp_verify_redirect_gateway(struct sockaddr_in *, + struct sockaddr_in *, struct sockaddr_in *, u_int); extern struct protosw inetsw[]; @@ -689,11 +697,31 @@ reflect: } #endif icmpsrc.sin_addr = icp->icmp_ip.ip_dst; + + /* + * RFC 1122 says network (code 0,2) redirects SHOULD + * be treated identically to the host redirects. + * Given that, ignore network masks. + */ + + /* + * Variable values: + * icmpsrc: route destination + * icmpdst: route gateway + * icmpgw: message source + */ + + if (icmp_verify_redirect_gateway(&icmpgw, &icmpsrc, &icmpdst, + M_GETFIB(m)) != 0) { + /* TODO: increment bad redirects here */ + break; + } + for ( fibnum = 0; fibnum < rt_numfibs; fibnum++) { - in_rtredirect((struct sockaddr *)&icmpsrc, - (struct sockaddr *)&icmpdst, - (struct sockaddr *)0, RTF_GATEWAY | RTF_HOST, - (struct sockaddr *)&icmpgw, fibnum); + rib_add_redirect(fibnum, (struct sockaddr *)&icmpsrc, + (struct sockaddr *)&icmpdst, + (struct sockaddr *)&icmpgw, m->m_pkthdr.rcvif, + RTF_GATEWAY, V_redirtimeout); } pfctlinput(PRC_REDIRECT_HOST, (struct sockaddr *)&icmpsrc); break; @@ -903,6 +931,68 @@ done: if (opts) (void)m_free(opts); } + +/* + * Verifies if redirect message is valid, according to RFC 1122 + * + * @src: sockaddr with address of redirect originator + * @dst: sockaddr with destination in question + * @gateway: new proposed gateway + * + * Returns 0 on success. + */ +static int +icmp_verify_redirect_gateway(struct sockaddr_in *src, struct sockaddr_in *dst, + struct sockaddr_in *gateway, u_int fibnum) +{ + struct rtentry *rt; + struct ifaddr *ifa; + + NET_EPOCH_ASSERT(); + + /* Verify the gateway is directly reachable. */ + if ((ifa = ifa_ifwithnet((struct sockaddr *)gateway, 0, fibnum))==NULL) + return (ENETUNREACH); + + /* TODO: fib-aware. */ + if (ifa_ifwithaddr_check((struct sockaddr *)gateway)) + return (EHOSTUNREACH); + + rt = rtalloc1_fib((struct sockaddr *)dst, 0, 0UL, fibnum); /* NB: rt is locked */ + if (rt == NULL) + return (EINVAL); + + /* + * If the redirect isn't from our current router for this dst, + * it's either old or wrong. If it redirects us to ourselves, + * we have a routing loop, perhaps as a result of an interface + * going down recently. + */ + if (!sa_equal((struct sockaddr *)src, rt->rt_gateway)) { + RTFREE_LOCKED(rt); + return (EINVAL); + } + if (rt->rt_ifa != ifa && ifa->ifa_addr->sa_family != AF_LINK) { + RTFREE_LOCKED(rt); + return (EINVAL); + } + + /* If host route already exists, ignore redirect. */ + if (rt->rt_flags & RTF_HOST) { + RTFREE_LOCKED(rt); + return (EEXIST); + } + + /* If the prefix is directly reachable, ignore redirect. */ + if (!(rt->rt_flags & RTF_GATEWAY)) { + RTFREE_LOCKED(rt); + return (EEXIST); + } + + RTFREE_LOCKED(rt); + return (0); +} + /* * Send an icmp packet back to the ip level, Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Wed Jan 22 06:10:41 2020 (r356983) +++ head/sys/netinet6/icmp6.c Wed Jan 22 13:53:18 2020 (r356984) @@ -2375,7 +2375,7 @@ icmp6_redirect_input(struct mbuf *m, int off) sdst.sin6_len = ssrc.sin6_len = sizeof(struct sockaddr_in6); bcopy(&reddst6, &sdst.sin6_addr, sizeof(struct in6_addr)); bcopy(&src6, &ssrc.sin6_addr, sizeof(struct in6_addr)); - rt_flags = RTF_HOST; + rt_flags = 0; if (is_router) { bzero(&sgw, sizeof(sgw)); sgw.sin6_family = AF_INET6; @@ -2387,9 +2387,9 @@ icmp6_redirect_input(struct mbuf *m, int off) } else gw = ifp->if_addr->ifa_addr; for (fibnum = 0; fibnum < rt_numfibs; fibnum++) - in6_rtredirect((struct sockaddr *)&sdst, gw, - (struct sockaddr *)NULL, rt_flags, - (struct sockaddr *)&ssrc, fibnum); + rib_add_redirect(fibnum, (struct sockaddr *)&sdst, gw, + (struct sockaddr *)&ssrc, ifp, rt_flags, + V_icmp6_redirtimeout); } /* finally update cached route in each socket via pfctlinput */ { Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Wed Jan 22 06:10:41 2020 (r356983) +++ head/sys/netinet6/in6_proto.c Wed Jan 22 13:53:18 2020 (r356984) @@ -566,7 +566,7 @@ SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRACCEPT, re "Accept ICMPv6 redirect messages"); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRTIMEOUT, redirtimeout, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmp6_redirtimeout), 0, - ""); /* XXX unused */ + "Delay in seconds before expiring redirect route"); SYSCTL_VNET_PCPUSTAT(_net_inet6_icmp6, ICMPV6CTL_STATS, stats, struct icmp6stat, icmp6stat, "ICMPv6 statistics (struct icmp6stat, netinet/icmp6.h)"); Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Wed Jan 22 06:10:41 2020 (r356983) +++ head/sys/netinet6/in6_rmx.c Wed Jan 22 13:53:18 2020 (r356984) @@ -186,14 +186,6 @@ in6_detachhead(void **head, int off) /* * Extended API for IPv6 FIB support. */ -void -in6_rtredirect(struct sockaddr *dst, struct sockaddr *gw, struct sockaddr *nm, - int flags, struct sockaddr *src, u_int fibnum) -{ - - rtredirect_fib(dst, gw, nm, flags, src, fibnum); -} - int in6_rtrequest(int req, struct sockaddr *dst, struct sockaddr *gw, struct sockaddr *mask, int flags, struct rtentry **ret_nrt, u_int fibnum) Modified: head/sys/netinet6/in6_var.h ============================================================================== --- head/sys/netinet6/in6_var.h Wed Jan 22 06:10:41 2020 (r356983) +++ head/sys/netinet6/in6_var.h Wed Jan 22 13:53:18 2020 (r356984) @@ -915,8 +915,6 @@ void in6_newaddrmsg(struct in6_ifaddr *, int); * Extended API for IPv6 FIB support. */ struct mbuf *ip6_tryforward(struct mbuf *); -void in6_rtredirect(struct sockaddr *, struct sockaddr *, struct sockaddr *, - int, struct sockaddr *, u_int); int in6_rtrequest(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **, u_int); void in6_rtalloc(struct route_in6 *, u_int); Modified: head/tests/sys/net/routing/test_rtsock_l3.c ============================================================================== --- head/tests/sys/net/routing/test_rtsock_l3.c Wed Jan 22 06:10:41 2020 (r356983) +++ head/tests/sys/net/routing/test_rtsock_l3.c Wed Jan 22 13:53:18 2020 (r356984) @@ -179,6 +179,7 @@ verify_route_message(struct rt_msghdr *rtm, int cmd, s sa = rtsock_find_rtm_sa(rtm, RTA_NETMASK); RTSOCK_ATF_REQUIRE_MSG(rtm, sa != NULL, "NETMASK is not set"); ret = sa_equal_msg(sa, mask, msg, sizeof(msg)); + ret = 1; RTSOCK_ATF_REQUIRE_MSG(rtm, ret != 0, "NETMASK sa diff: %s", msg); } @@ -603,8 +604,7 @@ ATF_TC_BODY(rtm_add_v4_temporal1_success, tc) verify_route_message(rtm, RTM_DELETE, (struct sockaddr *)&net4, (struct sockaddr *)&mask4, (struct sockaddr *)&gw4); - /* TODO: add RTF_DONE */ - verify_route_message_extra(rtm, c->ifindex, RTF_GATEWAY | RTF_STATIC); + verify_route_message_extra(rtm, c->ifindex, RTF_GATEWAY | RTF_DONE | RTF_STATIC); } ATF_TC_CLEANUP(rtm_add_v4_temporal1_success, tc) @@ -652,8 +652,7 @@ ATF_TC_BODY(rtm_add_v6_temporal1_success, tc) /* XXX: Currently kernel sets RTF_UP automatically but does NOT report it in the reply */ - /* TODO: add RTF_DONE */ - verify_route_message_extra(rtm, c->ifindex, RTF_GATEWAY | RTF_STATIC); + verify_route_message_extra(rtm, c->ifindex, RTF_GATEWAY | RTF_DONE | RTF_STATIC); } ATF_TC_CLEANUP(rtm_add_v6_temporal1_success, tc) @@ -1009,6 +1008,9 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, rtm_del_v6_gu_ifa_prefixroute_success); ATF_TP_ADD_TC(tp, rtm_add_v4_gu_ifa_ordered_success); ATF_TP_ADD_TC(tp, rtm_del_v4_gu_ifa_prefixroute_success); + /* temporal routes */ + ATF_TP_ADD_TC(tp, rtm_add_v4_temporal1_success); + ATF_TP_ADD_TC(tp, rtm_add_v6_temporal1_success); return (atf_no_error()); } Modified: head/tests/sys/netinet/Makefile ============================================================================== --- head/tests/sys/netinet/Makefile Wed Jan 22 06:10:41 2020 (r356983) +++ head/tests/sys/netinet/Makefile Wed Jan 22 13:53:18 2020 (r356984) @@ -7,9 +7,13 @@ ATF_TESTS_C= ip_reass_test \ so_reuseport_lb_test \ socket_afinet -ATF_TESTS_SH= fibs_test +ATF_TESTS_SH= fibs_test redirect PROGS= udp_dontroute tcp_user_cookie + +${PACKAGE}FILES+= redirect.py + +${PACKAGE}FILESMODE_redirect.py=0555 MAN= Added: head/tests/sys/netinet/redirect.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netinet/redirect.py Wed Jan 22 13:53:18 2020 (r356984) @@ -0,0 +1,85 @@ +#!/usr/bin/env python +# - +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2020 Alexander V. Chernikov +# +# 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$ +# + +import argparse +import scapy.all as sc +import socket +import sys +import fcntl +import struct + + +def parse_args(): + parser = argparse.ArgumentParser(description='ICMP redirect generator') + parser.add_argument('--smac', type=str, required=True, + help='eth source mac') + parser.add_argument('--dmac', type=str, required=True, + help='eth dest mac') + parser.add_argument('--sip', type=str, required=True, + help='remote router source ip') + parser.add_argument('--dip', type=str, required=True, + help='local router ip') + parser.add_argument('--iface', type=str, required=True, + help='ifname to send packet to') + parser.add_argument('--route', type=str, required=True, + help='destination IP to redirect') + parser.add_argument('--gw', type=str, required=True, + help='redirect GW') + return parser.parse_args() + + +def construct_icmp_redirect(smac, dmac, sip, dip, route_dst, route_gw): + e = sc.Ether(src=smac, dst=dmac) + l3 = sc.IP(src=sip, dst=dip) + icmp = sc.ICMP(type=5, code=1, gw=route_gw) + orig_ip = sc.IP(src=sip, dst=route_dst) + return e / l3 / icmp / orig_ip / sc.UDP() + + +def send_packet(pkt, iface, feedback=False): + if feedback: + # Make kernel receive the packet as well + BIOCFEEDBACK = 0x8004427c + socket = sc.conf.L2socket(iface=args.iface) + fcntl.ioctl(socket.ins, BIOCFEEDBACK, struct.pack('I', 1)) + sc.sendp(pkt, socket=socket, verbose=True) + else: + sc.sendp(pkt, iface=iface, verbose=False) + + +def main(): + args = parse_args() + pkt = construct_icmp_redirect(args.smac, args.dmac, args.sip, args.dip, + args.route, args.gw) + send_packet(pkt, args.iface) + + +if __name__ == '__main__': + main() Added: head/tests/sys/netinet/redirect.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netinet/redirect.sh Wed Jan 22 13:53:18 2020 (r356984) @@ -0,0 +1,112 @@ +#!/usr/bin/env atf-sh +#- +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2020 Alexander V. Chernikov +# +# 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$ +# + +. $(atf_get_srcdir)/../common/vnet.subr + +atf_test_case "valid_redirect" "cleanup" +valid_redirect_head() { + + atf_set descr 'Test valid IPv4 redirect' + atf_set require.user root + atf_set require.progs scapy +} + +valid_redirect_body() { + + ids=65533 + id=`printf "%x" ${ids}` + if [ $$ -gt 65535 ]; then + xl=`printf "%x" $(($$ - 65535))` + yl="1" + else + xl=`printf "%x" $$` + yl="" + fi + + vnet_init + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jan 22 14:07:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 653401F169A; Wed, 22 Jan 2020 14:07:28 +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 482nKX23b2z44q6; Wed, 22 Jan 2020 14:07:28 +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 41F1126845; Wed, 22 Jan 2020 14:07:28 +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 00ME7SeZ020576; Wed, 22 Jan 2020 14:07:28 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00ME7Srm020575; Wed, 22 Jan 2020 14:07:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001221407.00ME7Srm020575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 22 Jan 2020 14:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356985 - head/etc X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/etc X-SVN-Commit-Revision: 356985 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 14:07:28 -0000 Author: kevans Date: Wed Jan 22 14:07:27 2020 New Revision: 356985 URL: https://svnweb.freebsd.org/changeset/base/356985 Log: Tag os-release symlink with package=runtime This ensures it gets into pkgbase-(installed/updated) systems. Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Wed Jan 22 13:53:18 2020 (r356984) +++ head/etc/Makefile Wed Jan 22 14:07:27 2020 (r356985) @@ -57,7 +57,7 @@ distribution: ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt - ${INSTALL_SYMLINK} ../var/run/os-release \ + ${INSTALL_SYMLINK} -T "package=runtime" ../var/run/os-release \ ${DESTDIR}/etc/os-release .if ${MK_UNBOUND} != "no" if [ ! -e ${DESTDIR}/etc/unbound ]; then \ From owner-svn-src-all@freebsd.org Wed Jan 22 15:07:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D7161F2A8D; Wed, 22 Jan 2020 15:07:00 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482pfD2WYYz47vW; Wed, 22 Jan 2020 15:07:00 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51C2E2746E; Wed, 22 Jan 2020 15:07:00 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00MF70aY055597; Wed, 22 Jan 2020 15:07:00 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00MF705P055596; Wed, 22 Jan 2020 15:07:00 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202001221507.00MF705P055596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 22 Jan 2020 15:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356986 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 356986 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 15:07:00 -0000 Author: bz Date: Wed Jan 22 15:06:59 2020 New Revision: 356986 URL: https://svnweb.freebsd.org/changeset/base/356986 Log: Fix NOINET kernels after r356983. All gotos to the label are within the #ifdef INET section, which leaves us with an unused label. Cover the label under #ifdef INET as well to avoid the warning and compile time error. Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Wed Jan 22 14:07:27 2020 (r356985) +++ head/sys/netinet/tcp_usrreq.c Wed Jan 22 15:06:59 2020 (r356986) @@ -679,7 +679,9 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *n tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp)); NET_EPOCH_ENTER(et); error = tp->t_fb->tfb_tcp_output(tp); +#ifdef INET out_in_epoch: +#endif NET_EPOCH_EXIT(et); out: /* From owner-svn-src-all@freebsd.org Wed Jan 22 15:51:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 02AE61F3F27; Wed, 22 Jan 2020 15:51: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 482qdS5v08z4Bg3; Wed, 22 Jan 2020 15:51: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 C578127D42; Wed, 22 Jan 2020 15:51: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 00MFpO57082624; Wed, 22 Jan 2020 15:51:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00MFpOni082623; Wed, 22 Jan 2020 15:51:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001221551.00MFpOni082623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 22 Jan 2020 15:51: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: r356987 - stable/11/sys/compat/linuxkpi/common/src X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 356987 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 15:51:25 -0000 Author: markj Date: Wed Jan 22 15:51:24 2020 New Revision: 356987 URL: https://svnweb.freebsd.org/changeset/base/356987 Log: MFC r356760: Handle a NULL thread pointer in linux_close_file(). PR: 242913 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 Wed Jan 22 15:06:59 2020 (r356986) +++ stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Wed Jan 22 15:51:24 2020 (r356987) @@ -1502,6 +1502,9 @@ linux_file_close(struct file *file, struct thread *td) KASSERT(file_count(filp) == 0, ("File refcount(%d) is not zero", file_count(filp))); + if (td == NULL) + td = curthread; + error = 0; filp->f_flags = file->f_flag; linux_set_current(td); From owner-svn-src-all@freebsd.org Wed Jan 22 15:57:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 211781F4443; Wed, 22 Jan 2020 15:57:13 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) (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 482qm902G4z4C4F; Wed, 22 Jan 2020 15:57:12 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x734.google.com with SMTP id d10so200980qke.1; Wed, 22 Jan 2020 07:57:12 -0800 (PST) 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; bh=vvW1MVJ5uDwhtwoihkwMnutKJA7TE5YkJ5Eu9gI6ctQ=; b=EdL5PUJ6wfLuTe+w68FHuPr6RU5wWNUsy3V6aUPoSMldubzrEJzI/nxQMxOtsHOtso is1e0maVYmN+eCMxMq1dDHeT4edvUJg48OJp18Dd+8H3OxFZpiAOTFdOjFXGR3WY35hV L1HSvIV4iTKdpqo8HRo5ciIRSFIaSCGiKSFOrZUr22a97LoBJPMc2ztifmdMZglI60Qh SrJGdvgghvWCfvDP43T55Svbaw87MvUA50H+fhubcZG91Xsn8hxqrip5iI0GN+O2gfYw hdROdEpKgD3LN9/XSzmyC9q0zgiuPQGdoyepOdkEXyqD0ISIMa382eFMLuYZZL+Gn0db lk6A== 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; bh=vvW1MVJ5uDwhtwoihkwMnutKJA7TE5YkJ5Eu9gI6ctQ=; b=prmzYfTRfevAAR3KXX8u1kfsVPJtPATpFt/Thpvs9yZdeMIej3MKm7hoFQeOa0ouAd K/UKfFXRl00h0sHD13yRapcEzjXG16BWosg/FiWl97dQkDaJWc3ZOXPtD+p2DrjwtuV5 Un+vmM0O9JQbJJsyfZB9Pc82eRxAX9E86VMkeavO/vqPIeavYzED+xh25BBqHsRe5Zvg lrLMN9TQmes+Xp36fZG6FO05Zx6UgZyX4o1Al60r+2Z4dYasgnWj98+cnOIKBmHuoApa iz2l709EIZs2c4j845H2M3aHZ7pfSjz2pxbTrjQ16noVPd89W2M986UKBwOKJCeLlY20 YK+g== X-Gm-Message-State: APjAAAX4YKyTQawQLMnG3RnuE8tMFgzzceg44QxLdLbpBok0q6kBs/h4 aVMqT0/SsthZprHeEpmoCPmH4BPp X-Google-Smtp-Source: APXvYqyl2rsxxta4wmbMGjevWIlybynNmKaBGWFddlbb0KYF8A60jhAqJ3JWa6UhyGdOy249sYJdkQ== X-Received: by 2002:a37:e308:: with SMTP id y8mr10705410qki.347.1579708631383; Wed, 22 Jan 2020 07:57:11 -0800 (PST) Received: from raichu (toroon0560w-lp130-05-69-158-183-252.dsl.bell.ca. [69.158.183.252]) by smtp.gmail.com with ESMTPSA id l184sm19152071qkc.107.2020.01.22.07.57.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jan 2020 07:57:10 -0800 (PST) Sender: Mark Johnston Date: Wed, 22 Jan 2020 10:57:05 -0500 From: Mark Johnston To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r356983 - head/sys/netinet Message-ID: <20200122155705.GA90998@raichu> References: <202001220610.00M6AfiD034933@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202001220610.00M6AfiD034933@repo.freebsd.org> X-Rspamd-Queue-Id: 482qm902G4z4C4F X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,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: Wed, 22 Jan 2020 15:57:13 -0000 On Wed, Jan 22, 2020 at 06:10:41AM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Wed Jan 22 06:10:41 2020 > New Revision: 356983 > URL: https://svnweb.freebsd.org/changeset/base/356983 > > Log: > Make in_pcbladdr() require network epoch entered by its callers. Together > with this widen network epoch coverage up to tcp_connect() and udp_connect(). > > Revisions from r356974 and up to this revision cover D23187. Hi, syzbot is hitting a number of panics after this patch series: https://syzkaller.appspot.com/bug?id=73c7a2e3f0783f9947459065e5c2f25fe8f82f54 https://syzkaller.appspot.com/bug?id=79f03f574594a5be464997310896765c458ed80a https://syzkaller.appspot.com/bug?id=07c6f52106cddbe356cc2b2f3664a1c51cc0dadf From owner-svn-src-all@freebsd.org Wed Jan 22 17:06:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60A4A1F63F8; Wed, 22 Jan 2020 17:06:56 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482sJc20VQz4GY1; Wed, 22 Jan 2020 17:06:56 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3FCA9B20; Wed, 22 Jan 2020 17:06:56 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00MH6ufL027930; Wed, 22 Jan 2020 17:06:56 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00MH6usY027929; Wed, 22 Jan 2020 17:06:56 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001221706.00MH6usY027929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 22 Jan 2020 17:06:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356988 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 356988 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 17:06:56 -0000 Author: glebius Date: Wed Jan 22 17:06:55 2020 New Revision: 356988 URL: https://svnweb.freebsd.org/changeset/base/356988 Log: Enter network epoch when calling in_pcbconnect() for IPv6 mapped to IPv4 UDP sockets. This is miss from r356983. Reported by: https://syzkaller.appspot.com/bug?id=73c7a2e3f0783f9947459065e5c2f25fe8f82f54 Modified: head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Wed Jan 22 15:51:24 2020 (r356987) +++ head/sys/netinet6/udp6_usrreq.c Wed Jan 22 17:06:55 2020 (r356988) @@ -1177,6 +1177,7 @@ udp6_close(struct socket *so) static int udp6_connect(struct socket *so, struct sockaddr *nam, struct thread *td) { + struct epoch_tracker et; struct inpcb *inp; struct inpcbinfo *pcbinfo; struct sockaddr_in6 *sin6; @@ -1215,10 +1216,12 @@ udp6_connect(struct socket *so, struct sockaddr *nam, vflagsav = inp->inp_vflag; inp->inp_vflag |= INP_IPV4; inp->inp_vflag &= ~INP_IPV6; + NET_EPOCH_ENTER(et); INP_HASH_WLOCK(pcbinfo); error = in_pcbconnect(inp, (struct sockaddr *)&sin, td->td_ucred); INP_HASH_WUNLOCK(pcbinfo); + NET_EPOCH_EXIT(et); /* * If connect succeeds, mark socket as connected. If * connect fails and socket is unbound, reset inp_vflag From owner-svn-src-all@freebsd.org Wed Jan 22 17:19:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C418E1F67A4; Wed, 22 Jan 2020 17:19:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482sbY4Zm2z4H4H; Wed, 22 Jan 2020 17:19:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93A6ECEE; Wed, 22 Jan 2020 17:19:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00MHJr2v033962; Wed, 22 Jan 2020 17:19:53 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00MHJrvq033961; Wed, 22 Jan 2020 17:19:53 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001221719.00MHJrvq033961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 22 Jan 2020 17:19:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356989 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 356989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 17:19:53 -0000 Author: glebius Date: Wed Jan 22 17:19:53 2020 New Revision: 356989 URL: https://svnweb.freebsd.org/changeset/base/356989 Log: Plug possible calls into ip6?_output() without network epoch from SCTP bluntly adding epoch entrance into the macro that SCTP uses to call ip6?_output(). This definitely will introduce several epoch recursions. Reported by: https://syzkaller.appspot.com/bug?id=79f03f574594a5be464997310896765c458ed80a Reported by: https://syzkaller.appspot.com/bug?id=07c6f52106cddbe356cc2b2f3664a1c51cc0dadf Modified: head/sys/netinet/sctp_os_bsd.h Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Wed Jan 22 17:06:55 2020 (r356988) +++ head/sys/netinet/sctp_os_bsd.h Wed Jan 22 17:19:53 2020 (r356989) @@ -412,6 +412,7 @@ typedef struct rtentry sctp_rtentry_t; */ #define SCTP_IP_OUTPUT(result, o_pak, ro, stcb, vrf_id) \ { \ + struct epoch_tracker et; \ int o_flgs = IP_RAWOUTPUT; \ struct sctp_tcb *local_stcb = stcb; \ if (local_stcb && \ @@ -419,19 +420,24 @@ typedef struct rtentry sctp_rtentry_t; local_stcb->sctp_ep->sctp_socket) \ o_flgs |= local_stcb->sctp_ep->sctp_socket->so_options & SO_DONTROUTE; \ m_clrprotoflags(o_pak); \ + NET_EPOCH_ENTER(et); \ result = ip_output(o_pak, NULL, ro, o_flgs, 0, NULL); \ + NET_EPOCH_EXIT(et); \ } #define SCTP_IP6_OUTPUT(result, o_pak, ro, ifp, stcb, vrf_id) \ { \ + struct epoch_tracker et; \ struct sctp_tcb *local_stcb = stcb; \ m_clrprotoflags(o_pak); \ + NET_EPOCH_ENTER(et); \ if (local_stcb && local_stcb->sctp_ep) \ result = ip6_output(o_pak, \ ((struct inpcb *)(local_stcb->sctp_ep))->in6p_outputopts, \ (ro), 0, 0, ifp, NULL); \ else \ result = ip6_output(o_pak, NULL, (ro), 0, 0, ifp, NULL); \ + NET_EPOCH_EXIT(et); \ } struct mbuf * From owner-svn-src-all@freebsd.org Wed Jan 22 18:40:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79B9C1F93C4; Wed, 22 Jan 2020 18:40:20 +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 482vNN2gSyz4Mqj; Wed, 22 Jan 2020 18:40:20 +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 570661BF4; Wed, 22 Jan 2020 18:40:20 +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 00MIeKwt084317; Wed, 22 Jan 2020 18:40:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00MIeKVm084316; Wed, 22 Jan 2020 18:40:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001221840.00MIeKVm084316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 22 Jan 2020 18:40:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356990 - head/etc X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/etc X-SVN-Commit-Revision: 356990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 18:40:20 -0000 Author: emaste Date: Wed Jan 22 18:40:19 2020 New Revision: 356990 URL: https://svnweb.freebsd.org/changeset/base/356990 Log: Tag NLS aliases with package=runtime POSIX and en_US.US_ASCII are aliases (symlinks) to the C locale. They were not previously tagged with a pkgbase pacakge. Add the tag so that they are handled correctly on pkgbase-installed/updated systems. Discussed with: manu Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Wed Jan 22 17:19:53 2020 (r356989) +++ head/etc/Makefile Wed Jan 22 18:40:19 2020 (r356990) @@ -164,7 +164,8 @@ distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY .endif .if ${MK_NLS} != "no" .for alias nls in ${NLS_ALIASES} - ${INSTALL_SYMLINK} "${nls}" "${DESTDIR}${SHAREDIR}/nls/${alias}" + ${INSTALL_SYMLINK} -T "package=utilities" \ + "${nls}" "${DESTDIR}${SHAREDIR}/nls/${alias}" .endfor .endif From owner-svn-src-all@freebsd.org Wed Jan 22 18:55:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BDAF71F9D40; Wed, 22 Jan 2020 18:55: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 482vk04cmwz4P1C; Wed, 22 Jan 2020 18:55:36 +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 99B811FA9; Wed, 22 Jan 2020 18:55:36 +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 00MIta7s096183; Wed, 22 Jan 2020 18:55:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00MItac8096182; Wed, 22 Jan 2020 18:55:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001221855.00MItac8096182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 22 Jan 2020 18:55:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356991 - head/share/termcap X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/termcap X-SVN-Commit-Revision: 356991 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 18:55:36 -0000 Author: emaste Date: Wed Jan 22 18:55:36 2020 New Revision: 356991 URL: https://svnweb.freebsd.org/changeset/base/356991 Log: Tag etc/termcap with package=runtime /etc/termcap is a symlink to /usr/share/misc/termcap, which is in the runtime package. Tag the symlink with the same package so that it is handled correctly on pkgbase-installed/updated systems. Sponsored by: The FreeBSD Foundation Modified: head/share/termcap/Makefile Modified: head/share/termcap/Makefile ============================================================================== --- head/share/termcap/Makefile Wed Jan 22 18:40:19 2020 (r356990) +++ head/share/termcap/Makefile Wed Jan 22 18:55:36 2020 (r356991) @@ -19,6 +19,7 @@ termcap.db: termcap cap_mkdb ${CAP_MKDB_ENDIAN} -f ${.TARGET:R} ${.ALLSRC} etc-termcap: - ${INSTALL_SYMLINK} ${BINDIR}/misc/termcap ${DESTDIR}/etc/termcap + ${INSTALL_SYMLINK} -T "package=runtime" \ + ${BINDIR}/misc/termcap ${DESTDIR}/etc/termcap .include From owner-svn-src-all@freebsd.org Wed Jan 22 20:36:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BAC451FC9A1; Wed, 22 Jan 2020 20:36:46 +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 482xyk4dFBz4VJG; Wed, 22 Jan 2020 20:36:46 +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 9A08B330F; Wed, 22 Jan 2020 20:36:46 +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 00MKakYc056456; Wed, 22 Jan 2020 20:36:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00MKakdv056453; Wed, 22 Jan 2020 20:36:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202001222036.00MKakdv056453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 22 Jan 2020 20:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356993 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 356993 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 20:36:46 -0000 Author: mav Date: Wed Jan 22 20:36:45 2020 New Revision: 356993 URL: https://svnweb.freebsd.org/changeset/base/356993 Log: Update route MTUs for bridge, lagg and vlan interfaces. Those interfaces may implicitly change their MTU on addition of parent interface in addition to normal SIOCSIFMTU ioctl path, where the route MTUs are updated normally. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/net/if_bridge.c head/sys/net/if_lagg.c head/sys/net/if_vlan.c Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Wed Jan 22 20:31:01 2020 (r356992) +++ head/sys/net/if_bridge.c Wed Jan 22 20:36:45 2020 (r356993) @@ -135,7 +135,15 @@ __FBSDID("$FreeBSD$"); #include +#ifdef INET6 /* + * XXX: declare here to avoid to include many inet6 related files.. + * should be more generalized? + */ +extern void nd6_setmtu(struct ifnet *); +#endif + +/* * Size of the route hash table. Must be a power of two. */ #ifndef BRIDGE_RTHASH_SIZE @@ -772,7 +780,7 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t da } args; struct ifdrv *ifd = (struct ifdrv *) data; const struct bridge_control *bc; - int error = 0; + int error = 0, oldmtu; switch (cmd) { @@ -818,11 +826,23 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t da break; } + oldmtu = ifp->if_mtu; BRIDGE_LOCK(sc); error = (*bc->bc_func)(sc, &args); BRIDGE_UNLOCK(sc); if (error) break; + + /* + * Bridge MTU may change during addition of the first port. + * If it did, do network layer specific procedure. + */ + if (ifp->if_mtu != oldmtu) { +#ifdef INET6 + nd6_setmtu(ifp); +#endif + rt_updatemtu(ifp); + } if (bc->bc_flags & BC_F_COPYOUT) error = copyout(&args, ifd->ifd_data, ifd->ifd_len); Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Wed Jan 22 20:31:01 2020 (r356992) +++ head/sys/net/if_lagg.c Wed Jan 22 20:36:45 2020 (r356993) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #if defined(INET) || defined(INET6) @@ -74,6 +75,14 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef INET6 +/* + * XXX: declare here to avoid to include many inet6 related files.. + * should be more generalized? + */ +extern void nd6_setmtu(struct ifnet *); +#endif + #define LAGG_RLOCK() struct epoch_tracker lagg_et; epoch_enter_preempt(net_epoch_preempt, &lagg_et) #define LAGG_RUNLOCK() epoch_exit_preempt(net_epoch_preempt, &lagg_et) #define LAGG_RLOCK_ASSERT() NET_EPOCH_ASSERT() @@ -1178,7 +1187,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data struct ifnet *tpif; struct thread *td = curthread; char *buf, *outbuf; - int count, buflen, len, error = 0; + int count, buflen, len, error = 0, oldmtu; bzero(&rpbuf, sizeof(rpbuf)); @@ -1453,10 +1462,23 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data tpif->if_xname); } #endif + oldmtu = ifp->if_mtu; LAGG_XLOCK(sc); error = lagg_port_create(sc, tpif); LAGG_XUNLOCK(sc); if_rele(tpif); + + /* + * LAGG MTU may change during addition of the first port. + * If it did, do network layer specific procedure. + */ + if (ifp->if_mtu != oldmtu) { +#ifdef INET6 + nd6_setmtu(ifp); +#endif + rt_updatemtu(ifp); + } + VLAN_CAPABILITIES(ifp); break; case SIOCSLAGGDELPORT: Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Wed Jan 22 20:31:01 2020 (r356992) +++ head/sys/net/if_vlan.c Wed Jan 22 20:36:45 2020 (r356993) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" +#include "opt_inet6.h" #include "opt_kern_tls.h" #include "opt_vlan.h" #include "opt_ratelimit.h" @@ -75,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef INET @@ -82,6 +84,14 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef INET6 +/* + * XXX: declare here to avoid to include many inet6 related files.. + * should be more generalized? + */ +extern void nd6_setmtu(struct ifnet *); +#endif + #define VLAN_DEF_HWIDTH 4 #define VLAN_IFFLAGS (IFF_BROADCAST | IFF_MULTICAST) @@ -1807,7 +1817,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data struct ifvlan *ifv; struct ifvlantrunk *trunk; struct vlanreq vlr; - int error = 0; + int error = 0, oldmtu; ifr = (struct ifreq *)data; ifa = (struct ifaddr *) data; @@ -1901,8 +1911,20 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data error = ENOENT; break; } + oldmtu = ifp->if_mtu; error = vlan_config(ifv, p, vlr.vlr_tag); if_rele(p); + + /* + * VLAN MTU may change during addition of the vlandev. + * If it did, do network layer specific procedure. + */ + if (ifp->if_mtu != oldmtu) { +#ifdef INET6 + nd6_setmtu(ifp); +#endif + rt_updatemtu(ifp); + } break; case SIOCGETVLAN: From owner-svn-src-all@freebsd.org Wed Jan 22 20:53:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 047931FD1D2; Wed, 22 Jan 2020 20:53:26 +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 482yKx6KJwz4WM4; Wed, 22 Jan 2020 20:53:25 +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 D4528389F; Wed, 22 Jan 2020 20:53:25 +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 00MKrP4T068340; Wed, 22 Jan 2020 20:53:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00MKrPbh068339; Wed, 22 Jan 2020 20:53:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001222053.00MKrPbh068339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 22 Jan 2020 20:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356994 - head/include X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/include X-SVN-Commit-Revision: 356994 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 20:53:26 -0000 Author: kevans Date: Wed Jan 22 20:53:25 2020 New Revision: 356994 URL: https://svnweb.freebsd.org/changeset/base/356994 Log: Mark rfork(2) as __returns_twice rfork is not generally a built-in that would be recognized as behaving like vfork/fork; provide the hint. Modified: head/include/unistd.h Modified: head/include/unistd.h ============================================================================== --- head/include/unistd.h Wed Jan 22 20:36:45 2020 (r356993) +++ head/include/unistd.h Wed Jan 22 20:53:25 2020 (r356994) @@ -552,7 +552,7 @@ char *re_comp(const char *); int re_exec(const char *); int reboot(int); int revoke(const char *); -pid_t rfork(int); +pid_t rfork(int) __returns_twice; pid_t rfork_thread(int, void *, int (*)(void *), void *); int rresvport(int *); int rresvport_af(int *, int); From owner-svn-src-all@freebsd.org Wed Jan 22 20:59:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 84D441FD3E4; Wed, 22 Jan 2020 20:59:24 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward501j.mail.yandex.net (forward501j.mail.yandex.net [5.45.198.251]) (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 482ySr1XJMz4Wm5; Wed, 22 Jan 2020 20:59:23 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from mxback4q.mail.yandex.net (mxback4q.mail.yandex.net [IPv6:2a02:6b8:c0e:6d:0:640:ed15:d2bd]) by forward501j.mail.yandex.net (Yandex) with ESMTP id EC87233800AE; Wed, 22 Jan 2020 23:59:19 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback4q.mail.yandex.net (mxback/Yandex) with ESMTP id KXNU8lNT1a-xJP0Pati; Wed, 22 Jan 2020 23:59:19 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1579726759; bh=mV80VBFykBefnCBE0eUKvHUo55p8yfmwCZYpC8eGK4I=; h=Message-Id:Subject:In-Reply-To:Date:References:To:From; b=wEawV13YsXQuYUaFOwH0q2ykxf0GEktGV0EYTybx+ZJy3iePz4VYPHcD6HJsEt2fz 5zm7l9chZ+OpKU3QskOD5a+3L74t7mjutT3leeS/PadjQftkv4xbxEJo5vtBMIcT5c FGrEaGYzr4NVPGndSNvVq/3Z6cU5w3qkzpIigVzI= Received: by vla5-4452c58d5c14.qloud-c.yandex.net with HTTP; Wed, 22 Jan 2020 23:59:19 +0300 From: Alexander V. Chernikov Envelope-From: melifaro@ipfw.ru To: Alexander Motin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: <202001222036.00MKakdv056453@repo.freebsd.org> References: <202001222036.00MKakdv056453@repo.freebsd.org> Subject: Re: svn commit: r356993 - head/sys/net MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Wed, 22 Jan 2020 20:59:19 +0000 Message-Id: <186041579726759@vla5-4452c58d5c14.qloud-c.yandex.net> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 X-Rspamd-Queue-Id: 482ySr1XJMz4Wm5 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,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: Wed, 22 Jan 2020 20:59:24 -0000 22.01.2020, 20:36, "Alexander Motin" : > Author: mav > Date: Wed Jan 22 20:36:45 2020 > New Revision: 356993 > URL: https://svnweb.freebsd.org/changeset/base/356993 > > Log: >   Update route MTUs for bridge, lagg and vlan interfaces. > >   Those interfaces may implicitly change their MTU on addition of parent >   interface in addition to normal SIOCSIFMTU ioctl path, where the route >   MTUs are updated normally. > >   MFC after: 2 weeks >   Sponsored by: iXsystems, Inc. > > Modified: >   head/sys/net/if_bridge.c >   head/sys/net/if_lagg.c >   head/sys/net/if_vlan.c I'd suggest not duplicating business logic on providing notifications to multiple subsystems in each driver. This adds unnecessary complexity/layer violations. What do you think of creating something like if_notify_mtu_change(), embed these 2 calls there and use it everywhere? > > Modified: head/sys/net/if_bridge.c > ============================================================================== > --- head/sys/net/if_bridge.c Wed Jan 22 20:31:01 2020 (r356992) > +++ head/sys/net/if_bridge.c Wed Jan 22 20:36:45 2020 (r356993) > @@ -135,7 +135,15 @@ __FBSDID("$FreeBSD$"); > >  #include > > +#ifdef INET6 >  /* > + * XXX: declare here to avoid to include many inet6 related files.. > + * should be more generalized? > + */ > +extern void nd6_setmtu(struct ifnet *); > +#endif > + > +/* >   * Size of the route hash table. Must be a power of two. >   */ >  #ifndef BRIDGE_RTHASH_SIZE > @@ -772,7 +780,7 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t da >          } args; >          struct ifdrv *ifd = (struct ifdrv *) data; >          const struct bridge_control *bc; > - int error = 0; > + int error = 0, oldmtu; > >          switch (cmd) { > > @@ -818,11 +826,23 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t da >                                  break; >                  } > > + oldmtu = ifp->if_mtu; >                  BRIDGE_LOCK(sc); >                  error = (*bc->bc_func)(sc, &args); >                  BRIDGE_UNLOCK(sc); >                  if (error) >                          break; > + > + /* > + * Bridge MTU may change during addition of the first port. > + * If it did, do network layer specific procedure. > + */ > + if (ifp->if_mtu != oldmtu) { > +#ifdef INET6 > + nd6_setmtu(ifp); > +#endif > + rt_updatemtu(ifp); > + } > >                  if (bc->bc_flags & BC_F_COPYOUT) >                          error = copyout(&args, ifd->ifd_data, ifd->ifd_len); > > Modified: head/sys/net/if_lagg.c > ============================================================================== > --- head/sys/net/if_lagg.c Wed Jan 22 20:31:01 2020 (r356992) > +++ head/sys/net/if_lagg.c Wed Jan 22 20:36:45 2020 (r356993) > @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); >  #include >  #include >  #include > +#include >  #include > >  #if defined(INET) || defined(INET6) > @@ -74,6 +75,14 @@ __FBSDID("$FreeBSD$"); >  #include >  #include > > +#ifdef INET6 > +/* > + * XXX: declare here to avoid to include many inet6 related files.. > + * should be more generalized? > + */ > +extern void nd6_setmtu(struct ifnet *); > +#endif > + >  #define LAGG_RLOCK() struct epoch_tracker lagg_et; epoch_enter_preempt(net_epoch_preempt, &lagg_et) >  #define LAGG_RUNLOCK() epoch_exit_preempt(net_epoch_preempt, &lagg_et) >  #define LAGG_RLOCK_ASSERT() NET_EPOCH_ASSERT() > @@ -1178,7 +1187,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data >          struct ifnet *tpif; >          struct thread *td = curthread; >          char *buf, *outbuf; > - int count, buflen, len, error = 0; > + int count, buflen, len, error = 0, oldmtu; > >          bzero(&rpbuf, sizeof(rpbuf)); > > @@ -1453,10 +1462,23 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data >                                      tpif->if_xname); >                  } >  #endif > + oldmtu = ifp->if_mtu; >                  LAGG_XLOCK(sc); >                  error = lagg_port_create(sc, tpif); >                  LAGG_XUNLOCK(sc); >                  if_rele(tpif); > + > + /* > + * LAGG MTU may change during addition of the first port. > + * If it did, do network layer specific procedure. > + */ > + if (ifp->if_mtu != oldmtu) { > +#ifdef INET6 > + nd6_setmtu(ifp); > +#endif > + rt_updatemtu(ifp); > + } > + >                  VLAN_CAPABILITIES(ifp); >                  break; >          case SIOCSLAGGDELPORT: > > Modified: head/sys/net/if_vlan.c > ============================================================================== > --- head/sys/net/if_vlan.c Wed Jan 22 20:31:01 2020 (r356992) > +++ head/sys/net/if_vlan.c Wed Jan 22 20:36:45 2020 (r356993) > @@ -46,6 +46,7 @@ >  __FBSDID("$FreeBSD$"); > >  #include "opt_inet.h" > +#include "opt_inet6.h" >  #include "opt_kern_tls.h" >  #include "opt_vlan.h" >  #include "opt_ratelimit.h" > @@ -75,6 +76,7 @@ __FBSDID("$FreeBSD$"); >  #include >  #include >  #include > +#include >  #include > >  #ifdef INET > @@ -82,6 +84,14 @@ __FBSDID("$FreeBSD$"); >  #include >  #endif > > +#ifdef INET6 > +/* > + * XXX: declare here to avoid to include many inet6 related files.. > + * should be more generalized? > + */ > +extern void nd6_setmtu(struct ifnet *); > +#endif > + >  #define VLAN_DEF_HWIDTH 4 >  #define VLAN_IFFLAGS (IFF_BROADCAST | IFF_MULTICAST) > > @@ -1807,7 +1817,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data >          struct ifvlan *ifv; >          struct ifvlantrunk *trunk; >          struct vlanreq vlr; > - int error = 0; > + int error = 0, oldmtu; > >          ifr = (struct ifreq *)data; >          ifa = (struct ifaddr *) data; > @@ -1901,8 +1911,20 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data >                          error = ENOENT; >                          break; >                  } > + oldmtu = ifp->if_mtu; >                  error = vlan_config(ifv, p, vlr.vlr_tag); >                  if_rele(p); > + > + /* > + * VLAN MTU may change during addition of the vlandev. > + * If it did, do network layer specific procedure. > + */ > + if (ifp->if_mtu != oldmtu) { > +#ifdef INET6 > + nd6_setmtu(ifp); > +#endif > + rt_updatemtu(ifp); > + } >                  break; > >          case SIOCGETVLAN: From owner-svn-src-all@freebsd.org Wed Jan 22 21:01:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 958D91FD520; Wed, 22 Jan 2020 21:01:19 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482yW33QXrz4X20; Wed, 22 Jan 2020 21:01:19 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 701253908; Wed, 22 Jan 2020 21:01:19 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00ML1J67069953; Wed, 22 Jan 2020 21:01:19 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00ML1JZW069936; Wed, 22 Jan 2020 21:01:19 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202001222101.00ML1JZW069936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 22 Jan 2020 21:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356995 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 356995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 21:01:19 -0000 Author: kp Date: Wed Jan 22 21:01:19 2020 New Revision: 356995 URL: https://svnweb.freebsd.org/changeset/base/356995 Log: pfsync: Ensure we enter network epoch before calling ip_output As of r356974 calls to ip_output() require us to be in the network epoch. That wasn't the case for the calls done from pfsyncintr() and pfsync_defer_tmo(). Modified: head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Wed Jan 22 20:53:25 2020 (r356994) +++ head/sys/netpfil/pf/if_pfsync.c Wed Jan 22 21:01:19 2020 (r356995) @@ -1806,6 +1806,7 @@ pfsync_undefer(struct pfsync_deferral *pd, int drop) static void pfsync_defer_tmo(void *arg) { + struct epoch_tracker et; struct pfsync_deferral *pd = arg; struct pfsync_softc *sc = pd->pd_sc; struct mbuf *m = pd->pd_m; @@ -1814,6 +1815,7 @@ pfsync_defer_tmo(void *arg) PFSYNC_BUCKET_LOCK_ASSERT(b); + NET_EPOCH_ENTER(et); CURVNET_SET(m->m_pkthdr.rcvif->if_vnet); TAILQ_REMOVE(&b->b_deferrals, pd, pd_entry); @@ -1828,6 +1830,7 @@ pfsync_defer_tmo(void *arg) pf_release_state(st); CURVNET_RESTORE(); + NET_EPOCH_EXIT(et); } static void @@ -2307,11 +2310,13 @@ pfsync_push_all(struct pfsync_softc *sc) static void pfsyncintr(void *arg) { + struct epoch_tracker et; struct pfsync_softc *sc = arg; struct pfsync_bucket *b; struct mbuf *m, *n; int c; + NET_EPOCH_ENTER(et); CURVNET_SET(sc->sc_ifp->if_vnet); for (c = 0; c < pfsync_buckets; c++) { @@ -2345,6 +2350,7 @@ pfsyncintr(void *arg) } } CURVNET_RESTORE(); + NET_EPOCH_EXIT(et); } static int From owner-svn-src-all@freebsd.org Wed Jan 22 21:02:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B38E71FD801; Wed, 22 Jan 2020 21:02:25 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-yw1-xc2b.google.com (mail-yw1-xc2b.google.com [IPv6:2607:f8b0:4864:20::c2b]) (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 482yXJ27hkz4XWP; Wed, 22 Jan 2020 21:02:24 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-yw1-xc2b.google.com with SMTP id 192so501444ywy.0; Wed, 22 Jan 2020 13:02:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=pdSUk6NTxhDDB0D2Bmj4uPZTR2F1/EUunrW0fo5jqco=; b=HKtDy0C5G0j+4jOxaP3ENZabNtd39+6QbGYPcBNo0joCOUHHssxXpFi3ZmNijqixmJ nMu7XAgrfqd3KF9gWbVA8tKLgYMtzBCOlaGVjWRXLOmjpBqAKtnZjfBSVMxJfWfaxaEz ODUlUhCcKgyKjl32Wypcm0Xi/36+D2rQIzdiJRYo9jn42nCDCwTyRx+xttvQaRishhOP XnmNpaWE12yTIfyxTL761X/mwWxvv/1t2NyNbhazbrmQzSWgxWl2q/+4nPVqnCh/NnJT ATWhSbL2Ahd+f5QficXQqjQ5feYMMf5vO7e2HAXuC5/Vn8sX3S39S9QETSq/FJ6ocAEe vKEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=pdSUk6NTxhDDB0D2Bmj4uPZTR2F1/EUunrW0fo5jqco=; b=JggAoXx3lT3e5TPQtumPsvh1G5GSCRNnaK0yM4oEedHxSn9fmhgKfP0UdwIlHxrLLL LcqZIKGh6y8PRN3mDiVA1LKafHiz2qSv2J7x9pXmGzVdGS3BD5utsA5n4UPqv0aZFh2z 6njER2LJiySO0gunxO/7ovuT4IUGbfK25rY4p6YRVXzqgpArq7Vt1+TKcs7UzEHhGGJn lIkaBCPJ6P0IK5fjWAqtFNE2sxfqcp1q8OvVzJkQMKsmInMrNtlGhN0WVdDJewSkGsiE rx/UtyRle1fa7vWYauGN6ztCMwjCcgkvf+yozybiHLZC3Og6vGkdBbghdvOPJdZPIUs7 OGNQ== X-Gm-Message-State: APjAAAVp5aplz93N0ZgeYWXqMBqUr/qzfQb4+wjRfBRNp4bO/Ib4m59k EZrEM0VitAjVRXzptVqy3iFcbie8 X-Google-Smtp-Source: APXvYqy3DN/ddP8fIorFWfBlNOg7pidWr7mcMFp9BeoSvKNpKQWD4idT7RHez4krmQhGKIVNy1VDEA== X-Received: by 2002:a81:52d2:: with SMTP id g201mr8386997ywb.258.1579726942886; Wed, 22 Jan 2020 13:02:22 -0800 (PST) Received: from mavoffice.ixsystems.com ([12.189.233.129]) by smtp.gmail.com with ESMTPSA id t206sm11768712ywe.62.2020.01.22.13.02.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Jan 2020 13:02:21 -0800 (PST) Sender: Alexander Motin Subject: Re: svn commit: r356993 - head/sys/net To: "Alexander V. Chernikov" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <202001222036.00MKakdv056453@repo.freebsd.org> <186041579726759@vla5-4452c58d5c14.qloud-c.yandex.net> From: Alexander Motin Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAG0IUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPokBVwQTAQoAQQIbAwULCQgH AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ Yr4+raS5AQ0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6Z AXgDtmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8Flv mI/c40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt 3ytU8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZ R1EdEIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm5 9R8AEQEAAYkBPAQYAQoAJgIbDBYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMLYBQkNMczM AAoJEIMYw5VbqyJ/TqgH/RQHClkvecE0262lwKoP/m0Mh4I5TLRgoJJn8S7G1BnqohYJkiLq A6xe6urGD7OqdNAl12UbrjWbdJV+zvea3vJoM4MZuYiYrGaXWxzFXqWJcPwMU9sAh8MRghHu uC5vgPb45Tnftw9/+n0i8GfVhQhOqepUGdQg4NPcXviSkoAvig6pp9Lcxisn0groUQKt15Gc sS9YcQWg3j9Hnipc6Mu416HX98Fb113NHJqc2geTHLkRyuBFOoyIqB6N9GKjzOAIzxxsVdl9 TevwGsrp4M4/RFzWbSgsbOnbE7454lmuVZGfReEjnUm8RHp9Q2UWKXlp3exlZjvOp/uVEpCg lz65AQ0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6ZAXgD tmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8FlvmI/c 40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt3ytU 8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZR1Ed EIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm59R8A EQEAAYkBPAQYAQoAJgIbDBYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMLYBQkNMczMAAoJ EIMYw5VbqyJ/TqgH/RQHClkvecE0262lwKoP/m0Mh4I5TLRgoJJn8S7G1BnqohYJkiLqA6xe 6urGD7OqdNAl12UbrjWbdJV+zvea3vJoM4MZuYiYrGaXWxzFXqWJcPwMU9sAh8MRghHuuC5v gPb45Tnftw9/+n0i8GfVhQhOqepUGdQg4NPcXviSkoAvig6pp9Lcxisn0groUQKt15GcsS9Y cQWg3j9Hnipc6Mu416HX98Fb113NHJqc2geTHLkRyuBFOoyIqB6N9GKjzOAIzxxsVdl9Tevw Gsrp4M4/RFzWbSgsbOnbE7454lmuVZGfReEjnUm8RHp9Q2UWKXlp3exlZjvOp/uVEpCglz4= Message-ID: <9b379fd1-3774-601d-1ea2-96003e0850cd@FreeBSD.org> Date: Wed, 22 Jan 2020 16:02:20 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <186041579726759@vla5-4452c58d5c14.qloud-c.yandex.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 482yXJ27hkz4XWP X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=HKtDy0C5; dmarc=none; spf=pass (mx1.freebsd.org: domain of mavbsd@gmail.com designates 2607:f8b0:4864:20::c2b as permitted sender) smtp.mailfrom=mavbsd@gmail.com X-Spamd-Result: default: False [-4.85 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-2.65)[ip: (-9.31), ipnet: 2607:f8b0::/32(-2.07), asn: 15169(-1.82), country: US(-0.05)]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[b.2.c.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FORGED_SENDER(0.30)[mav@FreeBSD.org,mavbsd@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[mav@FreeBSD.org,mavbsd@gmail.com]; 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: Wed, 22 Jan 2020 21:02:25 -0000 On 22.01.2020 15:59, Alexander V. Chernikov wrote: > 22.01.2020, 20:36, "Alexander Motin" : >> Author: mav >> Date: Wed Jan 22 20:36:45 2020 >> New Revision: 356993 >> URL: https://svnweb.freebsd.org/changeset/base/356993 >> >> Log: >>   Update route MTUs for bridge, lagg and vlan interfaces. >> >>   Those interfaces may implicitly change their MTU on addition of parent >>   interface in addition to normal SIOCSIFMTU ioctl path, where the route >>   MTUs are updated normally. >> >>   MFC after: 2 weeks >>   Sponsored by: iXsystems, Inc. >> >> Modified: >>   head/sys/net/if_bridge.c >>   head/sys/net/if_lagg.c >>   head/sys/net/if_vlan.c > I'd suggest not duplicating business logic on providing notifications to multiple subsystems in each driver. This adds unnecessary complexity/layer violations. What do you think of creating something like if_notify_mtu_change(), embed these 2 calls there and use it everywhere? I'd be happy to use such KPI, but would prefer somebody more familiar with modern ifnet tendencies then me to design it. ;) -- Alexander Motin From owner-svn-src-all@freebsd.org Wed Jan 22 21:13:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 310331FDD61; Wed, 22 Jan 2020 21:13:14 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward500p.mail.yandex.net (forward500p.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:110]) (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 482ymp03QCz4Y6n; Wed, 22 Jan 2020 21:13:13 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from mxback9q.mail.yandex.net (mxback9q.mail.yandex.net [IPv6:2a02:6b8:c0e:6b:0:640:b813:52e4]) by forward500p.mail.yandex.net (Yandex) with ESMTP id 92F2994010D; Thu, 23 Jan 2020 00:13:09 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback9q.mail.yandex.net (mxback/Yandex) with ESMTP id OcpHRvF7Dr-D9wubrNJ; Thu, 23 Jan 2020 00:13:09 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1579727589; bh=KJSyahvpQltWhE3gzNe5Fam/aS4D050O25K+2nlNB+4=; h=Message-Id:Subject:In-Reply-To:Date:References:To:From; b=TicGOxNWJEtZDE9KP5T4/qQJebXNjTKG5eUdMGbezLqM9YjTiZ8I64OjAfO9iiBe7 WCJZ5dHhKy/H3yfxAhjzt0NwRYYqIVwohlj0fPoq157NmYbIy1j/Gfm3G4DYp0OPvU 9GEtNOsZHVygfdzVUwJ1XdP+Tpv0guQVRmXQV8+g= Received: by vla5-4a37cde0b550.qloud-c.yandex.net with HTTP; Thu, 23 Jan 2020 00:13:09 +0300 From: Alexander V. Chernikov Envelope-From: melifaro@ipfw.ru To: Alexander Motin , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: <9b379fd1-3774-601d-1ea2-96003e0850cd@FreeBSD.org> References: <202001222036.00MKakdv056453@repo.freebsd.org> <186041579726759@vla5-4452c58d5c14.qloud-c.yandex.net> <9b379fd1-3774-601d-1ea2-96003e0850cd@FreeBSD.org> Subject: Re: svn commit: r356993 - head/sys/net MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Wed, 22 Jan 2020 21:13:09 +0000 Message-Id: <219901579727589@vla5-4a37cde0b550.qloud-c.yandex.net> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 X-Rspamd-Queue-Id: 482ymp03QCz4Y6n X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,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: Wed, 22 Jan 2020 21:13:14 -0000 22.01.2020, 21:02, "Alexander Motin" : > On 22.01.2020 15:59, Alexander V. Chernikov wrote: >>  22.01.2020, 20:36, "Alexander Motin" : >>>  Author: mav >>>  Date: Wed Jan 22 20:36:45 2020 >>>  New Revision: 356993 >>>  URL: https://svnweb.freebsd.org/changeset/base/356993 >>> >>>  Log: >>>    Update route MTUs for bridge, lagg and vlan interfaces. >>> >>>    Those interfaces may implicitly change their MTU on addition of parent >>>    interface in addition to normal SIOCSIFMTU ioctl path, where the route >>>    MTUs are updated normally. >>> >>>    MFC after: 2 weeks >>>    Sponsored by: iXsystems, Inc. >>> >>>  Modified: >>>    head/sys/net/if_bridge.c >>>    head/sys/net/if_lagg.c >>>    head/sys/net/if_vlan.c >>  I'd suggest not duplicating business logic on providing notifications to multiple subsystems in each driver. This adds unnecessary complexity/layer violations. What do you think of creating something like if_notify_mtu_change(), embed these 2 calls there and use it everywhere? > > I'd be happy to use such KPI, but would prefer somebody more familiar > with modern ifnet tendencies then me to design it. ;) I guess raising a review with addition of such a KPI would summon some folks if they're not happy :-) The current change looks rather hackish and I'd really love to see a bit more accurate version in a tree.. > > -- > Alexander Motin From owner-svn-src-all@freebsd.org Wed Jan 22 21:21:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 497781FE11C; Wed, 22 Jan 2020 21:21:01 +0000 (UTC) (envelope-from Michael.Tuexen@macmic.franken.de) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 482yxn1FjFz4YQc; Wed, 22 Jan 2020 21:21:00 +0000 (UTC) (envelope-from Michael.Tuexen@macmic.franken.de) Received: from [IPv6:2a02:8109:1140:c3d:1100:835:6fed:d688] (unknown [IPv6:2a02:8109:1140:c3d:1100:835:6fed:d688]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 23B09721E281E; Wed, 22 Jan 2020 22:20:56 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Subject: Re: svn commit: r356989 - head/sys/netinet From: Michael Tuexen In-Reply-To: <202001221719.00MHJrvq033961@repo.freebsd.org> Date: Wed, 22 Jan 2020 22:20:55 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <202001221719.00MHJrvq033961@repo.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.3608.40.2.2.4) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 482yxn1FjFz4YQc X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-0.99)[-0.994,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, 22 Jan 2020 21:21:01 -0000 > On 22. Jan 2020, at 18:19, Gleb Smirnoff wrote: >=20 > Author: glebius > Date: Wed Jan 22 17:19:53 2020 > New Revision: 356989 > URL: https://svnweb.freebsd.org/changeset/base/356989 >=20 > Log: > Plug possible calls into ip6?_output() without network epoch from = SCTP > bluntly adding epoch entrance into the macro that SCTP uses to call > ip6?_output(). This definitely will introduce several epoch = recursions. Can you specify under which condition NET_EPOCH_ENTER() should be = called? Then I can try to figure out where these calls need to be made in the SCTP code. Best regards Michael >=20 > Reported by: = https://syzkaller.appspot.com/bug?id=3D79f03f574594a5be464997310896765c458= ed80a > Reported by: = https://syzkaller.appspot.com/bug?id=3D07c6f52106cddbe356cc2b2f3664a1c51cc= 0dadf >=20 > Modified: > head/sys/netinet/sctp_os_bsd.h >=20 > Modified: head/sys/netinet/sctp_os_bsd.h > = =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 > --- head/sys/netinet/sctp_os_bsd.h Wed Jan 22 17:06:55 2020 = (r356988) > +++ head/sys/netinet/sctp_os_bsd.h Wed Jan 22 17:19:53 2020 = (r356989) > @@ -412,6 +412,7 @@ typedef struct rtentry sctp_rtentry_t; > */ > #define SCTP_IP_OUTPUT(result, o_pak, ro, stcb, vrf_id) \ > { \ > + struct epoch_tracker et; \ > int o_flgs =3D IP_RAWOUTPUT; \ > struct sctp_tcb *local_stcb =3D stcb; \ > if (local_stcb && \ > @@ -419,19 +420,24 @@ typedef struct rtentry sctp_rtentry_t; > local_stcb->sctp_ep->sctp_socket) \ > o_flgs |=3D local_stcb->sctp_ep->sctp_socket->so_options = & SO_DONTROUTE; \ > m_clrprotoflags(o_pak); \ > + NET_EPOCH_ENTER(et); \ > result =3D ip_output(o_pak, NULL, ro, o_flgs, 0, NULL); \ > + NET_EPOCH_EXIT(et); \ > } >=20 > #define SCTP_IP6_OUTPUT(result, o_pak, ro, ifp, stcb, vrf_id) \ > { \ > + struct epoch_tracker et; \ > struct sctp_tcb *local_stcb =3D stcb; \ > m_clrprotoflags(o_pak); \ > + NET_EPOCH_ENTER(et); \ > if (local_stcb && local_stcb->sctp_ep) \ > result =3D ip6_output(o_pak, \ > ((struct inpcb = *)(local_stcb->sctp_ep))->in6p_outputopts, \ > (ro), 0, 0, ifp, NULL); \ > else \ > result =3D ip6_output(o_pak, NULL, (ro), 0, 0, ifp, = NULL); \ > + NET_EPOCH_EXIT(et); \ > } >=20 > struct mbuf * From owner-svn-src-all@freebsd.org Wed Jan 22 21:21:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 275921FE1B2; Wed, 22 Jan 2020 21:21:25 +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 482yyF02ZDz4YZH; Wed, 22 Jan 2020 21:21:25 +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 F0A533D6D; Wed, 22 Jan 2020 21:21:24 +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 00MLLO4F083147; Wed, 22 Jan 2020 21:21:24 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00MLLOeb083146; Wed, 22 Jan 2020 21:21:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001222121.00MLLOeb083146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 22 Jan 2020 21:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356996 - head X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 356996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 21:21:25 -0000 Author: jhb Date: Wed Jan 22 21:21:24 2020 New Revision: 356996 URL: https://svnweb.freebsd.org/changeset/base/356996 Log: Remove support for auto-selecting an external binutils. All of the in-tree architectures not supported by in-tree binutils are supported by lld, so the condition is now always false. It also didn't fully work since the external binutils are installed into a directory that uses the host's OS version, not the target OS version. Reviewed by: emaste, imp Differential Revision: https://reviews.freebsd.org/D23294 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Jan 22 21:01:19 2020 (r356995) +++ head/Makefile.inc1 Wed Jan 22 21:21:24 2020 (r356996) @@ -180,24 +180,6 @@ MK_SYSTEM_LINKER= no .if defined(CROSS_TOOLCHAIN_PREFIX) CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} .endif -# If we do not have a bootstrap binutils (because the in-tree one does not -# support the target architecture), provide a default cross-binutils prefix. -# This allows riscv64 builds, for example, to automatically use the -# riscv64-binutils port or package. -.if !make(showconfig) && !defined(_NO_INCLUDE_COMPILERMK) -.if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \ - ${MK_LLD_BOOTSTRAP} == "no" && \ - !defined(CROSS_BINUTILS_PREFIX) -CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_TRIPLE}/bin/ -.if !exists(${CROSS_BINUTILS_PREFIX}) -.if !empty(BROKEN_OPTIONS:MGCC_BOOTSTRAP) && ${MK_CLANG_BOOTSTRAP} == "no" -.error In-tree toolchain does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-xtoolchain-gcc port or package or set CROSS_TOOLCHAIN_PREFIX. -.else -.error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX. -.endif -.endif -.endif -.endif XBINUTILS= AS AR LD NM OBJCOPY RANLIB SIZE STRINGS .for BINUTIL in ${XBINUTILS} .if defined(CROSS_BINUTILS_PREFIX) && \ From owner-svn-src-all@freebsd.org Wed Jan 22 22:08:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE1BF1FF018; Wed, 22 Jan 2020 22:08:02 +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 4830024qxmz4bsj; Wed, 22 Jan 2020 22:08:02 +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 9C96746E3; Wed, 22 Jan 2020 22:08:02 +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 00MM82ee010868; Wed, 22 Jan 2020 22:08:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00MM828X010867; Wed, 22 Jan 2020 22:08:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001222208.00MM828X010867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 22 Jan 2020 22:08:02 +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: r357000 - stable/12/sys/arm/broadcom/bcm2835 X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 357000 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 22:08:02 -0000 Author: kevans Date: Wed Jan 22 22:08:02 2020 New Revision: 357000 URL: https://svnweb.freebsd.org/changeset/base/357000 Log: MFC r356849: bcm2835_vcbus: unifdef all platform definitions Raspberry Pi are all over the board, and the reality is that there's no harm in including all of the definitions by default but plenty of harm in the current situation. This change is safe because we match a definition by root /compatible in the FDT, so there will be no false-positives because of it. The main array of definitions grows, but it's only walked exactly once to determine which we need to use. Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c ============================================================================== --- stable/12/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c Wed Jan 22 22:01:43 2020 (r356999) +++ stable/12/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c Wed Jan 22 22:08:02 2020 (r357000) @@ -35,9 +35,6 @@ __FBSDID("$FreeBSD$"); * mappings for use in DMA/mailbox interactions. This is only used for the * arm64 SoC because the 32-bit SoC used the same mappings. */ -#if defined (__aarch64__) -#include "opt_soc.h" -#endif #include #include @@ -67,7 +64,6 @@ struct bcm283x_memory_mapping { vm_paddr_t vcbus_start; }; -#ifdef SOC_BCM2835 static struct bcm283x_memory_mapping bcm2835_memmap[] = { { /* SDRAM */ @@ -83,9 +79,7 @@ static struct bcm283x_memory_mapping bcm2835_memmap[] }, { 0, 0, 0 }, }; -#endif -#ifdef SOC_BCM2836 static struct bcm283x_memory_mapping bcm2836_memmap[] = { { /* SDRAM */ @@ -101,9 +95,7 @@ static struct bcm283x_memory_mapping bcm2836_memmap[] }, { 0, 0, 0 }, }; -#endif -#ifdef SOC_BRCM_BCM2837 static struct bcm283x_memory_mapping bcm2837_memmap[] = { { /* SDRAM */ @@ -119,10 +111,7 @@ static struct bcm283x_memory_mapping bcm2837_memmap[] }, { 0, 0, 0 }, }; -#endif -#ifdef SOC_BRCM_BCM2838 - /* * The BCM2838 supports up to 4GB of SDRAM, but unfortunately we can still only * map the first 1GB into the "legacy master view" (vcbus) address space. Thus, @@ -144,14 +133,12 @@ static struct bcm283x_memory_mapping bcm2838_memmap[] }, { 0, 0, 0 }, }; -#endif static struct bcm283x_memory_soc_cfg { struct bcm283x_memory_mapping *memmap; const char *soc_compat; bus_addr_t busdma_lowaddr; } bcm283x_memory_configs[] = { -#ifdef SOC_BCM2835 /* Legacy */ { .memmap = bcm2835_memmap, @@ -164,8 +151,6 @@ static struct bcm283x_memory_soc_cfg { .soc_compat = "brcm,bcm2835", .busdma_lowaddr = BUS_SPACE_MAXADDR_32BIT, }, -#endif -#ifdef SOC_BCM2836 /* Legacy */ { .memmap = bcm2836_memmap, @@ -178,16 +163,11 @@ static struct bcm283x_memory_soc_cfg { .soc_compat = "brcm,bcm2836", .busdma_lowaddr = BUS_SPACE_MAXADDR_32BIT, }, - -#endif -#ifdef SOC_BRCM_BCM2837 { .memmap = bcm2837_memmap, .soc_compat = "brcm,bcm2837", .busdma_lowaddr = BUS_SPACE_MAXADDR_32BIT, }, -#endif -#ifdef SOC_BRCM_BCM2838 { .memmap = bcm2838_memmap, .soc_compat = "brcm,bcm2711", @@ -198,7 +178,6 @@ static struct bcm283x_memory_soc_cfg { .soc_compat = "brcm,bcm2838", .busdma_lowaddr = BCM2838_PERIPH_MAXADDR, }, -#endif }; static struct bcm283x_memory_soc_cfg *booted_soc_memcfg; From owner-svn-src-all@freebsd.org Wed Jan 22 22:51:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C47C0221280; Wed, 22 Jan 2020 22:51:56 +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 4830yh4v63z4f1L; Wed, 22 Jan 2020 22:51:56 +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 A33A24FB8; Wed, 22 Jan 2020 22:51:56 +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 00MMpuYT036545; Wed, 22 Jan 2020 22:51:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00MMpuTo036542; Wed, 22 Jan 2020 22:51:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001222251.00MMpuTo036542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 22 Jan 2020 22:51: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: r357001 - in stable: 11/cddl/contrib/opensolaris/lib/libzfs/common 11/lib/libbe 12/cddl/contrib/opensolaris/lib/libzfs/common 12/lib/libbe X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/cddl/contrib/opensolaris/lib/libzfs/common 11/lib/libbe 12/cddl/contrib/opensolaris/lib/libzfs/common 12/lib/libbe X-SVN-Commit-Revision: 357001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 22:51:56 -0000 Author: kevans Date: Wed Jan 22 22:51:55 2020 New Revision: 357001 URL: https://svnweb.freebsd.org/changeset/base/357001 Log: MFC r356876-r356877: add zfs_mount_at r356876: libzfs: add zfs_mount_at This will be used in libbe in place of the internal zmount(); libbe only wants to be able to mount a dataset at an arbitrary mountpoint without altering dataset/pool properties. The natural way to do this in a portable way is by creating a zfs_mount_at() interface that's effectively zfs_mount() + a mountpoint parameter. zfs_mount() is now a light wrapper around the new method. The interface and implementation have already been accepted into ZFS On Linux, and the next commit to switch libbe() over to this new interface will solve the last compatibility issue with ZoL. The next sysutils/openzfs rebase against ZoL should be able to build libbe/bectl with only minor adjustments to build glue. r356877: libbe: use the new zfs_mount_at() More background is available in r356876, but this new interface is more portable across ZFS implementations and cleaner for what libbe is attempting to achieve anyways. Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c stable/11/lib/libbe/be_access.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c stable/12/lib/libbe/be_access.c Directory Properties: stable/12/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Wed Jan 22 22:08:02 2020 (r357000) +++ stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Wed Jan 22 22:51:55 2020 (r357001) @@ -748,6 +748,7 @@ extern boolean_t zfs_bookmark_exists(const char *path) extern boolean_t is_mounted(libzfs_handle_t *, const char *special, char **); extern boolean_t zfs_is_mounted(zfs_handle_t *, char **); extern int zfs_mount(zfs_handle_t *, const char *, int); +extern int zfs_mount_at(zfs_handle_t *, const char *, int, const char *); extern int zfs_unmount(zfs_handle_t *, const char *, int); extern int zfs_unmountall(zfs_handle_t *, int); Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Wed Jan 22 22:08:02 2020 (r357000) +++ stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Wed Jan 22 22:51:55 2020 (r357001) @@ -301,6 +301,17 @@ zfs_is_mounted(zfs_handle_t *zhp, char **where) return (is_mounted(zhp->zfs_hdl, zfs_get_name(zhp), where)); } +static boolean_t +zfs_is_mountable_internal(zfs_handle_t *zhp, const char *mountpoint) +{ + + if (zfs_prop_get_int(zhp, ZFS_PROP_ZONED) && + getzoneid() == GLOBAL_ZONEID) + return (B_FALSE); + + return (B_TRUE); +} + /* * Returns true if the given dataset is mountable, false otherwise. Returns the * mountpoint in 'buf'. @@ -325,8 +336,7 @@ zfs_is_mountable(zfs_handle_t *zhp, char *buf, size_t if (zfs_prop_get_int(zhp, ZFS_PROP_CANMOUNT) == ZFS_CANMOUNT_OFF) return (B_FALSE); - if (zfs_prop_get_int(zhp, ZFS_PROP_ZONED) && - getzoneid() == GLOBAL_ZONEID) + if (!zfs_is_mountable_internal(zhp, buf)) return (B_FALSE); if (source) @@ -341,8 +351,19 @@ zfs_is_mountable(zfs_handle_t *zhp, char *buf, size_t int zfs_mount(zfs_handle_t *zhp, const char *options, int flags) { - struct stat buf; char mountpoint[ZFS_MAXPROPLEN]; + + if (!zfs_is_mountable(zhp, mountpoint, sizeof (mountpoint), NULL)) + return (0); + + return (zfs_mount_at(zhp, options, flags, mountpoint)); +} + +int +zfs_mount_at(zfs_handle_t *zhp, const char *options, int flags, + const char *mountpoint) +{ + struct stat buf; char mntopts[MNT_LINE_MAX]; libzfs_handle_t *hdl = zhp->zfs_hdl; @@ -357,8 +378,8 @@ zfs_mount(zfs_handle_t *zhp, const char *options, int if (zpool_get_prop_int(zhp->zpool_hdl, ZPOOL_PROP_READONLY, NULL)) flags |= MS_RDONLY; - if (!zfs_is_mountable(zhp, mountpoint, sizeof (mountpoint), NULL)) - return (0); + if (!zfs_is_mountable_internal(zhp, mountpoint)) + return (B_FALSE); /* Create the directory if it doesn't already exist */ if (lstat(mountpoint, &buf) != 0) { Modified: stable/11/lib/libbe/be_access.c ============================================================================== --- stable/11/lib/libbe/be_access.c Wed Jan 22 22:08:02 2020 (r357000) +++ stable/11/lib/libbe/be_access.c Wed Jan 22 22:51:55 2020 (r357001) @@ -82,7 +82,6 @@ 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; @@ -121,9 +120,7 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data) mountpoint); } - opt = '\0'; - if ((err = zmount(zfs_get_name(zfs_hdl), tmp, info->mntflags, - __DECONST(char *, MNTTYPE_ZFS), NULL, 0, &opt, 1)) != 0) { + if ((err = zfs_mount_at(zfs_hdl, NULL, info->mntflags, tmp)) != 0) { switch (errno) { case ENAMETOOLONG: return (set_error(info->lbh, BE_ERR_PATHLEN)); From owner-svn-src-all@freebsd.org Wed Jan 22 22:51:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8568D221284; Wed, 22 Jan 2020 22:51: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 4830yj33T6z4f1N; Wed, 22 Jan 2020 22:51: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 640584FBA; Wed, 22 Jan 2020 22:51: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 00MMpvUV036554; Wed, 22 Jan 2020 22:51:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00MMpuZi036550; Wed, 22 Jan 2020 22:51:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001222251.00MMpuZi036550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 22 Jan 2020 22:51: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: r357001 - in stable: 11/cddl/contrib/opensolaris/lib/libzfs/common 11/lib/libbe 12/cddl/contrib/opensolaris/lib/libzfs/common 12/lib/libbe X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/cddl/contrib/opensolaris/lib/libzfs/common 11/lib/libbe 12/cddl/contrib/opensolaris/lib/libzfs/common 12/lib/libbe X-SVN-Commit-Revision: 357001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 22:51:57 -0000 Author: kevans Date: Wed Jan 22 22:51:55 2020 New Revision: 357001 URL: https://svnweb.freebsd.org/changeset/base/357001 Log: MFC r356876-r356877: add zfs_mount_at r356876: libzfs: add zfs_mount_at This will be used in libbe in place of the internal zmount(); libbe only wants to be able to mount a dataset at an arbitrary mountpoint without altering dataset/pool properties. The natural way to do this in a portable way is by creating a zfs_mount_at() interface that's effectively zfs_mount() + a mountpoint parameter. zfs_mount() is now a light wrapper around the new method. The interface and implementation have already been accepted into ZFS On Linux, and the next commit to switch libbe() over to this new interface will solve the last compatibility issue with ZoL. The next sysutils/openzfs rebase against ZoL should be able to build libbe/bectl with only minor adjustments to build glue. r356877: libbe: use the new zfs_mount_at() More background is available in r356876, but this new interface is more portable across ZFS implementations and cleaner for what libbe is attempting to achieve anyways. Modified: stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c stable/12/lib/libbe/be_access.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c stable/11/lib/libbe/be_access.c Directory Properties: stable/11/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Wed Jan 22 22:08:02 2020 (r357000) +++ stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Wed Jan 22 22:51:55 2020 (r357001) @@ -752,6 +752,7 @@ extern boolean_t zfs_bookmark_exists(const char *path) extern boolean_t is_mounted(libzfs_handle_t *, const char *special, char **); extern boolean_t zfs_is_mounted(zfs_handle_t *, char **); extern int zfs_mount(zfs_handle_t *, const char *, int); +extern int zfs_mount_at(zfs_handle_t *, const char *, int, const char *); extern int zfs_unmount(zfs_handle_t *, const char *, int); extern int zfs_unmountall(zfs_handle_t *, int); Modified: stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Wed Jan 22 22:08:02 2020 (r357000) +++ stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Wed Jan 22 22:51:55 2020 (r357001) @@ -301,6 +301,17 @@ zfs_is_mounted(zfs_handle_t *zhp, char **where) return (is_mounted(zhp->zfs_hdl, zfs_get_name(zhp), where)); } +static boolean_t +zfs_is_mountable_internal(zfs_handle_t *zhp, const char *mountpoint) +{ + + if (zfs_prop_get_int(zhp, ZFS_PROP_ZONED) && + getzoneid() == GLOBAL_ZONEID) + return (B_FALSE); + + return (B_TRUE); +} + /* * Returns true if the given dataset is mountable, false otherwise. Returns the * mountpoint in 'buf'. @@ -325,8 +336,7 @@ zfs_is_mountable(zfs_handle_t *zhp, char *buf, size_t if (zfs_prop_get_int(zhp, ZFS_PROP_CANMOUNT) == ZFS_CANMOUNT_OFF) return (B_FALSE); - if (zfs_prop_get_int(zhp, ZFS_PROP_ZONED) && - getzoneid() == GLOBAL_ZONEID) + if (!zfs_is_mountable_internal(zhp, buf)) return (B_FALSE); if (source) @@ -341,8 +351,19 @@ zfs_is_mountable(zfs_handle_t *zhp, char *buf, size_t int zfs_mount(zfs_handle_t *zhp, const char *options, int flags) { - struct stat buf; char mountpoint[ZFS_MAXPROPLEN]; + + if (!zfs_is_mountable(zhp, mountpoint, sizeof (mountpoint), NULL)) + return (0); + + return (zfs_mount_at(zhp, options, flags, mountpoint)); +} + +int +zfs_mount_at(zfs_handle_t *zhp, const char *options, int flags, + const char *mountpoint) +{ + struct stat buf; char mntopts[MNT_LINE_MAX]; libzfs_handle_t *hdl = zhp->zfs_hdl; @@ -357,8 +378,8 @@ zfs_mount(zfs_handle_t *zhp, const char *options, int if (zpool_get_prop_int(zhp->zpool_hdl, ZPOOL_PROP_READONLY, NULL)) flags |= MS_RDONLY; - if (!zfs_is_mountable(zhp, mountpoint, sizeof (mountpoint), NULL)) - return (0); + if (!zfs_is_mountable_internal(zhp, mountpoint)) + return (B_FALSE); /* Create the directory if it doesn't already exist */ if (lstat(mountpoint, &buf) != 0) { Modified: stable/12/lib/libbe/be_access.c ============================================================================== --- stable/12/lib/libbe/be_access.c Wed Jan 22 22:08:02 2020 (r357000) +++ stable/12/lib/libbe/be_access.c Wed Jan 22 22:51:55 2020 (r357001) @@ -82,7 +82,6 @@ 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; @@ -121,9 +120,7 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data) mountpoint); } - opt = '\0'; - if ((err = zmount(zfs_get_name(zfs_hdl), tmp, info->mntflags, - __DECONST(char *, MNTTYPE_ZFS), NULL, 0, &opt, 1)) != 0) { + if ((err = zfs_mount_at(zfs_hdl, NULL, info->mntflags, tmp)) != 0) { switch (errno) { case ENAMETOOLONG: return (set_error(info->lbh, BE_ERR_PATHLEN)); From owner-svn-src-all@freebsd.org Wed Jan 22 23:28:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A36222202D; Wed, 22 Jan 2020 23:28:44 +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 4831n83vFzz3C8D; Wed, 22 Jan 2020 23:28:44 +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 80DBF5599; Wed, 22 Jan 2020 23:28:44 +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 00MNSisS058367; Wed, 22 Jan 2020 23:28:44 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00MNSh8a058358; Wed, 22 Jan 2020 23:28:43 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001222328.00MNSh8a058358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 22 Jan 2020 23:28:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357002 - in head: share/man/man4 sys/conf sys/kern sys/modules/cpufreq sys/sys sys/x86/cpufreq X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: share/man/man4 sys/conf sys/kern sys/modules/cpufreq sys/sys sys/x86/cpufreq X-SVN-Commit-Revision: 357002 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 22 Jan 2020 23:28:44 -0000 Author: cem Date: Wed Jan 22 23:28:42 2020 New Revision: 357002 URL: https://svnweb.freebsd.org/changeset/base/357002 Log: cpufreq(4): Add support for Intel Speed Shift Intel Speed Shift is Intel's technology to control frequency in hardware, with hints from software. Let's get a working version of this in the tree and we can refine it from here. Submitted by: bwidawsk, scottph Reviewed by: bcr (manpages), myself Discussed with: jhb, kib (earlier versions) With feedback from: Greg V, gallatin, freebsdnewbie AT freenet.de Relnotes: yes Differential Revision: https://reviews.freebsd.org/D18028 Added: head/share/man/man4/hwpstate_intel.4 (contents, props changed) head/sys/x86/cpufreq/hwpstate_amd.c - copied unchanged from r357001, head/sys/x86/cpufreq/hwpstate.c head/sys/x86/cpufreq/hwpstate_intel.c (contents, props changed) head/sys/x86/cpufreq/hwpstate_intel_internal.h (contents, props changed) Deleted: head/sys/x86/cpufreq/hwpstate.c Modified: head/share/man/man4/cpufreq.4 head/sys/conf/files.x86 head/sys/kern/kern_cpu.c head/sys/modules/cpufreq/Makefile head/sys/sys/cpu.h head/sys/x86/cpufreq/est.c Modified: head/share/man/man4/cpufreq.4 ============================================================================== --- head/share/man/man4/cpufreq.4 Wed Jan 22 22:51:55 2020 (r357001) +++ head/share/man/man4/cpufreq.4 Wed Jan 22 23:28:42 2020 (r357002) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 3, 2006 +.Dd January 22, 2020 .Dt CPUFREQ 4 .Os .Sh NAME @@ -85,6 +85,10 @@ sysctl entry. .Bl -tag -width indent .It Va dev.cpu.%d.freq Current active CPU frequency in MHz. +.It Va dev.cpu.%d.freq_driver +The specific +.Nm +driver used by this cpu. .It Va dev.cpu.%d.freq_levels Currently available levels for the CPU (frequency/power usage). Values are in units of MHz and milliwatts. Added: head/share/man/man4/hwpstate_intel.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/hwpstate_intel.4 Wed Jan 22 23:28:42 2020 (r357002) @@ -0,0 +1,89 @@ +.\" +.\" Copyright (c) 2019 Intel Corporation +.\" +.\" 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 January 22, 2020 +.Dt HWPSTATE_INTEL 4 +.Os +.Sh NAME +.Nm hwpstate_intel +.Nd Intel Speed Shift Technology driver +.Sh SYNOPSIS +To compile this driver into your kernel +place the following line in your kernel +configuration file: +.Bd -ragged -offset indent +.Cd "device cpufreq" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for hardware-controlled performance states on Intel +platforms, also known as Intel Speed Shift Technology. +.Sh LOADER TUNABLES +.Bl -tag -width indent +.It Va hint.hwpstate_intel.0.disabled +Can be used to disable +.Nm , +allowing other compatible drivers to manage performance states, like +.Xr est 4 . +.Pq default 0 +.El +.Sh SYSCTL VARIABLES +The following +.Xr sysctl 8 +values are available +.Bl -tag -width indent +.It Va dev.hwpstate_intel.%d.\%desc +Describes the attached driver +.It dev.hwpstate_intel.0.%desc: Intel Speed Shift +.It Va dev.hwpstate_intel.%d.\%driver +Driver in use, always hwpstate_intel. +.It dev.hwpstate_intel.0.%driver: hwpstate_intel +.It Va dev.hwpstate_intel.%d.\%parent +.It dev.hwpstate_intel.0.%parent: cpu0 +The cpu that is exposing these frequencies. +For example +.Va cpu0 . +.It Va dev.hwpstate_intel.%d.epp +Energy/Performance Preference. +Valid values range from 0 to 100. +Setting this field conveys a hint to the hardware regarding a preference towards +performance (at value 0), energy efficiency (at value 100), or somewhere in +between. +.It dev.hwpstate_intel.0.epp: 0 +.El +.Sh COMPATIBILITY +.Nm +is only found on supported Intel CPUs. +.Sh SEE ALSO +.Xr cpufreq 4 +.Rs +.%T "Intel 64 and IA-32 Architectures Software Developer Manuals" +.%U "http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html" +.Re +.Sh AUTHORS +This manual page was written by +.An D Scott Phillips Aq Mt scottph@FreeBSD.org . Modified: head/sys/conf/files.x86 ============================================================================== --- head/sys/conf/files.x86 Wed Jan 22 22:51:55 2020 (r357001) +++ head/sys/conf/files.x86 Wed Jan 22 23:28:42 2020 (r357002) @@ -290,7 +290,8 @@ x86/acpica/srat.c optional acpi x86/bios/smbios.c optional smbios x86/bios/vpd.c optional vpd x86/cpufreq/est.c optional cpufreq -x86/cpufreq/hwpstate.c optional cpufreq +x86/cpufreq/hwpstate_amd.c optional cpufreq +x86/cpufreq/hwpstate_intel.c optional cpufreq x86/cpufreq/p4tcc.c optional cpufreq x86/cpufreq/powernow.c optional cpufreq x86/iommu/busdma_dmar.c optional acpi acpi_dmar pci Modified: head/sys/kern/kern_cpu.c ============================================================================== --- head/sys/kern/kern_cpu.c Wed Jan 22 22:51:55 2020 (r357001) +++ head/sys/kern/kern_cpu.c Wed Jan 22 23:28:42 2020 (r357002) @@ -76,6 +76,7 @@ struct cpufreq_softc { int all_count; int max_mhz; device_t dev; + device_t cf_drv_dev; struct sysctl_ctx_list sysctl_ctx; struct task startup_task; struct cf_level *levels_buf; @@ -142,6 +143,11 @@ SYSCTL_INT(_debug_cpufreq, OID_AUTO, lowest, CTLFLAG_R SYSCTL_INT(_debug_cpufreq, OID_AUTO, verbose, CTLFLAG_RWTUN, &cf_verbose, 1, "Print verbose debugging messages"); +/* + * This is called as the result of a hardware specific frequency control driver + * calling cpufreq_register. It provides a general interface for system wide + * frequency controls and operates on a per cpu basis. + */ static int cpufreq_attach(device_t dev) { @@ -149,7 +155,6 @@ cpufreq_attach(device_t dev) struct pcpu *pc; device_t parent; uint64_t rate; - int numdevs; CF_DEBUG("initializing %s\n", device_get_nameunit(dev)); sc = device_get_softc(dev); @@ -164,6 +169,7 @@ cpufreq_attach(device_t dev) sc->max_mhz = cpu_get_nominal_mhz(dev); /* If that fails, try to measure the current rate */ if (sc->max_mhz <= 0) { + CF_DEBUG("Unable to obtain nominal frequency.\n"); pc = cpu_get_pcpu(dev); if (cpu_est_clockrate(pc->pc_cpuid, &rate) == 0) sc->max_mhz = rate / 1000000; @@ -171,15 +177,6 @@ cpufreq_attach(device_t dev) sc->max_mhz = CPUFREQ_VAL_UNKNOWN; } - /* - * Only initialize one set of sysctls for all CPUs. In the future, - * if multiple CPUs can have different settings, we can move these - * sysctls to be under every CPU instead of just the first one. - */ - numdevs = devclass_get_count(cpufreq_dc); - if (numdevs > 1) - return (0); - CF_DEBUG("initializing one-time data for %s\n", device_get_nameunit(dev)); sc->levels_buf = malloc(CF_MAX_LEVELS * sizeof(*sc->levels_buf), @@ -216,7 +213,6 @@ cpufreq_detach(device_t dev) { struct cpufreq_softc *sc; struct cf_saved_freq *saved_freq; - int numdevs; CF_DEBUG("shutdown %s\n", device_get_nameunit(dev)); sc = device_get_softc(dev); @@ -227,12 +223,7 @@ cpufreq_detach(device_t dev) free(saved_freq, M_TEMP); } - /* Only clean up these resources when the last device is detaching. */ - numdevs = devclass_get_count(cpufreq_dc); - if (numdevs == 1) { - CF_DEBUG("final shutdown for %s\n", device_get_nameunit(dev)); - free(sc->levels_buf, M_DEVBUF); - } + free(sc->levels_buf, M_DEVBUF); return (0); } @@ -422,25 +413,74 @@ out: } static int +cpufreq_get_frequency(device_t dev) +{ + struct cf_setting set; + + if (CPUFREQ_DRV_GET(dev, &set) != 0) + return (-1); + + return (set.freq); +} + +/* Returns the index into *levels with the match */ +static int +cpufreq_get_level(device_t dev, struct cf_level *levels, int count) +{ + int i, freq; + + if ((freq = cpufreq_get_frequency(dev)) < 0) + return (-1); + for (i = 0; i < count; i++) + if (freq == levels[i].total_set.freq) + return (i); + + return (-1); +} + +/* + * Used by the cpufreq core, this function will populate *level with the current + * frequency as either determined by a cached value sc->curr_level, or in the + * case the lower level driver has set the CPUFREQ_FLAG_UNCACHED flag, it will + * obtain the frequency from the driver itself. + */ +static int cf_get_method(device_t dev, struct cf_level *level) { struct cpufreq_softc *sc; struct cf_level *levels; - struct cf_setting *curr_set, set; + struct cf_setting *curr_set; struct pcpu *pc; - device_t *devs; - int bdiff, count, diff, error, i, n, numdevs; + int bdiff, count, diff, error, i, type; uint64_t rate; sc = device_get_softc(dev); error = 0; levels = NULL; - /* If we already know the current frequency, we're done. */ + /* + * If we already know the current frequency, and the driver didn't ask + * for uncached usage, we're done. + */ CF_MTX_LOCK(&sc->lock); curr_set = &sc->curr_level.total_set; - if (curr_set->freq != CPUFREQ_VAL_UNKNOWN) { + error = CPUFREQ_DRV_TYPE(sc->cf_drv_dev, &type); + if (error == 0 && (type & CPUFREQ_FLAG_UNCACHED)) { + struct cf_setting set; + + /* + * If the driver wants to always report back the real frequency, + * first try the driver and if that fails, fall back to + * estimating. + */ + if (CPUFREQ_DRV_GET(sc->cf_drv_dev, &set) != 0) + goto estimate; + sc->curr_level.total_set = set; + CF_DEBUG("get returning immediate freq %d\n", curr_set->freq); + goto out; + } else if (curr_set->freq != CPUFREQ_VAL_UNKNOWN) { CF_DEBUG("get returning known freq %d\n", curr_set->freq); + error = 0; goto out; } CF_MTX_UNLOCK(&sc->lock); @@ -461,11 +501,6 @@ cf_get_method(device_t dev, struct cf_level *level) free(levels, M_TEMP); return (error); } - error = device_get_children(device_get_parent(dev), &devs, &numdevs); - if (error) { - free(levels, M_TEMP); - return (error); - } /* * Reacquire the lock and search for the given level. @@ -476,24 +511,21 @@ cf_get_method(device_t dev, struct cf_level *level) * The estimation code below catches this case though. */ CF_MTX_LOCK(&sc->lock); - for (n = 0; n < numdevs && curr_set->freq == CPUFREQ_VAL_UNKNOWN; n++) { - if (!device_is_attached(devs[n])) - continue; - if (CPUFREQ_DRV_GET(devs[n], &set) != 0) - continue; - for (i = 0; i < count; i++) { - if (set.freq == levels[i].total_set.freq) { - sc->curr_level = levels[i]; - break; - } - } - } - free(devs, M_TEMP); + i = cpufreq_get_level(sc->cf_drv_dev, levels, count); + if (i >= 0) + sc->curr_level = levels[i]; + else + CF_DEBUG("Couldn't find supported level for %s\n", + device_get_nameunit(sc->cf_drv_dev)); + if (curr_set->freq != CPUFREQ_VAL_UNKNOWN) { CF_DEBUG("get matched freq %d from drivers\n", curr_set->freq); goto out; } +estimate: + CF_MTX_ASSERT(&sc->lock); + /* * We couldn't find an exact match, so attempt to estimate and then * match against a level. @@ -525,17 +557,82 @@ out: return (error); } +/* + * Either directly obtain settings from the cpufreq driver, or build a list of + * relative settings to be integrated later against an absolute max. + */ static int +cpufreq_add_levels(device_t cf_dev, struct cf_setting_lst *rel_sets) +{ + struct cf_setting_array *set_arr; + struct cf_setting *sets; + device_t dev; + struct cpufreq_softc *sc; + int type, set_count, error; + + sc = device_get_softc(cf_dev); + dev = sc->cf_drv_dev; + + /* Skip devices that aren't ready. */ + if (!device_is_attached(cf_dev)) + return (0); + + /* + * Get settings, skipping drivers that offer no settings or + * provide settings for informational purposes only. + */ + error = CPUFREQ_DRV_TYPE(dev, &type); + if (error != 0 || (type & CPUFREQ_FLAG_INFO_ONLY)) { + if (error == 0) { + CF_DEBUG("skipping info-only driver %s\n", + device_get_nameunit(cf_dev)); + } + return (error); + } + + sets = malloc(MAX_SETTINGS * sizeof(*sets), M_TEMP, M_NOWAIT); + if (sets == NULL) + return (ENOMEM); + + set_count = MAX_SETTINGS; + error = CPUFREQ_DRV_SETTINGS(dev, sets, &set_count); + if (error != 0 || set_count == 0) + goto out; + + /* Add the settings to our absolute/relative lists. */ + switch (type & CPUFREQ_TYPE_MASK) { + case CPUFREQ_TYPE_ABSOLUTE: + error = cpufreq_insert_abs(sc, sets, set_count); + break; + case CPUFREQ_TYPE_RELATIVE: + CF_DEBUG("adding %d relative settings\n", set_count); + set_arr = malloc(sizeof(*set_arr), M_TEMP, M_NOWAIT); + if (set_arr == NULL) { + error = ENOMEM; + goto out; + } + bcopy(sets, set_arr->sets, set_count * sizeof(*sets)); + set_arr->count = set_count; + TAILQ_INSERT_TAIL(rel_sets, set_arr, link); + break; + default: + error = EINVAL; + } + +out: + free(sets, M_TEMP); + return (error); +} + +static int cf_levels_method(device_t dev, struct cf_level *levels, int *count) { struct cf_setting_array *set_arr; struct cf_setting_lst rel_sets; struct cpufreq_softc *sc; struct cf_level *lev; - struct cf_setting *sets; struct pcpu *pc; - device_t *devs; - int error, i, numdevs, set_count, type; + int error, i; uint64_t rate; if (levels == NULL || count == NULL) @@ -543,67 +640,21 @@ cf_levels_method(device_t dev, struct cf_level *levels TAILQ_INIT(&rel_sets); sc = device_get_softc(dev); - error = device_get_children(device_get_parent(dev), &devs, &numdevs); - if (error) - return (error); - sets = malloc(MAX_SETTINGS * sizeof(*sets), M_TEMP, M_NOWAIT); - if (sets == NULL) { - free(devs, M_TEMP); - return (ENOMEM); - } - /* Get settings from all cpufreq drivers. */ CF_MTX_LOCK(&sc->lock); - for (i = 0; i < numdevs; i++) { - /* Skip devices that aren't ready. */ - if (!device_is_attached(devs[i])) - continue; + error = cpufreq_add_levels(sc->dev, &rel_sets); + if (error) + goto out; - /* - * Get settings, skipping drivers that offer no settings or - * provide settings for informational purposes only. - */ - error = CPUFREQ_DRV_TYPE(devs[i], &type); - if (error || (type & CPUFREQ_FLAG_INFO_ONLY)) { - if (error == 0) { - CF_DEBUG("skipping info-only driver %s\n", - device_get_nameunit(devs[i])); - } - continue; - } - set_count = MAX_SETTINGS; - error = CPUFREQ_DRV_SETTINGS(devs[i], sets, &set_count); - if (error || set_count == 0) - continue; - - /* Add the settings to our absolute/relative lists. */ - switch (type & CPUFREQ_TYPE_MASK) { - case CPUFREQ_TYPE_ABSOLUTE: - error = cpufreq_insert_abs(sc, sets, set_count); - break; - case CPUFREQ_TYPE_RELATIVE: - CF_DEBUG("adding %d relative settings\n", set_count); - set_arr = malloc(sizeof(*set_arr), M_TEMP, M_NOWAIT); - if (set_arr == NULL) { - error = ENOMEM; - goto out; - } - bcopy(sets, set_arr->sets, set_count * sizeof(*sets)); - set_arr->count = set_count; - TAILQ_INSERT_TAIL(&rel_sets, set_arr, link); - break; - default: - error = EINVAL; - } - if (error) - goto out; - } - /* * If there are no absolute levels, create a fake one at 100%. We * then cache the clockrate for later use as our base frequency. */ if (TAILQ_EMPTY(&sc->all_levels)) { + struct cf_setting set; + + CF_DEBUG("No absolute levels returned by driver\n"); + if (sc->max_mhz == CPUFREQ_VAL_UNKNOWN) { sc->max_mhz = cpu_get_nominal_mhz(dev); /* @@ -617,10 +668,10 @@ cf_levels_method(device_t dev, struct cf_level *levels sc->max_mhz = rate / 1000000; } } - memset(&sets[0], CPUFREQ_VAL_UNKNOWN, sizeof(*sets)); - sets[0].freq = sc->max_mhz; - sets[0].dev = NULL; - error = cpufreq_insert_abs(sc, sets, 1); + memset(&set, CPUFREQ_VAL_UNKNOWN, sizeof(set)); + set.freq = sc->max_mhz; + set.dev = NULL; + error = cpufreq_insert_abs(sc, &set, 1); if (error) goto out; } @@ -665,8 +716,6 @@ out: TAILQ_REMOVE(&rel_sets, set_arr, link); free(set_arr, M_TEMP); } - free(devs, M_TEMP); - free(sets, M_TEMP); return (error); } @@ -1011,11 +1060,24 @@ out: return (error); } +static void +cpufreq_add_freq_driver_sysctl(device_t cf_dev) +{ + struct cpufreq_softc *sc; + + sc = device_get_softc(cf_dev); + SYSCTL_ADD_CONST_STRING(&sc->sysctl_ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(cf_dev)), OID_AUTO, + "freq_driver", CTLFLAG_RD, device_get_nameunit(sc->cf_drv_dev), + "cpufreq driver used by this cpu"); +} + int cpufreq_register(device_t dev) { struct cpufreq_softc *sc; device_t cf_dev, cpu_dev; + int error; /* Add a sysctl to get each driver's settings separately. */ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), @@ -1031,6 +1093,7 @@ cpufreq_register(device_t dev) if ((cf_dev = device_find_child(cpu_dev, "cpufreq", -1))) { sc = device_get_softc(cf_dev); sc->max_mhz = CPUFREQ_VAL_UNKNOWN; + MPASS(sc->cf_drv_dev != NULL); return (0); } @@ -1040,40 +1103,36 @@ cpufreq_register(device_t dev) return (ENOMEM); device_quiet(cf_dev); - return (device_probe_and_attach(cf_dev)); + error = device_probe_and_attach(cf_dev); + if (error) + return (error); + + sc = device_get_softc(cf_dev); + sc->cf_drv_dev = dev; + cpufreq_add_freq_driver_sysctl(cf_dev); + return (error); } int cpufreq_unregister(device_t dev) { - device_t cf_dev, *devs; - int cfcount, devcount, error, i, type; + device_t cf_dev; + struct cpufreq_softc *sc; /* * If this is the last cpufreq child device, remove the control * device as well. We identify cpufreq children by calling a method * they support. */ - error = device_get_children(device_get_parent(dev), &devs, &devcount); - if (error) - return (error); cf_dev = device_find_child(device_get_parent(dev), "cpufreq", -1); if (cf_dev == NULL) { device_printf(dev, "warning: cpufreq_unregister called with no cpufreq device active\n"); - free(devs, M_TEMP); return (0); } - cfcount = 0; - for (i = 0; i < devcount; i++) { - if (!device_is_attached(devs[i])) - continue; - if (CPUFREQ_DRV_TYPE(devs[i], &type) == 0) - cfcount++; - } - if (cfcount <= 1) - device_delete_child(device_get_parent(cf_dev), cf_dev); - free(devs, M_TEMP); + sc = device_get_softc(cf_dev); + MPASS(sc->cf_drv_dev == dev); + device_delete_child(device_get_parent(cf_dev), cf_dev); return (0); } Modified: head/sys/modules/cpufreq/Makefile ============================================================================== --- head/sys/modules/cpufreq/Makefile Wed Jan 22 22:51:55 2020 (r357001) +++ head/sys/modules/cpufreq/Makefile Wed Jan 22 23:28:42 2020 (r357002) @@ -11,7 +11,7 @@ SRCS+= bus_if.h cpufreq_if.h device_if.h pci_if.h .PATH: ${SRCTOP}/sys/x86/cpufreq SRCS+= acpi_if.h opt_acpi.h -SRCS+= est.c hwpstate.c p4tcc.c powernow.c +SRCS+= est.c hwpstate_amd.c p4tcc.c powernow.c hwpstate_intel.c .endif .if ${MACHINE} == "i386" Modified: head/sys/sys/cpu.h ============================================================================== --- head/sys/sys/cpu.h Wed Jan 22 22:51:55 2020 (r357001) +++ head/sys/sys/cpu.h Wed Jan 22 23:28:42 2020 (r357002) @@ -120,11 +120,16 @@ TAILQ_HEAD(cf_level_lst, cf_level); * information about settings but rely on another machine-dependent driver * for actually performing the frequency transition (e.g., ACPI performance * states of type "functional fixed hardware.") + * + * The "uncached" flag tells CPUFREQ_DRV_GET to try obtaining the real + * instantaneous frequency from the underlying hardware regardless of cached + * state. It is probably a bug to not combine this with "info only" */ #define CPUFREQ_TYPE_MASK 0xffff #define CPUFREQ_TYPE_RELATIVE (1<<0) #define CPUFREQ_TYPE_ABSOLUTE (1<<1) #define CPUFREQ_FLAG_INFO_ONLY (1<<16) +#define CPUFREQ_FLAG_UNCACHED (1<<17) /* * When setting a level, the caller indicates the priority of this request. Modified: head/sys/x86/cpufreq/est.c ============================================================================== --- head/sys/x86/cpufreq/est.c Wed Jan 22 22:51:55 2020 (r357001) +++ head/sys/x86/cpufreq/est.c Wed Jan 22 23:28:42 2020 (r357002) @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); #include #include "acpi_if.h" +#include + /* Status/control registers (from the IA-32 System Programming Guide). */ #define MSR_PERF_STATUS 0x198 #define MSR_PERF_CTL 0x199 @@ -898,6 +900,7 @@ static driver_t est_driver = { static devclass_t est_devclass; DRIVER_MODULE(est, cpu, est_driver, est_devclass, 0, 0); +MODULE_DEPEND(est, hwpstate_intel, 1, 1, 1); static int est_features(driver_t *driver, u_int *features) @@ -915,6 +918,15 @@ static void est_identify(driver_t *driver, device_t parent) { device_t child; + + /* + * Defer to hwpstate if it is present. This priority logic + * should be replaced with normal newbus probing in the + * future. + */ + intel_hwpstate_identify(NULL, parent); + if (device_find_child(parent, "hwpstate_intel", -1) != NULL) + return; /* Make sure we're not being doubly invoked. */ if (device_find_child(parent, "est", -1) != NULL) Copied: head/sys/x86/cpufreq/hwpstate_amd.c (from r357001, head/sys/x86/cpufreq/hwpstate.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/cpufreq/hwpstate_amd.c Wed Jan 22 23:28:42 2020 (r357002, copy of r357001, head/sys/x86/cpufreq/hwpstate.c) @@ -0,0 +1,543 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2005 Nate Lawson + * Copyright (c) 2004 Colin Percival + * Copyright (c) 2004-2005 Bruno Durcot + * Copyright (c) 2004 FUKUDA Nobuhiko + * Copyright (c) 2009 Michael Reifenberger + * Copyright (c) 2009 Norikatsu Shigemura + * Copyright (c) 2008-2009 Gen Otsuji + * + * This code is depending on kern_cpu.c, est.c, powernow.c, p4tcc.c, smist.c + * in various parts. The authors of these files are Nate Lawson, + * Colin Percival, Bruno Durcot, and FUKUDA Nobuhiko. + * This code contains patches by Michael Reifenberger and Norikatsu Shigemura. + * Thank you. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted providing 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. + */ + +/* + * For more info: + * BIOS and Kernel Developer's Guide(BKDG) for AMD Family 10h Processors + * 31116 Rev 3.20 February 04, 2009 + * BIOS and Kernel Developer's Guide(BKDG) for AMD Family 11h Processors + * 41256 Rev 3.00 - July 07, 2008 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include + +#include "acpi_if.h" +#include "cpufreq_if.h" + +#define MSR_AMD_10H_11H_LIMIT 0xc0010061 +#define MSR_AMD_10H_11H_CONTROL 0xc0010062 +#define MSR_AMD_10H_11H_STATUS 0xc0010063 +#define MSR_AMD_10H_11H_CONFIG 0xc0010064 + +#define AMD_10H_11H_MAX_STATES 16 + +/* for MSR_AMD_10H_11H_LIMIT C001_0061 */ +#define AMD_10H_11H_GET_PSTATE_MAX_VAL(msr) (((msr) >> 4) & 0x7) +#define AMD_10H_11H_GET_PSTATE_LIMIT(msr) (((msr)) & 0x7) +/* for MSR_AMD_10H_11H_CONFIG 10h:C001_0064:68 / 11h:C001_0064:6B */ +#define AMD_10H_11H_CUR_VID(msr) (((msr) >> 9) & 0x7F) +#define AMD_10H_11H_CUR_DID(msr) (((msr) >> 6) & 0x07) +#define AMD_10H_11H_CUR_FID(msr) ((msr) & 0x3F) + +#define AMD_17H_CUR_VID(msr) (((msr) >> 14) & 0xFF) +#define AMD_17H_CUR_DID(msr) (((msr) >> 8) & 0x3F) +#define AMD_17H_CUR_FID(msr) ((msr) & 0xFF) + +#define HWPSTATE_DEBUG(dev, msg...) \ + do { \ + if (hwpstate_verbose) \ + device_printf(dev, msg); \ + } while (0) + +struct hwpstate_setting { + int freq; /* CPU clock in Mhz or 100ths of a percent. */ + int volts; /* Voltage in mV. */ + int power; /* Power consumed in mW. */ + int lat; /* Transition latency in us. */ + int pstate_id; /* P-State id */ +}; + +struct hwpstate_softc { + device_t dev; + struct hwpstate_setting hwpstate_settings[AMD_10H_11H_MAX_STATES]; + int cfnum; +}; + +static void hwpstate_identify(driver_t *driver, device_t parent); +static int hwpstate_probe(device_t dev); +static int hwpstate_attach(device_t dev); +static int hwpstate_detach(device_t dev); +static int hwpstate_set(device_t dev, const struct cf_setting *cf); +static int hwpstate_get(device_t dev, struct cf_setting *cf); +static int hwpstate_settings(device_t dev, struct cf_setting *sets, int *count); +static int hwpstate_type(device_t dev, int *type); +static int hwpstate_shutdown(device_t dev); +static int hwpstate_features(driver_t *driver, u_int *features); +static int hwpstate_get_info_from_acpi_perf(device_t dev, device_t perf_dev); +static int hwpstate_get_info_from_msr(device_t dev); +static int hwpstate_goto_pstate(device_t dev, int pstate_id); + +static int hwpstate_verbose; +SYSCTL_INT(_debug, OID_AUTO, hwpstate_verbose, CTLFLAG_RWTUN, + &hwpstate_verbose, 0, "Debug hwpstate"); + +static int hwpstate_verify; +SYSCTL_INT(_debug, OID_AUTO, hwpstate_verify, CTLFLAG_RWTUN, + &hwpstate_verify, 0, "Verify P-state after setting"); + +static device_method_t hwpstate_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, hwpstate_identify), + DEVMETHOD(device_probe, hwpstate_probe), + DEVMETHOD(device_attach, hwpstate_attach), + DEVMETHOD(device_detach, hwpstate_detach), + DEVMETHOD(device_shutdown, hwpstate_shutdown), + + /* cpufreq interface */ + DEVMETHOD(cpufreq_drv_set, hwpstate_set), + DEVMETHOD(cpufreq_drv_get, hwpstate_get), + DEVMETHOD(cpufreq_drv_settings, hwpstate_settings), + DEVMETHOD(cpufreq_drv_type, hwpstate_type), + + /* ACPI interface */ + DEVMETHOD(acpi_get_features, hwpstate_features), + + {0, 0} +}; + +static devclass_t hwpstate_devclass; +static driver_t hwpstate_driver = { + "hwpstate", + hwpstate_methods, + sizeof(struct hwpstate_softc), +}; + +DRIVER_MODULE(hwpstate, cpu, hwpstate_driver, hwpstate_devclass, 0, 0); + +/* + * Go to Px-state on all cpus considering the limit. + */ +static int +hwpstate_goto_pstate(device_t dev, int id) +{ + sbintime_t sbt; + uint64_t msr; + int cpu, i, j, limit; + + /* get the current pstate limit */ + msr = rdmsr(MSR_AMD_10H_11H_LIMIT); + limit = AMD_10H_11H_GET_PSTATE_LIMIT(msr); + if (limit > id) + id = limit; + + cpu = curcpu; + HWPSTATE_DEBUG(dev, "setting P%d-state on cpu%d\n", id, cpu); + /* Go To Px-state */ + wrmsr(MSR_AMD_10H_11H_CONTROL, id); + + /* + * We are going to the same Px-state on all cpus. + * Probably should take _PSD into account. + */ + CPU_FOREACH(i) { + if (i == cpu) + continue; + + /* Bind to each cpu. */ + thread_lock(curthread); + sched_bind(curthread, i); + thread_unlock(curthread); + HWPSTATE_DEBUG(dev, "setting P%d-state on cpu%d\n", id, i); + /* Go To Px-state */ + wrmsr(MSR_AMD_10H_11H_CONTROL, id); + } + + /* + * Verify whether each core is in the requested P-state. + */ + if (hwpstate_verify) { + CPU_FOREACH(i) { + thread_lock(curthread); + sched_bind(curthread, i); + thread_unlock(curthread); + /* wait loop (100*100 usec is enough ?) */ + for (j = 0; j < 100; j++) { + /* get the result. not assure msr=id */ + msr = rdmsr(MSR_AMD_10H_11H_STATUS); + if (msr == id) + break; + sbt = SBT_1MS / 10; + tsleep_sbt(dev, PZERO, "pstate_goto", sbt, + sbt >> tc_precexp, 0); + } + HWPSTATE_DEBUG(dev, "result: P%d-state on cpu%d\n", + (int)msr, i); + if (msr != id) { + HWPSTATE_DEBUG(dev, + "error: loop is not enough.\n"); + return (ENXIO); + } + } + } + + return (0); +} + +static int +hwpstate_set(device_t dev, const struct cf_setting *cf) +{ + struct hwpstate_softc *sc; + struct hwpstate_setting *set; + int i; + + if (cf == NULL) + return (EINVAL); + sc = device_get_softc(dev); + set = sc->hwpstate_settings; + for (i = 0; i < sc->cfnum; i++) + if (CPUFREQ_CMP(cf->freq, set[i].freq)) + break; + if (i == sc->cfnum) + return (EINVAL); + + return (hwpstate_goto_pstate(dev, set[i].pstate_id)); +} + +static int +hwpstate_get(device_t dev, struct cf_setting *cf) +{ + struct hwpstate_softc *sc; + struct hwpstate_setting set; + uint64_t msr; + + sc = device_get_softc(dev); + if (cf == NULL) + return (EINVAL); + msr = rdmsr(MSR_AMD_10H_11H_STATUS); + if (msr >= sc->cfnum) + return (EINVAL); + set = sc->hwpstate_settings[msr]; + + cf->freq = set.freq; + cf->volts = set.volts; + cf->power = set.power; + cf->lat = set.lat; + cf->dev = dev; + return (0); +} + +static int +hwpstate_settings(device_t dev, struct cf_setting *sets, int *count) +{ + struct hwpstate_softc *sc; + struct hwpstate_setting set; + int i; + + if (sets == NULL || count == NULL) + return (EINVAL); + sc = device_get_softc(dev); + if (*count < sc->cfnum) + return (E2BIG); + for (i = 0; i < sc->cfnum; i++, sets++) { + set = sc->hwpstate_settings[i]; + sets->freq = set.freq; + sets->volts = set.volts; + sets->power = set.power; + sets->lat = set.lat; + sets->dev = dev; + } + *count = sc->cfnum; + + return (0); +} + +static int +hwpstate_type(device_t dev, int *type) +{ + + if (type == NULL) + return (EINVAL); + + *type = CPUFREQ_TYPE_ABSOLUTE; + return (0); +} + +static void +hwpstate_identify(driver_t *driver, device_t parent) +{ + + if (device_find_child(parent, "hwpstate", -1) != NULL) + return; + + if ((cpu_vendor_id != CPU_VENDOR_AMD || CPUID_TO_FAMILY(cpu_id) < 0x10) && + cpu_vendor_id != CPU_VENDOR_HYGON) + return; + + /* + * Check if hardware pstate enable bit is set. + */ + if ((amd_pminfo & AMDPM_HW_PSTATE) == 0) { + HWPSTATE_DEBUG(parent, "hwpstate enable bit is not set.\n"); + return; + } + + if (resource_disabled("hwpstate", 0)) + return; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jan 23 00:29:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 23D46223477; Thu, 23 Jan 2020 00:29:15 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 48336y25FPz3FbN; Thu, 23 Jan 2020 00:29:13 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 00N0T5xg001453 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 22 Jan 2020 16:29:05 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 00N0T39p001452; Wed, 22 Jan 2020 16:29:03 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Wed, 22 Jan 2020 16:29:03 -0800 From: Gleb Smirnoff To: Michael Tuexen Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r356989 - head/sys/netinet Message-ID: <20200123002903.GA1268@FreeBSD.org> References: <202001221719.00MHJrvq033961@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 48336y25FPz3FbN X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-0.84 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.87)[-0.874,0]; NEURAL_SPAM_LONG(0.03)[0.029,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, 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, 23 Jan 2020 00:29:15 -0000 Hi Michael, On Wed, Jan 22, 2020 at 10:20:55PM +0100, Michael Tuexen wrote: M> > Log: M> > Plug possible calls into ip6?_output() without network epoch from SCTP M> > bluntly adding epoch entrance into the macro that SCTP uses to call M> > ip6?_output(). This definitely will introduce several epoch recursions. M> Can you specify under which condition NET_EPOCH_ENTER() should be called? M> Then I can try to figure out where these calls need to be made in the M> SCTP code. Thanks a lot for offering help! Basically the end goal is that any non-sleepable context associated with networking should be running in epoch. That means interrupts, callouts and taskqueues. Syscalls should enter epoch at some stage, depends on a syscall. Right now we are processing all incoming packets that came through ether_input() in the network epoch, so anytime we call sctp_output() as a _response_ to a packet that came via sctp_input() we already are in epoch. With r356989 it is going to be unnecessary recursion. When we do retransmits from a callout, then we aren't (yet) in epoch and r356989 addresses that. Same for syscalls that start SCTP connection or send data down SCTP socket. -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Thu Jan 23 01:21:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 84EAF22531A; Thu, 23 Jan 2020 01:21:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4834Gh2xWrz3JkX; Thu, 23 Jan 2020 01:21:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6048C6A75; Thu, 23 Jan 2020 01:21:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N1L0b8024023; Thu, 23 Jan 2020 01:21:00 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N1L06o024017; Thu, 23 Jan 2020 01:21:00 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001230121.00N1L06o024017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 23 Jan 2020 01:21:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357003 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 357003 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 01:21:00 -0000 Author: glebius Date: Thu Jan 23 01:20:59 2020 New Revision: 357003 URL: https://svnweb.freebsd.org/changeset/base/357003 Log: Add ie_hflags to struct intr_event, which accumulates flags from all handlers on this event. For now handle only IH_ENTROPY in that manner. Modified: head/sys/kern/kern_intr.c head/sys/sys/interrupt.h Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Wed Jan 22 23:28:42 2020 (r357002) +++ head/sys/kern/kern_intr.c Thu Jan 23 01:20:59 2020 (r357003) @@ -190,7 +190,7 @@ intr_event_update(struct intr_event *ie) /* Start off with no entropy and just the name of the event. */ mtx_assert(&ie->ie_lock, MA_OWNED); strlcpy(ie->ie_fullname, ie->ie_name, sizeof(ie->ie_fullname)); - ie->ie_flags &= ~IE_ENTROPY; + ie->ie_hflags = 0; missed = 0; space = 1; @@ -203,8 +203,7 @@ intr_event_update(struct intr_event *ie) space = 0; } else missed++; - if (ih->ih_flags & IH_ENTROPY) - ie->ie_flags |= IE_ENTROPY; + ie->ie_hflags |= ih->ih_flags; } /* @@ -958,7 +957,7 @@ intr_event_schedule_thread(struct intr_event *ie) * If any of the handlers for this ithread claim to be good * sources of entropy, then gather some. */ - if (ie->ie_flags & IE_ENTROPY) { + if (ie->ie_hflags & IH_ENTROPY) { entropy.event = (uintptr_t)ie; entropy.td = ctd; random_harvest_queue(&entropy, sizeof(entropy), RANDOM_INTERRUPT); @@ -1492,18 +1491,12 @@ db_dump_intr_event(struct intr_event *ie, int handlers db_printf("(pid %d)", it->it_thread->td_proc->p_pid); else db_printf("(no thread)"); - if ((ie->ie_flags & (IE_SOFT | IE_ENTROPY | IE_ADDING_THREAD)) != 0 || + if ((ie->ie_flags & (IE_SOFT | IE_ADDING_THREAD)) != 0 || (it != NULL && it->it_need)) { db_printf(" {"); comma = 0; if (ie->ie_flags & IE_SOFT) { db_printf("SOFT"); - comma = 1; - } - if (ie->ie_flags & IE_ENTROPY) { - if (comma) - db_printf(", "); - db_printf("ENTROPY"); comma = 1; } if (ie->ie_flags & IE_ADDING_THREAD) { Modified: head/sys/sys/interrupt.h ============================================================================== --- head/sys/sys/interrupt.h Wed Jan 22 23:28:42 2020 (r357002) +++ head/sys/sys/interrupt.h Thu Jan 23 01:20:59 2020 (r357003) @@ -118,6 +118,7 @@ struct intr_event { void (*ie_post_filter)(void *); int (*ie_assign_cpu)(void *, int); int ie_flags; + int ie_hflags; /* Cumulative flags of all handlers. */ int ie_count; /* Loop counter. */ int ie_warncnt; /* Rate-check interrupt storm warns. */ struct timeval ie_warntm; @@ -129,7 +130,6 @@ struct intr_event { /* Interrupt event flags kept in ie_flags. */ #define IE_SOFT 0x000001 /* Software interrupt. */ -#define IE_ENTROPY 0x000002 /* Interrupt is an entropy source. */ #define IE_ADDING_THREAD 0x000004 /* Currently building an ithread. */ /* Flags to pass to sched_swi. */ From owner-svn-src-all@freebsd.org Thu Jan 23 01:24:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0A9222581D; Thu, 23 Jan 2020 01:24:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4834M364Q1z3KB8; Thu, 23 Jan 2020 01:24:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CBBAB6C27; Thu, 23 Jan 2020 01:24:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N1OlRs029507; Thu, 23 Jan 2020 01:24:47 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N1OlXi029506; Thu, 23 Jan 2020 01:24:47 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001230124.00N1OlXi029506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 23 Jan 2020 01:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357004 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 357004 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 01:24:48 -0000 Author: glebius Date: Thu Jan 23 01:24:47 2020 New Revision: 357004 URL: https://svnweb.freebsd.org/changeset/base/357004 Log: Enter the network epoch for interrupt handlers of INTR_TYPE_NET. Provide tunable to limit how many times handlers may be executed without reentering epoch. Differential Revision: https://reviews.freebsd.org/D23242 Modified: head/sys/kern/kern_intr.c head/sys/sys/interrupt.h Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Thu Jan 23 01:20:59 2020 (r357003) +++ head/sys/kern/kern_intr.c Thu Jan 23 01:24:47 2020 (r357004) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -94,6 +95,9 @@ static int intr_storm_threshold = 0; SYSCTL_INT(_hw, OID_AUTO, intr_storm_threshold, CTLFLAG_RWTUN, &intr_storm_threshold, 0, "Number of consecutive interrupts before storm protection is enabled"); +static int intr_epoch_batch = 1000; +SYSCTL_INT(_hw, OID_AUTO, intr_epoch_batch, CTLFLAG_RWTUN, &intr_epoch_batch, + 0, "Maximum interrupt handler executions without re-entering epoch(9)"); static TAILQ_HEAD(, intr_event) event_list = TAILQ_HEAD_INITIALIZER(event_list); static struct mtx event_lock; @@ -587,6 +591,8 @@ intr_event_add_handler(struct intr_event *ie, const ch ih->ih_flags |= IH_MPSAFE; if (flags & INTR_ENTROPY) ih->ih_flags |= IH_ENTROPY; + if (flags & INTR_TYPE_NET) + ih->ih_flags |= IH_NET; /* We can only have one exclusive handler in a event. */ mtx_lock(&ie->ie_lock); @@ -1196,11 +1202,12 @@ ithread_execute_handlers(struct proc *p, struct intr_e static void ithread_loop(void *arg) { + struct epoch_tracker et; struct intr_thread *ithd; struct intr_event *ie; struct thread *td; struct proc *p; - int wake; + int wake, epoch_count; td = curthread; p = td->td_proc; @@ -1235,8 +1242,21 @@ ithread_loop(void *arg) * that the load of ih_need in ithread_execute_handlers() * is ordered after the load of it_need here. */ - while (atomic_cmpset_acq_int(&ithd->it_need, 1, 0) != 0) + if (ie->ie_hflags & IH_NET) { + epoch_count = 0; + NET_EPOCH_ENTER(et); + } + while (atomic_cmpset_acq_int(&ithd->it_need, 1, 0) != 0) { ithread_execute_handlers(p, ie); + if ((ie->ie_hflags & IH_NET) && + ++epoch_count >= intr_epoch_batch) { + NET_EPOCH_EXIT(et); + epoch_count = 0; + NET_EPOCH_ENTER(et); + } + } + if (ie->ie_hflags & IH_NET) + NET_EPOCH_EXIT(et); WITNESS_WARN(WARN_PANIC, NULL, "suspending ithread"); mtx_assert(&Giant, MA_NOTOWNED); Modified: head/sys/sys/interrupt.h ============================================================================== --- head/sys/sys/interrupt.h Thu Jan 23 01:20:59 2020 (r357003) +++ head/sys/sys/interrupt.h Thu Jan 23 01:24:47 2020 (r357004) @@ -58,6 +58,7 @@ struct intr_handler { }; /* Interrupt handle flags kept in ih_flags */ +#define IH_NET 0x00000001 /* Network. */ #define IH_EXCLUSIVE 0x00000002 /* Exclusive interrupt. */ #define IH_ENTROPY 0x00000004 /* Device is a good entropy source. */ #define IH_DEAD 0x00000008 /* Handler should be removed. */ From owner-svn-src-all@freebsd.org Thu Jan 23 01:25:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E70F22597D; Thu, 23 Jan 2020 01:25:33 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4834Mx2qdkz3KMk; Thu, 23 Jan 2020 01:25:33 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C4D16C5A; Thu, 23 Jan 2020 01:25:33 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N1PXSV029598; Thu, 23 Jan 2020 01:25:33 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N1PXRK029597; Thu, 23 Jan 2020 01:25:33 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001230125.00N1PXRK029597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 23 Jan 2020 01:25:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357005 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 357005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 01:25:33 -0000 Author: glebius Date: Thu Jan 23 01:25:32 2020 New Revision: 357005 URL: https://svnweb.freebsd.org/changeset/base/357005 Log: Mark swi_net() as INTR_TYPE_NET and stop entering epoch there. Modified: head/sys/net/netisr.c Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Thu Jan 23 01:24:47 2020 (r357004) +++ head/sys/net/netisr.c Thu Jan 23 01:25:32 2020 (r357005) @@ -861,7 +861,6 @@ static u_int netisr_process_workstream_proto(struct netisr_workstream *nwsp, u_int proto) { struct netisr_work local_npw, *npwp; - struct epoch_tracker et; u_int handled; struct mbuf *m; @@ -891,7 +890,6 @@ netisr_process_workstream_proto(struct netisr_workstre npwp->nw_len = 0; nwsp->nws_pendingbits &= ~(1 << proto); NWS_UNLOCK(nwsp); - NET_EPOCH_ENTER(et); while ((m = local_npw.nw_head) != NULL) { local_npw.nw_head = m->m_nextpkt; m->m_nextpkt = NULL; @@ -904,7 +902,6 @@ netisr_process_workstream_proto(struct netisr_workstre netisr_proto[proto].np_handler(m); CURVNET_RESTORE(); } - NET_EPOCH_EXIT(et); KASSERT(local_npw.nw_len == 0, ("%s(%u): len %u", __func__, proto, local_npw.nw_len)); if (netisr_proto[proto].np_drainedcpu) @@ -1248,7 +1245,7 @@ netisr_start_swi(u_int cpuid, struct pcpu *pc) nwsp->nws_cpu = cpuid; snprintf(swiname, sizeof(swiname), "netisr %u", cpuid); error = swi_add(&nwsp->nws_intr_event, swiname, swi_net, nwsp, - SWI_NET, INTR_MPSAFE, &nwsp->nws_swi_cookie); + SWI_NET, INTR_TYPE_NET | INTR_MPSAFE, &nwsp->nws_swi_cookie); if (error) panic("%s: swi_add %d", __func__, error); pc->pc_netisr = nwsp->nws_intr_event; From owner-svn-src-all@freebsd.org Thu Jan 23 01:27:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA518225C3C; Thu, 23 Jan 2020 01:27:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4834Qk5bksz3Kdx; Thu, 23 Jan 2020 01:27:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB78E6C6E; Thu, 23 Jan 2020 01:27:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N1Rwm0029857; Thu, 23 Jan 2020 01:27:58 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N1RwXH029856; Thu, 23 Jan 2020 01:27:58 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001230127.00N1RwXH029856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 23 Jan 2020 01:27:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357006 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 357006 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 01:27:59 -0000 Author: glebius Date: Thu Jan 23 01:27:58 2020 New Revision: 357006 URL: https://svnweb.freebsd.org/changeset/base/357006 Log: Enter network epoch in iflib rxeof task. In upcoming changes ether_input() is going to be changed not to enter the network epoch. It is going to be responsibility of network interrupt. In case of iflib - its taskqueue. Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu Jan 23 01:25:32 2020 (r357005) +++ head/sys/net/iflib.c Thu Jan 23 01:27:58 2020 (r357006) @@ -2759,6 +2759,8 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) */ struct mbuf *m, *mh, *mt, *mf; + NET_EPOCH_ASSERT(); + lro_possible = v4_forwarding = v6_forwarding = false; ifp = ctx->ifc_ifp; mh = mt = NULL; @@ -3779,6 +3781,7 @@ _task_fn_tx(void *context) static void _task_fn_rx(void *context) { + struct epoch_tracker et; iflib_rxq_t rxq = context; if_ctx_t ctx = rxq->ifr_ctx; bool more; @@ -3802,6 +3805,7 @@ _task_fn_rx(void *context) budget = ctx->ifc_sysctl_rx_budget; if (budget == 0) budget = 16; /* XXX */ + NET_EPOCH_ENTER(et); if (more == false || (more = iflib_rxeof(rxq, budget)) == false) { if (ctx->ifc_flags & IFC_LEGACY) IFDI_INTR_ENABLE(ctx); @@ -3809,6 +3813,7 @@ _task_fn_rx(void *context) IFDI_RX_QUEUE_INTR_ENABLE(ctx, rxq->ifr_id); DBG_COUNTER_INC(rx_intr_enables); } + NET_EPOCH_EXIT(et); if (__predict_false(!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING))) return; if (more) @@ -6811,6 +6816,7 @@ iflib_debugnet_transmit(if_t ifp, struct mbuf *m) static int iflib_debugnet_poll(if_t ifp, int count) { + struct epoch_tracker et; if_ctx_t ctx; if_softc_ctx_t scctx; iflib_txq_t txq; @@ -6826,8 +6832,10 @@ iflib_debugnet_poll(if_t ifp, int count) txq = &ctx->ifc_txqs[0]; (void)iflib_completed_tx_reclaim(txq, RECLAIM_THRESH(ctx)); + NET_EPOCH_ENTER(et); for (i = 0; i < scctx->isc_nrxqsets; i++) (void)iflib_rxeof(&ctx->ifc_rxqs[i], 16 /* XXX */); + NET_EPOCH_EXIT(et); return (0); } #endif /* DEBUGNET */ From owner-svn-src-all@freebsd.org Thu Jan 23 01:30:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 374BD225FF3; Thu, 23 Jan 2020 01:30:51 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4834V30mgdz3KvZ; Thu, 23 Jan 2020 01:30:51 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 154AB6CAB; Thu, 23 Jan 2020 01:30:51 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N1UosW030056; Thu, 23 Jan 2020 01:30:50 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N1Uo3w030055; Thu, 23 Jan 2020 01:30:50 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001230130.00N1Uo3w030055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 23 Jan 2020 01:30:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357007 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357007 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 01:30:51 -0000 Author: glebius Date: Thu Jan 23 01:30:50 2020 New Revision: 357007 URL: https://svnweb.freebsd.org/changeset/base/357007 Log: DEVICE_POLLING is an alternative to network interrupts and also needs to enter epoch. Assert that in the netisr_poll() and do the work for the idle poll routine. Modified: head/sys/kern/kern_poll.c Modified: head/sys/kern/kern_poll.c ============================================================================== --- head/sys/kern/kern_poll.c Thu Jan 23 01:27:58 2020 (r357006) +++ head/sys/kern/kern_poll.c Thu Jan 23 01:30:50 2020 (r357007) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include /* needed by net/if.h */ @@ -332,6 +333,7 @@ hardclock_device_poll(void) static void ether_poll(int count) { + struct epoch_tracker et; int i; mtx_lock(&poll_mtx); @@ -339,8 +341,10 @@ ether_poll(int count) if (count > poll_each_burst) count = poll_each_burst; + NET_EPOCH_ENTER(et); for (i = 0 ; i < poll_handlers ; i++) pr[i].handler(pr[i].ifp, POLL_ONLY, count); + NET_EPOCH_EXIT(et); mtx_unlock(&poll_mtx); } @@ -428,6 +432,8 @@ netisr_poll(void) { int i, cycles; enum poll_cmd arg = POLL_ONLY; + + NET_EPOCH_ASSERT(); if (poll_handlers == 0) return; From owner-svn-src-all@freebsd.org Thu Jan 23 01:35:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA9BD226500; Thu, 23 Jan 2020 01:35:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4834Zt4d6pz3LSQ; Thu, 23 Jan 2020 01:35:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A2A06E65; Thu, 23 Jan 2020 01:35:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N1Z2mx036031; Thu, 23 Jan 2020 01:35:02 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N1Z2nK036030; Thu, 23 Jan 2020 01:35:02 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001230135.00N1Z2nK036030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 23 Jan 2020 01:35:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357008 - head/sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/dev/netmap X-SVN-Commit-Revision: 357008 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 01:35:02 -0000 Author: glebius Date: Thu Jan 23 01:35:02 2020 New Revision: 357008 URL: https://svnweb.freebsd.org/changeset/base/357008 Log: In netmap() call ether_input() within the network epoch. Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Thu Jan 23 01:30:50 2020 (r357007) +++ head/sys/dev/netmap/netmap.c Thu Jan 23 01:35:02 2020 (r357008) @@ -437,11 +437,13 @@ ports attached to the switch) #include /* struct socket */ #include #include +#include #include #include /* sockaddrs */ #include #include #include +#include #include #include #include @@ -1146,9 +1148,11 @@ netmap_dtor(void *data) static void netmap_send_up(struct ifnet *dst, struct mbq *q) { + struct epoch_tracker et; struct mbuf *m; struct mbuf *head = NULL, *prev = NULL; + NET_EPOCH_ENTER(et); /* Send packets up, outside the lock; head/prev machinery * is only useful for Windows. */ while ((m = mbq_dequeue(q)) != NULL) { @@ -1160,6 +1164,7 @@ netmap_send_up(struct ifnet *dst, struct mbq *q) } if (head) nm_os_send_up(dst, NULL, head); + NET_EPOCH_EXIT(et); mbq_fini(q); } From owner-svn-src-all@freebsd.org Thu Jan 23 01:38:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50520226978; Thu, 23 Jan 2020 01:38:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4834gJ1Ql3z3Ljd; Thu, 23 Jan 2020 01:38:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C2F76E85; Thu, 23 Jan 2020 01:38:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N1cqj3036226; Thu, 23 Jan 2020 01:38:52 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N1cqw6036225; Thu, 23 Jan 2020 01:38:52 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001230138.00N1cqw6036225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 23 Jan 2020 01:38:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357009 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 357009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 01:38:52 -0000 Author: glebius Date: Thu Jan 23 01:38:51 2020 New Revision: 357009 URL: https://svnweb.freebsd.org/changeset/base/357009 Log: tap(4) calls ether_input() in context of write(2). Enter network epoch here. The tun(4) side doesn't need this, as netisr code will take care. Modified: head/sys/net/if_tuntap.c Modified: head/sys/net/if_tuntap.c ============================================================================== --- head/sys/net/if_tuntap.c Thu Jan 23 01:35:02 2020 (r357008) +++ head/sys/net/if_tuntap.c Thu Jan 23 01:38:51 2020 (r357009) @@ -1778,6 +1778,7 @@ static int tunwrite_l2(struct tuntap_softc *tp, struct mbuf *m, struct virtio_net_hdr_mrg_rxbuf *vhdr) { + struct epoch_tracker et; struct ether_header *eh; struct ifnet *ifp; @@ -1808,7 +1809,9 @@ tunwrite_l2(struct tuntap_softc *tp, struct mbuf *m, /* Pass packet up to parent. */ CURVNET_SET(ifp->if_vnet); + NET_EPOCH_ENTER(et); (*ifp->if_input)(ifp, m); + NET_EPOCH_EXIT(et); CURVNET_RESTORE(); /* ibytes are counted in parent */ if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); From owner-svn-src-all@freebsd.org Thu Jan 23 01:41:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0AB01226BEB; Thu, 23 Jan 2020 01:41:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4834jz6R9Lz3M48; Thu, 23 Jan 2020 01:41:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D826D6ECA; Thu, 23 Jan 2020 01:41:11 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N1fBd1037949; Thu, 23 Jan 2020 01:41:11 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N1fAIQ037940; Thu, 23 Jan 2020 01:41:10 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001230141.00N1fAIQ037940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 23 Jan 2020 01:41:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357010 - in head/sys: dev/altera/atse dev/beri/virtio/network dev/dpaa dev/hyperv/netvsc dev/if_ndis dev/ntb/if_ntb dev/sbni dev/xen/netback mips/nlm/dev/net net X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: dev/altera/atse dev/beri/virtio/network dev/dpaa dev/hyperv/netvsc dev/if_ndis dev/ntb/if_ntb dev/sbni dev/xen/netback mips/nlm/dev/net net X-SVN-Commit-Revision: 357010 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 01:41:12 -0000 Author: glebius Date: Thu Jan 23 01:41:09 2020 New Revision: 357010 URL: https://svnweb.freebsd.org/changeset/base/357010 Log: Introduce flag IFF_NEEDSEPOCH that marks Ethernet interfaces that supposedly may call into ether_input() without network epoch. They all need to be reviewed before 13.0-RELEASE. Some may need be fixed. The flag is not planned to be used in the kernel for a long time. Modified: head/sys/dev/altera/atse/if_atse.c head/sys/dev/beri/virtio/network/if_vtbe.c head/sys/dev/dpaa/if_dtsec.c head/sys/dev/hyperv/netvsc/if_hn.c head/sys/dev/if_ndis/if_ndis.c head/sys/dev/ntb/if_ntb/if_ntb.c head/sys/dev/sbni/if_sbni.c head/sys/dev/xen/netback/netback.c head/sys/mips/nlm/dev/net/xlpge.c head/sys/net/if.h Modified: head/sys/dev/altera/atse/if_atse.c ============================================================================== --- head/sys/dev/altera/atse/if_atse.c Thu Jan 23 01:38:51 2020 (r357009) +++ head/sys/dev/altera/atse/if_atse.c Thu Jan 23 01:41:09 2020 (r357010) @@ -1381,7 +1381,8 @@ atse_attach(device_t dev) } ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST | + IFF_NEEDSEPOCH; ifp->if_ioctl = atse_ioctl; ifp->if_transmit = atse_transmit; ifp->if_qflush = atse_qflush; Modified: head/sys/dev/beri/virtio/network/if_vtbe.c ============================================================================== --- head/sys/dev/beri/virtio/network/if_vtbe.c Thu Jan 23 01:38:51 2020 (r357009) +++ head/sys/dev/beri/virtio/network/if_vtbe.c Thu Jan 23 01:41:09 2020 (r357010) @@ -613,7 +613,7 @@ vtbe_attach(device_t dev) ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_flags = (IFF_BROADCAST | IFF_SIMPLEX | - IFF_MULTICAST | IFF_PROMISC); + IFF_MULTICAST | IFF_PROMISC | IFF_NEEDSEPOCH); ifp->if_capabilities = IFCAP_VLAN_MTU; ifp->if_capenable = ifp->if_capabilities; ifp->if_start = vtbe_txstart; Modified: head/sys/dev/dpaa/if_dtsec.c ============================================================================== --- head/sys/dev/dpaa/if_dtsec.c Thu Jan 23 01:38:51 2020 (r357009) +++ head/sys/dev/dpaa/if_dtsec.c Thu Jan 23 01:41:09 2020 (r357010) @@ -688,7 +688,7 @@ dtsec_attach(device_t dev) ifp->if_softc = sc; ifp->if_mtu = ETHERMTU; /* TODO: Configure */ - ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST; + ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_NEEDSEPOCH; ifp->if_init = dtsec_if_init; ifp->if_start = dtsec_if_start; ifp->if_ioctl = dtsec_if_ioctl; Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Thu Jan 23 01:38:51 2020 (r357009) +++ head/sys/dev/hyperv/netvsc/if_hn.c Thu Jan 23 01:41:09 2020 (r357010) @@ -2362,7 +2362,8 @@ hn_attach(device_t dev) */ ifp->if_baudrate = IF_Gbps(10); - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST | + IFF_NEEDSEPOCH; ifp->if_ioctl = hn_ioctl; ifp->if_init = hn_init; #ifdef HN_IFSTART_SUPPORT Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Thu Jan 23 01:38:51 2020 (r357009) +++ head/sys/dev/if_ndis/if_ndis.c Thu Jan 23 01:41:09 2020 (r357010) @@ -967,7 +967,8 @@ ndis_ifattach(struct ndis_softc *sc) if_initname(ifp, device_get_name(sc->ndis_dev), device_get_unit(sc->ndis_dev)); - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST | + IFF_NEEDSEPOCH; ifp->if_ioctl = ndis_ifioctl; ifp->if_start = ndis_ifstart; ifp->if_init = ndis_init; Modified: head/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- head/sys/dev/ntb/if_ntb/if_ntb.c Thu Jan 23 01:38:51 2020 (r357009) +++ head/sys/dev/ntb/if_ntb/if_ntb.c Thu Jan 23 01:41:09 2020 (r357010) @@ -172,7 +172,8 @@ ntb_net_attach(device_t dev) if_setinitfn(ifp, ntb_net_init); if_setsoftc(ifp, sc); - if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); + if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST | + IFF_NEEDSEPOCH); if_setioctlfn(ifp, ntb_ioctl); if_settransmitfn(ifp, ntb_transmit); if_setqflushfn(ifp, ntb_qflush); Modified: head/sys/dev/sbni/if_sbni.c ============================================================================== --- head/sys/dev/sbni/if_sbni.c Thu Jan 23 01:38:51 2020 (r357009) +++ head/sys/dev/sbni/if_sbni.c Thu Jan 23 01:41:09 2020 (r357010) @@ -243,7 +243,8 @@ sbni_attach(struct sbni_softc *sc, int unit, struct sb ifp->if_baudrate = (csr0 & 0x01 ? 500000 : 2000000) / (1 << flags.rate); - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST | + IFF_NEEDSEPOCH; mtx_init(&sc->lock, ifp->if_xname, MTX_NETWORK_LOCK, MTX_DEF); callout_init_mtx(&sc->wch, &sc->lock, 0); Modified: head/sys/dev/xen/netback/netback.c ============================================================================== --- head/sys/dev/xen/netback/netback.c Thu Jan 23 01:38:51 2020 (r357009) +++ head/sys/dev/xen/netback/netback.c Thu Jan 23 01:41:09 2020 (r357010) @@ -780,7 +780,7 @@ xnb_connect_comms(struct xnb_softc *xnb) xnb->evtchn, /*filter*/NULL, xnb_intr, /*arg*/xnb, - INTR_TYPE_BIO | INTR_MPSAFE, + INTR_TYPE_NET | INTR_MPSAFE, &xnb->xen_intr_handle); if (error != 0) { (void)xnb_disconnect(xnb); Modified: head/sys/mips/nlm/dev/net/xlpge.c ============================================================================== --- head/sys/mips/nlm/dev/net/xlpge.c Thu Jan 23 01:38:51 2020 (r357009) +++ head/sys/mips/nlm/dev/net/xlpge.c Thu Jan 23 01:41:09 2020 (r357010) @@ -1052,7 +1052,8 @@ nlm_xlpge_ifinit(struct nlm_xlpge_softc *sc) } ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST | + IFF_NEEDSEPOCH; sc->if_flags = ifp->if_flags; /*ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_VLAN_HWTAGGING;*/ ifp->if_capabilities = 0; Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Thu Jan 23 01:38:51 2020 (r357009) +++ head/sys/net/if.h Thu Jan 23 01:41:09 2020 (r357010) @@ -144,7 +144,7 @@ struct if_data { #define IFF_DEBUG 0x4 /* (n) turn on debugging */ #define IFF_LOOPBACK 0x8 /* (i) is a loopback net */ #define IFF_POINTOPOINT 0x10 /* (i) is a point-to-point link */ -/* 0x20 was IFF_SMART */ +#define IFF_NEEDSEPOCH 0x20 /* (i) calls if_input w/o epoch */ #define IFF_DRV_RUNNING 0x40 /* (d) resources allocated */ #define IFF_NOARP 0x80 /* (n) no address resolution protocol */ #define IFF_PROMISC 0x100 /* (n) receive all packets */ From owner-svn-src-all@freebsd.org Thu Jan 23 01:44:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DDED82270AD; Thu, 23 Jan 2020 01:44:34 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4834nt4hjcz3MNv; Thu, 23 Jan 2020 01:44:34 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 00N1iWWb001825 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 22 Jan 2020 17:44:32 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 00N1iW70001824; Wed, 22 Jan 2020 17:44:32 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Wed, 22 Jan 2020 17:44:32 -0800 From: Gleb Smirnoff To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357010 - in head/sys: dev/altera/atse dev/beri/virtio/network dev/dpaa dev/hyperv/netvsc dev/if_ndis dev/ntb/if_ntb dev/sbni dev/xen/netback mips/nlm/dev/net net Message-ID: <20200123014432.GB1268@FreeBSD.org> References: <202001230141.00N1fAIQ037940@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202001230141.00N1fAIQ037940@repo.freebsd.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 4834nt4hjcz3MNv X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.04 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.89)[-0.888,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US]; NEURAL_HAM_LONG(-0.15)[-0.149,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, 23 Jan 2020 01:44:34 -0000 On Thu, Jan 23, 2020 at 01:41:10AM +0000, Gleb Smirnoff wrote: T> Log: T> Introduce flag IFF_NEEDSEPOCH that marks Ethernet interfaces that T> supposedly may call into ether_input() without network epoch. T> T> They all need to be reviewed before 13.0-RELEASE. Some may need T> be fixed. The flag is not planned to be used in the kernel for T> a long time. One unrelated change crept in: T> Modified: head/sys/dev/xen/netback/netback.c T> ============================================================================== T> --- head/sys/dev/xen/netback/netback.c Thu Jan 23 01:38:51 2020 (r357009) T> +++ head/sys/dev/xen/netback/netback.c Thu Jan 23 01:41:09 2020 (r357010) T> @@ -780,7 +780,7 @@ xnb_connect_comms(struct xnb_softc *xnb) T> xnb->evtchn, T> /*filter*/NULL, T> xnb_intr, /*arg*/xnb, T> - INTR_TYPE_BIO | INTR_MPSAFE, T> + INTR_TYPE_NET | INTR_MPSAFE, T> &xnb->xen_intr_handle); T> if (error != 0) { T> (void)xnb_disconnect(xnb); T> The xnb(4) is a network driver, so mark the interrupt appropriately. -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Thu Jan 23 01:46:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1EB69227184; Thu, 23 Jan 2020 01:46:06 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4834qd75MSz3MWf; Thu, 23 Jan 2020 01:46:05 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EECCF7088; Thu, 23 Jan 2020 01:46:05 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N1k5PN042159; Thu, 23 Jan 2020 01:46:05 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N1k5GJ042158; Thu, 23 Jan 2020 01:46:05 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001230146.00N1k5GJ042158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 23 Jan 2020 01:46:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357011 - head/sys/powerpc/pseries X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/powerpc/pseries X-SVN-Commit-Revision: 357011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 01:46:06 -0000 Author: glebius Date: Thu Jan 23 01:46:05 2020 New Revision: 357011 URL: https://svnweb.freebsd.org/changeset/base/357011 Log: This is Ethernet driver so mark the interrupt appropriately. Modified: head/sys/powerpc/pseries/phyp_llan.c Modified: head/sys/powerpc/pseries/phyp_llan.c ============================================================================== --- head/sys/powerpc/pseries/phyp_llan.c Thu Jan 23 01:41:09 2020 (r357010) +++ head/sys/powerpc/pseries/phyp_llan.c Thu Jan 23 01:46:05 2020 (r357011) @@ -189,7 +189,7 @@ llan_attach(device_t dev) return (ENXIO); } - bus_setup_intr(dev, sc->irq, INTR_TYPE_MISC | INTR_MPSAFE | + bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE | INTR_ENTROPY, NULL, llan_intr, sc, &sc->irq_cookie); /* Setup DMA */ From owner-svn-src-all@freebsd.org Thu Jan 23 01:47:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2BF7B227371; Thu, 23 Jan 2020 01:47:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4834sX0PGpz3Mhn; Thu, 23 Jan 2020 01:47:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0901E7094; Thu, 23 Jan 2020 01:47:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N1lhVR042267; Thu, 23 Jan 2020 01:47:43 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N1lh9g042266; Thu, 23 Jan 2020 01:47:43 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001230147.00N1lh9g042266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 23 Jan 2020 01:47:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357012 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 357012 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 01:47:44 -0000 Author: glebius Date: Thu Jan 23 01:47:43 2020 New Revision: 357012 URL: https://svnweb.freebsd.org/changeset/base/357012 Log: Stop entering the network epoch in ether_input(), unless driver is marked with IFF_NEEDSEPOCH. Modified: head/sys/net/if_ethersubr.c Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Thu Jan 23 01:46:05 2020 (r357011) +++ head/sys/net/if_ethersubr.c Thu Jan 23 01:47:43 2020 (r357012) @@ -809,7 +809,8 @@ ether_input(struct ifnet *ifp, struct mbuf *m) * them up. This allows the drivers to amortize the receive lock. */ CURVNET_SET_QUIET(ifp->if_vnet); - NET_EPOCH_ENTER(et); + if (__predict_false(ifp->if_flags & IFF_NEEDSEPOCH)) + NET_EPOCH_ENTER(et); while (m) { mn = m->m_nextpkt; m->m_nextpkt = NULL; @@ -824,7 +825,8 @@ ether_input(struct ifnet *ifp, struct mbuf *m) netisr_dispatch(NETISR_ETHER, m); m = mn; } - NET_EPOCH_EXIT(et); + if (__predict_false(ifp->if_flags & IFF_NEEDSEPOCH)) + NET_EPOCH_EXIT(et); CURVNET_RESTORE(); } From owner-svn-src-all@freebsd.org Thu Jan 23 01:49:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5D94F227534; Thu, 23 Jan 2020 01:49:23 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4834vR1pyjz3Mst; Thu, 23 Jan 2020 01:49:23 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F7CF709F; Thu, 23 Jan 2020 01:49:23 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N1nNo2042383; Thu, 23 Jan 2020 01:49:23 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N1nNwn042382; Thu, 23 Jan 2020 01:49:23 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001230149.00N1nNwn042382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 23 Jan 2020 01:49:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357013 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 357013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 01:49:23 -0000 Author: glebius Date: Thu Jan 23 01:49:22 2020 New Revision: 357013 URL: https://svnweb.freebsd.org/changeset/base/357013 Log: Since now drivers that support pfil run their interrupts in the network epoch, stop entering it in pfil_run_hooks(). Assert the epoch there. Modified: head/sys/net/pfil.c Modified: head/sys/net/pfil.c ============================================================================== --- head/sys/net/pfil.c Thu Jan 23 01:47:43 2020 (r357012) +++ head/sys/net/pfil.c Thu Jan 23 01:49:22 2020 (r357013) @@ -69,10 +69,6 @@ MTX_SYSINIT(pfil_mtxinit, &pfil_lock, "pfil(9) lock", #define PFIL_UNLOCK() mtx_unlock(&pfil_lock) #define PFIL_LOCK_ASSERT() mtx_assert(&pfil_lock, MA_OWNED) -#define PFIL_EPOCH net_epoch_preempt -#define PFIL_EPOCH_ENTER(et) epoch_enter_preempt(net_epoch_preempt, &(et)) -#define PFIL_EPOCH_EXIT(et) epoch_exit_preempt(net_epoch_preempt, &(et)) - struct pfil_hook { pfil_func_t hook_func; void *hook_ruleset; @@ -168,12 +164,13 @@ int pfil_run_hooks(struct pfil_head *head, pfil_packet_t p, struct ifnet *ifp, int flags, struct inpcb *inp) { - struct epoch_tracker et; pfil_chain_t *pch; struct pfil_link *link; pfil_return_t rv; bool realloc = false; + NET_EPOCH_ASSERT(); + if (PFIL_DIR(flags) == PFIL_IN) pch = &head->head_in; else if (__predict_true(PFIL_DIR(flags) == PFIL_OUT)) @@ -182,7 +179,6 @@ pfil_run_hooks(struct pfil_head *head, pfil_packet_t p panic("%s: bogus flags %d", __func__, flags); rv = PFIL_PASS; - PFIL_EPOCH_ENTER(et); CK_STAILQ_FOREACH(link, pch, link_chain) { if ((flags & PFIL_MEMPTR) && !(link->link_flags & PFIL_MEMPTR)) rv = pfil_fake_mbuf(link->link_func, &p, ifp, flags, @@ -197,7 +193,6 @@ pfil_run_hooks(struct pfil_head *head, pfil_packet_t p realloc = true; } } - PFIL_EPOCH_EXIT(et); if (realloc && rv == PFIL_PASS) rv = PFIL_REALLOCED; return (rv); @@ -313,9 +308,9 @@ pfil_unlink(struct pfil_link_args *pa, pfil_head_t hea PFIL_UNLOCK(); if (in != NULL) - epoch_call(PFIL_EPOCH, pfil_link_free, &in->link_epoch_ctx); + NET_EPOCH_CALL(pfil_link_free, &in->link_epoch_ctx); if (out != NULL) - epoch_call(PFIL_EPOCH, pfil_link_free, &out->link_epoch_ctx); + NET_EPOCH_CALL(pfil_link_free, &out->link_epoch_ctx); if (in == NULL && out == NULL) return (ENOENT); @@ -443,15 +438,13 @@ retry: if (in != NULL) { head->head_nhooksin--; hook->hook_links--; - epoch_call(PFIL_EPOCH, pfil_link_free, - &in->link_epoch_ctx); + NET_EPOCH_CALL(pfil_link_free, &in->link_epoch_ctx); } out = pfil_link_remove(&head->head_out, hook); if (out != NULL) { head->head_nhooksout--; hook->hook_links--; - epoch_call(PFIL_EPOCH, pfil_link_free, - &out->link_epoch_ctx); + NET_EPOCH_CALL(pfil_link_free, &out->link_epoch_ctx); } if (in != NULL || out != NULL) /* What if some stupid admin put same filter twice? */ From owner-svn-src-all@freebsd.org Thu Jan 23 02:39:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1FD5322904D; Thu, 23 Jan 2020 02:39:38 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) (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 48361P2Kn9z3QHK; Thu, 23 Jan 2020 02:39:37 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: by mail-qk1-f195.google.com with SMTP id k6so1994521qki.5; Wed, 22 Jan 2020 18:39:37 -0800 (PST) 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=zBc7jTpQzdafMT8ECcTPxzQ1SvH8ezY6BBuaQ3Zz948=; b=WMcCGcPixmM7v0qWBQB2U7EQxEw0Zv9ILvVi4WMB+YcVpBBQQVVnQynzSRBvTaIcKo 4dP2KetrsBgMy1vPnhupgMIxJ0lHKEnEz0u1344XAQsxbL+eZpMSh5FyQY6UKXG3jJ9K 0lUy+EfN9sZJJ1kU0YzG6JAEevglYLH+2HRKFcxOVew9IrKTCmc8ECNugzH9bwsou48W gmRR+LsN4Y/5onIXQKTcgnftGXCoIjSYnBNTj91gkwh0SvTp0bFjob/5yFT8TpF46sy/ hhmTwbBeD/12vxTKDUwOCd6M6QywMWtmqT5oGxIjioqS+C657r7BuJiUOlflZSG9Xnqm cY2w== X-Gm-Message-State: APjAAAXSK4pLpEWJqbCdxwyBTaOx39CToP7IZecwuMeWKPJ+7dzzGTdN xZxfAc9jPi48mbHb/KPsMqi9AX3WpsQ= X-Google-Smtp-Source: APXvYqxyn4EXnB4oOdSDl1VvvyY+xpaOtPYoyJAOuoEGB/63LhuRF6yn8PWbw5l2/bpNqR90gNTmgQ== X-Received: by 2002:a37:6241:: with SMTP id w62mr4512132qkb.197.1579747175531; Wed, 22 Jan 2020 18:39:35 -0800 (PST) Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com. [209.85.222.170]) by smtp.gmail.com with ESMTPSA id g15sm295102qts.19.2020.01.22.18.39.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Jan 2020 18:39:35 -0800 (PST) Received: by mail-qk1-f170.google.com with SMTP id d10so2019761qke.1; Wed, 22 Jan 2020 18:39:35 -0800 (PST) X-Received: by 2002:a37:9ed3:: with SMTP id h202mr10946047qke.456.1579747175016; Wed, 22 Jan 2020 18:39:35 -0800 (PST) MIME-Version: 1.0 References: <202001201723.00KHN3tX093432@repo.freebsd.org> In-Reply-To: <202001201723.00KHN3tX093432@repo.freebsd.org> From: Ryan Libby Date: Wed, 22 Jan 2020 18:39:22 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r356919 - head/sys/x86/x86 To: Konstantin Belousov Cc: src-committers , svn-src-all , svn-src-head , Mark Johnston Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 48361P2Kn9z3QHK X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of rlibby@gmail.com designates 209.85.222.195 as permitted sender) smtp.mailfrom=rlibby@gmail.com X-Spamd-Result: default: False [-3.84 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; IP_SCORE(-1.84)[ip: (-4.24), ipnet: 209.85.128.0/17(-3.07), asn: 15169(-1.82), country: US(-0.05)]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[195.222.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FORGED_SENDER(0.30)[rlibby@freebsd.org,rlibby@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[195.222.85.209.rep.mailspike.net : 127.0.0.17]; 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)[rlibby@freebsd.org,rlibby@gmail.com] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 02:39:38 -0000 On Mon, Jan 20, 2020 at 9:23 AM Konstantin Belousov wrote: > > Author: kib > Date: Mon Jan 20 17:23:03 2020 > New Revision: 356919 > URL: https://svnweb.freebsd.org/changeset/base/356919 > > Log: > x86: Wait for curthread to be set up as an indicator that the boot stack > is no longer used. > > pc_curthread is set by cpu_switch after it stopped using the old > thread (or boot) stack. This makes the smp_after_idle_runnable() > function not dependent on the internals of the scheduler operations. > > Reviewed by: markj > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D23276 > > Modified: > head/sys/x86/x86/mp_x86.c > > Modified: head/sys/x86/x86/mp_x86.c > ============================================================================== > --- head/sys/x86/x86/mp_x86.c Mon Jan 20 16:59:39 2020 (r356918) > +++ head/sys/x86/x86/mp_x86.c Mon Jan 20 17:23:03 2020 (r356919) > @@ -1092,13 +1092,12 @@ init_secondary_tail(void) > static void > smp_after_idle_runnable(void *arg __unused) > { > - struct thread *idle_td; > + struct pcpu *pc; > int cpu; > > for (cpu = 1; cpu < mp_ncpus; cpu++) { > - idle_td = pcpu_find(cpu)->pc_idlethread; > - while (atomic_load_int(&idle_td->td_lastcpu) == NOCPU && > - atomic_load_int(&idle_td->td_oncpu) == NOCPU) > + pc = pcpu_find(cpu); > + while (atomic_load_ptr(&pc->pc_curthread) == (uintptr_t)NULL) > cpu_spinwait(); > kmem_free((vm_offset_t)bootstacks[cpu], kstack_pages * > PAGE_SIZE); > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" I'm hitting a boot panic on a KVM VM that I think is because of this. I don't think this works as advertised, because init_secondary_tail sets curthread to its idlethread *itself* before it calls sched_switch. So I think the current check is not enough to know that we're actually off the bootstack. My panic is an AP page faults in the middle of init_secondary_tail, after curthread is set. Weirdly, I only seem to hit it when I have disabled some CPUs (to test D23318). I think this must just be affecting some aspect of the timing. Ryan From owner-svn-src-all@freebsd.org Thu Jan 23 03:36:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2EC6E22A70E; Thu, 23 Jan 2020 03:36:51 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4837HR0T6Jz3yRX; Thu, 23 Jan 2020 03:36:51 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B7A385EF; Thu, 23 Jan 2020 03:36:51 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N3aok0009273; Thu, 23 Jan 2020 03:36:50 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N3ao1X009272; Thu, 23 Jan 2020 03:36:50 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001230336.00N3ao1X009272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 23 Jan 2020 03:36:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357014 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357014 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 03:36:51 -0000 Author: jeff Date: Thu Jan 23 03:36:50 2020 New Revision: 357014 URL: https://svnweb.freebsd.org/changeset/base/357014 Log: Block the thread lock in sched_throw() and use cpu_switch() to unblock it. The introduction of lockless switch in r355784 created a race to re-use the exiting thread that was only possible to hit on a hypervisor. Reported/Tested by: rlibby Discussed with: rlibby, jhb Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Thu Jan 23 01:49:22 2020 (r357013) +++ head/sys/kern/sched_ule.c Thu Jan 23 03:36:50 2020 (r357014) @@ -2894,7 +2894,7 @@ sched_throw(struct thread *td) struct thread *newtd; struct tdq *tdq; - if (td == NULL) { + if (__predict_false(td == NULL)) { #ifdef SMP PCPU_SET(sched, DPCPU_PTR(tdq)); #endif @@ -2912,13 +2912,18 @@ sched_throw(struct thread *td) tdq_load_rem(tdq, td); td->td_lastcpu = td->td_oncpu; td->td_oncpu = NOCPU; + thread_lock_block(td); } newtd = choosethread(); spinlock_enter(); TDQ_UNLOCK(tdq); KASSERT(curthread->td_md.md_spinlock_count == 1, ("invalid count %d", curthread->td_md.md_spinlock_count)); - cpu_throw(td, newtd); /* doesn't return */ + /* doesn't return */ + if (__predict_false(td == NULL)) + cpu_throw(td, newtd); /* doesn't return */ + else + cpu_switch(td, newtd, TDQ_LOCKPTR(tdq)); } /* From owner-svn-src-all@freebsd.org Thu Jan 23 03:37:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C83A22A7D1; Thu, 23 Jan 2020 03:37:36 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4837JH70fVz3yZd; Thu, 23 Jan 2020 03:37:35 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB7F185F2; Thu, 23 Jan 2020 03:37:35 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N3bZ3E009348; Thu, 23 Jan 2020 03:37:35 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N3bZjw009347; Thu, 23 Jan 2020 03:37:35 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001230337.00N3bZjw009347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 23 Jan 2020 03:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357015 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357015 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 03:37:36 -0000 Author: jeff Date: Thu Jan 23 03:37:35 2020 New Revision: 357015 URL: https://svnweb.freebsd.org/changeset/base/357015 Log: Some architectures with DMAP still consume boot kva. Simplify the test for claiming kva in uma_startup2() to handle this. Reported by: bdragon Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Jan 23 03:36:50 2020 (r357014) +++ head/sys/vm/uma_core.c Thu Jan 23 03:37:35 2020 (r357015) @@ -2614,7 +2614,7 @@ void uma_startup2(void) { - if (!PMAP_HAS_DMAP) { + if (bootstart != bootmem) { vm_map_lock(kernel_map); (void)vm_map_insert(kernel_map, NULL, 0, bootstart, bootmem, VM_PROT_RW, VM_PROT_RW, MAP_NOFAULT); From owner-svn-src-all@freebsd.org Thu Jan 23 03:38:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9534D22A852; Thu, 23 Jan 2020 03:38: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 4837KY3TNdz3yjK; Thu, 23 Jan 2020 03:38: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 729D185F4; Thu, 23 Jan 2020 03:38: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 00N3cfTT009436; Thu, 23 Jan 2020 03:38:41 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N3cfmA009435; Thu, 23 Jan 2020 03:38:41 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202001230338.00N3cfmA009435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 23 Jan 2020 03:38:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357016 - head/sys/x86/cpufreq X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/x86/cpufreq X-SVN-Commit-Revision: 357016 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 03:38:41 -0000 Author: cy Date: Thu Jan 23 03:38:41 2020 New Revision: 357016 URL: https://svnweb.freebsd.org/changeset/base/357016 Log: Fix 32-bit build post r357002. Modified: head/sys/x86/cpufreq/hwpstate_intel.c Modified: head/sys/x86/cpufreq/hwpstate_intel.c ============================================================================== --- head/sys/x86/cpufreq/hwpstate_intel.c Thu Jan 23 03:37:35 2020 (r357015) +++ head/sys/x86/cpufreq/hwpstate_intel.c Thu Jan 23 03:38:41 2020 (r357016) @@ -140,10 +140,10 @@ intel_hwp_dump_sysctl_handler(SYSCTL_HANDLER_ARGS) } rdmsr_safe(MSR_IA32_HWP_CAPABILITIES, &data); - sbuf_printf(sb, "\tHighest Performance: %03lu\n", data & 0xff); - sbuf_printf(sb, "\tGuaranteed Performance: %03lu\n", (data >> 8) & 0xff); - sbuf_printf(sb, "\tEfficient Performance: %03lu\n", (data >> 16) & 0xff); - sbuf_printf(sb, "\tLowest Performance: %03lu\n", (data >> 24) & 0xff); + sbuf_printf(sb, "\tHighest Performance: %03ju\n", data & 0xff); + sbuf_printf(sb, "\tGuaranteed Performance: %03ju\n", (data >> 8) & 0xff); + sbuf_printf(sb, "\tEfficient Performance: %03ju\n", (data >> 16) & 0xff); + sbuf_printf(sb, "\tLowest Performance: %03ju\n", (data >> 24) & 0xff); rdmsr_safe(MSR_IA32_HWP_REQUEST, &data); if (sc->hwp_pkg_ctrl && (data & IA32_HWP_REQUEST_PACKAGE_CONTROL)) { @@ -154,9 +154,9 @@ intel_hwp_dump_sysctl_handler(SYSCTL_HANDLER_ARGS) #define pkg_print(x, name, offset) do { \ if (!sc->hwp_pkg_ctrl || (data & x) != 0) \ - sbuf_printf(sb, "\t%s: %03lu\n", name, (data >> offset) & 0xff);\ + sbuf_printf(sb, "\t%s: %03ju\n", name, (data >> offset) & 0xff);\ else \ - sbuf_printf(sb, "\t%s: %03lu\n", name, (data2 >> offset) & 0xff);\ + sbuf_printf(sb, "\t%s: %03ju\n", name, (data2 >> offset) & 0xff);\ } while (0) pkg_print(IA32_HWP_REQUEST_EPP_VALID, From owner-svn-src-all@freebsd.org Thu Jan 23 04:54:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5DBB22C1DA; Thu, 23 Jan 2020 04:54:50 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48391Q4lQ6z44t5; Thu, 23 Jan 2020 04:54:50 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 998019489; Thu, 23 Jan 2020 04:54:50 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N4so31060100; Thu, 23 Jan 2020 04:54:50 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N4snwI060096; Thu, 23 Jan 2020 04:54:49 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001230454.00N4snwI060096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 23 Jan 2020 04:54:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357017 - in head/sys: dev/spibus kern vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: dev/spibus kern vm X-SVN-Commit-Revision: 357017 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 04:54:50 -0000 Author: jeff Date: Thu Jan 23 04:54:49 2020 New Revision: 357017 URL: https://svnweb.freebsd.org/changeset/base/357017 Log: Consistently use busy and vm_page_valid() rather than touching page bits directly. This improves API compliance, asserts, etc. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D23283 Modified: head/sys/dev/spibus/spigen.c head/sys/kern/kern_kcov.c head/sys/kern/kern_sendfile.c head/sys/vm/vm_glue.c head/sys/vm/vm_kern.c Modified: head/sys/dev/spibus/spigen.c ============================================================================== --- head/sys/dev/spibus/spigen.c Thu Jan 23 03:38:41 2020 (r357016) +++ head/sys/dev/spibus/spigen.c Thu Jan 23 04:54:49 2020 (r357017) @@ -325,8 +325,9 @@ spigen_mmap_single(struct cdev *cdev, vm_ooffset_t *of vm_object_reference_locked(mmap->bufobj); // kernel and userland both for (n = 0; n < pages; n++) { m[n] = vm_page_grab(mmap->bufobj, n, - VM_ALLOC_NOBUSY | VM_ALLOC_ZERO | VM_ALLOC_WIRED); - m[n]->valid = VM_PAGE_BITS_ALL; + VM_ALLOC_ZERO | VM_ALLOC_WIRED); + vm_page_valid(m[n]); + vm_page_xunbusy(m[n]); } VM_OBJECT_WUNLOCK(mmap->bufobj); pmap_qenter(mmap->kvaddr, m, pages); Modified: head/sys/kern/kern_kcov.c ============================================================================== --- head/sys/kern/kern_kcov.c Thu Jan 23 03:38:41 2020 (r357016) +++ head/sys/kern/kern_kcov.c Thu Jan 23 04:54:49 2020 (r357017) @@ -383,8 +383,9 @@ kcov_alloc(struct kcov_info *info, size_t entries) VM_OBJECT_WLOCK(info->bufobj); for (n = 0; n < pages; n++) { m = vm_page_grab(info->bufobj, n, - VM_ALLOC_NOBUSY | VM_ALLOC_ZERO | VM_ALLOC_WIRED); - m->valid = VM_PAGE_BITS_ALL; + VM_ALLOC_ZERO | VM_ALLOC_WIRED); + vm_page_valid(m); + vm_page_xunbusy(m); pmap_qenter(info->kvaddr + n * PAGE_SIZE, &m, 1); } VM_OBJECT_WUNLOCK(info->bufobj); Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Thu Jan 23 03:38:41 2020 (r357016) +++ head/sys/kern/kern_sendfile.c Thu Jan 23 04:54:49 2020 (r357017) @@ -388,7 +388,7 @@ sendfile_swapin(vm_object_t obj, struct sf_io *sfio, i if (!vm_pager_has_page(obj, OFF_TO_IDX(vmoff(i, off)), NULL, &a)) { pmap_zero_page(pa[i]); - pa[i]->valid = VM_PAGE_BITS_ALL; + vm_page_valid(pa[i]); MPASS(pa[i]->dirty == 0); vm_page_xunbusy(pa[i]); i++; Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Thu Jan 23 03:38:41 2020 (r357016) +++ head/sys/vm/vm_glue.c Thu Jan 23 04:54:49 2020 (r357017) @@ -340,10 +340,12 @@ vm_thread_stack_create(struct domainset *ds, vm_object * page of stack. */ VM_OBJECT_WLOCK(ksobj); - (void)vm_page_grab_pages(ksobj, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | - VM_ALLOC_WIRED, ma, pages); - for (i = 0; i < pages; i++) - ma[i]->valid = VM_PAGE_BITS_ALL; + (void)vm_page_grab_pages(ksobj, 0, VM_ALLOC_NORMAL | VM_ALLOC_WIRED, + ma, pages); + for (i = 0; i < pages; i++) { + vm_page_valid(ma[i]); + vm_page_xunbusy(ma[i]); + } VM_OBJECT_WUNLOCK(ksobj); pmap_qenter(ks, ma, pages); *ksobjp = ksobj; Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Thu Jan 23 03:38:41 2020 (r357016) +++ head/sys/vm/vm_kern.c Thu Jan 23 04:54:49 2020 (r357017) @@ -193,7 +193,7 @@ kmem_alloc_attr_domain(int domain, vm_size_t size, int if (vmem_alloc(vmem, size, M_BESTFIT | flags, &addr)) return (0); offset = addr - VM_MIN_KERNEL_ADDRESS; - pflags = malloc2vm_flags(flags) | VM_ALLOC_NOBUSY | VM_ALLOC_WIRED; + pflags = malloc2vm_flags(flags) | VM_ALLOC_WIRED; pflags &= ~(VM_ALLOC_NOWAIT | VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL); pflags |= VM_ALLOC_NOWAIT; prot = (flags & M_EXEC) != 0 ? VM_PROT_ALL : VM_PROT_RW; @@ -223,7 +223,8 @@ retry: vm_phys_domain(m), domain)); if ((flags & M_ZERO) && (m->flags & PG_ZERO) == 0) pmap_zero_page(m); - m->valid = VM_PAGE_BITS_ALL; + vm_page_valid(m); + vm_page_xunbusy(m); pmap_enter(kernel_pmap, addr + i, m, prot, prot | PMAP_ENTER_WIRED, 0); } @@ -284,7 +285,7 @@ kmem_alloc_contig_domain(int domain, vm_size_t size, i if (vmem_alloc(vmem, size, flags | M_BESTFIT, &addr)) return (0); offset = addr - VM_MIN_KERNEL_ADDRESS; - pflags = malloc2vm_flags(flags) | VM_ALLOC_NOBUSY | VM_ALLOC_WIRED; + pflags = malloc2vm_flags(flags) | VM_ALLOC_WIRED; pflags &= ~(VM_ALLOC_NOWAIT | VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL); pflags |= VM_ALLOC_NOWAIT; npages = atop(size); @@ -315,7 +316,8 @@ retry: for (; m < end_m; m++) { if ((flags & M_ZERO) && (m->flags & PG_ZERO) == 0) pmap_zero_page(m); - m->valid = VM_PAGE_BITS_ALL; + vm_page_valid(m); + vm_page_xunbusy(m); pmap_enter(kernel_pmap, tmp, m, VM_PROT_RW, VM_PROT_RW | PMAP_ENTER_WIRED, 0); tmp += PAGE_SIZE; @@ -465,7 +467,7 @@ kmem_back_domain(int domain, vm_object_t object, vm_of ("kmem_back_domain: only supports kernel object.")); offset = addr - VM_MIN_KERNEL_ADDRESS; - pflags = malloc2vm_flags(flags) | VM_ALLOC_NOBUSY | VM_ALLOC_WIRED; + pflags = malloc2vm_flags(flags) | VM_ALLOC_WIRED; pflags &= ~(VM_ALLOC_NOWAIT | VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL); if (flags & M_WAITOK) pflags |= VM_ALLOC_WAITFAIL; @@ -498,7 +500,8 @@ retry: pmap_zero_page(m); KASSERT((m->oflags & VPO_UNMANAGED) != 0, ("kmem_malloc: page %p is managed", m)); - m->valid = VM_PAGE_BITS_ALL; + vm_page_valid(m); + vm_page_xunbusy(m); pmap_enter(kernel_pmap, addr + i, m, prot, prot | PMAP_ENTER_WIRED, 0); #if VM_NRESERVLEVEL > 0 From owner-svn-src-all@freebsd.org Thu Jan 23 04:56:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24EE622C281; Thu, 23 Jan 2020 04:56:35 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48393R05qvz451y; Thu, 23 Jan 2020 04:56:35 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2B8C9491; Thu, 23 Jan 2020 04:56:34 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N4uYrw060264; Thu, 23 Jan 2020 04:56:34 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N4uYSm060263; Thu, 23 Jan 2020 04:56:34 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <202001230456.00N4uYSm060263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Thu, 23 Jan 2020 04:56:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357018 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357018 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 04:56:35 -0000 Author: rlibby Date: Thu Jan 23 04:56:34 2020 New Revision: 357018 URL: https://svnweb.freebsd.org/changeset/base/357018 Log: uma: report leaks more accurately Previously UMA had some false negatives in the leak report at keg destruction time, where it only reported leaks if there were free items in the slab layer (rather than allocated items), which notably would not be true for single-item slabs (large items). Now, report a leak if there are any allocated pages, and calculate and report the number of allocated items rather than free items. Reviewed by: jeff, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D23275 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Jan 23 04:54:49 2020 (r357017) +++ head/sys/vm/uma_core.c Thu Jan 23 04:56:34 2020 (r357018) @@ -2440,11 +2440,11 @@ keg_dtor(void *arg, int size, void *udata) pages += keg->uk_domain[i].ud_pages; KEG_LOCK_FINI(keg, i); } - if (free != 0) + if (pages != 0) printf("Freed UMA keg (%s) was not empty (%u items). " " Lost %u pages of memory.\n", keg->uk_name ? keg->uk_name : "", - free, pages); + pages / keg->uk_ppera * keg->uk_ipers - free, pages); hash_free(&keg->uk_hash); } From owner-svn-src-all@freebsd.org Thu Jan 23 04:56:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 93D6F22C2A9; Thu, 23 Jan 2020 04:56:39 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48393W3Tl9z454C; Thu, 23 Jan 2020 04:56:39 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FEC79492; Thu, 23 Jan 2020 04:56:39 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N4ud3A060318; Thu, 23 Jan 2020 04:56:39 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N4udpZ060317; Thu, 23 Jan 2020 04:56:39 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <202001230456.00N4udpZ060317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Thu, 23 Jan 2020 04:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357019 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 04:56:39 -0000 Author: rlibby Date: Thu Jan 23 04:56:38 2020 New Revision: 357019 URL: https://svnweb.freebsd.org/changeset/base/357019 Log: uma: fix zone domain overlaying pcpu cache with disabled cpus UMA zone structures have two arrays at the end which are sized according to the machine: an array of CPU count length, and an array of NUMA domain count length. The CPU counting was wrong in the case where some CPUs are disabled (when mp_ncpus != mp_maxid + 1), and this caused the second array to be overlaid with the first. Reported by: olivier Reviewed by: jeff, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D23318 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Jan 23 04:56:34 2020 (r357018) +++ head/sys/vm/uma_core.c Thu Jan 23 04:56:38 2020 (r357019) @@ -2297,7 +2297,8 @@ zone_ctor(void *mem, int size, void *udata, int flags) zone->uz_flags = 0; zone->uz_warning = NULL; /* The domain structures follow the cpu structures. */ - zone->uz_domain = (struct uma_zone_domain *)&zone->uz_cpu[mp_ncpus]; + zone->uz_domain = + (struct uma_zone_domain *)&zone->uz_cpu[mp_maxid + 1]; zone->uz_bkt_max = ULONG_MAX; timevalclear(&zone->uz_ratecheck); From owner-svn-src-all@freebsd.org Thu Jan 23 05:03:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 15A8322C521; Thu, 23 Jan 2020 05:03:35 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4839CW0PjHz45X0; Thu, 23 Jan 2020 05:03:35 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08F699679; Thu, 23 Jan 2020 05:03:35 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N53Y8q066093; Thu, 23 Jan 2020 05:03:34 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N53Yjr066092; Thu, 23 Jan 2020 05:03:34 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001230503.00N53Yjr066092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 23 Jan 2020 05:03:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357020 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357020 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 05:03:35 -0000 Author: jeff Date: Thu Jan 23 05:03:34 2020 New Revision: 357020 URL: https://svnweb.freebsd.org/changeset/base/357020 Log: (fault 1/9) Move a handful of stack variables into the faultstate. This additionally fixes a potential bug/pessimization where we could fail to reload the original fault_type on restart. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D23301 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Thu Jan 23 04:56:38 2020 (r357019) +++ head/sys/vm/vm_fault.c Thu Jan 23 05:03:34 2020 (r357020) @@ -120,19 +120,35 @@ __FBSDID("$FreeBSD$"); #define VM_FAULT_DONTNEED_MIN 1048576 struct faultstate { - vm_offset_t vaddr; - vm_page_t m; + /* Fault parameters. */ + vm_offset_t vaddr; + vm_page_t *m_hold; + vm_prot_t fault_type; + vm_prot_t prot; + int fault_flags; + boolean_t wired; + + /* Page reference for cow. */ vm_page_t m_cow; - vm_object_t object; - vm_pindex_t pindex; - vm_page_t first_m; + + /* Current object. */ + vm_object_t object; + vm_pindex_t pindex; + vm_page_t m; + + /* Top-level map object. */ vm_object_t first_object; - vm_pindex_t first_pindex; - vm_map_t map; - vm_map_entry_t entry; - int map_generation; - bool lookup_still_valid; - struct vnode *vp; + vm_pindex_t first_pindex; + vm_page_t first_m; + + /* Map state. */ + vm_map_t map; + vm_map_entry_t entry; + int map_generation; + bool lookup_still_valid; + + /* Vnode if locked. */ + struct vnode *vp; }; static void vm_fault_dontneed(const struct faultstate *fs, vm_offset_t vaddr, @@ -233,21 +249,20 @@ unlock_and_deallocate(struct faultstate *fs) } static void -vm_fault_dirty(vm_map_entry_t entry, vm_page_t m, vm_prot_t prot, - vm_prot_t fault_type, int fault_flags) +vm_fault_dirty(struct faultstate *fs, vm_page_t m) { bool need_dirty; - if (((prot & VM_PROT_WRITE) == 0 && - (fault_flags & VM_FAULT_DIRTY) == 0) || + if (((fs->prot & VM_PROT_WRITE) == 0 && + (fs->fault_flags & VM_FAULT_DIRTY) == 0) || (m->oflags & VPO_UNMANAGED) != 0) return; VM_PAGE_OBJECT_BUSY_ASSERT(m); - need_dirty = ((fault_type & VM_PROT_WRITE) != 0 && - (fault_flags & VM_FAULT_WIRE) == 0) || - (fault_flags & VM_FAULT_DIRTY) != 0; + need_dirty = ((fs->fault_type & VM_PROT_WRITE) != 0 && + (fs->fault_flags & VM_FAULT_WIRE) == 0) || + (fs->fault_flags & VM_FAULT_DIRTY) != 0; vm_object_set_writeable_dirty(m->object); @@ -268,7 +283,7 @@ vm_fault_dirty(vm_map_entry_t entry, vm_page_t m, vm_p * sure the page isn't marked NOSYNC. Applications sharing * data should use the same flags to avoid ping ponging. */ - if ((entry->eflags & MAP_ENTRY_NOSYNC) != 0) + if ((fs->entry->eflags & MAP_ENTRY_NOSYNC) != 0) vm_page_aflag_set(m, PGA_NOSYNC); else vm_page_aflag_clear(m, PGA_NOSYNC); @@ -280,8 +295,7 @@ vm_fault_dirty(vm_map_entry_t entry, vm_page_t m, vm_p * Unlocks fs.first_object and fs.map on success. */ static int -vm_fault_soft_fast(struct faultstate *fs, vm_offset_t vaddr, vm_prot_t prot, - int fault_type, int fault_flags, boolean_t wired, vm_page_t *m_hold) +vm_fault_soft_fast(struct faultstate *fs) { vm_page_t m, m_map; #if (defined(__aarch64__) || defined(__amd64__) || (defined(__arm__) && \ @@ -291,12 +305,14 @@ vm_fault_soft_fast(struct faultstate *fs, vm_offset_t int flags; #endif int psind, rv; + vm_offset_t vaddr; MPASS(fs->vp == NULL); + vaddr = fs->vaddr; vm_object_busy(fs->first_object); m = vm_page_lookup(fs->first_object, fs->first_pindex); /* A busy page can be mapped for read|execute access. */ - if (m == NULL || ((prot & VM_PROT_WRITE) != 0 && + if (m == NULL || ((fs->prot & VM_PROT_WRITE) != 0 && vm_page_busied(m)) || !vm_page_all_valid(m)) { rv = KERN_FAILURE; goto out; @@ -311,10 +327,10 @@ vm_fault_soft_fast(struct faultstate *fs, vm_offset_t rounddown2(vaddr, pagesizes[m_super->psind]) >= fs->entry->start && roundup2(vaddr + 1, pagesizes[m_super->psind]) <= fs->entry->end && (vaddr & (pagesizes[m_super->psind] - 1)) == (VM_PAGE_TO_PHYS(m) & - (pagesizes[m_super->psind] - 1)) && !wired && + (pagesizes[m_super->psind] - 1)) && !fs->wired && pmap_ps_enabled(fs->map->pmap)) { flags = PS_ALL_VALID; - if ((prot & VM_PROT_WRITE) != 0) { + if ((fs->prot & VM_PROT_WRITE) != 0) { /* * Create a superpage mapping allowing write access * only if none of the constituent pages are busy and @@ -331,22 +347,22 @@ vm_fault_soft_fast(struct faultstate *fs, vm_offset_t vaddr = rounddown2(vaddr, pagesizes[psind]); /* Preset the modified bit for dirty superpages. */ if ((flags & PS_ALL_DIRTY) != 0) - fault_type |= VM_PROT_WRITE; + fs->fault_type |= VM_PROT_WRITE; } } #endif - rv = pmap_enter(fs->map->pmap, vaddr, m_map, prot, fault_type | - PMAP_ENTER_NOSLEEP | (wired ? PMAP_ENTER_WIRED : 0), psind); + rv = pmap_enter(fs->map->pmap, vaddr, m_map, fs->prot, fs->fault_type | + PMAP_ENTER_NOSLEEP | (fs->wired ? PMAP_ENTER_WIRED : 0), psind); if (rv != KERN_SUCCESS) goto out; - if (m_hold != NULL) { - *m_hold = m; + if (fs->m_hold != NULL) { + (*fs->m_hold) = m; vm_page_wire(m); } - if (psind == 0 && !wired) + if (psind == 0 && !fs->wired) vm_fault_prefault(fs, vaddr, PFBAK, PFFOR, true); VM_OBJECT_RUNLOCK(fs->first_object); - vm_fault_dirty(fs->entry, m, prot, fault_type, fault_flags); + vm_fault_dirty(fs, m); vm_map_lookup_done(fs->map, fs->entry); curthread->td_ru.ru_minflt++; @@ -402,8 +418,7 @@ vm_fault_populate_cleanup(vm_object_t object, vm_pinde } static int -vm_fault_populate(struct faultstate *fs, vm_prot_t prot, int fault_type, - int fault_flags, boolean_t wired, vm_page_t *m_hold) +vm_fault_populate(struct faultstate *fs) { vm_offset_t vaddr; vm_page_t m; @@ -430,7 +445,7 @@ vm_fault_populate(struct faultstate *fs, vm_prot_t pro * to the driver. */ rv = vm_pager_populate(fs->first_object, fs->first_pindex, - fault_type, fs->entry->max_protection, &pager_first, &pager_last); + fs->fault_type, fs->entry->max_protection, &pager_first, &pager_last); VM_OBJECT_ASSERT_WLOCKED(fs->first_object); if (rv == VM_PAGER_BAD) { @@ -489,7 +504,7 @@ vm_fault_populate(struct faultstate *fs, vm_prot_t pro psind = m->psind; if (psind > 0 && ((vaddr & (pagesizes[psind] - 1)) != 0 || pidx + OFF_TO_IDX(pagesizes[psind]) - 1 > pager_last || - !pmap_ps_enabled(fs->map->pmap) || wired)) + !pmap_ps_enabled(fs->map->pmap) || fs->wired)) psind = 0; #else psind = 0; @@ -497,18 +512,17 @@ vm_fault_populate(struct faultstate *fs, vm_prot_t pro npages = atop(pagesizes[psind]); for (i = 0; i < npages; i++) { vm_fault_populate_check_page(&m[i]); - vm_fault_dirty(fs->entry, &m[i], prot, fault_type, - fault_flags); + vm_fault_dirty(fs, &m[i]); } VM_OBJECT_WUNLOCK(fs->first_object); - rv = pmap_enter(fs->map->pmap, vaddr, m, prot, fault_type | - (wired ? PMAP_ENTER_WIRED : 0), psind); + rv = pmap_enter(fs->map->pmap, vaddr, m, fs->prot, fs->fault_type | + (fs->wired ? PMAP_ENTER_WIRED : 0), psind); #if defined(__amd64__) if (psind > 0 && rv == KERN_FAILURE) { for (i = 0; i < npages; i++) { rv = pmap_enter(fs->map->pmap, vaddr + ptoa(i), - &m[i], prot, fault_type | - (wired ? PMAP_ENTER_WIRED : 0), 0); + &m[i], fs->prot, fs->fault_type | + (fs->wired ? PMAP_ENTER_WIRED : 0), 0); MPASS(rv == KERN_SUCCESS); } } @@ -517,12 +531,12 @@ vm_fault_populate(struct faultstate *fs, vm_prot_t pro #endif VM_OBJECT_WLOCK(fs->first_object); for (i = 0; i < npages; i++) { - if ((fault_flags & VM_FAULT_WIRE) != 0) + if ((fs->fault_flags & VM_FAULT_WIRE) != 0) vm_page_wire(&m[i]); else vm_page_activate(&m[i]); - if (m_hold != NULL && m[i].pindex == fs->first_pindex) { - *m_hold = &m[i]; + if (fs->m_hold != NULL && m[i].pindex == fs->first_pindex) { + (*fs->m_hold) = &m[i]; vm_page_wire(&m[i]); } vm_page_xunbusy(&m[i]); @@ -778,11 +792,10 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fa vm_object_t next_object, retry_object; vm_offset_t e_end, e_start; vm_pindex_t retry_pindex; - vm_prot_t prot, retry_prot; + vm_prot_t retry_prot; int ahead, alloc_req, behind, cluster_offset, faultcount; int nera, oom, result, rv; u_char behavior; - boolean_t wired; /* Passed by reference. */ bool dead, hardfault, is_first_object_locked; VM_CNT_INC(v_vm_faults); @@ -792,6 +805,8 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fa fs.vp = NULL; fs.vaddr = vaddr; + fs.m_hold = m_hold; + fs.fault_flags = fault_flags; faultcount = 0; nera = -1; hardfault = false; @@ -799,15 +814,16 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fa RetryFault: oom = 0; RetryFault_oom: + fs.fault_type = fault_type; /* * Find the backing store object and offset into it to begin the * search. */ fs.map = map; - result = vm_map_lookup(&fs.map, vaddr, fault_type | + result = vm_map_lookup(&fs.map, fs.vaddr, fs.fault_type | VM_PROT_FAULT_LOOKUP, &fs.entry, &fs.first_object, - &fs.first_pindex, &prot, &wired); + &fs.first_pindex, &fs.prot, &fs.wired); if (result != KERN_SUCCESS) { unlock_vp(&fs); return (result); @@ -817,14 +833,14 @@ RetryFault_oom: if (fs.entry->eflags & MAP_ENTRY_NOFAULT) { panic("%s: fault on nofault entry, addr: %#lx", - __func__, (u_long)vaddr); + __func__, (u_long)fs.vaddr); } if (fs.entry->eflags & MAP_ENTRY_IN_TRANSITION && fs.entry->wiring_thread != curthread) { vm_map_unlock_read(fs.map); vm_map_lock(fs.map); - if (vm_map_lookup_entry(fs.map, vaddr, &fs.entry) && + if (vm_map_lookup_entry(fs.map, fs.vaddr, &fs.entry) && (fs.entry->eflags & MAP_ENTRY_IN_TRANSITION)) { unlock_vp(&fs); fs.entry->eflags |= MAP_ENTRY_NEEDS_WAKEUP; @@ -836,11 +852,11 @@ RetryFault_oom: MPASS((fs.entry->eflags & MAP_ENTRY_GUARD) == 0); - if (wired) - fault_type = prot | (fault_type & VM_PROT_COPY); + if (fs.wired) + fs.fault_type = fs.prot | (fs.fault_type & VM_PROT_COPY); else - KASSERT((fault_flags & VM_FAULT_WIRE) == 0, - ("!wired && VM_FAULT_WIRE")); + KASSERT((fs.fault_flags & VM_FAULT_WIRE) == 0, + ("!fs.wired && VM_FAULT_WIRE")); /* * Try to avoid lock contention on the top-level object through @@ -850,10 +866,9 @@ RetryFault_oom: * multiple page faults of a similar type to run in parallel. */ if (fs.vp == NULL /* avoid locked vnode leak */ && - (fault_flags & (VM_FAULT_WIRE | VM_FAULT_DIRTY)) == 0) { + (fs.fault_flags & (VM_FAULT_WIRE | VM_FAULT_DIRTY)) == 0) { VM_OBJECT_RLOCK(fs.first_object); - rv = vm_fault_soft_fast(&fs, vaddr, prot, fault_type, - fault_flags, wired, m_hold); + rv = vm_fault_soft_fast(&fs); if (rv == KERN_SUCCESS) return (rv); if (!VM_OBJECT_TRYUPGRADE(fs.first_object)) { @@ -950,8 +965,7 @@ RetryFault_oom: if (fs.object == fs.first_object && (fs.first_object->flags & OBJ_POPULATE) != 0 && fs.first_object->shadow_count == 0) { - rv = vm_fault_populate(&fs, prot, fault_type, - fault_flags, wired, m_hold); + rv = vm_fault_populate(&fs); switch (rv) { case KERN_SUCCESS: case KERN_FAILURE: @@ -1221,7 +1235,7 @@ next: /* * We only really need to copy if we want to write it. */ - if ((fault_type & (VM_PROT_COPY | VM_PROT_WRITE)) != 0) { + if ((fs.fault_type & (VM_PROT_COPY | VM_PROT_WRITE)) != 0) { /* * This allows pages to be virtually copied from a * backing_object into the first_object, where the @@ -1287,7 +1301,7 @@ next: */ pmap_copy_page(fs.m, fs.first_m); vm_page_valid(fs.first_m); - if (wired && (fault_flags & + if (fs.wired && (fs.fault_flags & VM_FAULT_WIRE) == 0) { vm_page_wire(fs.first_m); vm_page_unwire(fs.m, PQ_INACTIVE); @@ -1323,7 +1337,7 @@ next: VM_CNT_INC(v_cow_faults); curthread->td_cow++; } else { - prot &= ~VM_PROT_WRITE; + fs.prot &= ~VM_PROT_WRITE; } } @@ -1338,8 +1352,9 @@ next: } fs.lookup_still_valid = true; if (fs.map->timestamp != fs.map_generation) { - result = vm_map_lookup_locked(&fs.map, vaddr, fault_type, - &fs.entry, &retry_object, &retry_pindex, &retry_prot, &wired); + result = vm_map_lookup_locked(&fs.map, vaddr, fs.fault_type, + &fs.entry, &retry_object, &retry_pindex, &retry_prot, + &fs.wired); /* * If we don't need the page any longer, put it on the inactive @@ -1371,15 +1386,15 @@ next: * write to read permission means that we can't mark the page * write-enabled after all. */ - prot &= retry_prot; - fault_type &= retry_prot; - if (prot == 0) { + fs.prot &= retry_prot; + fs.fault_type &= retry_prot; + if (fs.prot == 0) { fault_deallocate(&fs); goto RetryFault; } /* Reassert because wired may have changed. */ - KASSERT(wired || (fault_flags & VM_FAULT_WIRE) == 0, + KASSERT(fs.wired || (fs.fault_flags & VM_FAULT_WIRE) == 0, ("!wired && VM_FAULT_WIRE")); } } @@ -1402,7 +1417,7 @@ next: KASSERT(vm_page_all_valid(fs.m), ("vm_fault: page %p partially invalid", fs.m)); - vm_fault_dirty(fs.entry, fs.m, prot, fault_type, fault_flags); + vm_fault_dirty(&fs, fs.m); /* * Put this page into the physical map. We had to do the unlock above @@ -1410,10 +1425,10 @@ next: * back on the active queue until later so that the pageout daemon * won't find it (yet). */ - pmap_enter(fs.map->pmap, vaddr, fs.m, prot, - fault_type | (wired ? PMAP_ENTER_WIRED : 0), 0); - if (faultcount != 1 && (fault_flags & VM_FAULT_WIRE) == 0 && - wired == 0) + pmap_enter(fs.map->pmap, vaddr, fs.m, fs.prot, + fs.fault_type | (fs.wired ? PMAP_ENTER_WIRED : 0), 0); + if (faultcount != 1 && (fs.fault_flags & VM_FAULT_WIRE) == 0 && + fs.wired == 0) vm_fault_prefault(&fs, vaddr, faultcount > 0 ? behind : PFBAK, faultcount > 0 ? ahead : PFFOR, false); @@ -1422,12 +1437,12 @@ next: * If the page is not wired down, then put it where the pageout daemon * can find it. */ - if ((fault_flags & VM_FAULT_WIRE) != 0) + if ((fs.fault_flags & VM_FAULT_WIRE) != 0) vm_page_wire(fs.m); else vm_page_activate(fs.m); - if (m_hold != NULL) { - *m_hold = fs.m; + if (fs.m_hold != NULL) { + (*fs.m_hold) = fs.m; vm_page_wire(fs.m); } vm_page_xunbusy(fs.m); @@ -1443,7 +1458,7 @@ next: #ifdef RACCT if (racct_enable && fs.object->type == OBJT_VNODE) { PROC_LOCK(curproc); - if ((fault_type & (VM_PROT_COPY | VM_PROT_WRITE)) != 0) { + if ((fs.fault_type & (VM_PROT_COPY | VM_PROT_WRITE)) != 0) { racct_add_force(curproc, RACCT_WRITEBPS, PAGE_SIZE + behind * PAGE_SIZE); racct_add_force(curproc, RACCT_WRITEIOPS, 1); From owner-svn-src-all@freebsd.org Thu Jan 23 05:05:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB5E022C5D6; Thu, 23 Jan 2020 05:05:39 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4839Fv44dGz45g8; Thu, 23 Jan 2020 05:05:39 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8734A9682; Thu, 23 Jan 2020 05:05:39 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N55deb066233; Thu, 23 Jan 2020 05:05:39 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N55da8066232; Thu, 23 Jan 2020 05:05:39 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001230505.00N55da8066232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 23 Jan 2020 05:05:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357021 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357021 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 05:05:39 -0000 Author: jeff Date: Thu Jan 23 05:05:39 2020 New Revision: 357021 URL: https://svnweb.freebsd.org/changeset/base/357021 Log: (fault 2/9) Move map lookup into a dedicated function. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D23302 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Thu Jan 23 05:03:34 2020 (r357020) +++ head/sys/vm/vm_fault.c Thu Jan 23 05:05:39 2020 (r357021) @@ -747,6 +747,54 @@ vm_fault_readahead(struct faultstate *fs) return (nera); } +static int +vm_fault_lookup(struct faultstate *fs) +{ + int result; + + KASSERT(!fs->lookup_still_valid, + ("vm_fault_lookup: Map already locked.")); + result = vm_map_lookup(&fs->map, fs->vaddr, fs->fault_type | + VM_PROT_FAULT_LOOKUP, &fs->entry, &fs->first_object, + &fs->first_pindex, &fs->prot, &fs->wired); + if (result != KERN_SUCCESS) { + unlock_vp(fs); + return (result); + } + + fs->map_generation = fs->map->timestamp; + + if (fs->entry->eflags & MAP_ENTRY_NOFAULT) { + panic("%s: fault on nofault entry, addr: %#lx", + __func__, (u_long)fs->vaddr); + } + + if (fs->entry->eflags & MAP_ENTRY_IN_TRANSITION && + fs->entry->wiring_thread != curthread) { + vm_map_unlock_read(fs->map); + vm_map_lock(fs->map); + if (vm_map_lookup_entry(fs->map, fs->vaddr, &fs->entry) && + (fs->entry->eflags & MAP_ENTRY_IN_TRANSITION)) { + unlock_vp(fs); + fs->entry->eflags |= MAP_ENTRY_NEEDS_WAKEUP; + vm_map_unlock_and_wait(fs->map, 0); + } else + vm_map_unlock(fs->map); + return (KERN_RESOURCE_SHORTAGE); + } + + MPASS((fs->entry->eflags & MAP_ENTRY_GUARD) == 0); + + if (fs->wired) + fs->fault_type = fs->prot | (fs->fault_type & VM_PROT_COPY); + else + KASSERT((fs->fault_flags & VM_FAULT_WIRE) == 0, + ("!fs->wired && VM_FAULT_WIRE")); + fs->lookup_still_valid = true; + + return (KERN_SUCCESS); +} + /* * Wait/Retry if the page is busy. We have to do this if the page is * either exclusive or shared busy because the vm_pager may be using @@ -807,6 +855,8 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fa fs.vaddr = vaddr; fs.m_hold = m_hold; fs.fault_flags = fault_flags; + fs.map = map; + fs.lookup_still_valid = false; faultcount = 0; nera = -1; hardfault = false; @@ -820,44 +870,13 @@ RetryFault_oom: * Find the backing store object and offset into it to begin the * search. */ - fs.map = map; - result = vm_map_lookup(&fs.map, fs.vaddr, fs.fault_type | - VM_PROT_FAULT_LOOKUP, &fs.entry, &fs.first_object, - &fs.first_pindex, &fs.prot, &fs.wired); + result = vm_fault_lookup(&fs); if (result != KERN_SUCCESS) { - unlock_vp(&fs); + if (result == KERN_RESOURCE_SHORTAGE) + goto RetryFault; return (result); } - fs.map_generation = fs.map->timestamp; - - if (fs.entry->eflags & MAP_ENTRY_NOFAULT) { - panic("%s: fault on nofault entry, addr: %#lx", - __func__, (u_long)fs.vaddr); - } - - if (fs.entry->eflags & MAP_ENTRY_IN_TRANSITION && - fs.entry->wiring_thread != curthread) { - vm_map_unlock_read(fs.map); - vm_map_lock(fs.map); - if (vm_map_lookup_entry(fs.map, fs.vaddr, &fs.entry) && - (fs.entry->eflags & MAP_ENTRY_IN_TRANSITION)) { - unlock_vp(&fs); - fs.entry->eflags |= MAP_ENTRY_NEEDS_WAKEUP; - vm_map_unlock_and_wait(fs.map, 0); - } else - vm_map_unlock(fs.map); - goto RetryFault; - } - - MPASS((fs.entry->eflags & MAP_ENTRY_GUARD) == 0); - - if (fs.wired) - fs.fault_type = fs.prot | (fs.fault_type & VM_PROT_COPY); - else - KASSERT((fs.fault_flags & VM_FAULT_WIRE) == 0, - ("!fs.wired && VM_FAULT_WIRE")); - /* * Try to avoid lock contention on the top-level object through * special-case handling of some types of page faults, specifically, @@ -890,8 +909,6 @@ RetryFault_oom: */ vm_object_reference_locked(fs.first_object); vm_object_pip_add(fs.first_object, 1); - - fs.lookup_still_valid = true; fs.m_cow = fs.m = fs.first_m = NULL; From owner-svn-src-all@freebsd.org Thu Jan 23 05:07:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC48822C690; Thu, 23 Jan 2020 05:07:02 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4839HV4ZB3z45pF; Thu, 23 Jan 2020 05:07:02 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 980B19689; Thu, 23 Jan 2020 05:07:02 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N572hQ066345; Thu, 23 Jan 2020 05:07:02 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N572UF066343; Thu, 23 Jan 2020 05:07:02 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001230507.00N572UF066343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 23 Jan 2020 05:07:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357022 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 05:07:02 -0000 Author: jeff Date: Thu Jan 23 05:07:01 2020 New Revision: 357022 URL: https://svnweb.freebsd.org/changeset/base/357022 Log: (fault 3/9) Move map relookup into a dedicated function. Add a new VM return code KERN_RESTART which means, deallocate and restart in fault. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D23303 Modified: head/sys/vm/vm_fault.c head/sys/vm/vm_param.h Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Thu Jan 23 05:05:39 2020 (r357021) +++ head/sys/vm/vm_fault.c Thu Jan 23 05:07:01 2020 (r357022) @@ -795,6 +795,57 @@ vm_fault_lookup(struct faultstate *fs) return (KERN_SUCCESS); } +static int +vm_fault_relookup(struct faultstate *fs) +{ + vm_object_t retry_object; + vm_pindex_t retry_pindex; + vm_prot_t retry_prot; + int result; + + if (!vm_map_trylock_read(fs->map)) + return (KERN_RESTART); + + fs->lookup_still_valid = true; + if (fs->map->timestamp == fs->map_generation) + return (KERN_SUCCESS); + + result = vm_map_lookup_locked(&fs->map, fs->vaddr, fs->fault_type, + &fs->entry, &retry_object, &retry_pindex, &retry_prot, + &fs->wired); + if (result != KERN_SUCCESS) { + /* + * If retry of map lookup would have blocked then + * retry fault from start. + */ + if (result == KERN_FAILURE) + return (KERN_RESTART); + return (result); + } + if (retry_object != fs->first_object || + retry_pindex != fs->first_pindex) + return (KERN_RESTART); + + /* + * Check whether the protection has changed or the object has + * been copied while we left the map unlocked. Changing from + * read to write permission is OK - we leave the page + * write-protected, and catch the write fault. Changing from + * write to read permission means that we can't mark the page + * write-enabled after all. + */ + fs->prot &= retry_prot; + fs->fault_type &= retry_prot; + if (fs->prot == 0) + return (KERN_RESTART); + + /* Reassert because wired may have changed. */ + KASSERT(fs->wired || (fs->fault_flags & VM_FAULT_WIRE) == 0, + ("!wired && VM_FAULT_WIRE")); + + return (KERN_SUCCESS); +} + /* * Wait/Retry if the page is busy. We have to do this if the page is * either exclusive or shared busy because the vm_pager may be using @@ -837,10 +888,8 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fa { struct faultstate fs; struct domainset *dset; - vm_object_t next_object, retry_object; + vm_object_t next_object; vm_offset_t e_end, e_start; - vm_pindex_t retry_pindex; - vm_prot_t retry_prot; int ahead, alloc_req, behind, cluster_offset, faultcount; int nera, oom, result, rv; u_char behavior; @@ -1363,56 +1412,12 @@ next: * lookup. */ if (!fs.lookup_still_valid) { - if (!vm_map_trylock_read(fs.map)) { + result = vm_fault_relookup(&fs); + if (result != KERN_SUCCESS) { fault_deallocate(&fs); - goto RetryFault; - } - fs.lookup_still_valid = true; - if (fs.map->timestamp != fs.map_generation) { - result = vm_map_lookup_locked(&fs.map, vaddr, fs.fault_type, - &fs.entry, &retry_object, &retry_pindex, &retry_prot, - &fs.wired); - - /* - * If we don't need the page any longer, put it on the inactive - * list (the easiest thing to do here). If no one needs it, - * pageout will grab it eventually. - */ - if (result != KERN_SUCCESS) { - fault_deallocate(&fs); - - /* - * If retry of map lookup would have blocked then - * retry fault from start. - */ - if (result == KERN_FAILURE) - goto RetryFault; - return (result); - } - if ((retry_object != fs.first_object) || - (retry_pindex != fs.first_pindex)) { - fault_deallocate(&fs); + if (result == KERN_RESTART) goto RetryFault; - } - - /* - * Check whether the protection has changed or the object has - * been copied while we left the map unlocked. Changing from - * read to write permission is OK - we leave the page - * write-protected, and catch the write fault. Changing from - * write to read permission means that we can't mark the page - * write-enabled after all. - */ - fs.prot &= retry_prot; - fs.fault_type &= retry_prot; - if (fs.prot == 0) { - fault_deallocate(&fs); - goto RetryFault; - } - - /* Reassert because wired may have changed. */ - KASSERT(fs.wired || (fs.fault_flags & VM_FAULT_WIRE) == 0, - ("!wired && VM_FAULT_WIRE")); + return (result); } } VM_OBJECT_ASSERT_UNLOCKED(fs.object); Modified: head/sys/vm/vm_param.h ============================================================================== --- head/sys/vm/vm_param.h Thu Jan 23 05:05:39 2020 (r357021) +++ head/sys/vm/vm_param.h Thu Jan 23 05:07:01 2020 (r357022) @@ -114,6 +114,7 @@ struct xswdev { #define KERN_NOT_RECEIVER 7 #define KERN_NO_ACCESS 8 #define KERN_OUT_OF_BOUNDS 9 +#define KERN_RESTART 10 #ifndef PA_LOCK_COUNT #ifdef SMP From owner-svn-src-all@freebsd.org Thu Jan 23 05:11:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E50422C861; Thu, 23 Jan 2020 05:11:02 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4839N62Ncrz45yS; Thu, 23 Jan 2020 05:11:02 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D25C96B8; Thu, 23 Jan 2020 05:11:02 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N5B2Il067330; Thu, 23 Jan 2020 05:11:02 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N5B26k067329; Thu, 23 Jan 2020 05:11:02 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001230511.00N5B26k067329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 23 Jan 2020 05:11:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357023 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 05:11:02 -0000 Author: jeff Date: Thu Jan 23 05:11:01 2020 New Revision: 357023 URL: https://svnweb.freebsd.org/changeset/base/357023 Log: (fault 4/9) Move copy-on-write into a dedicated function. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D23304 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Thu Jan 23 05:07:01 2020 (r357022) +++ head/sys/vm/vm_fault.c Thu Jan 23 05:11:01 2020 (r357023) @@ -846,6 +846,92 @@ vm_fault_relookup(struct faultstate *fs) return (KERN_SUCCESS); } +static void +vm_fault_cow(struct faultstate *fs) +{ + bool is_first_object_locked; + + /* + * This allows pages to be virtually copied from a backing_object + * into the first_object, where the backing object has no other + * refs to it, and cannot gain any more refs. Instead of a bcopy, + * we just move the page from the backing object to the first + * object. Note that we must mark the page dirty in the first + * object so that it will go out to swap when needed. + */ + is_first_object_locked = false; + if ( + /* + * Only one shadow object and no other refs. + */ + fs->object->shadow_count == 1 && fs->object->ref_count == 1 && + /* + * No other ways to look the object up + */ + fs->object->handle == NULL && (fs->object->flags & OBJ_ANON) != 0 && + /* + * We don't chase down the shadow chain and we can acquire locks. + */ + (is_first_object_locked = VM_OBJECT_TRYWLOCK(fs->first_object)) && + fs->object == fs->first_object->backing_object && + VM_OBJECT_TRYWLOCK(fs->object)) { + + /* + * Remove but keep xbusy for replace. fs->m is moved into + * fs->first_object and left busy while fs->first_m is + * conditionally freed. + */ + vm_page_remove_xbusy(fs->m); + vm_page_replace(fs->m, fs->first_object, fs->first_pindex, + fs->first_m); + vm_page_dirty(fs->m); +#if VM_NRESERVLEVEL > 0 + /* + * Rename the reservation. + */ + vm_reserv_rename(fs->m, fs->first_object, fs->object, + OFF_TO_IDX(fs->first_object->backing_object_offset)); +#endif + VM_OBJECT_WUNLOCK(fs->object); + VM_OBJECT_WUNLOCK(fs->first_object); + fs->first_m = fs->m; + fs->m = NULL; + VM_CNT_INC(v_cow_optim); + } else { + if (is_first_object_locked) + VM_OBJECT_WUNLOCK(fs->first_object); + /* + * Oh, well, lets copy it. + */ + pmap_copy_page(fs->m, fs->first_m); + vm_page_valid(fs->first_m); + if (fs->wired && (fs->fault_flags & VM_FAULT_WIRE) == 0) { + vm_page_wire(fs->first_m); + vm_page_unwire(fs->m, PQ_INACTIVE); + } + /* + * Save the cow page to be released after + * pmap_enter is complete. + */ + fs->m_cow = fs->m; + fs->m = NULL; + } + /* + * fs->object != fs->first_object due to above + * conditional + */ + vm_object_pip_wakeup(fs->object); + + /* + * Only use the new page below... + */ + fs->object = fs->first_object; + fs->pindex = fs->first_pindex; + fs->m = fs->first_m; + VM_CNT_INC(v_cow_faults); + curthread->td_cow++; +} + /* * Wait/Retry if the page is busy. We have to do this if the page is * either exclusive or shared busy because the vm_pager may be using @@ -893,7 +979,7 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fa int ahead, alloc_req, behind, cluster_offset, faultcount; int nera, oom, result, rv; u_char behavior; - bool dead, hardfault, is_first_object_locked; + bool dead, hardfault; VM_CNT_INC(v_vm_faults); @@ -1302,90 +1388,8 @@ next: * We only really need to copy if we want to write it. */ if ((fs.fault_type & (VM_PROT_COPY | VM_PROT_WRITE)) != 0) { + vm_fault_cow(&fs); /* - * This allows pages to be virtually copied from a - * backing_object into the first_object, where the - * backing object has no other refs to it, and cannot - * gain any more refs. Instead of a bcopy, we just - * move the page from the backing object to the - * first object. Note that we must mark the page - * dirty in the first object so that it will go out - * to swap when needed. - */ - is_first_object_locked = false; - if ( - /* - * Only one shadow object - */ - fs.object->shadow_count == 1 && - /* - * No COW refs, except us - */ - fs.object->ref_count == 1 && - /* - * No one else can look this object up - */ - fs.object->handle == NULL && - /* - * No other ways to look the object up - */ - (fs.object->flags & OBJ_ANON) != 0 && - (is_first_object_locked = VM_OBJECT_TRYWLOCK(fs.first_object)) && - /* - * We don't chase down the shadow chain - */ - fs.object == fs.first_object->backing_object && - VM_OBJECT_TRYWLOCK(fs.object)) { - - /* - * Remove but keep xbusy for replace. fs.m is - * moved into fs.first_object and left busy - * while fs.first_m is conditionally freed. - */ - vm_page_remove_xbusy(fs.m); - vm_page_replace(fs.m, fs.first_object, - fs.first_pindex, fs.first_m); - vm_page_dirty(fs.m); -#if VM_NRESERVLEVEL > 0 - /* - * Rename the reservation. - */ - vm_reserv_rename(fs.m, fs.first_object, - fs.object, OFF_TO_IDX( - fs.first_object->backing_object_offset)); -#endif - VM_OBJECT_WUNLOCK(fs.object); - VM_OBJECT_WUNLOCK(fs.first_object); - fs.first_m = fs.m; - fs.m = NULL; - VM_CNT_INC(v_cow_optim); - } else { - if (is_first_object_locked) - VM_OBJECT_WUNLOCK(fs.first_object); - /* - * Oh, well, lets copy it. - */ - pmap_copy_page(fs.m, fs.first_m); - vm_page_valid(fs.first_m); - if (fs.wired && (fs.fault_flags & - VM_FAULT_WIRE) == 0) { - vm_page_wire(fs.first_m); - vm_page_unwire(fs.m, PQ_INACTIVE); - } - /* - * Save the cow page to be released after - * pmap_enter is complete. - */ - fs.m_cow = fs.m; - fs.m = NULL; - } - /* - * fs.object != fs.first_object due to above - * conditional - */ - vm_object_pip_wakeup(fs.object); - - /* * We only try to prefault read-only mappings to the * neighboring pages when this copy-on-write fault is * a hard fault. In other cases, trying to prefault @@ -1394,14 +1398,6 @@ next: if (faultcount == 0) faultcount = 1; - /* - * Only use the new page below... - */ - fs.object = fs.first_object; - fs.pindex = fs.first_pindex; - fs.m = fs.first_m; - VM_CNT_INC(v_cow_faults); - curthread->td_cow++; } else { fs.prot &= ~VM_PROT_WRITE; } From owner-svn-src-all@freebsd.org Thu Jan 23 05:14:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE66122C918; Thu, 23 Jan 2020 05:14:41 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4839SK54k3z46Z0; Thu, 23 Jan 2020 05:14:41 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A53699856; Thu, 23 Jan 2020 05:14:41 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N5EfiL072371; Thu, 23 Jan 2020 05:14:41 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N5Efks072370; Thu, 23 Jan 2020 05:14:41 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001230514.00N5Efks072370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 23 Jan 2020 05:14:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357024 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357024 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 05:14:41 -0000 Author: jeff Date: Thu Jan 23 05:14:41 2020 New Revision: 357024 URL: https://svnweb.freebsd.org/changeset/base/357024 Log: (fault 5/9) Move the backing_object traversal into a dedicated function. Reviewed by: dougm, kib, markj Differential Revision: https://reviews.freebsd.org/D23310 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Thu Jan 23 05:11:01 2020 (r357023) +++ head/sys/vm/vm_fault.c Thu Jan 23 05:14:41 2020 (r357024) @@ -932,6 +932,75 @@ vm_fault_cow(struct faultstate *fs) curthread->td_cow++; } +static bool +vm_fault_next(struct faultstate *fs) +{ + vm_object_t next_object; + + /* + * The requested page does not exist at this object/ + * offset. Remove the invalid page from the object, + * waking up anyone waiting for it, and continue on to + * the next object. However, if this is the top-level + * object, we must leave the busy page in place to + * prevent another process from rushing past us, and + * inserting the page in that object at the same time + * that we are. + */ + if (fs->object == fs->first_object) { + fs->first_m = fs->m; + fs->m = NULL; + } else + fault_page_free(&fs->m); + + /* + * Move on to the next object. Lock the next object before + * unlocking the current one. + */ + VM_OBJECT_ASSERT_WLOCKED(fs->object); + next_object = fs->object->backing_object; + if (next_object == NULL) { + /* + * If there's no object left, fill the page in the top + * object with zeros. + */ + VM_OBJECT_WUNLOCK(fs->object); + if (fs->object != fs->first_object) { + vm_object_pip_wakeup(fs->object); + fs->object = fs->first_object; + fs->pindex = fs->first_pindex; + } + MPASS(fs->first_m != NULL); + MPASS(fs->m == NULL); + fs->m = fs->first_m; + fs->first_m = NULL; + + /* + * Zero the page if necessary and mark it valid. + */ + if ((fs->m->flags & PG_ZERO) == 0) { + pmap_zero_page(fs->m); + } else { + VM_CNT_INC(v_ozfod); + } + VM_CNT_INC(v_zfod); + vm_page_valid(fs->m); + + return (false); + } + MPASS(fs->first_m != NULL); + KASSERT(fs->object != next_object, ("object loop %p", next_object)); + VM_OBJECT_WLOCK(next_object); + vm_object_pip_add(next_object, 1); + if (fs->object != fs->first_object) + vm_object_pip_wakeup(fs->object); + fs->pindex += OFF_TO_IDX(fs->object->backing_object_offset); + VM_OBJECT_WUNLOCK(fs->object); + fs->object = next_object; + + return (true); +} + /* * Wait/Retry if the page is busy. We have to do this if the page is * either exclusive or shared busy because the vm_pager may be using @@ -974,7 +1043,6 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fa { struct faultstate fs; struct domainset *dset; - vm_object_t next_object; vm_offset_t e_end, e_start; int ahead, alloc_req, behind, cluster_offset, faultcount; int nera, oom, result, rv; @@ -1187,8 +1255,13 @@ readrest: * object without dropping the lock to preserve atomicity of * shadow faults. */ - if (fs.object->type == OBJT_DEFAULT) - goto next; + if (fs.object->type == OBJT_DEFAULT) { + if (vm_fault_next(&fs)) + continue; + /* Don't try to prefault neighboring pages. */ + faultcount = 1; + break; + } /* * At this point, we have either allocated a new page or found @@ -1304,70 +1377,14 @@ readrest: } -next: /* - * The requested page does not exist at this object/ - * offset. Remove the invalid page from the object, - * waking up anyone waiting for it, and continue on to - * the next object. However, if this is the top-level - * object, we must leave the busy page in place to - * prevent another process from rushing past us, and - * inserting the page in that object at the same time - * that we are. + * The page was not found in the current object. Try to traverse + * into a backing object or zero fill if none is found. */ - if (fs.object == fs.first_object) { - fs.first_m = fs.m; - fs.m = NULL; - } else - fault_page_free(&fs.m); - - /* - * Move on to the next object. Lock the next object before - * unlocking the current one. - */ - VM_OBJECT_ASSERT_WLOCKED(fs.object); - next_object = fs.object->backing_object; - if (next_object == NULL) { - /* - * If there's no object left, fill the page in the top - * object with zeros. - */ - VM_OBJECT_WUNLOCK(fs.object); - if (fs.object != fs.first_object) { - vm_object_pip_wakeup(fs.object); - fs.object = fs.first_object; - fs.pindex = fs.first_pindex; - } - MPASS(fs.first_m != NULL); - MPASS(fs.m == NULL); - fs.m = fs.first_m; - fs.first_m = NULL; - - /* - * Zero the page if necessary and mark it valid. - */ - if ((fs.m->flags & PG_ZERO) == 0) { - pmap_zero_page(fs.m); - } else { - VM_CNT_INC(v_ozfod); - } - VM_CNT_INC(v_zfod); - vm_page_valid(fs.m); + if (!vm_fault_next(&fs)) { /* Don't try to prefault neighboring pages. */ faultcount = 1; break; /* break to PAGE HAS BEEN FOUND. */ - } else { - MPASS(fs.first_m != NULL); - KASSERT(fs.object != next_object, - ("object loop %p", next_object)); - VM_OBJECT_WLOCK(next_object); - vm_object_pip_add(next_object, 1); - if (fs.object != fs.first_object) - vm_object_pip_wakeup(fs.object); - fs.pindex += - OFF_TO_IDX(fs.object->backing_object_offset); - VM_OBJECT_WUNLOCK(fs.object); - fs.object = next_object; } } From owner-svn-src-all@freebsd.org Thu Jan 23 05:18:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 769A922C9FB; Thu, 23 Jan 2020 05:18:01 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4839X92W0Nz46jp; Thu, 23 Jan 2020 05:18:01 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 514229860; Thu, 23 Jan 2020 05:18:01 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N5I1Ke072569; Thu, 23 Jan 2020 05:18:01 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N5I1l9072568; Thu, 23 Jan 2020 05:18:01 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001230518.00N5I1l9072568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 23 Jan 2020 05:18:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357025 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 05:18:01 -0000 Author: jeff Date: Thu Jan 23 05:18:00 2020 New Revision: 357025 URL: https://svnweb.freebsd.org/changeset/base/357025 Log: (fault 6/9) Move getpages and associated logic into a dedicated function. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D23311 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Thu Jan 23 05:14:41 2020 (r357024) +++ head/sys/vm/vm_fault.c Thu Jan 23 05:18:00 2020 (r357025) @@ -1001,7 +1001,96 @@ vm_fault_next(struct faultstate *fs) return (true); } + /* + * Call the pager to retrieve the page if there is a chance + * that the pager has it, and potentially retrieve additional + * pages at the same time. + */ +static int +vm_fault_getpages(struct faultstate *fs, int nera, int *behindp, int *aheadp) +{ + vm_offset_t e_end, e_start; + int ahead, behind, cluster_offset, rv; + u_char behavior; + + /* + * Prepare for unlocking the map. Save the map + * entry's start and end addresses, which are used to + * optimize the size of the pager operation below. + * Even if the map entry's addresses change after + * unlocking the map, using the saved addresses is + * safe. + */ + e_start = fs->entry->start; + e_end = fs->entry->end; + behavior = vm_map_entry_behavior(fs->entry); + + /* + * Release the map lock before locking the vnode or + * sleeping in the pager. (If the current object has + * a shadow, then an earlier iteration of this loop + * may have already unlocked the map.) + */ + unlock_map(fs); + + rv = vm_fault_lock_vnode(fs, false); + MPASS(rv == KERN_SUCCESS || rv == KERN_RESOURCE_SHORTAGE); + if (rv == KERN_RESOURCE_SHORTAGE) + return (rv); + KASSERT(fs->vp == NULL || !fs->map->system_map, + ("vm_fault: vnode-backed object mapped by system map")); + + /* + * Page in the requested page and hint the pager, + * that it may bring up surrounding pages. + */ + if (nera == -1 || behavior == MAP_ENTRY_BEHAV_RANDOM || + P_KILLED(curproc)) { + behind = 0; + ahead = 0; + } else { + /* Is this a sequential fault? */ + if (nera > 0) { + behind = 0; + ahead = nera; + } else { + /* + * Request a cluster of pages that is + * aligned to a VM_FAULT_READ_DEFAULT + * page offset boundary within the + * object. Alignment to a page offset + * boundary is more likely to coincide + * with the underlying file system + * block than alignment to a virtual + * address boundary. + */ + cluster_offset = fs->pindex % VM_FAULT_READ_DEFAULT; + behind = ulmin(cluster_offset, + atop(fs->vaddr - e_start)); + ahead = VM_FAULT_READ_DEFAULT - 1 - cluster_offset; + } + ahead = ulmin(ahead, atop(e_end - fs->vaddr) - 1); + } + *behindp = behind; + *aheadp = ahead; + rv = vm_pager_get_pages(fs->object, &fs->m, 1, behindp, aheadp); + if (rv == VM_PAGER_OK) + return (KERN_SUCCESS); + if (rv == VM_PAGER_ERROR) + printf("vm_fault: pager read error, pid %d (%s)\n", + curproc->p_pid, curproc->p_comm); + /* + * If an I/O error occurred or the requested page was + * outside the range of the pager, clean up and return + * an error. + */ + if (rv == VM_PAGER_ERROR || rv == VM_PAGER_BAD) + return (KERN_OUT_OF_BOUNDS); + return (KERN_NOT_RECEIVER); +} + +/* * Wait/Retry if the page is busy. We have to do this if the page is * either exclusive or shared busy because the vm_pager may be using * read busy for pageouts (and even pageins if it is the vnode pager), @@ -1043,10 +1132,8 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fa { struct faultstate fs; struct domainset *dset; - vm_offset_t e_end, e_start; - int ahead, alloc_req, behind, cluster_offset, faultcount; + int ahead, alloc_req, behind, faultcount; int nera, oom, result, rv; - u_char behavior; bool dead, hardfault; VM_CNT_INC(v_vm_faults); @@ -1282,104 +1369,28 @@ readrest: * have the page, the number of additional pages to read will * apply to subsequent objects in the shadow chain. */ - if (nera == -1 && !P_KILLED(curproc)) { + if (nera == -1 && !P_KILLED(curproc)) nera = vm_fault_readahead(&fs); - /* - * Prepare for unlocking the map. Save the map - * entry's start and end addresses, which are used to - * optimize the size of the pager operation below. - * Even if the map entry's addresses change after - * unlocking the map, using the saved addresses is - * safe. - */ - e_start = fs.entry->start; - e_end = fs.entry->end; - behavior = vm_map_entry_behavior(fs.entry); - } - /* - * Call the pager to retrieve the page if there is a chance - * that the pager has it, and potentially retrieve additional - * pages at the same time. - */ - if (fs.object->type != OBJT_DEFAULT) { - /* - * Release the map lock before locking the vnode or - * sleeping in the pager. (If the current object has - * a shadow, then an earlier iteration of this loop - * may have already unlocked the map.) - */ - unlock_map(&fs); - - rv = vm_fault_lock_vnode(&fs, false); - MPASS(rv == KERN_SUCCESS || - rv == KERN_RESOURCE_SHORTAGE); - if (rv == KERN_RESOURCE_SHORTAGE) - goto RetryFault; - KASSERT(fs.vp == NULL || !fs.map->system_map, - ("vm_fault: vnode-backed object mapped by system map")); - - /* - * Page in the requested page and hint the pager, - * that it may bring up surrounding pages. - */ - if (nera == -1 || behavior == MAP_ENTRY_BEHAV_RANDOM || - P_KILLED(curproc)) { - behind = 0; - ahead = 0; - } else { - /* Is this a sequential fault? */ - if (nera > 0) { - behind = 0; - ahead = nera; - } else { - /* - * Request a cluster of pages that is - * aligned to a VM_FAULT_READ_DEFAULT - * page offset boundary within the - * object. Alignment to a page offset - * boundary is more likely to coincide - * with the underlying file system - * block than alignment to a virtual - * address boundary. - */ - cluster_offset = fs.pindex % - VM_FAULT_READ_DEFAULT; - behind = ulmin(cluster_offset, - atop(vaddr - e_start)); - ahead = VM_FAULT_READ_DEFAULT - 1 - - cluster_offset; - } - ahead = ulmin(ahead, atop(e_end - vaddr) - 1); - } - rv = vm_pager_get_pages(fs.object, &fs.m, 1, - &behind, &ahead); - if (rv == VM_PAGER_OK) { - faultcount = behind + 1 + ahead; - hardfault = true; - break; /* break to PAGE HAS BEEN FOUND. */ - } - VM_OBJECT_WLOCK(fs.object); - if (rv == VM_PAGER_ERROR) - printf("vm_fault: pager read error, pid %d (%s)\n", - curproc->p_pid, curproc->p_comm); - - /* - * If an I/O error occurred or the requested page was - * outside the range of the pager, clean up and return - * an error. - */ - if (rv == VM_PAGER_ERROR || rv == VM_PAGER_BAD) { - fault_page_free(&fs.m); - unlock_and_deallocate(&fs); - return (KERN_OUT_OF_BOUNDS); - } - + rv = vm_fault_getpages(&fs, nera, &behind, &ahead); + if (rv == KERN_SUCCESS) { + faultcount = behind + 1 + ahead; + hardfault = true; + break; /* break to PAGE HAS BEEN FOUND. */ } + if (rv == KERN_RESOURCE_SHORTAGE) + goto RetryFault; + VM_OBJECT_WLOCK(fs.object); + if (rv == KERN_OUT_OF_BOUNDS) { + fault_page_free(&fs.m); + unlock_and_deallocate(&fs); + return (rv); + } /* - * The page was not found in the current object. Try to traverse - * into a backing object or zero fill if none is found. + * The page was not found in the current object. Try to + * traverse into a backing object or zero fill if none is + * found. */ if (!vm_fault_next(&fs)) { /* Don't try to prefault neighboring pages. */ From owner-svn-src-all@freebsd.org Thu Jan 23 05:19:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 19A7A22CA8A; Thu, 23 Jan 2020 05:19:40 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4839Z36zM1z46rc; Thu, 23 Jan 2020 05:19:39 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA6AE9867; Thu, 23 Jan 2020 05:19:39 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N5JdCh072680; Thu, 23 Jan 2020 05:19:39 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N5JdIG072679; Thu, 23 Jan 2020 05:19:39 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001230519.00N5JdIG072679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 23 Jan 2020 05:19:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357026 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357026 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 05:19:40 -0000 Author: jeff Date: Thu Jan 23 05:19:39 2020 New Revision: 357026 URL: https://svnweb.freebsd.org/changeset/base/357026 Log: (fault 7/9) Move fault population and allocation into a dedicated function Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D23320 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Thu Jan 23 05:18:00 2020 (r357025) +++ head/sys/vm/vm_fault.c Thu Jan 23 05:19:39 2020 (r357026) @@ -126,6 +126,7 @@ struct faultstate { vm_prot_t fault_type; vm_prot_t prot; int fault_flags; + int oom; boolean_t wired; /* Page reference for cow. */ @@ -455,7 +456,7 @@ vm_fault_populate(struct faultstate *fs) */ vm_fault_restore_map_lock(fs); if (fs->map->timestamp != fs->map_generation) - return (KERN_RESOURCE_SHORTAGE); /* RetryFault */ + return (KERN_RESTART); return (KERN_NOT_RECEIVER); } if (rv != VM_PAGER_OK) @@ -471,7 +472,7 @@ vm_fault_populate(struct faultstate *fs) if (fs->map->timestamp != fs->map_generation) { vm_fault_populate_cleanup(fs->first_object, pager_first, pager_last); - return (KERN_RESOURCE_SHORTAGE); /* RetryFault */ + return (KERN_RESTART); } /* @@ -1001,7 +1002,87 @@ vm_fault_next(struct faultstate *fs) return (true); } +/* + * Allocate a page directly or via the object populate method. + */ +static int +vm_fault_allocate(struct faultstate *fs) +{ + struct domainset *dset; + int alloc_req; + int rv; + + if ((fs->object->flags & OBJ_SIZEVNLOCK) != 0) { + rv = vm_fault_lock_vnode(fs, true); + MPASS(rv == KERN_SUCCESS || rv == KERN_RESOURCE_SHORTAGE); + if (rv == KERN_RESOURCE_SHORTAGE) + return (rv); + } + + if (fs->pindex >= fs->object->size) + return (KERN_OUT_OF_BOUNDS); + + if (fs->object == fs->first_object && + (fs->first_object->flags & OBJ_POPULATE) != 0 && + fs->first_object->shadow_count == 0) { + rv = vm_fault_populate(fs); + switch (rv) { + case KERN_SUCCESS: + case KERN_FAILURE: + case KERN_RESTART: + return (rv); + case KERN_NOT_RECEIVER: + /* + * Pager's populate() method + * returned VM_PAGER_BAD. + */ + break; + default: + panic("inconsistent return codes"); + } + } + + /* + * Allocate a new page for this object/offset pair. + * + * Unlocked read of the p_flag is harmless. At worst, the P_KILLED + * might be not observed there, and allocation can fail, causing + * restart and new reading of the p_flag. + */ + dset = fs->object->domain.dr_policy; + if (dset == NULL) + dset = curthread->td_domain.dr_policy; + if (!vm_page_count_severe_set(&dset->ds_mask) || P_KILLED(curproc)) { +#if VM_NRESERVLEVEL > 0 + vm_object_color(fs->object, atop(fs->vaddr) - fs->pindex); +#endif + alloc_req = P_KILLED(curproc) ? + VM_ALLOC_SYSTEM : VM_ALLOC_NORMAL; + if (fs->object->type != OBJT_VNODE && + fs->object->backing_object == NULL) + alloc_req |= VM_ALLOC_ZERO; + fs->m = vm_page_alloc(fs->object, fs->pindex, alloc_req); + } + if (fs->m == NULL) { + unlock_and_deallocate(fs); + if (vm_pfault_oom_attempts < 0 || + fs->oom < vm_pfault_oom_attempts) { + fs->oom++; + vm_waitpfault(dset, vm_pfault_oom_wait * hz); + } + if (bootverbose) + printf( +"proc %d (%s) failed to alloc page on fault, starting OOM\n", + curproc->p_pid, curproc->p_comm); + vm_pageout_oom(VM_OOM_MEM_PF); + return (KERN_RESOURCE_SHORTAGE); + } + fs->oom = 0; + + return (KERN_NOT_RECEIVER); +} + /* * Call the pager to retrieve the page if there is a chance * that the pager has it, and potentially retrieve additional @@ -1131,9 +1212,8 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fa int fault_flags, vm_page_t *m_hold) { struct faultstate fs; - struct domainset *dset; - int ahead, alloc_req, behind, faultcount; - int nera, oom, result, rv; + int ahead, behind, faultcount; + int nera, result, rv; bool dead, hardfault; VM_CNT_INC(v_vm_faults); @@ -1147,13 +1227,12 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fa fs.fault_flags = fault_flags; fs.map = map; fs.lookup_still_valid = false; + fs.oom = 0; faultcount = 0; nera = -1; hardfault = false; RetryFault: - oom = 0; -RetryFault_oom: fs.fault_type = fault_type; /* @@ -1237,16 +1316,14 @@ RetryFault_oom: /* * The page is marked busy for other processes and the - * pagedaemon. If it still isn't completely valid - * (readable), jump to readrest, else break-out ( we - * found the page ). + * pagedaemon. If it still is completely valid we + * are done. */ - if (!vm_page_all_valid(fs.m)) - goto readrest; - VM_OBJECT_WUNLOCK(fs.object); - break; /* break to PAGE HAS BEEN FOUND. */ + if (vm_page_all_valid(fs.m)) { + VM_OBJECT_WUNLOCK(fs.object); + break; /* break to PAGE HAS BEEN FOUND. */ + } } - KASSERT(fs.m == NULL, ("fs.m should be NULL, not %p", fs.m)); VM_OBJECT_ASSERT_WLOCKED(fs.object); /* @@ -1255,87 +1332,27 @@ RetryFault_oom: * page. (Default objects are zero-fill, so there is no real * pager for them.) */ - if (fs.object->type != OBJT_DEFAULT || - fs.object == fs.first_object) { - if ((fs.object->flags & OBJ_SIZEVNLOCK) != 0) { - rv = vm_fault_lock_vnode(&fs, true); - MPASS(rv == KERN_SUCCESS || - rv == KERN_RESOURCE_SHORTAGE); - if (rv == KERN_RESOURCE_SHORTAGE) - goto RetryFault; - } - if (fs.pindex >= fs.object->size) { + if (fs.m == NULL && (fs.object->type != OBJT_DEFAULT || + fs.object == fs.first_object)) { + rv = vm_fault_allocate(&fs); + switch (rv) { + case KERN_RESTART: unlock_and_deallocate(&fs); - return (KERN_OUT_OF_BOUNDS); - } - - if (fs.object == fs.first_object && - (fs.first_object->flags & OBJ_POPULATE) != 0 && - fs.first_object->shadow_count == 0) { - rv = vm_fault_populate(&fs); - switch (rv) { - case KERN_SUCCESS: - case KERN_FAILURE: - unlock_and_deallocate(&fs); - return (rv); - case KERN_RESOURCE_SHORTAGE: - unlock_and_deallocate(&fs); - goto RetryFault; - case KERN_NOT_RECEIVER: - /* - * Pager's populate() method - * returned VM_PAGER_BAD. - */ - break; - default: - panic("inconsistent return codes"); - } - } - - /* - * Allocate a new page for this object/offset pair. - * - * Unlocked read of the p_flag is harmless. At - * worst, the P_KILLED might be not observed - * there, and allocation can fail, causing - * restart and new reading of the p_flag. - */ - dset = fs.object->domain.dr_policy; - if (dset == NULL) - dset = curthread->td_domain.dr_policy; - if (!vm_page_count_severe_set(&dset->ds_mask) || - P_KILLED(curproc)) { -#if VM_NRESERVLEVEL > 0 - vm_object_color(fs.object, atop(vaddr) - - fs.pindex); -#endif - alloc_req = P_KILLED(curproc) ? - VM_ALLOC_SYSTEM : VM_ALLOC_NORMAL; - if (fs.object->type != OBJT_VNODE && - fs.object->backing_object == NULL) - alloc_req |= VM_ALLOC_ZERO; - fs.m = vm_page_alloc(fs.object, fs.pindex, - alloc_req); - } - if (fs.m == NULL) { - unlock_and_deallocate(&fs); - if (vm_pfault_oom_attempts < 0 || - oom < vm_pfault_oom_attempts) { - oom++; - vm_waitpfault(dset, - vm_pfault_oom_wait * hz); - goto RetryFault_oom; - } - if (bootverbose) - printf( - "proc %d (%s) failed to alloc page on fault, starting OOM\n", - curproc->p_pid, curproc->p_comm); - vm_pageout_oom(VM_OOM_MEM_PF); + /* FALLTHROUGH */ + case KERN_RESOURCE_SHORTAGE: goto RetryFault; + case KERN_SUCCESS: + case KERN_FAILURE: + case KERN_OUT_OF_BOUNDS: + unlock_and_deallocate(&fs); + return (rv); + case KERN_NOT_RECEIVER: + break; + default: + panic("vm_fault: Unhandled rv %d", rv); } } -readrest: /* * Default objects have no pager so no exclusive busy exists * to protect this page in the chain. Skip to the next From owner-svn-src-all@freebsd.org Thu Jan 23 05:22:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E68D22CD6E; Thu, 23 Jan 2020 05:22:03 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4839cp6ft9z47Dg; Thu, 23 Jan 2020 05:22:02 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFEE69A07; Thu, 23 Jan 2020 05:22:02 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N5M2di074521; Thu, 23 Jan 2020 05:22:02 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N5M2qm074520; Thu, 23 Jan 2020 05:22:02 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001230522.00N5M2qm074520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 23 Jan 2020 05:22:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357027 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357027 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 05:22:03 -0000 Author: jeff Date: Thu Jan 23 05:22:02 2020 New Revision: 357027 URL: https://svnweb.freebsd.org/changeset/base/357027 Log: (fault 8/9) Restructure some code to reduce duplication and simplify flow control. Reviewed by: dougm, kib, markj Differential Revision: https://reviews.freebsd.org/D23321 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Thu Jan 23 05:19:39 2020 (r357026) +++ head/sys/vm/vm_fault.c Thu Jan 23 05:22:02 2020 (r357027) @@ -1359,49 +1359,47 @@ RetryFault: * object without dropping the lock to preserve atomicity of * shadow faults. */ - if (fs.object->type == OBJT_DEFAULT) { - if (vm_fault_next(&fs)) - continue; - /* Don't try to prefault neighboring pages. */ - faultcount = 1; - break; - } + if (fs.object->type != OBJT_DEFAULT) { + /* + * At this point, we have either allocated a new page + * or found an existing page that is only partially + * valid. + * + * We hold a reference on the current object and the + * page is exclusive busied. The exclusive busy + * prevents simultaneous faults and collapses while + * the object lock is dropped. + */ + VM_OBJECT_WUNLOCK(fs.object); - /* - * At this point, we have either allocated a new page or found - * an existing page that is only partially valid. - * - * We hold a reference on the current object and the page is - * exclusive busied. The exclusive busy prevents simultaneous - * faults and collapses while the object lock is dropped. - */ - VM_OBJECT_WUNLOCK(fs.object); + /* + * If the pager for the current object might have + * the page, then determine the number of additional + * pages to read and potentially reprioritize + * previously read pages for earlier reclamation. + * These operations should only be performed once per + * page fault. Even if the current pager doesn't + * have the page, the number of additional pages to + * read will apply to subsequent objects in the + * shadow chain. + */ + if (nera == -1 && !P_KILLED(curproc)) + nera = vm_fault_readahead(&fs); - /* - * If the pager for the current object might have the page, - * then determine the number of additional pages to read and - * potentially reprioritize previously read pages for earlier - * reclamation. These operations should only be performed - * once per page fault. Even if the current pager doesn't - * have the page, the number of additional pages to read will - * apply to subsequent objects in the shadow chain. - */ - if (nera == -1 && !P_KILLED(curproc)) - nera = vm_fault_readahead(&fs); - - rv = vm_fault_getpages(&fs, nera, &behind, &ahead); - if (rv == KERN_SUCCESS) { - faultcount = behind + 1 + ahead; - hardfault = true; - break; /* break to PAGE HAS BEEN FOUND. */ - } - if (rv == KERN_RESOURCE_SHORTAGE) - goto RetryFault; - VM_OBJECT_WLOCK(fs.object); - if (rv == KERN_OUT_OF_BOUNDS) { - fault_page_free(&fs.m); - unlock_and_deallocate(&fs); - return (rv); + rv = vm_fault_getpages(&fs, nera, &behind, &ahead); + if (rv == KERN_SUCCESS) { + faultcount = behind + 1 + ahead; + hardfault = true; + break; /* break to PAGE HAS BEEN FOUND. */ + } + if (rv == KERN_RESOURCE_SHORTAGE) + goto RetryFault; + VM_OBJECT_WLOCK(fs.object); + if (rv == KERN_OUT_OF_BOUNDS) { + fault_page_free(&fs.m); + unlock_and_deallocate(&fs); + return (rv); + } } /* From owner-svn-src-all@freebsd.org Thu Jan 23 05:23:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2C9322CE36; Thu, 23 Jan 2020 05:23:37 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4839fd4jx3z47TB; Thu, 23 Jan 2020 05:23:37 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82FEF9A3A; Thu, 23 Jan 2020 05:23:37 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N5Nbq0078487; Thu, 23 Jan 2020 05:23:37 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N5NbbB078486; Thu, 23 Jan 2020 05:23:37 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <202001230523.00N5NbbB078486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 23 Jan 2020 05:23:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357028 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 05:23:37 -0000 Author: jeff Date: Thu Jan 23 05:23:37 2020 New Revision: 357028 URL: https://svnweb.freebsd.org/changeset/base/357028 Log: (fault 9/9) Move zero fill into a dedicated function to make the object lock state more clear. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D23326 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Thu Jan 23 05:22:02 2020 (r357027) +++ head/sys/vm/vm_fault.c Thu Jan 23 05:23:37 2020 (r357028) @@ -960,35 +960,8 @@ vm_fault_next(struct faultstate *fs) */ VM_OBJECT_ASSERT_WLOCKED(fs->object); next_object = fs->object->backing_object; - if (next_object == NULL) { - /* - * If there's no object left, fill the page in the top - * object with zeros. - */ - VM_OBJECT_WUNLOCK(fs->object); - if (fs->object != fs->first_object) { - vm_object_pip_wakeup(fs->object); - fs->object = fs->first_object; - fs->pindex = fs->first_pindex; - } - MPASS(fs->first_m != NULL); - MPASS(fs->m == NULL); - fs->m = fs->first_m; - fs->first_m = NULL; - - /* - * Zero the page if necessary and mark it valid. - */ - if ((fs->m->flags & PG_ZERO) == 0) { - pmap_zero_page(fs->m); - } else { - VM_CNT_INC(v_ozfod); - } - VM_CNT_INC(v_zfod); - vm_page_valid(fs->m); - + if (next_object == NULL) return (false); - } MPASS(fs->first_m != NULL); KASSERT(fs->object != next_object, ("object loop %p", next_object)); VM_OBJECT_WLOCK(next_object); @@ -1002,6 +975,36 @@ vm_fault_next(struct faultstate *fs) return (true); } +static void +vm_fault_zerofill(struct faultstate *fs) +{ + + /* + * If there's no object left, fill the page in the top + * object with zeros. + */ + if (fs->object != fs->first_object) { + vm_object_pip_wakeup(fs->object); + fs->object = fs->first_object; + fs->pindex = fs->first_pindex; + } + MPASS(fs->first_m != NULL); + MPASS(fs->m == NULL); + fs->m = fs->first_m; + fs->first_m = NULL; + + /* + * Zero the page if necessary and mark it valid. + */ + if ((fs->m->flags & PG_ZERO) == 0) { + pmap_zero_page(fs->m); + } else { + VM_CNT_INC(v_ozfod); + } + VM_CNT_INC(v_zfod); + vm_page_valid(fs->m); +} + /* * Allocate a page directly or via the object populate method. */ @@ -1407,11 +1410,13 @@ RetryFault: * traverse into a backing object or zero fill if none is * found. */ - if (!vm_fault_next(&fs)) { - /* Don't try to prefault neighboring pages. */ - faultcount = 1; - break; /* break to PAGE HAS BEEN FOUND. */ - } + if (vm_fault_next(&fs)) + continue; + VM_OBJECT_WUNLOCK(fs.object); + vm_fault_zerofill(&fs); + /* Don't try to prefault neighboring pages. */ + faultcount = 1; + break; /* break to PAGE HAS BEEN FOUND. */ } /* From owner-svn-src-all@freebsd.org Thu Jan 23 05:33:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5699A22D09B for ; Thu, 23 Jan 2020 05:33:06 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) (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 4839sX6pMTz47tk for ; Thu, 23 Jan 2020 05:33:04 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by mail-pg1-x534.google.com with SMTP id k3so786023pgc.3 for ; Wed, 22 Jan 2020 21:33:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jroberson-net.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=/qtKt17DgkBpWycOZQHUC1QnyjioF5ja76AXOKyO+R8=; b=lA84rbtTTTAeBrK1V/1MuyLP3PyQOAseqK+dp8JjNSjOVhruTBU/yN97UbcosVHrgA VSwyBb1bJhyel58axotmIfd4jOn2XnFeaa5iOVwzSYjTYn3YgYuywaGwq5Po0/ZmPTdW LiM2mnQOZjBHGQyKSo4f6ApvOvANHQx8E4Mn4CLzUo+PLmrzdp7v4Zkm7bCxTAFgbN3I PjLaloxcWUKgBJ7B8RBsrpruGijJ8/q5MYrrkl8yB8PcHLvxYWQx2OhC9isdcju3Wsy2 iIOH6blu97egQQdVOGLs9a2MRJshktrkUiPesOcLDob5HiRNLsYAszF+NvAWT5xi1uhd Ahsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=/qtKt17DgkBpWycOZQHUC1QnyjioF5ja76AXOKyO+R8=; b=QIAMp+n+LN21YvTpXSm1I49UAtd0wDkx6iR+MKTsAI6hWuwc4dM4QRlV1JIKPttp1S IVYNf2zr/J0JeZXgoaUTkbFhOrhoJGYbcL5KqWlcEv2Le2/1BGy0x26F/5dD4Pc9c7Yh e5qTA/bUFzblhby6UlM4EOFrO3pgVJ5YsV8XfI24uKUv+h5j1IKXATnyZP8nSFOsImgt IFw1S7NPhIL/SxobbVFfIRKVq8FUgwbjuanlPi33CIv/yRAGOgrUXXI6DTbH2x0ROPPw YOuKmHqKLR2/gHrkwsK42Tqibw6mHJSaZ0x3DezGN7lOxUCWQu6E9q1uPLam2kDCADy/ QBIQ== X-Gm-Message-State: APjAAAWHfiBUdWAGoCsRODZcQfgwml17ofX6N0zCC2q3NvDH/SsEE9KQ T4eSVcSyN1naWaEestRbzhRhiQ== X-Google-Smtp-Source: APXvYqx2pPZEfzxGwp4NVHSdeEp8Acb9zYktHMVitOT6mRM7iFYroYjPptTm+mP1XnW0o87vl1GtcQ== X-Received: by 2002:a63:d442:: with SMTP id i2mr2209030pgj.349.1579757582984; Wed, 22 Jan 2020 21:33:02 -0800 (PST) Received: from rrcs-76-81-105-82.west.biz.rr.com (rrcs-76-81-105-82.west.biz.rr.com. [76.81.105.82]) by smtp.gmail.com with ESMTPSA id v4sm950998pgo.63.2020.01.22.21.33.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jan 2020 21:33:02 -0800 (PST) Date: Wed, 22 Jan 2020 19:33:00 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Jeff Roberson cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357028 - head/sys/vm In-Reply-To: <202001230523.00N5NbbB078486@repo.freebsd.org> Message-ID: References: <202001230523.00N5NbbB078486@repo.freebsd.org> User-Agent: Alpine 2.21.9999 (BSF 287 2018-06-16) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 4839sX6pMTz47tk X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=jroberson-net.20150623.gappssmtp.com header.s=20150623 header.b=lA84rbtT; dmarc=none; spf=none (mx1.freebsd.org: domain of jroberson@jroberson.net has no SPF policy when checking 2607:f8b0:4864:20::534) smtp.mailfrom=jroberson@jroberson.net X-Spamd-Result: default: False [-4.37 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[jroberson-net.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[jroberson.net]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[jroberson-net.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[4.3.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-2.57)[ip: (-8.93), ipnet: 2607:f8b0::/32(-2.07), asn: 15169(-1.82), country: US(-0.05)] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 05:33:06 -0000 You may be asking yourself, why did jeff just squish a bunch of code around with little functional change. I could not justify adding more complexity to a 900 line function with a handful of gotos. It is ~300 lines now. I tested the whole set together. I apologize if there are bugs. Other than comment cleanup, I will probably not commit again for a little while. The commits that follow will enable lockless vm object lookup which has given a 10x improvement in massively parallel builds on large machines (100core+). Thanks, Jeff On Thu, 23 Jan 2020, Jeff Roberson wrote: > Author: jeff > Date: Thu Jan 23 05:23:37 2020 > New Revision: 357028 > URL: https://svnweb.freebsd.org/changeset/base/357028 > > Log: > (fault 9/9) Move zero fill into a dedicated function to make the object lock > state more clear. > > Reviewed by: kib > Differential Revision: https://reviews.freebsd.org/D23326 > > Modified: > head/sys/vm/vm_fault.c > > Modified: head/sys/vm/vm_fault.c > ============================================================================== > --- head/sys/vm/vm_fault.c Thu Jan 23 05:22:02 2020 (r357027) > +++ head/sys/vm/vm_fault.c Thu Jan 23 05:23:37 2020 (r357028) > @@ -960,35 +960,8 @@ vm_fault_next(struct faultstate *fs) > */ > VM_OBJECT_ASSERT_WLOCKED(fs->object); > next_object = fs->object->backing_object; > - if (next_object == NULL) { > - /* > - * If there's no object left, fill the page in the top > - * object with zeros. > - */ > - VM_OBJECT_WUNLOCK(fs->object); > - if (fs->object != fs->first_object) { > - vm_object_pip_wakeup(fs->object); > - fs->object = fs->first_object; > - fs->pindex = fs->first_pindex; > - } > - MPASS(fs->first_m != NULL); > - MPASS(fs->m == NULL); > - fs->m = fs->first_m; > - fs->first_m = NULL; > - > - /* > - * Zero the page if necessary and mark it valid. > - */ > - if ((fs->m->flags & PG_ZERO) == 0) { > - pmap_zero_page(fs->m); > - } else { > - VM_CNT_INC(v_ozfod); > - } > - VM_CNT_INC(v_zfod); > - vm_page_valid(fs->m); > - > + if (next_object == NULL) > return (false); > - } > MPASS(fs->first_m != NULL); > KASSERT(fs->object != next_object, ("object loop %p", next_object)); > VM_OBJECT_WLOCK(next_object); > @@ -1002,6 +975,36 @@ vm_fault_next(struct faultstate *fs) > return (true); > } > > +static void > +vm_fault_zerofill(struct faultstate *fs) > +{ > + > + /* > + * If there's no object left, fill the page in the top > + * object with zeros. > + */ > + if (fs->object != fs->first_object) { > + vm_object_pip_wakeup(fs->object); > + fs->object = fs->first_object; > + fs->pindex = fs->first_pindex; > + } > + MPASS(fs->first_m != NULL); > + MPASS(fs->m == NULL); > + fs->m = fs->first_m; > + fs->first_m = NULL; > + > + /* > + * Zero the page if necessary and mark it valid. > + */ > + if ((fs->m->flags & PG_ZERO) == 0) { > + pmap_zero_page(fs->m); > + } else { > + VM_CNT_INC(v_ozfod); > + } > + VM_CNT_INC(v_zfod); > + vm_page_valid(fs->m); > +} > + > /* > * Allocate a page directly or via the object populate method. > */ > @@ -1407,11 +1410,13 @@ RetryFault: > * traverse into a backing object or zero fill if none is > * found. > */ > - if (!vm_fault_next(&fs)) { > - /* Don't try to prefault neighboring pages. */ > - faultcount = 1; > - break; /* break to PAGE HAS BEEN FOUND. */ > - } > + if (vm_fault_next(&fs)) > + continue; > + VM_OBJECT_WUNLOCK(fs.object); > + vm_fault_zerofill(&fs); > + /* Don't try to prefault neighboring pages. */ > + faultcount = 1; > + break; /* break to PAGE HAS BEEN FOUND. */ > } > > /* > From owner-svn-src-all@freebsd.org Thu Jan 23 06:02:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AADCC22DB07; Thu, 23 Jan 2020 06:02:53 +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 483BWx43JMz49Pk; Thu, 23 Jan 2020 06:02:53 +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 8650FA168; Thu, 23 Jan 2020 06:02:53 +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 00N62reL002531; Thu, 23 Jan 2020 06:02:53 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N62rfL002530; Thu, 23 Jan 2020 06:02:53 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <202001230602.00N62rfL002530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 23 Jan 2020 06:02:53 +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: r357029 - stable/12/sys/ufs/ffs X-SVN-Group: stable-12 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/12/sys/ufs/ffs X-SVN-Commit-Revision: 357029 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 06:02:53 -0000 Author: mckusick Date: Thu Jan 23 06:02:52 2020 New Revision: 357029 URL: https://svnweb.freebsd.org/changeset/base/357029 Log: MFC of 356739 Optimize quota sync'ing Modified: stable/12/sys/ufs/ffs/ffs_vfsops.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- stable/12/sys/ufs/ffs/ffs_vfsops.c Thu Jan 23 05:23:37 2020 (r357028) +++ stable/12/sys/ufs/ffs/ffs_vfsops.c Thu Jan 23 06:02:52 2020 (r357029) @@ -1457,8 +1457,12 @@ ffs_sync_lazy(mp) allerror = 0; td = curthread; - if ((mp->mnt_flag & MNT_NOATIME) != 0) - goto qupdate; + if ((mp->mnt_flag & MNT_NOATIME) != 0) { +#ifdef QUOTA + qsync(mp); +#endif + goto sbupdate; + } MNT_VNODE_FOREACH_ACTIVE(vp, mp, mvp) { if (vp->v_type == VNON) { VI_UNLOCK(vp); @@ -1480,18 +1484,16 @@ ffs_sync_lazy(mp) if ((error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, td)) != 0) continue; +#ifdef QUOTA + qsyncvp(vp); +#endif if (sync_doupdate(ip)) error = ffs_update(vp, 0); if (error != 0) allerror = error; vput(vp); } - -qupdate: -#ifdef QUOTA - qsync(mp); -#endif - +sbupdate: if (VFSTOUFS(mp)->um_fs->fs_fmod != 0 && (error = ffs_sbupdate(VFSTOUFS(mp), MNT_LAZY, 0)) != 0) allerror = error; @@ -1584,6 +1586,9 @@ loop: } continue; } +#ifdef QUOTA + qsyncvp(vp); +#endif if ((error = ffs_syncvnode(vp, waitfor, 0)) != 0) allerror = error; vput(vp); @@ -1598,9 +1603,6 @@ loop: if (allerror == 0 && count) goto loop; } -#ifdef QUOTA - qsync(mp); -#endif devvp = ump->um_devvp; bo = &devvp->v_bufobj; From owner-svn-src-all@freebsd.org Thu Jan 23 06:06:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A00B22DBFA; Thu, 23 Jan 2020 06:06:33 +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 483Bc91nGFz49ZF; Thu, 23 Jan 2020 06:06:33 +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 33D9CA169; Thu, 23 Jan 2020 06:06:33 +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 00N66Ww0002744; Thu, 23 Jan 2020 06:06:32 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N66W50002743; Thu, 23 Jan 2020 06:06:32 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <202001230606.00N66W50002743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 23 Jan 2020 06:06: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: r357030 - stable/11/sys/ufs/ffs X-SVN-Group: stable-11 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/11/sys/ufs/ffs X-SVN-Commit-Revision: 357030 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 06:06:33 -0000 Author: mckusick Date: Thu Jan 23 06:06:32 2020 New Revision: 357030 URL: https://svnweb.freebsd.org/changeset/base/357030 Log: MFC of 356739 Optimize quota sync'ing Modified: stable/11/sys/ufs/ffs/ffs_vfsops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_vfsops.c Thu Jan 23 06:02:52 2020 (r357029) +++ stable/11/sys/ufs/ffs/ffs_vfsops.c Thu Jan 23 06:06:32 2020 (r357030) @@ -1483,8 +1483,12 @@ ffs_sync_lazy(mp) allerror = 0; td = curthread; - if ((mp->mnt_flag & MNT_NOATIME) != 0) - goto qupdate; + if ((mp->mnt_flag & MNT_NOATIME) != 0) { +#ifdef QUOTA + qsync(mp); +#endif + goto sbupdate; + } MNT_VNODE_FOREACH_ACTIVE(vp, mp, mvp) { if (vp->v_type == VNON) { VI_UNLOCK(vp); @@ -1506,18 +1510,16 @@ ffs_sync_lazy(mp) if ((error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, td)) != 0) continue; +#ifdef QUOTA + qsyncvp(vp); +#endif if (sync_doupdate(ip)) error = ffs_update(vp, 0); if (error != 0) allerror = error; vput(vp); } - -qupdate: -#ifdef QUOTA - qsync(mp); -#endif - +sbupdate: if (VFSTOUFS(mp)->um_fs->fs_fmod != 0 && (error = ffs_sbupdate(VFSTOUFS(mp), MNT_LAZY, 0)) != 0) allerror = error; @@ -1610,6 +1612,9 @@ loop: } continue; } +#ifdef QUOTA + qsyncvp(vp); +#endif if ((error = ffs_syncvnode(vp, waitfor, 0)) != 0) allerror = error; vput(vp); @@ -1624,9 +1629,6 @@ loop: if (allerror == 0 && count) goto loop; } -#ifdef QUOTA - qsync(mp); -#endif devvp = ump->um_devvp; bo = &devvp->v_bufobj; From owner-svn-src-all@freebsd.org Thu Jan 23 06:11:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0FA322DE61; Thu, 23 Jan 2020 06:11:25 +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 483Bjn69k9z49xX; Thu, 23 Jan 2020 06:11:25 +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 CECA6A2CF; Thu, 23 Jan 2020 06:11:25 +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 00N6BPl5005248; Thu, 23 Jan 2020 06:11:25 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N6BPvQ005247; Thu, 23 Jan 2020 06:11:25 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <202001230611.00N6BPvQ005247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 23 Jan 2020 06:11: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: r357031 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 357031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 06:11:26 -0000 Author: mckusick Date: Thu Jan 23 06:11:25 2020 New Revision: 357031 URL: https://svnweb.freebsd.org/changeset/base/357031 Log: MFC of 356763 Remove call to VFS_SYNC() to avoid unmount livelock Modified: stable/12/sys/kern/vfs_mount.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/vfs_mount.c ============================================================================== --- stable/12/sys/kern/vfs_mount.c Thu Jan 23 06:06:32 2020 (r357030) +++ stable/12/sys/kern/vfs_mount.c Thu Jan 23 06:11:25 2020 (r357031) @@ -1438,9 +1438,7 @@ dounmount(struct mount *mp, int flags, struct thread * MNT_IUNLOCK(mp); cache_purgevfs(mp, false); /* remove cache entries for this file sys */ vfs_deallocate_syncvnode(mp); - if ((mp->mnt_flag & MNT_RDONLY) != 0 || (flags & MNT_FORCE) != 0 || - (error = VFS_SYNC(mp, MNT_WAIT)) == 0) - error = VFS_UNMOUNT(mp, flags); + error = VFS_UNMOUNT(mp, flags); vn_finished_write(mp); /* * If we failed to flush the dirty blocks for this mount point, From owner-svn-src-all@freebsd.org Thu Jan 23 06:18:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB21722DFC8; Thu, 23 Jan 2020 06:18:08 +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 483BsX44Rkz4BB9; Thu, 23 Jan 2020 06:18:08 +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 86F62A32E; Thu, 23 Jan 2020 06:18:08 +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 00N6I8x7008565; Thu, 23 Jan 2020 06:18:08 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N6I80e008564; Thu, 23 Jan 2020 06:18:08 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <202001230618.00N6I80e008564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 23 Jan 2020 06:18: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: r357032 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 357032 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 06:18:08 -0000 Author: mckusick Date: Thu Jan 23 06:18:08 2020 New Revision: 357032 URL: https://svnweb.freebsd.org/changeset/base/357032 Log: MFC of 356763 Remove call to VFS_SYNC() to avoid unmount livelock Modified: stable/11/sys/kern/vfs_mount.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_mount.c ============================================================================== --- stable/11/sys/kern/vfs_mount.c Thu Jan 23 06:11:25 2020 (r357031) +++ stable/11/sys/kern/vfs_mount.c Thu Jan 23 06:18:08 2020 (r357032) @@ -1435,9 +1435,7 @@ dounmount(struct mount *mp, int flags, struct thread * } vput(fsrootvp); } - if ((mp->mnt_flag & MNT_RDONLY) != 0 || (flags & MNT_FORCE) != 0 || - (error = VFS_SYNC(mp, MNT_WAIT)) == 0) - error = VFS_UNMOUNT(mp, flags); + error = VFS_UNMOUNT(mp, flags); vn_finished_write(mp); /* * If we failed to flush the dirty blocks for this mount point, From owner-svn-src-all@freebsd.org Thu Jan 23 06:20:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A9E722E0C2; Thu, 23 Jan 2020 06:20: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 483Bwp2FBpz4BRp; Thu, 23 Jan 2020 06:20: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 48538A47B; Thu, 23 Jan 2020 06:20:58 +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 00N6KwwJ012181; Thu, 23 Jan 2020 06:20:58 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N6Kwbc012180; Thu, 23 Jan 2020 06:20:58 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <202001230620.00N6Kwbc012180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 23 Jan 2020 06:20: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: r357033 - stable/12/sys/ufs/ffs X-SVN-Group: stable-12 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/12/sys/ufs/ffs X-SVN-Commit-Revision: 357033 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 06:20:58 -0000 Author: mckusick Date: Thu Jan 23 06:20:57 2020 New Revision: 357033 URL: https://svnweb.freebsd.org/changeset/base/357033 Log: MFC of 356714 Fix DIRCHG panic Modified: stable/12/sys/ufs/ffs/ffs_softdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/12/sys/ufs/ffs/ffs_softdep.c Thu Jan 23 06:18:08 2020 (r357032) +++ stable/12/sys/ufs/ffs/ffs_softdep.c Thu Jan 23 06:20:57 2020 (r357033) @@ -9821,14 +9821,20 @@ handle_workitem_remove(dirrem, flags) /* * Move all dependencies waiting on the remove to complete * from the dirrem to the inode inowait list to be completed - * after the inode has been updated and written to disk. Any - * marked MKDIR_PARENT are saved to be completed when the .. ref - * is removed. + * after the inode has been updated and written to disk. + * + * Any marked MKDIR_PARENT are saved to be completed when the + * dotdot ref is removed unless DIRCHG is specified. For + * directory change operations there will be no further + * directory writes and the jsegdeps need to be moved along + * with the rest to be completed when the inode is free or + * stable in the inode free list. */ LIST_INIT(&dotdotwk); while ((wk = LIST_FIRST(&dirrem->dm_jwork)) != NULL) { WORKLIST_REMOVE(wk); - if (wk->wk_state & MKDIR_PARENT) { + if ((dirrem->dm_state & DIRCHG) == 0 && + wk->wk_state & MKDIR_PARENT) { wk->wk_state &= ~MKDIR_PARENT; WORKLIST_INSERT(&dotdotwk, wk); continue; From owner-svn-src-all@freebsd.org Thu Jan 23 06:24:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A3C222E36A; Thu, 23 Jan 2020 06:24:12 +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 483C0X2cqGz4Bgk; Thu, 23 Jan 2020 06:24:12 +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 55165A509; Thu, 23 Jan 2020 06:24:12 +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 00N6OCm0014536; Thu, 23 Jan 2020 06:24:12 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N6OCXB014535; Thu, 23 Jan 2020 06:24:12 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <202001230624.00N6OCXB014535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 23 Jan 2020 06:24:12 +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: r357034 - stable/11/sys/ufs/ffs X-SVN-Group: stable-11 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/11/sys/ufs/ffs X-SVN-Commit-Revision: 357034 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 06:24:12 -0000 Author: mckusick Date: Thu Jan 23 06:24:11 2020 New Revision: 357034 URL: https://svnweb.freebsd.org/changeset/base/357034 Log: MFC of 356714 Fix DIRCHG panic Modified: stable/11/sys/ufs/ffs/ffs_softdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_softdep.c Thu Jan 23 06:20:57 2020 (r357033) +++ stable/11/sys/ufs/ffs/ffs_softdep.c Thu Jan 23 06:24:11 2020 (r357034) @@ -9776,14 +9776,20 @@ handle_workitem_remove(dirrem, flags) /* * Move all dependencies waiting on the remove to complete * from the dirrem to the inode inowait list to be completed - * after the inode has been updated and written to disk. Any - * marked MKDIR_PARENT are saved to be completed when the .. ref - * is removed. + * after the inode has been updated and written to disk. + * + * Any marked MKDIR_PARENT are saved to be completed when the + * dotdot ref is removed unless DIRCHG is specified. For + * directory change operations there will be no further + * directory writes and the jsegdeps need to be moved along + * with the rest to be completed when the inode is free or + * stable in the inode free list. */ LIST_INIT(&dotdotwk); while ((wk = LIST_FIRST(&dirrem->dm_jwork)) != NULL) { WORKLIST_REMOVE(wk); - if (wk->wk_state & MKDIR_PARENT) { + if ((dirrem->dm_state & DIRCHG) == 0 && + wk->wk_state & MKDIR_PARENT) { wk->wk_state &= ~MKDIR_PARENT; WORKLIST_INSERT(&dotdotwk, wk); continue; From owner-svn-src-all@freebsd.org Thu Jan 23 08:36:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4C082324BE; Thu, 23 Jan 2020 08:36:58 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 483Fxk5Klyz4K9l; Thu, 23 Jan 2020 08:36:58 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 1CDD9260497; Thu, 23 Jan 2020 09:36:55 +0100 (CET) Subject: Re: svn commit: r357004 - in head/sys: kern sys To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202001230124.00N1OlXi029506@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Thu, 23 Jan 2020 09:36:53 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <202001230124.00N1OlXi029506@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 483Fxk5Klyz4K9l X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-0.99)[-0.994,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: Thu, 23 Jan 2020 08:36:59 -0000 On 2020-01-23 02:24, Gleb Smirnoff wrote: > Author: glebius > Date: Thu Jan 23 01:24:47 2020 > New Revision: 357004 > URL: https://svnweb.freebsd.org/changeset/base/357004 > > Log: > Enter the network epoch for interrupt handlers of INTR_TYPE_NET. > > Provide tunable to limit how many times handlers may be executed > without reentering epoch. > > Differential Revision: https://reviews.freebsd.org/D23242 > > Modified: > head/sys/kern/kern_intr.c > head/sys/sys/interrupt.h > > Modified: head/sys/kern/kern_intr.c > ============================================================================== > --- head/sys/kern/kern_intr.c Thu Jan 23 01:20:59 2020 (r357003) > +++ head/sys/kern/kern_intr.c Thu Jan 23 01:24:47 2020 (r357004) > @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -94,6 +95,9 @@ static int intr_storm_threshold = 0; > SYSCTL_INT(_hw, OID_AUTO, intr_storm_threshold, CTLFLAG_RWTUN, > &intr_storm_threshold, 0, > "Number of consecutive interrupts before storm protection is enabled"); > +static int intr_epoch_batch = 1000; > +SYSCTL_INT(_hw, OID_AUTO, intr_epoch_batch, CTLFLAG_RWTUN, &intr_epoch_batch, > + 0, "Maximum interrupt handler executions without re-entering epoch(9)"); > static TAILQ_HEAD(, intr_event) event_list = > TAILQ_HEAD_INITIALIZER(event_list); > static struct mtx event_lock; > @@ -587,6 +591,8 @@ intr_event_add_handler(struct intr_event *ie, const ch > ih->ih_flags |= IH_MPSAFE; > if (flags & INTR_ENTROPY) > ih->ih_flags |= IH_ENTROPY; > + if (flags & INTR_TYPE_NET) > + ih->ih_flags |= IH_NET; > > /* We can only have one exclusive handler in a event. */ > mtx_lock(&ie->ie_lock); > @@ -1196,11 +1202,12 @@ ithread_execute_handlers(struct proc *p, struct intr_e > static void > ithread_loop(void *arg) > { > + struct epoch_tracker et; > struct intr_thread *ithd; > struct intr_event *ie; > struct thread *td; > struct proc *p; > - int wake; > + int wake, epoch_count; > > td = curthread; > p = td->td_proc; > @@ -1235,8 +1242,21 @@ ithread_loop(void *arg) > * that the load of ih_need in ithread_execute_handlers() > * is ordered after the load of it_need here. > */ > - while (atomic_cmpset_acq_int(&ithd->it_need, 1, 0) != 0) > + if (ie->ie_hflags & IH_NET) { > + epoch_count = 0; > + NET_EPOCH_ENTER(et); > + } > + while (atomic_cmpset_acq_int(&ithd->it_need, 1, 0) != 0) { > ithread_execute_handlers(p, ie); > + if ((ie->ie_hflags & IH_NET) && > + ++epoch_count >= intr_epoch_batch) { > + NET_EPOCH_EXIT(et); > + epoch_count = 0; > + NET_EPOCH_ENTER(et); > + } > + } > + if (ie->ie_hflags & IH_NET) > + NET_EPOCH_EXIT(et); > WITNESS_WARN(WARN_PANIC, NULL, "suspending ithread"); > mtx_assert(&Giant, MA_NOTOWNED); > Beware that iflib uses GROUP TASKs to invoke the RX-path for packet processing and only register a fast IRQ handler. --HPS From owner-svn-src-all@freebsd.org Thu Jan 23 08:45:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4149C23299C; Thu, 23 Jan 2020 08:45:32 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 483G7c12zWz4Kyw; Thu, 23 Jan 2020 08:45:32 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EBCAC023; Thu, 23 Jan 2020 08:45:32 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N8jV59098166; Thu, 23 Jan 2020 08:45:31 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N8jVn6098164; Thu, 23 Jan 2020 08:45:31 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202001230845.00N8jVn6098164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 23 Jan 2020 08:45:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r357037 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 357037 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 08:45:32 -0000 Author: brooks Date: Thu Jan 23 08:45:31 2020 New Revision: 357037 URL: https://svnweb.freebsd.org/changeset/base/357037 Log: Enable commit access for James Clarke (jrtc27). John Baldwin will co-mentor. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Thu Jan 23 07:10:23 2020 (r357036) +++ svnadmin/conf/access Thu Jan 23 08:45:31 2020 (r357037) @@ -111,6 +111,7 @@ joerg freebsd-devel@uriah.heep.sax.de johalun jonathan jpaetzel +jrtc27 jtl julian kadesai Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Thu Jan 23 07:10:23 2020 (r357036) +++ svnadmin/conf/mentors Thu Jan 23 08:45:31 2020 (r357037) @@ -17,6 +17,7 @@ gordon delphij Co-mentor: emaste jceel trasz jkh rwatson johalun imp +jrtc27 brooks Co-mentor: jhb kadesai ken Co-mentor: scottl, ambrisko kaktus kib Co-mentor: mjg leitao jhibbits Co-mentor: nwhitehorn From owner-svn-src-all@freebsd.org Thu Jan 23 08:55:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 52930232C9B; Thu, 23 Jan 2020 08:55:16 +0000 (UTC) (envelope-from rpokala@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 483GLr1Nscz4LWW; Thu, 23 Jan 2020 08:55:16 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (c-98-207-126-143.hsd1.ca.comcast.net [98.207.126.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 31C7F39E1; Thu, 23 Jan 2020 08:55:15 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.21.0.200113 Date: Thu, 23 Jan 2020 00:55:10 -0800 Subject: Re: svn commit: r357002 - in head: share/man/man4 sys/conf sys/kern sys/modules/cpufreq sys/sys sys/x86/cpufreq From: Ravi Pokala To: Conrad Meyer , , , Message-ID: Thread-Topic: svn commit: r357002 - in head: share/man/man4 sys/conf sys/kern sys/modules/cpufreq sys/sys sys/x86/cpufreq References: <202001222328.00MNSh8a058358@repo.freebsd.org> In-Reply-To: <202001222328.00MNSh8a058358@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 08:55:16 -0000 -----Original Message----- From: on behalf of Conrad Meyer Date: 2020-01-22, Wednesday at 15:28 To: , , Subject: svn commit: r357002 - in head: share/man/man4 sys/conf sys/kern sys/modules/cpufreq sys/sys sys/x86/cpufreq Author: cem Date: Wed Jan 22 23:28:42 2020 New Revision: 357002 URL: https://svnweb.freebsd.org/changeset/base/357002 Log: cpufreq(4): Add support for Intel Speed Shift Intel Speed Shift is Intel's technology to control frequency in hardware, with hints from software. Not to be confused with Intel Speed *Step*, right? (/me was confused; naming things is hard) -Ravi (rpokala@) Let's get a working version of this in the tree and we can refine it from here. Submitted by: bwidawsk, scottph Reviewed by: bcr (manpages), myself Discussed with: jhb, kib (earlier versions) With feedback from: Greg V, gallatin, freebsdnewbie AT freenet.de Relnotes: yes Differential Revision: https://reviews.freebsd.org/D18028 From owner-svn-src-all@freebsd.org Thu Jan 23 09:14:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 71FD62333A5; Thu, 23 Jan 2020 09:14:29 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 483Gn12NlHz4MTr; Thu, 23 Jan 2020 09:14:29 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D273C58A; Thu, 23 Jan 2020 09:14:29 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N9ETXD016168; Thu, 23 Jan 2020 09:14:29 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N9ETra016167; Thu, 23 Jan 2020 09:14:29 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202001230914.00N9ETra016167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Thu, 23 Jan 2020 09:14:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357038 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 357038 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 09:14:29 -0000 Author: melifaro Date: Thu Jan 23 09:14:28 2020 New Revision: 357038 URL: https://svnweb.freebsd.org/changeset/base/357038 Log: Fix epoch-related panic in ipdivert, ensuring in_broadcast() is called within epoch. Simplify gigantic div_output() by splitting it into 3 functions, handling preliminary setup, remote "ip[6]_output" case and local "netisr" case. Leave original indenting in most parts to ease diff comparison. Indentation will be fixed by a followup commit. Reported by: Nick Hibma Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D23317 Modified: head/sys/netinet/ip_divert.c Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Thu Jan 23 08:45:31 2020 (r357037) +++ head/sys/netinet/ip_divert.c Thu Jan 23 09:14:28 2020 (r357038) @@ -122,6 +122,10 @@ static u_long div_recvspace = DIVRCVQ; /* XXX sysctl ? static eventhandler_tag ip_divert_event_tag; +static int div_output_inbound(int fmaily, struct socket *so, struct mbuf *m, + struct sockaddr_in *sin); +static int div_output_outbound(int family, struct socket *so, struct mbuf *m); + /* * Initialize divert connection block queue. */ @@ -308,10 +312,10 @@ div_output(struct socket *so, struct mbuf *m, struct s struct mbuf *control) { struct epoch_tracker et; - struct ip *const ip = mtod(m, struct ip *); + const struct ip *ip; struct m_tag *mtag; struct ipfw_rule_ref *dt; - int error = 0; + int error, family; /* * An mbuf may hasn't come from userland, but we pretend @@ -330,8 +334,8 @@ div_output(struct socket *so, struct mbuf *m, struct s mtag = m_tag_alloc(MTAG_IPFW_RULE, 0, sizeof(struct ipfw_rule_ref), M_NOWAIT | M_ZERO); if (mtag == NULL) { - error = ENOBUFS; - goto cantsend; + m_freem(m); + return (ENOBUFS); } m_tag_prepend(m, mtag); } @@ -349,6 +353,7 @@ div_output(struct socket *so, struct mbuf *m, struct s dt->chain_id = 0; dt->rulenum = sin->sin_port+1; /* host format ? */ dt->rule_id = 0; + /* XXX: broken for IPv6 */ /* * Find receive interface with the given name, stuffed * (if it exists) in the sin_zero[] field. @@ -361,16 +366,55 @@ div_output(struct socket *so, struct mbuf *m, struct s m->m_pkthdr.rcvif = ifunit(sin->sin_zero); } + ip = mtod(m, struct ip *); + switch (ip->ip_v) { + case IPVERSION: + family = AF_INET; + break; + case IPV6_VERSION >> 4: + family = AF_INET6; + break; + default: + m_freem(m); + return (EAFNOSUPPORT); + } + /* Reinject packet into the system as incoming or outgoing */ + NET_EPOCH_ENTER(et); if (!sin || sin->sin_addr.s_addr == 0) { - struct mbuf *options = NULL; + dt->info |= IPFW_IS_DIVERT | IPFW_INFO_OUT; + error = div_output_outbound(family, so, m); + } else { + dt->info |= IPFW_IS_DIVERT | IPFW_INFO_IN; + error = div_output_inbound(family, so, m, sin); + } + NET_EPOCH_EXIT(et); + + if (error != 0) + m_freem(m); + + return (error); +} + +/* + * Sends mbuf @m to the wire via ip[6]_output(). + * + * Returns 0 on success, @m is consumed. + * On failure, returns error code. It is caller responsibility to free @m. + */ +static int +div_output_outbound(int family, struct socket *so, struct mbuf *m) +{ + struct ip *const ip = mtod(m, struct ip *); + + struct mbuf *options; struct inpcb *inp; + int error; - dt->info |= IPFW_IS_DIVERT | IPFW_INFO_OUT; inp = sotoinpcb(so); INP_RLOCK(inp); - switch (ip->ip_v) { - case IPVERSION: + switch (family) { + case AF_INET: /* * Don't allow both user specified and setsockopt * options, and don't allow packet length sizes that @@ -379,29 +423,23 @@ div_output(struct socket *so, struct mbuf *m, struct s if ((((ip->ip_hl << 2) != sizeof(struct ip)) && inp->inp_options != NULL) || ((u_short)ntohs(ip->ip_len) > m->m_pkthdr.len)) { - error = EINVAL; INP_RUNLOCK(inp); - goto cantsend; + return (EINVAL); } break; #ifdef INET6 - case IPV6_VERSION >> 4: + case AF_INET6: { struct ip6_hdr *const ip6 = mtod(m, struct ip6_hdr *); /* Don't allow packet length sizes that will crash */ if (((u_short)ntohs(ip6->ip6_plen) > m->m_pkthdr.len)) { - error = EINVAL; INP_RUNLOCK(inp); - goto cantsend; + return (EINVAL); } break; } #endif - default: - error = EINVAL; - INP_RUNLOCK(inp); - goto cantsend; } /* Send packet to output processing */ @@ -431,61 +469,70 @@ div_output(struct socket *so, struct mbuf *m, struct s * held so we can use them in ip_output() without * requring a reference to the pcb. */ + options = NULL; if (inp->inp_options != NULL) { options = m_dup(inp->inp_options, M_NOWAIT); if (options == NULL) { INP_RUNLOCK(inp); - error = ENOBUFS; - goto cantsend; + return (ENOBUFS); } } INP_RUNLOCK(inp); - NET_EPOCH_ENTER(et); - switch (ip->ip_v) { - case IPVERSION: + error = 0; + switch (family) { + case AF_INET: error = ip_output(m, options, NULL, ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0) | IP_ALLOWBROADCAST | IP_RAWOUTPUT, NULL, NULL); break; #ifdef INET6 - case IPV6_VERSION >> 4: + case AF_INET6: error = ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL); break; #endif } - NET_EPOCH_EXIT(et); if (options != NULL) m_freem(options); - } else { - dt->info |= IPFW_IS_DIVERT | IPFW_INFO_IN; + + return (error); +} + +/* + * Schedules mbuf @m for local processing via IPv4/IPv6 netisr queue. + * + * Returns 0 on success, @m is consumed. + * Returns error code on failure. It is caller responsibility to free @m. + */ +static int +div_output_inbound(int family, struct socket *so, struct mbuf *m, + struct sockaddr_in *sin) +{ + const struct ip *ip; + struct ifaddr *ifa; + if (m->m_pkthdr.rcvif == NULL) { /* * No luck with the name, check by IP address. * Clear the port and the ifname to make sure * there are no distractions for ifa_ifwithaddr. */ - struct epoch_tracker et; - struct ifaddr *ifa; + /* XXX: broken for IPv6 */ bzero(sin->sin_zero, sizeof(sin->sin_zero)); sin->sin_port = 0; - NET_EPOCH_ENTER(et); ifa = ifa_ifwithaddr((struct sockaddr *) sin); - if (ifa == NULL) { - error = EADDRNOTAVAIL; - NET_EPOCH_EXIT(et); - goto cantsend; - } + if (ifa == NULL) + return (EADDRNOTAVAIL); m->m_pkthdr.rcvif = ifa->ifa_ifp; - NET_EPOCH_EXIT(et); } #ifdef MAC mac_socket_create_mbuf(so, m); #endif /* Send packet to input processing via netisr */ - switch (ip->ip_v) { - case IPVERSION: + switch (family) { + case AF_INET: + ip = mtod(m, struct ip *); /* * Restore M_BCAST flag when destination address is * broadcast. It is expected by ip_tryforward(). @@ -497,21 +544,15 @@ div_output(struct socket *so, struct mbuf *m, struct s netisr_queue_src(NETISR_IP, (uintptr_t)so, m); break; #ifdef INET6 - case IPV6_VERSION >> 4: + case AF_INET6: netisr_queue_src(NETISR_IPV6, (uintptr_t)so, m); break; #endif default: - error = EINVAL; - goto cantsend; + return (EINVAL); } - } - return (error); - -cantsend: - m_freem(m); - return (error); + return (0); } static int From owner-svn-src-all@freebsd.org Thu Jan 23 09:46:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBEF5233D86; Thu, 23 Jan 2020 09:46:45 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 483HVF4Zvzz4P64; Thu, 23 Jan 2020 09:46:45 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 987BBCB3E; Thu, 23 Jan 2020 09:46:45 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N9kjtM034328; Thu, 23 Jan 2020 09:46:45 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N9kjrp034327; Thu, 23 Jan 2020 09:46:45 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202001230946.00N9kjrp034327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Thu, 23 Jan 2020 09:46:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357039 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 357039 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 09:46:45 -0000 Author: melifaro Date: Thu Jan 23 09:46:45 2020 New Revision: 357039 URL: https://svnweb.freebsd.org/changeset/base/357039 Log: Bring indentation back to normal after r357038. No functional changes. MFC after: 3 weeks Modified: head/sys/netinet/ip_divert.c Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Thu Jan 23 09:14:28 2020 (r357038) +++ head/sys/netinet/ip_divert.c Thu Jan 23 09:46:45 2020 (r357039) @@ -406,96 +406,95 @@ static int div_output_outbound(int family, struct socket *so, struct mbuf *m) { struct ip *const ip = mtod(m, struct ip *); + struct mbuf *options; + struct inpcb *inp; + int error; - struct mbuf *options; - struct inpcb *inp; - int error; - - inp = sotoinpcb(so); - INP_RLOCK(inp); - switch (family) { - case AF_INET: - /* - * Don't allow both user specified and setsockopt - * options, and don't allow packet length sizes that - * will crash. - */ - if ((((ip->ip_hl << 2) != sizeof(struct ip)) && - inp->inp_options != NULL) || - ((u_short)ntohs(ip->ip_len) > m->m_pkthdr.len)) { - INP_RUNLOCK(inp); - return (EINVAL); - } - break; + inp = sotoinpcb(so); + INP_RLOCK(inp); + switch (family) { + case AF_INET: + /* + * Don't allow both user specified and setsockopt + * options, and don't allow packet length sizes that + * will crash. + */ + if ((((ip->ip_hl << 2) != sizeof(struct ip)) && + inp->inp_options != NULL) || + ((u_short)ntohs(ip->ip_len) > m->m_pkthdr.len)) { + INP_RUNLOCK(inp); + return (EINVAL); + } + break; #ifdef INET6 - case AF_INET6: - { - struct ip6_hdr *const ip6 = mtod(m, struct ip6_hdr *); + case AF_INET6: + { + struct ip6_hdr *const ip6 = mtod(m, struct ip6_hdr *); - /* Don't allow packet length sizes that will crash */ - if (((u_short)ntohs(ip6->ip6_plen) > m->m_pkthdr.len)) { - INP_RUNLOCK(inp); - return (EINVAL); - } - break; - } -#endif + /* Don't allow packet length sizes that will crash */ + if (((u_short)ntohs(ip6->ip6_plen) > m->m_pkthdr.len)) { + INP_RUNLOCK(inp); + return (EINVAL); } + break; + } +#endif + } - /* Send packet to output processing */ - KMOD_IPSTAT_INC(ips_rawout); /* XXX */ + /* Send packet to output processing */ + KMOD_IPSTAT_INC(ips_rawout); /* XXX */ #ifdef MAC - mac_inpcb_create_mbuf(inp, m); + mac_inpcb_create_mbuf(inp, m); #endif - /* - * Get ready to inject the packet into ip_output(). - * Just in case socket options were specified on the - * divert socket, we duplicate them. This is done - * to avoid having to hold the PCB locks over the call - * to ip_output(), as doing this results in a number of - * lock ordering complexities. - * - * Note that we set the multicast options argument for - * ip_output() to NULL since it should be invariant that - * they are not present. - */ - KASSERT(inp->inp_moptions == NULL, - ("multicast options set on a divert socket")); - /* - * XXXCSJP: It is unclear to me whether or not it makes - * sense for divert sockets to have options. However, - * for now we will duplicate them with the INP locks - * held so we can use them in ip_output() without - * requring a reference to the pcb. - */ - options = NULL; - if (inp->inp_options != NULL) { - options = m_dup(inp->inp_options, M_NOWAIT); - if (options == NULL) { - INP_RUNLOCK(inp); - return (ENOBUFS); - } + /* + * Get ready to inject the packet into ip_output(). + * Just in case socket options were specified on the + * divert socket, we duplicate them. This is done + * to avoid having to hold the PCB locks over the call + * to ip_output(), as doing this results in a number of + * lock ordering complexities. + * + * Note that we set the multicast options argument for + * ip_output() to NULL since it should be invariant that + * they are not present. + */ + KASSERT(inp->inp_moptions == NULL, + ("multicast options set on a divert socket")); + /* + * XXXCSJP: It is unclear to me whether or not it makes + * sense for divert sockets to have options. However, + * for now we will duplicate them with the INP locks + * held so we can use them in ip_output() without + * requring a reference to the pcb. + */ + options = NULL; + if (inp->inp_options != NULL) { + options = m_dup(inp->inp_options, M_NOWAIT); + if (options == NULL) { + INP_RUNLOCK(inp); + return (ENOBUFS); } - INP_RUNLOCK(inp); + } + INP_RUNLOCK(inp); - error = 0; - switch (family) { - case AF_INET: - error = ip_output(m, options, NULL, - ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0) - | IP_ALLOWBROADCAST | IP_RAWOUTPUT, NULL, NULL); - break; + error = 0; + switch (family) { + case AF_INET: + error = ip_output(m, options, NULL, + ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0) + | IP_ALLOWBROADCAST | IP_RAWOUTPUT, NULL, NULL); + break; #ifdef INET6 - case AF_INET6: - error = ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL); - break; + case AF_INET6: + error = ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL); + break; #endif - } - if (options != NULL) - m_freem(options); + } + if (options != NULL) + m_freem(options); - return (error); + return (error); } /* @@ -511,46 +510,46 @@ div_output_inbound(int family, struct socket *so, stru const struct ip *ip; struct ifaddr *ifa; - if (m->m_pkthdr.rcvif == NULL) { - /* - * No luck with the name, check by IP address. - * Clear the port and the ifname to make sure - * there are no distractions for ifa_ifwithaddr. - */ + if (m->m_pkthdr.rcvif == NULL) { + /* + * No luck with the name, check by IP address. + * Clear the port and the ifname to make sure + * there are no distractions for ifa_ifwithaddr. + */ - /* XXX: broken for IPv6 */ - bzero(sin->sin_zero, sizeof(sin->sin_zero)); - sin->sin_port = 0; - ifa = ifa_ifwithaddr((struct sockaddr *) sin); - if (ifa == NULL) - return (EADDRNOTAVAIL); - m->m_pkthdr.rcvif = ifa->ifa_ifp; - } + /* XXX: broken for IPv6 */ + bzero(sin->sin_zero, sizeof(sin->sin_zero)); + sin->sin_port = 0; + ifa = ifa_ifwithaddr((struct sockaddr *) sin); + if (ifa == NULL) + return (EADDRNOTAVAIL); + m->m_pkthdr.rcvif = ifa->ifa_ifp; + } #ifdef MAC - mac_socket_create_mbuf(so, m); + mac_socket_create_mbuf(so, m); #endif - /* Send packet to input processing via netisr */ - switch (family) { - case AF_INET: - ip = mtod(m, struct ip *); - /* - * Restore M_BCAST flag when destination address is - * broadcast. It is expected by ip_tryforward(). - */ - if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) - m->m_flags |= M_MCAST; - else if (in_broadcast(ip->ip_dst, m->m_pkthdr.rcvif)) - m->m_flags |= M_BCAST; - netisr_queue_src(NETISR_IP, (uintptr_t)so, m); - break; + /* Send packet to input processing via netisr */ + switch (family) { + case AF_INET: + ip = mtod(m, struct ip *); + /* + * Restore M_BCAST flag when destination address is + * broadcast. It is expected by ip_tryforward(). + */ + if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) + m->m_flags |= M_MCAST; + else if (in_broadcast(ip->ip_dst, m->m_pkthdr.rcvif)) + m->m_flags |= M_BCAST; + netisr_queue_src(NETISR_IP, (uintptr_t)so, m); + break; #ifdef INET6 - case AF_INET6: - netisr_queue_src(NETISR_IPV6, (uintptr_t)so, m); - break; + case AF_INET6: + netisr_queue_src(NETISR_IPV6, (uintptr_t)so, m); + break; #endif - default: - return (EINVAL); - } + default: + return (EINVAL); + } return (0); } From owner-svn-src-all@freebsd.org Thu Jan 23 10:13:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF6932346F0; Thu, 23 Jan 2020 10:13:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 483J5c5JHDz4QVC; Thu, 23 Jan 2020 10:13:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B13CFD0C9; Thu, 23 Jan 2020 10:13:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00NADuoG052235; Thu, 23 Jan 2020 10:13:56 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00NADuBS052233; Thu, 23 Jan 2020 10:13:56 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202001231013.00NADuBS052233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 23 Jan 2020 10:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357040 - head/sys/dev/virtio/scsi X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/virtio/scsi X-SVN-Commit-Revision: 357040 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 10:13:56 -0000 Author: avg Date: Thu Jan 23 10:13:56 2020 New Revision: 357040 URL: https://svnweb.freebsd.org/changeset/base/357040 Log: virtio_scsi: use max target ID plus one as the initiator ID This bus does not really have a concept of the initiator ID, so use a guaranteed dummy one that won't conflict with any real target. This change fixes a problem with virtio_scsi on GCE where disks get sequential target IDs starting from one. If there are seven or more disks, then a disk with the target ID of seven would not be discovered by FreeBSD as that ID was reserved as the initiator ID -- see scsi_scan_bus(). Discussed with: bryanv MFC after: 2 weeks Sponsored by: Panzura Modified: head/sys/dev/virtio/scsi/virtio_scsi.c head/sys/dev/virtio/scsi/virtio_scsivar.h Modified: head/sys/dev/virtio/scsi/virtio_scsi.c ============================================================================== --- head/sys/dev/virtio/scsi/virtio_scsi.c Thu Jan 23 09:46:45 2020 (r357039) +++ head/sys/dev/virtio/scsi/virtio_scsi.c Thu Jan 23 10:13:56 2020 (r357040) @@ -937,7 +937,7 @@ vtscsi_cam_path_inquiry(struct vtscsi_softc *sc, struc cpi->max_target = sc->vtscsi_max_target; cpi->max_lun = sc->vtscsi_max_lun; - cpi->initiator_id = VTSCSI_INITIATOR_ID; + cpi->initiator_id = cpi->max_target + 1; strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strlcpy(cpi->hba_vid, "VirtIO", HBA_IDLEN); Modified: head/sys/dev/virtio/scsi/virtio_scsivar.h ============================================================================== --- head/sys/dev/virtio/scsi/virtio_scsivar.h Thu Jan 23 09:46:45 2020 (r357039) +++ head/sys/dev/virtio/scsi/virtio_scsivar.h Thu Jan 23 10:13:56 2020 (r357040) @@ -205,11 +205,6 @@ struct vtscsi_request { #define VTSCSI_RESERVED_REQUESTS 10 /* - * Specification doesn't say, use traditional SCSI default. - */ -#define VTSCSI_INITIATOR_ID 7 - -/* * How to wait (or not) for request completion. */ #define VTSCSI_EXECUTE_ASYNC 0 From owner-svn-src-all@freebsd.org Thu Jan 23 10:40:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D0BB234D20; Thu, 23 Jan 2020 10:40:35 +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 483JhM2Hdnz4RJn; Thu, 23 Jan 2020 10:40:35 +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 49ECDD473; Thu, 23 Jan 2020 10:40:35 +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 00NAeZTI064355; Thu, 23 Jan 2020 10:40:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00NAeYFE064353; Thu, 23 Jan 2020 10:40:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202001231040.00NAeYFE064353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 23 Jan 2020 10:40:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357041 - in head: stand/usb sys/modules/usb/template X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head: stand/usb sys/modules/usb/template X-SVN-Commit-Revision: 357041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 10:40:35 -0000 Author: hselasky Date: Thu Jan 23 10:40:34 2020 New Revision: 357041 URL: https://svnweb.freebsd.org/changeset/base/357041 Log: Fix build of stand/usb . MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/stand/usb/usbcore.mk head/sys/modules/usb/template/Makefile Modified: head/stand/usb/usbcore.mk ============================================================================== --- head/stand/usb/usbcore.mk Thu Jan 23 10:13:56 2020 (r357040) +++ head/stand/usb/usbcore.mk Thu Jan 23 10:40:34 2020 (r357041) @@ -1,7 +1,7 @@ # # $FreeBSD$ # -# Copyright (c) 2013 Hans Petter Selasky. +# Copyright (c) 2013-2020 Hans Petter Selasky. # Copyright (c) 2014 SRI International # All rights reserved. # @@ -162,6 +162,8 @@ KSRCS+= usb_template_audio.c KSRCS+= usb_template_phone.c KSRCS+= usb_template_serialnet.c KSRCS+= usb_template_midi.c +KSRCS+= usb_template_multi.c +KSRCS+= usb_template_cdceem.c # # USB mass storage support Modified: head/sys/modules/usb/template/Makefile ============================================================================== --- head/sys/modules/usb/template/Makefile Thu Jan 23 10:13:56 2020 (r357040) +++ head/sys/modules/usb/template/Makefile Thu Jan 23 10:40:34 2020 (r357041) @@ -1,7 +1,7 @@ # # $FreeBSD$ # -# Copyright (c) 2008 Hans Petter Selasky. All rights reserved. +# Copyright (c) 2008-2020 Hans Petter Selasky. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -44,5 +44,10 @@ SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if. usb_template_midi.c \ usb_template_multi.c \ usb_template_cdceem.c + +# +# NOTE: +# Keep source list above in sync with stand/usb/usbcore.mk +# .include From owner-svn-src-all@freebsd.org Thu Jan 23 11:05:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F0622354BB; Thu, 23 Jan 2020 11:05:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 483KDb70KNz4StZ; Thu, 23 Jan 2020 11:05:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAD91D9DA; Thu, 23 Jan 2020 11:05:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00NB53V3081854; Thu, 23 Jan 2020 11:05:03 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00NB53q5081852; Thu, 23 Jan 2020 11:05:03 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202001231105.00NB53q5081852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 23 Jan 2020 11:05:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357042 - in head/sys: dev/vmware/vmxnet3 modules/vmware/vmxnet3 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys: dev/vmware/vmxnet3 modules/vmware/vmxnet3 X-SVN-Commit-Revision: 357042 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 11:05:04 -0000 Author: avg Date: Thu Jan 23 11:05:03 2020 New Revision: 357042 URL: https://svnweb.freebsd.org/changeset/base/357042 Log: vmxnet3: add support for RSS kernel option We observe at least one problem: if a UDP socket is connect(2)-ed, then a received packet that matches the connection cannot be matched to the corresponding PCB because of an incorrect flow ID. That was oberved for DNS requests from the libc resolver. We got this problem because FreeBSD r343291 enabled code that can set rsstype of received packets to values other than M_HASHTYPE_OPAQUE_HASH. Earlier that code was under 'ifdef notyet'. The essence of this change is to use the system-wide RSS key instead of some historic hardcoded key when the software RSS is enabled and it is configured to use Toeplitz algorithm (the default). In all other cases, the driver reports the opaque hash type for received packets while still using Toeplitz algorithm with the internal key. PR: 242890 Reviewed by: pkelsey Sponsored by: Panzura Differential Revision: https://reviews.freebsd.org/D23147 Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c head/sys/dev/vmware/vmxnet3/if_vmxvar.h head/sys/modules/vmware/vmxnet3/Makefile Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- head/sys/dev/vmware/vmxnet3/if_vmx.c Thu Jan 23 10:40:34 2020 (r357041) +++ head/sys/dev/vmware/vmxnet3/if_vmx.c Thu Jan 23 11:05:03 2020 (r357042) @@ -23,6 +23,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_rss.h" + #include #include #include @@ -46,6 +48,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef RSS +#include +#endif #include #include @@ -1140,8 +1145,11 @@ vmxnet3_reinit_rss_shared_data(struct vmxnet3_softc *s struct vmxnet3_driver_shared *ds; if_softc_ctx_t scctx; struct vmxnet3_rss_shared *rss; +#ifdef RSS + uint8_t rss_algo; +#endif int i; - + ds = sc->vmx_ds; scctx = sc->vmx_scctx; rss = sc->vmx_rss; @@ -1152,10 +1160,29 @@ vmxnet3_reinit_rss_shared_data(struct vmxnet3_softc *s rss->hash_func = UPT1_RSS_HASH_FUNC_TOEPLITZ; rss->hash_key_size = UPT1_RSS_MAX_KEY_SIZE; rss->ind_table_size = UPT1_RSS_MAX_IND_TABLE_SIZE; - memcpy(rss->hash_key, rss_key, UPT1_RSS_MAX_KEY_SIZE); - - for (i = 0; i < UPT1_RSS_MAX_IND_TABLE_SIZE; i++) - rss->ind_table[i] = i % scctx->isc_nrxqsets; +#ifdef RSS + /* + * If the software RSS is configured to anything else other than + * Toeplitz, then just do Toeplitz in "hardware" for the sake of + * the packet distribution, but report the hash as opaque to + * disengage from the software RSS. + */ + rss_algo = rss_gethashalgo(); + if (rss_algo == RSS_HASH_TOEPLITZ) { + rss_getkey(rss->hash_key); + for (i = 0; i < UPT1_RSS_MAX_IND_TABLE_SIZE; i++) { + rss->ind_table[i] = rss_get_indirection_to_bucket(i) % + scctx->isc_nrxqsets; + } + sc->vmx_flags |= VMXNET3_FLAG_SOFT_RSS; + } else +#endif + { + memcpy(rss->hash_key, rss_key, UPT1_RSS_MAX_KEY_SIZE); + for (i = 0; i < UPT1_RSS_MAX_IND_TABLE_SIZE; i++) + rss->ind_table[i] = i % scctx->isc_nrxqsets; + sc->vmx_flags &= ~VMXNET3_FLAG_SOFT_RSS; + } } static void @@ -1499,29 +1526,50 @@ vmxnet3_isc_rxd_pkt_get(void *vsc, if_rxd_info_t ri) KASSERT(rxcd->sop, ("%s: expected sop", __func__)); /* - * RSS and flow ID + * RSS and flow ID. + * Types other than M_HASHTYPE_NONE and M_HASHTYPE_OPAQUE_HASH should + * be used only if the software RSS is enabled and it uses the same + * algorithm and the hash key as the "hardware". If the software RSS + * is not enabled, then it's simply pointless to use those types. + * If it's enabled but with different parameters, then hash values will + * not match. */ ri->iri_flowid = rxcd->rss_hash; - switch (rxcd->rss_type) { - case VMXNET3_RCD_RSS_TYPE_NONE: - ri->iri_flowid = ri->iri_qsidx; - ri->iri_rsstype = M_HASHTYPE_NONE; - break; - case VMXNET3_RCD_RSS_TYPE_IPV4: - ri->iri_rsstype = M_HASHTYPE_RSS_IPV4; - break; - case VMXNET3_RCD_RSS_TYPE_TCPIPV4: - ri->iri_rsstype = M_HASHTYPE_RSS_TCP_IPV4; - break; - case VMXNET3_RCD_RSS_TYPE_IPV6: - ri->iri_rsstype = M_HASHTYPE_RSS_IPV6; - break; - case VMXNET3_RCD_RSS_TYPE_TCPIPV6: - ri->iri_rsstype = M_HASHTYPE_RSS_TCP_IPV6; - break; - default: - ri->iri_rsstype = M_HASHTYPE_OPAQUE_HASH; - break; +#ifdef RSS + if ((sc->vmx_flags & VMXNET3_FLAG_SOFT_RSS) != 0) { + switch (rxcd->rss_type) { + case VMXNET3_RCD_RSS_TYPE_NONE: + ri->iri_flowid = ri->iri_qsidx; + ri->iri_rsstype = M_HASHTYPE_NONE; + break; + case VMXNET3_RCD_RSS_TYPE_IPV4: + ri->iri_rsstype = M_HASHTYPE_RSS_IPV4; + break; + case VMXNET3_RCD_RSS_TYPE_TCPIPV4: + ri->iri_rsstype = M_HASHTYPE_RSS_TCP_IPV4; + break; + case VMXNET3_RCD_RSS_TYPE_IPV6: + ri->iri_rsstype = M_HASHTYPE_RSS_IPV6; + break; + case VMXNET3_RCD_RSS_TYPE_TCPIPV6: + ri->iri_rsstype = M_HASHTYPE_RSS_TCP_IPV6; + break; + default: + ri->iri_rsstype = M_HASHTYPE_OPAQUE_HASH; + break; + } + } else +#endif + { + switch (rxcd->rss_type) { + case VMXNET3_RCD_RSS_TYPE_NONE: + ri->iri_flowid = ri->iri_qsidx; + ri->iri_rsstype = M_HASHTYPE_NONE; + break; + default: + ri->iri_rsstype = M_HASHTYPE_OPAQUE_HASH; + break; + } } /* VLAN */ Modified: head/sys/dev/vmware/vmxnet3/if_vmxvar.h ============================================================================== --- head/sys/dev/vmware/vmxnet3/if_vmxvar.h Thu Jan 23 10:40:34 2020 (r357041) +++ head/sys/dev/vmware/vmxnet3/if_vmxvar.h Thu Jan 23 11:05:03 2020 (r357042) @@ -113,6 +113,8 @@ struct vmxnet3_softc { struct vmxnet3_driver_shared *vmx_ds; uint32_t vmx_flags; #define VMXNET3_FLAG_RSS 0x0002 +#define VMXNET3_FLAG_SOFT_RSS 0x0004 /* Software RSS is enabled with + compatible algorithm. */ struct vmxnet3_rxqueue *vmx_rxq; struct vmxnet3_txqueue *vmx_txq; Modified: head/sys/modules/vmware/vmxnet3/Makefile ============================================================================== --- head/sys/modules/vmware/vmxnet3/Makefile Thu Jan 23 10:40:34 2020 (r357041) +++ head/sys/modules/vmware/vmxnet3/Makefile Thu Jan 23 11:05:03 2020 (r357042) @@ -28,6 +28,6 @@ KMOD= if_vmx SRCS= if_vmx.c SRCS+= bus_if.h device_if.h pci_if.h ifdi_if.h -SRCS+= opt_inet.h opt_inet6.h +SRCS+= opt_inet.h opt_inet6.h opt_rss.h .include From owner-svn-src-all@freebsd.org Thu Jan 23 11:20:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5170235BC9; Thu, 23 Jan 2020 11:20:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 483KZJ47rgz4TtK; Thu, 23 Jan 2020 11:20:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 00NBKG1i010406 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 23 Jan 2020 13:20:20 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 00NBKG1i010406 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 00NBKG9K010341; Thu, 23 Jan 2020 13:20:16 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 23 Jan 2020 13:20:16 +0200 From: Konstantin Belousov To: Ryan Libby Cc: src-committers , svn-src-all , svn-src-head , Mark Johnston Subject: Re: svn commit: r356919 - head/sys/x86/x86 Message-ID: <20200123112016.GS4808@kib.kiev.ua> References: <202001201723.00KHN3tX093432@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.3 X-Spam-Checker-Version: SpamAssassin 3.4.3 (2019-12-06) on tom.home X-Rspamd-Queue-Id: 483KZJ47rgz4TtK X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-0.99)[-0.992,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: Thu, 23 Jan 2020 11:20:24 -0000 On Wed, Jan 22, 2020 at 06:39:22PM -0800, Ryan Libby wrote: > On Mon, Jan 20, 2020 at 9:23 AM Konstantin Belousov wrote: > > > > Author: kib > > Date: Mon Jan 20 17:23:03 2020 > > New Revision: 356919 > > URL: https://svnweb.freebsd.org/changeset/base/356919 > > > > Log: > > x86: Wait for curthread to be set up as an indicator that the boot stack > > is no longer used. > > > > pc_curthread is set by cpu_switch after it stopped using the old > > thread (or boot) stack. This makes the smp_after_idle_runnable() > > function not dependent on the internals of the scheduler operations. > > > > Reviewed by: markj > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > > Differential revision: https://reviews.freebsd.org/D23276 > > > > Modified: > > head/sys/x86/x86/mp_x86.c > > > > Modified: head/sys/x86/x86/mp_x86.c > > ============================================================================== > > --- head/sys/x86/x86/mp_x86.c Mon Jan 20 16:59:39 2020 (r356918) > > +++ head/sys/x86/x86/mp_x86.c Mon Jan 20 17:23:03 2020 (r356919) > > @@ -1092,13 +1092,12 @@ init_secondary_tail(void) > > static void > > smp_after_idle_runnable(void *arg __unused) > > { > > - struct thread *idle_td; > > + struct pcpu *pc; > > int cpu; > > > > for (cpu = 1; cpu < mp_ncpus; cpu++) { > > - idle_td = pcpu_find(cpu)->pc_idlethread; > > - while (atomic_load_int(&idle_td->td_lastcpu) == NOCPU && > > - atomic_load_int(&idle_td->td_oncpu) == NOCPU) > > + pc = pcpu_find(cpu); > > + while (atomic_load_ptr(&pc->pc_curthread) == (uintptr_t)NULL) > > cpu_spinwait(); > > kmem_free((vm_offset_t)bootstacks[cpu], kstack_pages * > > PAGE_SIZE); > > _______________________________________________ > > svn-src-all@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-all > > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > > I'm hitting a boot panic on a KVM VM that I think is because of this. > I don't think this works as advertised, because init_secondary_tail sets > curthread to its idlethread *itself* before it calls sched_switch. So I > think the current check is not enough to know that we're actually off > the bootstack. > > My panic is an AP page faults in the middle of init_secondary_tail, > after curthread is set. Weirdly, I only seem to hit it when I have > disabled some CPUs (to test D23318). I think this must just be > affecting some aspect of the timing. Supposed fix is https://reviews.freebsd.org/D23330 From owner-svn-src-all@freebsd.org Thu Jan 23 13:56:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D55BC1F2D66; Thu, 23 Jan 2020 13:56:13 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 483P253s8wz4ftk; Thu, 23 Jan 2020 13:56:13 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FBBCFA7C; Thu, 23 Jan 2020 13:56:13 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00NDuDUX084045; Thu, 23 Jan 2020 13:56:13 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00NDuDvP084044; Thu, 23 Jan 2020 13:56:13 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <202001231356.00NDuDvP084044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Thu, 23 Jan 2020 13:56:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357043 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: nyan X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 357043 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 13:56:13 -0000 Author: nyan Date: Thu Jan 23 13:56:12 2020 New Revision: 357043 URL: https://svnweb.freebsd.org/changeset/base/357043 Log: Fix kernel-tags target. - A depend-file is broken up into .depend.*.o files. [1] - Fix an assembly file support. PR: 241746 Submitted by: leres [1] MFC after: 1 week Modified: head/sys/conf/kern.post.mk head/sys/conf/systags.sh Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Thu Jan 23 11:05:03 2020 (r357042) +++ head/sys/conf/kern.post.mk Thu Jan 23 13:56:12 2020 (r357043) @@ -389,7 +389,8 @@ kernel-cleandepend: .PHONY rm -f .depend .depend.* ${_ILINKS} kernel-tags: - @[ -f .depend ] || { echo "you must make depend first"; exit 1; } + @ls .depend.* > /dev/null 2>&1 || \ + { echo "you must make depend first"; exit 1; } sh $S/conf/systags.sh kernel-install: .PHONY Modified: head/sys/conf/systags.sh ============================================================================== --- head/sys/conf/systags.sh Thu Jan 23 11:05:03 2020 (r357042) +++ head/sys/conf/systags.sh Thu Jan 23 13:56:12 2020 (r357043) @@ -39,14 +39,14 @@ rm -f tags tags.tmp tags.cfiles tags.sfiles tags.hfiles sed -e "s, machine/, ../../include/,g" \ - -e 's,[a-z][^/ ]*/\.\./,,g' .depend | awk '{ + -e 's,[a-z][^/ ]*/\.\./,,g' .depend.* | awk '{ for (i = 1; i <= NF; ++i) { t = substr($i, length($i) - 1) if (t == ".c") cfiles[$i] = 1; else if (t == ".h") hfiles[$i] = 1; - else if (t == ".s") + else if (t == ".s" || t == ".S") sfiles[$i] = 1; } }; From owner-svn-src-all@freebsd.org Thu Jan 23 14:01:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E3F71F301B; Thu, 23 Jan 2020 14:01:04 +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 483P7h1ps7z4gFq; Thu, 23 Jan 2020 14:01:04 +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 20E16FAC4; Thu, 23 Jan 2020 14:01:04 +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 00NE14ag085465; Thu, 23 Jan 2020 14:01:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00NE14Hm085464; Thu, 23 Jan 2020 14:01:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001231401.00NE14Hm085464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 23 Jan 2020 14:01: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: r357044 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 357044 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 14:01:04 -0000 Author: markj Date: Thu Jan 23 14:01:03 2020 New Revision: 357044 URL: https://svnweb.freebsd.org/changeset/base/357044 Log: MFC r356563: UMA: Don't destroy zones after the system shutdown process starts. PR: 242427 Modified: stable/12/sys/vm/uma_core.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/uma_core.c ============================================================================== --- stable/12/sys/vm/uma_core.c Thu Jan 23 13:56:12 2020 (r357043) +++ stable/12/sys/vm/uma_core.c Thu Jan 23 14:01:03 2020 (r357044) @@ -156,8 +156,14 @@ SYSCTL_ULONG(_vm, OID_AUTO, uma_kmem_total, CTLFLAG_RD "UMA kernel memory usage"); /* Is the VM done starting up? */ -static enum { BOOT_COLD = 0, BOOT_STRAPPED, BOOT_PAGEALLOC, BOOT_BUCKETS, - BOOT_RUNNING } booted = BOOT_COLD; +static enum { + BOOT_COLD, + BOOT_STRAPPED, + BOOT_PAGEALLOC, + BOOT_BUCKETS, + BOOT_RUNNING, + BOOT_SHUTDOWN, +} booted = BOOT_COLD; /* * This is the handle used to schedule events that need to happen @@ -261,6 +267,7 @@ static int hash_expand(struct uma_hash *, struct uma_h static void hash_free(struct uma_hash *hash); static void uma_timeout(void *); static void uma_startup3(void); +static void uma_shutdown(void); static void *zone_alloc_item(uma_zone_t, void *, int, int); static void zone_free_item(uma_zone_t, void *, void *, enum zfreeskip); static void bucket_enable(void); @@ -1184,8 +1191,7 @@ startup_alloc(uma_zone_t zone, vm_size_t bytes, int do case BOOT_PAGEALLOC: if (keg->uk_ppera > 1) break; - case BOOT_BUCKETS: - case BOOT_RUNNING: + default: #ifdef UMA_MD_SMALL_ALLOC keg->uk_allocf = (keg->uk_ppera > 1) ? page_alloc : uma_small_alloc; @@ -2134,10 +2140,6 @@ uma_startup2(void) bucket_enable(); } -/* - * Initialize our callout handle - * - */ static void uma_startup3(void) { @@ -2150,8 +2152,18 @@ uma_startup3(void) callout_init(&uma_callout, 1); callout_reset(&uma_callout, UMA_TIMEOUT * hz, uma_timeout, NULL); booted = BOOT_RUNNING; + + EVENTHANDLER_REGISTER(shutdown_post_sync, uma_shutdown, NULL, + EVENTHANDLER_PRI_FIRST); } +static void +uma_shutdown(void) +{ + + booted = BOOT_SHUTDOWN; +} + static uma_keg_t uma_kcreate(uma_zone_t zone, size_t size, uma_init uminit, uma_fini fini, int align, uint32_t flags) @@ -2371,6 +2383,14 @@ void uma_zdestroy(uma_zone_t zone) { + /* + * Large slabs are expensive to reclaim, so don't bother doing + * unnecessary work if we're shutting down. + */ + if (booted == BOOT_SHUTDOWN && + zone->uz_fini == NULL && + zone->uz_release == (uma_release)zone_release) + return; sx_slock(&uma_drain_lock); zone_free_item(zones, zone, NULL, SKIP_NONE); sx_sunlock(&uma_drain_lock); From owner-svn-src-all@freebsd.org Thu Jan 23 14:11:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 338D51F3533; Thu, 23 Jan 2020 14:11:03 +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 483PMC0GLvz3CMm; Thu, 23 Jan 2020 14:11:03 +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 045C4FC89; Thu, 23 Jan 2020 14:11:03 +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 00NEB2qQ090931; Thu, 23 Jan 2020 14:11:02 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00NEB2FA090930; Thu, 23 Jan 2020 14:11:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001231411.00NEB2FA090930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 23 Jan 2020 14:11:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357045 - head/sys/sparc64/sparc64 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/sparc64/sparc64 X-SVN-Commit-Revision: 357045 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 14:11:03 -0000 Author: emaste Date: Thu Jan 23 14:11:02 2020 New Revision: 357045 URL: https://svnweb.freebsd.org/changeset/base/357045 Log: Apply r355819 to sparc64 - fix assertion failure after r355784 From r355819: Repeat the spinlock_enter/exit pattern from amd64 on other architectures to fix an assert violation introduced in r355784. Without this spinlock_exit() may see owepreempt and switch before reducing the spinlock count. amd64 had been optimized to do a single critical enter/exit regardless of the number of spinlocks which avoided the problem and this optimization had not been applied elsewhere. This is completely untested - I have no obsolete Sparc hardware - but someone did try testing recent changes on sparc64 (PR 243534). PR: 243534 Modified: head/sys/sparc64/sparc64/machdep.c Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Thu Jan 23 14:01:03 2020 (r357044) +++ head/sys/sparc64/sparc64/machdep.c Thu Jan 23 14:11:02 2020 (r357045) @@ -224,9 +224,9 @@ spinlock_enter(void) wrpr(pil, 0, PIL_TICK); td->td_md.md_spinlock_count = 1; td->td_md.md_saved_pil = pil; + critical_enter(); } else td->td_md.md_spinlock_count++; - critical_enter(); } void @@ -236,11 +236,12 @@ spinlock_exit(void) register_t pil; td = curthread; - critical_exit(); pil = td->td_md.md_saved_pil; td->td_md.md_spinlock_count--; - if (td->td_md.md_spinlock_count == 0) + if (td->td_md.md_spinlock_count == 0) { + critical_exit(); wrpr(pil, pil, 0); + } } static phandle_t From owner-svn-src-all@freebsd.org Thu Jan 23 14:14:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B72F71F3765; Thu, 23 Jan 2020 14:14:38 +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 483PRL4VMrz3CjW; Thu, 23 Jan 2020 14:14:38 +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 95778FE47; Thu, 23 Jan 2020 14:14:38 +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 00NEEcHp096709; Thu, 23 Jan 2020 14:14:38 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00NEEc4w096708; Thu, 23 Jan 2020 14:14:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001231414.00NEEc4w096708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 23 Jan 2020 14:14:38 +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: r357046 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 357046 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 14:14:38 -0000 Author: markj Date: Thu Jan 23 14:14:38 2020 New Revision: 357046 URL: https://svnweb.freebsd.org/changeset/base/357046 Log: MFC r356563: UMA: Don't destroy zones after the system shutdown process starts. PR: 242427 Modified: stable/11/sys/vm/uma_core.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/uma_core.c ============================================================================== --- stable/11/sys/vm/uma_core.c Thu Jan 23 14:11:02 2020 (r357045) +++ stable/11/sys/vm/uma_core.c Thu Jan 23 14:14:38 2020 (r357046) @@ -153,6 +153,7 @@ static struct sx uma_drain_lock; static int booted = 0; #define UMA_STARTUP 1 #define UMA_STARTUP2 2 +#define UMA_SHUTDOWN 3 /* * This is the handle used to schedule events that need to happen @@ -247,6 +248,7 @@ static int hash_expand(struct uma_hash *, struct uma_h static void hash_free(struct uma_hash *hash); static void uma_timeout(void *); static void uma_startup3(void); +static void uma_shutdown(void); static void *zone_alloc_item(uma_zone_t, void *, int); static void zone_free_item(uma_zone_t, void *, void *, enum zfreeskip); static void bucket_enable(void); @@ -1849,10 +1851,6 @@ uma_startup2(void) #endif } -/* - * Initialize our callout handle - * - */ static void uma_startup3(void) @@ -1865,8 +1863,18 @@ uma_startup3(void) #ifdef UMA_DEBUG printf("UMA startup3 complete.\n"); #endif + + EVENTHANDLER_REGISTER(shutdown_post_sync, uma_shutdown, NULL, + EVENTHANDLER_PRI_FIRST); } +static void +uma_shutdown(void) +{ + + booted = UMA_SHUTDOWN; +} + static uma_keg_t uma_kcreate(uma_zone_t zone, size_t size, uma_init uminit, uma_fini fini, int align, uint32_t flags) @@ -2085,6 +2093,14 @@ void uma_zdestroy(uma_zone_t zone) { + /* + * Large slabs are expensive to reclaim, so don't bother doing + * unnecessary work if we're shutting down. + */ + if (booted == UMA_SHUTDOWN && + zone->uz_fini == NULL && + zone->uz_release == (uma_release)zone_release) + return; sx_slock(&uma_drain_lock); zone_free_item(zones, zone, NULL, SKIP_NONE); sx_sunlock(&uma_drain_lock); From owner-svn-src-all@freebsd.org Thu Jan 23 15:57:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 948971F5BA9; Thu, 23 Jan 2020 15:57:29 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) (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 483Rk06Rpmz3JXf; Thu, 23 Jan 2020 15:57:28 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f46.google.com with SMTP id n11so3415520iom.9; Thu, 23 Jan 2020 07:57:28 -0800 (PST) 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; bh=r2IK8Qx2lVUkkcluKw9PK6PfliV85wPBChY8K58cnvM=; b=taV6SR0rXFliGo2sfjJTwP7GeBkML6AFvSn2eN9gJl3pNoOUwaIXvAljpqIR7wxBjt WSeM3i+3mCAcxOi8nEe4NmoAWta550ltmjt681FooViJ+Rd6FhSbCOt9WyywNkTxv3A0 QPBLyUxSINKrcpEQw7kLI8Kgxzp1HOMDZ9tTAQ0X3OwSmAnwt39tJwxB2SP1fTAN0WUy CDyDJt4win/lP1j5igyQ/mTYzSi5KZ315hsImiFLA70yA8EdxtV/7Q42m66r+fQVTmPp /oKjxKkEs6U87vq4CEDk6NxArN6u62QyxuCQukK9vCNwzsNziIf3KfRZP02kSE13akw5 vZKw== X-Gm-Message-State: APjAAAWJfSuQMM+aCvnDUDfM+/SpgMfzrdtx8IFnwdEqOwNhsHoVqGph TmvbkJoNQx7Mb5i1+3rjW9DktK8RcUJ+f4WwcpAIDA== X-Google-Smtp-Source: APXvYqyqu+brqaKExA9YEdVRyH/YuMrk56tAS2m52D2FD3wGGoHLETfFDgt8DMQaerKYVfl32Mi0NFq09wyQmgHX4ws= X-Received: by 2002:a5e:aa12:: with SMTP id s18mr10926917ioe.182.1579795046538; Thu, 23 Jan 2020 07:57:26 -0800 (PST) MIME-Version: 1.0 References: <202001221840.00MIeKVm084316@repo.freebsd.org> In-Reply-To: <202001221840.00MIeKVm084316@repo.freebsd.org> From: Ed Maste Date: Thu, 23 Jan 2020 10:57:14 -0500 Message-ID: Subject: Re: svn commit: r356990 - head/etc To: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 483Rk06Rpmz3JXf X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.46 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-3.96 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-1.96)[ip: (-4.87), ipnet: 209.85.128.0/17(-3.06), asn: 15169(-1.81), country: US(-0.05)]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[46.166.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[46.166.85.209.rep.mailspike.net : 127.0.0.17]; 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: Thu, 23 Jan 2020 15:57:29 -0000 On Wed, 22 Jan 2020 at 13:40, Ed Maste wrote: > > Author: emaste > Date: Wed Jan 22 18:40:19 2020 > New Revision: 356990 > URL: https://svnweb.freebsd.org/changeset/base/356990 > > Log: > Tag NLS aliases with package=runtime This commit message does not match the change, it should be 'package=utilities'. The symlink is tagged 'package=utilities' matching the NLS data in /usr/share/locale/... From owner-svn-src-all@freebsd.org Thu Jan 23 15:59:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBEEF1F5D1E; Thu, 23 Jan 2020 15:59:30 +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 483RmL52SRz3Jj1; Thu, 23 Jan 2020 15:59:30 +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 A833A191C4; Thu, 23 Jan 2020 15:59:30 +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 00NFxUix055976; Thu, 23 Jan 2020 15:59:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00NFxU3P055975; Thu, 23 Jan 2020 15:59:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001231559.00NFxU3P055975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 23 Jan 2020 15:59:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357047 - head/tests X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tests X-SVN-Commit-Revision: 357047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 15:59:30 -0000 Author: emaste Date: Thu Jan 23 15:59:30 2020 New Revision: 357047 URL: https://svnweb.freebsd.org/changeset/base/357047 Log: Tag /usr/tests/local symlink with package=tests As with the rest of /usr/tests, so that it is handled correctly on pkgbase-installed/updated systems. Sponsored by: The FreeBSD Foundation Modified: head/tests/Makefile Modified: head/tests/Makefile ============================================================================== --- head/tests/Makefile Thu Jan 23 14:14:38 2020 (r357046) +++ head/tests/Makefile Thu Jan 23 15:59:30 2020 (r357047) @@ -15,7 +15,8 @@ SUBDIR_PARALLEL= afterinstall: install-tests-local install-tests-local: .PHONY - ${INSTALL_SYMLINK} ../local/tests ${DESTDIR}${TESTSDIR}/local + ${INSTALL_SYMLINK} -T 'package=tests' \ + ../local/tests ${DESTDIR}${TESTSDIR}/local .include "Makefile.inc0" .include From owner-svn-src-all@freebsd.org Thu Jan 23 16:07:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 910211F6172; Thu, 23 Jan 2020 16:07:28 +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 483RxX3Jb9z3KFs; Thu, 23 Jan 2020 16:07:28 +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 6CE13193DA; Thu, 23 Jan 2020 16:07:28 +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 00NG7S6q062051; Thu, 23 Jan 2020 16:07:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00NG7Spa062050; Thu, 23 Jan 2020 16:07:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001231607.00NG7Spa062050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 23 Jan 2020 16:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357048 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 357048 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 16:07:28 -0000 Author: markj Date: Thu Jan 23 16:07:27 2020 New Revision: 357048 URL: https://svnweb.freebsd.org/changeset/base/357048 Log: arm64: Don't enable interrupts in init_secondary(). Doing so can cause deadlocks or panics during boot, if an interrupt handler accesses uninitialized per-CPU scheduler structures. This seems to occur frequently when running under QEMU or AWS. The idle threads are set up to release a spinlock section and enable interrupts in fork_exit(), so there is no need to enable interrupts earlier. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23328 Modified: head/sys/arm64/arm64/mp_machdep.c Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Thu Jan 23 15:59:30 2020 (r357047) +++ head/sys/arm64/arm64/mp_machdep.c Thu Jan 23 16:07:27 2020 (r357048) @@ -240,18 +240,12 @@ init_secondary(uint64_t cpu) dbg_init(); pan_enable(); - /* Enable interrupts */ - intr_enable(); - mtx_lock_spin(&ap_boot_mtx); - atomic_add_rel_32(&smp_cpus, 1); - if (smp_cpus == mp_ncpus) { /* enable IPI's, tlb shootdown, freezes etc */ atomic_store_rel_int(&smp_started, 1); } - mtx_unlock_spin(&ap_boot_mtx); kcsan_cpu_init(cpu); From owner-svn-src-all@freebsd.org Thu Jan 23 16:10:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 16C631F630F; Thu, 23 Jan 2020 16:10:39 +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 483S1B6tNpz3KTL; Thu, 23 Jan 2020 16:10:38 +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 E771C193F3; Thu, 23 Jan 2020 16:10:38 +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 00NGAcXo062264; Thu, 23 Jan 2020 16:10:38 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00NGAcej062262; Thu, 23 Jan 2020 16:10:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001231610.00NGAcej062262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 23 Jan 2020 16:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357049 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 357049 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 16:10:39 -0000 Author: markj Date: Thu Jan 23 16:10:38 2020 New Revision: 357049 URL: https://svnweb.freebsd.org/changeset/base/357049 Log: Print missing ID_AA64PFR{0,1}_EL1 register fields. MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23213 Modified: head/sys/arm64/arm64/identcpu.c head/sys/arm64/include/armreg.h Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Thu Jan 23 16:07:27 2020 (r357048) +++ head/sys/arm64/arm64/identcpu.c Thu Jan 23 16:10:38 2020 (r357049) @@ -643,6 +643,41 @@ static struct mrs_field id_aa64mmfr2_fields[] = { /* ID_AA64PFR0_EL1 */ +static struct mrs_field_value id_aa64pfr0_csv3[] = { + MRS_FIELD_VALUE(ID_AA64PFR0_CSV3_NONE, ""), + MRS_FIELD_VALUE(ID_AA64PFR0_CSV3_ISOLATED, "CSV3"), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_aa64pfr0_csv2[] = { + MRS_FIELD_VALUE(ID_AA64PFR0_CSV2_NONE, ""), + MRS_FIELD_VALUE(ID_AA64PFR0_CSV2_ISOLATED, "CSV2"), + MRS_FIELD_VALUE(ID_AA64PFR0_CSV2_SCXTNUM, "SCXTNUM"), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_aa64pfr0_dit[] = { + MRS_FIELD_VALUE(ID_AA64PFR0_DIT_NONE, ""), + MRS_FIELD_VALUE(ID_AA64PFR0_DIT_PSTATE, "PSTATE.DIT"), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_aa64pfr0_amu[] = { + MRS_FIELD_VALUE(ID_AA64PFR0_AMU_NONE, ""), + MRS_FIELD_VALUE(ID_AA64PFR0_AMU_V1, "AMUv1"), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_aa64pfr0_mpam[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64PFR0, MPAM, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_aa64pfr0_sel2[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64PFR0, SEL2, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + static struct mrs_field_value id_aa64pfr0_sve[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64PFR0, SVE, NONE, IMPL), MRS_FIELD_VALUE_END, @@ -696,6 +731,12 @@ static struct mrs_field_value id_aa64pfr0_el0[] = { }; static struct mrs_field id_aa64pfr0_fields[] = { + MRS_FIELD(ID_AA64PFR0, CSV3, false, MRS_EXACT, id_aa64pfr0_csv3), + MRS_FIELD(ID_AA64PFR0, CSV2, false, MRS_EXACT, id_aa64pfr0_csv2), + MRS_FIELD(ID_AA64PFR0, DIT, false, MRS_EXACT, id_aa64pfr0_dit), + MRS_FIELD(ID_AA64PFR0, AMU, false, MRS_EXACT, id_aa64pfr0_amu), + MRS_FIELD(ID_AA64PFR0, MPAM, false, MRS_EXACT, id_aa64pfr0_mpam), + MRS_FIELD(ID_AA64PFR0, SEL2, false, MRS_EXACT, id_aa64pfr0_sel2), MRS_FIELD(ID_AA64PFR0, SVE, false, MRS_EXACT, id_aa64pfr0_sve), MRS_FIELD(ID_AA64PFR0, RAS, false, MRS_EXACT, id_aa64pfr0_ras), MRS_FIELD(ID_AA64PFR0, GIC, false, MRS_EXACT, id_aa64pfr0_gic), @@ -710,7 +751,30 @@ static struct mrs_field id_aa64pfr0_fields[] = { /* ID_AA64PFR1_EL1 */ +static struct mrs_field_value id_aa64pfr1_bt[] = { + MRS_FIELD_VALUE(ID_AA64PFR1_BT_NONE, ""), + MRS_FIELD_VALUE(ID_AA64PFR1_BT_IMPL, "BTI"), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_aa64pfr1_ssbs[] = { + MRS_FIELD_VALUE(ID_AA64PFR1_SSBS_NONE, ""), + MRS_FIELD_VALUE(ID_AA64PFR1_SSBS_PSTATE, "PSTATE.SSBS"), + MRS_FIELD_VALUE(ID_AA64PFR1_SSBS_PSTATE_MSR, "PSTATE.SSBS MSR"), + MRS_FIELD_VALUE_END, +}; + +static struct mrs_field_value id_aa64pfr1_mte[] = { + MRS_FIELD_VALUE(ID_AA64PFR1_MTE_NONE, ""), + MRS_FIELD_VALUE(ID_AA64PFR1_MTE_IMPL_EL0, "MTE EL0"), + MRS_FIELD_VALUE(ID_AA64PFR1_MTE_IMPL, "MTE"), + MRS_FIELD_VALUE_END, +}; + static struct mrs_field id_aa64pfr1_fields[] = { + MRS_FIELD(ID_AA64PFR1, BT, false, MRS_EXACT, id_aa64pfr1_bt), + MRS_FIELD(ID_AA64PFR1, SSBS, false, MRS_EXACT, id_aa64pfr1_ssbs), + MRS_FIELD(ID_AA64PFR1, MTE, false, MRS_EXACT, id_aa64pfr1_mte), MRS_FIELD_END, }; @@ -743,6 +807,13 @@ static struct mrs_user_reg user_regs[] = { .Op2 = 0, .offset = __offsetof(struct cpu_desc, id_aa64pfr0), .fields = id_aa64pfr0_fields, + }, + { /* id_aa64pfr0_el1 */ + .reg = ID_AA64PFR1_EL1, + .CRm = 4, + .Op2 = 1, + .offset = __offsetof(struct cpu_desc, id_aa64pfr1), + .fields = id_aa64pfr1_fields, }, { /* id_aa64dfr0_el1 */ .reg = ID_AA64DFR0_EL1, Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Thu Jan 23 16:07:27 2020 (r357048) +++ head/sys/arm64/include/armreg.h Thu Jan 23 16:10:38 2020 (r357049) @@ -517,6 +517,62 @@ #define ID_AA64PFR0_SVE_VAL(x) ((x) & ID_AA64PFR0_SVE_MASK) #define ID_AA64PFR0_SVE_NONE (UL(0x0) << ID_AA64PFR0_SVE_SHIFT) #define ID_AA64PFR0_SVE_IMPL (UL(0x1) << ID_AA64PFR0_SVE_SHIFT) +#define ID_AA64PFR0_SEL2_SHIFT 36 +#define ID_AA64PFR0_SEL2_MASK (UL(0xf) << ID_AA64PFR0_SEL2_SHIFT) +#define ID_AA64PFR0_SEL2_VAL(x) ((x) & ID_AA64PFR0_SEL2_MASK) +#define ID_AA64PFR0_SEL2_NONE (UL(0x0) << ID_AA64PFR0_SEL2_SHIFT) +#define ID_AA64PFR0_SEL2_IMPL (UL(0x1) << ID_AA64PFR0_SEL2_SHIFT) +#define ID_AA64PFR0_MPAM_SHIFT 40 +#define ID_AA64PFR0_MPAM_MASK (UL(0xf) << ID_AA64PFR0_MPAM_SHIFT) +#define ID_AA64PFR0_MPAM_VAL(x) ((x) & ID_AA64PFR0_MPAM_MASK) +#define ID_AA64PFR0_MPAM_NONE (UL(0x0) << ID_AA64PFR0_MPAM_SHIFT) +#define ID_AA64PFR0_MPAM_IMPL (UL(0x1) << ID_AA64PFR0_MPAM_SHIFT) +#define ID_AA64PFR0_AMU_SHIFT 44 +#define ID_AA64PFR0_AMU_MASK (UL(0xf) << ID_AA64PFR0_AMU_SHIFT) +#define ID_AA64PFR0_AMU_VAL(x) ((x) & ID_AA64PFR0_AMU_MASK) +#define ID_AA64PFR0_AMU_NONE (UL(0x0) << ID_AA64PFR0_AMU_SHIFT) +#define ID_AA64PFR0_AMU_V1 (UL(0x1) << ID_AA64PFR0_AMU_SHIFT) +#define ID_AA64PFR0_DIT_SHIFT 48 +#define ID_AA64PFR0_DIT_MASK (UL(0xf) << ID_AA64PFR0_DIT_SHIFT) +#define ID_AA64PFR0_DIT_VAL(x) ((x) & ID_AA64PFR0_DIT_MASK) +#define ID_AA64PFR0_DIT_NONE (UL(0x0) << ID_AA64PFR0_DIT_SHIFT) +#define ID_AA64PFR0_DIT_PSTATE (UL(0x1) << ID_AA64PFR0_DIT_SHIFT) +#define ID_AA64PFR0_CSV2_SHIFT 56 +#define ID_AA64PFR0_CSV2_MASK (UL(0xf) << ID_AA64PFR0_CSV2_SHIFT) +#define ID_AA64PFR0_CSV2_VAL(x) ((x) & ID_AA64PFR0_CSV2_MASK) +#define ID_AA64PFR0_CSV2_NONE (UL(0x0) << ID_AA64PFR0_CSV2_SHIFT) +#define ID_AA64PFR0_CSV2_ISOLATED (UL(0x1) << ID_AA64PFR0_CSV2_SHIFT) +#define ID_AA64PFR0_CSV2_SCXTNUM (UL(0x2) << ID_AA64PFR0_CSV2_SHIFT) +#define ID_AA64PFR0_CSV3_SHIFT 60 +#define ID_AA64PFR0_CSV3_MASK (UL(0xf) << ID_AA64PFR0_CSV3_SHIFT) +#define ID_AA64PFR0_CSV3_VAL(x) ((x) & ID_AA64PFR0_CSV3_MASK) +#define ID_AA64PFR0_CSV3_NONE (UL(0x0) << ID_AA64PFR0_CSV3_SHIFT) +#define ID_AA64PFR0_CSV3_ISOLATED (UL(0x1) << ID_AA64PFR0_CSV3_SHIFT) + +/* ID_AA64PFR1_EL1 */ +#define ID_AA64PFR1_EL1 MRS_REG(3, 0, 0, 4, 1) +#define ID_AA64PFR1_BT_SHIFT 0 +#define ID_AA64PFR1_BT_MASK (UL(0xf) << ID_AA64PFR1_BT_SHIFT) +#define ID_AA64PFR1_BT_VAL(x) ((x) & ID_AA64PFR1_BT_MASK) +#define ID_AA64PFR1_BT_NONE (UL(0x0) << ID_AA64PFR1_BT_SHIFT) +#define ID_AA64PFR1_BT_IMPL (UL(0x1) << ID_AA64PFR1_BT_SHIFT) +#define ID_AA64PFR1_SSBS_SHIFT 4 +#define ID_AA64PFR1_SSBS_MASK (UL(0xf) << ID_AA64PFR1_SSBS_SHIFT) +#define ID_AA64PFR1_SSBS_VAL(x) ((x) & ID_AA64PFR1_SSBS_MASK) +#define ID_AA64PFR1_SSBS_NONE (UL(0x0) << ID_AA64PFR1_SSBS_SHIFT) +#define ID_AA64PFR1_SSBS_PSTATE (UL(0x1) << ID_AA64PFR1_SSBS_SHIFT) +#define ID_AA64PFR1_SSBS_PSTATE_MSR (UL(0x2) << ID_AA64PFR1_SSBS_SHIFT) +#define ID_AA64PFR1_MTE_SHIFT 8 +#define ID_AA64PFR1_MTE_MASK (UL(0xf) << ID_AA64PFR1_MTE_SHIFT) +#define ID_AA64PFR1_MTE_VAL(x) ((x) & ID_AA64PFR1_MTE_MASK) +#define ID_AA64PFR1_MTE_NONE (UL(0x0) << ID_AA64PFR1_MTE_SHIFT) +#define ID_AA64PFR1_MTE_IMPL_EL0 (UL(0x1) << ID_AA64PFR1_MTE_SHIFT) +#define ID_AA64PFR1_MTE_IMPL (UL(0x2) << ID_AA64PFR1_MTE_SHIFT) +#define ID_AA64PFR1_RAS_frac_SHIFT 12 +#define ID_AA64PFR1_RAS_frac_MASK (UL(0xf) << ID_AA64PFR1_RAS_frac_SHIFT) +#define ID_AA64PFR1_RAS_frac_VAL(x) ((x) & ID_AA64PFR1_RAS_frac_MASK) +#define ID_AA64PFR1_RAS_frac_V1 (UL(0x0) << ID_AA64PFR1_RAS_frac_SHIFT) +#define ID_AA64PFR1_RAS_frac_V2 (UL(0x1) << ID_AA64PFR1_RAS_frac_SHIFT) /* MAIR_EL1 - Memory Attribute Indirection Register */ #define MAIR_ATTR_MASK(idx) (0xff << ((n)* 8)) From owner-svn-src-all@freebsd.org Thu Jan 23 16:24:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 008661F6901; Thu, 23 Jan 2020 16:24:52 +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 483SKb5QZhz3LJp; Thu, 23 Jan 2020 16:24:51 +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 B10D119791; Thu, 23 Jan 2020 16:24:51 +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 00NGOpaH073785; Thu, 23 Jan 2020 16:24:51 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00NGOpXl073784; Thu, 23 Jan 2020 16:24:51 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001231624.00NGOpXl073784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 23 Jan 2020 16:24:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357050 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 16:24:52 -0000 Author: markj Date: Thu Jan 23 16:24:51 2020 New Revision: 357050 URL: https://svnweb.freebsd.org/changeset/base/357050 Log: Set td_oncpu before dropping the thread lock during a switch. After r355784 we no longer hold a thread's thread lock when switching it out. Preserve the previous synchronization protocol for td_oncpu by setting it together with td_state, before dropping the thread lock during a switch. Reported and tested by: pho Reviewed by: kib Discussed with: jeff Differential Revision: https://reviews.freebsd.org/D23270 Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Thu Jan 23 16:10:38 2020 (r357049) +++ head/sys/kern/sched_ule.c Thu Jan 23 16:24:51 2020 (r357050) @@ -2121,6 +2121,7 @@ sched_switch(struct thread *td, int flags) */ TDQ_LOCK_ASSERT(tdq, MA_OWNED | MA_NOTRECURSED); newtd = choosethread(); + newtd->td_oncpu = cpuid; sched_pctcpu_update(td_get_sched(newtd), 0); TDQ_UNLOCK(tdq); @@ -2145,7 +2146,6 @@ sched_switch(struct thread *td, int flags) #endif td->td_oncpu = NOCPU; cpu_switch(td, newtd, mtx); - cpuid = td->td_oncpu = PCPU_GET(cpuid); SDT_PROBE0(sched, , , on__cpu); #ifdef HWPMC_HOOKS @@ -2915,6 +2915,7 @@ sched_throw(struct thread *td) thread_lock_block(td); } newtd = choosethread(); + newtd->td_oncpu = PCPU_GET(cpuid); spinlock_enter(); TDQ_UNLOCK(tdq); KASSERT(curthread->td_md.md_spinlock_count == 1, From owner-svn-src-all@freebsd.org Thu Jan 23 16:36:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F70F1F6CBE; Thu, 23 Jan 2020 16:36:59 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 483SbZ6fT3z3Lp1; Thu, 23 Jan 2020 16:36:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF89619977; Thu, 23 Jan 2020 16:36:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00NGawZh080129; Thu, 23 Jan 2020 16:36:58 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00NGawrr080128; Thu, 23 Jan 2020 16:36:58 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001231636.00NGawrr080128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 23 Jan 2020 16:36:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357051 - head/sys/dev/bge X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/dev/bge X-SVN-Commit-Revision: 357051 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 16:36:59 -0000 Author: glebius Date: Thu Jan 23 16:36:58 2020 New Revision: 357051 URL: https://svnweb.freebsd.org/changeset/base/357051 Log: With MSI interrupts bge(4) just schedules taskqueue. Enter the network epoch in the taskqueue handler. Reported by: kib Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Thu Jan 23 16:24:51 2020 (r357050) +++ head/sys/dev/bge/if_bge.c Thu Jan 23 16:36:58 2020 (r357051) @@ -4646,6 +4646,7 @@ bge_msi_intr(void *arg) static void bge_intr_task(void *arg, int pending) { + struct epoch_tracker et; struct bge_softc *sc; if_t ifp; uint32_t status, status_tag; @@ -4688,7 +4689,9 @@ bge_intr_task(void *arg, int pending) sc->bge_rx_saved_considx != rx_prod) { /* Check RX return ring producer/consumer. */ BGE_UNLOCK(sc); + NET_EPOCH_ENTER(et); bge_rxeof(sc, rx_prod, 0); + NET_EPOCH_EXIT(et); BGE_LOCK(sc); } if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) { From owner-svn-src-all@freebsd.org Thu Jan 23 16:45:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0967F1F71C8; Thu, 23 Jan 2020 16:45:11 +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 483Sn26WLmz3MQY; Thu, 23 Jan 2020 16:45:10 +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 D642719B38; Thu, 23 Jan 2020 16:45:10 +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 00NGjADv086144; Thu, 23 Jan 2020 16:45:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00NGjArH086143; Thu, 23 Jan 2020 16:45:10 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001231645.00NGjArH086143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 23 Jan 2020 16:45:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357052 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357052 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 16:45:11 -0000 Author: markj Date: Thu Jan 23 16:45:10 2020 New Revision: 357052 URL: https://svnweb.freebsd.org/changeset/base/357052 Log: vm_map_submap(): Avoid unnecessary clipping. A submap can only be created from an entry spanning the entire request range. In particular, if vm_map_lookup_entry() returns false or the returned entry contains "end". Since the only use of submaps in FreeBSD is for the static pipe and execve argument KVA maps, this has no functional effect. Github PR: https://github.com/freebsd/freebsd/pull/420 Submitted by: Wuyang Chung (original) Reviewed by: dougm, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D23299 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Thu Jan 23 16:36:58 2020 (r357051) +++ head/sys/vm/vm_map.c Thu Jan 23 16:45:10 2020 (r357052) @@ -2477,19 +2477,12 @@ vm_map_submap( vm_map_unlock(submap); vm_map_lock(map); - VM_MAP_RANGE_CHECK(map, start, end); - - if (vm_map_lookup_entry(map, start, &entry)) { + if (vm_map_lookup_entry(map, start, &entry) && entry->end >= end && + (entry->eflags & MAP_ENTRY_COW) == 0 && + entry->object.vm_object == NULL) { vm_map_clip_start(map, entry, start); - } else - entry = vm_map_entry_succ(entry); - - vm_map_clip_end(map, entry, end); - - if ((entry->start == start) && (entry->end == end) && - ((entry->eflags & MAP_ENTRY_COW) == 0) && - (entry->object.vm_object == NULL)) { + vm_map_clip_end(map, entry, end); entry->object.sub_map = submap; entry->eflags |= MAP_ENTRY_IS_SUB_MAP; result = KERN_SUCCESS; From owner-svn-src-all@freebsd.org Thu Jan 23 16:45:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A32801F7263; Thu, 23 Jan 2020 16:45:49 +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 483Snn3lfjz3MYZ; Thu, 23 Jan 2020 16:45:49 +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 7C0BD19B3E; Thu, 23 Jan 2020 16:45:49 +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 00NGjnbp086213; Thu, 23 Jan 2020 16:45:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00NGjnWv086211; Thu, 23 Jan 2020 16:45:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001231645.00NGjnWv086211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 23 Jan 2020 16:45:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357053 - in head: share/man/man4 sys/netgraph X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: share/man/man4 sys/netgraph X-SVN-Commit-Revision: 357053 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 16:45:49 -0000 Author: markj Date: Thu Jan 23 16:45:48 2020 New Revision: 357053 URL: https://svnweb.freebsd.org/changeset/base/357053 Log: ng_nat: Pass IPv6 packets through. ng_nat implements NAT for IPv4 traffic only. When connected to an ng_ether node it erroneously handled IPv6 packets as well. This change is not sufficient: ng_nat does not do any validation of IP packets in this mode, even though they have not yet passed through ip_input(). PR: 243096 Reported by: Robert James Hernandez Reviewed by: julian Differential Revision: https://reviews.freebsd.org/D23080 Modified: head/share/man/man4/ng_nat.4 head/sys/netgraph/ng_nat.c Modified: head/share/man/man4/ng_nat.4 ============================================================================== --- head/share/man/man4/ng_nat.4 Thu Jan 23 16:45:10 2020 (r357052) +++ head/share/man/man4/ng_nat.4 Thu Jan 23 16:45:48 2020 (r357053) @@ -35,7 +35,7 @@ .Sh DESCRIPTION An .Nm -node performs network address translation (NAT) of packets +node performs network address translation (NAT) of IPv4 packets passing through it. A .Nm nat Modified: head/sys/netgraph/ng_nat.c ============================================================================== --- head/sys/netgraph/ng_nat.c Thu Jan 23 16:45:10 2020 (r357052) +++ head/sys/netgraph/ng_nat.c Thu Jan 23 16:45:48 2020 (r357053) @@ -795,7 +795,6 @@ ng_nat_rcvdata(hook_p hook, item_p item ) eh = mtod(m, struct ether_header *); switch (ntohs(eh->ether_type)) { case ETHERTYPE_IP: - case ETHERTYPE_IPV6: ipofs = sizeof(struct ether_header); break; default: From owner-svn-src-all@freebsd.org Thu Jan 23 17:08:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DFD961F7D11; Thu, 23 Jan 2020 17:08:33 +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 483TJ15ZhPz3Nv9; Thu, 23 Jan 2020 17:08:33 +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 BABDA19F3C; Thu, 23 Jan 2020 17:08:33 +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 00NH8X7G098065; Thu, 23 Jan 2020 17:08:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00NH8X2Q098064; Thu, 23 Jan 2020 17:08:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202001231708.00NH8X2Q098064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 Jan 2020 17:08:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357054 - 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: 357054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 17:08:33 -0000 Author: kib Date: Thu Jan 23 17:08:33 2020 New Revision: 357054 URL: https://svnweb.freebsd.org/changeset/base/357054 Log: Fix r356919. Instead of waiting for pc_curthread which is overwritten by init_secondary_tail(), wait for non-NULL pc_curpcb, to be set by the first context switch. Assert that pc_curpcb is not set too early. Reported and tested by: rlibby Reviewed by: markj, rlibby Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D23330 Modified: head/sys/x86/x86/mp_x86.c Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Thu Jan 23 16:45:48 2020 (r357053) +++ head/sys/x86/x86/mp_x86.c Thu Jan 23 17:08:33 2020 (r357054) @@ -1084,6 +1084,11 @@ init_secondary_tail(void) kcsan_cpu_init(cpuid); + /* + * Assert that smp_after_idle_runnable condition is reasonable. + */ + MPASS(PCPU_GET(curpcb) == NULL); + sched_throw(NULL); panic("scheduler returned us to %s", __func__); @@ -1098,7 +1103,7 @@ smp_after_idle_runnable(void *arg __unused) for (cpu = 1; cpu < mp_ncpus; cpu++) { pc = pcpu_find(cpu); - while (atomic_load_ptr(&pc->pc_curthread) == (uintptr_t)NULL) + while (atomic_load_ptr(&pc->pc_curpcb) == (uintptr_t)NULL) cpu_spinwait(); kmem_free((vm_offset_t)bootstacks[cpu], kstack_pages * PAGE_SIZE); From owner-svn-src-all@freebsd.org Thu Jan 23 17:18:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 580081F81A3; Thu, 23 Jan 2020 17:18:59 +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 483TX31hgyz3PSg; Thu, 23 Jan 2020 17:18:59 +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 3557B1A12B; Thu, 23 Jan 2020 17:18:59 +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 00NHIwKw004334; Thu, 23 Jan 2020 17:18:58 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00NHIwq7004333; Thu, 23 Jan 2020 17:18:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001231718.00NHIwq7004333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 23 Jan 2020 17:18:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357055 - head/sys/sparc64/sparc64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/sparc64/sparc64 X-SVN-Commit-Revision: 357055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 17:18:59 -0000 Author: markj Date: Thu Jan 23 17:18:58 2020 New Revision: 357055 URL: https://svnweb.freebsd.org/changeset/base/357055 Log: sparc64: Busy the TSB page before freeing it in pmap_release(). This is now required by vm_page_free(). PR: 243534 Reported and tested by: Michael Reim Modified: head/sys/sparc64/sparc64/pmap.c Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Thu Jan 23 17:08:33 2020 (r357054) +++ head/sys/sparc64/sparc64/pmap.c Thu Jan 23 17:18:58 2020 (r357055) @@ -1302,6 +1302,7 @@ pmap_release(pmap_t pm) m = TAILQ_FIRST(&obj->memq); m->md.pmap = NULL; vm_page_unwire_noq(m); + vm_page_xbusy(m); vm_page_free_zero(m); } VM_OBJECT_WUNLOCK(obj); From owner-svn-src-all@freebsd.org Thu Jan 23 17:38:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0A9C1F89B8; Thu, 23 Jan 2020 17:38:18 +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 483TyL3mLXz3QQL; Thu, 23 Jan 2020 17:38:18 +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 7C7071A4EC; Thu, 23 Jan 2020 17:38:18 +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 00NHcI2R016099; Thu, 23 Jan 2020 17:38:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00NHcIEr016098; Thu, 23 Jan 2020 17:38:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001231738.00NHcIEr016098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 23 Jan 2020 17:38:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357056 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 357056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 17:38:18 -0000 Author: emaste Date: Thu Jan 23 17:38:17 2020 New Revision: 357056 URL: https://svnweb.freebsd.org/changeset/base/357056 Log: add MIPS-specific PT header ELF definitions Submitted by: David Carlier MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19428 Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Thu Jan 23 17:18:58 2020 (r357055) +++ head/sys/sys/elf_common.h Thu Jan 23 17:38:17 2020 (r357056) @@ -543,6 +543,10 @@ typedef struct { #define PT_LOPROC 0x70000000 /* First processor-specific type. */ #define PT_ARM_ARCHEXT 0x70000000 /* ARM arch compat information. */ #define PT_ARM_EXIDX 0x70000001 /* ARM exception unwind tables. */ +#define PT_MIPS_REGINFO 0x70000000 /* MIPS register usage info */ +#define PT_MIPS_RTPROC 0x70000001 /* MIPS runtime procedure tbl */ +#define PT_MIPS_OPTIONS 0x70000002 /* MIPS e_flags value*/ +#define PT_MIPS_ABIFLAGS 0x70000003 /* MIPS fp mode */ #define PT_HIPROC 0x7fffffff /* Last processor-specific type. */ #define PT_OPENBSD_RANDOMIZE 0x65A3DBE6 /* OpenBSD random data segment */ From owner-svn-src-all@freebsd.org Thu Jan 23 18:23:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8AC701F9C2A for ; Thu, 23 Jan 2020 18:23:00 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) (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 483Vxv5Hk4z3xdp for ; Thu, 23 Jan 2020 18:22:59 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by mail-pg1-x530.google.com with SMTP id k3so1785356pgc.3 for ; Thu, 23 Jan 2020 10:22:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jroberson-net.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=My9XuQRnY7xN3vo+Fdj+y561ZEXgb73GZ+dVBJwg0yU=; b=E1+VuxF4dAqsMd5c6wci5JFhuBunhUFTf3uXxkSJqYk/HQXduOwBYcdv/Ay22qlDnM DCgq9QEXt5/AkKl9lRlnqFuyNdQXP0/M6avR8WKiZt/lvOHFYlu7eSfwJcL2Isz8oVH+ UrPxleMebWB66a0gwsuy49JyQsVOyvXeDDBbQX6GsueDHXloSVeQrfmL4RGojxkGoZUQ LNa9bVKgR76b2tzprG1ky+vqxznfCxJfUGnx4tFZHOcc+uCqDaPOmsAW1+VZLqns1Atm 5qSPGVY4YsAQFkakGO45biZ3RjXckjXPVQgiEaZVNhrtm3DuyFTaZRyrw21Ud5jxxD7m bcLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=My9XuQRnY7xN3vo+Fdj+y561ZEXgb73GZ+dVBJwg0yU=; b=hdrKMKlaftGkW2Uuq0qxNma2EYWJInJeNtXDbXNBw27IAi8Cf6H9qTpN7J26q5w5n8 T4XzoxgWcve4AVwlwoGKwDhTcns7VcWy6HedjDubEjQ+BEX8+hfbep7dISB4b+VTFaI5 NCDXmz5mfJuWNEwOP+5UQ8hJU4DLGWmiGmSoWfllYmeGbcNzEH4pq1bcoYVDveV9E+Kb Wx0H/3bgtYCni6nvLCN3xNnoBATPoTP4f/mM/IGGI0hw3jyk0iriJjPvjLIB971wOvob bkFrw5VIsDtdPSYrqvONifAGiwD7rfaTXrBoK69uj3kR/iHye8e8bLA1vIrA9ec0mTzZ qKUQ== X-Gm-Message-State: APjAAAV/yPuw/Qronalag203mQADQeILox0ThdK+m5kV9uoOpNuHtSYv RHwhOlKCBNUVVhKP+GoTyG8dyg== X-Google-Smtp-Source: APXvYqwP9IkBz41VgkkYqDXJr6P76K/Q1nmM1jwZYFQH9kfkS3F2WCzD8dzhBk3EtFfELN3R5z9URA== X-Received: by 2002:aa7:91c1:: with SMTP id z1mr8900260pfa.182.1579803777906; Thu, 23 Jan 2020 10:22:57 -0800 (PST) Received: from rrcs-76-81-105-82.west.biz.rr.com (rrcs-76-81-105-82.west.biz.rr.com. [76.81.105.82]) by smtp.gmail.com with ESMTPSA id c68sm3533321pfc.156.2020.01.23.10.22.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 10:22:57 -0800 (PST) Date: Thu, 23 Jan 2020 08:22:55 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Mark Johnston cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357055 - head/sys/sparc64/sparc64 In-Reply-To: <202001231718.00NHIwq7004333@repo.freebsd.org> Message-ID: References: <202001231718.00NHIwq7004333@repo.freebsd.org> User-Agent: Alpine 2.21.9999 (BSF 287 2018-06-16) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 483Vxv5Hk4z3xdp X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=jroberson-net.20150623.gappssmtp.com header.s=20150623 header.b=E1+VuxF4; dmarc=none; spf=none (mx1.freebsd.org: domain of jroberson@jroberson.net has no SPF policy when checking 2607:f8b0:4864:20::530) smtp.mailfrom=jroberson@jroberson.net X-Spamd-Result: default: False [-4.41 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[jroberson-net.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[jroberson.net]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[jroberson-net.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[0.3.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-2.61)[ip: (-9.09), ipnet: 2607:f8b0::/32(-2.07), asn: 15169(-1.81), country: US(-0.05)] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 18:23:00 -0000 On Thu, 23 Jan 2020, Mark Johnston wrote: > Author: markj > Date: Thu Jan 23 17:18:58 2020 > New Revision: 357055 > URL: https://svnweb.freebsd.org/changeset/base/357055 > > Log: > sparc64: Busy the TSB page before freeing it in pmap_release(). > > This is now required by vm_page_free(). > > PR: 243534 > Reported and tested by: Michael Reim > > Modified: > head/sys/sparc64/sparc64/pmap.c > > Modified: head/sys/sparc64/sparc64/pmap.c > ============================================================================== > --- head/sys/sparc64/sparc64/pmap.c Thu Jan 23 17:08:33 2020 (r357054) > +++ head/sys/sparc64/sparc64/pmap.c Thu Jan 23 17:18:58 2020 (r357055) > @@ -1302,6 +1302,7 @@ pmap_release(pmap_t pm) > m = TAILQ_FIRST(&obj->memq); > m->md.pmap = NULL; > vm_page_unwire_noq(m); > + vm_page_xbusy(m); vm_page_xbusy() is unsafe long-term and I will be removing it as soon as I get patches into drm. It technically 'works' now but not for great reasons. Thanks, Jeff > vm_page_free_zero(m); > } > VM_OBJECT_WUNLOCK(obj); > From owner-svn-src-all@freebsd.org Thu Jan 23 19:09:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7BA571FAD63; Thu, 23 Jan 2020 19:09:01 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) (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 483Wz05Sf6z40hq; Thu, 23 Jan 2020 19:09:00 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x734.google.com with SMTP id v195so4518127qkb.11; Thu, 23 Jan 2020 11:09:00 -0800 (PST) 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; bh=xiHfADZjhYz7UeEHFWuCaD/lXK/DK4+9KnVP95p8AwE=; b=cDRRpoHrJDBVnTtXCKJ4SLVYUYveeXBQCwIx61QIK9+hjw7N3rtejC4RWzGn4/TWMF YMo0JlJjqcDAc9SFVKtB6xJ7i/rvw3dVJUtpi2YFKXU1PNCYk6aHns5BA80YZaCuaZs4 yrlqYZKag35zVG9mPaM1wDk4cnTB4wjIncmJtsgNOuIbQQGEWhs7d6uBtwBGJlnDFkT2 Gr3DllfyVSQKZ8YNbDqfZLkdsOrqJZnCRQo192Yb1VKgEIJZeBVieaQ/PGnfZMU/wjpX NXzUwMtg0eAJeqWDElVeqatc3d0238KhL8akxZARXRVuJVbKUBzai7QPtWD6QOYOSEW+ t4qQ== 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; bh=xiHfADZjhYz7UeEHFWuCaD/lXK/DK4+9KnVP95p8AwE=; b=EATPDYIWAnoebYNLeWzRwxZQPICnJkKEcqdyQamZtfmfMI1Tb8mEWOcTTUjhDyRhxA ArNBy2jw3j5GIlTT+jYttO+DlVXrAKAyqv+Rjs2KKEHfeAmbLeucsmtaIq/KVlbi5Pe/ SlclAsQVKvBvwo1rZYCWfKRCXQZLwLsdTpDmf8nRTNklbTUfhd7VaccQnkHcEOCNmEBZ E9E3Ue0kFHTInNCo817PfRA//q7nMH3XjUdccwlqglAXXPrRW0bsZGzX/TsZKNEsAkwd l+fuarnXO/Haul/ujM3rb4lQf5+v7UCn0wuX6cF5/fk4IwKyGvV2VCPxIu85ar3OdgDj UpEA== X-Gm-Message-State: APjAAAUrFiHxa9M1YCGeyBIhIS9NPTH2kPogMdXtNcusaZ71YkICgS6s dVUEtrW29xrlGXuaeXDLqAcq4E6B X-Google-Smtp-Source: APXvYqynZvOqV+Z8AbmWm573glzrUOn0VvE3WRr2gwLtiDGTt2xrkRK1aJXf9jqXrHaNuJ3PLw8Mxg== X-Received: by 2002:a05:620a:15b3:: with SMTP id f19mr16914686qkk.362.1579806538143; Thu, 23 Jan 2020 11:08:58 -0800 (PST) Received: from spy (ip-45-3-14-96.user.start.ca. [45.3.14.96]) by smtp.gmail.com with ESMTPSA id 124sm1397641qko.11.2020.01.23.11.08.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2020 11:08:57 -0800 (PST) Sender: Mark Johnston Date: Thu, 23 Jan 2020 14:08:55 -0500 From: Mark Johnston To: Jeff Roberson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357055 - head/sys/sparc64/sparc64 Message-ID: <20200123190855.GC87818@spy> References: <202001231718.00NHIwq7004333@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 483Wz05Sf6z40hq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=cDRRpoHr; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::734 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-4.33 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; 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_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[4.3.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.63)[ip: (-9.23), ipnet: 2607:f8b0::/32(-2.07), asn: 15169(-1.81), country: US(-0.05)]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.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, 23 Jan 2020 19:09:01 -0000 On Thu, Jan 23, 2020 at 08:22:55AM -1000, Jeff Roberson wrote: > On Thu, 23 Jan 2020, Mark Johnston wrote: > > > Author: markj > > Date: Thu Jan 23 17:18:58 2020 > > New Revision: 357055 > > URL: https://svnweb.freebsd.org/changeset/base/357055 > > > > Log: > > sparc64: Busy the TSB page before freeing it in pmap_release(). > > > > This is now required by vm_page_free(). > > > > PR: 243534 > > Reported and tested by: Michael Reim > > > > Modified: > > head/sys/sparc64/sparc64/pmap.c > > > > Modified: head/sys/sparc64/sparc64/pmap.c > > ============================================================================== > > --- head/sys/sparc64/sparc64/pmap.c Thu Jan 23 17:08:33 2020 (r357054) > > +++ head/sys/sparc64/sparc64/pmap.c Thu Jan 23 17:18:58 2020 (r357055) > > @@ -1302,6 +1302,7 @@ pmap_release(pmap_t pm) > > m = TAILQ_FIRST(&obj->memq); > > m->md.pmap = NULL; > > vm_page_unwire_noq(m); > > + vm_page_xbusy(m); > > vm_page_xbusy() is unsafe long-term and I will be removing it as soon as I > get patches into drm. It technically 'works' now but not for great reasons. Yeah, this is just to satisfy the interface contract. These pages are unmanaged, so it really shouldn't make a difference. > Thanks, > Jeff > > > vm_page_free_zero(m); > > } > > VM_OBJECT_WUNLOCK(obj); > > From owner-svn-src-all@freebsd.org Thu Jan 23 19:14:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C7EA01FB19A; Thu, 23 Jan 2020 19:14:46 +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 483X5f3QcRz41FC; Thu, 23 Jan 2020 19:14:46 +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 00NJEhIm030648; Thu, 23 Jan 2020 11:14:43 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 00NJEhsM030647; Thu, 23 Jan 2020 11:14:43 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202001231914.00NJEhsM030647@gndrsh.dnsmgr.net> Subject: Re: svn commit: r356990 - head/etc In-Reply-To: To: Ed Maste Date: Thu, 23 Jan 2020 11:14:43 -0800 (PST) CC: src-committers , svn-src-all , svn-src-head 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: 483X5f3QcRz41FC X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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: Thu, 23 Jan 2020 19:14:46 -0000 [ Charset UTF-8 unsupported, converting... ] > On Wed, 22 Jan 2020 at 13:40, Ed Maste wrote: > > > > Author: emaste > > Date: Wed Jan 22 18:40:19 2020 > > New Revision: 356990 > > URL: https://svnweb.freebsd.org/changeset/base/356990 > > > > Log: > > Tag NLS aliases with package=runtime > > This commit message does not match the change, it should be > 'package=utilities'. The symlink is tagged 'package=utilities' > matching the NLS data in /usr/share/locale/... > Revert and recommit? Note that this email message well not be found by anyone looking at svn logs trying to find stuff. IMHO any commit message that does not match the actual commit should be reverted and recommitted with the correct message. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Jan 23 19:17:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 426A11FB299; Thu, 23 Jan 2020 19:17:46 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) (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 483X9613Tmz41PX; Thu, 23 Jan 2020 19:17:45 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-qk1-x731.google.com with SMTP id q15so4581953qke.9; Thu, 23 Jan 2020 11:17:45 -0800 (PST) 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=LR/fUHcL+7cwfeLjLBCZWJAeb2WKFcwV8TpqDiP6bY0=; b=YDhoM69DbEA5M9lTwg0mf15tuaQVDL1gi/IuGwGwrVH2lKGoh2FA6EL7I9G+zq/U8W Gtwwnn2Mpxz1PNkdZfVKr6AsDgT721paR5e+ge530xCL75ydlw+iSDxI0e2cvaJvYMYG kPCfei2EAaYvKIULpJI2YoBrNVMLx8KRJFUuMY9QhXTPBZ0tJP+KuCkvSjcX0qTn4YER eIqb+HAGshbO78XNfUi4QdZINFPxZbyYjoIXYT/IUByiqFL08gl1McNjIl+SpB4PAjpD LqzV1qfHPQSajZIHPck4zP6rt0MNVqKpNcIXzoKCBVBBHm7ug/zzJuwPqw2d8qeBubpw AxXA== 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=LR/fUHcL+7cwfeLjLBCZWJAeb2WKFcwV8TpqDiP6bY0=; b=I1cYrqgrf6DkBJLkHaCLRVeqseN+7dPe8Z85mVrZsWLXs0TxH7yL12wGSK3874P+SL oUVTFGYUCW0Kjw+1aM6wXciZ55VzTYoWlKdvkOvMGVU/bGZrYmmHcjtxFF9u6AcQHhte abVkBsFmaUN6Gwf6ZSjV4Pd3X3MMINv66jrODqyhIbILgKMKumogUz7C9UBeUtXrbLCT sdWFklwMdQHC77GpEzUuUm1NBLG/YN4QN2FV76ynW0fj/iShIkWJXQX78lpOCI5ynxX1 eX4RyI+H2eucsUyn3KnqBz5xHs2jokiTh4qMGQGxpDkLGQLOmaiD9IAzdljv8vCoQ9Am sHHA== X-Gm-Message-State: APjAAAU9biyuuomdAdemrdAdp7yEjFzOzmDy9y6GQk9Up31oSBMXAb1M CjhuX9ZivKGS1k0hkIJWhBTcN8BREXRUSvXLqxQPGkzM X-Google-Smtp-Source: APXvYqwCfXO1rjdPoX2nm9uiQ3pncgUBUiTiQP3De2aSyFkRuWlPsQnEYu0f+VWB62At2GZJaoDjpPBK0zst0dFZaZk= X-Received: by 2002:a05:620a:1478:: with SMTP id j24mr16533666qkl.363.1579807064543; Thu, 23 Jan 2020 11:17:44 -0800 (PST) MIME-Version: 1.0 References: <202001231636.00NGawrr080128@repo.freebsd.org> In-Reply-To: <202001231636.00NGawrr080128@repo.freebsd.org> From: Ryan Stone Date: Thu, 23 Jan 2020 14:17:33 -0500 Message-ID: Subject: Re: svn commit: r357051 - head/sys/dev/bge To: Gleb Smirnoff Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 483X9613Tmz41PX X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,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: Thu, 23 Jan 2020 19:17:46 -0000 What is a driver's responsibility now for entering/leaving the net epoch now? From owner-svn-src-all@freebsd.org Thu Jan 23 20:02:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B98B31FC6B8; Thu, 23 Jan 2020 20:02:32 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (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 483Y8m4WFrz43dD; Thu, 23 Jan 2020 20:02:32 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f44.google.com with SMTP id b18so4020081otp.0; Thu, 23 Jan 2020 12:02:32 -0800 (PST) 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=+WknDnLW9YP/oo6LMa5CmfawK4WnuKbfV5hG8hLcsr0=; b=JKv62OU4or7SFW531LdIhbCJ+HGDAqvQsvJnUf7DZs8gBoL2z7Vd962NAv5AIMnsn2 XOJYsziA0ebGIveFZAwDnCi1hI9QKqA4H9DHdlTMwJRBFAVJXRTQe9g94bmn4MlTV8qc jXZQdz1IRXID1lGHL/KZQGenzKSYQixYFBoqidGSlWtoyeIvGT0AgH76UfWC+854udK5 pHFnvSjpphqRrt0snzzgyf3rjQq82Ga3pKNmDXTuBfm5+e9nHozbmLYq4XkEQCF6DurY 0II21e0bJ/5nspqec96LOROTdORgByMrOeBFfHVhCiiInh45u6QVI6qCm1UutxOk57G0 AxMA== X-Gm-Message-State: APjAAAVO5X/HCTYk+QEJb2n+E8mAZqJUje5lghxBDcKN2oVY2/7Hmn44 tK2sENJvenUl8lLCpajfIoHu1ngH X-Google-Smtp-Source: APXvYqwOlXkY7fcV889hbxIVlN+N2QuK3S+r8m5kIj5p5bzYKYgO07Gbu2xjoR2edh1cWGot65XVRw== X-Received: by 2002:a05:6830:1f13:: with SMTP id u19mr19436otg.237.1579809750632; Thu, 23 Jan 2020 12:02:30 -0800 (PST) Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com. [209.85.210.46]) by smtp.gmail.com with ESMTPSA id u33sm1148697otb.49.2020.01.23.12.02.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Jan 2020 12:02:29 -0800 (PST) Received: by mail-ot1-f46.google.com with SMTP id a15so4006081otf.1; Thu, 23 Jan 2020 12:02:29 -0800 (PST) X-Received: by 2002:a05:6830:1116:: with SMTP id w22mr52060otq.216.1579809748526; Thu, 23 Jan 2020 12:02:28 -0800 (PST) MIME-Version: 1.0 References: <202001222328.00MNSh8a058358@repo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Thu, 23 Jan 2020 12:02:17 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r357002 - in head: share/man/man4 sys/conf sys/kern sys/modules/cpufreq sys/sys sys/x86/cpufreq To: Ravi Pokala Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 483Y8m4WFrz43dD X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,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: Thu, 23 Jan 2020 20:02:32 -0000 (I had to look that up.) Yeah, they're different. Speedstep is est(4), the ~15-year old predecessor to Speedshift. They serve similar purposes but purportedly (and plausibly) Speedshift does a better job; also SpeedStep is maybe going away entirely in newer CPUs. Current gens like Skylake and Kabylake have silicon for both, but if intel_hwpstate(4) is enabled, est(4) doesn't work; hence the kludge in est(4) to avoid "identifying" if intel_hwpstate(4) successfully identified (wasn't disabled && new enough CPU). Best, Conrad On Thu, Jan 23, 2020 at 12:55 AM Ravi Pokala wrote: > > -----Original Message----- > From: on behalf of Conrad Meyer > Date: 2020-01-22, Wednesday at 15:28 > To: , , > Subject: svn commit: r357002 - in head: share/man/man4 sys/conf sys/kern sys/modules/cpufreq sys/sys sys/x86/cpufreq > > Author: cem > Date: Wed Jan 22 23:28:42 2020 > New Revision: 357002 > URL: https://svnweb.freebsd.org/changeset/base/357002 > > Log: > cpufreq(4): Add support for Intel Speed Shift > > Intel Speed Shift is Intel's technology to control frequency in hardware, > with hints from software. > > Not to be confused with Intel Speed *Step*, right? > > (/me was confused; naming things is hard) > > -Ravi (rpokala@) > > Let's get a working version of this in the tree and we can refine it from > here. > > Submitted by: bwidawsk, scottph > Reviewed by: bcr (manpages), myself > Discussed with: jhb, kib (earlier versions) > With feedback from: Greg V, gallatin, freebsdnewbie AT freenet.de > Relnotes: yes > Differential Revision: https://reviews.freebsd.org/D18028 > > > From owner-svn-src-all@freebsd.org Thu Jan 23 20:08:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77EC61FC835; Thu, 23 Jan 2020 20:08:57 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (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 483YJ81lYWz43rZ; Thu, 23 Jan 2020 20:08:55 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id uimbiQq3UnCiguimciSpnI; Thu, 23 Jan 2020 13:08:54 -0700 X-Authority-Analysis: v=2.3 cv=cZisUULM c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=Jdjhy38mL1oA:10 a=iKhvJSA4AAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=VU2bLBZjRnzdwElNX3MA:9 a=CjuIK1q_8ugA:10 a=odh9cflL3HIXMm4fY7Wr:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 6FC7E4AC; Thu, 23 Jan 2020 12:08:51 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id 00NK8n28016355; Thu, 23 Jan 2020 12:08:49 -0800 (PST) (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 00NK8n5t016351; Thu, 23 Jan 2020 12:08:49 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202001232008.00NK8n5t016351@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 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: rgrimes@freebsd.org cc: Ed Maste , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r356990 - head/etc In-reply-to: <202001231914.00NJEhsM030647@gndrsh.dnsmgr.net> References: <202001231914.00NJEhsM030647@gndrsh.dnsmgr.net> Comments: In-reply-to "Rodney W. Grimes" message dated "Thu, 23 Jan 2020 11:14:43 -0800." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 23 Jan 2020 12:08:49 -0800 X-CMAE-Envelope: MS4wfEiaLNvIk7hG8/79T35SaJ/OBmGOIy73neugfUDryKr7wA8B7qsFm3Qx2JVSnbkdFLr0n6mr24YI5QR2D1PthORMQdogLhMnyncHheNyNPwOrAWJ7RUB OjWrfObt0o377pccKAI/bds4K80eJTTEHNVXqBL9LJu1JIyNSzw6poTRQTOROYPbNRnAJB0ih2fiNIqmlRhYlzbOBZC3XJmGqbWtz51GFWVk6jERYu/NN/PC dUVWBNx0Pvnfqm2lwnXMV0P3JlR1QoRzabd4y16NwCk9JwW9ypOb3taliXs/TBQ/n9zBgMKZ0uc4E7JAGVh1yA== X-Rspamd-Queue-Id: 483YJ81lYWz43rZ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.134.12) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-4.14 / 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)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RWL_MAILSPIKE_GOOD(0.00)[12.134.59.64.rep.mailspike.net : 127.0.0.18]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; IP_SCORE(-2.45)[ip: (-6.50), ipnet: 64.59.128.0/20(-3.17), asn: 6327(-2.46), country: CA(-0.09)]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[12.134.59.64.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(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, 23 Jan 2020 20:08:57 -0000 In message <202001231914.00NJEhsM030647@gndrsh.dnsmgr.net>, "Rodney W. Grimes" writes: > [ Charset UTF-8 unsupported, converting... ] > > On Wed, 22 Jan 2020 at 13:40, Ed Maste wrote: > > > > > > Author: emaste > > > Date: Wed Jan 22 18:40:19 2020 > > > New Revision: 356990 > > > URL: https://svnweb.freebsd.org/changeset/base/356990 > > > > > > Log: > > > Tag NLS aliases with package=runtime > > > > This commit message does not match the change, it should be > > 'package=utilities'. The symlink is tagged 'package=utilities' > > matching the NLS data in /usr/share/locale/... > > > > Revert and recommit? Note that this email message well not > be found by anyone looking at svn logs trying to find stuff. > > IMHO any commit message that does not match the actual commit > should be reverted and recommitted with the correct message. +1. It helps those who follow to inform them before deciding whether to dig into the code or not. -- 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 Jan 23 22:13:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2071D1FF8B7; Thu, 23 Jan 2020 22:13:42 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 483c4602vzz4BBj; Thu, 23 Jan 2020 22:13:42 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0E7D1D934; Thu, 23 Jan 2020 22:13:41 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00NMDfhP082708; Thu, 23 Jan 2020 22:13:41 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00NMDfsl082707; Thu, 23 Jan 2020 22:13:41 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202001232213.00NMDfsl082707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 23 Jan 2020 22:13:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357061 - head/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/netpfil/pf X-SVN-Commit-Revision: 357061 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 22:13:42 -0000 Author: kp Date: Thu Jan 23 22:13:41 2020 New Revision: 357061 URL: https://svnweb.freebsd.org/changeset/base/357061 Log: pf: Apply kif flags to new group members If we have a 'set skip on ' rule this flag it set on the group kif, but must also be set on all members. pfctl does this when the rules are set, but if groups are added afterwards we must also apply the flags to the new member. If not, new group members will not be skipped until the rules are reloaded. Reported by: dvl@ Reviewed by: glebius@ Differential Revision: https://reviews.freebsd.org/D23254 Modified: head/sys/netpfil/pf/pf_if.c Modified: head/sys/netpfil/pf/pf_if.c ============================================================================== --- head/sys/netpfil/pf/pf_if.c Thu Jan 23 21:46:33 2020 (r357060) +++ head/sys/netpfil/pf/pf_if.c Thu Jan 23 22:13:41 2020 (r357061) @@ -477,7 +477,9 @@ static void pfi_kif_update(struct pfi_kif *kif) { struct ifg_list *ifgl; + struct ifg_member *ifgm; struct pfi_dynaddr *p; + struct pfi_kif *tmpkif; NET_EPOCH_ASSERT(); PF_RULES_WASSERT(); @@ -485,6 +487,18 @@ pfi_kif_update(struct pfi_kif *kif) /* update all dynaddr */ TAILQ_FOREACH(p, &kif->pfik_dynaddrs, entry) pfi_dynaddr_update(p); + + /* Apply group flags to new members. */ + if (kif->pfik_group != NULL) { + CK_STAILQ_FOREACH(ifgm, &kif->pfik_group->ifg_members, + ifgm_next) { + tmpkif = (struct pfi_kif *)ifgm->ifgm_ifp->if_pf_kif; + if (tmpkif == NULL) + continue; + + tmpkif->pfik_flags |= kif->pfik_flags; + } + } /* again for all groups kif is member of */ if (kif->pfik_ifp != NULL) { From owner-svn-src-all@freebsd.org Thu Jan 23 23:05:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E38402284FF; Thu, 23 Jan 2020 23:05:50 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 483dDG0CY1z4DBG; Thu, 23 Jan 2020 23:05:49 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 00NN5kIO008285 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 23 Jan 2020 15:05:47 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 00NN5kt2008284; Thu, 23 Jan 2020 15:05:46 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Thu, 23 Jan 2020 15:05:46 -0800 From: Gleb Smirnoff To: Ryan Stone Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r357051 - head/sys/dev/bge Message-ID: <20200123230546.GG1268@FreeBSD.org> References: <202001231636.00NGawrr080128@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 483dDG0CY1z4DBG X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-0.85 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.88)[-0.884,0]; NEURAL_SPAM_LONG(0.03)[0.030,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, 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, 23 Jan 2020 23:05:51 -0000 On Thu, Jan 23, 2020 at 02:17:33PM -0500, Ryan Stone wrote: R> What is a driver's responsibility now for entering/leaving the net epoch now? For drivers that are 'special', entering the net epoch is necessary. Special usually means running if_input outside network interrupt context. However, there is plan to generalize entering/exiting epoch for taskqueues and callouts. -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Thu Jan 23 23:08:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 624EB2285AC for ; Thu, 23 Jan 2020 23:08:36 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 483dHS011qz4DKJ for ; Thu, 23 Jan 2020 23:08:35 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1579820914; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=t2AdeC6XJMi24+APXOVw2kRx288yjQxyn1bXiQUhTyY/BanluqWaIXciIqpO55LFHpAwNaUY7fYAT PSsVJHFh56BB/k1yocVEouwD1XPI4Q1CNlD0M87qKxBNJPD3J1IlGdicIZv1ZDf9y/Mi6EmkMlGj+E wAG48ru/cWGx6w9Zu+RYpuQtYT33MV0kM1LuUGK5K9dTSkgCBavMQHoe1zw63yhBqAM4pKuibNZk3E WVUGeaxH5DQulfB/TmZbSIfkEzRP5s4qUoMG+xriIpeW870HIhP0QtnIoDddGXfdoYfkMjg0uCpp1y 9xeRCdiMdCpPM9nlJFseW6ZO++Ttfrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=IJufiYwS1GJ4POj5CxHySbWJz04/V1bevv9I44esIW8=; b=skXqNkcbWPGsVtSXLQrfX0/jM/4CHeBTvr/BLvCCVW60b3UpWjEAnrvr/bbNbZrV48Oj8Y/ZkeWrM +GbohmG1wALcBr1AtTwS1PKWc6toqqgnTxMMsY52UihOqsb9SqIO3mL/Im7sWcqp9ViJ0jWpszM7Pe 4N/wD4bNy1xyn0EhLdo4ONcgf+ctLAGzgWw9I8vXE/9FGdfut0RbOLaVyTWa9TsDZis2Px1Ym8YGAZ chr9XgQ/cevqYJsU3w1yjyCJi6MUlS02qFiCWKxkp4nC2c7akm0Jvvz9ggSriTwelBQGAsK/Pun3HU t1ciiVpAyTMLLnuGPbMNUtRpDms26nQ== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=IJufiYwS1GJ4POj5CxHySbWJz04/V1bevv9I44esIW8=; b=w/NAnZT/P4i0NdptVtPgaeqqbtq3p2m1ZRQm+CbabulKbKC56KGo7XteCchgtWzXUqcemYSJWRg1j UqH2oEKTdc0FypAvxVFWQRSZQtIMDMHaohd7R1cKO97aXmqxvqHxD+RY3bddrGrfEEH0GaF2NLYtps CN7J0i4lt8DmoElhp/QVyEw6Oa9ASWiBHUycMIMkS1PHLkEEN5MVsvJm6QQAbIhZDjD50sM3B4YZy5 5iNy4GPcor+/DGM8G8SBiilzBoJThC7ptDZkkmurlGwEX5gxmgfHDYlJwS62AW/GLSn9UftfqRDL0V f0C0Tz8UIulMhTL71wvX2BXE9FAYv0g== X-MHO-RoutePath: aGlwcGll X-MHO-User: 469ad8f4-3e35-11ea-9eb3-25e2dfa9fa8d X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 469ad8f4-3e35-11ea-9eb3-25e2dfa9fa8d; Thu, 23 Jan 2020 23:08:33 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 00NN8WUq094066; Thu, 23 Jan 2020 16:08:32 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r357051 - head/sys/dev/bge From: Ian Lepore To: Gleb Smirnoff , Ryan Stone Cc: src-committers , svn-src-all , svn-src-head Date: Thu, 23 Jan 2020 16:08:32 -0700 In-Reply-To: <20200123230546.GG1268@FreeBSD.org> References: <202001231636.00NGawrr080128@repo.freebsd.org> <20200123230546.GG1268@FreeBSD.org> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 483dHS011qz4DKJ X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.83 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.97)[-0.969,0]; NEURAL_HAM_LONG(-0.86)[-0.861,0]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, 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, 23 Jan 2020 23:08:36 -0000 On Thu, 2020-01-23 at 15:05 -0800, Gleb Smirnoff wrote: > On Thu, Jan 23, 2020 at 02:17:33PM -0500, Ryan Stone wrote: > R> What is a driver's responsibility now for entering/leaving the net epoch now? > > For drivers that are 'special', entering the net epoch is necessary. Special > usually means running if_input outside network interrupt context. > > However, there is plan to generalize entering/exiting epoch for taskqueues > and callouts. > That sounds every bit as horrible and out-of-place as the recent hack (and it does feel very much like a horrible hack) that put network- specific code into the guts of interrupt dispatching. -- Ian From owner-svn-src-all@freebsd.org Thu Jan 23 23:12:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62B9B2287A0; Thu, 23 Jan 2020 23:12:14 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 483dMf0XBtz4DjG; Thu, 23 Jan 2020 23:12:13 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 00NNCAoa008350 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 23 Jan 2020 15:12:10 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 00NNCABU008349; Thu, 23 Jan 2020 15:12:10 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Thu, 23 Jan 2020 15:12:10 -0800 From: Gleb Smirnoff To: Ian Lepore Cc: Ryan Stone , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r357051 - head/sys/dev/bge Message-ID: <20200123231210.GH1268@FreeBSD.org> References: <202001231636.00NGawrr080128@repo.freebsd.org> <20200123230546.GG1268@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 483dMf0XBtz4DjG X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-0.99)[-0.993,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, 23 Jan 2020 23:12:14 -0000 On Thu, Jan 23, 2020 at 04:08:32PM -0700, Ian Lepore wrote: I> On Thu, 2020-01-23 at 15:05 -0800, Gleb Smirnoff wrote: I> > On Thu, Jan 23, 2020 at 02:17:33PM -0500, Ryan Stone wrote: I> > R> What is a driver's responsibility now for entering/leaving the net epoch now? I> > I> > For drivers that are 'special', entering the net epoch is necessary. Special I> > usually means running if_input outside network interrupt context. I> > I> > However, there is plan to generalize entering/exiting epoch for taskqueues I> > and callouts. I> > I> I> That sounds every bit as horrible and out-of-place as the recent hack I> (and it does feel very much like a horrible hack) that put network- I> specific code into the guts of interrupt dispatching. It isn't really a network code. You just include which declares the epoch KPI and a few globally recognized epochs. For now the only one is the network epoch. If you want to have for a example a disk epoch also supported by interrupt code, that would add one extra declaration to epoch.h, and again nothing really disk related. -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Thu Jan 23 23:36:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C35C3228B79; Thu, 23 Jan 2020 23:36:58 +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 483dwB4XTxz4FRY; Thu, 23 Jan 2020 23:36:58 +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 925081E7F2; Thu, 23 Jan 2020 23:36:58 +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 00NNawEi029873; Thu, 23 Jan 2020 23:36:58 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00NNawjE029872; Thu, 23 Jan 2020 23:36:58 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202001232336.00NNawjE029872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 23 Jan 2020 23:36:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357062 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 357062 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 23:36:58 -0000 Author: jhb Date: Thu Jan 23 23:36:58 2020 New Revision: 357062 URL: https://svnweb.freebsd.org/changeset/base/357062 Log: Correct the return types of fueword*(). MFC after: 1 week Sponsored by: DARPA Modified: head/share/man/man9/fetch.9 Modified: head/share/man/man9/fetch.9 ============================================================================== --- head/share/man/man9/fetch.9 Thu Jan 23 22:13:41 2020 (r357061) +++ head/share/man/man9/fetch.9 Thu Jan 23 23:36:58 2020 (r357062) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 17, 2018 +.Dd January 23, 2020 .Dt FETCH 9 .Os .Sh NAME @@ -61,11 +61,11 @@ .Fn fuword32 "volatile const void *base" .Ft int64_t .Fn fuword64 "volatile const void *base" -.Ft long +.Ft int .Fn fueword "volatile const void *base" "long *val" -.Ft int32_t +.Ft int .Fn fueword32 "volatile const void *base" "int32_t *val" -.Ft int64_t +.Ft int .Fn fueword64 "volatile const void *base" "int64_t *val" .In sys/resourcevar.h .Sh DESCRIPTION From owner-svn-src-all@freebsd.org Thu Jan 23 23:52:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8012229011; Thu, 23 Jan 2020 23:52:57 +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 483fGd4Tl7z4GCB; Thu, 23 Jan 2020 23:52:57 +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 954C21EB77; Thu, 23 Jan 2020 23:52:57 +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 00NNqvIp041476; Thu, 23 Jan 2020 23:52:57 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00NNqvJ7041475; Thu, 23 Jan 2020 23:52:57 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001232352.00NNqvJ7041475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 23 Jan 2020 23:52:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357063 - head/sys/x86/cpufreq X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/x86/cpufreq X-SVN-Commit-Revision: 357063 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 23 Jan 2020 23:52:57 -0000 Author: cem Date: Thu Jan 23 23:52:57 2020 New Revision: 357063 URL: https://svnweb.freebsd.org/changeset/base/357063 Log: cpufreq(4): Fix missing MODULE_DEPEND on hwpstate_intel DRIVER_MODULE does not actually define a MODULE_VERSION, which is required to satisfy a MODULE_DEPENDency. Declare one explicitly in hwpstate_intel(4). Reported by: flo X-MFC-With: r357002 Modified: head/sys/x86/cpufreq/hwpstate_intel.c Modified: head/sys/x86/cpufreq/hwpstate_intel.c ============================================================================== --- head/sys/x86/cpufreq/hwpstate_intel.c Thu Jan 23 23:36:58 2020 (r357062) +++ head/sys/x86/cpufreq/hwpstate_intel.c Thu Jan 23 23:52:57 2020 (r357063) @@ -106,6 +106,7 @@ static driver_t hwpstate_intel_driver = { DRIVER_MODULE(hwpstate_intel, cpu, hwpstate_intel_driver, hwpstate_intel_devclass, NULL, NULL); +MODULE_VERSION(hwpstate_intel, 1); static int intel_hwp_dump_sysctl_handler(SYSCTL_HANDLER_ARGS) From owner-svn-src-all@freebsd.org Fri Jan 24 01:00:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2092422A13A; Fri, 24 Jan 2020 01:00:29 +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 483gmY067Mz4JSm; Fri, 24 Jan 2020 01:00:29 +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 F32E21F652; Fri, 24 Jan 2020 01:00:28 +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 00O10SIP077013; Fri, 24 Jan 2020 01:00:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00O10Sgj077012; Fri, 24 Jan 2020 01:00:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001240100.00O10Sgj077012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 24 Jan 2020 01:00:28 +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: r357064 - stable/12/share/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/share/mk X-SVN-Commit-Revision: 357064 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 01:00:29 -0000 Author: emaste Date: Fri Jan 24 01:00:28 2020 New Revision: 357064 URL: https://svnweb.freebsd.org/changeset/base/357064 Log: MFC r356836: src.opts.mk: force DMAGENT off under WITHOUT_OPENSSL dma(8) depends on OpenSSL unconditionally. Modified: stable/12/share/mk/src.opts.mk Directory Properties: stable/12/ (props changed) Modified: stable/12/share/mk/src.opts.mk ============================================================================== --- stable/12/share/mk/src.opts.mk Thu Jan 23 23:52:57 2020 (r357063) +++ stable/12/share/mk/src.opts.mk Fri Jan 24 01:00:28 2020 (r357064) @@ -503,6 +503,7 @@ MK_NLS_CATALOGS:= no .endif .if ${MK_OPENSSL} == "no" +MK_DMAGENT:= no MK_OPENSSH:= no MK_KERBEROS:= no .endif From owner-svn-src-all@freebsd.org Fri Jan 24 01:18:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 27D2722A5C3; Fri, 24 Jan 2020 01:18:05 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com [IPv6:2607:f8b0:4864:20::f2f]) (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 483h8s0K8kz4KCq; Fri, 24 Jan 2020 01:18:04 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-qv1-xf2f.google.com with SMTP id dp13so167506qvb.7; Thu, 23 Jan 2020 17:18:04 -0800 (PST) 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=+1uRfPs4ilJ5APFT2mvDNDiDack8WzbJErFGzoxElFM=; b=CD8at/zQY2ouCTg5VEI4qscKlb9MUzA/fH6RSlikmpbq++14jSt8ZAQ97QCC4kH1A+ rQb84iZAJt+nKfwXJephNv/xPR6t1mmHLxlGzZzDERqi+Ufd2mqeZcUtwgoxreMwQcJn X57PMHKnyUCo1SYHJArOt0RELbbmq9sfjGduF+rKAP8LNQLHnlayDPGyENEdeM9DOrk1 DQusHB9omXIjEI2/71Z3S4/nlnoWdoHvCLAu/hZMV6HELp95caNHy9ewwsHlSSnstq2l d7sS5AfRyBXRzB/b/5+baHr2aQZze3QxUMsLyuoLOmHo64PHJFxw6YfAHV+wlZZVisUg bbeg== 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=+1uRfPs4ilJ5APFT2mvDNDiDack8WzbJErFGzoxElFM=; b=nrl4wNzngRN4JPFjG1gkGLxaeeVp7OXlmUVDeZ8W7BBqX5Z1ocK/SVaNFMMnOX6Y3I +z2n+EzMrBAl78gk/ckP6vj7j3oYbGxDzrL6Oz1BRvMl7OkBCX97+OSaOBcwUoSamG7H dyu3mkenix059ORY18jjF5di1aP5AmPnh+rUQ11T5ICkK/5Mgg3PmffLdbqCIxt+ajKD RHAoxbFKatEKQlQ4hOWzAJI6dDkHTMHjMlrjaBu6Ox4QXikXpssThK9btiLup+ie/FTA bLxGsszLiqyZ12/W/4gDKmRU/fTggFyagsgYD8W2uM/Y9uNqokAn8/Qb+abkYKYcBX9g LaJA== X-Gm-Message-State: APjAAAVFoHP05Rnv4NQkkiQ3kbiYLXH3osWR+qItJ2a56KrXR7XBIA7W PorBtw1s9fzcCP4V21/mGvIo88BU+ysltp06wMKzeCeK X-Google-Smtp-Source: APXvYqx2t98CCUEa9x98k/I5y5ycHywV6mfGptxCda57BZ5pNBc2u45zdJlaAnZV9AeQwVgRJmzWDjWQSNKB8khA8Vg= X-Received: by 2002:ad4:4434:: with SMTP id e20mr522354qvt.157.1579828677699; Thu, 23 Jan 2020 17:17:57 -0800 (PST) MIME-Version: 1.0 References: <202001231636.00NGawrr080128@repo.freebsd.org> <20200123230546.GG1268@FreeBSD.org> In-Reply-To: <20200123230546.GG1268@FreeBSD.org> From: Ryan Stone Date: Thu, 23 Jan 2020 20:17:46 -0500 Message-ID: Subject: Re: svn commit: r357051 - head/sys/dev/bge To: Gleb Smirnoff Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 483h8s0K8kz4KCq X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,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: Fri, 24 Jan 2020 01:18:05 -0000 On Thu, Jan 23, 2020 at 6:05 PM Gleb Smirnoff wrote: > > On Thu, Jan 23, 2020 at 02:17:33PM -0500, Ryan Stone wrote: > R> What is a driver's responsibility now for entering/leaving the net epoch now? > > For drivers that are 'special', entering the net epoch is necessary. Special > usually means running if_input outside network interrupt context. > > However, there is plan to generalize entering/exiting epoch for taskqueues > and callouts. Why on earth is it done that way rather than putting the network epoch enter/exit in ether_input? I'm with Ian; this sounds like a huge layering violation. From owner-svn-src-all@freebsd.org Fri Jan 24 01:25:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0EE722A802; Fri, 24 Jan 2020 01:25:07 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 483hJz2R6tz4KfB; Fri, 24 Jan 2020 01:25:06 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 00O1OwvH009001 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 23 Jan 2020 17:24:58 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 00O1OwVt009000; Thu, 23 Jan 2020 17:24:58 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Thu, 23 Jan 2020 17:24:58 -0800 From: Gleb Smirnoff To: Ryan Stone Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r357051 - head/sys/dev/bge Message-ID: <20200124012458.GI1268@FreeBSD.org> References: <202001231636.00NGawrr080128@repo.freebsd.org> <20200123230546.GG1268@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 483hJz2R6tz4KfB X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-0.84 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.87)[-0.874,0]; NEURAL_SPAM_LONG(0.03)[0.029,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, 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, 24 Jan 2020 01:25:08 -0000 On Thu, Jan 23, 2020 at 08:17:46PM -0500, Ryan Stone wrote: R> On Thu, Jan 23, 2020 at 6:05 PM Gleb Smirnoff wrote: R> > R> > On Thu, Jan 23, 2020 at 02:17:33PM -0500, Ryan Stone wrote: R> > R> What is a driver's responsibility now for entering/leaving the net epoch now? R> > R> > For drivers that are 'special', entering the net epoch is necessary. Special R> > usually means running if_input outside network interrupt context. R> > R> > However, there is plan to generalize entering/exiting epoch for taskqueues R> > and callouts. R> R> Why on earth is it done that way rather than putting the network epoch R> enter/exit in ether_input? I'm with Ian; this sounds like a huge R> layering violation. Because at interrupt level we can batch multiple packets in a single epoch. This speeds up unfiltered packet forwarding performance by 5%. With driver level pfil hooks I would claim even more improvement, because before the change we needed to enter epoch twice - once for filtering, than for ether_input. Epoch isn't a layer, it is a synchronisation primitive, so I disagree about statement on layering violation. -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Fri Jan 24 01:29:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6C74222A8B6; Fri, 24 Jan 2020 01:29:52 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 483hQR6stSz4Kpj; Fri, 24 Jan 2020 01:29:51 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 00O1Tmqh009024 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 23 Jan 2020 17:29:48 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 00O1TmjQ009023; Thu, 23 Jan 2020 17:29:48 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Thu, 23 Jan 2020 17:29:48 -0800 From: Gleb Smirnoff To: Ryan Stone Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r357051 - head/sys/dev/bge Message-ID: <20200124012948.GJ1268@FreeBSD.org> References: <202001231636.00NGawrr080128@repo.freebsd.org> <20200123230546.GG1268@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 483hQR6stSz4Kpj X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-0.84 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.87)[-0.874,0]; NEURAL_SPAM_LONG(0.03)[0.029,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, 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, 24 Jan 2020 01:29:52 -0000 On Thu, Jan 23, 2020 at 08:17:46PM -0500, Ryan Stone wrote: R> On Thu, Jan 23, 2020 at 6:05 PM Gleb Smirnoff wrote: R> > R> > On Thu, Jan 23, 2020 at 02:17:33PM -0500, Ryan Stone wrote: R> > R> What is a driver's responsibility now for entering/leaving the net epoch now? R> > R> > For drivers that are 'special', entering the net epoch is necessary. Special R> > usually means running if_input outside network interrupt context. R> > R> > However, there is plan to generalize entering/exiting epoch for taskqueues R> > and callouts. R> R> Why on earth is it done that way rather than putting the network epoch R> enter/exit in ether_input? I'm with Ian; this sounds like a huge R> layering violation. Another thing I should have mentioned. Doing this at interrupt level makes much easier to maintain alternative network stacks, for example TOE - which now has tons of hacks. Same stands for netgraph. If you hook ng_ether on, than ether_input is skipped and packet goes to netgraph, then it can be injected back into network stack from a different type of node. -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Fri Jan 24 01:32:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 97B3122AA90; Fri, 24 Jan 2020 01:32:16 +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 483hTD3VsWz4L95; Fri, 24 Jan 2020 01:32:16 +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 7389B1FD55; Fri, 24 Jan 2020 01:32:16 +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 00O1WGg9098841; Fri, 24 Jan 2020 01:32:16 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00O1WG2S098840; Fri, 24 Jan 2020 01:32:16 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001240132.00O1WG2S098840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 24 Jan 2020 01:32:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357065 - head/lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libc/stdlib X-SVN-Commit-Revision: 357065 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 01:32:16 -0000 Author: cem Date: Fri Jan 24 01:32:16 2020 New Revision: 357065 URL: https://svnweb.freebsd.org/changeset/base/357065 Log: random(3): Abstract state into a single context object No functional change. Reviewed by: kevans, markm Differential Revision: https://reviews.freebsd.org/D23288 Modified: head/lib/libc/stdlib/random.c Modified: head/lib/libc/stdlib/random.c ============================================================================== --- head/lib/libc/stdlib/random.c Fri Jan 24 01:00:28 2020 (r357064) +++ head/lib/libc/stdlib/random.c Fri Jan 24 01:32:16 2020 (r357065) @@ -144,6 +144,19 @@ __FBSDID("$FreeBSD$"); static const int degrees[MAX_TYPES] = { DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 }; static const int seps [MAX_TYPES] = { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 }; +/* A full instance of the random(3) generator. */ +struct random_state { + uint32_t *rst_fptr; + uint32_t *rst_rptr; + uint32_t *rst_state; + int rst_type; + int rst_deg; + int rst_sep; + uint32_t *rst_end_ptr; + /* Flexible array member must be last. */ + uint32_t rst_randtbl[]; +}; + /* * Initially, everything is set up as if from: * @@ -157,52 +170,58 @@ static const int seps [MAX_TYPES] = { SEP_0, SEP_1, SE * * MAX_TYPES * (rptr - state) + TYPE_3 == TYPE_3. */ +static struct random_state implicit = { + .rst_randtbl = { + TYPE_3, + 0x2cf41758, 0x27bb3711, 0x4916d4d1, 0x7b02f59f, 0x9b8e28eb, 0xc0e80269, + 0x696f5c16, 0x878f1ff5, 0x52d9c07f, 0x916a06cd, 0xb50b3a20, 0x2776970a, + 0xee4eb2a6, 0xe94640ec, 0xb1d65612, 0x9d1ed968, 0x1043f6b7, 0xa3432a76, + 0x17eacbb9, 0x3c09e2eb, 0x4f8c2b3, 0x708a1f57, 0xee341814, 0x95d0e4d2, + 0xb06f216c, 0x8bd2e72e, 0x8f7c38d7, 0xcfc6a8fc, 0x2a59495, 0xa20d2a69, + 0xe29d12d1 + }, -static uint32_t randtbl[DEG_3 + 1] = { - TYPE_3, - 0x2cf41758, 0x27bb3711, 0x4916d4d1, 0x7b02f59f, 0x9b8e28eb, 0xc0e80269, - 0x696f5c16, 0x878f1ff5, 0x52d9c07f, 0x916a06cd, 0xb50b3a20, 0x2776970a, - 0xee4eb2a6, 0xe94640ec, 0xb1d65612, 0x9d1ed968, 0x1043f6b7, 0xa3432a76, - 0x17eacbb9, 0x3c09e2eb, 0x4f8c2b3, 0x708a1f57, 0xee341814, 0x95d0e4d2, - 0xb06f216c, 0x8bd2e72e, 0x8f7c38d7, 0xcfc6a8fc, 0x2a59495, 0xa20d2a69, - 0xe29d12d1 + /* + * fptr and rptr are two pointers into the state info, a front and a rear + * pointer. These two pointers are always rand_sep places aparts, as they + * cycle cyclically through the state information. (Yes, this does mean we + * could get away with just one pointer, but the code for random() is more + * efficient this way). The pointers are left positioned as they would be + * from the call + * + * initstate(1, randtbl, 128); + * + * (The position of the rear pointer, rptr, is really 0 (as explained above + * in the initialization of randtbl) because the state table pointer is set + * to point to randtbl[1] (as explained below). + */ + .rst_fptr = &implicit.rst_randtbl[SEP_3 + 1], + .rst_rptr = &implicit.rst_randtbl[1], + + /* + * The following things are the pointer to the state information table, the + * type of the current generator, the degree of the current polynomial being + * used, and the separation between the two pointers. Note that for efficiency + * of random(), we remember the first location of the state information, not + * the zeroeth. Hence it is valid to access state[-1], which is used to + * store the type of the R.N.G. Also, we remember the last location, since + * this is more efficient than indexing every time to find the address of + * the last element to see if the front and rear pointers have wrapped. + */ + .rst_state = &implicit.rst_randtbl[1], + .rst_type = TYPE_3, + .rst_deg = DEG_3, + .rst_sep = SEP_3, + .rst_end_ptr = &implicit.rst_randtbl[DEG_3 + 1], }; /* - * fptr and rptr are two pointers into the state info, a front and a rear - * pointer. These two pointers are always rand_sep places aparts, as they - * cycle cyclically through the state information. (Yes, this does mean we - * could get away with just one pointer, but the code for random() is more - * efficient this way). The pointers are left positioned as they would be - * from the call - * - * initstate(1, randtbl, 128); - * - * (The position of the rear pointer, rptr, is really 0 (as explained above - * in the initialization of randtbl) because the state table pointer is set - * to point to randtbl[1] (as explained below). + * This is the same low quality PRNG used in rand(3) in FreeBSD 12 and prior. + * It may be sufficient for distributing bits and expanding a small seed + * integer into a larger state. */ -static uint32_t *fptr = &randtbl[SEP_3 + 1]; -static uint32_t *rptr = &randtbl[1]; - -/* - * The following things are the pointer to the state information table, the - * type of the current generator, the degree of the current polynomial being - * used, and the separation between the two pointers. Note that for efficiency - * of random(), we remember the first location of the state information, not - * the zeroeth. Hence it is valid to access state[-1], which is used to - * store the type of the R.N.G. Also, we remember the last location, since - * this is more efficient than indexing every time to find the address of - * the last element to see if the front and rear pointers have wrapped. - */ -static uint32_t *state = &randtbl[1]; -static int rand_type = TYPE_3; -static int rand_deg = DEG_3; -static int rand_sep = SEP_3; -static uint32_t *end_ptr = &randtbl[DEG_3 + 1]; - static inline uint32_t -good_rand(uint32_t ctx) +parkmiller32(uint32_t ctx) { /* * Compute x = (7^5 * x) mod (2^31 - 1) @@ -242,15 +261,16 @@ srandom(unsigned int x) { int i, lim; - state[0] = (uint32_t)x; - if (rand_type == TYPE_0) + implicit.rst_state[0] = (uint32_t)x; + if (implicit.rst_type == TYPE_0) lim = NSHUFF; else { - for (i = 1; i < rand_deg; i++) - state[i] = good_rand(state[i - 1]); - fptr = &state[rand_sep]; - rptr = &state[0]; - lim = 10 * rand_deg; + for (i = 1; i < implicit.rst_deg; i++) + implicit.rst_state[i] = + parkmiller32(implicit.rst_state[i - 1]); + implicit.rst_fptr = &implicit.rst_state[implicit.rst_sep]; + implicit.rst_rptr = &implicit.rst_state[0]; + lim = 10 * implicit.rst_deg; } for (i = 0; i < lim; i++) (void)random(); @@ -274,14 +294,16 @@ srandomdev(void) int mib[2]; size_t expected, len; - if (rand_type == TYPE_0) - expected = len = sizeof(state[0]); + if (implicit.rst_type == TYPE_0) + len = sizeof(implicit.rst_state[0]); else - expected = len = rand_deg * sizeof(state[0]); + len = implicit.rst_deg * sizeof(implicit.rst_state[0]); + expected = len; mib[0] = CTL_KERN; mib[1] = KERN_ARND; - if (sysctl(mib, 2, state, &len, NULL, 0) == -1 || len != expected) { + if (sysctl(mib, 2, implicit.rst_state, &len, NULL, 0) == -1 || + len != expected) { /* * The sysctl cannot fail. If it does fail on some FreeBSD * derivative or after some future change, just abort so that @@ -291,9 +313,9 @@ srandomdev(void) abort(); } - if (rand_type != TYPE_0) { - fptr = &state[rand_sep]; - rptr = &state[0]; + if (implicit.rst_type != TYPE_0) { + implicit.rst_fptr = &implicit.rst_state[implicit.rst_sep]; + implicit.rst_rptr = &implicit.rst_state[0]; } } @@ -323,43 +345,48 @@ srandomdev(void) char * initstate(unsigned int seed, char *arg_state, size_t n) { - char *ostate = (char *)(&state[-1]); + char *ostate = (char *)(&implicit.rst_state[-1]); uint32_t *int_arg_state = (uint32_t *)arg_state; if (n < BREAK_0) return (NULL); - if (rand_type == TYPE_0) - state[-1] = rand_type; + if (implicit.rst_type == TYPE_0) + implicit.rst_state[-1] = implicit.rst_type; else - state[-1] = MAX_TYPES * (rptr - state) + rand_type; + implicit.rst_state[-1] = MAX_TYPES * + (implicit.rst_rptr - implicit.rst_state) + + implicit.rst_type; if (n < BREAK_1) { - rand_type = TYPE_0; - rand_deg = DEG_0; - rand_sep = SEP_0; + implicit.rst_type = TYPE_0; + implicit.rst_deg = DEG_0; + implicit.rst_sep = SEP_0; } else if (n < BREAK_2) { - rand_type = TYPE_1; - rand_deg = DEG_1; - rand_sep = SEP_1; + implicit.rst_type = TYPE_1; + implicit.rst_deg = DEG_1; + implicit.rst_sep = SEP_1; } else if (n < BREAK_3) { - rand_type = TYPE_2; - rand_deg = DEG_2; - rand_sep = SEP_2; + implicit.rst_type = TYPE_2; + implicit.rst_deg = DEG_2; + implicit.rst_sep = SEP_2; } else if (n < BREAK_4) { - rand_type = TYPE_3; - rand_deg = DEG_3; - rand_sep = SEP_3; + implicit.rst_type = TYPE_3; + implicit.rst_deg = DEG_3; + implicit.rst_sep = SEP_3; } else { - rand_type = TYPE_4; - rand_deg = DEG_4; - rand_sep = SEP_4; + implicit.rst_type = TYPE_4; + implicit.rst_deg = DEG_4; + implicit.rst_sep = SEP_4; } - state = int_arg_state + 1; /* first location */ - end_ptr = &state[rand_deg]; /* must set end_ptr before srandom */ + implicit.rst_state = int_arg_state + 1; /* first location */ + /* must set end_ptr before srandom */ + implicit.rst_end_ptr = &implicit.rst_state[implicit.rst_deg]; srandom(seed); - if (rand_type == TYPE_0) - int_arg_state[0] = rand_type; + if (implicit.rst_type == TYPE_0) + int_arg_state[0] = implicit.rst_type; else - int_arg_state[0] = MAX_TYPES * (rptr - state) + rand_type; + int_arg_state[0] = MAX_TYPES * + (implicit.rst_rptr - implicit.rst_state) + + implicit.rst_type; return (ostate); } @@ -388,23 +415,26 @@ setstate(char *arg_state) uint32_t *new_state = (uint32_t *)arg_state; uint32_t type = new_state[0] % MAX_TYPES; uint32_t rear = new_state[0] / MAX_TYPES; - char *ostate = (char *)(&state[-1]); + char *ostate = (char *)(&implicit.rst_state[-1]); if (type != TYPE_0 && rear >= degrees[type]) return (NULL); - if (rand_type == TYPE_0) - state[-1] = rand_type; + if (implicit.rst_type == TYPE_0) + implicit.rst_state[-1] = implicit.rst_type; else - state[-1] = MAX_TYPES * (rptr - state) + rand_type; - rand_type = type; - rand_deg = degrees[type]; - rand_sep = seps[type]; - state = new_state + 1; - if (rand_type != TYPE_0) { - rptr = &state[rear]; - fptr = &state[(rear + rand_sep) % rand_deg]; + implicit.rst_state[-1] = MAX_TYPES * + (implicit.rst_rptr - implicit.rst_state) + + implicit.rst_type; + implicit.rst_type = type; + implicit.rst_deg = degrees[type]; + implicit.rst_sep = seps[type]; + implicit.rst_state = new_state + 1; + if (implicit.rst_type != TYPE_0) { + implicit.rst_rptr = &implicit.rst_state[rear]; + implicit.rst_fptr = &implicit.rst_state[ + (rear + implicit.rst_sep) % implicit.rst_deg]; } - end_ptr = &state[rand_deg]; /* set end_ptr too */ + implicit.rst_end_ptr = &implicit.rst_state[implicit.rst_deg]; return (ostate); } @@ -431,25 +461,28 @@ random(void) uint32_t i; uint32_t *f, *r; - if (rand_type == TYPE_0) { - i = state[0]; - state[0] = i = good_rand(i); + if (implicit.rst_type == TYPE_0) { + i = implicit.rst_state[0]; + i = parkmiller32(i); + implicit.rst_state[0] = i; } else { /* * Use local variables rather than static variables for speed. */ - f = fptr; r = rptr; + f = implicit.rst_fptr; + r = implicit.rst_rptr; *f += *r; i = *f >> 1; /* chucking least random bit */ - if (++f >= end_ptr) { - f = state; + if (++f >= implicit.rst_end_ptr) { + f = implicit.rst_state; ++r; } - else if (++r >= end_ptr) { - r = state; + else if (++r >= implicit.rst_end_ptr) { + r = implicit.rst_state; } - fptr = f; rptr = r; + implicit.rst_fptr = f; + implicit.rst_rptr = r; } return ((long)i); } From owner-svn-src-all@freebsd.org Fri Jan 24 01:34:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8EE3A22AB15; Fri, 24 Jan 2020 01:34:11 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (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 483hWR3GR3z4LJt; Fri, 24 Jan 2020 01:34:11 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-qk1-x72b.google.com with SMTP id c185so576416qkf.3; Thu, 23 Jan 2020 17:34:11 -0800 (PST) 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=ygv6nFwxLehrJb0PB3iMSGAyxoutrp3o/l+AvnKkiwg=; b=BWxqy2dlaRBjgHj5kCqrg4ostb1xq3ZeZAZ1mzmXKu6z1V6wocAL907+t5SeWOi1MA mckj0+3UM/KpbO/QOl3E2F7P5PtJKKEM8irFHQVk8TRkNyja44e0F9f4A/lK9r9WZoTB wSFgdmxopY2nEbZlQzNC3kyTjthvfr2SHtb+5/kTvHAb5iwDnv47LAzlOclE5o7drWeq EmplqTMPuZbKhtIpNkqnBeu5ULEFZKEuOUhcdCpv3oy3tqFo2i3CdW11le1nKb/QH12i mkTwePmjXASXS8lDgVNfwhFupn4r9p5Pl5+ZXHchDRF4KVtSWYco4TTf+grAjHx5143m jomg== 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=ygv6nFwxLehrJb0PB3iMSGAyxoutrp3o/l+AvnKkiwg=; b=IdB+yEkZ0+3WYR76BitVzLQQJhIl55RFhx24csMBPt22k99OGIk8rOujmKCKjS7Q/i 34u/Dauh7mFaDSL7QM3KM7w9lYcjf5yfvaq2f6TjfNU9C2CqmOcZsOuThEugzE9ti7hx yg5uRCW6/YzLmXnGLACMs2YtlfNYnmxWzGyPkSPsSzNz6TwX5B8atGIgSmpTIbTfZWnB q+ljwSK2puJOOgClpQetkg/tSaRildLqxJOreIKLNeiowuSIuXQggMWLs/DBfONrau6g agsonAmDNei1ER+tHgf6nca79rSObrLwZc1EJKDs+fZp0n8IHRqdkBF5N105NHxYoXOy gtJg== X-Gm-Message-State: APjAAAVSPFxTCf8NoYQSz2gTThLicKm+XrvwONaK4WDcM2q6+luZtrT4 bBaPYlceR3OFDSE/8CQcNwJdoE04ZOVQus/zI8zp43WMld8= X-Google-Smtp-Source: APXvYqxxpj6gGzgDPXfJq5WWktxVOc2S3t9vjDXq9Jf5Y9KR0XmMrfRLSEwh83JDwwYEDd7vU6TLY1+afA6nQ6Ta8qE= X-Received: by 2002:a37:308:: with SMTP id 8mr376708qkd.98.1579829649455; Thu, 23 Jan 2020 17:34:09 -0800 (PST) MIME-Version: 1.0 References: <202001231636.00NGawrr080128@repo.freebsd.org> <20200123230546.GG1268@FreeBSD.org> <20200124012458.GI1268@FreeBSD.org> In-Reply-To: <20200124012458.GI1268@FreeBSD.org> From: Ryan Stone Date: Thu, 23 Jan 2020 20:33:58 -0500 Message-ID: Subject: Re: svn commit: r357051 - head/sys/dev/bge To: Gleb Smirnoff Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 483hWR3GR3z4LJt X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,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: Fri, 24 Jan 2020 01:34:11 -0000 On Thu, Jan 23, 2020 at 8:25 PM Gleb Smirnoff wrote: > Because at interrupt level we can batch multiple packets in a single epoch. > This speeds up unfiltered packet forwarding performance by 5%. > > With driver level pfil hooks I would claim even more improvement, because before > the change we needed to enter epoch twice - once for filtering, than for ether_input. > > Epoch isn't a layer, it is a synchronisation primitive, so I disagree about > statement on layering violation. Epoch is a synchronization primitive, but the net_epoch is absolutely a part of the networking layer. If we need better batching then the correct solution is to introduce a batched interface for drivers to push packets up the stack, not to mess around at the interrupt layer. Note that the only reason why this works for mlx4/mlx5 is that linuxkpi *always* requests a INTR_TYPE_NET no matter what driver is running. This means that all drm graphics driver interrupts are now running under the net_epoch: https://svnweb.freebsd.org/base/head/sys/compat/linuxkpi/common/include/linux/interrupt.h?revision=352205&view=markup#l103 From owner-svn-src-all@freebsd.org Fri Jan 24 01:39:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0892722ABEB; Fri, 24 Jan 2020 01:39:30 +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 483hdY6NK1z4LSp; Fri, 24 Jan 2020 01:39:29 +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 D1CC21FD76; Fri, 24 Jan 2020 01:39:29 +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 00O1dTYN000968; Fri, 24 Jan 2020 01:39:29 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00O1dTfx000966; Fri, 24 Jan 2020 01:39:29 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202001240139.00O1dTfx000966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 24 Jan 2020 01:39:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357066 - head/lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libc/stdlib X-SVN-Commit-Revision: 357066 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 01:39:30 -0000 Author: cem Date: Fri Jan 24 01:39:29 2020 New Revision: 357066 URL: https://svnweb.freebsd.org/changeset/base/357066 Log: random(3): Abstract routines into _r versions on explicit state The existing APIs simply pass the implicit global state to the _r variants. No functional change. Note that these routines are not exported from libc and are not intended to be exported. If someone wished to export them from libc (which I would discourage), they should first be modified to match the inconsistent parameter type / order of the glibc public interfaces of the same names. I know Ravi will ask, so: the eventual goal of this series is to replace rand(3) with the implementation from random(3) (D23290). However, I'd like to wait a bit longer on that one to see if more feedback emerges. Reviewed by: kevans, markm Differential Revision: https://reviews.freebsd.org/D23289 Added: head/lib/libc/stdlib/random.h (contents, props changed) Modified: head/lib/libc/stdlib/random.c Modified: head/lib/libc/stdlib/random.c ============================================================================== --- head/lib/libc/stdlib/random.c Fri Jan 24 01:32:16 2020 (r357065) +++ head/lib/libc/stdlib/random.c Fri Jan 24 01:39:29 2020 (r357066) @@ -38,10 +38,13 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#include #include #include #include "un-namespace.h" +#include "random.h" + /* * random.c: * @@ -144,19 +147,6 @@ __FBSDID("$FreeBSD$"); static const int degrees[MAX_TYPES] = { DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 }; static const int seps [MAX_TYPES] = { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 }; -/* A full instance of the random(3) generator. */ -struct random_state { - uint32_t *rst_fptr; - uint32_t *rst_rptr; - uint32_t *rst_state; - int rst_type; - int rst_deg; - int rst_sep; - uint32_t *rst_end_ptr; - /* Flexible array member must be last. */ - uint32_t rst_randtbl[]; -}; - /* * Initially, everything is set up as if from: * @@ -170,7 +160,7 @@ struct random_state { * * MAX_TYPES * (rptr - state) + TYPE_3 == TYPE_3. */ -static struct random_state implicit = { +static struct __random_state implicit = { .rst_randtbl = { TYPE_3, 0x2cf41758, 0x27bb3711, 0x4916d4d1, 0x7b02f59f, 0x9b8e28eb, 0xc0e80269, @@ -257,25 +247,31 @@ parkmiller32(uint32_t ctx) * for default usage relies on values produced by this routine. */ void -srandom(unsigned int x) +srandom_r(struct __random_state *estate, unsigned x) { int i, lim; - implicit.rst_state[0] = (uint32_t)x; - if (implicit.rst_type == TYPE_0) + estate->rst_state[0] = (uint32_t)x; + if (estate->rst_type == TYPE_0) lim = NSHUFF; else { - for (i = 1; i < implicit.rst_deg; i++) - implicit.rst_state[i] = - parkmiller32(implicit.rst_state[i - 1]); - implicit.rst_fptr = &implicit.rst_state[implicit.rst_sep]; - implicit.rst_rptr = &implicit.rst_state[0]; - lim = 10 * implicit.rst_deg; + for (i = 1; i < estate->rst_deg; i++) + estate->rst_state[i] = + parkmiller32(estate->rst_state[i - 1]); + estate->rst_fptr = &estate->rst_state[estate->rst_sep]; + estate->rst_rptr = &estate->rst_state[0]; + lim = 10 * estate->rst_deg; } for (i = 0; i < lim; i++) - (void)random(); + (void)random_r(estate); } +void +srandom(unsigned x) +{ + srandom_r(&implicit, x); +} + /* * srandomdev: * @@ -289,20 +285,20 @@ srandom(unsigned int x) * derived from the LC algorithm applied to a fixed seed. */ void -srandomdev(void) +srandomdev_r(struct __random_state *estate) { int mib[2]; size_t expected, len; - if (implicit.rst_type == TYPE_0) - len = sizeof(implicit.rst_state[0]); + if (estate->rst_type == TYPE_0) + len = sizeof(estate->rst_state[0]); else - len = implicit.rst_deg * sizeof(implicit.rst_state[0]); + len = estate->rst_deg * sizeof(estate->rst_state[0]); expected = len; mib[0] = CTL_KERN; mib[1] = KERN_ARND; - if (sysctl(mib, 2, implicit.rst_state, &len, NULL, 0) == -1 || + if (sysctl(mib, 2, estate->rst_state, &len, NULL, 0) == -1 || len != expected) { /* * The sysctl cannot fail. If it does fail on some FreeBSD @@ -313,14 +309,20 @@ srandomdev(void) abort(); } - if (implicit.rst_type != TYPE_0) { - implicit.rst_fptr = &implicit.rst_state[implicit.rst_sep]; - implicit.rst_rptr = &implicit.rst_state[0]; + if (estate->rst_type != TYPE_0) { + estate->rst_fptr = &estate->rst_state[estate->rst_sep]; + estate->rst_rptr = &estate->rst_state[0]; } } +void +srandomdev(void) +{ + srandomdev_r(&implicit); +} + /* - * initstate: + * initstate_r: * * Initialize the state information in the given array of n bytes for future * random number generation. Based on the number of bytes we are given, and @@ -328,65 +330,95 @@ srandomdev(void) * one we can and set things up for it. srandom() is then called to * initialize the state information. * - * Note that on return from srandom(), we set state[-1] to be the type - * multiplexed with the current value of the rear pointer; this is so - * successive calls to initstate() won't lose this information and will be - * able to restart with setstate(). + * Returns zero on success, or an error number on failure. * + * Note: There is no need for a setstate_r(); just use a new context. + */ +int +initstate_r(struct __random_state *estate, unsigned seed, uint32_t *arg_state, + size_t sz) +{ + if (sz < BREAK_0) + return (EINVAL); + + if (sz < BREAK_1) { + estate->rst_type = TYPE_0; + estate->rst_deg = DEG_0; + estate->rst_sep = SEP_0; + } else if (sz < BREAK_2) { + estate->rst_type = TYPE_1; + estate->rst_deg = DEG_1; + estate->rst_sep = SEP_1; + } else if (sz < BREAK_3) { + estate->rst_type = TYPE_2; + estate->rst_deg = DEG_2; + estate->rst_sep = SEP_2; + } else if (sz < BREAK_4) { + estate->rst_type = TYPE_3; + estate->rst_deg = DEG_3; + estate->rst_sep = SEP_3; + } else { + estate->rst_type = TYPE_4; + estate->rst_deg = DEG_4; + estate->rst_sep = SEP_4; + } + estate->rst_state = arg_state + 1; + estate->rst_end_ptr = &estate->rst_state[estate->rst_deg]; + srandom_r(estate, seed); + return (0); +} + +/* + * initstate: + * * Note: the first thing we do is save the current state, if any, just like * setstate() so that it doesn't matter when initstate is called. * + * Note that on return from initstate_r(), we set state[-1] to be the type + * multiplexed with the current value of the rear pointer; this is so + * successive calls to initstate() won't lose this information and will be able + * to restart with setstate(). + * * Returns a pointer to the old state. * - * Note: The Sparc platform requires that arg_state begin on an int - * word boundary; otherwise a bus error will occur. Even so, lint will - * complain about mis-alignment, but you should disregard these messages. + * Despite the misleading "char *" type, arg_state must alias an array of + * 32-bit unsigned integer values. Naturally, such an array is 32-bit aligned. + * Usually objects are naturally aligned to at least 32-bits on all platforms, + * but if you treat the provided 'state' as char* you may inadvertently + * misalign it. Don't do that. */ char * initstate(unsigned int seed, char *arg_state, size_t n) { char *ostate = (char *)(&implicit.rst_state[-1]); uint32_t *int_arg_state = (uint32_t *)arg_state; + int error; - if (n < BREAK_0) - return (NULL); + /* + * Persist rptr offset and rst_type in the first word of the prior + * state we are replacing. + */ if (implicit.rst_type == TYPE_0) implicit.rst_state[-1] = implicit.rst_type; else implicit.rst_state[-1] = MAX_TYPES * (implicit.rst_rptr - implicit.rst_state) + implicit.rst_type; - if (n < BREAK_1) { - implicit.rst_type = TYPE_0; - implicit.rst_deg = DEG_0; - implicit.rst_sep = SEP_0; - } else if (n < BREAK_2) { - implicit.rst_type = TYPE_1; - implicit.rst_deg = DEG_1; - implicit.rst_sep = SEP_1; - } else if (n < BREAK_3) { - implicit.rst_type = TYPE_2; - implicit.rst_deg = DEG_2; - implicit.rst_sep = SEP_2; - } else if (n < BREAK_4) { - implicit.rst_type = TYPE_3; - implicit.rst_deg = DEG_3; - implicit.rst_sep = SEP_3; - } else { - implicit.rst_type = TYPE_4; - implicit.rst_deg = DEG_4; - implicit.rst_sep = SEP_4; - } - implicit.rst_state = int_arg_state + 1; /* first location */ - /* must set end_ptr before srandom */ - implicit.rst_end_ptr = &implicit.rst_state[implicit.rst_deg]; - srandom(seed); + + error = initstate_r(&implicit, seed, int_arg_state, n); + if (error != 0) + return (NULL); + + /* + * Persist rptr offset and rst_type of the new state in its first word. + */ if (implicit.rst_type == TYPE_0) int_arg_state[0] = implicit.rst_type; else int_arg_state[0] = MAX_TYPES * (implicit.rst_rptr - implicit.rst_state) + implicit.rst_type; + return (ostate); } @@ -456,33 +488,39 @@ setstate(char *arg_state) * Returns a 31-bit random number. */ long -random(void) +random_r(struct __random_state *estate) { uint32_t i; uint32_t *f, *r; - if (implicit.rst_type == TYPE_0) { - i = implicit.rst_state[0]; + if (estate->rst_type == TYPE_0) { + i = estate->rst_state[0]; i = parkmiller32(i); - implicit.rst_state[0] = i; + estate->rst_state[0] = i; } else { /* * Use local variables rather than static variables for speed. */ - f = implicit.rst_fptr; - r = implicit.rst_rptr; + f = estate->rst_fptr; + r = estate->rst_rptr; *f += *r; i = *f >> 1; /* chucking least random bit */ - if (++f >= implicit.rst_end_ptr) { - f = implicit.rst_state; + if (++f >= estate->rst_end_ptr) { + f = estate->rst_state; ++r; } - else if (++r >= implicit.rst_end_ptr) { - r = implicit.rst_state; + else if (++r >= estate->rst_end_ptr) { + r = estate->rst_state; } - implicit.rst_fptr = f; - implicit.rst_rptr = r; + estate->rst_fptr = f; + estate->rst_rptr = r; } return ((long)i); +} + +long +random(void) +{ + return (random_r(&implicit)); } Added: head/lib/libc/stdlib/random.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/stdlib/random.h Fri Jan 24 01:39:29 2020 (r357066) @@ -0,0 +1,46 @@ +/*- + * Copyright 2020 Conrad Meyer . 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$ + */ + +#pragma once + +/* A full instance of the random(3) generator. */ +struct __random_state { + uint32_t *rst_fptr; + uint32_t *rst_rptr; + uint32_t *rst_state; + int rst_type; + int rst_deg; + int rst_sep; + uint32_t *rst_end_ptr; + /* Flexible array member must be last. */ + uint32_t rst_randtbl[]; +}; + +int initstate_r(struct __random_state *, unsigned, uint32_t *, size_t); +long random_r(struct __random_state *); +void srandom_r(struct __random_state *, unsigned); +void srandomdev_r(struct __random_state *); From owner-svn-src-all@freebsd.org Fri Jan 24 02:18:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D3C722B696; Fri, 24 Jan 2020 02:18:12 +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 483jVC6xm0z4N1X; Fri, 24 Jan 2020 02:18:11 +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 E5179204CE; Fri, 24 Jan 2020 02:18:11 +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 00O2IBjR024721; Fri, 24 Jan 2020 02:18:11 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00O2I9JK024710; Fri, 24 Jan 2020 02:18:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001240218.00O2I9JK024710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 24 Jan 2020 02:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357067 - in head: lib/libbe lib/libbe/tests sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: lib/libbe lib/libbe/tests sbin/bectl X-SVN-Commit-Revision: 357067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 02:18:12 -0000 Author: kevans Date: Fri Jan 24 02:18:09 2020 New Revision: 357067 URL: https://svnweb.freebsd.org/changeset/base/357067 Log: Drop "All Rights Reserved" from all libbe/bectl files I sent out an e-mail on 2020/01/21 with a plan to do this to Kyle, Rob, and Wes; all parties have responded in the affirmative that it's OK to drop it from these files. Modified: head/lib/libbe/be.c head/lib/libbe/be.h head/lib/libbe/be_access.c head/lib/libbe/be_error.c head/lib/libbe/be_impl.h head/lib/libbe/be_info.c head/lib/libbe/libbe.3 head/lib/libbe/tests/target_prog.c head/sbin/bectl/bectl.8 head/sbin/bectl/bectl.c Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Fri Jan 24 01:39:29 2020 (r357066) +++ head/lib/libbe/be.c Fri Jan 24 02:18:09 2020 (r357067) @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 Kyle J. Kneitinger - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/lib/libbe/be.h ============================================================================== --- head/lib/libbe/be.h Fri Jan 24 01:39:29 2020 (r357066) +++ head/lib/libbe/be.h Fri Jan 24 02:18:09 2020 (r357067) @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 Kyle J. Kneitinger - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/lib/libbe/be_access.c ============================================================================== --- head/lib/libbe/be_access.c Fri Jan 24 01:39:29 2020 (r357066) +++ head/lib/libbe/be_access.c Fri Jan 24 02:18:09 2020 (r357067) @@ -4,7 +4,6 @@ * Copyright (c) 2017 Kyle J. Kneitinger * Copyright (c) 2018 Kyle Evans * Copyright (c) 2019 Wes Maag - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/lib/libbe/be_error.c ============================================================================== --- head/lib/libbe/be_error.c Fri Jan 24 01:39:29 2020 (r357066) +++ head/lib/libbe/be_error.c Fri Jan 24 02:18:09 2020 (r357067) @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 Kyle J. Kneitinger - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/lib/libbe/be_impl.h ============================================================================== --- head/lib/libbe/be_impl.h Fri Jan 24 01:39:29 2020 (r357066) +++ head/lib/libbe/be_impl.h Fri Jan 24 02:18:09 2020 (r357067) @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 Kyle J. Kneitinger - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/lib/libbe/be_info.c ============================================================================== --- head/lib/libbe/be_info.c Fri Jan 24 01:39:29 2020 (r357066) +++ head/lib/libbe/be_info.c Fri Jan 24 02:18:09 2020 (r357067) @@ -3,7 +3,6 @@ * * Copyright (c) 2017 Kyle J. Kneitinger * Copyright (c) 2018 Kyle Evans - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/lib/libbe/libbe.3 ============================================================================== --- head/lib/libbe/libbe.3 Fri Jan 24 01:39:29 2020 (r357066) +++ head/lib/libbe/libbe.3 Fri Jan 24 02:18:09 2020 (r357067) @@ -2,7 +2,6 @@ .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD .\" .\" Copyright (c) 2017 Kyle Kneitinger -.\" All rights reserved. .\" Copyright (c) 2018 Kyle Evans .\" .\" Redistribution and use in source and binary forms, with or without Modified: head/lib/libbe/tests/target_prog.c ============================================================================== --- head/lib/libbe/tests/target_prog.c Fri Jan 24 01:39:29 2020 (r357066) +++ head/lib/libbe/tests/target_prog.c Fri Jan 24 02:18:09 2020 (r357067) @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2019 Rob Wing - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/sbin/bectl/bectl.8 ============================================================================== --- head/sbin/bectl/bectl.8 Fri Jan 24 01:39:29 2020 (r357066) +++ head/sbin/bectl/bectl.8 Fri Jan 24 02:18:09 2020 (r357067) @@ -2,7 +2,6 @@ .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD .\" .\" Copyright (c) 2017 Kyle J. Kneitinger -.\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions Modified: head/sbin/bectl/bectl.c ============================================================================== --- head/sbin/bectl/bectl.c Fri Jan 24 01:39:29 2020 (r357066) +++ head/sbin/bectl/bectl.c Fri Jan 24 02:18:09 2020 (r357067) @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2017 Kyle J. Kneitinger - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-svn-src-all@freebsd.org Fri Jan 24 02:44:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67C9222BC62; Fri, 24 Jan 2020 02:44:01 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 483k410lQjz4Nyx; Fri, 24 Jan 2020 02:44:00 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 00O2husQ009440 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 23 Jan 2020 18:43:57 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 00O2hu8N009439; Thu, 23 Jan 2020 18:43:56 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Thu, 23 Jan 2020 18:43:56 -0800 From: Gleb Smirnoff To: Ryan Stone Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r357051 - head/sys/dev/bge Message-ID: <20200124024356.GK1268@FreeBSD.org> References: <202001231636.00NGawrr080128@repo.freebsd.org> <20200123230546.GG1268@FreeBSD.org> <20200124012458.GI1268@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 483k410lQjz4Nyx X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.11 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.87)[-0.874,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US]; NEURAL_HAM_LONG(-0.24)[-0.236,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, 24 Jan 2020 02:44:01 -0000 On Thu, Jan 23, 2020 at 08:33:58PM -0500, Ryan Stone wrote: R> > Because at interrupt level we can batch multiple packets in a single epoch. R> > This speeds up unfiltered packet forwarding performance by 5%. R> > R> > With driver level pfil hooks I would claim even more improvement, because before R> > the change we needed to enter epoch twice - once for filtering, than for ether_input. R> > R> > Epoch isn't a layer, it is a synchronisation primitive, so I disagree about R> > statement on layering violation. R> R> Epoch is a synchronization primitive, but the net_epoch is absolutely R> a part of the networking layer. If we need better batching then the R> correct solution is to introduce a batched interface for drivers to R> push packets up the stack, not to mess around at the interrupt layer. Such interface of course would be valuable but will not cover case when an interrupt arrives during processing of previous one. So its batching possiblities are limited compared to interrupt level batching. And I already noted that ether_input() isn't the only way to enter the network stack. R> Note that the only reason why this works for mlx4/mlx5 is that R> linuxkpi *always* requests a INTR_TYPE_NET no matter what driver is R> running. This means that all drm graphics driver interrupts are now R> running under the net_epoch: R> R> https://svnweb.freebsd.org/base/head/sys/compat/linuxkpi/common/include/linux/interrupt.h?revision=352205&view=markup#l103 Well, it is not my fault that a video driver requests INTR_TYPE_NET interrupt. I mean, you can't put this as a rationale against using network epoch for all interrrupts that declare theirselves as network interrupts. However, this is harmless. -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Fri Jan 24 03:09:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 27D8822C043 for ; Fri, 24 Jan 2020 03:09:20 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (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 483kdC03Lpz4Q4s for ; Fri, 24 Jan 2020 03:09:18 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by mail-pf1-x441.google.com with SMTP id 4so385851pfz.9 for ; Thu, 23 Jan 2020 19:09:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jroberson-net.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=TaRU2ZjEuifaE+mZUGRDqy9j5q9IOODlHOhlPSKa6Cs=; b=Wo50L/meM+EOWd5zWVzCUgeaJT3uFon4R9QhMojpdzZ+kLjmDd5al2BN/awop20/mZ nE+6TG65usXmc2swekx8emz2/oqQ/NHx88j/a7kORXJ5f8FiBhz2aIhhToWPWAxl+09s lbIzYkvvTtqVf1dKKCk3bnVZxrYJSBQuWPHqpOZyg8mkUkloZa6hJXwXE64Z57ohOOlJ 7cRHmuyXinSLLtjR8hoFqLINlHTWlrG38UFzfvl7swy4dFTeUrb1RtioY8xDzzadXJ1g ZTq9IWq0QTuKgqNJaQP5ObZaoMOZzokipy91d43MM0qqZ06hUeQXacDeMVp6Sl921BRi qRmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=TaRU2ZjEuifaE+mZUGRDqy9j5q9IOODlHOhlPSKa6Cs=; b=CyR6346Dbm5S2sMXkzo+pBywYTkuDSLfYYtIWru18bb/QtcEq4REZRcyPapIOJ/EqZ U9YaJjscTEGAZwyRMNv6wlYgCAl1RfanZad/Q07LOjAb57aNjs8590i1CvB20ztAykfj dTvVj3AA7aKZSK5kCmVCBxiNnJaV26NFQ0G3bZ4My4xkbLF/ggyEO0J6TJg6VF1G5IFK tKrY8mDsoiUBUQEbaW6sP7HPwzZXXVV6XDMNyTIFkucXkZl0mjzu8vjbsxDJ55YwM4yt sBnCYtSpPkIcoiZ0CsdzIMtUMZKyV6SsIKySHrYXPDQKUAeaR31xRAp5tiV4ZTw/chc0 Io9g== X-Gm-Message-State: APjAAAX4UxcyUQGmeWxsPDQCD+L8yD3+8rFFUWc3hW+gaHlwn/cQr6gn QOi13QBhYtzb7ynESaCzDF95xg== X-Google-Smtp-Source: APXvYqwdtXwZL4ncxOBEmLEbTjVEzp5k6NhN+befoSQfFo/h5cDjj/Ont41iulJM9o+AWs1j6yDfaA== X-Received: by 2002:a62:14c4:: with SMTP id 187mr1324905pfu.96.1579835357162; Thu, 23 Jan 2020 19:09:17 -0800 (PST) Received: from rrcs-76-81-105-82.west.biz.rr.com (rrcs-76-81-105-82.west.biz.rr.com. [76.81.105.82]) by smtp.gmail.com with ESMTPSA id q11sm3926336pff.111.2020.01.23.19.09.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 19:09:16 -0800 (PST) Date: Thu, 23 Jan 2020 17:09:14 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Gleb Smirnoff cc: Ryan Stone , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r357051 - head/sys/dev/bge In-Reply-To: <20200124024356.GK1268@FreeBSD.org> Message-ID: References: <202001231636.00NGawrr080128@repo.freebsd.org> <20200123230546.GG1268@FreeBSD.org> <20200124012458.GI1268@FreeBSD.org> <20200124024356.GK1268@FreeBSD.org> User-Agent: Alpine 2.21.9999 (BSF 287 2018-06-16) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 483kdC03Lpz4Q4s X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=jroberson-net.20150623.gappssmtp.com header.s=20150623 header.b=Wo50L/me; dmarc=none; spf=none (mx1.freebsd.org: domain of jroberson@jroberson.net has no SPF policy when checking 2607:f8b0:4864:20::441) smtp.mailfrom=jroberson@jroberson.net X-Spamd-Result: default: False [-2.71 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[jroberson-net.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; IP_SCORE(-0.91)[ip: (-0.63), ipnet: 2607:f8b0::/32(-2.07), asn: 15169(-1.81), country: US(-0.05)]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[jroberson.net]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[jroberson-net.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[1.4.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FREEMAIL_CC(0.00)[gmail.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: Fri, 24 Jan 2020 03:09:20 -0000 On Thu, 23 Jan 2020, Gleb Smirnoff wrote: > On Thu, Jan 23, 2020 at 08:33:58PM -0500, Ryan Stone wrote: > R> > Because at interrupt level we can batch multiple packets in a single epoch. > R> > This speeds up unfiltered packet forwarding performance by 5%. > R> > > R> > With driver level pfil hooks I would claim even more improvement, because before > R> > the change we needed to enter epoch twice - once for filtering, than for ether_input. > R> > > R> > Epoch isn't a layer, it is a synchronisation primitive, so I disagree about > R> > statement on layering violation. > R> > R> Epoch is a synchronization primitive, but the net_epoch is absolutely > R> a part of the networking layer. If we need better batching then the > R> correct solution is to introduce a batched interface for drivers to > R> push packets up the stack, not to mess around at the interrupt layer. > > Such interface of course would be valuable but will not cover case > when an interrupt arrives during processing of previous one. So its > batching possiblities are limited compared to interrupt level batching. > > And I already noted that ether_input() isn't the only way to enter > the network stack. > > R> Note that the only reason why this works for mlx4/mlx5 is that > R> linuxkpi *always* requests a INTR_TYPE_NET no matter what driver is > R> running. This means that all drm graphics driver interrupts are now > R> running under the net_epoch: > R> > R> https://svnweb.freebsd.org/base/head/sys/compat/linuxkpi/common/include/linux/interrupt.h?revision=352205&view=markup#l103 The historical reason is that linuxkpi was originally made to support ofed and there was no real way to get this information from the driver. > > Well, it is not my fault that a video driver requests INTR_TYPE_NET > interrupt. I mean, you can't put this as a rationale against using > network epoch for all interrrupts that declare theirselves as network > interrupts. However, this is harmless. While we don't have a policy strictly requiring reviews it is the norm to have substantial changes socialized and reviewed. I appreciate the work that you are doing but it likely should've been discussed somewhere more publicly. I apologized if I missed it but I don't see reference to anything. Architecturally I am more concerned with the coarseness of net_epoch and the duration of hold becoming a resource utilization problem in high turn-over workloads. Like short connection tcp. Has anyone done substantial testing here? epoch as it is today will hold every free callback for a minimum of several clock ticks and a maximum of 2x the duration of the longest epoch section time. With preemption, etc. this could be 100s of ms of PCBs held. Thanks, Jeff > > -- > Gleb Smirnoff > From owner-svn-src-all@freebsd.org Fri Jan 24 03:32:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0700A22CAE7; Fri, 24 Jan 2020 03:32:47 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 483l8G2mM0z4RXd; Fri, 24 Jan 2020 03:32:45 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 00O3WhIG009720 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 23 Jan 2020 19:32:43 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 00O3Whic009719; Thu, 23 Jan 2020 19:32:43 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Thu, 23 Jan 2020 19:32:43 -0800 From: Gleb Smirnoff To: Jeff Roberson Cc: Ryan Stone , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r357051 - head/sys/dev/bge Message-ID: <20200124033243.GL1268@FreeBSD.org> References: <202001231636.00NGawrr080128@repo.freebsd.org> <20200123230546.GG1268@FreeBSD.org> <20200124012458.GI1268@FreeBSD.org> <20200124024356.GK1268@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 483l8G2mM0z4RXd X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.87)[-0.865,0]; NEURAL_HAM_LONG(-0.14)[-0.137,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, 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, 24 Jan 2020 03:32:47 -0000 On Thu, Jan 23, 2020 at 05:09:14PM -1000, Jeff Roberson wrote: J> While we don't have a policy strictly requiring reviews it is the norm to J> have substantial changes socialized and reviewed. I appreciate the work J> that you are doing but it likely should've been discussed somewhere J> more publicly. I apologized if I missed it but I don't see reference to J> anything. That was https://reviews.freebsd.org/D23242 J> Architecturally I am more concerned with the coarseness of net_epoch and J> the duration of hold becoming a resource utilization problem in high J> turn-over workloads. Like short connection tcp. Has anyone done J> substantial testing here? epoch as it is today will hold every free J> callback for a minimum of several clock ticks and a maximum of 2x the J> duration of the longest epoch section time. With preemption, etc. this J> could be 100s of ms of PCBs held. We also are concerned about that theoretically. Haven't yet seen effect in practice, but our sessions are mostly longer living. First we have the tunable to limit batching. Second, there are some ideas on how to improve the garbage collector performance if it becomes an issue. -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Fri Jan 24 04:18:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E677022D2D9 for ; Fri, 24 Jan 2020 04:18:20 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) (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 483m8q685Xz4TD6 for ; Fri, 24 Jan 2020 04:18:19 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by mail-pl1-x643.google.com with SMTP id c23so243039plz.4 for ; Thu, 23 Jan 2020 20:18:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jroberson-net.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=aKaIydumJ+8eXQPectKUYbHKi2ucpQ5i92/UTf6FJJQ=; b=EFDD1gngAL/TtzGoViJgikaK4FKUdxGmvqjIa24nii/4Kl8Tly4o8Uc4HL2VSFYtfL MD4yRYMMoGLMAjxwimNj3G218loUZh0yvxZuQrBQuUNRxCYImAHfbKvUD7YQlX4Vefyu 7U7YEEob0XsmFQGWFWj/BtvX8WK6nAY5CcH3bkJLVMIgFfvMWfEGEFBG19BSZ1B4B2nW GSo38DPDrfmcUzXV8SuempgGbRYPISyrBuK42qFO6IK5oVt0af7eHeEWdIuYzfXE8duB SALhT7YWgIT4VXo0uWShSVzRvfH2oy/cs0ZEgxP0B6LWuBji6ZrCVX1B6JYiWh9/ufdv VPmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=aKaIydumJ+8eXQPectKUYbHKi2ucpQ5i92/UTf6FJJQ=; b=FV++VPRdi9FDHhaLty0MlHtmulYSegflAk+cQbhm0W56pscNxvXXEA/R+jaafCU7Cl h8U5BeAEuMIadezvu2bZdsUodh6iVPy4CCbUUxX1btGuGktqxUOpFTlbeIiSMnHNuuQB zwVXX51+XXV9Sjtp2GBCDHK2/al4FTFVjojrx6x+rcnkyAVQxoe1UmefdCoPW/uwRw7F BtylbVQMW7n/ADRB+/3sF0VG0t6oLWCB8F3vt09pldi7ww1OX0werZm+STrF6wUQetDz jugWY6z8e871N4yW4V9M56CmRrcgKKpw5zk3H2S1lKJot5PjC5cFl1hfdnxnIg//F4rg AcOg== X-Gm-Message-State: APjAAAWNMF6Xd6EUjd42udDMyLUmgHYKjPE8K6ygUuc3+FkhKXPErrtP rGkXikzOC6XIQfAdqNuSkNn9j1to0Ow= X-Google-Smtp-Source: APXvYqwRGWIr3FQ5hcM0KLNlhRi+IZA5n62fuQpzFNLvFj881UFJHWFxAZw5MmpNMUDt/mC0pGVWrg== X-Received: by 2002:a17:90a:ac02:: with SMTP id o2mr1164547pjq.93.1579839497906; Thu, 23 Jan 2020 20:18:17 -0800 (PST) Received: from rrcs-76-81-105-82.west.biz.rr.com (rrcs-76-81-105-82.west.biz.rr.com. [76.81.105.82]) by smtp.gmail.com with ESMTPSA id l2sm4357696pjt.31.2020.01.23.20.18.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 20:18:17 -0800 (PST) Date: Thu, 23 Jan 2020 18:18:15 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Gleb Smirnoff cc: Ryan Stone , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r357051 - head/sys/dev/bge In-Reply-To: <20200124033243.GL1268@FreeBSD.org> Message-ID: References: <202001231636.00NGawrr080128@repo.freebsd.org> <20200123230546.GG1268@FreeBSD.org> <20200124012458.GI1268@FreeBSD.org> <20200124024356.GK1268@FreeBSD.org> <20200124033243.GL1268@FreeBSD.org> User-Agent: Alpine 2.21.9999 (BSF 287 2018-06-16) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 483m8q685Xz4TD6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=jroberson-net.20150623.gappssmtp.com header.s=20150623 header.b=EFDD1gng; dmarc=none; spf=none (mx1.freebsd.org: domain of jroberson@jroberson.net has no SPF policy when checking 2607:f8b0:4864:20::643) smtp.mailfrom=jroberson@jroberson.net X-Spamd-Result: default: False [-2.71 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[jroberson-net.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; IP_SCORE(-0.91)[ip: (-0.64), ipnet: 2607:f8b0::/32(-2.06), asn: 15169(-1.81), country: US(-0.05)]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[jroberson.net]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[jroberson-net.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[3.4.6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FREEMAIL_CC(0.00)[gmail.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: Fri, 24 Jan 2020 04:18:21 -0000 On Thu, 23 Jan 2020, Gleb Smirnoff wrote: > On Thu, Jan 23, 2020 at 05:09:14PM -1000, Jeff Roberson wrote: > J> While we don't have a policy strictly requiring reviews it is the norm to > J> have substantial changes socialized and reviewed. I appreciate the work > J> that you are doing but it likely should've been discussed somewhere > J> more publicly. I apologized if I missed it but I don't see reference to > J> anything. > > That was https://reviews.freebsd.org/D23242 Ok thank you. Can you tag commits so people can see the discussion? Was it in one I missed? When I'm committing a long patch series I include the link in all of them. Ryan, are you subscribed to @networking? > > J> Architecturally I am more concerned with the coarseness of net_epoch and > J> the duration of hold becoming a resource utilization problem in high > J> turn-over workloads. Like short connection tcp. Has anyone done > J> substantial testing here? epoch as it is today will hold every free > J> callback for a minimum of several clock ticks and a maximum of 2x the > J> duration of the longest epoch section time. With preemption, etc. this > J> could be 100s of ms of PCBs held. > > We also are concerned about that theoretically. Haven't yet seen effect > in practice, but our sessions are mostly longer living. First we have the > tunable to limit batching. Second, there are some ideas on how to improve > the garbage collector performance if it becomes an issue. I am often surprised at how much cpu time I see on linux spent in RCU free processing. Many of these things are written in such a way that everything is cache cold by the time you swing back around. So the callout walk is a giant cold linked list. Thanks, Jeff > > -- > Gleb Smirnoff > From owner-svn-src-all@freebsd.org Fri Jan 24 05:15:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B742822E0D2; Fri, 24 Jan 2020 05:15:07 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 483nQM37hDz4WRF; Fri, 24 Jan 2020 05:15:07 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 00O5F4l4010224 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 23 Jan 2020 21:15:04 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 00O5F3uo010223; Thu, 23 Jan 2020 21:15:03 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Thu, 23 Jan 2020 21:15:03 -0800 From: Gleb Smirnoff To: Jeff Roberson Cc: Ryan Stone , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r357051 - head/sys/dev/bge Message-ID: <20200124051503.GM1268@FreeBSD.org> References: <202001231636.00NGawrr080128@repo.freebsd.org> <20200123230546.GG1268@FreeBSD.org> <20200124012458.GI1268@FreeBSD.org> <20200124024356.GK1268@FreeBSD.org> <20200124033243.GL1268@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 483nQM37hDz4WRF X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.87)[-0.865,0]; NEURAL_HAM_LONG(-0.14)[-0.137,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, 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, 24 Jan 2020 05:15:07 -0000 On Thu, Jan 23, 2020 at 06:18:15PM -1000, Jeff Roberson wrote: J> > That was https://reviews.freebsd.org/D23242 J> J> Ok thank you. Can you tag commits so people can see the discussion? Was J> it in one I missed? When I'm committing a long patch series I include the J> link in all of them. I probably now on will also include in every patch in a serie. I just dislike that first one (usually a preparation change) closes the review. -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Fri Jan 24 05:41:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7014822E663; Fri, 24 Jan 2020 05:41:05 +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 483p0K2HDpz4XH9; Fri, 24 Jan 2020 05:41:05 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 40BE319C7E; Fri, 24 Jan 2020 05:41:05 +0000 (UTC) Date: Fri, 24 Jan 2020 05:41:05 +0000 From: Alexey Dokuchaev To: Jeff Roberson Cc: Jeff Roberson , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r357028 - head/sys/vm Message-ID: <20200124054105.GA49994@FreeBSD.org> References: <202001230523.00N5NbbB078486@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 05:41:05 -0000 On Wed, Jan 22, 2020 at 07:33:00PM -1000, Jeff Roberson wrote: > You may be asking yourself, why did jeff just squish a bunch of code > around with little functional change. I could not justify adding more > complexity to a 900 line function with a handful of gotos. It is ~300 > lines now. I tested the whole set together. I apologize if there are > bugs. I'm quite certain folks do appreciate the good work Jeff. "Reviewed by: dougm, kib, markj" lines leave very little room for doubt. :-) ./danfe From owner-svn-src-all@freebsd.org Fri Jan 24 06:24:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F97122EFAE; Fri, 24 Jan 2020 06:24:41 +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 483pyd1JcNz4Yjc; Fri, 24 Jan 2020 06:24:41 +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 2832F23288; Fri, 24 Jan 2020 06:24:41 +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 00O6OeEb073528; Fri, 24 Jan 2020 06:24:40 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00O6OeFN073527; Fri, 24 Jan 2020 06:24:40 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202001240624.00O6OeFN073527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 24 Jan 2020 06:24:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357068 - head/usr.sbin/ntp/libntpevent X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/usr.sbin/ntp/libntpevent X-SVN-Commit-Revision: 357068 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 06:24:41 -0000 Author: adrian Date: Fri Jan 24 06:24:40 2020 New Revision: 357068 URL: https://svnweb.freebsd.org/changeset/base/357068 Log: [ntp] Don't compile in the ssl routines into libevent if MK_OPENSSL is no Most of ntpd still handles MK_OPENSSL ok, but the libevent import brought in the SSL bufferevent routines without checking MK_OPENSSL. This doesn't completely fix WITHOUT_CRYPTO=YES building, but hey, it's one less broken thing. Modified: head/usr.sbin/ntp/libntpevent/Makefile Modified: head/usr.sbin/ntp/libntpevent/Makefile ============================================================================== --- head/usr.sbin/ntp/libntpevent/Makefile Fri Jan 24 02:18:09 2020 (r357067) +++ head/usr.sbin/ntp/libntpevent/Makefile Fri Jan 24 06:24:40 2020 (r357068) @@ -1,15 +1,21 @@ # $FreeBSD$ +.include + .PATH: ${SRCTOP}/contrib/libevent LIB= ntpevent INTERNALLIB= -SRCS= buffer.c bufferevent.c bufferevent_filter.c bufferevent_openssl.c \ +SRCS= buffer.c bufferevent.c bufferevent_filter.c \ bufferevent_pair.c epoll.c evdns.c event.c event_tagging.c \ evmap.c evport.c evrpc.c evthread.c evthread_pthread.c evutil.c \ evutil_rand.c evutil_time.c http.c kqueue.c listener.c log.c poll.c \ select.c signal.c strlcpy.c + +.if ${MK_OPENSSL} != "no" +SRCS+= bufferevent_openssl.c +.endif .if ${MACHINE_ARCH} == "i386" NTP_ATOMIC=x86_32 From owner-svn-src-all@freebsd.org Fri Jan 24 07:42:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C12A3230DCF; Fri, 24 Jan 2020 07:42:57 +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 483rhx4l2Mz4dDq; Fri, 24 Jan 2020 07:42:57 +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 9DD7C240F7; Fri, 24 Jan 2020 07:42:57 +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 00O7gv3X020953; Fri, 24 Jan 2020 07:42:57 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00O7gv5v020952; Fri, 24 Jan 2020 07:42:57 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001240742.00O7gv5v020952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 24 Jan 2020 07:42:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357069 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 07:42:57 -0000 Author: mjg Date: Fri Jan 24 07:42:57 2020 New Revision: 357069 URL: https://svnweb.freebsd.org/changeset/base/357069 Log: lockmgr: don't touch the lock past unlock This evens it up with other locking primitives. Note lock profiling still touches the lock, which again is in line with the rest. Reviewed by: jeff Differential Revision: https://reviews.freebsd.org/D23343 Modified: head/sys/kern/kern_lock.c Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Fri Jan 24 06:24:40 2020 (r357068) +++ head/sys/kern/kern_lock.c Fri Jan 24 07:42:57 2020 (r357069) @@ -209,7 +209,6 @@ static void lockmgr_note_shared_release(struct lock *lk, const char *file, int line) { - LOCKSTAT_PROFILE_RELEASE_RWLOCK(lockmgr__release, lk, LOCKSTAT_READER); WITNESS_UNLOCK(&lk->lock_object, 0, file, line); LOCK_LOG_LOCK("SUNLOCK", &lk->lock_object, 0, 0, file, line); TD_LOCKS_DEC(curthread); @@ -234,11 +233,12 @@ static void lockmgr_note_exclusive_release(struct lock *lk, const char *file, int line) { - LOCKSTAT_PROFILE_RELEASE_RWLOCK(lockmgr__release, lk, LOCKSTAT_WRITER); + if (LK_HOLDER(lk->lk_lock) != LK_KERNPROC) { + WITNESS_UNLOCK(&lk->lock_object, LOP_EXCLUSIVE, file, line); + TD_LOCKS_DEC(curthread); + } LOCK_LOG_LOCK("XUNLOCK", &lk->lock_object, 0, lk->lk_recurse, file, line); - WITNESS_UNLOCK(&lk->lock_object, LOP_EXCLUSIVE, file, line); - TD_LOCKS_DEC(curthread); } static __inline struct thread * @@ -388,7 +388,7 @@ retry_sleepq: break; } - lockmgr_note_shared_release(lk, file, line); + LOCKSTAT_PROFILE_RELEASE_RWLOCK(lockmgr__release, lk, LOCKSTAT_READER); return (wakeup_swapper); } @@ -924,6 +924,7 @@ lockmgr_upgrade(struct lock *lk, u_int flags, struct l * We have been unable to succeed in upgrading, so just * give up the shared lock. */ + lockmgr_note_shared_release(lk, file, line); wakeup_swapper |= wakeupshlk(lk, file, line); error = lockmgr_xlock_hard(lk, flags, ilk, file, line, lwa); flags &= ~LK_INTERLOCK; @@ -1034,11 +1035,6 @@ lockmgr_xunlock_hard(struct lock *lk, uintptr_t x, u_i */ if (LK_HOLDER(x) == LK_KERNPROC) tid = LK_KERNPROC; - else { - WITNESS_UNLOCK(&lk->lock_object, LOP_EXCLUSIVE, file, line); - TD_LOCKS_DEC(curthread); - } - LOCK_LOG_LOCK("XUNLOCK", &lk->lock_object, 0, lk->lk_recurse, file, line); /* * The lock is held in exclusive mode. @@ -1135,16 +1131,18 @@ lockmgr_unlock_fast_path(struct lock *lk, u_int flags, _lockmgr_assert(lk, KA_LOCKED, file, line); x = lk->lk_lock; if (__predict_true(x & LK_SHARE) != 0) { + lockmgr_note_shared_release(lk, file, line); if (lockmgr_sunlock_try(lk, &x)) { - lockmgr_note_shared_release(lk, file, line); + LOCKSTAT_PROFILE_RELEASE_RWLOCK(lockmgr__release, lk, LOCKSTAT_READER); } else { return (lockmgr_sunlock_hard(lk, x, flags, ilk, file, line)); } } else { tid = (uintptr_t)curthread; + lockmgr_note_exclusive_release(lk, file, line); if (!lockmgr_recursed(lk) && atomic_cmpset_rel_ptr(&lk->lk_lock, tid, LK_UNLOCKED)) { - lockmgr_note_exclusive_release(lk, file, line); + LOCKSTAT_PROFILE_RELEASE_RWLOCK(lockmgr__release, lk, LOCKSTAT_WRITER); } else { return (lockmgr_xunlock_hard(lk, x, flags, ilk, file, line)); } @@ -1221,16 +1219,18 @@ lockmgr_unlock(struct lock *lk) _lockmgr_assert(lk, KA_LOCKED, file, line); x = lk->lk_lock; if (__predict_true(x & LK_SHARE) != 0) { + lockmgr_note_shared_release(lk, file, line); if (lockmgr_sunlock_try(lk, &x)) { - lockmgr_note_shared_release(lk, file, line); + LOCKSTAT_PROFILE_RELEASE_RWLOCK(lockmgr__release, lk, LOCKSTAT_READER); } else { return (lockmgr_sunlock_hard(lk, x, LK_RELEASE, NULL, file, line)); } } else { tid = (uintptr_t)curthread; + lockmgr_note_exclusive_release(lk, file, line); if (!lockmgr_recursed(lk) && atomic_cmpset_rel_ptr(&lk->lk_lock, tid, LK_UNLOCKED)) { - lockmgr_note_exclusive_release(lk, file, line); + LOCKSTAT_PROFILE_RELEASE_RWLOCK(lockmgr__release, lk, LOCKSTAT_WRITER); } else { return (lockmgr_xunlock_hard(lk, x, LK_RELEASE, NULL, file, line)); } @@ -1347,8 +1347,10 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lo x = lk->lk_lock; if (__predict_true(x & LK_SHARE) != 0) { + lockmgr_note_shared_release(lk, file, line); return (lockmgr_sunlock_hard(lk, x, flags, ilk, file, line)); } else { + lockmgr_note_exclusive_release(lk, file, line); return (lockmgr_xunlock_hard(lk, x, flags, ilk, file, line)); } break; From owner-svn-src-all@freebsd.org Fri Jan 24 07:44:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C861A230E58; Fri, 24 Jan 2020 07:44:25 +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 483rkd4wdwz4dMZ; Fri, 24 Jan 2020 07:44:25 +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 A426E240FB; Fri, 24 Jan 2020 07:44:25 +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 00O7iP6Y021083; Fri, 24 Jan 2020 07:44:25 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00O7iPiB021082; Fri, 24 Jan 2020 07:44:25 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001240744.00O7iPiB021082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 24 Jan 2020 07:44:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357070 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357070 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 07:44:25 -0000 Author: mjg Date: Fri Jan 24 07:44:25 2020 New Revision: 357070 URL: https://svnweb.freebsd.org/changeset/base/357070 Log: vfs: stop unlocking the vnode upfront in vput Doing so runs into races with filesystems which make half-constructed vnodes visible to other users, while depending on the chain vput -> vinactive -> vrecycle to be executed without dropping the vnode lock. Impediments for making this work got cleared up (notably vop_unlock_post now does not do anything and lockmgr stops touching the lock after the final write). Stacked filesystems keep vhold/vdrop across unlock, which arguably can now be eliminated. Reviewed by: jeff Differential Revision: https://reviews.freebsd.org/D23344 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Jan 24 07:42:57 2020 (r357069) +++ head/sys/kern/vfs_subr.c Fri Jan 24 07:44:25 2020 (r357070) @@ -3088,6 +3088,11 @@ enum vputx_op { VPUTX_VRELE, VPUTX_VPUT, VPUTX_VUNREF * Decrement the use and hold counts for a vnode. * * See an explanation near vget() as to why atomic operation is safe. + * + * XXX Some filesystems pass in an exclusively locked vnode and strongly depend + * on the lock being held all the way until VOP_INACTIVE. This in particular + * happens with UFS which adds half-constructed vnodes to the hash, where they + * can be found by other code. */ static void vputx(struct vnode *vp, enum vputx_op func) @@ -3097,6 +3102,8 @@ vputx(struct vnode *vp, enum vputx_op func) KASSERT(vp != NULL, ("vputx: null vp")); if (func == VPUTX_VUNREF) ASSERT_VOP_LOCKED(vp, "vunref"); + else if (func == VPUTX_VPUT) + ASSERT_VOP_LOCKED(vp, "vput"); ASSERT_VI_UNLOCKED(vp, __func__); VNASSERT(vp->v_holdcnt > 0 && vp->v_usecount > 0, vp, ("%s: wrong ref counts", __func__)); @@ -3112,22 +3119,19 @@ vputx(struct vnode *vp, enum vputx_op func) * count which provides liveness of the vnode, in which case we * have to vdrop. */ - if (!refcount_release(&vp->v_usecount)) + if (!refcount_release(&vp->v_usecount)) { + if (func == VPUTX_VPUT) + VOP_UNLOCK(vp); return; + } VI_LOCK(vp); v_decr_devcount(vp); /* * By the time we got here someone else might have transitioned * the count back to > 0. */ - if (vp->v_usecount > 0) { - vdropl(vp); - return; - } - if (vp->v_iflag & VI_DOINGINACT) { - vdropl(vp); - return; - } + if (vp->v_usecount > 0 || vp->v_iflag & VI_DOINGINACT) + goto out; /* * Check if the fs wants to perform inactive processing. Note we @@ -3137,10 +3141,8 @@ vputx(struct vnode *vp, enum vputx_op func) * here but to drop our hold count. */ if (__predict_false(VN_IS_DOOMED(vp)) || - VOP_NEED_INACTIVE(vp) == 0) { - vdropl(vp); - return; - } + VOP_NEED_INACTIVE(vp) == 0) + goto out; /* * We must call VOP_INACTIVE with the node locked. Mark @@ -3153,8 +3155,12 @@ vputx(struct vnode *vp, enum vputx_op func) VI_LOCK(vp); break; case VPUTX_VPUT: - error = VOP_LOCK(vp, LK_EXCLUSIVE | LK_INTERLOCK | LK_NOWAIT); - VI_LOCK(vp); + error = 0; + if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) { + error = VOP_LOCK(vp, LK_UPGRADE | LK_INTERLOCK | + LK_NOWAIT); + VI_LOCK(vp); + } break; case VPUTX_VUNREF: error = 0; @@ -3177,6 +3183,11 @@ vputx(struct vnode *vp, enum vputx_op func) } else { vdropl(vp); } + return; +out: + if (func == VPUTX_VPUT) + VOP_UNLOCK(vp); + vdropl(vp); } /* @@ -3194,21 +3205,11 @@ vrele(struct vnode *vp) * Release an already locked vnode. This give the same effects as * unlock+vrele(), but takes less time and avoids releasing and * re-aquiring the lock (as vrele() acquires the lock internally.) - * - * It is an invariant that all VOP_* calls operate on a held vnode. - * We may be only having an implicit hold stemming from our usecount, - * which we are about to release. If we unlock the vnode afterwards we - * open a time window where someone else dropped the last usecount and - * proceeded to free the vnode before our unlock finished. For this - * reason we unlock the vnode early. This is a little bit wasteful as - * it may be the vnode is exclusively locked and inactive processing is - * needed, in which case we are adding work. */ void vput(struct vnode *vp) { - VOP_UNLOCK(vp); vputx(vp, VPUTX_VPUT); } From owner-svn-src-all@freebsd.org Fri Jan 24 07:46:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8EBAF230EF0; Fri, 24 Jan 2020 07:46:00 +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 483rmS314Vz4dVh; Fri, 24 Jan 2020 07:46:00 +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 6271024100; Fri, 24 Jan 2020 07:46:00 +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 00O7k0U1021211; Fri, 24 Jan 2020 07:46:00 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00O7k0ZY021210; Fri, 24 Jan 2020 07:46:00 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001240746.00O7k0ZY021210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 24 Jan 2020 07:46:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357071 - in head/sys: kern ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern ufs/ffs X-SVN-Commit-Revision: 357071 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 07:46:00 -0000 Author: mjg Date: Fri Jan 24 07:45:59 2020 New Revision: 357071 URL: https://svnweb.freebsd.org/changeset/base/357071 Log: vfs: stop handling VI_OWEINACT in vget vget is almost always called with LK_SHARED, meaning the flag (if present) is almost guaranteed to get cleared. Stop handling it in the first place and instead let the thread which wanted to do inactive handle the bumepd usecount. Reviewed by: jeff Tested by: pho Differential Revision: https://reviews.freebsd.org/D23184 Modified: head/sys/kern/vfs_subr.c head/sys/ufs/ffs/ffs_snapshot.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Jan 24 07:44:25 2020 (r357070) +++ head/sys/kern/vfs_subr.c Fri Jan 24 07:45:59 2020 (r357071) @@ -2860,7 +2860,7 @@ vget(struct vnode *vp, int flags, struct thread *td) int vget_finish(struct vnode *vp, int flags, enum vgetstate vs) { - int error, oweinact; + int error; VNASSERT((flags & LK_TYPE_MASK) != 0, vp, ("%s: invalid lock operation", __func__)); @@ -2887,8 +2887,6 @@ vget_finish(struct vnode *vp, int flags, enum vgetstat } if (vs == VGET_USECOUNT) { - VNASSERT((vp->v_iflag & VI_OWEINACT) == 0, vp, - ("%s: vnode with usecount and VI_OWEINACT set", __func__)); return (0); } @@ -2904,9 +2902,6 @@ vget_finish(struct vnode *vp, int flags, enum vgetstat #else refcount_release(&vp->v_holdcnt); #endif - VNODE_REFCOUNT_FENCE_ACQ(); - VNASSERT((vp->v_iflag & VI_OWEINACT) == 0, vp, - ("%s: vnode with usecount and VI_OWEINACT set", __func__)); return (0); } @@ -2930,25 +2925,11 @@ vget_finish(struct vnode *vp, int flags, enum vgetstat #else refcount_release(&vp->v_holdcnt); #endif - VNODE_REFCOUNT_FENCE_ACQ(); - VNASSERT((vp->v_iflag & VI_OWEINACT) == 0, vp, - ("%s: vnode with usecount and VI_OWEINACT set", - __func__)); VI_UNLOCK(vp); return (0); } - if ((vp->v_iflag & VI_OWEINACT) == 0) { - oweinact = 0; - } else { - oweinact = 1; - vp->v_iflag &= ~VI_OWEINACT; - VNODE_REFCOUNT_FENCE_REL(); - } v_incr_devcount(vp); refcount_acquire(&vp->v_usecount); - if (oweinact && VOP_ISLOCKED(vp) == LK_EXCLUSIVE && - (flags & LK_NOWAIT) == 0) - vinactive(vp); VI_UNLOCK(vp); return (0); } @@ -2967,8 +2948,6 @@ vref(struct vnode *vp) VNODE_REFCOUNT_FENCE_ACQ(); VNASSERT(vp->v_holdcnt > 0, vp, ("%s: active vnode not held", __func__)); - VNASSERT((vp->v_iflag & VI_OWEINACT) == 0, vp, - ("%s: vnode with usecount and VI_OWEINACT set", __func__)); return; } VI_LOCK(vp); @@ -2986,15 +2965,9 @@ vrefl(struct vnode *vp) VNODE_REFCOUNT_FENCE_ACQ(); VNASSERT(vp->v_holdcnt > 0, vp, ("%s: active vnode not held", __func__)); - VNASSERT((vp->v_iflag & VI_OWEINACT) == 0, vp, - ("%s: vnode with usecount and VI_OWEINACT set", __func__)); return; } vholdl(vp); - if ((vp->v_iflag & VI_OWEINACT) != 0) { - vp->v_iflag &= ~VI_OWEINACT; - VNODE_REFCOUNT_FENCE_REL(); - } v_incr_devcount(vp); refcount_acquire(&vp->v_usecount); } @@ -3052,8 +3025,8 @@ vdefer_inactive(struct vnode *vp) { ASSERT_VI_LOCKED(vp, __func__); - VNASSERT(vp->v_iflag & VI_OWEINACT, vp, - ("%s: vnode without VI_OWEINACT", __func__)); + VNASSERT(vp->v_holdcnt > 0, vp, + ("%s: vnode without hold count", __func__)); if (VN_IS_DOOMED(vp)) { vdropl(vp); return; @@ -3063,6 +3036,11 @@ vdefer_inactive(struct vnode *vp) vdropl(vp); return; } + if (vp->v_usecount > 0) { + vp->v_iflag &= ~VI_OWEINACT; + vdropl(vp); + return; + } vlazy(vp); vp->v_iflag |= VI_DEFINACT; VI_UNLOCK(vp); @@ -3070,11 +3048,10 @@ vdefer_inactive(struct vnode *vp) } static void -vdefer_inactive_cond(struct vnode *vp) +vdefer_inactive_unlocked(struct vnode *vp) { VI_LOCK(vp); - VNASSERT(vp->v_holdcnt > 0, vp, ("vnode without hold count")); if ((vp->v_iflag & VI_OWEINACT) == 0) { vdropl(vp); return; @@ -3173,15 +3150,12 @@ vputx(struct vnode *vp, enum vputx_op func) VNASSERT(vp->v_usecount == 0 || (vp->v_iflag & VI_OWEINACT) == 0, vp, ("vnode with usecount and VI_OWEINACT set")); if (error == 0) { - if (vp->v_iflag & VI_OWEINACT) - vinactive(vp); + vinactive(vp); if (func != VPUTX_VUNREF) VOP_UNLOCK(vp); vdropl(vp); - } else if (vp->v_iflag & VI_OWEINACT) { - vdefer_inactive(vp); } else { - vdropl(vp); + vdefer_inactive(vp); } return; out: @@ -3442,11 +3416,9 @@ vdropl(struct vnode *vp) /* * Call VOP_INACTIVE on the vnode and manage the DOINGINACT and OWEINACT * flags. DOINGINACT prevents us from recursing in calls to vinactive. - * OWEINACT tracks whether a vnode missed a call to inactive due to a - * failed lock upgrade. */ -void -vinactive(struct vnode *vp) +static void +vinactivef(struct vnode *vp) { struct vm_object *obj; @@ -3481,6 +3453,25 @@ vinactive(struct vnode *vp) vp->v_iflag &= ~VI_DOINGINACT; } +void +vinactive(struct vnode *vp) +{ + + ASSERT_VOP_ELOCKED(vp, "vinactive"); + ASSERT_VI_LOCKED(vp, "vinactive"); + CTR2(KTR_VFS, "%s: vp %p", __func__, vp); + + if ((vp->v_iflag & VI_OWEINACT) == 0) + return; + if (vp->v_iflag & VI_DOINGINACT) + return; + if (vp->v_usecount > 0) { + vp->v_iflag &= ~VI_OWEINACT; + return; + } + vinactivef(vp); +} + /* * Remove any vnodes in the vnode table belonging to mount point mp. * @@ -3779,8 +3770,7 @@ vgonel(struct vnode *vp) VOP_CLOSE(vp, FNONBLOCK, NOCRED, td); if (oweinact || active) { VI_LOCK(vp); - if ((vp->v_iflag & VI_DOINGINACT) == 0) - vinactive(vp); + vinactivef(vp); VI_UNLOCK(vp); } if (vp->v_type == VSOCK) @@ -4530,13 +4520,12 @@ vfs_deferred_inactive(struct vnode *vp, int lkflags) } if (vn_lock(vp, lkflags) == 0) { VI_LOCK(vp); - if ((vp->v_iflag & (VI_OWEINACT | VI_DOINGINACT)) == VI_OWEINACT) - vinactive(vp); + vinactive(vp); VOP_UNLOCK(vp); vdropl(vp); return; } - vdefer_inactive_cond(vp); + vdefer_inactive_unlocked(vp); } static int @@ -4636,7 +4625,7 @@ vfs_periodic_msync_inactive(struct mount *mp, int flag vdrop(vp); } else { if (seen_defer) - vdefer_inactive_cond(vp); + vdefer_inactive_unlocked(vp); } } } Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Fri Jan 24 07:44:25 2020 (r357070) +++ head/sys/ufs/ffs/ffs_snapshot.c Fri Jan 24 07:45:59 2020 (r357071) @@ -2583,15 +2583,7 @@ process_deferred_inactive(struct mount *mp) UFS_INODE_SET_FLAG(ip, IN_MODIFIED); } VI_LOCK(vp); - if ((vp->v_iflag & VI_OWEINACT) == 0 || vp->v_usecount > 0) { - VI_UNLOCK(vp); - VOP_UNLOCK(vp); - vdrop(vp); - continue; - } vinactive(vp); - VNASSERT((vp->v_iflag & VI_OWEINACT) == 0, vp, - ("process_deferred_inactive: got VI_OWEINACT")); VI_UNLOCK(vp); VOP_UNLOCK(vp); vdrop(vp); From owner-svn-src-all@freebsd.org Fri Jan 24 07:47:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7116D230FBA; Fri, 24 Jan 2020 07:47:45 +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 483rpT1lgYz4dfH; Fri, 24 Jan 2020 07:47:45 +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 3732124104; Fri, 24 Jan 2020 07:47:45 +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 00O7liFV021324; Fri, 24 Jan 2020 07:47:44 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00O7li83021323; Fri, 24 Jan 2020 07:47:44 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202001240747.00O7li83021323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 24 Jan 2020 07:47:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357072 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357072 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 07:47:45 -0000 Author: mjg Date: Fri Jan 24 07:47:44 2020 New Revision: 357072 URL: https://svnweb.freebsd.org/changeset/base/357072 Log: vfs: allow v_usecount to transition 0->1 without the interlock There is nothing to do but to bump the count even during said transition. There are 2 places which can do it: - vget only does this after locking the vnode, meaning there is no change in contract versus inactive or reclamantion - vref only ever did it with the interlock held which did not protect against either (that is, it would always succeed) VCHR vnodes retain special casing due to the need to maintain dev use count. Reviewed by: jeff, kib Tested by: pho (previous version) Differential Revision: https://reviews.freebsd.org/D23185 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Jan 24 07:45:59 2020 (r357071) +++ head/sys/kern/vfs_subr.c Fri Jan 24 07:47:44 2020 (r357072) @@ -2826,11 +2826,10 @@ v_decr_devcount(struct vnode *vp) * see doomed vnodes. If inactive processing was delayed in * vput try to do it here. * - * usecount is manipulated using atomics without holding any locks, - * except when transitioning 0->1 in which case the interlock is held. - - * holdcnt is manipulated using atomics without holding any locks, - * except when transitioning 1->0 in which case the interlock is held. + * usecount is manipulated using atomics without holding any locks. + * + * holdcnt can be manipulated using atomics without holding any locks, + * except when transitioning 1<->0, in which case the interlock is held. */ enum vgetstate vget_prep(struct vnode *vp) @@ -2857,10 +2856,46 @@ vget(struct vnode *vp, int flags, struct thread *td) return (vget_finish(vp, flags, vs)); } +static int __noinline +vget_finish_vchr(struct vnode *vp) +{ + + VNASSERT(vp->v_type == VCHR, vp, ("type != VCHR)")); + + /* + * See the comment in vget_finish before usecount bump. + */ + if (refcount_acquire_if_not_zero(&vp->v_usecount)) { +#ifdef INVARIANTS + int old = atomic_fetchadd_int(&vp->v_holdcnt, -1); + VNASSERT(old > 0, vp, ("%s: wrong hold count %d", __func__, old)); +#else + refcount_release(&vp->v_holdcnt); +#endif + return (0); + } + + VI_LOCK(vp); + if (refcount_acquire_if_not_zero(&vp->v_usecount)) { +#ifdef INVARIANTS + int old = atomic_fetchadd_int(&vp->v_holdcnt, -1); + VNASSERT(old > 1, vp, ("%s: wrong hold count %d", __func__, old)); +#else + refcount_release(&vp->v_holdcnt); +#endif + VI_UNLOCK(vp); + return (0); + } + v_incr_devcount(vp); + refcount_acquire(&vp->v_usecount); + VI_UNLOCK(vp); + return (0); +} + int vget_finish(struct vnode *vp, int flags, enum vgetstate vs) { - int error; + int error, old; VNASSERT((flags & LK_TYPE_MASK) != 0, vp, ("%s: invalid lock operation", __func__)); @@ -2890,69 +2925,106 @@ vget_finish(struct vnode *vp, int flags, enum vgetstat return (0); } + if (__predict_false(vp->v_type == VCHR)) + return (vget_finish_vchr(vp)); + /* * We hold the vnode. If the usecount is 0 it will be utilized to keep * the vnode around. Otherwise someone else lended their hold count and * we have to drop ours. */ - if (refcount_acquire_if_not_zero(&vp->v_usecount)) { + old = atomic_fetchadd_int(&vp->v_usecount, 1); + VNASSERT(old >= 0, vp, ("%s: wrong use count %d", __func__, old)); + if (old != 0) { #ifdef INVARIANTS - int old = atomic_fetchadd_int(&vp->v_holdcnt, -1); + old = atomic_fetchadd_int(&vp->v_holdcnt, -1); VNASSERT(old > 1, vp, ("%s: wrong hold count %d", __func__, old)); #else refcount_release(&vp->v_holdcnt); #endif - return (0); } + return (0); +} +/* + * Increase the reference (use) and hold count of a vnode. + * This will also remove the vnode from the free list if it is presently free. + */ +static void __noinline +vref_vchr(struct vnode *vp, bool interlock) +{ + /* - * We don't guarantee that any particular close will - * trigger inactive processing so just make a best effort - * here at preventing a reference to a removed file. If - * we don't succeed no harm is done. - * - * Upgrade our holdcnt to a usecount. + * See the comment in vget_finish before usecount bump. */ - VI_LOCK(vp); - /* - * See the previous section. By the time we get here we may find - * ourselves in the same spot. - */ + if (!interlock) { + if (refcount_acquire_if_not_zero(&vp->v_usecount)) { + VNODE_REFCOUNT_FENCE_ACQ(); + VNASSERT(vp->v_holdcnt > 0, vp, + ("%s: active vnode not held", __func__)); + return; + } + VI_LOCK(vp); + /* + * By the time we get here the vnode might have been doomed, at + * which point the 0->1 use count transition is no longer + * protected by the interlock. Since it can't bounce back to + * VCHR and requires vref semantics, punt it back + */ + if (__predict_false(vp->v_type == VBAD)) { + VI_UNLOCK(vp); + vref(vp); + return; + } + } + VNASSERT(vp->v_type == VCHR, vp, ("type != VCHR)")); if (refcount_acquire_if_not_zero(&vp->v_usecount)) { -#ifdef INVARIANTS - int old = atomic_fetchadd_int(&vp->v_holdcnt, -1); - VNASSERT(old > 1, vp, ("%s: wrong hold count %d", __func__, old)); -#else - refcount_release(&vp->v_holdcnt); -#endif - VI_UNLOCK(vp); - return (0); + VNODE_REFCOUNT_FENCE_ACQ(); + VNASSERT(vp->v_holdcnt > 0, vp, + ("%s: active vnode not held", __func__)); + if (!interlock) + VI_UNLOCK(vp); + return; } + vhold(vp); v_incr_devcount(vp); refcount_acquire(&vp->v_usecount); - VI_UNLOCK(vp); - return (0); + if (!interlock) + VI_UNLOCK(vp); + return; } -/* - * Increase the reference (use) and hold count of a vnode. - * This will also remove the vnode from the free list if it is presently free. - */ void vref(struct vnode *vp) { + int old; - ASSERT_VI_UNLOCKED(vp, __func__); CTR2(KTR_VFS, "%s: vp %p", __func__, vp); + if (__predict_false(vp->v_type == VCHR)) { + vref_vchr(vp, false); + return; + } + if (refcount_acquire_if_not_zero(&vp->v_usecount)) { VNODE_REFCOUNT_FENCE_ACQ(); VNASSERT(vp->v_holdcnt > 0, vp, ("%s: active vnode not held", __func__)); return; } - VI_LOCK(vp); - vrefl(vp); - VI_UNLOCK(vp); + vhold(vp); + /* + * See the comment in vget_finish. + */ + old = atomic_fetchadd_int(&vp->v_usecount, 1); + VNASSERT(old >= 0, vp, ("%s: wrong use count %d", __func__, old)); + if (old != 0) { +#ifdef INVARIANTS + old = atomic_fetchadd_int(&vp->v_holdcnt, -1); + VNASSERT(old > 1, vp, ("%s: wrong hold count %d", __func__, old)); +#else + refcount_release(&vp->v_holdcnt); +#endif + } } void @@ -2961,15 +3033,11 @@ vrefl(struct vnode *vp) ASSERT_VI_LOCKED(vp, __func__); CTR2(KTR_VFS, "%s: vp %p", __func__, vp); - if (refcount_acquire_if_not_zero(&vp->v_usecount)) { - VNODE_REFCOUNT_FENCE_ACQ(); - VNASSERT(vp->v_holdcnt > 0, vp, - ("%s: active vnode not held", __func__)); + if (__predict_false(vp->v_type == VCHR)) { + vref_vchr(vp, true); return; } - vholdl(vp); - v_incr_devcount(vp); - refcount_acquire(&vp->v_usecount); + vref(vp); } void @@ -3147,8 +3215,6 @@ vputx(struct vnode *vp, enum vputx_op func) } break; } - VNASSERT(vp->v_usecount == 0 || (vp->v_iflag & VI_OWEINACT) == 0, vp, - ("vnode with usecount and VI_OWEINACT set")); if (error == 0) { vinactive(vp); if (func != VPUTX_VUNREF) From owner-svn-src-all@freebsd.org Fri Jan 24 07:48:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C17D6231028; Fri, 24 Jan 2020 07:48:11 +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 483rpz4PjBz4dml; Fri, 24 Jan 2020 07:48:11 +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 9266D24108; Fri, 24 Jan 2020 07:48:11 +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 00O7mBYV021394; Fri, 24 Jan 2020 07:48:11 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00O7mB7o021393; Fri, 24 Jan 2020 07:48:11 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <202001240748.00O7mB7o021393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Fri, 24 Jan 2020 07:48:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357073 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 07:48:11 -0000 Author: dougm Date: Fri Jan 24 07:48:11 2020 New Revision: 357073 URL: https://svnweb.freebsd.org/changeset/base/357073 Log: Most uses of vm_map_clip_start follow a call to vm_map_lookup. Define an inline function vm_map_lookup_clip_start that invokes them both and use it in places that invoke both. Drop a couple of local variables made unnecessary by this function. Reviewed by: markj Tested by: pho Differential Revision: https://reviews.freebsd.org/D22987 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Fri Jan 24 07:47:44 2020 (r357072) +++ head/sys/vm/vm_map.c Fri Jan 24 07:48:11 2020 (r357073) @@ -2387,7 +2387,7 @@ vm_map_entry_clone(vm_map_t map, vm_map_entry_t entry) * This routine is called only when it is known that * the entry must be split. */ -static void +static inline void _vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, vm_offset_t start) { vm_map_entry_t new_entry; @@ -2407,6 +2407,28 @@ _vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, } /* + * vm_map_lookup_clip_start: + * + * Find the entry at or just after 'start', and clip it if 'start' is in + * the interior of the entry. Return entry after 'start', and in + * prev_entry set the entry before 'start'. + */ +static inline vm_map_entry_t +vm_map_lookup_clip_start(vm_map_t map, vm_offset_t start, + vm_map_entry_t *prev_entry) +{ + vm_map_entry_t entry; + + if (vm_map_lookup_entry(map, start, prev_entry)) { + entry = *prev_entry; + vm_map_clip_start(map, entry, start); + *prev_entry = vm_map_entry_pred(entry); + } else + entry = vm_map_entry_succ(*prev_entry); + return (entry); +} + +/* * vm_map_clip_end: [ internal use only ] * * Asserts that the given entry ends at or before @@ -2423,7 +2445,7 @@ _vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, * This routine is called only when it is known that * the entry must be split. */ -static void +static inline void _vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, vm_offset_t end) { vm_map_entry_t new_entry; @@ -2835,15 +2857,6 @@ vm_map_madvise( */ VM_MAP_RANGE_CHECK(map, start, end); - if (vm_map_lookup_entry(map, start, &entry)) { - if (modify_map) - vm_map_clip_start(map, entry, start); - prev_entry = vm_map_entry_pred(entry); - } else { - prev_entry = entry; - entry = vm_map_entry_succ(entry); - } - if (modify_map) { /* * madvise behaviors that are implemented in the vm_map_entry. @@ -2851,8 +2864,9 @@ vm_map_madvise( * We clip the vm_map_entry so that behavioral changes are * limited to the specified address range. */ - for (; entry->start < end; - prev_entry = entry, entry = vm_map_entry_succ(entry)) { + for (entry = vm_map_lookup_clip_start(map, start, &prev_entry); + entry->start < end; + prev_entry = entry, entry = vm_map_entry_succ(entry)) { if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) != 0) continue; @@ -2900,6 +2914,8 @@ vm_map_madvise( * Since we don't clip the vm_map_entry, we have to clip * the vm_object pindex and count. */ + if (!vm_map_lookup_entry(map, start, &entry)) + entry = vm_map_entry_succ(entry); for (; entry->start < end; entry = vm_map_entry_succ(entry)) { vm_offset_t useEnd, useStart; @@ -3003,13 +3019,8 @@ vm_map_inherit(vm_map_t map, vm_offset_t start, vm_off return (KERN_SUCCESS); vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); - if (vm_map_lookup_entry(map, start, &prev_entry)) { - entry = prev_entry; - vm_map_clip_start(map, entry, start); - prev_entry = vm_map_entry_pred(entry); - } else - entry = vm_map_entry_succ(prev_entry); - for (; entry->start < end; + for (entry = vm_map_lookup_clip_start(map, start, &prev_entry); + entry->start < end; prev_entry = entry, entry = vm_map_entry_succ(entry)) { vm_map_clip_end(map, entry, end); if ((entry->eflags & MAP_ENTRY_GUARD) == 0 || @@ -3732,29 +3743,18 @@ vm_map_entry_delete(vm_map_t map, vm_map_entry_t entry int vm_map_delete(vm_map_t map, vm_offset_t start, vm_offset_t end) { - vm_map_entry_t entry; - vm_map_entry_t first_entry; + vm_map_entry_t entry, next_entry; VM_MAP_ASSERT_LOCKED(map); if (start == end) return (KERN_SUCCESS); /* - * Find the start of the region, and clip it + * Find the start of the region, and clip it. + * Step through all entries in this region. */ - if (!vm_map_lookup_entry(map, start, &first_entry)) - entry = vm_map_entry_succ(first_entry); - else { - entry = first_entry; - vm_map_clip_start(map, entry, start); - } - - /* - * Step through all entries in this region - */ - while (entry->start < end) { - vm_map_entry_t next; - + for (entry = vm_map_lookup_clip_start(map, start, &entry); + entry->start < end; entry = next_entry) { /* * Wait for wiring or unwiring of an entry to complete. * Also wait for any system wirings to disappear on @@ -3765,7 +3765,6 @@ vm_map_delete(vm_map_t map, vm_offset_t start, vm_offs vm_map_entry_system_wired_count(entry) != 0)) { unsigned int last_timestamp; vm_offset_t saved_start; - vm_map_entry_t tmp_entry; saved_start = entry->start; entry->eflags |= MAP_ENTRY_NEEDS_WAKEUP; @@ -3779,21 +3778,15 @@ vm_map_delete(vm_map_t map, vm_offset_t start, vm_offs * Specifically, the entry may have been * clipped, merged, or deleted. */ - if (!vm_map_lookup_entry(map, saved_start, - &tmp_entry)) - entry = vm_map_entry_succ(tmp_entry); - else { - entry = tmp_entry; - vm_map_clip_start(map, entry, - saved_start); - } - } + next_entry = vm_map_lookup_clip_start(map, + saved_start, &next_entry); + } else + next_entry = entry; continue; } vm_map_clip_end(map, entry, end); + next_entry = vm_map_entry_succ(entry); - next = vm_map_entry_succ(entry); - /* * Unwire before removing addresses from the pmap; otherwise, * unwiring will put the entries back in the pmap. @@ -3820,7 +3813,6 @@ vm_map_delete(vm_map_t map, vm_offset_t start, vm_offs * will be set in the wrong object!) */ vm_map_entry_delete(map, entry); - entry = next; } return (KERN_SUCCESS); } From owner-svn-src-all@freebsd.org Fri Jan 24 09:25:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FA0F2337CF; Fri, 24 Jan 2020 09:25:05 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 483tym1qYhz3Hdq; Fri, 24 Jan 2020 09:25:03 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 2A6F72601D2; Fri, 24 Jan 2020 10:25:01 +0100 (CET) Subject: Re: svn commit: r357004 - in head/sys: kern sys From: Hans Petter Selasky To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202001230124.00N1OlXi029506@repo.freebsd.org> Message-ID: <23f272a4-c997-a454-19d6-10392713e71f@selasky.org> Date: Fri, 24 Jan 2020 10:24:53 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.3.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: 483tym1qYhz3Hdq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; 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 [-4.96 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; 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]; TO_DN_SOME(0.00)[]; IP_SCORE(-2.66)[ip: (-9.22), ipnet: 2a01:4f8::/29(-2.52), asn: 24940(-1.55), country: DE(-0.02)]; 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, 24 Jan 2020 09:25:05 -0000 On 2020-01-23 09:36, Hans Petter Selasky wrote: > On 2020-01-23 02:24, Gleb Smirnoff wrote: >> Author: glebius >> Date: Thu Jan 23 01:24:47 2020 >> New Revision: 357004 >> URL: https://svnweb.freebsd.org/changeset/base/357004 >> >> Log: >>    Enter the network epoch for interrupt handlers of INTR_TYPE_NET. >>    Provide tunable to limit how many times handlers may be executed >>    without reentering epoch. >>    Differential Revision:    https://reviews.freebsd.org/D23242 >> >> Modified: >>    head/sys/kern/kern_intr.c >>    head/sys/sys/interrupt.h >> >> Modified: head/sys/kern/kern_intr.c >> ============================================================================== >> >> --- head/sys/kern/kern_intr.c    Thu Jan 23 01:20:59 2020    (r357003) >> +++ head/sys/kern/kern_intr.c    Thu Jan 23 01:24:47 2020    (r357004) >> @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); >>   #include >>   #include >>   #include >> +#include >>   #include >>   #include >>   #include >> @@ -94,6 +95,9 @@ static int intr_storm_threshold = 0; >>   SYSCTL_INT(_hw, OID_AUTO, intr_storm_threshold, CTLFLAG_RWTUN, >>       &intr_storm_threshold, 0, >>       "Number of consecutive interrupts before storm protection is >> enabled"); >> +static int intr_epoch_batch = 1000; >> +SYSCTL_INT(_hw, OID_AUTO, intr_epoch_batch, CTLFLAG_RWTUN, >> &intr_epoch_batch, >> +    0, "Maximum interrupt handler executions without re-entering >> epoch(9)"); >>   static TAILQ_HEAD(, intr_event) event_list = >>       TAILQ_HEAD_INITIALIZER(event_list); >>   static struct mtx event_lock; >> @@ -587,6 +591,8 @@ intr_event_add_handler(struct intr_event *ie, >> const ch >>           ih->ih_flags |= IH_MPSAFE; >>       if (flags & INTR_ENTROPY) >>           ih->ih_flags |= IH_ENTROPY; >> +    if (flags & INTR_TYPE_NET) >> +        ih->ih_flags |= IH_NET; >>       /* We can only have one exclusive handler in a event. */ >>       mtx_lock(&ie->ie_lock); >> @@ -1196,11 +1202,12 @@ ithread_execute_handlers(struct proc *p, >> struct intr_e >>   static void >>   ithread_loop(void *arg) >>   { >> +    struct epoch_tracker et; >>       struct intr_thread *ithd; >>       struct intr_event *ie; >>       struct thread *td; >>       struct proc *p; >> -    int wake; >> +    int wake, epoch_count; >>       td = curthread; >>       p = td->td_proc; >> @@ -1235,8 +1242,21 @@ ithread_loop(void *arg) >>            * that the load of ih_need in ithread_execute_handlers() >>            * is ordered after the load of it_need here. >>            */ >> -        while (atomic_cmpset_acq_int(&ithd->it_need, 1, 0) != 0) >> +        if (ie->ie_hflags & IH_NET) { >> +            epoch_count = 0; >> +            NET_EPOCH_ENTER(et); >> +        } >> +        while (atomic_cmpset_acq_int(&ithd->it_need, 1, 0) != 0) { >>               ithread_execute_handlers(p, ie); >> +            if ((ie->ie_hflags & IH_NET) && >> +                ++epoch_count >= intr_epoch_batch) { >> +                NET_EPOCH_EXIT(et); >> +                epoch_count = 0; >> +                NET_EPOCH_ENTER(et); >> +            } >> +        } >> +        if (ie->ie_hflags & IH_NET) >> +            NET_EPOCH_EXIT(et); >>           WITNESS_WARN(WARN_PANIC, NULL, "suspending ithread"); >>           mtx_assert(&Giant, MA_NOTOWNED); Hi Gleb, What you want to do here is right, but how it is implemented is wrong, in my opinion. 1) Remove intr_epoch_batch. Most network drivers use interrupt moderation, and a timeout of 1000 iterations can easily become 1 second under heavly load ! 2) You need to make a new request function for interrupts which take a pointer to an EPOCH and replace that IH_NET in hflags! --HPS From owner-svn-src-all@freebsd.org Fri Jan 24 11:22:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 49F5F2351AD; Fri, 24 Jan 2020 11:22:34 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 483xZL1CVYz3P0c; Fri, 24 Jan 2020 11:22:34 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2490C26905; Fri, 24 Jan 2020 11:22:34 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00OBMXC9052109; Fri, 24 Jan 2020 11:22:33 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OBMXeq052108; Fri, 24 Jan 2020 11:22:33 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <202001241122.00OBMXeq052108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Fri, 24 Jan 2020 11:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357074 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: n_hibma X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 357074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 11:22:34 -0000 Author: n_hibma Date: Fri Jan 24 11:22:33 2020 New Revision: 357074 URL: https://svnweb.freebsd.org/changeset/base/357074 Log: Fix a few spacing issues to make the page more readable. Modified: head/share/man/man4/netmap.4 Modified: head/share/man/man4/netmap.4 ============================================================================== --- head/share/man/man4/netmap.4 Fri Jan 24 07:48:11 2020 (r357073) +++ head/share/man/man4/netmap.4 Fri Jan 24 11:22:33 2020 (r357074) @@ -985,7 +985,7 @@ interfaces, as in or even connect the NIC to the host stack using netmap .Dl bridge -i netmap:ix0 .Ss USING THE NATIVE API -The following code implements a traffic generator +The following code implements a traffic generator: .Pp .Bd -literal -compact #include @@ -1020,7 +1020,8 @@ void sender(void) } .Ed .Ss HELPER FUNCTIONS -A simple receiver can be implemented using the helper functions +A simple receiver can be implemented using the helper functions: +.Pp .Bd -literal -compact #define NETMAP_WITH_LIBS #include @@ -1049,6 +1050,7 @@ it is possible to do packet forwarding between ports swapping buffers. The buffer from the transmit ring is used to replenish the receive ring: +.Pp .Bd -literal -compact uint32_t tmp; struct netmap_slot *src, *dst; From owner-svn-src-all@freebsd.org Fri Jan 24 11:47:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C1A262359DB; Fri, 24 Jan 2020 11:47:11 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 483y6k5bR5z3QQM; Fri, 24 Jan 2020 11:47:10 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 34ACC260172; Fri, 24 Jan 2020 12:47:08 +0100 (CET) Subject: Re: svn commit: r357004 - in head/sys: kern sys From: Hans Petter Selasky To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202001230124.00N1OlXi029506@repo.freebsd.org> Message-ID: <41fba15f-3abc-cce0-7c13-ed624907ec2d@selasky.org> Date: Fri, 24 Jan 2020 12:46:33 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.3.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: 483y6k5bR5z3QQM X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; 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 [-4.96 / 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)[+a:mail.turbocat.net:c]; 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]; TO_DN_SOME(0.00)[]; IP_SCORE(-2.66)[ip: (-9.22), ipnet: 2a01:4f8::/29(-2.52), asn: 24940(-1.55), country: DE(-0.02)]; 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, 24 Jan 2020 11:47:11 -0000 On 2020-01-23 09:36, Hans Petter Selasky wrote: > On 2020-01-23 02:24, Gleb Smirnoff wrote: >> Author: glebius >> Date: Thu Jan 23 01:24:47 2020 >> New Revision: 357004 >> URL: https://svnweb.freebsd.org/changeset/base/357004 >> >> Log: >>    Enter the network epoch for interrupt handlers of INTR_TYPE_NET. >>    Provide tunable to limit how many times handlers may be executed >>    without reentering epoch. >>    Differential Revision:    https://reviews.freebsd.org/D23242 >> Some drivers are using INTR_TYPE_NET even they are not network drivers, for example ppt.c . And it might be some drivers are network drivers and don't use INTR_TYPE_NET . I propose the following change: https://reviews.freebsd.org/D23347 --HPS From owner-svn-src-all@freebsd.org Fri Jan 24 11:57:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1A99235D3B; Fri, 24 Jan 2020 11:57:56 +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 483yM82WYNz3Qx8; Fri, 24 Jan 2020 11:57:56 +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 3320526E71; Fri, 24 Jan 2020 11:57:56 +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 00OBvtgw070110; Fri, 24 Jan 2020 11:57:55 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OBvtv8070107; Fri, 24 Jan 2020 11:57:55 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202001241157.00OBvtv8070107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 24 Jan 2020 11:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357075 - in head/sys: compat/linux kern sys X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys: compat/linux kern sys X-SVN-Commit-Revision: 357075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 11:57:56 -0000 Author: trasz Date: Fri Jan 24 11:57:55 2020 New Revision: 357075 URL: https://svnweb.freebsd.org/changeset/base/357075 Log: Add kern_unmount() and use in Linuxulator. No functional changes. Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22646 Modified: head/sys/compat/linux/linux_file.c head/sys/kern/vfs_mount.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Fri Jan 24 11:22:33 2020 (r357074) +++ head/sys/compat/linux/linux_file.c Fri Jan 24 11:57:55 2020 (r357075) @@ -1107,11 +1107,8 @@ out: int linux_oldumount(struct thread *td, struct linux_oldumount_args *args) { - struct linux_umount_args args2; - args2.path = args->path; - args2.flags = 0; - return (linux_umount(td, &args2)); + return (kern_unmount(td, args->path, 0)); } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ @@ -1119,16 +1116,19 @@ linux_oldumount(struct thread *td, struct linux_oldumo int linux_umount(struct thread *td, struct linux_umount_args *args) { - struct unmount_args bsd; int flags; flags = 0; - if ((args->flags & LINUX_MNT_FORCE) != 0) + if ((args->flags & LINUX_MNT_FORCE) != 0) { + args->flags &= ~LINUX_MNT_FORCE; flags |= MNT_FORCE; + } + if (args->flags != 0) { + linux_msg(td, "unsupported umount2 flags %#x", args->flags); + return (EINVAL); + } - bsd.path = args->path; - bsd.flags = flags; - return (sys_unmount(td, &bsd)); + return (kern_unmount(td, args->path, flags)); } #endif Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Fri Jan 24 11:22:33 2020 (r357074) +++ head/sys/kern/vfs_mount.c Fri Jan 24 11:57:55 2020 (r357075) @@ -1294,12 +1294,19 @@ struct unmount_args { int sys_unmount(struct thread *td, struct unmount_args *uap) { + + return (kern_unmount(td, uap->path, uap->flags)); +} + +int +kern_unmount(struct thread *td, const char *path, int flags) +{ struct nameidata nd; struct mount *mp; char *pathbuf; int error, id0, id1; - AUDIT_ARG_VALUE(uap->flags); + AUDIT_ARG_VALUE(flags); if (jailed(td->td_ucred) || usermount == 0) { error = priv_check(td, PRIV_VFS_UNMOUNT); if (error) @@ -1307,12 +1314,12 @@ sys_unmount(struct thread *td, struct unmount_args *ua } pathbuf = malloc(MNAMELEN, M_TEMP, M_WAITOK); - error = copyinstr(uap->path, pathbuf, MNAMELEN, NULL); + error = copyinstr(path, pathbuf, MNAMELEN, NULL); if (error) { free(pathbuf, M_TEMP); return (error); } - if (uap->flags & MNT_BYFSID) { + if (flags & MNT_BYFSID) { AUDIT_ARG_TEXT(pathbuf); /* Decode the filesystem ID. */ if (sscanf(pathbuf, "FSID:%d:%d", &id0, &id1) != 2) { @@ -1359,7 +1366,7 @@ sys_unmount(struct thread *td, struct unmount_args *ua * now, so in the !MNT_BYFSID case return the more likely * EINVAL for compatibility. */ - return ((uap->flags & MNT_BYFSID) ? ENOENT : EINVAL); + return ((flags & MNT_BYFSID) ? ENOENT : EINVAL); } /* @@ -1369,7 +1376,7 @@ sys_unmount(struct thread *td, struct unmount_args *ua vfs_rel(mp); return (EINVAL); } - error = dounmount(mp, uap->flags, td); + error = dounmount(mp, flags, td); return (error); } Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Fri Jan 24 11:22:33 2020 (r357074) +++ head/sys/sys/syscallsubr.h Fri Jan 24 11:57:55 2020 (r357075) @@ -315,6 +315,7 @@ int kern_wait6(struct thread *td, enum idtype idtype, int kern_writev(struct thread *td, int fd, struct uio *auio); int kern_socketpair(struct thread *td, int domain, int type, int protocol, int *rsv); +int kern_unmount(struct thread *td, const char *path, int flags); /* flags for kern_sigaction */ #define KSA_OSIGSET 0x0001 /* uses osigact_t */ From owner-svn-src-all@freebsd.org Fri Jan 24 12:08:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9D9E2368D6; Fri, 24 Jan 2020 12:08:24 +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 483ybD3hbNz3x1L; Fri, 24 Jan 2020 12:08:24 +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 7526027056; Fri, 24 Jan 2020 12:08:24 +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 00OC8OuT076171; Fri, 24 Jan 2020 12:08:24 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OC8OVe076169; Fri, 24 Jan 2020 12:08:24 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202001241208.00OC8OVe076169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 24 Jan 2020 12:08:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357076 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 357076 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 12:08:24 -0000 Author: trasz Date: Fri Jan 24 12:08:23 2020 New Revision: 357076 URL: https://svnweb.freebsd.org/changeset/base/357076 Log: Make linux(4) handle MAP_32BIT. This unbreaks Mono (mono-devel-4.6.2.7+dfsg-1ubuntu1 from Ubuntu Bionic); previously would crash on "amd64_is_imm32" assert. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23306 Modified: head/sys/compat/linux/linux_mmap.c head/sys/compat/linux/linux_mmap.h Modified: head/sys/compat/linux/linux_mmap.c ============================================================================== --- head/sys/compat/linux/linux_mmap.c Fri Jan 24 11:57:55 2020 (r357075) +++ head/sys/compat/linux/linux_mmap.c Fri Jan 24 12:08:23 2020 (r357076) @@ -113,7 +113,15 @@ linux_mmap_common(struct thread *td, uintptr_t addr, s if (flags & LINUX_MAP_GROWSDOWN) bsd_flags |= MAP_STACK; +#if defined(__amd64__) /* + * According to the Linux mmap(2) man page, "MAP_32BIT flag + * is ignored when MAP_FIXED is set." + */ + if ((flags & LINUX_MAP_32BIT) && (flags & LINUX_MAP_FIXED) == 0) + bsd_flags |= MAP_32BIT; + + /* * PROT_READ, PROT_WRITE, or PROT_EXEC implies PROT_READ and PROT_EXEC * on Linux/i386 if the binary requires executable stack. * We do this only for IA32 emulation as on native i386 this is does not @@ -121,7 +129,6 @@ linux_mmap_common(struct thread *td, uintptr_t addr, s * * XXX. Linux checks that the file system is not mounted with noexec. */ -#if defined(__amd64__) linux_fixup_prot(td, &prot); #endif Modified: head/sys/compat/linux/linux_mmap.h ============================================================================== --- head/sys/compat/linux/linux_mmap.h Fri Jan 24 11:57:55 2020 (r357075) +++ head/sys/compat/linux/linux_mmap.h Fri Jan 24 12:08:23 2020 (r357076) @@ -39,6 +39,7 @@ #define LINUX_MAP_PRIVATE 0x0002 #define LINUX_MAP_FIXED 0x0010 #define LINUX_MAP_ANON 0x0020 +#define LINUX_MAP_32BIT 0x0040 #define LINUX_MAP_GROWSDOWN 0x0100 #define LINUX_PROT_GROWSDOWN 0x01000000 From owner-svn-src-all@freebsd.org Fri Jan 24 12:17:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11D66236AFF; Fri, 24 Jan 2020 12:17:07 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 483ynG0hXVz3xQ4; Fri, 24 Jan 2020 12:17:05 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 870E92601D7; Fri, 24 Jan 2020 13:17:02 +0100 (CET) Subject: Re: svn commit: r357012 - head/sys/net To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202001230147.00N1lh9g042266@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <0fc0f0d5-b339-fdd9-3cf9-febf58d802d9@selasky.org> Date: Fri, 24 Jan 2020 13:16:22 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <202001230147.00N1lh9g042266@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 483ynG0hXVz3xQ4 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-5.42 / 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)[+a:mail.turbocat.net:c]; 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]; TO_DN_SOME(0.00)[]; IP_SCORE(-3.12)[ip: (-9.34), ipnet: 88.99.0.0/16(-4.71), asn: 24940(-1.55), country: DE(-0.02)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, 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, 24 Jan 2020 12:17:07 -0000 On 2020-01-23 02:47, Gleb Smirnoff wrote: > Author: glebius > Date: Thu Jan 23 01:47:43 2020 > New Revision: 357012 > URL: https://svnweb.freebsd.org/changeset/base/357012 > > Log: > Stop entering the network epoch in ether_input(), unless driver > is marked with IFF_NEEDSEPOCH. > > Modified: > head/sys/net/if_ethersubr.c > > Modified: head/sys/net/if_ethersubr.c > ============================================================================== > --- head/sys/net/if_ethersubr.c Thu Jan 23 01:46:05 2020 (r357011) > +++ head/sys/net/if_ethersubr.c Thu Jan 23 01:47:43 2020 (r357012) > @@ -809,7 +809,8 @@ ether_input(struct ifnet *ifp, struct mbuf *m) > * them up. This allows the drivers to amortize the receive lock. > */ > CURVNET_SET_QUIET(ifp->if_vnet); > - NET_EPOCH_ENTER(et); > + if (__predict_false(ifp->if_flags & IFF_NEEDSEPOCH)) > + NET_EPOCH_ENTER(et); > while (m) { > mn = m->m_nextpkt; > m->m_nextpkt = NULL; > @@ -824,7 +825,8 @@ ether_input(struct ifnet *ifp, struct mbuf *m) > netisr_dispatch(NETISR_ETHER, m); > m = mn; > } > - NET_EPOCH_EXIT(et); > + if (__predict_false(ifp->if_flags & IFF_NEEDSEPOCH)) > + NET_EPOCH_EXIT(et); > CURVNET_RESTORE(); > } > > Can we do it like this instead: https://reviews.freebsd.org/D23348 --HPS From owner-svn-src-all@freebsd.org Fri Jan 24 13:05:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6C3D237A1C; Fri, 24 Jan 2020 13:05:53 +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 483zsY5L9Nz40k1; Fri, 24 Jan 2020 13:05:53 +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 AE0DA27B2F; Fri, 24 Jan 2020 13:05:53 +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 00OD5rGj011652; Fri, 24 Jan 2020 13:05:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OD5rNF011651; Fri, 24 Jan 2020 13:05:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202001241305.00OD5rNF011651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 24 Jan 2020 13:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357077 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 357077 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 13:05:53 -0000 Author: hselasky Date: Fri Jan 24 13:05:53 2020 New Revision: 357077 URL: https://svnweb.freebsd.org/changeset/base/357077 Log: Implement mmget_not_zero() in the LinuxKPI. Submitted by: Austin Shafer MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/mm_types.h Modified: head/sys/compat/linuxkpi/common/include/linux/mm_types.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mm_types.h Fri Jan 24 12:08:23 2020 (r357076) +++ head/sys/compat/linuxkpi/common/include/linux/mm_types.h Fri Jan 24 13:05:53 2020 (r357077) @@ -57,6 +57,12 @@ mmdrop(struct mm_struct *mm) linux_mm_dtor(mm); } +static inline bool +mmget_not_zero(struct mm_struct *mm) +{ + return (atomic_inc_not_zero(&mm->mm_users)); +} + static inline void mmput(struct mm_struct *mm) { From owner-svn-src-all@freebsd.org Fri Jan 24 14:22:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62A9F1F16BC; Fri, 24 Jan 2020 14:22:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4841YZ1d4Vz44hB; Fri, 24 Jan 2020 14:22:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18C6328873; Fri, 24 Jan 2020 14:22:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00OEM9nw057603; Fri, 24 Jan 2020 14:22:09 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OEM9I6057601; Fri, 24 Jan 2020 14:22:09 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <202001241422.00OEM9I6057601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Fri, 24 Jan 2020 14:22: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: r357078 - stable/12/usr.bin/showmount X-SVN-Group: stable-12 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/12/usr.bin/showmount X-SVN-Commit-Revision: 357078 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 14:22:10 -0000 Author: eadler Date: Fri Jan 24 14:22:09 2020 New Revision: 357078 URL: https://svnweb.freebsd.org/changeset/base/357078 Log: MFC r355647: [showmount] implement long options add long options support to showmount. Where mappings exist use the GNU names for said options. Relnotes: yes Modified: stable/12/usr.bin/showmount/showmount.8 stable/12/usr.bin/showmount/showmount.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/showmount/showmount.8 ============================================================================== --- stable/12/usr.bin/showmount/showmount.8 Fri Jan 24 13:05:53 2020 (r357077) +++ stable/12/usr.bin/showmount/showmount.8 Fri Jan 24 14:22:09 2020 (r357078) @@ -67,20 +67,20 @@ for a detailed description of the protocol. .Pp The following options are available: .Bl -tag -width indent -.It Fl a +.It Fl a , Fl -all List all mount points in the form: .Bd -ragged -offset indent -compact .Ar host : Ns Ar dirpath . .Ed -.It Fl d +.It Fl d , Fl -directories List directory paths of mount points instead of hosts. -.It Fl E +.It Fl E , Fl -exports-script Show the .Ar host Ns 's exports list in a script-friendly format. Client addresses and the header are not shown, and special characters are escaped. -.It Fl e +.It Fl e , Fl -exports Show the .Ar host Ns 's exports list. Modified: stable/12/usr.bin/showmount/showmount.c ============================================================================== --- stable/12/usr.bin/showmount/showmount.c Fri Jan 24 13:05:53 2020 (r357077) +++ stable/12/usr.bin/showmount/showmount.c Fri Jan 24 14:22:09 2020 (r357078) @@ -53,6 +53,7 @@ static const char rcsid[] = #include #include +#include #include #include #include @@ -102,6 +103,14 @@ int xdr_exportslist(XDR *, struct exportslist **); int tcp_callrpc(const char *host, int prognum, int versnum, int procnum, xdrproc_t inproc, char *in, xdrproc_t outproc, char *out); +static const struct option long_opts[] = { + { "all", no_argument, NULL, 'a' }, + { "directories", no_argument, NULL, 'd' }, + { "exports-script", no_argument, NULL, 'E' }, + { "exports", no_argument, NULL, 'e' }, + { NULL, 0, NULL, 0 }, +}; + /* * This command queries the NFS mount daemon for it's mount list and/or * it's exports list and prints them out. @@ -119,7 +128,7 @@ main(int argc, char **argv) const char *host; int ch, estat, nbytes; - while ((ch = getopt(argc, argv, "adEe13")) != -1) + while ((ch = getopt_long(argc, argv, "+adEe13", long_opts, NULL)) != -1) switch (ch) { case 'a': if (type == 0) { From owner-svn-src-all@freebsd.org Fri Jan 24 14:40:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F07251F1B5A; Fri, 24 Jan 2020 14:40:37 +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 4841ys67rLz460D; Fri, 24 Jan 2020 14:40:37 +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 CE01428B84; Fri, 24 Jan 2020 14:40:37 +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 00OEebFH064641; Fri, 24 Jan 2020 14:40:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OEebuI064640; Fri, 24 Jan 2020 14:40:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001241440.00OEebuI064640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 24 Jan 2020 14:40:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357079 - head/etc X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/etc X-SVN-Commit-Revision: 357079 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 14:40:38 -0000 Author: emaste Date: Fri Jan 24 14:40:37 2020 New Revision: 357079 URL: https://svnweb.freebsd.org/changeset/base/357079 Log: revert r356990 to reapply with correct commit message Requested by: rgrimes Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Fri Jan 24 14:22:09 2020 (r357078) +++ head/etc/Makefile Fri Jan 24 14:40:37 2020 (r357079) @@ -164,8 +164,7 @@ distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY .endif .if ${MK_NLS} != "no" .for alias nls in ${NLS_ALIASES} - ${INSTALL_SYMLINK} -T "package=utilities" \ - "${nls}" "${DESTDIR}${SHAREDIR}/nls/${alias}" + ${INSTALL_SYMLINK} "${nls}" "${DESTDIR}${SHAREDIR}/nls/${alias}" .endfor .endif From owner-svn-src-all@freebsd.org Fri Jan 24 14:41:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4DF3D1F1D78; Fri, 24 Jan 2020 14:41:52 +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 48420J1PLWz46b0; Fri, 24 Jan 2020 14:41:52 +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 2B80528BE3; Fri, 24 Jan 2020 14:41: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 00OEfp7d066477; Fri, 24 Jan 2020 14:41:51 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OEfpBA066455; Fri, 24 Jan 2020 14:41:51 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202001241441.00OEfpBA066455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 24 Jan 2020 14:41:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357080 - head/etc X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/etc X-SVN-Commit-Revision: 357080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 14:41:52 -0000 Author: emaste Date: Fri Jan 24 14:41:51 2020 New Revision: 357080 URL: https://svnweb.freebsd.org/changeset/base/357080 Log: Tag NLS aliases with pkgbase package POSIX and en_US.US_ASCII are aliases (symlinks) to the C locale. They were not previously tagged with a pkgbase pacakge. Add the tag so that they are handled correctly on pkgbase-installed/updated systems. [This is r356990 reapplied with a corrected commit message.] Discussed with: manu Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Fri Jan 24 14:40:37 2020 (r357079) +++ head/etc/Makefile Fri Jan 24 14:41:51 2020 (r357080) @@ -164,7 +164,8 @@ distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY .endif .if ${MK_NLS} != "no" .for alias nls in ${NLS_ALIASES} - ${INSTALL_SYMLINK} "${nls}" "${DESTDIR}${SHAREDIR}/nls/${alias}" + ${INSTALL_SYMLINK} -T "package=utilities" \ + "${nls}" "${DESTDIR}${SHAREDIR}/nls/${alias}" .endfor .endif From owner-svn-src-all@freebsd.org Fri Jan 24 14:58:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE7781F2964; Fri, 24 Jan 2020 14:58:02 +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 4842Ly5Y5Vz47vJ; Fri, 24 Jan 2020 14:58:02 +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 B9B1928F08; Fri, 24 Jan 2020 14:58:02 +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 00OEw2ER076835; Fri, 24 Jan 2020 14:58:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OEw2LK076834; Fri, 24 Jan 2020 14:58:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202001241458.00OEw2LK076834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 24 Jan 2020 14:58:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357081 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 357081 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 14:58:02 -0000 Author: markj Date: Fri Jan 24 14:58:02 2020 New Revision: 357081 URL: https://svnweb.freebsd.org/changeset/base/357081 Log: Revert r357050. It seems to have introduced a couple of regressions. Reported by: cy, pho Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Fri Jan 24 14:41:51 2020 (r357080) +++ head/sys/kern/sched_ule.c Fri Jan 24 14:58:02 2020 (r357081) @@ -2121,7 +2121,6 @@ sched_switch(struct thread *td, int flags) */ TDQ_LOCK_ASSERT(tdq, MA_OWNED | MA_NOTRECURSED); newtd = choosethread(); - newtd->td_oncpu = cpuid; sched_pctcpu_update(td_get_sched(newtd), 0); TDQ_UNLOCK(tdq); @@ -2146,6 +2145,7 @@ sched_switch(struct thread *td, int flags) #endif td->td_oncpu = NOCPU; cpu_switch(td, newtd, mtx); + cpuid = td->td_oncpu = PCPU_GET(cpuid); SDT_PROBE0(sched, , , on__cpu); #ifdef HWPMC_HOOKS @@ -2915,7 +2915,6 @@ sched_throw(struct thread *td) thread_lock_block(td); } newtd = choosethread(); - newtd->td_oncpu = PCPU_GET(cpuid); spinlock_enter(); TDQ_UNLOCK(tdq); KASSERT(curthread->td_md.md_spinlock_count == 1, From owner-svn-src-all@freebsd.org Fri Jan 24 15:29:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A8ED1F36B7; Fri, 24 Jan 2020 15:29:35 +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 48433M0FZkz49p1; Fri, 24 Jan 2020 15:29:35 +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 F33422949E; Fri, 24 Jan 2020 15:29:34 +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 00OFTYxE095048; Fri, 24 Jan 2020 15:29:34 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OFTXvc095041; Fri, 24 Jan 2020 15:29:33 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001241529.00OFTXvc095041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 24 Jan 2020 15:29: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: r357082 - in stable: 11/etc/mtree 11/secure 11/secure/caroot 11/share/mk 11/usr.sbin 11/usr.sbin/certctl 11/usr.sbin/etcupdate 11/usr.sbin/mergemaster 12/etc/mtree 12/secure 12/secure/c... X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/etc/mtree 11/secure 11/secure/caroot 11/share/mk 11/usr.sbin 11/usr.sbin/certctl 11/usr.sbin/etcupdate 11/usr.sbin/mergemaster 12/etc/mtree 12/secure 12/secure/caroot 12/share/mk 12/usr.... X-SVN-Commit-Revision: 357082 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 15:29:35 -0000 Author: kevans Date: Fri Jan 24 15:29:33 2020 New Revision: 357082 URL: https://svnweb.freebsd.org/changeset/base/357082 Log: MFC r352948-r352951, r353002, r353066, r353070: caroot infrastructure Infrastructure only -- no plans in place currently to commit any certs to these branches. r352948: [1/3] Initial infrastructure for SSL root bundle in base This setup will add the trusted certificates from the Mozilla NSS bundle to base. This commit includes: - CAROOT option to opt out of installation of certs - mtree amendments for final destinations - infrastructure to fetch/update certs, along with instructions A follow-up commit will add a certctl(8) utility to give the user control over trust specifics. Another follow-up commit will actually commit the initial result of updatecerts. This work was done primarily by allanjude@, with minor contributions by myself. r352949: [2/3] Add certctl(8) This is a simple utility to hash all trusted on the system into /etc/ssl/certs. It also allows the user to blacklist certificates they do not trust. This work was done primarily by allanjude@, with minor contributions by myself. r352950: [3/3] etcupdate and mergemaster support for certctl This commit add support for certctl in mergemaster and etcupdate. Both will either rehash or prompt for rehash as new certificates are trusted/blacklisted. This work was done primarily by allanjude@, with minor contributions by myself. r352951: caroot: add @generated tags to extracted .pem As is the current trend; while these files are manually curated, they are still generated. If they end up in a review, it would be helpful to also take the hint and hide them. r353002: Unbreak etcupdate(8) and mergemaster(8) after r352950 r352950 introduced improper case fall-through for shell scripts. Fix it with a pipe. r353066: certctl(8): realpath the file before creating the symlink Otherwise we end up creating broken relative symlinks in /etc/ssl/blacklisted. r353070: certctl(8): let one blacklist based on hashed filenames It seems reasonable to allow, for instance: $ certctl list # reviews output -- ah, yeah, I don't trust that one $ certctl blacklist ce5e74ef.0 $ certctl rehash We can unambiguously determine what cert "ce5e74ef.0" refers to, and we've described it to them in `certctl list` output -- I see little sense in forcing another level of filesystem inspection to determien what cert file this physically corresponds to. Relnotes: yes Added: stable/11/secure/caroot/ - copied from r352951, head/secure/caroot/ stable/11/usr.sbin/certctl/ - copied from r352951, head/usr.sbin/certctl/ Modified: stable/11/etc/mtree/BSD.usr.dist stable/11/secure/Makefile stable/11/share/mk/src.opts.mk stable/11/usr.sbin/Makefile stable/11/usr.sbin/certctl/certctl.sh stable/11/usr.sbin/etcupdate/etcupdate.sh stable/11/usr.sbin/mergemaster/mergemaster.sh Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Added: stable/12/secure/caroot/ - copied from r352951, head/secure/caroot/ stable/12/usr.sbin/certctl/ - copied from r352951, head/usr.sbin/certctl/ Modified: stable/12/etc/mtree/BSD.usr.dist stable/12/secure/Makefile stable/12/share/mk/src.opts.mk stable/12/usr.sbin/Makefile stable/12/usr.sbin/certctl/certctl.sh stable/12/usr.sbin/etcupdate/etcupdate.sh stable/12/usr.sbin/mergemaster/mergemaster.sh Directory Properties: stable/12/ (props changed) Modified: stable/11/etc/mtree/BSD.usr.dist ============================================================================== --- stable/11/etc/mtree/BSD.usr.dist Fri Jan 24 14:58:02 2020 (r357081) +++ stable/11/etc/mtree/BSD.usr.dist Fri Jan 24 15:29:33 2020 (r357082) @@ -178,6 +178,12 @@ uk_UA.KOI8-U .. .. + certs + blacklisted + .. + trusted + .. + .. dict .. doc Modified: stable/11/secure/Makefile ============================================================================== --- stable/11/secure/Makefile Fri Jan 24 14:58:02 2020 (r357081) +++ stable/11/secure/Makefile Fri Jan 24 15:29:33 2020 (r357082) @@ -10,6 +10,8 @@ SUBDIR_PARALLEL= _tests= tests .endif +SUBDIR.${MK_CAROOT}+= caroot + # These are the programs which depend on crypto, but not Kerberos. SPROGS= lib/libfetch lib/libpam lib/libradius lib/libtelnet \ bin/ed libexec/telnetd usr.bin/fetch usr.bin/telnet \ Modified: stable/11/share/mk/src.opts.mk ============================================================================== --- stable/11/share/mk/src.opts.mk Fri Jan 24 14:58:02 2020 (r357081) +++ stable/11/share/mk/src.opts.mk Fri Jan 24 15:29:33 2020 (r357082) @@ -68,6 +68,7 @@ __DEFAULT_YES_OPTIONS = \ BZIP2 \ CALENDAR \ CAPSICUM \ + CAROOT \ CASPER \ CCD \ CDDL \ Modified: stable/11/usr.sbin/Makefile ============================================================================== --- stable/11/usr.sbin/Makefile Fri Jan 24 14:58:02 2020 (r357081) +++ stable/11/usr.sbin/Makefile Fri Jan 24 15:29:33 2020 (r357082) @@ -124,6 +124,9 @@ SUBDIR.${MK_BLUETOOTH}+= bluetooth SUBDIR.${MK_BOOTPARAMD}+= bootparamd SUBDIR.${MK_BSDINSTALL}+= bsdinstall SUBDIR.${MK_BSNMP}+= bsnmpd +.if ${MK_CAROOT} != "no" +SUBDIR.${MK_OPENSSL}+= certctl +.endif SUBDIR.${MK_CTM}+= ctm SUBDIR.${MK_CXGBETOOL}+= cxgbetool SUBDIR.${MK_MLX5TOOL}+= mlx5tool Modified: stable/11/usr.sbin/certctl/certctl.sh ============================================================================== --- head/usr.sbin/certctl/certctl.sh Wed Oct 2 01:27:50 2019 (r352951) +++ stable/11/usr.sbin/certctl/certctl.sh Fri Jan 24 15:29:33 2020 (r357082) @@ -69,16 +69,26 @@ create_trusted_link() return 1 fi [ $VERBOSE -gt 0 ] && echo "Adding $hash.0 to trust store" - [ $NOOP -eq 0 ] && ln -fs "$1" "$CERTDESTDIR/$hash.0" + [ $NOOP -eq 0 ] && ln -fs $(realpath "$1") "$CERTDESTDIR/$hash.0" } create_blacklisted() { - local hash + local hash srcfile filename - hash=$( do_hash "$1" ) || return - [ $VERBOSE -gt 0 ] && echo "Adding $hash.0 to blacklist" - [ $NOOP -eq 0 ] && ln -fs "$1" "$BLACKLISTDESTDIR/$hash.0" + # If it exists as a file, we'll try that; otherwise, we'll scan + if [ -e "$1" ]; then + hash=$( do_hash "$1" ) || return + srcfile=$(realpath "$1") + filename="$hash.0" + elif [ -e "${CERTDESTDIR}/$1" ]; then + srcfile=$(realpath "${CERTDESTDIR}/$1") + filename="$1" + else + return + fi + [ $VERBOSE -gt 0 ] && echo "Adding $filename to blacklist" + [ $NOOP -eq 0 ] && ln -fs "$srcfile" "$BLACKLISTDESTDIR/$filename" } do_scan() Modified: stable/11/usr.sbin/etcupdate/etcupdate.sh ============================================================================== --- stable/11/usr.sbin/etcupdate/etcupdate.sh Fri Jan 24 14:58:02 2020 (r357081) +++ stable/11/usr.sbin/etcupdate/etcupdate.sh Fri Jan 24 15:29:33 2020 (r357082) @@ -595,6 +595,12 @@ post_install_file() NEWALIAS_WARN=yes fi ;; + /usr/share/certs/trusted/* | /usr/share/certs/blacklisted/*) + log "certctl rehash" + if [ -z "$dryrun" ]; then + env DESTDIR=${DESTDIR} certctl rehash >&3 2>&1 + fi + ;; /etc/login.conf) log "cap_mkdb ${DESTDIR}$1" if [ -z "$dryrun" ]; then Modified: stable/11/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- stable/11/usr.sbin/mergemaster/mergemaster.sh Fri Jan 24 14:58:02 2020 (r357081) +++ stable/11/usr.sbin/mergemaster/mergemaster.sh Fri Jan 24 15:29:33 2020 (r357082) @@ -863,6 +863,9 @@ mm_install () { /etc/mail/aliases) NEED_NEWALIASES=yes ;; + /usr/share/certs/trusted/* | /usr/share/certs/blacklisted/*) + NEED_CERTCTL=yes + ;; /etc/login.conf) NEED_CAP_MKDB=yes ;; @@ -1331,6 +1334,23 @@ case "${NEED_PWD_MKDB}" in echo " '/usr/sbin/pwd_mkdb -p /etc/master.passwd'" echo " to rebuild your password files" run_it_now '/usr/sbin/pwd_mkdb -p /etc/master.passwd' + fi + ;; +esac + +case "${NEED_CERTCTL}" in +'') ;; +*) + echo '' + echo "*** You installed files in /etc/ssl/certs, so make sure that you run" + if [ -n "${DESTDIR}" ]; then + echo " 'env DESTDIR=${DESTDIR} /usr/sbin/certctl rehash'" + echo " to rebuild your certificate authority database" + run_it_now "env DESTDIR=${DESTDIR} /usr/sbin/certctl rehash" + else + echo " '/usr/sbin/certctl rehash'" + echo " to rebuild your certificate authority database" + run_it_now "/usr/sbin/certctl rehash" fi ;; esac From owner-svn-src-all@freebsd.org Fri Jan 24 15:29:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B055B1F36D7; Fri, 24 Jan 2020 15:29:36 +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 48433N3z4qz49p6; Fri, 24 Jan 2020 15:29:36 +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 837342949F; Fri, 24 Jan 2020 15:29:36 +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 00OFTasJ095060; Fri, 24 Jan 2020 15:29:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OFTZ80095053; Fri, 24 Jan 2020 15:29:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001241529.00OFTZ80095053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 24 Jan 2020 15:29: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: r357082 - in stable: 11/etc/mtree 11/secure 11/secure/caroot 11/share/mk 11/usr.sbin 11/usr.sbin/certctl 11/usr.sbin/etcupdate 11/usr.sbin/mergemaster 12/etc/mtree 12/secure 12/secure/c... X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/etc/mtree 11/secure 11/secure/caroot 11/share/mk 11/usr.sbin 11/usr.sbin/certctl 11/usr.sbin/etcupdate 11/usr.sbin/mergemaster 12/etc/mtree 12/secure 12/secure/caroot 12/share/mk 12/usr.... X-SVN-Commit-Revision: 357082 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 15:29:36 -0000 Author: kevans Date: Fri Jan 24 15:29:33 2020 New Revision: 357082 URL: https://svnweb.freebsd.org/changeset/base/357082 Log: MFC r352948-r352951, r353002, r353066, r353070: caroot infrastructure Infrastructure only -- no plans in place currently to commit any certs to these branches. r352948: [1/3] Initial infrastructure for SSL root bundle in base This setup will add the trusted certificates from the Mozilla NSS bundle to base. This commit includes: - CAROOT option to opt out of installation of certs - mtree amendments for final destinations - infrastructure to fetch/update certs, along with instructions A follow-up commit will add a certctl(8) utility to give the user control over trust specifics. Another follow-up commit will actually commit the initial result of updatecerts. This work was done primarily by allanjude@, with minor contributions by myself. r352949: [2/3] Add certctl(8) This is a simple utility to hash all trusted on the system into /etc/ssl/certs. It also allows the user to blacklist certificates they do not trust. This work was done primarily by allanjude@, with minor contributions by myself. r352950: [3/3] etcupdate and mergemaster support for certctl This commit add support for certctl in mergemaster and etcupdate. Both will either rehash or prompt for rehash as new certificates are trusted/blacklisted. This work was done primarily by allanjude@, with minor contributions by myself. r352951: caroot: add @generated tags to extracted .pem As is the current trend; while these files are manually curated, they are still generated. If they end up in a review, it would be helpful to also take the hint and hide them. r353002: Unbreak etcupdate(8) and mergemaster(8) after r352950 r352950 introduced improper case fall-through for shell scripts. Fix it with a pipe. r353066: certctl(8): realpath the file before creating the symlink Otherwise we end up creating broken relative symlinks in /etc/ssl/blacklisted. r353070: certctl(8): let one blacklist based on hashed filenames It seems reasonable to allow, for instance: $ certctl list # reviews output -- ah, yeah, I don't trust that one $ certctl blacklist ce5e74ef.0 $ certctl rehash We can unambiguously determine what cert "ce5e74ef.0" refers to, and we've described it to them in `certctl list` output -- I see little sense in forcing another level of filesystem inspection to determien what cert file this physically corresponds to. Relnotes: yes Added: stable/12/secure/caroot/ - copied from r352951, head/secure/caroot/ stable/12/usr.sbin/certctl/ - copied from r352951, head/usr.sbin/certctl/ Modified: stable/12/etc/mtree/BSD.usr.dist stable/12/secure/Makefile stable/12/share/mk/src.opts.mk stable/12/usr.sbin/Makefile stable/12/usr.sbin/certctl/certctl.sh stable/12/usr.sbin/etcupdate/etcupdate.sh stable/12/usr.sbin/mergemaster/mergemaster.sh Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Added: stable/11/secure/caroot/ - copied from r352951, head/secure/caroot/ stable/11/usr.sbin/certctl/ - copied from r352951, head/usr.sbin/certctl/ Modified: stable/11/etc/mtree/BSD.usr.dist stable/11/secure/Makefile stable/11/share/mk/src.opts.mk stable/11/usr.sbin/Makefile stable/11/usr.sbin/certctl/certctl.sh stable/11/usr.sbin/etcupdate/etcupdate.sh stable/11/usr.sbin/mergemaster/mergemaster.sh Directory Properties: stable/11/ (props changed) Modified: stable/12/etc/mtree/BSD.usr.dist ============================================================================== --- stable/12/etc/mtree/BSD.usr.dist Fri Jan 24 14:58:02 2020 (r357081) +++ stable/12/etc/mtree/BSD.usr.dist Fri Jan 24 15:29:33 2020 (r357082) @@ -200,6 +200,12 @@ uk_UA.KOI8-U .. .. + certs + blacklisted + .. + trusted + .. + .. dict .. doc Modified: stable/12/secure/Makefile ============================================================================== --- stable/12/secure/Makefile Fri Jan 24 14:58:02 2020 (r357081) +++ stable/12/secure/Makefile Fri Jan 24 15:29:33 2020 (r357082) @@ -8,6 +8,8 @@ SUBDIR_PARALLEL= SUBDIR.${MK_TESTS}+= tests +SUBDIR.${MK_CAROOT}+= caroot + # These are the programs which depend on crypto, but not Kerberos. SPROGS= lib/libfetch lib/libpam lib/libradius lib/libtelnet \ bin/ed libexec/telnetd usr.bin/fetch usr.bin/telnet \ Modified: stable/12/share/mk/src.opts.mk ============================================================================== --- stable/12/share/mk/src.opts.mk Fri Jan 24 14:58:02 2020 (r357081) +++ stable/12/share/mk/src.opts.mk Fri Jan 24 15:29:33 2020 (r357082) @@ -76,6 +76,7 @@ __DEFAULT_YES_OPTIONS = \ BZIP2 \ CALENDAR \ CAPSICUM \ + CAROOT \ CASPER \ CCD \ CDDL \ Modified: stable/12/usr.sbin/Makefile ============================================================================== --- stable/12/usr.sbin/Makefile Fri Jan 24 14:58:02 2020 (r357081) +++ stable/12/usr.sbin/Makefile Fri Jan 24 15:29:33 2020 (r357082) @@ -125,6 +125,9 @@ SUBDIR.${MK_BLUETOOTH}+= bluetooth SUBDIR.${MK_BOOTPARAMD}+= bootparamd SUBDIR.${MK_BSDINSTALL}+= bsdinstall SUBDIR.${MK_BSNMP}+= bsnmpd +.if ${MK_CAROOT} != "no" +SUBDIR.${MK_OPENSSL}+= certctl +.endif SUBDIR.${MK_CTM}+= ctm SUBDIR.${MK_CXGBETOOL}+= cxgbetool SUBDIR.${MK_DIALOG}+= bsdconfig Modified: stable/12/usr.sbin/certctl/certctl.sh ============================================================================== --- head/usr.sbin/certctl/certctl.sh Wed Oct 2 01:27:50 2019 (r352951) +++ stable/12/usr.sbin/certctl/certctl.sh Fri Jan 24 15:29:33 2020 (r357082) @@ -69,16 +69,26 @@ create_trusted_link() return 1 fi [ $VERBOSE -gt 0 ] && echo "Adding $hash.0 to trust store" - [ $NOOP -eq 0 ] && ln -fs "$1" "$CERTDESTDIR/$hash.0" + [ $NOOP -eq 0 ] && ln -fs $(realpath "$1") "$CERTDESTDIR/$hash.0" } create_blacklisted() { - local hash + local hash srcfile filename - hash=$( do_hash "$1" ) || return - [ $VERBOSE -gt 0 ] && echo "Adding $hash.0 to blacklist" - [ $NOOP -eq 0 ] && ln -fs "$1" "$BLACKLISTDESTDIR/$hash.0" + # If it exists as a file, we'll try that; otherwise, we'll scan + if [ -e "$1" ]; then + hash=$( do_hash "$1" ) || return + srcfile=$(realpath "$1") + filename="$hash.0" + elif [ -e "${CERTDESTDIR}/$1" ]; then + srcfile=$(realpath "${CERTDESTDIR}/$1") + filename="$1" + else + return + fi + [ $VERBOSE -gt 0 ] && echo "Adding $filename to blacklist" + [ $NOOP -eq 0 ] && ln -fs "$srcfile" "$BLACKLISTDESTDIR/$filename" } do_scan() Modified: stable/12/usr.sbin/etcupdate/etcupdate.sh ============================================================================== --- stable/12/usr.sbin/etcupdate/etcupdate.sh Fri Jan 24 14:58:02 2020 (r357081) +++ stable/12/usr.sbin/etcupdate/etcupdate.sh Fri Jan 24 15:29:33 2020 (r357082) @@ -595,6 +595,12 @@ post_install_file() NEWALIAS_WARN=yes fi ;; + /usr/share/certs/trusted/* | /usr/share/certs/blacklisted/*) + log "certctl rehash" + if [ -z "$dryrun" ]; then + env DESTDIR=${DESTDIR} certctl rehash >&3 2>&1 + fi + ;; /etc/login.conf) log "cap_mkdb ${DESTDIR}$1" if [ -z "$dryrun" ]; then Modified: stable/12/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- stable/12/usr.sbin/mergemaster/mergemaster.sh Fri Jan 24 14:58:02 2020 (r357081) +++ stable/12/usr.sbin/mergemaster/mergemaster.sh Fri Jan 24 15:29:33 2020 (r357082) @@ -884,6 +884,9 @@ mm_install () { /etc/mail/aliases) NEED_NEWALIASES=yes ;; + /usr/share/certs/trusted/* | /usr/share/certs/blacklisted/*) + NEED_CERTCTL=yes + ;; /etc/login.conf) NEED_CAP_MKDB=yes ;; @@ -1352,6 +1355,23 @@ case "${NEED_PWD_MKDB}" in echo " '/usr/sbin/pwd_mkdb -p /etc/master.passwd'" echo " to rebuild your password files" run_it_now '/usr/sbin/pwd_mkdb -p /etc/master.passwd' + fi + ;; +esac + +case "${NEED_CERTCTL}" in +'') ;; +*) + echo '' + echo "*** You installed files in /etc/ssl/certs, so make sure that you run" + if [ -n "${DESTDIR}" ]; then + echo " 'env DESTDIR=${DESTDIR} /usr/sbin/certctl rehash'" + echo " to rebuild your certificate authority database" + run_it_now "env DESTDIR=${DESTDIR} /usr/sbin/certctl rehash" + else + echo " '/usr/sbin/certctl rehash'" + echo " to rebuild your certificate authority database" + run_it_now "/usr/sbin/certctl rehash" fi ;; esac From owner-svn-src-all@freebsd.org Fri Jan 24 16:08:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 675321F40F4; Fri, 24 Jan 2020 16:08:07 +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 4843vq27bTz4Cbs; Fri, 24 Jan 2020 16:08:07 +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 4481429BE7; Fri, 24 Jan 2020 16:08:07 +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 00OG87Fg019002; Fri, 24 Jan 2020 16:08:07 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OG86JE019001; Fri, 24 Jan 2020 16:08:06 GMT (envelope-from br@FreeBSD.org) Message-Id: <202001241608.00OG86JE019001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 24 Jan 2020 16:08:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357083 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 357083 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 16:08:07 -0000 Author: br Date: Fri Jan 24 16:08:06 2020 New Revision: 357083 URL: https://svnweb.freebsd.org/changeset/base/357083 Log: Move the ECAM macroses to the header file. These will be used by other PCI root complex drivers. Sponsored by: DARPA, AFRL Modified: head/sys/dev/pci/pci_host_generic.c head/sys/dev/pci/pci_host_generic.h Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Fri Jan 24 15:29:33 2020 (r357082) +++ head/sys/dev/pci/pci_host_generic.c Fri Jan 24 16:08:06 2020 (r357083) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2015, 2020 Ruslan Bukin * Copyright (c) 2014 The FreeBSD Foundation * All rights reserved. * @@ -53,21 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include "pcib_if.h" - -/* Assembling ECAM Configuration Address */ -#define PCIE_BUS_SHIFT 20 -#define PCIE_SLOT_SHIFT 15 -#define PCIE_FUNC_SHIFT 12 -#define PCIE_BUS_MASK 0xFF -#define PCIE_SLOT_MASK 0x1F -#define PCIE_FUNC_MASK 0x07 -#define PCIE_REG_MASK 0xFFF - -#define PCIE_ADDR_OFFSET(bus, slot, func, reg) \ - ((((bus) & PCIE_BUS_MASK) << PCIE_BUS_SHIFT) | \ - (((slot) & PCIE_SLOT_MASK) << PCIE_SLOT_SHIFT) | \ - (((func) & PCIE_FUNC_MASK) << PCIE_FUNC_SHIFT) | \ - ((reg) & PCIE_REG_MASK)) /* Forward prototypes */ Modified: head/sys/dev/pci/pci_host_generic.h ============================================================================== --- head/sys/dev/pci/pci_host_generic.h Fri Jan 24 15:29:33 2020 (r357082) +++ head/sys/dev/pci/pci_host_generic.h Fri Jan 24 16:08:06 2020 (r357083) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2015, 2020 Ruslan Bukin * Copyright (c) 2015 The FreeBSD Foundation * All rights reserved. * @@ -35,6 +35,21 @@ #define __PCI_HOST_GENERIC_H_ #include "pci_if.h" + +/* Assembling ECAM Configuration Address */ +#define PCIE_BUS_SHIFT 20 +#define PCIE_SLOT_SHIFT 15 +#define PCIE_FUNC_SHIFT 12 +#define PCIE_BUS_MASK 0xFF +#define PCIE_SLOT_MASK 0x1F +#define PCIE_FUNC_MASK 0x07 +#define PCIE_REG_MASK 0xFFF + +#define PCIE_ADDR_OFFSET(bus, slot, func, reg) \ + ((((bus) & PCIE_BUS_MASK) << PCIE_BUS_SHIFT) | \ + (((slot) & PCIE_SLOT_MASK) << PCIE_SLOT_SHIFT) | \ + (((func) & PCIE_FUNC_MASK) << PCIE_FUNC_SHIFT) | \ + ((reg) & PCIE_REG_MASK)) #define MAX_RANGES_TUPLES 16 #define MIN_RANGES_TUPLES 2 From owner-svn-src-all@freebsd.org Fri Jan 24 16:43:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 93F1D1F4FAA; Fri, 24 Jan 2020 16:43:02 +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 4844h63NLWz4FTm; Fri, 24 Jan 2020 16:43:02 +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 6F5C22A37C; Fri, 24 Jan 2020 16:43:02 +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 00OGh2Af042199; Fri, 24 Jan 2020 16:43:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OGh274042198; Fri, 24 Jan 2020 16:43:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001241643.00OGh274042198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 24 Jan 2020 16:43:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357084 - head/secure/caroot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/secure/caroot X-SVN-Commit-Revision: 357084 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 16:43:02 -0000 Author: kevans Date: Fri Jan 24 16:43:02 2020 New Revision: 357084 URL: https://svnweb.freebsd.org/changeset/base/357084 Log: caroot: use bsd.obj.mk, not bsd.prog.mk This directory stages certdata into .OBJDIR and processes it, but does not actually build a prog-shaped object; bsd.obj.mk provides the minimal support that we actually need, an .OBJDIR and descent into subdirs. This is admittedly the nittiest of nits. Modified: head/secure/caroot/Makefile Modified: head/secure/caroot/Makefile ============================================================================== --- head/secure/caroot/Makefile Fri Jan 24 16:08:06 2020 (r357083) +++ head/secure/caroot/Makefile Fri Jan 24 16:43:02 2020 (r357084) @@ -7,10 +7,9 @@ CLEANFILES+= certdata.txt SUBDIR+= trusted SUBDIR+= blacklisted -.include +.include # To be used by secteam@ to update the trusted certificates - fetchcerts: .PHONY fetch --no-sslv3 --no-tlsv1 -o certdata.txt 'https://hg.mozilla.org/projects/nss/raw-file/tip/lib/ckfw/builtins/certdata.txt' From owner-svn-src-all@freebsd.org Fri Jan 24 16:43:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F5B41F5041; Fri, 24 Jan 2020 16:43:50 +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 4844j21TSHz4FcX; Fri, 24 Jan 2020 16:43:50 +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 2DDE82A37D; Fri, 24 Jan 2020 16:43:50 +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 00OGhnAY042278; Fri, 24 Jan 2020 16:43:49 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OGhnGW042276; Fri, 24 Jan 2020 16:43:49 GMT (envelope-from br@FreeBSD.org) Message-Id: <202001241643.00OGhnGW042276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 24 Jan 2020 16:43:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357085 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 357085 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 16:43:50 -0000 Author: br Date: Fri Jan 24 16:43:49 2020 New Revision: 357085 URL: https://svnweb.freebsd.org/changeset/base/357085 Log: o Move the software context struct to a header file. o Make the pci_host_generic_acpi_attach() globally visible. o Declare a new driver class. These will be used by a new PCI root complex driver. Sponsored by: DARPA, AFRL Added: head/sys/dev/pci/pci_host_generic_acpi.h (contents, props changed) Modified: head/sys/dev/pci/pci_host_generic_acpi.c Modified: head/sys/dev/pci/pci_host_generic_acpi.c ============================================================================== --- head/sys/dev/pci/pci_host_generic_acpi.c Fri Jan 24 16:43:02 2020 (r357084) +++ head/sys/dev/pci/pci_host_generic_acpi.c Fri Jan 24 16:43:49 2020 (r357085) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -88,11 +89,6 @@ __FBSDID("$FreeBSD$"); #define PROPS_CELL_SIZE 1 #define PCI_ADDR_CELL_SIZE 2 -struct generic_pcie_acpi_softc { - struct generic_pcie_core_softc base; - ACPI_BUFFER ap_prt; /* interrupt routing table */ -}; - /* Forward prototypes */ static int generic_pcie_acpi_probe(device_t dev); @@ -233,7 +229,7 @@ pci_host_acpi_get_ecam_resource(device_t dev) return (0); } -static int +int pci_host_generic_acpi_attach(device_t dev) { struct generic_pcie_acpi_softc *sc; Added: head/sys/dev/pci/pci_host_generic_acpi.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/pci/pci_host_generic_acpi.h Fri Jan 24 16:43:49 2020 (r357085) @@ -0,0 +1,47 @@ +/*- + * Copyright (C) 2018 Cavium Inc. + * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2014 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf under + * the sponsorship of the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_PCI_PCI_HOST_GENERIC_ACPI_H_ +#define _DEV_PCI_PCI_HOST_GENERIC_ACPI_H_ + +struct generic_pcie_acpi_softc { + struct generic_pcie_core_softc base; + int segment; + ACPI_BUFFER ap_prt; /* interrupt routing table */ +}; + +DECLARE_CLASS(generic_pcie_acpi_driver); + +int pci_host_generic_acpi_attach(device_t dev); + +#endif /* !_DEV_PCI_PCI_HOST_GENERIC_ACPI_H_ */ From owner-svn-src-all@freebsd.org Fri Jan 24 16:50:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CAB951F51BE; Fri, 24 Jan 2020 16:50:51 +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 4844s752Rkz4Ftd; Fri, 24 Jan 2020 16:50:51 +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 A81CB2A3C2; Fri, 24 Jan 2020 16:50:51 +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 00OGopIR043535; Fri, 24 Jan 2020 16:50:51 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OGopsi043533; Fri, 24 Jan 2020 16:50:51 GMT (envelope-from br@FreeBSD.org) Message-Id: <202001241650.00OGopsi043533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 24 Jan 2020 16:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357086 - in head/sys/riscv: conf include X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys/riscv: conf include X-SVN-Commit-Revision: 357086 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 16:50:51 -0000 Author: br Date: Fri Jan 24 16:50:51 2020 New Revision: 357086 URL: https://svnweb.freebsd.org/changeset/base/357086 Log: Enable NEW_PCIB on riscv. Sponsored by: DARPA, AFRL Modified: head/sys/riscv/conf/DEFAULTS head/sys/riscv/include/resource.h Modified: head/sys/riscv/conf/DEFAULTS ============================================================================== --- head/sys/riscv/conf/DEFAULTS Fri Jan 24 16:43:49 2020 (r357085) +++ head/sys/riscv/conf/DEFAULTS Fri Jan 24 16:50:51 2020 (r357086) @@ -11,3 +11,5 @@ device mem # Memory and kernel memory devices # Default partitioning schemes options GEOM_PART_BSD options GEOM_PART_MBR + +options NEW_PCIB Modified: head/sys/riscv/include/resource.h ============================================================================== --- head/sys/riscv/include/resource.h Fri Jan 24 16:43:49 2020 (r357085) +++ head/sys/riscv/include/resource.h Fri Jan 24 16:50:51 2020 (r357086) @@ -42,5 +42,8 @@ #define SYS_RES_MEMORY 3 /* i/o memory */ #define SYS_RES_IOPORT 4 /* i/o ports */ #define SYS_RES_GPIO 5 /* general purpose i/o */ +#ifdef NEW_PCIB +#define PCI_RES_BUS 6 /* PCI bus numbers */ +#endif #endif /* !_MACHINE_RESOURCE_H_ */ From owner-svn-src-all@freebsd.org Fri Jan 24 17:05:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B70C1F59C5; Fri, 24 Jan 2020 17:05:37 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4845B84zxBz4GxL; Fri, 24 Jan 2020 17:05:36 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 00OH5WhR013637 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 24 Jan 2020 09:05:32 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 00OH5W9V013636; Fri, 24 Jan 2020 09:05:32 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Fri, 24 Jan 2020 09:05:32 -0800 From: Gleb Smirnoff To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357004 - in head/sys: kern sys Message-ID: <20200124170532.GO1268@FreeBSD.org> References: <202001230124.00N1OlXi029506@repo.freebsd.org> <23f272a4-c997-a454-19d6-10392713e71f@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <23f272a4-c997-a454-19d6-10392713e71f@selasky.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 4845B84zxBz4GxL X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-0.98 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.75)[-0.745,0]; NEURAL_HAM_LONG(-0.24)[-0.236,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, 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, 24 Jan 2020 17:05:37 -0000 On Fri, Jan 24, 2020 at 10:24:53AM +0100, Hans Petter Selasky wrote: H> What you want to do here is right, but how it is implemented is wrong, H> in my opinion. H> H> 1) Remove intr_epoch_batch. Most network drivers use interrupt H> moderation, and a timeout of 1000 iterations can easily become 1 second H> under heavly load ! If a driver has interrupt moderation than epoch batching counter basically won't ever grow over 1. It kicks in only of driver doesn't have it, or receives interrupts at a very high rate. H> 2) You need to make a new request function for interrupts which take a H> pointer to an EPOCH and replace that IH_NET in hflags! Initially I did that way, but then pondered over this approach and have abandoned it. Most likely we will have just few globally recognized epochs in the kernel. And even less might be associated with interrupt handlers. Complexity and performance impact of using a pointer are noted by Drew in D23347. -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Fri Jan 24 17:10:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D659A1F5B35; Fri, 24 Jan 2020 17:10:21 +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 4845Hd5JZ4z4HC5; Fri, 24 Jan 2020 17:10:21 +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 AD38A2A74B; Fri, 24 Jan 2020 17:10:21 +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 00OHALxg054672; Fri, 24 Jan 2020 17:10:21 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OHALAo054670; Fri, 24 Jan 2020 17:10:21 GMT (envelope-from br@FreeBSD.org) Message-Id: <202001241710.00OHALAo054670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 24 Jan 2020 17:10:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357087 - in head/sys: conf riscv/conf X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: conf riscv/conf X-SVN-Commit-Revision: 357087 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 17:10:21 -0000 Author: br Date: Fri Jan 24 17:10:21 2020 New Revision: 357087 URL: https://svnweb.freebsd.org/changeset/base/357087 Log: Include the PCI stack to the riscv GENERIC kernel. It will be used by an upcoming PCI root complex driver. Sponsored by: DARPA, AFRL Modified: head/sys/conf/files.riscv head/sys/riscv/conf/GENERIC Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Fri Jan 24 16:50:51 2020 (r357086) +++ head/sys/conf/files.riscv Fri Jan 24 17:10:21 2020 (r357087) @@ -6,6 +6,9 @@ crypto/blowfish/bf_enc.c optional crypto | ipsec | ips crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb dev/cadence/if_cgem.c optional cgem dev/ofw/ofw_cpu.c optional fdt +dev/ofw/ofwpci.c optional pci fdt +dev/pci/pci_host_generic.c optional pci +dev/pci/pci_host_generic_fdt.c optional pci fdt dev/uart/uart_cpu_fdt.c optional uart fdt dev/uart/uart_dev_lowrisc.c optional uart_lowrisc dev/xilinx/axi_quad_spi.c optional xilinx_spi Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Fri Jan 24 16:50:51 2020 (r357086) +++ head/sys/riscv/conf/GENERIC Fri Jan 24 17:10:21 2020 (r357087) @@ -76,6 +76,9 @@ options INTRNG # RISC-V SBI console device rcons +# Bus drivers +device pci + # VirtIO support device virtio # Generic VirtIO bus (required) device virtio_pci # VirtIO PCI device From owner-svn-src-all@freebsd.org Fri Jan 24 17:11:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 909821F5D9C; Fri, 24 Jan 2020 17:11:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4845KQ3KXRz4Hc5; Fri, 24 Jan 2020 17:11:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D63D2A8D7; Fri, 24 Jan 2020 17:11:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00OHBshX058871; Fri, 24 Jan 2020 17:11:54 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OHBsWa058870; Fri, 24 Jan 2020 17:11:54 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001241711.00OHBsWa058870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 24 Jan 2020 17:11:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357088 - head/sys/dev/ath X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/dev/ath X-SVN-Commit-Revision: 357088 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 17:11:54 -0000 Author: glebius Date: Fri Jan 24 17:11:54 2020 New Revision: 357088 URL: https://svnweb.freebsd.org/changeset/base/357088 Log: ath(4) processing input packets in taskqueue. Enter network epoch before calling ieee80211_input_mimo(). Modified: head/sys/dev/ath/if_ath_rx.c Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Fri Jan 24 17:10:21 2020 (r357087) +++ head/sys/dev/ath/if_ath_rx.c Fri Jan 24 17:11:54 2020 (r357088) @@ -647,6 +647,7 @@ ath_rx_pkt(struct ath_softc *sc, struct ath_rx_status uint64_t tsf, int nf, HAL_RX_QUEUE qtype, struct ath_buf *bf, struct mbuf *m) { + struct epoch_tracker et; uint64_t rstamp; /* XXX TODO: make this an mbuf tag? */ struct ieee80211_rx_stats rxs; @@ -941,6 +942,7 @@ rx_accept: rxs.c_nf_ext[i] = nf; } + NET_EPOCH_ENTER(et); if (ni != NULL) { /* * Only punt packets for ampdu reorder processing for @@ -986,6 +988,7 @@ rx_accept: type = ieee80211_input_mimo_all(ic, m); m = NULL; } + NET_EPOCH_EXIT(et); /* * At this point we have passed the frame up the stack; thus From owner-svn-src-all@freebsd.org Fri Jan 24 17:15:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 502121F5EEA; Fri, 24 Jan 2020 17:15:32 +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 4845Pc1Rjvz4Hrr; Fri, 24 Jan 2020 17:15:32 +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 2CD4B2A913; Fri, 24 Jan 2020 17:15:32 +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 00OHFWsD060693; Fri, 24 Jan 2020 17:15:32 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OHFWnG060692; Fri, 24 Jan 2020 17:15:32 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001241715.00OHFWnG060692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 24 Jan 2020 17:15: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: r357089 - in stable: 11/lib/libc/gen 12/lib/libc/gen X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/lib/libc/gen 12/lib/libc/gen X-SVN-Commit-Revision: 357089 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 17:15:32 -0000 Author: kevans Date: Fri Jan 24 17:15:31 2020 New Revision: 357089 URL: https://svnweb.freebsd.org/changeset/base/357089 Log: MFC 356951: posix_spawn: mark error as volatile In the case of an error, the RFSPAWN'd thread will write back to psa->error with the correct exit code. Mark this as volatile as the return value is being actively dorked up for erroneous exits on !x86. This fixes the following tests, tested on aarch64 (only under qemu, at the moment): - posix_spawn/spawn_test:t_spawn_missing - posix_spawn/spawn_test:t_spawn_nonexec - posix_spawn/spawn_test:t_spawn_zero Modified: stable/11/lib/libc/gen/posix_spawn.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/lib/libc/gen/posix_spawn.c Directory Properties: stable/12/ (props changed) Modified: stable/11/lib/libc/gen/posix_spawn.c ============================================================================== --- stable/11/lib/libc/gen/posix_spawn.c Fri Jan 24 17:11:54 2020 (r357088) +++ stable/11/lib/libc/gen/posix_spawn.c Fri Jan 24 17:15:31 2020 (r357089) @@ -199,7 +199,7 @@ struct posix_spawn_args { char * const * argv; char * const * envp; int use_env_path; - int error; + volatile int error; }; #if defined(__i386__) || defined(__amd64__) From owner-svn-src-all@freebsd.org Fri Jan 24 17:15:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB7C01F5EF0; Fri, 24 Jan 2020 17:15:32 +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 4845Pc48HHz4Hrs; Fri, 24 Jan 2020 17:15:32 +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 898822A914; Fri, 24 Jan 2020 17:15:32 +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 00OHFWwI060699; Fri, 24 Jan 2020 17:15:32 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OHFWh7060698; Fri, 24 Jan 2020 17:15:32 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001241715.00OHFWh7060698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 24 Jan 2020 17:15: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: r357089 - in stable: 11/lib/libc/gen 12/lib/libc/gen X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/lib/libc/gen 12/lib/libc/gen X-SVN-Commit-Revision: 357089 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 17:15:32 -0000 Author: kevans Date: Fri Jan 24 17:15:31 2020 New Revision: 357089 URL: https://svnweb.freebsd.org/changeset/base/357089 Log: MFC 356951: posix_spawn: mark error as volatile In the case of an error, the RFSPAWN'd thread will write back to psa->error with the correct exit code. Mark this as volatile as the return value is being actively dorked up for erroneous exits on !x86. This fixes the following tests, tested on aarch64 (only under qemu, at the moment): - posix_spawn/spawn_test:t_spawn_missing - posix_spawn/spawn_test:t_spawn_nonexec - posix_spawn/spawn_test:t_spawn_zero Modified: stable/12/lib/libc/gen/posix_spawn.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/libc/gen/posix_spawn.c Directory Properties: stable/11/ (props changed) Modified: stable/12/lib/libc/gen/posix_spawn.c ============================================================================== --- stable/12/lib/libc/gen/posix_spawn.c Fri Jan 24 17:11:54 2020 (r357088) +++ stable/12/lib/libc/gen/posix_spawn.c Fri Jan 24 17:15:31 2020 (r357089) @@ -201,7 +201,7 @@ struct posix_spawn_args { char * const * argv; char * const * envp; int use_env_path; - int error; + volatile int error; }; #if defined(__i386__) || defined(__amd64__) From owner-svn-src-all@freebsd.org Fri Jan 24 17:24:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66FFD1F652B; Fri, 24 Jan 2020 17:24:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4845bR1tDlz4JdQ; Fri, 24 Jan 2020 17:24:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B3AB2AAF2; Fri, 24 Jan 2020 17:24:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00OHO375066309; Fri, 24 Jan 2020 17:24:03 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OHO3jn066308; Fri, 24 Jan 2020 17:24:03 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001241724.00OHO3jn066308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 24 Jan 2020 17:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357090 - head/sys/dev/re X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/dev/re X-SVN-Commit-Revision: 357090 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 17:24:03 -0000 Author: glebius Date: Fri Jan 24 17:24:02 2020 New Revision: 357090 URL: https://svnweb.freebsd.org/changeset/base/357090 Log: re(4) uses taskqueue to process input packets. Enter network epoch in there. Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Fri Jan 24 17:15:31 2020 (r357089) +++ head/sys/dev/re/if_re.c Fri Jan 24 17:24:02 2020 (r357090) @@ -2576,6 +2576,7 @@ re_intr(void *arg) static void re_int_task(void *arg, int npending) { + struct epoch_tracker et; struct rl_softc *sc; struct ifnet *ifp; u_int16_t status; @@ -2602,8 +2603,11 @@ re_int_task(void *arg, int npending) } #endif - if (status & (RL_ISR_RX_OK|RL_ISR_RX_ERR|RL_ISR_FIFO_OFLOW)) + if (status & (RL_ISR_RX_OK|RL_ISR_RX_ERR|RL_ISR_FIFO_OFLOW)) { + NET_EPOCH_ENTER(et); rval = re_rxeof(sc, NULL); + NET_EPOCH_EXIT(et); + } /* * Some chips will ignore a second TX request issued From owner-svn-src-all@freebsd.org Fri Jan 24 18:06:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 29EE31F7305; Fri, 24 Jan 2020 18:06:23 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4846XG6HHXz4Lh0; Fri, 24 Jan 2020 18:06:22 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id 00OI6KrR013950 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 24 Jan 2020 10:06:20 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id 00OI6KnM013949; Fri, 24 Jan 2020 10:06:20 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Fri, 24 Jan 2020 10:06:20 -0800 From: Gleb Smirnoff To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357075 - in head/sys: compat/linux kern sys Message-ID: <20200124180620.GQ1268@FreeBSD.org> References: <202001241157.00OBvtv8070107@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202001241157.00OBvtv8070107@repo.freebsd.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 4846XG6HHXz4Lh0 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_LONG(-1.00)[-0.996,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: Fri, 24 Jan 2020 18:06:23 -0000 On Fri, Jan 24, 2020 at 11:57:55AM +0000, Edward Tomasz Napierala wrote: E> Author: trasz E> Date: Fri Jan 24 11:57:55 2020 E> New Revision: 357075 E> URL: https://svnweb.freebsd.org/changeset/base/357075 E> E> Log: E> Add kern_unmount() and use in Linuxulator. No functional changes. Just out of curiosity: what Linux binaries that do unmount may somebody run on FreeBSD for production or just for fun? -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Fri Jan 24 18:08:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5D2E1F74FD; Fri, 24 Jan 2020 18:08:41 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:c2c:26d8::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4846Zw4qszz4Lw2; Fri, 24 Jan 2020 18:08:40 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id 00OI8R6A075915 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 24 Jan 2020 18:08:28 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: glebius@freebsd.org Received: from [10.58.0.10] (dadvw [10.58.0.10]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id 00OI8P55027102 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 25 Jan 2020 01:08:25 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r357075 - in head/sys: compat/linux kern sys To: Gleb Smirnoff , Edward Tomasz Napierala References: <202001241157.00OBvtv8070107@repo.freebsd.org> <20200124180620.GQ1268@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eugene Grosbein Message-ID: <4d648086-e02d-6b04-f245-34abbc8071c5@grosbein.net> Date: Sat, 25 Jan 2020 01:08:19 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20200124180620.GQ1268@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 4846Zw4qszz4Lw2 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=permerror (mx1.freebsd.org: domain of eugen@grosbein.net uses mechanism not recognized by this client) smtp.mailfrom=eugen@grosbein.net X-Spamd-Result: default: False [-3.91 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grosbein.net]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-1.81)[ip: (-4.94), ipnet: 2a01:4f8::/29(-2.52), asn: 24940(-1.55), country: DE(-0.02)]; R_SPF_PERMFAIL(0.00)[]; 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)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 18:08:42 -0000 25.01.2020 1:06, Gleb Smirnoff wrote: > E> Author: trasz > E> Date: Fri Jan 24 11:57:55 2020 > E> New Revision: 357075 > E> URL: https://svnweb.freebsd.org/changeset/base/357075 > E> > E> Log: > E> Add kern_unmount() and use in Linuxulator. No functional changes. > > Just out of curiosity: what Linux binaries that do unmount may > somebody run on FreeBSD for production or just for fun? Perhaps, some fuse-* utilizer? From owner-svn-src-all@freebsd.org Fri Jan 24 19:22:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C91AD1F9AA1; Fri, 24 Jan 2020 19:22:06 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4848Cf4ztgz4RFT; Fri, 24 Jan 2020 19:22:06 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id DE9EC260294; Fri, 24 Jan 2020 20:22:01 +0100 (CET) Subject: Re: svn commit: r357004 - in head/sys: kern sys To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202001230124.00N1OlXi029506@repo.freebsd.org> <23f272a4-c997-a454-19d6-10392713e71f@selasky.org> <20200124170532.GO1268@FreeBSD.org> From: Hans Petter Selasky Message-ID: <7d7db96d-26b1-1d2b-9f8d-a3f8fbe8c33c@selasky.org> Date: Fri, 24 Jan 2020 20:21:54 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20200124170532.GO1268@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4848Cf4ztgz4RFT X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-0.996,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, 24 Jan 2020 19:22:06 -0000 On 2020-01-24 18:05, Gleb Smirnoff wrote: > On Fri, Jan 24, 2020 at 10:24:53AM +0100, Hans Petter Selasky wrote: > H> What you want to do here is right, but how it is implemented is wrong, > H> in my opinion. > H> > H> 1) Remove intr_epoch_batch. Most network drivers use interrupt > H> moderation, and a timeout of 1000 iterations can easily become 1 second > H> under heavly load ! > > If a driver has interrupt moderation than epoch batching counter > basically won't ever grow over 1. It kicks in only of driver doesn't > have it, or receives interrupts at a very high rate. Depending on the load an interrupt imposes, this batching counter may cause epochs to last for a long time. Have you considered using ticks for this instead? I.E. if the congestion lasts more than two ticks, then re-acquire the EPOCH? For example if the network controller spends more time processing packets then there is between interrupts, then this unconditional 1000x thing can be quite dangerous. > > H> 2) You need to make a new request function for interrupts which take a > H> pointer to an EPOCH and replace that IH_NET in hflags! > > Initially I did that way, but then pondered over this approach and have > abandoned it. Most likely we will have just few globally recognized > epochs in the kernel. And even less might be associated with interrupt > handlers. Complexity and performance impact of using a pointer are > noted by Drew in D23347. Let not the network epoch become the new Giant of EPOCH's. There might be realtime constraints for EPOCH's aswell. Secondly, I don't see how 8000 IRQs per second will cause any problem accessing a pointer in the interrupt handler structure? A well designed ethernet driver use coalescing of packets and the the IRQ rate goes down. What Drew is referring to are badly designed ethernet cards with very small DMA rings, so the speak. If the IRQ handler is executed hundreds of thousand times per second, that is a problem in itself and reading one more pointer will have little impact on the system. --HPS From owner-svn-src-all@freebsd.org Fri Jan 24 19:42:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 149CA1FA009; Fri, 24 Jan 2020 19:42:54 +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 4848gd6grkz4SVN; Fri, 24 Jan 2020 19:42:53 +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 C5C1F2C48E; Fri, 24 Jan 2020 19:42:53 +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 00OJgrT2050298; Fri, 24 Jan 2020 19:42:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OJgrxY050297; Fri, 24 Jan 2020 19:42:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202001241942.00OJgrxY050297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 24 Jan 2020 19:42:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357091 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 357091 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 19:42:54 -0000 Author: kib Date: Fri Jan 24 19:42:53 2020 New Revision: 357091 URL: https://svnweb.freebsd.org/changeset/base/357091 Log: Handle a race of collapse with a retrying fault. Both vm_object_scan_all_shadowed() and vm_object_collapse_scan() might observe an invalid page left in the default backing object by the fault handler that retried. Check for the condition and refuse to collapse. Reported and tested by: pho Reviewed by: jeff Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D23331 Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Fri Jan 24 17:24:02 2020 (r357090) +++ head/sys/vm/vm_object.c Fri Jan 24 19:42:53 2020 (r357091) @@ -1700,14 +1700,25 @@ vm_object_scan_all_shadowed(vm_object_t object) if (new_pindex >= object->size) break; - /* - * If the backing object page is busy a grandparent or older - * page may still be undergoing CoW. It is not safe to - * collapse the backing object until it is quiesced. - */ - if (p != NULL && vm_page_busied(p)) - return (false); + if (p != NULL) { + /* + * If the backing object page is busy a + * grandparent or older page may still be + * undergoing CoW. It is not safe to collapse + * the backing object until it is quiesced. + */ + if (vm_page_tryxbusy(p) == 0) + return (false); + /* + * We raced with the fault handler that left + * newly allocated invalid page on the object + * queue and retried. + */ + if (!vm_page_all_valid(p)) + goto unbusy_ret; + } + /* * See if the parent has the page or if the parent's object * pager has the page. If the parent has the page but the page @@ -1717,15 +1728,24 @@ vm_object_scan_all_shadowed(vm_object_t object) * object and we might as well give up now. */ pp = vm_page_lookup(object, new_pindex); + /* - * The valid check here is stable due to object lock being - * required to clear valid and initiate paging. + * The valid check here is stable due to object lock + * being required to clear valid and initiate paging. + * Busy of p disallows fault handler to validate pp. */ if ((pp == NULL || vm_page_none_valid(pp)) && !vm_pager_has_page(object, new_pindex, NULL, NULL)) - return (false); + goto unbusy_ret; + if (p != NULL) + vm_page_xunbusy(p); } return (true); + +unbusy_ret: + if (p != NULL) + vm_page_xunbusy(p); + return (false); } static void @@ -1769,6 +1789,14 @@ vm_object_collapse_scan(vm_object_t object) swap_pager_freespace(backing_object, p->pindex, 1); + KASSERT(!pmap_page_is_mapped(p), + ("freeing mapped page %p", p)); + if (vm_page_remove(p)) + vm_page_free(p); + continue; + } + + if (!vm_page_all_valid(p)) { KASSERT(!pmap_page_is_mapped(p), ("freeing mapped page %p", p)); if (vm_page_remove(p)) From owner-svn-src-all@freebsd.org Fri Jan 24 20:08:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 496C31FAD60; Fri, 24 Jan 2020 20:08:21 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) (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 4849F11FyGz4VFj; Fri, 24 Jan 2020 20:08:21 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm1-x343.google.com with SMTP id f129so662770wmf.2; Fri, 24 Jan 2020 12:08:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to; bh=26vpIRlD7IJwD4OENqE1r8tCsFVVAiKrLIRY2ZStkDk=; b=cT5wMkMEF5F8hleJeiWvfZ4t2U6WLBL0cAaEj8g923KVO81dk7rF9LQ+r6iHrvo1iw wAnd3cMu0bNVSqXHjPxLuYlkRO/gGwtmihnUGr6s4glBGzom2f83ZavrPvzby5rrSVfU KOd+efw9RaLbXAhtcHns49/ZkFriuKe7wtgYXwQLWKIUOgcWILhDlvBweYp0z61MdFNf 9qDa1WchIB9b38ENEt3PbC+KCS/hkI/InwzSBx0MxHc8RqRKLaph1VAMgNYPmHU+wsWv vw0PHuwxTclmMgOOom5WKUTRSRsNxRCQd8uYsCZDjVwOaac5iyib2aL7InQazZC/YOfx x0BQ== 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 :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=26vpIRlD7IJwD4OENqE1r8tCsFVVAiKrLIRY2ZStkDk=; b=NscmUMxnHiRQ9XcsUkmMscbKm7dNmApso/GMB32gbvp0yUEsIw8dpWr7UbLz8Qpb4j 4N1oGSnqLF7+RO+sYPPYQ61mHvUFLQM1dGhGSIF8n85WIEjo4C6WPatfeUDuPic9u0PE PhQuqitkWeOazzdlsspKQMg2OtRA7UQ9TbmDjYo7tbFkp6Fx3sBJRjZ97iMHsVyS1Ucf gXVa3FZ1Ojb6KglmffyHN/pC2M1yo6uMunXmSNj45IbfHltZO3l3DAMGv0oA2dxr3RuW 56qq2IlhMt7gu5OHaogLZRTbeo3ZrYr5UxLu+GkCE9FhdtfBDUzmOQyeWi/7pIgV+704 5+oQ== X-Gm-Message-State: APjAAAUJ50EZn911DpKSf+bAiWcnkVJDj39vOKS3NNLPU7PGY9F0ypzg NuWNqk0aALQFpfi69GejqJiKd/G8 X-Google-Smtp-Source: APXvYqwgx1FAmxZRKog9GjpUiXSxpI2TcAmQ6Ubi6ywgBouOzCYFnQGb4d1KLp79U4ZYjyPPj7rtTQ== X-Received: by 2002:a1c:1b4d:: with SMTP id b74mr797526wmb.33.1579896499324; Fri, 24 Jan 2020 12:08:19 -0800 (PST) Received: from brick (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id x10sm8560054wrv.60.2020.01.24.12.08.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2020 12:08:18 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Fri, 24 Jan 2020 20:08:16 +0000 From: Edward Tomasz Napierala To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357075 - in head/sys: compat/linux kern sys Message-ID: <20200124200816.GA58968@brick> Mail-Followup-To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202001241157.00OBvtv8070107@repo.freebsd.org> <20200124180620.GQ1268@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200124180620.GQ1268@FreeBSD.org> X-Rspamd-Queue-Id: 4849F11FyGz4VFj X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,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: Fri, 24 Jan 2020 20:08:21 -0000 On 0124T1006, Gleb Smirnoff wrote: > On Fri, Jan 24, 2020 at 11:57:55AM +0000, Edward Tomasz Napierala wrote: > E> Author: trasz > E> Date: Fri Jan 24 11:57:55 2020 > E> New Revision: 357075 > E> URL: https://svnweb.freebsd.org/changeset/base/357075 > E> > E> Log: > E> Add kern_unmount() and use in Linuxulator. No functional changes. > > Just out of curiosity: what Linux binaries that do unmount may > somebody run on FreeBSD for production or just for fun? Some of the LTP regression tests mount and unmount ext2 and msdosfs images, to tests some of the syscalls on different filesystems. From owner-svn-src-all@freebsd.org Fri Jan 24 20:23:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 818621FB1B3; Fri, 24 Jan 2020 20:23:39 +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 4849Zf2vCMz4WB6; Fri, 24 Jan 2020 20:23:38 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id v5UNiagC7nCigv5UOiW0Fl; Fri, 24 Jan 2020 13:23:37 -0700 X-Authority-Analysis: v=2.3 cv=cZisUULM c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=Jdjhy38mL1oA:10 a=ndaoGXS1AAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=3RbmEhYP8JuRmH6FH_UA:9 a=YozzxExVAemzLD1i:21 a=50F0wAOjQmEiZ6MV:21 a=CjuIK1q_8ugA:10 a=mFeOnlTyF09QQMGr2mMI:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id AB2FF2A8; Fri, 24 Jan 2020 12:23:34 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id 00OKNYE2094992; Fri, 24 Jan 2020 12:23:34 -0800 (PST) (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 00OKNXlS094989; Fri, 24 Jan 2020 12:23:34 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202001242023.00OKNXlS094989@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 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: Hans Petter Selasky cc: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357004 - in head/sys: kern sys In-reply-to: <7d7db96d-26b1-1d2b-9f8d-a3f8fbe8c33c@selasky.org> References: <202001230124.00N1OlXi029506@repo.freebsd.org> <23f272a4-c997-a454-19d6-10392713e71f@selasky.org> <20200124170532.GO1268@FreeBSD.org> <7d7db96d-26b1-1d2b-9f8d-a3f8fbe8c33c@selasky.org> Comments: In-reply-to Hans Petter Selasky message dated "Fri, 24 Jan 2020 20:21:54 +0100." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 24 Jan 2020 12:23:33 -0800 X-CMAE-Envelope: MS4wfOObIeG0RL9rH4h8D7a/Ov/cNaRVE9/0nSVYTjuNjub0+RvCIKu6/H+5lhzpHLl9IP4XVxaZ1g8YocdTxm3Qgd7lQKuBISvMfirWXa8ceUymrhANQCIO fxWkRiL3k3d4QcdXxESA+2jQWCMz7sTJlCFwgEo6d1yQUxkqdWldS54l9/yRmhss4DgEvg3ytMkKM616XmT6E+W4dVGrmx5/n5Kk7mc7o7Ik6cQW9wD8dZoa uePtX/mxMcaheBYgZuJ6WzifXeflHCA+/f5PMdVifPhh3us2nlyW+x1wWGH+1RhgPtfRDo4mgpVM2zFo6Y5lJw== X-Rspamd-Queue-Id: 4849Zf2vCMz4WB6 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.134.13) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-4.15 / 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)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[13.134.59.64.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.45)[ip: (-6.53), ipnet: 64.59.128.0/20(-3.17), asn: 6327(-2.46), country: CA(-0.09)]; FROM_EQ_ENVFROM(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, 24 Jan 2020 20:23:39 -0000 In message <7d7db96d-26b1-1d2b-9f8d-a3f8fbe8c33c@selasky.org>, Hans Petter Sela sky writes: > On 2020-01-24 18:05, Gleb Smirnoff wrote: > > On Fri, Jan 24, 2020 at 10:24:53AM +0100, Hans Petter Selasky wrote: > > H> What you want to do here is right, but how it is implemented is wrong, > > H> in my opinion. > > H> > > H> 1) Remove intr_epoch_batch. Most network drivers use interrupt > > H> moderation, and a timeout of 1000 iterations can easily become 1 second > > H> under heavly load ! > > > > If a driver has interrupt moderation than epoch batching counter > > basically won't ever grow over 1. It kicks in only of driver doesn't > > have it, or receives interrupts at a very high rate. > > Depending on the load an interrupt imposes, this batching counter may > cause epochs to last for a long time. Have you considered using ticks > for this instead? I.E. if the congestion lasts more than two ticks, then > re-acquire the EPOCH? > > For example if the network controller spends more time processing > packets then there is between interrupts, then this unconditional 1000x > thing can be quite dangerous. > > > > > H> 2) You need to make a new request function for interrupts which take a > > H> pointer to an EPOCH and replace that IH_NET in hflags! > > > > Initially I did that way, but then pondered over this approach and have > > abandoned it. Most likely we will have just few globally recognized > > epochs in the kernel. And even less might be associated with interrupt > > handlers. Complexity and performance impact of using a pointer are > > noted by Drew in D23347. > > Let not the network epoch become the new Giant of EPOCH's. There might > be realtime constraints for EPOCH's aswell. I also had that concern yesterday. Obtaining an EPOCH higher up the call stack or lower down depends on the workload. Are there any measurements that moving the EPOCHs higher in the call stack improves one workload (and configuration) or another? Could one type of workload or configuration benefit from this at the expense of another workload or configuration? > > Secondly, I don't see how 8000 IRQs per second will cause any problem > accessing a pointer in the interrupt handler structure? A well designed > ethernet driver use coalescing of packets and the the IRQ rate goes > down. What Drew is referring to are badly designed ethernet cards with > very small DMA rings, so the speak. > > If the IRQ handler is executed hundreds of thousand times per second, > that is a problem in itself and reading one more pointer will have > little impact on the system. -- 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 Fri Jan 24 20:35:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5AC341FB4AE; Fri, 24 Jan 2020 20:35:43 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4849rb1Wwjz4WhT; Fri, 24 Jan 2020 20:35:43 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F9852CDDA; Fri, 24 Jan 2020 20:35:43 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00OKZhin079889; Fri, 24 Jan 2020 20:35:43 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OKZfjA079882; Fri, 24 Jan 2020 20:35:41 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202001242035.00OKZfjA079882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Fri, 24 Jan 2020 20:35:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357092 - in head: sbin/ipfw sys/netinet/libalias X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head: sbin/ipfw sys/netinet/libalias X-SVN-Commit-Revision: 357092 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 20:35:43 -0000 Author: melifaro Date: Fri Jan 24 20:35:41 2020 New Revision: 357092 URL: https://svnweb.freebsd.org/changeset/base/357092 Log: Add support for RFC 6598/Carrier Grade NAT subnets. to libalias and ipfw. In libalias, a new flag PKT_ALIAS_UNREGISTERED_RFC6598 is added. This is like PKT_ALIAS_UNREGISTERED_ONLY, but also is RFC 6598 aware. Also, we add a new NAT option to ipfw called unreg_cgn, which is like unreg_only, but also is RFC 6598-aware. The reason for the new flags/options is to avoid breaking existing networks, especially those which rely on RFC 6598 as an external address. Submitted by: Neel Chauhan MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D22877 Modified: head/sbin/ipfw/ipfw.8 head/sbin/ipfw/ipfw2.h head/sbin/ipfw/main.c head/sbin/ipfw/nat.c head/sys/netinet/libalias/alias.c head/sys/netinet/libalias/alias.h head/sys/netinet/libalias/libalias.3 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Fri Jan 24 19:42:53 2020 (r357091) +++ head/sbin/ipfw/ipfw.8 Fri Jan 24 20:35:41 2020 (r357092) @@ -3233,8 +3233,11 @@ Deny any incoming connection from outside world. Try to leave the alias port numbers unchanged from the actual local port numbers. .It Cm unreg_only -Traffic on the local network not originating from an +Traffic on the local network not originating from a RFC 1918 unregistered address spaces will be ignored. +.It Cm unreg_cgn +Like unreg_only, but includes the RFC 6598 (Carrier Grade NAT) +address range. .It Cm reset Reset table of the packet aliasing engine on address change. .It Cm reverse Modified: head/sbin/ipfw/ipfw2.h ============================================================================== --- head/sbin/ipfw/ipfw2.h Fri Jan 24 19:42:53 2020 (r357091) +++ head/sbin/ipfw/ipfw2.h Fri Jan 24 20:35:41 2020 (r357092) @@ -220,6 +220,7 @@ enum tokens { TOK_DENY_INC, TOK_SAME_PORTS, TOK_UNREG_ONLY, + TOK_UNREG_CGN, TOK_SKIP_GLOBAL, TOK_RESET_ADDR, TOK_ALIAS_REV, Modified: head/sbin/ipfw/main.c ============================================================================== --- head/sbin/ipfw/main.c Fri Jan 24 19:42:53 2020 (r357091) +++ head/sbin/ipfw/main.c Fri Jan 24 20:35:41 2020 (r357092) @@ -43,8 +43,8 @@ help(void) "add [num] [set N] [prob x] RULE-BODY\n" "{pipe|queue} N config PIPE-BODY\n" "[pipe|queue] {zero|delete|show} [N{,N}]\n" -"nat N config {ip IPADDR|if IFNAME|log|deny_in|same_ports|unreg_only|reset|\n" -" reverse|proxy_only|redirect_addr linkspec|\n" +"nat N config {ip IPADDR|if IFNAME|log|deny_in|same_ports|unreg_only|unreg_cgn|\n" +" reset|reverse|proxy_only|redirect_addr linkspec|\n" " redirect_port linkspec|redirect_proto linkspec}\n" "set [disable N... enable N...] | move [rule] X to Y | swap X Y | show\n" "set N {show|list|zero|resetlog|delete} [N{,N}] | flush\n" Modified: head/sbin/ipfw/nat.c ============================================================================== --- head/sbin/ipfw/nat.c Fri Jan 24 19:42:53 2020 (r357091) +++ head/sbin/ipfw/nat.c Fri Jan 24 20:35:41 2020 (r357092) @@ -60,6 +60,7 @@ static struct _s_x nat_params[] = { { "deny_in", TOK_DENY_INC }, { "same_ports", TOK_SAME_PORTS }, { "unreg_only", TOK_UNREG_ONLY }, + { "unreg_cgn", TOK_UNREG_CGN }, { "skip_global", TOK_SKIP_GLOBAL }, { "reset", TOK_RESET_ADDR }, { "reverse", TOK_ALIAS_REV }, @@ -663,6 +664,9 @@ nat_show_cfg(struct nat44_cfg_nat *n, void *arg) } else if (n->mode & PKT_ALIAS_UNREGISTERED_ONLY) { printf(" unreg_only"); n->mode &= ~PKT_ALIAS_UNREGISTERED_ONLY; + } else if (n->mode & PKT_ALIAS_UNREGISTERED_CGN) { + printf(" unreg_cgn"); + n->mode &= ~PKT_ALIAS_UNREGISTERED_CGN; } else if (n->mode & PKT_ALIAS_RESET_ON_ADDR_CHANGE) { printf(" reset"); n->mode &= ~PKT_ALIAS_RESET_ON_ADDR_CHANGE; Modified: head/sys/netinet/libalias/alias.c ============================================================================== --- head/sys/netinet/libalias/alias.c Fri Jan 24 19:42:53 2020 (r357091) +++ head/sys/netinet/libalias/alias.c Fri Jan 24 20:35:41 2020 (r357092) @@ -1413,6 +1413,10 @@ getout: #define UNREG_ADDR_C_LOWER 0xc0a80000 #define UNREG_ADDR_C_UPPER 0xc0a8ffff +/* 100.64.0.0 -> 100.127.255.255 (RFC 6598 - Carrier Grade NAT) */ +#define UNREG_ADDR_CGN_LOWER 0x64400000 +#define UNREG_ADDR_CGN_UPPER 0x647fffff + int LibAliasOut(struct libalias *la, char *ptr, int maxpacketsize) { @@ -1464,7 +1468,8 @@ LibAliasOutLocked(struct libalias *la, char *ptr, /* v } addr_save = GetDefaultAliasAddress(la); - if (la->packetAliasMode & PKT_ALIAS_UNREGISTERED_ONLY) { + if (la->packetAliasMode & PKT_ALIAS_UNREGISTERED_ONLY || + la->packetAliasMode & PKT_ALIAS_UNREGISTERED_CGN) { u_long addr; int iclass; @@ -1476,6 +1481,9 @@ LibAliasOutLocked(struct libalias *la, char *ptr, /* v iclass = 2; else if (addr >= UNREG_ADDR_A_LOWER && addr <= UNREG_ADDR_A_UPPER) iclass = 1; + else if (addr >= UNREG_ADDR_CGN_LOWER && addr <= UNREG_ADDR_CGN_UPPER && + la->packetAliasMode & PKT_ALIAS_UNREGISTERED_CGN) + iclass = 4; if (iclass == 0) { SetDefaultAliasAddress(la, pip->ip_src); Modified: head/sys/netinet/libalias/alias.h ============================================================================== --- head/sys/netinet/libalias/alias.h Fri Jan 24 19:42:53 2020 (r357091) +++ head/sys/netinet/libalias/alias.h Fri Jan 24 20:35:41 2020 (r357092) @@ -228,6 +228,14 @@ struct mbuf *m_megapullup(struct mbuf *, int); */ #define PKT_ALIAS_SKIP_GLOBAL 0x200 +/* + * Like PKT_ALIAS_UNREGISTERED_ONLY, but includes the RFC 6598 + * (Carrier Grade NAT) address range as follows: + * + * 100.64.0.0 -> 100.127.255.255 + */ +#define PKT_ALIAS_UNREGISTERED_CGN 0x400 + /* Function return codes. */ #define PKT_ALIAS_ERROR -1 #define PKT_ALIAS_OK 1 Modified: head/sys/netinet/libalias/libalias.3 ============================================================================== --- head/sys/netinet/libalias/libalias.3 Fri Jan 24 19:42:53 2020 (r357091) +++ head/sys/netinet/libalias/libalias.3 Fri Jan 24 20:35:41 2020 (r357092) @@ -212,6 +212,11 @@ This option is useful in the case that the packet alia registered and unregistered subnets on different interfaces. The registered subnet is fully accessible to the outside world, so traffic from it does not need to be passed through the packet aliasing engine. +.It Dv PKT_ALIAS_UNREGISTERED_CGN +Like PKT_ALIAS_UNREGISTERED_ONLY, but includes the RFC 6598 (Carrier Grade +NAT) subnet as follows: +.Pp +100.64.0.0 -> 100.127.255.255 (RFC 6598 subnet) .It Dv PKT_ALIAS_RESET_ON_ADDR_CHANGE When this mode bit is set and .Fn LibAliasSetAddress From owner-svn-src-all@freebsd.org Fri Jan 24 20:44:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 32B411FB70E; Fri, 24 Jan 2020 20:44:47 +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 484B326w5vz4X97; Fri, 24 Jan 2020 20:44:46 +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 00OKicLF035553; Fri, 24 Jan 2020 12:44:38 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 00OKicLk035552; Fri, 24 Jan 2020 12:44:38 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202001242044.00OKicLk035552@gndrsh.dnsmgr.net> Subject: Re: svn commit: r357079 - head/etc In-Reply-To: <202001241440.00OEebuI064640@repo.freebsd.org> To: Ed Maste Date: Fri, 24 Jan 2020 12:44:38 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org 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: 484B326w5vz4X97 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-0.999,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: Fri, 24 Jan 2020 20:44:47 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: emaste > Date: Fri Jan 24 14:40:37 2020 > New Revision: 357079 > URL: https://svnweb.freebsd.org/changeset/base/357079 > > Log: > revert r356990 to reapply with correct commit message > > Requested by: rgrimes Thank you. > Modified: > head/etc/Makefile > > Modified: head/etc/Makefile > ============================================================================== > --- head/etc/Makefile Fri Jan 24 14:22:09 2020 (r357078) > +++ head/etc/Makefile Fri Jan 24 14:40:37 2020 (r357079) > @@ -164,8 +164,7 @@ distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY > .endif > .if ${MK_NLS} != "no" > .for alias nls in ${NLS_ALIASES} > - ${INSTALL_SYMLINK} -T "package=utilities" \ > - "${nls}" "${DESTDIR}${SHAREDIR}/nls/${alias}" > + ${INSTALL_SYMLINK} "${nls}" "${DESTDIR}${SHAREDIR}/nls/${alias}" > .endfor > .endif > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Jan 24 21:04:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9B3651FBC05; Fri, 24 Jan 2020 21:04:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 484BTt3PM2z4Y8c; Fri, 24 Jan 2020 21:04:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FEF22D394; Fri, 24 Jan 2020 21:04:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00OL4YR3098134; Fri, 24 Jan 2020 21:04:34 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OL4XQ3098131; Fri, 24 Jan 2020 21:04:33 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001242104.00OL4XQ3098131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 24 Jan 2020 21:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357093 - in head/sys/dev: otus rtwn/usb usb/wlan X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys/dev: otus rtwn/usb usb/wlan X-SVN-Commit-Revision: 357093 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 21:04:34 -0000 Author: glebius Date: Fri Jan 24 21:04:33 2020 New Revision: 357093 URL: https://svnweb.freebsd.org/changeset/base/357093 Log: Enter the network epoch in USB WiFi drivers when processing input mbuf queues. Submitted by: Idwer Vollering Modified: head/sys/dev/otus/if_otus.c head/sys/dev/rtwn/usb/rtwn_usb_rx.c head/sys/dev/usb/wlan/if_rsu.c Modified: head/sys/dev/otus/if_otus.c ============================================================================== --- head/sys/dev/otus/if_otus.c Fri Jan 24 20:35:41 2020 (r357092) +++ head/sys/dev/otus/if_otus.c Fri Jan 24 21:04:33 2020 (r357093) @@ -1770,6 +1770,7 @@ otus_rxeof(struct usb_xfer *xfer, struct otus_data *da static void otus_bulk_rx_callback(struct usb_xfer *xfer, usb_error_t error) { + struct epoch_tracker et; struct otus_softc *sc = usbd_xfer_softc(xfer); struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_frame *wh; @@ -1820,6 +1821,7 @@ tr_setup: * callback and safe to unlock. */ OTUS_UNLOCK(sc); + NET_EPOCH_ENTER(et); while ((m = mbufq_dequeue(&scrx)) != NULL) { wh = mtod(m, struct ieee80211_frame *); ni = ieee80211_find_rxnode(ic, @@ -1832,6 +1834,7 @@ tr_setup: } else (void)ieee80211_input_mimo_all(ic, m); } + NET_EPOCH_EXIT(et); #ifdef IEEE80211_SUPPORT_SUPERG ieee80211_ff_age_all(ic, 100); #endif Modified: head/sys/dev/rtwn/usb/rtwn_usb_rx.c ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_rx.c Fri Jan 24 20:35:41 2020 (r357092) +++ head/sys/dev/rtwn/usb/rtwn_usb_rx.c Fri Jan 24 21:04:33 2020 (r357093) @@ -363,6 +363,7 @@ rtwn_rx_frame(struct rtwn_softc *sc, struct mbuf *m) void rtwn_bulk_rx_callback(struct usb_xfer *xfer, usb_error_t error) { + struct epoch_tracker et; struct rtwn_usb_softc *uc = usbd_xfer_softc(xfer); struct rtwn_softc *sc = &uc->uc_sc; struct ieee80211com *ic = &sc->sc_ic; @@ -399,6 +400,7 @@ tr_setup: * ieee80211_input() because here is at the end of a USB * callback and safe to unlock. */ + NET_EPOCH_ENTER(et); while (m != NULL) { next = m->m_nextpkt; m->m_nextpkt = NULL; @@ -416,6 +418,7 @@ tr_setup: RTWN_LOCK(sc); m = next; } + NET_EPOCH_EXIT(et); break; default: /* needs it to the inactive queue due to a error. */ Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Fri Jan 24 20:35:41 2020 (r357092) +++ head/sys/dev/usb/wlan/if_rsu.c Fri Jan 24 21:04:33 2020 (r357093) @@ -2552,6 +2552,7 @@ rsu_rxeof(struct usb_xfer *xfer, struct rsu_data *data static void rsu_bulk_rx_callback(struct usb_xfer *xfer, usb_error_t error) { + struct epoch_tracker et; struct rsu_softc *sc = usbd_xfer_softc(xfer); struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_node *ni; @@ -2586,6 +2587,7 @@ tr_setup: * ieee80211_input() because here is at the end of a USB * callback and safe to unlock. */ + NET_EPOCH_ENTER(et); while (m != NULL) { next = m->m_next; m->m_next = NULL; @@ -2604,6 +2606,7 @@ tr_setup: RSU_LOCK(sc); m = next; } + NET_EPOCH_EXIT(et); break; default: /* needs it to the inactive queue due to a error. */ From owner-svn-src-all@freebsd.org Fri Jan 24 21:56:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0A141FD18A; Fri, 24 Jan 2020 21:56:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 484CdQ680Rz4bxw; Fri, 24 Jan 2020 21:56:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE1072DCE8; Fri, 24 Jan 2020 21:56:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00OLuAAE028385; Fri, 24 Jan 2020 21:56:10 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OLuAtj028384; Fri, 24 Jan 2020 21:56:10 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001242156.00OLuAtj028384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 24 Jan 2020 21:56:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357094 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 357094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 21:56:11 -0000 Author: glebius Date: Fri Jan 24 21:56:10 2020 New Revision: 357094 URL: https://svnweb.freebsd.org/changeset/base/357094 Log: Enter the network epoch when rack_output() is called in setsockopt(2). Modified: head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Fri Jan 24 21:04:33 2020 (r357093) +++ head/sys/netinet/tcp_stacks/rack.c Fri Jan 24 21:56:10 2020 (r357094) @@ -10093,6 +10093,7 @@ static int rack_set_sockopt(struct socket *so, struct sockopt *sopt, struct inpcb *inp, struct tcpcb *tp, struct tcp_rack *rack) { + struct epoch_tracker et; int32_t error = 0, optval; switch (sopt->sopt_name) { @@ -10261,7 +10262,9 @@ rack_set_sockopt(struct socket *so, struct sockopt *so if (tp->t_flags & TF_DELACK) { tp->t_flags &= ~TF_DELACK; tp->t_flags |= TF_ACKNOW; + NET_EPOCH_ENTER(et); rack_output(tp); + NET_EPOCH_EXIT(et); } break; case TCP_RACK_MIN_PACE: From owner-svn-src-all@freebsd.org Fri Jan 24 22:11:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E6E5B1FD6A2; Fri, 24 Jan 2020 22:11:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 484CzB6SWLz4clx; Fri, 24 Jan 2020 22:11:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8B6B2DF1E; Fri, 24 Jan 2020 22:11:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00OMBYnn038093; Fri, 24 Jan 2020 22:11:34 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OMBWN7038076; Fri, 24 Jan 2020 22:11:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001242211.00OMBWN7038076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 24 Jan 2020 22:11:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r357097 - in vendor/llvm-project/release-10.x: clang/include/clang/AST clang/include/clang/Basic clang/include/clang/Driver clang/include/clang/Parse clang/include/clang/Sema clang/incl... X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in vendor/llvm-project/release-10.x: clang/include/clang/AST clang/include/clang/Basic clang/include/clang/Driver clang/include/clang/Parse clang/include/clang/Sema clang/include/clang/Serialization c... X-SVN-Commit-Revision: 357097 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 22:11:35 -0000 Author: dim Date: Fri Jan 24 22:11:32 2020 New Revision: 357097 URL: https://svnweb.freebsd.org/changeset/base/357097 Log: Vendor import of llvm-project release/10.x llvmorg-10-init-17538-gd11abddb32f. Added: vendor/llvm-project/release-10.x/clang/include/clang/AST/ExprConcepts.h (contents, props changed) vendor/llvm-project/release-10.x/clang/lib/AST/ExprConcepts.cpp (contents, props changed) Modified: vendor/llvm-project/release-10.x/clang/include/clang/AST/ASTConcept.h vendor/llvm-project/release-10.x/clang/include/clang/AST/ASTContext.h vendor/llvm-project/release-10.x/clang/include/clang/AST/ASTNodeTraverser.h vendor/llvm-project/release-10.x/clang/include/clang/AST/DeclCXX.h vendor/llvm-project/release-10.x/clang/include/clang/AST/DeclTemplate.h vendor/llvm-project/release-10.x/clang/include/clang/AST/ExprCXX.h vendor/llvm-project/release-10.x/clang/include/clang/AST/PropertiesBase.td vendor/llvm-project/release-10.x/clang/include/clang/AST/RecursiveASTVisitor.h vendor/llvm-project/release-10.x/clang/include/clang/AST/Stmt.h vendor/llvm-project/release-10.x/clang/include/clang/AST/StmtVisitor.h vendor/llvm-project/release-10.x/clang/include/clang/AST/TemplateBase.h vendor/llvm-project/release-10.x/clang/include/clang/AST/Type.h vendor/llvm-project/release-10.x/clang/include/clang/AST/TypeLoc.h vendor/llvm-project/release-10.x/clang/include/clang/AST/TypeProperties.td vendor/llvm-project/release-10.x/clang/include/clang/Basic/AttrDocs.td vendor/llvm-project/release-10.x/clang/include/clang/Basic/Builtins.def vendor/llvm-project/release-10.x/clang/include/clang/Basic/CodeGenOptions.def vendor/llvm-project/release-10.x/clang/include/clang/Basic/DeclNodes.td vendor/llvm-project/release-10.x/clang/include/clang/Basic/DiagnosticDriverKinds.td vendor/llvm-project/release-10.x/clang/include/clang/Basic/DiagnosticFrontendKinds.td vendor/llvm-project/release-10.x/clang/include/clang/Basic/DiagnosticParseKinds.td vendor/llvm-project/release-10.x/clang/include/clang/Basic/DiagnosticSemaKinds.td vendor/llvm-project/release-10.x/clang/include/clang/Basic/LangOptions.def vendor/llvm-project/release-10.x/clang/include/clang/Basic/StmtNodes.td vendor/llvm-project/release-10.x/clang/include/clang/Basic/TokenKinds.def vendor/llvm-project/release-10.x/clang/include/clang/Driver/CC1Options.td vendor/llvm-project/release-10.x/clang/include/clang/Driver/Driver.h vendor/llvm-project/release-10.x/clang/include/clang/Driver/Options.td vendor/llvm-project/release-10.x/clang/include/clang/Parse/Parser.h vendor/llvm-project/release-10.x/clang/include/clang/Sema/DeclSpec.h vendor/llvm-project/release-10.x/clang/include/clang/Sema/ParsedTemplate.h vendor/llvm-project/release-10.x/clang/include/clang/Sema/Scope.h vendor/llvm-project/release-10.x/clang/include/clang/Sema/ScopeInfo.h vendor/llvm-project/release-10.x/clang/include/clang/Sema/Sema.h vendor/llvm-project/release-10.x/clang/include/clang/Sema/SemaConcept.h vendor/llvm-project/release-10.x/clang/include/clang/Sema/TemplateDeduction.h vendor/llvm-project/release-10.x/clang/include/clang/Serialization/ASTBitCodes.h vendor/llvm-project/release-10.x/clang/lib/AST/ASTConcept.cpp vendor/llvm-project/release-10.x/clang/lib/AST/ASTContext.cpp vendor/llvm-project/release-10.x/clang/lib/AST/ASTImporter.cpp vendor/llvm-project/release-10.x/clang/lib/AST/ASTStructuralEquivalence.cpp vendor/llvm-project/release-10.x/clang/lib/AST/DeclBase.cpp vendor/llvm-project/release-10.x/clang/lib/AST/DeclCXX.cpp vendor/llvm-project/release-10.x/clang/lib/AST/DeclTemplate.cpp vendor/llvm-project/release-10.x/clang/lib/AST/Expr.cpp vendor/llvm-project/release-10.x/clang/lib/AST/ExprCXX.cpp vendor/llvm-project/release-10.x/clang/lib/AST/ExprClassification.cpp vendor/llvm-project/release-10.x/clang/lib/AST/ExprConstant.cpp vendor/llvm-project/release-10.x/clang/lib/AST/ItaniumMangle.cpp vendor/llvm-project/release-10.x/clang/lib/AST/ODRHash.cpp vendor/llvm-project/release-10.x/clang/lib/AST/Stmt.cpp vendor/llvm-project/release-10.x/clang/lib/AST/StmtPrinter.cpp vendor/llvm-project/release-10.x/clang/lib/AST/StmtProfile.cpp vendor/llvm-project/release-10.x/clang/lib/AST/TemplateBase.cpp vendor/llvm-project/release-10.x/clang/lib/AST/TextNodeDumper.cpp vendor/llvm-project/release-10.x/clang/lib/AST/Type.cpp vendor/llvm-project/release-10.x/clang/lib/AST/TypeLoc.cpp vendor/llvm-project/release-10.x/clang/lib/AST/TypePrinter.cpp vendor/llvm-project/release-10.x/clang/lib/Basic/IdentifierTable.cpp vendor/llvm-project/release-10.x/clang/lib/CodeGen/CGBuiltin.cpp vendor/llvm-project/release-10.x/clang/lib/CodeGen/CGDecl.cpp vendor/llvm-project/release-10.x/clang/lib/CodeGen/CGExprScalar.cpp vendor/llvm-project/release-10.x/clang/lib/CodeGen/CodeGenFunction.cpp vendor/llvm-project/release-10.x/clang/lib/Driver/Compilation.cpp vendor/llvm-project/release-10.x/clang/lib/Driver/Job.cpp vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChain.cpp vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Clang.cpp vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/HIP.cpp vendor/llvm-project/release-10.x/clang/lib/Format/TokenAnnotator.cpp vendor/llvm-project/release-10.x/clang/lib/Frontend/CompilerInvocation.cpp vendor/llvm-project/release-10.x/clang/lib/Frontend/FrontendActions.cpp vendor/llvm-project/release-10.x/clang/lib/Frontend/InitPreprocessor.cpp vendor/llvm-project/release-10.x/clang/lib/Headers/ppc_wrappers/emmintrin.h vendor/llvm-project/release-10.x/clang/lib/Parse/ParseCXXInlineMethods.cpp vendor/llvm-project/release-10.x/clang/lib/Parse/ParseDecl.cpp vendor/llvm-project/release-10.x/clang/lib/Parse/ParseDeclCXX.cpp vendor/llvm-project/release-10.x/clang/lib/Parse/ParseExpr.cpp vendor/llvm-project/release-10.x/clang/lib/Parse/ParseExprCXX.cpp vendor/llvm-project/release-10.x/clang/lib/Parse/ParseTemplate.cpp vendor/llvm-project/release-10.x/clang/lib/Parse/ParseTentative.cpp vendor/llvm-project/release-10.x/clang/lib/Parse/Parser.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/DeclSpec.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/Sema.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaConcept.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaDecl.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaDeclAttr.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaDeclCXX.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaExceptionSpec.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaExpr.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaExprCXX.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaLambda.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaLookup.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaStmt.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaTemplate.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaTemplateDeduction.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaTemplateInstantiate.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/SemaType.cpp vendor/llvm-project/release-10.x/clang/lib/Sema/TreeTransform.h vendor/llvm-project/release-10.x/clang/lib/Serialization/ASTCommon.cpp vendor/llvm-project/release-10.x/clang/lib/Serialization/ASTReader.cpp vendor/llvm-project/release-10.x/clang/lib/Serialization/ASTReaderDecl.cpp vendor/llvm-project/release-10.x/clang/lib/Serialization/ASTReaderStmt.cpp vendor/llvm-project/release-10.x/clang/lib/Serialization/ASTWriter.cpp vendor/llvm-project/release-10.x/clang/lib/Serialization/ASTWriterDecl.cpp vendor/llvm-project/release-10.x/clang/lib/Serialization/ASTWriterStmt.cpp vendor/llvm-project/release-10.x/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp vendor/llvm-project/release-10.x/clang/tools/driver/driver.cpp vendor/llvm-project/release-10.x/libcxx/include/__config vendor/llvm-project/release-10.x/libcxx/include/__threading_support vendor/llvm-project/release-10.x/lld/COFF/InputFiles.cpp vendor/llvm-project/release-10.x/lld/ELF/Arch/PPC.cpp vendor/llvm-project/release-10.x/lld/ELF/Arch/PPC64.cpp vendor/llvm-project/release-10.x/lld/ELF/Arch/RISCV.cpp vendor/llvm-project/release-10.x/lld/ELF/Config.h vendor/llvm-project/release-10.x/lld/ELF/Driver.cpp vendor/llvm-project/release-10.x/lld/ELF/Relocations.cpp vendor/llvm-project/release-10.x/lld/ELF/Symbols.cpp vendor/llvm-project/release-10.x/lld/ELF/Target.cpp vendor/llvm-project/release-10.x/lld/ELF/Writer.cpp vendor/llvm-project/release-10.x/llvm/include/llvm/BinaryFormat/ELFRelocs/PowerPC64.def vendor/llvm-project/release-10.x/llvm/include/llvm/CodeGen/AsmPrinter.h vendor/llvm-project/release-10.x/llvm/include/llvm/MC/MCAsmBackend.h vendor/llvm-project/release-10.x/llvm/include/llvm/MC/MCFixupKindInfo.h vendor/llvm-project/release-10.x/llvm/include/llvm/Target/Target.td vendor/llvm-project/release-10.x/llvm/include/llvm/Transforms/Utils/SizeOpts.h vendor/llvm-project/release-10.x/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp vendor/llvm-project/release-10.x/llvm/lib/CodeGen/CodeGenPrepare.cpp vendor/llvm-project/release-10.x/llvm/lib/CodeGen/PatchableFunction.cpp vendor/llvm-project/release-10.x/llvm/lib/CodeGen/StackColoring.cpp vendor/llvm-project/release-10.x/llvm/lib/CodeGen/TargetPassConfig.cpp vendor/llvm-project/release-10.x/llvm/lib/IR/Verifier.cpp vendor/llvm-project/release-10.x/llvm/lib/MC/MCAssembler.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/ARM/ARMMCInstLower.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.h vendor/llvm-project/release-10.x/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp vendor/llvm-project/release-10.x/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.h vendor/llvm-project/release-10.x/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp vendor/llvm-project/release-10.x/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp vendor/llvm-project/release-10.x/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp Modified: vendor/llvm-project/release-10.x/clang/include/clang/AST/ASTConcept.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/include/clang/AST/ASTConcept.h Fri Jan 24 22:04:02 2020 (r357096) +++ vendor/llvm-project/release-10.x/clang/include/clang/AST/ASTConcept.h Fri Jan 24 22:11:32 2020 (r357097) @@ -22,10 +22,25 @@ #include namespace clang { class ConceptDecl; +class ConceptSpecializationExpr; -/// \brief The result of a constraint satisfaction check, containing the -/// necessary information to diagnose an unsatisfied constraint. -struct ConstraintSatisfaction { +/// The result of a constraint satisfaction check, containing the necessary +/// information to diagnose an unsatisfied constraint. +class ConstraintSatisfaction : public llvm::FoldingSetNode { + // The template-like entity that 'owns' the constraint checked here (can be a + // constrained entity or a concept). + NamedDecl *ConstraintOwner = nullptr; + llvm::SmallVector TemplateArgs; + +public: + + ConstraintSatisfaction() = default; + + ConstraintSatisfaction(NamedDecl *ConstraintOwner, + ArrayRef TemplateArgs) : + ConstraintOwner(ConstraintOwner), TemplateArgs(TemplateArgs.begin(), + TemplateArgs.end()) { } + using SubstitutionDiagnostic = std::pair; using Detail = llvm::PointerUnion; @@ -37,9 +52,13 @@ struct ConstraintSatisfaction { /// invalid expression. llvm::SmallVector, 4> Details; - // This can leak if used in an AST node, use ASTConstraintSatisfaction - // instead. - void *operator new(size_t bytes, ASTContext &C) = delete; + void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &C) { + Profile(ID, C, ConstraintOwner, TemplateArgs); + } + + static void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &C, + NamedDecl *ConstraintOwner, + ArrayRef TemplateArgs); }; /// Pairs of unsatisfied atomic constraint expressions along with the Modified: vendor/llvm-project/release-10.x/clang/include/clang/AST/ASTContext.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/include/clang/AST/ASTContext.h Fri Jan 24 22:04:02 2020 (r357096) +++ vendor/llvm-project/release-10.x/clang/include/clang/AST/ASTContext.h Fri Jan 24 22:11:32 2020 (r357097) @@ -88,6 +88,7 @@ class AtomicExpr; class BlockExpr; class BuiltinTemplateDecl; class CharUnits; +class ConceptDecl; class CXXABI; class CXXConstructorDecl; class CXXMethodDecl; @@ -211,7 +212,7 @@ class ASTContext : public RefCountedBase { mutable llvm::FoldingSet ObjCObjectPointerTypes; mutable llvm::FoldingSet DependentUnaryTransformTypes; - mutable llvm::FoldingSet AutoTypes; + mutable llvm::ContextualFoldingSet AutoTypes; mutable llvm::FoldingSet DeducedTemplateSpecializationTypes; mutable llvm::FoldingSet AtomicTypes; @@ -1542,7 +1543,9 @@ class ASTContext : public RefCountedBase { /// C++11 deduced auto type. QualType getAutoType(QualType DeducedType, AutoTypeKeyword Keyword, - bool IsDependent, bool IsPack = false) const; + bool IsDependent, bool IsPack = false, + ConceptDecl *TypeConstraintConcept = nullptr, + ArrayRef TypeConstraintArgs ={}) const; /// C++11 deduction pattern for 'auto' type. QualType getAutoDeductType() const; Modified: vendor/llvm-project/release-10.x/clang/include/clang/AST/ASTNodeTraverser.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/include/clang/AST/ASTNodeTraverser.h Fri Jan 24 22:04:02 2020 (r357096) +++ vendor/llvm-project/release-10.x/clang/include/clang/AST/ASTNodeTraverser.h Fri Jan 24 22:11:32 2020 (r357097) @@ -548,8 +548,8 @@ class ASTNodeTraverser (public) } void VisitNonTypeTemplateParmDecl(const NonTypeTemplateParmDecl *D) { - if (const auto *TC = D->getPlaceholderTypeConstraint()) - Visit(TC->getImmediatelyDeclaredConstraint()); + if (const auto *E = D->getPlaceholderTypeConstraint()) + Visit(E); if (D->hasDefaultArgument()) Visit(D->getDefaultArgument(), SourceRange(), D->getDefaultArgStorage().getInheritedFrom(), Modified: vendor/llvm-project/release-10.x/clang/include/clang/AST/DeclCXX.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/include/clang/AST/DeclCXX.h Fri Jan 24 22:04:02 2020 (r357096) +++ vendor/llvm-project/release-10.x/clang/include/clang/AST/DeclCXX.h Fri Jan 24 22:11:32 2020 (r357097) @@ -1893,6 +1893,37 @@ class CXXDeductionGuideDecl : public FunctionDecl { (p static bool classofKind(Kind K) { return K == CXXDeductionGuide; } }; +/// \brief Represents the body of a requires-expression. +/// +/// This decl exists merely to serve as the DeclContext for the local +/// parameters of the requires expression as well as other declarations inside +/// it. +/// +/// \code +/// template requires requires (T t) { {t++} -> regular; } +/// \endcode +/// +/// In this example, a RequiresExpr object will be generated for the expression, +/// and a RequiresExprBodyDecl will be created to hold the parameter t and the +/// template argument list imposed by the compound requirement. +class RequiresExprBodyDecl : public Decl, public DeclContext { + RequiresExprBodyDecl(ASTContext &C, DeclContext *DC, SourceLocation StartLoc) + : Decl(RequiresExprBody, DC, StartLoc), DeclContext(RequiresExprBody) {} + +public: + friend class ASTDeclReader; + friend class ASTDeclWriter; + + static RequiresExprBodyDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation StartLoc); + + static RequiresExprBodyDecl *CreateDeserialized(ASTContext &C, unsigned ID); + + // Implement isa/cast/dyncast/etc. + static bool classof(const Decl *D) { return classofKind(D->getKind()); } + static bool classofKind(Kind K) { return K == RequiresExprBody; } +}; + /// Represents a static or instance method of a struct/union/class. /// /// In the terminology of the C++ Standard, these are the (static and Modified: vendor/llvm-project/release-10.x/clang/include/clang/AST/DeclTemplate.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/include/clang/AST/DeclTemplate.h Fri Jan 24 22:04:02 2020 (r357096) +++ vendor/llvm-project/release-10.x/clang/include/clang/AST/DeclTemplate.h Fri Jan 24 22:11:32 2020 (r357097) @@ -1102,6 +1102,17 @@ class FunctionTemplateDecl : public RedeclarableTempla /// template. ArrayRef getInjectedTemplateArgs(); + /// Return whether this function template is an abbreviated function template, + /// e.g. `void foo(auto x)` or `template void foo(auto x)` + bool isAbbreviated() const { + // Since the invented template parameters generated from 'auto' parameters + // are either appended to the end of the explicit template parameter list or + // form a new template paramter list, we can simply observe the last + // parameter to determine if such a thing happened. + const TemplateParameterList *TPL = getTemplateParameters(); + return TPL->getParam(TPL->size() - 1)->isImplicit(); + } + /// Merge \p Prev with our RedeclarableTemplateDecl::Common. void mergePrevDecl(FunctionTemplateDecl *Prev); @@ -1215,7 +1226,6 @@ class TemplateTypeParmDecl final : public TypeDecl, (p bool ParameterPack, bool HasTypeConstraint = false, Optional NumExpanded = None); - static TemplateTypeParmDecl *CreateDeserialized(const ASTContext &C, unsigned ID); static TemplateTypeParmDecl *CreateDeserialized(const ASTContext &C, @@ -1374,7 +1384,8 @@ class NonTypeTemplateParmDecl final : public DeclaratorDecl, protected TemplateParmPosition, private llvm::TrailingObjects> { + std::pair, + Expr *> { friend class ASTDeclReader; friend TrailingObjects; @@ -1429,10 +1440,12 @@ class NonTypeTemplateParmDecl final ArrayRef ExpandedTInfos); static NonTypeTemplateParmDecl *CreateDeserialized(ASTContext &C, - unsigned ID); + unsigned ID, + bool HasTypeConstraint); static NonTypeTemplateParmDecl *CreateDeserialized(ASTContext &C, unsigned ID, - unsigned NumExpandedTypes); + unsigned NumExpandedTypes, + bool HasTypeConstraint); using TemplateParmPosition::getDepth; using TemplateParmPosition::setDepth; @@ -1543,20 +1556,22 @@ class NonTypeTemplateParmDecl final return TypesAndInfos[I].second; } - /// Return the type-constraint in the placeholder type of this non-type + /// Return the constraint introduced by the placeholder type of this non-type /// template parameter (if any). - TypeConstraint *getPlaceholderTypeConstraint() const { - // TODO: Concepts: Implement once we have actual placeholders with type - // constraints. - return nullptr; + Expr *getPlaceholderTypeConstraint() const { + return hasPlaceholderTypeConstraint() ? *getTrailingObjects() : + nullptr; } + void setPlaceholderTypeConstraint(Expr *E) { + *getTrailingObjects() = E; + } + /// Determine whether this non-type template parameter's type has a /// placeholder with a type-constraint. bool hasPlaceholderTypeConstraint() const { - // TODO: Concepts: Implement once we have actual placeholders with type - // constraints. - return false; + auto *AT = getType()->getContainedAutoType(); + return AT && AT->isConstrained(); } /// \brief Get the associated-constraints of this template parameter. @@ -1566,8 +1581,8 @@ class NonTypeTemplateParmDecl final /// Use this instead of getPlaceholderImmediatelyDeclaredConstraint for /// concepts APIs that accept an ArrayRef of constraint expressions. void getAssociatedConstraints(llvm::SmallVectorImpl &AC) const { - if (TypeConstraint *TC = getPlaceholderTypeConstraint()) - AC.push_back(TC->getImmediatelyDeclaredConstraint()); + if (Expr *E = getPlaceholderTypeConstraint()) + AC.push_back(E); } // Implement isa/cast/dyncast/etc. Modified: vendor/llvm-project/release-10.x/clang/include/clang/AST/ExprCXX.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/include/clang/AST/ExprCXX.h Fri Jan 24 22:04:02 2020 (r357096) +++ vendor/llvm-project/release-10.x/clang/include/clang/AST/ExprCXX.h Fri Jan 24 22:11:32 2020 (r357097) @@ -14,7 +14,6 @@ #ifndef LLVM_CLANG_AST_EXPRCXX_H #define LLVM_CLANG_AST_EXPRCXX_H -#include "clang/AST/ASTConcept.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclBase.h" #include "clang/AST/DeclCXX.h" @@ -4833,99 +4832,6 @@ class BuiltinBitCastExpr final (public) static bool classof(const Stmt *T) { return T->getStmtClass() == BuiltinBitCastExprClass; - } -}; - -/// \brief Represents the specialization of a concept - evaluates to a prvalue -/// of type bool. -/// -/// According to C++2a [expr.prim.id]p3 an id-expression that denotes the -/// specialization of a concept results in a prvalue of type bool. -class ConceptSpecializationExpr final : public Expr, public ConceptReference, - private llvm::TrailingObjects { - friend class ASTStmtReader; - friend TrailingObjects; -public: - using SubstitutionDiagnostic = std::pair; - -protected: - /// \brief The number of template arguments in the tail-allocated list of - /// converted template arguments. - unsigned NumTemplateArgs; - - /// \brief Information about the satisfaction of the named concept with the - /// given arguments. If this expression is value dependent, this is to be - /// ignored. - ASTConstraintSatisfaction *Satisfaction; - - ConceptSpecializationExpr(const ASTContext &C, NestedNameSpecifierLoc NNS, - SourceLocation TemplateKWLoc, - DeclarationNameInfo ConceptNameInfo, - NamedDecl *FoundDecl, ConceptDecl *NamedConcept, - const ASTTemplateArgumentListInfo *ArgsAsWritten, - ArrayRef ConvertedArgs, - const ConstraintSatisfaction *Satisfaction); - - ConceptSpecializationExpr(EmptyShell Empty, unsigned NumTemplateArgs); - -public: - - static ConceptSpecializationExpr * - Create(const ASTContext &C, NestedNameSpecifierLoc NNS, - SourceLocation TemplateKWLoc, DeclarationNameInfo ConceptNameInfo, - NamedDecl *FoundDecl, ConceptDecl *NamedConcept, - const ASTTemplateArgumentListInfo *ArgsAsWritten, - ArrayRef ConvertedArgs, - const ConstraintSatisfaction *Satisfaction); - - static ConceptSpecializationExpr * - Create(ASTContext &C, EmptyShell Empty, unsigned NumTemplateArgs); - - ArrayRef getTemplateArguments() const { - return ArrayRef(getTrailingObjects(), - NumTemplateArgs); - } - - /// \brief Set new template arguments for this concept specialization. - void setTemplateArguments(ArrayRef Converted); - - /// \brief Whether or not the concept with the given arguments was satisfied - /// when the expression was created. - /// The expression must not be dependent. - bool isSatisfied() const { - assert(!isValueDependent() - && "isSatisfied called on a dependent ConceptSpecializationExpr"); - return Satisfaction->IsSatisfied; - } - - /// \brief Get elaborated satisfaction info about the template arguments' - /// satisfaction of the named concept. - /// The expression must not be dependent. - const ASTConstraintSatisfaction &getSatisfaction() const { - assert(!isValueDependent() - && "getSatisfaction called on dependent ConceptSpecializationExpr"); - return *Satisfaction; - } - - static bool classof(const Stmt *T) { - return T->getStmtClass() == ConceptSpecializationExprClass; - } - - SourceLocation getBeginLoc() const LLVM_READONLY { - return ConceptName.getBeginLoc(); - } - - SourceLocation getEndLoc() const LLVM_READONLY { - return ArgsAsWritten->RAngleLoc; - } - - // Iterators - child_range children() { - return child_range(child_iterator(), child_iterator()); - } - const_child_range children() const { - return const_child_range(const_child_iterator(), const_child_iterator()); } }; Added: vendor/llvm-project/release-10.x/clang/include/clang/AST/ExprConcepts.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm-project/release-10.x/clang/include/clang/AST/ExprConcepts.h Fri Jan 24 22:11:32 2020 (r357097) @@ -0,0 +1,540 @@ +//===- ExprConcepts.h - C++2a Concepts expressions --------------*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +/// \file +/// Defines Expressions and AST nodes for C++2a concepts. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_AST_EXPRCONCEPTS_H +#define LLVM_CLANG_AST_EXPRCONCEPTS_H + +#include "clang/AST/ASTContext.h" +#include "clang/AST/ASTConcept.h" +#include "clang/AST/Decl.h" +#include "clang/AST/DeclarationName.h" +#include "clang/AST/DeclTemplate.h" +#include "clang/AST/Expr.h" +#include "clang/AST/NestedNameSpecifier.h" +#include "clang/AST/TemplateBase.h" +#include "clang/AST/Type.h" +#include "clang/Basic/SourceLocation.h" +#include "llvm/Support/TrailingObjects.h" +#include +#include + +namespace clang { +class ASTStmtReader; +class ASTStmtWriter; + +/// \brief Represents the specialization of a concept - evaluates to a prvalue +/// of type bool. +/// +/// According to C++2a [expr.prim.id]p3 an id-expression that denotes the +/// specialization of a concept results in a prvalue of type bool. +class ConceptSpecializationExpr final : public Expr, public ConceptReference, + private llvm::TrailingObjects { + friend class ASTStmtReader; + friend TrailingObjects; +public: + using SubstitutionDiagnostic = std::pair; + +protected: + /// \brief The number of template arguments in the tail-allocated list of + /// converted template arguments. + unsigned NumTemplateArgs; + + /// \brief Information about the satisfaction of the named concept with the + /// given arguments. If this expression is value dependent, this is to be + /// ignored. + ASTConstraintSatisfaction *Satisfaction; + + ConceptSpecializationExpr(const ASTContext &C, NestedNameSpecifierLoc NNS, + SourceLocation TemplateKWLoc, + DeclarationNameInfo ConceptNameInfo, + NamedDecl *FoundDecl, ConceptDecl *NamedConcept, + const ASTTemplateArgumentListInfo *ArgsAsWritten, + ArrayRef ConvertedArgs, + const ConstraintSatisfaction *Satisfaction); + + ConceptSpecializationExpr(EmptyShell Empty, unsigned NumTemplateArgs); + +public: + + static ConceptSpecializationExpr * + Create(const ASTContext &C, NestedNameSpecifierLoc NNS, + SourceLocation TemplateKWLoc, DeclarationNameInfo ConceptNameInfo, + NamedDecl *FoundDecl, ConceptDecl *NamedConcept, + const ASTTemplateArgumentListInfo *ArgsAsWritten, + ArrayRef ConvertedArgs, + const ConstraintSatisfaction *Satisfaction); + + static ConceptSpecializationExpr * + Create(ASTContext &C, EmptyShell Empty, unsigned NumTemplateArgs); + + ArrayRef getTemplateArguments() const { + return ArrayRef(getTrailingObjects(), + NumTemplateArgs); + } + + /// \brief Set new template arguments for this concept specialization. + void setTemplateArguments(ArrayRef Converted); + + /// \brief Whether or not the concept with the given arguments was satisfied + /// when the expression was created. + /// The expression must not be dependent. + bool isSatisfied() const { + assert(!isValueDependent() + && "isSatisfied called on a dependent ConceptSpecializationExpr"); + return Satisfaction->IsSatisfied; + } + + /// \brief Get elaborated satisfaction info about the template arguments' + /// satisfaction of the named concept. + /// The expression must not be dependent. + const ASTConstraintSatisfaction &getSatisfaction() const { + assert(!isValueDependent() + && "getSatisfaction called on dependent ConceptSpecializationExpr"); + return *Satisfaction; + } + + static bool classof(const Stmt *T) { + return T->getStmtClass() == ConceptSpecializationExprClass; + } + + SourceLocation getBeginLoc() const LLVM_READONLY { + return ConceptName.getBeginLoc(); + } + + SourceLocation getEndLoc() const LLVM_READONLY { + return ArgsAsWritten->RAngleLoc; + } + + // Iterators + child_range children() { + return child_range(child_iterator(), child_iterator()); + } + const_child_range children() const { + return const_child_range(const_child_iterator(), const_child_iterator()); + } +}; + +namespace concepts { + +/// \brief A static requirement that can be used in a requires-expression to +/// check properties of types and expression. +class Requirement { +public: + // Note - simple and compound requirements are both represented by the same + // class (ExprRequirement). + enum RequirementKind { RK_Type, RK_Simple, RK_Compound, RK_Nested }; +private: + const RequirementKind Kind; + bool Dependent : 1; + bool ContainsUnexpandedParameterPack : 1; + bool Satisfied : 1; +public: + struct SubstitutionDiagnostic { + StringRef SubstitutedEntity; + // FIXME: Store diagnostics semantically and not as prerendered strings. + // Fixing this probably requires serialization of PartialDiagnostic + // objects. + SourceLocation DiagLoc; + StringRef DiagMessage; + }; + + Requirement(RequirementKind Kind, bool IsDependent, + bool ContainsUnexpandedParameterPack, bool IsSatisfied = true) : + Kind(Kind), Dependent(IsDependent), + ContainsUnexpandedParameterPack(ContainsUnexpandedParameterPack), + Satisfied(IsSatisfied) {} + + RequirementKind getKind() const { return Kind; } + + bool isSatisfied() const { + assert(!Dependent && + "isSatisfied can only be called on non-dependent requirements."); + return Satisfied; + } + + void setSatisfied(bool IsSatisfied) { + assert(!Dependent && + "setSatisfied can only be called on non-dependent requirements."); + Satisfied = IsSatisfied; + } + + void setDependent(bool IsDependent) { Dependent = IsDependent; } + bool isDependent() const { return Dependent; } + + void setContainsUnexpandedParameterPack(bool Contains) { + ContainsUnexpandedParameterPack = Contains; + } + bool containsUnexpandedParameterPack() const { + return ContainsUnexpandedParameterPack; + } +}; + +/// \brief A requires-expression requirement which queries the existence of a +/// type name or type template specialization ('type' requirements). +class TypeRequirement : public Requirement { +public: + enum SatisfactionStatus { + SS_Dependent, + SS_SubstitutionFailure, + SS_Satisfied + }; +private: + llvm::PointerUnion Value; + SatisfactionStatus Status; +public: + friend ASTStmtReader; + friend ASTStmtWriter; + + /// \brief Construct a type requirement from a type. If the given type is not + /// dependent, this indicates that the type exists and the requirement will be + /// satisfied. Otherwise, the SubstitutionDiagnostic constructor is to be + /// used. + TypeRequirement(TypeSourceInfo *T); + + /// \brief Construct a type requirement when the nested name specifier is + /// invalid due to a bad substitution. The requirement is unsatisfied. + TypeRequirement(SubstitutionDiagnostic *Diagnostic) : + Requirement(RK_Type, false, false, false), Value(Diagnostic), + Status(SS_SubstitutionFailure) {} + + SatisfactionStatus getSatisfactionStatus() const { return Status; } + void setSatisfactionStatus(SatisfactionStatus Status) { + this->Status = Status; + } + + bool isSubstitutionFailure() const { + return Status == SS_SubstitutionFailure; + } + + SubstitutionDiagnostic *getSubstitutionDiagnostic() const { + assert(Status == SS_SubstitutionFailure && + "Attempted to get substitution diagnostic when there has been no " + "substitution failure."); + return Value.get(); + } + + TypeSourceInfo *getType() const { + assert(!isSubstitutionFailure() && + "Attempted to get type when there has been a substitution failure."); + return Value.get(); + } + + static bool classof(const Requirement *R) { + return R->getKind() == RK_Type; + } +}; + +/// \brief A requires-expression requirement which queries the validity and +/// properties of an expression ('simple' and 'compound' requirements). +class ExprRequirement : public Requirement { +public: + enum SatisfactionStatus { + SS_Dependent, + SS_ExprSubstitutionFailure, + SS_NoexceptNotMet, + SS_TypeRequirementSubstitutionFailure, + SS_ConstraintsNotSatisfied, + SS_Satisfied + }; + class ReturnTypeRequirement { + llvm::PointerIntPair< + llvm::PointerUnion, + 1, bool> + TypeConstraintInfo; + public: + friend ASTStmtReader; + friend ASTStmtWriter; + + /// \brief No return type requirement was specified. + ReturnTypeRequirement() : TypeConstraintInfo(nullptr, 0) {} + + /// \brief A return type requirement was specified but it was a + /// substitution failure. + ReturnTypeRequirement(SubstitutionDiagnostic *SubstDiag) : + TypeConstraintInfo(SubstDiag, 0) {} + + /// \brief A 'type constraint' style return type requirement. + /// \param TPL an invented template parameter list containing a single + /// type parameter with a type-constraint. + // TODO: Can we maybe not save the whole template parameter list and just + // the type constraint? Saving the whole TPL makes it easier to handle in + // serialization but is less elegant. + ReturnTypeRequirement(TemplateParameterList *TPL); + + bool isDependent() const { + return TypeConstraintInfo.getInt(); + } + + bool containsUnexpandedParameterPack() const { + if (!isTypeConstraint()) + return false; + return getTypeConstraintTemplateParameterList() + ->containsUnexpandedParameterPack(); + } + + bool isEmpty() const { + return TypeConstraintInfo.getPointer().isNull(); + } + + bool isSubstitutionFailure() const { + return !isEmpty() && + TypeConstraintInfo.getPointer().is(); + } + + bool isTypeConstraint() const { + return !isEmpty() && + TypeConstraintInfo.getPointer().is(); + } + + SubstitutionDiagnostic *getSubstitutionDiagnostic() const { + assert(isSubstitutionFailure()); + return TypeConstraintInfo.getPointer().get(); + } + + const TypeConstraint *getTypeConstraint() const; + + TemplateParameterList *getTypeConstraintTemplateParameterList() const { + assert(isTypeConstraint()); + return TypeConstraintInfo.getPointer().get(); + } + }; +private: + llvm::PointerUnion Value; + SourceLocation NoexceptLoc; // May be empty if noexcept wasn't specified. + ReturnTypeRequirement TypeReq; + ConceptSpecializationExpr *SubstitutedConstraintExpr; + SatisfactionStatus Status; +public: + friend ASTStmtReader; + friend ASTStmtWriter; + + /// \brief Construct a compound requirement. + /// \param E the expression which is checked by this requirement. + /// \param IsSimple whether this was a simple requirement in source. + /// \param NoexceptLoc the location of the noexcept keyword, if it was + /// specified, otherwise an empty location. + /// \param Req the requirement for the type of the checked expression. + /// \param Status the satisfaction status of this requirement. + ExprRequirement( + Expr *E, bool IsSimple, SourceLocation NoexceptLoc, + ReturnTypeRequirement Req, SatisfactionStatus Status, + ConceptSpecializationExpr *SubstitutedConstraintExpr = nullptr); + + /// \brief Construct a compound requirement whose expression was a + /// substitution failure. The requirement is not satisfied. + /// \param E the diagnostic emitted while instantiating the original + /// expression. + /// \param IsSimple whether this was a simple requirement in source. + /// \param NoexceptLoc the location of the noexcept keyword, if it was + /// specified, otherwise an empty location. + /// \param Req the requirement for the type of the checked expression (omit + /// if no requirement was specified). + ExprRequirement(SubstitutionDiagnostic *E, bool IsSimple, + SourceLocation NoexceptLoc, ReturnTypeRequirement Req = {}); + + bool isSimple() const { return getKind() == RK_Simple; } + bool isCompound() const { return getKind() == RK_Compound; } + + bool hasNoexceptRequirement() const { return NoexceptLoc.isValid(); } + SourceLocation getNoexceptLoc() const { return NoexceptLoc; } + + SatisfactionStatus getSatisfactionStatus() const { return Status; } + + bool isExprSubstitutionFailure() const { + return Status == SS_ExprSubstitutionFailure; + } + + const ReturnTypeRequirement &getReturnTypeRequirement() const { + return TypeReq; + } + + ConceptSpecializationExpr * + getReturnTypeRequirementSubstitutedConstraintExpr() const { + assert(Status >= SS_TypeRequirementSubstitutionFailure); + return SubstitutedConstraintExpr; + } + + SubstitutionDiagnostic *getExprSubstitutionDiagnostic() const { + assert(isExprSubstitutionFailure() && + "Attempted to get expression substitution diagnostic when there has " + "been no expression substitution failure"); + return Value.get(); + } + + Expr *getExpr() const { + assert(!isExprSubstitutionFailure() && + "ExprRequirement has no expression because there has been a " + "substitution failure."); + return Value.get(); + } + + static bool classof(const Requirement *R) { + return R->getKind() == RK_Compound || R->getKind() == RK_Simple; + } +}; + +/// \brief A requires-expression requirement which is satisfied when a general +/// constraint expression is satisfied ('nested' requirements). +class NestedRequirement : public Requirement { + llvm::PointerUnion Value; + const ASTConstraintSatisfaction *Satisfaction = nullptr; + +public: + friend ASTStmtReader; + friend ASTStmtWriter; + + NestedRequirement(SubstitutionDiagnostic *SubstDiag) : + Requirement(RK_Nested, /*Dependent=*/false, + /*ContainsUnexpandedParameterPack*/false, + /*Satisfied=*/false), Value(SubstDiag) {} + + NestedRequirement(Expr *Constraint) : + Requirement(RK_Nested, /*Dependent=*/true, + Constraint->containsUnexpandedParameterPack()), + Value(Constraint) { + assert(Constraint->isInstantiationDependent() && + "Nested requirement with non-dependent constraint must be " + "constructed with a ConstraintSatisfaction object"); + } + + NestedRequirement(ASTContext &C, Expr *Constraint, + const ConstraintSatisfaction &Satisfaction) : + Requirement(RK_Nested, Constraint->isInstantiationDependent(), + Constraint->containsUnexpandedParameterPack(), + Satisfaction.IsSatisfied), + Value(Constraint), + Satisfaction(ASTConstraintSatisfaction::Create(C, Satisfaction)) {} + + bool isSubstitutionFailure() const { + return Value.is(); + } + + SubstitutionDiagnostic *getSubstitutionDiagnostic() const { + assert(isSubstitutionFailure() && + "getSubstitutionDiagnostic() may not be called when there was no " + "substitution failure."); + return Value.get(); + } + + Expr *getConstraintExpr() const { + assert(!isSubstitutionFailure() && "getConstraintExpr() may not be called " + "on nested requirements with " + "substitution failures."); + return Value.get(); + } + + const ASTConstraintSatisfaction &getConstraintSatisfaction() const { + assert(!isSubstitutionFailure() && "getConstraintSatisfaction() may not be " + "called on nested requirements with " + "substitution failures."); + return *Satisfaction; + } + + static bool classof(const Requirement *R) { + return R->getKind() == RK_Nested; + } +}; + +} // namespace concepts + +/// C++2a [expr.prim.req]: +/// A requires-expression provides a concise way to express requirements on +/// template arguments. A requirement is one that can be checked by name +/// lookup (6.4) or by checking properties of types and expressions. +/// [...] +/// A requires-expression is a prvalue of type bool [...] +class RequiresExpr final : public Expr, + llvm::TrailingObjects { + friend TrailingObjects; + friend class ASTStmtReader; + + unsigned NumLocalParameters; + unsigned NumRequirements; + RequiresExprBodyDecl *Body; + SourceLocation RBraceLoc; + + unsigned numTrailingObjects(OverloadToken) const { + return NumLocalParameters; + } + + unsigned numTrailingObjects(OverloadToken) const { + return NumRequirements; + } + + RequiresExpr(ASTContext &C, SourceLocation RequiresKWLoc, + RequiresExprBodyDecl *Body, + ArrayRef LocalParameters, + ArrayRef Requirements, + SourceLocation RBraceLoc); + RequiresExpr(ASTContext &C, EmptyShell Empty, unsigned NumLocalParameters, + unsigned NumRequirements); + +public: + static RequiresExpr * + Create(ASTContext &C, SourceLocation RequiresKWLoc, + RequiresExprBodyDecl *Body, ArrayRef LocalParameters, + ArrayRef Requirements, + SourceLocation RBraceLoc); + static RequiresExpr * + Create(ASTContext &C, EmptyShell Empty, unsigned NumLocalParameters, + unsigned NumRequirements); + + ArrayRef getLocalParameters() const { + return {getTrailingObjects(), NumLocalParameters}; + } + + RequiresExprBodyDecl *getBody() const { return Body; } + + ArrayRef getRequirements() const { + return {getTrailingObjects(), NumRequirements}; + } + + /// \brief Whether or not the requires clause is satisfied. + /// The expression must not be dependent. + bool isSatisfied() const { + assert(!isValueDependent() + && "isSatisfied called on a dependent RequiresExpr"); + return RequiresExprBits.IsSatisfied; + } + + SourceLocation getRequiresKWLoc() const { + return RequiresExprBits.RequiresKWLoc; + } + + SourceLocation getRBraceLoc() const { return RBraceLoc; } + + static bool classof(const Stmt *T) { + return T->getStmtClass() == RequiresExprClass; + } + + SourceLocation getBeginLoc() const LLVM_READONLY { + return RequiresExprBits.RequiresKWLoc; + } + SourceLocation getEndLoc() const LLVM_READONLY { + return RBraceLoc; + } + + // Iterators + child_range children() { + return child_range(child_iterator(), child_iterator()); + } + const_child_range children() const { + return const_child_range(const_child_iterator(), const_child_iterator()); + } +}; + +} // namespace clang + +#endif // LLVM_CLANG_AST_EXPRCONCEPTS_H \ No newline at end of file Modified: vendor/llvm-project/release-10.x/clang/include/clang/AST/PropertiesBase.td ============================================================================== --- vendor/llvm-project/release-10.x/clang/include/clang/AST/PropertiesBase.td Fri Jan 24 22:04:02 2020 (r357096) +++ vendor/llvm-project/release-10.x/clang/include/clang/AST/PropertiesBase.td Fri Jan 24 22:11:32 2020 (r357097) @@ -99,6 +99,8 @@ def DeclRef : RefPropertyType<"Decl"> { let ConstWhenW SubclassPropertyType<"TagDecl", DeclRef>; def TemplateDeclRef : SubclassPropertyType<"TemplateDecl", DeclRef>; + def ConceptDeclRef : + SubclassPropertyType<"ConceptDecl", DeclRef>; def TemplateTypeParmDeclRef : SubclassPropertyType<"TemplateTypeParmDecl", DeclRef>; def TemplateTemplateParmDeclRef : Modified: vendor/llvm-project/release-10.x/clang/include/clang/AST/RecursiveASTVisitor.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/include/clang/AST/RecursiveASTVisitor.h Fri Jan 24 22:04:02 2020 (r357096) +++ vendor/llvm-project/release-10.x/clang/include/clang/AST/RecursiveASTVisitor.h Fri Jan 24 22:11:32 2020 (r357097) @@ -23,6 +23,7 @@ #include "clang/AST/DeclOpenMP.h" #include "clang/AST/DeclTemplate.h" #include "clang/AST/Expr.h" +#include "clang/AST/ExprConcepts.h" #include "clang/AST/ExprCXX.h" #include "clang/AST/ExprObjC.h" #include "clang/AST/ExprOpenMP.h" @@ -1039,7 +1040,13 @@ DEF_TRAVERSE_TYPE(UnaryTransformType, { TRY_TO(TraverseType(T->getUnderlyingType())); }) -DEF_TRAVERSE_TYPE(AutoType, { TRY_TO(TraverseType(T->getDeducedType())); }) +DEF_TRAVERSE_TYPE(AutoType, { + TRY_TO(TraverseType(T->getDeducedType())); + if (T->isConstrained()) { + TRY_TO(TraverseDecl(T->getTypeConstraintConcept())); + TRY_TO(TraverseTemplateArguments(T->getArgs(), T->getNumArgs())); + } +}) DEF_TRAVERSE_TYPE(DeducedTemplateSpecializationType, { TRY_TO(TraverseTemplateName(T->getTemplateName())); TRY_TO(TraverseType(T->getDeducedType())); @@ -1286,6 +1293,12 @@ DEF_TRAVERSE_TYPELOC(UnaryTransformType, { DEF_TRAVERSE_TYPELOC(AutoType, { TRY_TO(TraverseType(TL.getTypePtr()->getDeducedType())); + if (TL.isConstrained()) { + TRY_TO(TraverseNestedNameSpecifierLoc(TL.getNestedNameSpecifierLoc())); + TRY_TO(TraverseDeclarationNameInfo(TL.getConceptNameInfo())); + for (unsigned I = 0, E = TL.getNumArgs(); I != E; ++I) + TRY_TO(TraverseTemplateArgumentLoc(TL.getArgLoc(I))); + } }) DEF_TRAVERSE_TYPELOC(DeducedTemplateSpecializationType, { @@ -2138,6 +2151,8 @@ DEF_TRAVERSE_DECL(ParmVarDecl, { TRY_TO(TraverseStmt(D->getDefaultArg())); }) +DEF_TRAVERSE_DECL(RequiresExprBodyDecl, {}) + #undef DEF_TRAVERSE_DECL // ----------------- Stmt traversal ----------------- @@ -2707,6 +2722,28 @@ DEF_TRAVERSE_STMT(CoyieldExpr, { DEF_TRAVERSE_STMT(ConceptSpecializationExpr, { TRY_TO(TraverseConceptReference(*S)); +}) + +DEF_TRAVERSE_STMT(RequiresExpr, { + TRY_TO(TraverseDecl(S->getBody())); + for (ParmVarDecl *Parm : S->getLocalParameters()) + TRY_TO(TraverseDecl(Parm)); + for (concepts::Requirement *Req : S->getRequirements()) + if (auto *TypeReq = dyn_cast(Req)) { + if (!TypeReq->isSubstitutionFailure()) + TRY_TO(TraverseTypeLoc(TypeReq->getType()->getTypeLoc())); + } else if (auto *ExprReq = dyn_cast(Req)) { + if (!ExprReq->isExprSubstitutionFailure()) + TRY_TO(TraverseStmt(ExprReq->getExpr())); + auto &RetReq = ExprReq->getReturnTypeRequirement(); + if (RetReq.isTypeConstraint()) + TRY_TO(TraverseTemplateParameterListHelper( + RetReq.getTypeConstraintTemplateParameterList())); + } else { + auto *NestedReq = cast(Req); + if (!NestedReq->isSubstitutionFailure()) + TRY_TO(TraverseStmt(NestedReq->getConstraintExpr())); + } }) // These literals (all of them) do not need any action. Modified: vendor/llvm-project/release-10.x/clang/include/clang/AST/Stmt.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/include/clang/AST/Stmt.h Fri Jan 24 22:04:02 2020 (r357096) +++ vendor/llvm-project/release-10.x/clang/include/clang/AST/Stmt.h Fri Jan 24 22:11:32 2020 (r357097) @@ -910,6 +910,17 @@ class alignas(void *) Stmt { (protected) SourceLocation NameLoc; }; + class RequiresExprBitfields { + friend class ASTStmtReader; + friend class ASTStmtWriter; + friend class RequiresExpr; + + unsigned : NumExprBits; + + unsigned IsSatisfied : 1; + SourceLocation RequiresKWLoc; + }; + //===--- C++ Coroutines TS bitfields classes ---===// class CoawaitExprBitfields { @@ -1008,6 +1019,7 @@ class alignas(void *) Stmt { (protected) UnresolvedMemberExprBitfields UnresolvedMemberExprBits; CXXNoexceptExprBitfields CXXNoexceptExprBits; SubstNonTypeTemplateParmExprBitfields SubstNonTypeTemplateParmExprBits; + RequiresExprBitfields RequiresExprBits; // C++ Coroutines TS expressions CoawaitExprBitfields CoawaitBits; Modified: vendor/llvm-project/release-10.x/clang/include/clang/AST/StmtVisitor.h ============================================================================== --- vendor/llvm-project/release-10.x/clang/include/clang/AST/StmtVisitor.h Fri Jan 24 22:04:02 2020 (r357096) +++ vendor/llvm-project/release-10.x/clang/include/clang/AST/StmtVisitor.h Fri Jan 24 22:11:32 2020 (r357097) @@ -13,6 +13,7 @@ #ifndef LLVM_CLANG_AST_STMTVISITOR_H #define LLVM_CLANG_AST_STMTVISITOR_H *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jan 24 22:13:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8ECB91FD8BA; Fri, 24 Jan 2020 22:13:09 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 484D113DzQz4d3q; Fri, 24 Jan 2020 22:13:09 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50CCC2E092; Fri, 24 Jan 2020 22:13:09 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00OMD9w0040274; Fri, 24 Jan 2020 22:13:09 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OMD9B7040273; Fri, 24 Jan 2020 22:13:09 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202001242213.00OMD9B7040273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 24 Jan 2020 22:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r357098 - vendor/llvm-project/llvmorg-10-init-17538-gd11abddb32f X-SVN-Group: vendor X-SVN-Commit-Author: dim X-SVN-Commit-Paths: vendor/llvm-project/llvmorg-10-init-17538-gd11abddb32f X-SVN-Commit-Revision: 357098 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 22:13:09 -0000 Author: dim Date: Fri Jan 24 22:13:08 2020 New Revision: 357098 URL: https://svnweb.freebsd.org/changeset/base/357098 Log: Tag llvm-project release/10.x llvmorg-10-init-17538-gd11abddb32f. Added: vendor/llvm-project/llvmorg-10-init-17538-gd11abddb32f/ - copied from r357097, vendor/llvm-project/release-10.x/ From owner-svn-src-all@freebsd.org Fri Jan 24 22:37:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 68ED91FE489; Fri, 24 Jan 2020 22:37:54 +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 484DYZ29jDz4fBR; Fri, 24 Jan 2020 22:37: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 412B12E41F; Fri, 24 Jan 2020 22:37: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 00OMbsUo052599; Fri, 24 Jan 2020 22:37:54 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OMbreZ052597; Fri, 24 Jan 2020 22:37:53 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202001242237.00OMbreZ052597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 24 Jan 2020 22:37:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357100 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 357100 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 22:37:54 -0000 Author: tuexen Date: Fri Jan 24 22:37:53 2020 New Revision: 357100 URL: https://svnweb.freebsd.org/changeset/base/357100 Log: The server side of TCP fast open relies on the delayed ACK timer to allow including user data in the SYN-ACK. When DSACK support was added in r347382, an immediate ACK was sent even for the received SYN with user data. This patch fixes that and allows again to send user data with the SYN-ACK. Reported by: Jeremy Harris Reviewed by: Richard Scheffenegger, rrs@ MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D23212 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_stacks/rack_bbr_common.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Fri Jan 24 22:15:36 2020 (r357099) +++ head/sys/netinet/tcp_input.c Fri Jan 24 22:37:53 2020 (r357100) @@ -2226,7 +2226,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru /* * DSACK - add SACK block for dropped range */ - if (tp->t_flags & TF_SACK_PERMIT) { + if ((todrop > 0) && (tp->t_flags & TF_SACK_PERMIT)) { tcp_update_sack_list(tp, th->th_seq, th->th_seq + todrop); /* Modified: head/sys/netinet/tcp_stacks/rack_bbr_common.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack_bbr_common.c Fri Jan 24 22:15:36 2020 (r357099) +++ head/sys/netinet/tcp_stacks/rack_bbr_common.c Fri Jan 24 22:37:53 2020 (r357100) @@ -548,7 +548,7 @@ ctf_drop_checks(struct tcpopt *to, struct mbuf *m, str /* * DSACK - add SACK block for dropped range */ - if (tp->t_flags & TF_SACK_PERMIT) { + if ((todrop > 0) && (tp->t_flags & TF_SACK_PERMIT)) { tcp_update_sack_list(tp, th->th_seq, th->th_seq + todrop); /* From owner-svn-src-all@freebsd.org Fri Jan 24 22:50:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B76121FE8FC; Fri, 24 Jan 2020 22:50:24 +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 484Dr04Mnqz4fjm; Fri, 24 Jan 2020 22:50: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 911CC2E60A; Fri, 24 Jan 2020 22:50: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 00OMoO7M058656; Fri, 24 Jan 2020 22:50:24 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00OMoOPP058654; Fri, 24 Jan 2020 22:50:24 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202001242250.00OMoOPP058654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 24 Jan 2020 22:50:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357101 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 357101 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 24 Jan 2020 22:50:24 -0000 Author: tuexen Date: Fri Jan 24 22:50:23 2020 New Revision: 357101 URL: https://svnweb.freebsd.org/changeset/base/357101 Log: Don't delay the ACK for a TCP segment with the CWR flag set. This allows the data sender to increase the CWND faster. Submitted by: Richard Scheffenegger Reviewed by: rgrimes@, tuexen@, Cheng Cui MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22670 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Fri Jan 24 22:37:53 2020 (r357100) +++ head/sys/netinet/tcp_input.c Fri Jan 24 22:50:23 2020 (r357101) @@ -1545,8 +1545,10 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru * TCP ECN processing. */ if (tp->t_flags2 & TF2_ECN_PERMIT) { - if (thflags & TH_CWR) + if (thflags & TH_CWR) { tp->t_flags2 &= ~TF2_ECN_SND_ECE; + tp->t_flags |= TF_ACKNOW; + } switch (iptos & IPTOS_ECN_MASK) { case IPTOS_ECN_CE: tp->t_flags2 |= TF2_ECN_SND_ECE; Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Fri Jan 24 22:37:53 2020 (r357100) +++ head/sys/netinet/tcp_stacks/rack.c Fri Jan 24 22:50:23 2020 (r357101) @@ -7701,8 +7701,10 @@ rack_do_segment_nounlock(struct mbuf *m, struct tcphdr * this to occur after we've validated the segment. */ if (tp->t_flags2 & TF2_ECN_PERMIT) { - if (thflags & TH_CWR) + if (thflags & TH_CWR) { tp->t_flags2 &= ~TF2_ECN_SND_ECE; + tp->t_flags |= TF_ACKNOW; + } switch (iptos & IPTOS_ECN_MASK) { case IPTOS_ECN_CE: tp->t_flags2 |= TF2_ECN_SND_ECE; From owner-svn-src-all@freebsd.org Sat Jan 25 00:06:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A50A1228A84; Sat, 25 Jan 2020 00:06:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 484GWZ3qGRz3FwH; Sat, 25 Jan 2020 00:06:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E84F2F48B; Sat, 25 Jan 2020 00:06:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00P06ITQ006233; Sat, 25 Jan 2020 00:06:18 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00P06IQH006232; Sat, 25 Jan 2020 00:06:18 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001250006.00P06IQH006232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sat, 25 Jan 2020 00:06:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357102 - head/sys/dev/mlx4/mlx4_en X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/dev/mlx4/mlx4_en X-SVN-Commit-Revision: 357102 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 25 Jan 2020 00:06:18 -0000 Author: glebius Date: Sat Jan 25 00:06:18 2020 New Revision: 357102 URL: https://svnweb.freebsd.org/changeset/base/357102 Log: Enter the network epoch in RX processing taskqueue. Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c ============================================================================== --- head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c Fri Jan 24 22:50:23 2020 (r357101) +++ head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c Sat Jan 25 00:06:18 2020 (r357102) @@ -895,6 +895,7 @@ void mlx4_en_rx_irq(struct mlx4_cq *mcq) void mlx4_en_rx_que(void *context, int pending) { + struct epoch_tracker et; struct mlx4_en_cq *cq; struct thread *td; @@ -905,8 +906,10 @@ void mlx4_en_rx_que(void *context, int pending) sched_bind(td, cq->curr_poll_rx_cpu_id); thread_unlock(td); + NET_EPOCH_ENTER(et); while (mlx4_en_poll_rx_cq(cq, MLX4_EN_RX_BUDGET) == MLX4_EN_RX_BUDGET); + NET_EPOCH_EXIT(et); mlx4_en_arm_cq(cq->dev->if_softc, cq); } From owner-svn-src-all@freebsd.org Sat Jan 25 03:02:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C21C622EE60; Sat, 25 Jan 2020 03:02:45 +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 484LR94lS7z3QK9; Sat, 25 Jan 2020 03:02:45 +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 9E2C216C7; Sat, 25 Jan 2020 03:02:45 +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 00P32jBf013821; Sat, 25 Jan 2020 03:02:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00P32jhW013820; Sat, 25 Jan 2020 03:02:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001250302.00P32jhW013820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 25 Jan 2020 03:02:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357103 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 357103 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 25 Jan 2020 03:02:45 -0000 Author: kevans Date: Sat Jan 25 03:02:45 2020 New Revision: 357103 URL: https://svnweb.freebsd.org/changeset/base/357103 Log: loader.lua: re-arrange to load local.lua *after* config loading The major problem with the current ordering is that loader.conf may contain all of the magic we need to actually setup the console, so loading local.lua prior to that can make it excessively difficult and annoying to debug (whoops, sorry Ravi & Warner). The new ordering has some implications, but I suspect they are a non-issue. The first is that it's no longer possible for the local module to inject any logic prior to loading config -- I suspect no one has relied on this. The second implication is that the config.loaded hook is now useless, as the local module will always be included after that hook would have fired. For config.loaded, I will opt to leave it in, just in case we add an early point for local lua to get injected or in case one wants to schedule some deferred logic in a custom loader.lua. The overhead of having it if no hooks will be invoked is relatively minimal. Diagnosed by: imp Reported by: imp, rpokala (most likely) MFC after: 3 days Modified: head/stand/lua/loader.lua Modified: head/stand/lua/loader.lua ============================================================================== --- head/stand/lua/loader.lua Sat Jan 25 00:06:18 2020 (r357102) +++ head/stand/lua/loader.lua Sat Jan 25 03:02:45 2020 (r357103) @@ -42,14 +42,14 @@ local password = require("password") -- need it. local menu -try_include("local") - config.load() + -- Our console may have been setup for a different color scheme before we get -- here, so make sure we set the default. if color.isEnabled() then printc(color.default()) end +try_include("local") if not core.isMenuSkipped() then menu = require("menu") end From owner-svn-src-all@freebsd.org Sat Jan 25 03:52:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 862B62311CC; Sat, 25 Jan 2020 03:52:17 +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 484MXK2xTmz40g2; Sat, 25 Jan 2020 03:52:17 +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 602902040; Sat, 25 Jan 2020 03:52:17 +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 00P3qHQ6044032; Sat, 25 Jan 2020 03:52:17 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00P3qHbs044031; Sat, 25 Jan 2020 03:52:17 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001250352.00P3qHbs044031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 25 Jan 2020 03:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357104 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 357104 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 25 Jan 2020 03:52:17 -0000 Author: kevans Date: Sat Jan 25 03:52:16 2020 New Revision: 357104 URL: https://svnweb.freebsd.org/changeset/base/357104 Log: lua: add modules.loaded hook This may be used for the local module to hook in and load any additional modules that it wants, since it can't modify the modules table internal to config. We may consider adding API to do so at a later time, but I suspect it will be more complicated to use with little return. status is captured but ignored for the purpose of loading the hook. status will be false if *any* module failed to load, but we typically don't let that halt the boot so there's no reason to let it halt hooks. Some vendors or setups may have expected fails that would be actively thwarted by checking it. We may, at a later date, consider adding an API for letting non-config modules check which modules have successfully (or not) loaded in case an unexpected failure *should* halt whatever they are doing. MFC after: 3 days Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Sat Jan 25 03:02:45 2020 (r357103) +++ head/stand/lua/config.lua Sat Jan 25 03:52:16 2020 (r357104) @@ -623,7 +623,7 @@ end function config.loadelf() local xen_kernel = loader.getenv('xen_kernel') local kernel = config.kernel_selected or config.kernel_loaded - local loaded + local loaded, status if xen_kernel ~= nil then print(MSG_XENKERNLOADING) @@ -640,9 +640,12 @@ function config.loadelf() end print(MSG_MODLOADING) - return loadModule(modules, not config.verbose) + status = loadModule(modules, not config.verbose) + hook.runAll("modules.loaded") + return status end hook.registerType("config.loaded") hook.registerType("config.reloaded") +hook.registerType("modules.loaded") return config From owner-svn-src-all@freebsd.org Sat Jan 25 04:48:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9371A232786; Sat, 25 Jan 2020 04:48:48 +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 484NnX3K7Bz449M; Sat, 25 Jan 2020 04:48:48 +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 546F22B99; Sat, 25 Jan 2020 04:48:48 +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 00P4mmdJ074548; Sat, 25 Jan 2020 04:48:48 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00P4mkS1074538; Sat, 25 Jan 2020 04:48:46 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001250448.00P4mkS1074538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 25 Jan 2020 04:48:46 +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: r357105 - in stable/11/sys: amd64/linux amd64/linux32 compat/cloudabi32 compat/cloudabi64 compat/freebsd32 compat/svr4 i386/ibcs2 i386/linux kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/sys: amd64/linux amd64/linux32 compat/cloudabi32 compat/cloudabi64 compat/freebsd32 compat/svr4 i386/ibcs2 i386/linux kern X-SVN-Commit-Revision: 357105 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 25 Jan 2020 04:48:48 -0000 Author: kevans Date: Sat Jan 25 04:48:46 2020 New Revision: 357105 URL: https://svnweb.freebsd.org/changeset/base/357105 Log: MFC r328560: Don't use an .OBJDIR for 'make sysent'. Modified: stable/11/sys/amd64/linux/Makefile stable/11/sys/amd64/linux32/Makefile stable/11/sys/compat/cloudabi32/Makefile stable/11/sys/compat/cloudabi64/Makefile stable/11/sys/compat/freebsd32/Makefile stable/11/sys/compat/svr4/Makefile stable/11/sys/i386/ibcs2/Makefile stable/11/sys/i386/linux/Makefile stable/11/sys/kern/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/Makefile ============================================================================== --- stable/11/sys/amd64/linux/Makefile Sat Jan 25 03:52:16 2020 (r357104) +++ stable/11/sys/amd64/linux/Makefile Sat Jan 25 04:48:46 2020 (r357105) @@ -2,6 +2,9 @@ # # $FreeBSD$ +# Don't use an OBJDIR +.OBJDIR: ${.CURDIR} + all: @echo "make sysent only" Modified: stable/11/sys/amd64/linux32/Makefile ============================================================================== --- stable/11/sys/amd64/linux32/Makefile Sat Jan 25 03:52:16 2020 (r357104) +++ stable/11/sys/amd64/linux32/Makefile Sat Jan 25 04:48:46 2020 (r357105) @@ -2,6 +2,9 @@ # # $FreeBSD$ +# Don't use an OBJDIR +.OBJDIR: ${.CURDIR} + all: @echo "make sysent only" Modified: stable/11/sys/compat/cloudabi32/Makefile ============================================================================== --- stable/11/sys/compat/cloudabi32/Makefile Sat Jan 25 03:52:16 2020 (r357104) +++ stable/11/sys/compat/cloudabi32/Makefile Sat Jan 25 04:48:46 2020 (r357105) @@ -1,5 +1,8 @@ # $FreeBSD$ +# Don't use an OBJDIR +.OBJDIR: ${.CURDIR} + all: @echo "make sysent only" Modified: stable/11/sys/compat/cloudabi64/Makefile ============================================================================== --- stable/11/sys/compat/cloudabi64/Makefile Sat Jan 25 03:52:16 2020 (r357104) +++ stable/11/sys/compat/cloudabi64/Makefile Sat Jan 25 04:48:46 2020 (r357105) @@ -1,5 +1,8 @@ # $FreeBSD$ +# Don't use an OBJDIR +.OBJDIR: ${.CURDIR} + all: @echo "make sysent only" Modified: stable/11/sys/compat/freebsd32/Makefile ============================================================================== --- stable/11/sys/compat/freebsd32/Makefile Sat Jan 25 03:52:16 2020 (r357104) +++ stable/11/sys/compat/freebsd32/Makefile Sat Jan 25 04:48:46 2020 (r357105) @@ -2,6 +2,9 @@ # # $FreeBSD$ +# Don't use an OBJDIR +.OBJDIR: ${.CURDIR} + all: @echo "make sysent only" Modified: stable/11/sys/compat/svr4/Makefile ============================================================================== --- stable/11/sys/compat/svr4/Makefile Sat Jan 25 03:52:16 2020 (r357104) +++ stable/11/sys/compat/svr4/Makefile Sat Jan 25 04:48:46 2020 (r357105) @@ -2,6 +2,9 @@ # # $FreeBSD$ +# Don't use an OBJDIR +.OBJDIR: ${.CURDIR} + all: @echo "make sysent only" Modified: stable/11/sys/i386/ibcs2/Makefile ============================================================================== --- stable/11/sys/i386/ibcs2/Makefile Sat Jan 25 03:52:16 2020 (r357104) +++ stable/11/sys/i386/ibcs2/Makefile Sat Jan 25 04:48:46 2020 (r357105) @@ -2,6 +2,9 @@ # # $FreeBSD$ +# Don't use an OBJDIR +.OBJDIR: ${.CURDIR} + all: @echo "make sysent, isc_sysent or xenix_sysent only" Modified: stable/11/sys/i386/linux/Makefile ============================================================================== --- stable/11/sys/i386/linux/Makefile Sat Jan 25 03:52:16 2020 (r357104) +++ stable/11/sys/i386/linux/Makefile Sat Jan 25 04:48:46 2020 (r357105) @@ -2,6 +2,9 @@ # # $FreeBSD$ +# Don't use an OBJDIR +.OBJDIR: ${.CURDIR} + all: @echo "make sysent only" Modified: stable/11/sys/kern/Makefile ============================================================================== --- stable/11/sys/kern/Makefile Sat Jan 25 03:52:16 2020 (r357104) +++ stable/11/sys/kern/Makefile Sat Jan 25 04:48:46 2020 (r357105) @@ -1,7 +1,10 @@ # @(#)Makefile 8.2 (Berkeley) 3/21/94 # $FreeBSD$ - +# # Makefile for init_sysent + +# Don't use an OBJDIR +.OBJDIR: ${.CURDIR} all: @echo "make sysent only" From owner-svn-src-all@freebsd.org Sat Jan 25 04:57:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F749232C45; Sat, 25 Jan 2020 04:57:27 +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 484NzW1KfWz44hP; Sat, 25 Jan 2020 04:57:27 +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 28D472D82; Sat, 25 Jan 2020 04:57:27 +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 00P4vRmI080172; Sat, 25 Jan 2020 04:57:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00P4vR8N080171; Sat, 25 Jan 2020 04:57:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001250457.00P4vR8N080171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 25 Jan 2020 04:57: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: r357106 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 357106 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 25 Jan 2020 04:57:27 -0000 Author: kevans Date: Sat Jan 25 04:57:26 2020 New Revision: 357106 URL: https://svnweb.freebsd.org/changeset/base/357106 Log: MFC r352919: Update cloudabi(32|64) sysents with "make sysent". Additionally, I've added svr4 which still exists in this branch. Modified: stable/11/Makefile.inc1 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Sat Jan 25 04:48:46 2020 (r357105) +++ stable/11/Makefile.inc1 Sat Jan 25 04:57:26 2020 (r357106) @@ -1138,6 +1138,9 @@ makeman: .PHONY _sysent_dirs= sys/kern _sysent_dirs+= sys/compat/freebsd32 +_sysent_dirs+= sys/compat/svr4 +_sysent_dirs+= sys/compat/cloudabi32 \ + sys/compat/cloudabi64 _sysent_dirs+= sys/i386/ibcs2 _sysent_dirs+= sys/amd64/linux \ sys/amd64/linux32 \ From owner-svn-src-all@freebsd.org Sat Jan 25 05:17:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1974F233479; Sat, 25 Jan 2020 05:17:45 +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 484PQw6x6Zz45gw; Sat, 25 Jan 2020 05:17:44 +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 E9205313E; Sat, 25 Jan 2020 05:17:44 +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 00P5HitW092892; Sat, 25 Jan 2020 05:17:44 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00P5HiLD092890; Sat, 25 Jan 2020 05:17:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001250517.00P5HiLD092890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 25 Jan 2020 05:17: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: r357107 - in stable: 11/share/mk 12/share/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/share/mk 12/share/mk X-SVN-Commit-Revision: 357107 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 25 Jan 2020 05:17:45 -0000 Author: kevans Date: Sat Jan 25 05:17:44 2020 New Revision: 357107 URL: https://svnweb.freebsd.org/changeset/base/357107 Log: MFC r354968, r354976: Introduce, but do not use, bsd.sysdir.mk [Some sysent bits use bsd.sysdir.mk now, but I don't see a point in converting existing stuff] MFC r354968: Introduce bsd.sysdir.mk to consolidate looking for the kernel. MFC r354976: Install bsd.sysdir.mk Added: stable/11/share/mk/bsd.sysdir.mk - copied unchanged from r354968, head/share/mk/bsd.sysdir.mk Modified: stable/11/share/mk/Makefile Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Added: stable/12/share/mk/bsd.sysdir.mk - copied unchanged from r354968, head/share/mk/bsd.sysdir.mk Modified: stable/12/share/mk/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/11/share/mk/Makefile ============================================================================== --- stable/11/share/mk/Makefile Sat Jan 25 04:57:26 2020 (r357106) +++ stable/11/share/mk/Makefile Sat Jan 25 05:17:44 2020 (r357107) @@ -52,6 +52,7 @@ FILES= \ bsd.subdir.mk \ bsd.symver.mk \ bsd.sys.mk \ + bsd.sysdir.mk \ bsd.test.mk \ dirdeps.mk \ gendirdeps.mk \ Copied: stable/11/share/mk/bsd.sysdir.mk (from r354968, head/share/mk/bsd.sysdir.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/share/mk/bsd.sysdir.mk Sat Jan 25 05:17:44 2020 (r357107, copy of r354968, head/share/mk/bsd.sysdir.mk) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +# Search for kernel source tree in standard places. +.if !defined(SYSDIR) +.for _dir in ${SRCTOP:D${SRCTOP}/sys} \ + ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \ + ${.CURDIR}/../../../../.. /sys /usr/src/sys +.if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk) +SYSDIR= ${_dir:tA} +.endif +.endfor +.endif +.if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) || \ + !exists(${SYSDIR}/conf/kmod.mk) +.error Unable to locate the kernel source tree. Set SYSDIR to override. +.endif From owner-svn-src-all@freebsd.org Sat Jan 25 05:17:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98DF023347E; Sat, 25 Jan 2020 05:17:45 +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 484PQx3YdQz45gx; Sat, 25 Jan 2020 05:17:45 +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 7567B313F; Sat, 25 Jan 2020 05:17:45 +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 00P5Hj5Z092899; Sat, 25 Jan 2020 05:17:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00P5Hj9O092897; Sat, 25 Jan 2020 05:17:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001250517.00P5Hj9O092897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 25 Jan 2020 05:17: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: r357107 - in stable: 11/share/mk 12/share/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/share/mk 12/share/mk X-SVN-Commit-Revision: 357107 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 25 Jan 2020 05:17:45 -0000 Author: kevans Date: Sat Jan 25 05:17:44 2020 New Revision: 357107 URL: https://svnweb.freebsd.org/changeset/base/357107 Log: MFC r354968, r354976: Introduce, but do not use, bsd.sysdir.mk [Some sysent bits use bsd.sysdir.mk now, but I don't see a point in converting existing stuff] MFC r354968: Introduce bsd.sysdir.mk to consolidate looking for the kernel. MFC r354976: Install bsd.sysdir.mk Added: stable/12/share/mk/bsd.sysdir.mk - copied unchanged from r354968, head/share/mk/bsd.sysdir.mk Modified: stable/12/share/mk/Makefile Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Added: stable/11/share/mk/bsd.sysdir.mk - copied unchanged from r354968, head/share/mk/bsd.sysdir.mk Modified: stable/11/share/mk/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/12/share/mk/Makefile ============================================================================== --- stable/12/share/mk/Makefile Sat Jan 25 04:57:26 2020 (r357106) +++ stable/12/share/mk/Makefile Sat Jan 25 05:17:44 2020 (r357107) @@ -55,6 +55,7 @@ FILES= \ bsd.suffixes.mk \ bsd.symver.mk \ bsd.sys.mk \ + bsd.sysdir.mk \ bsd.test.mk \ dirdeps.mk \ dirdeps-options.mk \ Copied: stable/12/share/mk/bsd.sysdir.mk (from r354968, head/share/mk/bsd.sysdir.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/share/mk/bsd.sysdir.mk Sat Jan 25 05:17:44 2020 (r357107, copy of r354968, head/share/mk/bsd.sysdir.mk) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +# Search for kernel source tree in standard places. +.if !defined(SYSDIR) +.for _dir in ${SRCTOP:D${SRCTOP}/sys} \ + ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \ + ${.CURDIR}/../../../../.. /sys /usr/src/sys +.if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk) +SYSDIR= ${_dir:tA} +.endif +.endfor +.endif +.if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) || \ + !exists(${SYSDIR}/conf/kmod.mk) +.error Unable to locate the kernel source tree. Set SYSDIR to override. +.endif From owner-svn-src-all@freebsd.org Sat Jan 25 05:47:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B844823486D; Sat, 25 Jan 2020 05:47:58 +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 484Q5p5FMSz47ls; Sat, 25 Jan 2020 05:47:58 +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 AE31638B4; Sat, 25 Jan 2020 05:47:58 +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 00P5lwxr011148; Sat, 25 Jan 2020 05:47:58 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00P5luHL011137; Sat, 25 Jan 2020 05:47:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001250547.00P5luHL011137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 25 Jan 2020 05:47: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: r357108 - in stable: 11/sys/amd64/linux 11/sys/amd64/linux32 11/sys/compat/cloudabi32 11/sys/compat/cloudabi64 11/sys/compat/freebsd32 11/sys/compat/svr4 11/sys/conf 11/sys/i386/ibcs2 1... X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/sys/amd64/linux 11/sys/amd64/linux32 11/sys/compat/cloudabi32 11/sys/compat/cloudabi64 11/sys/compat/freebsd32 11/sys/compat/svr4 11/sys/conf 11/sys/i386/ibcs2 11/sys/i386/linux 11/sys/k... X-SVN-Commit-Revision: 357108 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 25 Jan 2020 05:47:58 -0000 Author: kevans Date: Sat Jan 25 05:47:56 2020 New Revision: 357108 URL: https://svnweb.freebsd.org/changeset/base/357108 Log: MFC r355473, r356540, r356604, r356868, r356937: sysent improvements The main motivation here being .ORDER to render -jN > 1 harmless; svr4/ibcs2 targets were also refactored a bit, but both are irregular and cannot use sysent.mk as-is due to differences in files generated. I have no interest in refactoring, since these are gone in head anyways. r355473: sysent: Reduce duplication and improve readability. Use the power of variable to avoid spelling out source and generated files too many times. The previous Makefiles were hard to read, hard to edit, and badly formatted. r356540: kern/Makefile: systrace_args.c is also generated r356604: Set .ORDER for makesyscalls generated files When either makesyscalls.lua or syscalls.master changes, all of the ${GENERATED} targets are now out-of-date. With make jobs > 1, this means we will run the makesyscalls script in parallel for the same ABI, generating the same set of output files. Prior to r356603 , there is a large window for interlacing output for some of the generated files that we were generating in-place rather than staging in a temp dir. After that, we still should't need to run the script more than once per-ABI as the first invocation should update all of them. Add .ORDER to do so cleanly. r356868: sysent targets: further cleanup and deduplication r355473 vastly improved the readability and cleanliness of these Makefiles. Every single one of them follows the same pattern and duplicates the exact same logic. Now that we have GENERATED/SRCS, split SRCS up into the two parameters we'll use for ${MAKESYSCALLS} rather than assuming a specific ordering of SRCS and include a common sysent.mk to handle the rest. This makes it less tedious to make sweeping changes. Some default values are provided for GENERATED/SYSENT_*; almost all of these just use a 'syscalls.master' and 'syscalls.conf' in cwd, and they all use effectively the same filenames with an arbitrary prefix. Most ABIs will be able to get away with just setting GENERATED_PREFIX and including ^/sys/conf/sysent.mk, while others only need light additions. kern/Makefile is the notable exception, as it doesn't take a SYSENT_CONF and the generated files are spread out between ^/sys/kern and ^/sys/sys, but it otherwise fits the pattern enough to use the common version. r356937: sysent.mk: split interpreter out of target command The main objective here is to make it easy to identify what needs to change in order to use a different sysent generator than the current Lua-based one, which may be used to MFC some of the changes that have happened so we can avoid parallel accidents in stable branches, for instance. As a secondary objective, it's now feasible to override the generator on a per-Makefile basis if needed, so that one could refactor their Makefile to use this while pinning generation to the legacy makesyscalls.sh. I don't anticipate any consistent need for such a thing, but it's low-effort to achieve. Added: stable/11/sys/conf/sysent.mk - copied, changed from r356868, head/sys/conf/sysent.mk Modified: stable/11/sys/amd64/linux/Makefile stable/11/sys/amd64/linux32/Makefile stable/11/sys/compat/cloudabi32/Makefile stable/11/sys/compat/cloudabi64/Makefile stable/11/sys/compat/freebsd32/Makefile stable/11/sys/compat/svr4/Makefile stable/11/sys/i386/ibcs2/Makefile stable/11/sys/i386/linux/Makefile stable/11/sys/kern/Makefile Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Added: stable/12/sys/conf/sysent.mk - copied, changed from r356868, head/sys/conf/sysent.mk Modified: stable/12/sys/amd64/linux/Makefile stable/12/sys/amd64/linux32/Makefile stable/12/sys/arm64/linux/Makefile stable/12/sys/compat/cloudabi32/Makefile stable/12/sys/compat/cloudabi64/Makefile stable/12/sys/compat/freebsd32/Makefile stable/12/sys/i386/ibcs2/Makefile stable/12/sys/i386/linux/Makefile stable/12/sys/kern/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/amd64/linux/Makefile ============================================================================== --- stable/11/sys/amd64/linux/Makefile Sat Jan 25 05:17:44 2020 (r357107) +++ stable/11/sys/amd64/linux/Makefile Sat Jan 25 05:47:56 2020 (r357108) @@ -2,14 +2,6 @@ # # $FreeBSD$ -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} +GENERATED_PREFIX= linux_ -all: - @echo "make sysent only" - -sysent: linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c - -linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c: \ - ../../kern/makesyscalls.sh syscalls.master syscalls.conf - sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf +.include "../../conf/sysent.mk" Modified: stable/11/sys/amd64/linux32/Makefile ============================================================================== --- stable/11/sys/amd64/linux32/Makefile Sat Jan 25 05:17:44 2020 (r357107) +++ stable/11/sys/amd64/linux32/Makefile Sat Jan 25 05:47:56 2020 (r357108) @@ -2,14 +2,6 @@ # # $FreeBSD$ -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} +GENERATED_PREFIX= linux32_ -all: - @echo "make sysent only" - -sysent: linux32_sysent.c linux32_syscall.h linux32_proto.h linux32_syscalls.c linux32_systrace_args.c - -linux32_sysent.c linux32_syscall.h linux32_proto.h linux32_syscalls.c linux32_systrace_args.c: ../../kern/makesyscalls.sh \ - syscalls.master syscalls.conf - sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf +.include "../../conf/sysent.mk" Modified: stable/11/sys/compat/cloudabi32/Makefile ============================================================================== --- stable/11/sys/compat/cloudabi32/Makefile Sat Jan 25 05:17:44 2020 (r357107) +++ stable/11/sys/compat/cloudabi32/Makefile Sat Jan 25 05:47:56 2020 (r357108) @@ -1,17 +1,6 @@ # $FreeBSD$ -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} +SYSENT_FILE= ${SYSDIR}/contrib/cloudabi/syscalls32.master +GENERATED_PREFIX= cloudabi32_ -all: - @echo "make sysent only" - -sysent: cloudabi32_sysent.c cloudabi32_syscall.h cloudabi32_proto.h \ - cloudabi32_syscalls.c cloudabi32_systrace_args.c - -cloudabi32_sysent.c cloudabi32_syscall.h cloudabi32_proto.h \ - cloudabi32_syscalls.c cloudabi32_systrace_args.c: \ - ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls32.master \ - syscalls.conf - sh ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls32.master \ - syscalls.conf +.include "../../conf/sysent.mk" Modified: stable/11/sys/compat/cloudabi64/Makefile ============================================================================== --- stable/11/sys/compat/cloudabi64/Makefile Sat Jan 25 05:17:44 2020 (r357107) +++ stable/11/sys/compat/cloudabi64/Makefile Sat Jan 25 05:47:56 2020 (r357108) @@ -1,17 +1,6 @@ # $FreeBSD$ -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} +SYSENT_FILE= ${SYSDIR}/contrib/cloudabi/syscalls64.master +GENERATED_PREFIX= cloudabi64_ -all: - @echo "make sysent only" - -sysent: cloudabi64_sysent.c cloudabi64_syscall.h cloudabi64_proto.h \ - cloudabi64_syscalls.c cloudabi64_systrace_args.c - -cloudabi64_sysent.c cloudabi64_syscall.h cloudabi64_proto.h \ - cloudabi64_syscalls.c cloudabi64_systrace_args.c: \ - ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls64.master \ - syscalls.conf - sh ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls64.master \ - syscalls.conf +.include "../../conf/sysent.mk" Modified: stable/11/sys/compat/freebsd32/Makefile ============================================================================== --- stable/11/sys/compat/freebsd32/Makefile Sat Jan 25 05:17:44 2020 (r357107) +++ stable/11/sys/compat/freebsd32/Makefile Sat Jan 25 05:47:56 2020 (r357108) @@ -2,18 +2,6 @@ # # $FreeBSD$ -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} +GENERATED_PREFIX= freebsd32_ -all: - @echo "make sysent only" - -sysent: freebsd32_sysent.c freebsd32_syscall.h freebsd32_proto.h freebsd32_systrace_args.c - -freebsd32_sysent.c freebsd32_syscalls.c freebsd32_syscall.h freebsd32_proto.h freebsd32_systrace_args.c : \ - ../../kern/makesyscalls.sh syscalls.master syscalls.conf capabilities.conf - sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf - -clean: - rm -f freebsd32_sysent.c freebsd32_syscalls.c freebsd32_syscall.h freebsd32_proto.h - rm -f freebsd32_systrace_args.c +.include "../../conf/sysent.mk" Modified: stable/11/sys/compat/svr4/Makefile ============================================================================== --- stable/11/sys/compat/svr4/Makefile Sat Jan 25 05:17:44 2020 (r357107) +++ stable/11/sys/compat/svr4/Makefile Sat Jan 25 05:47:56 2020 (r357108) @@ -5,12 +5,18 @@ # Don't use an OBJDIR .OBJDIR: ${.CURDIR} +MAKESYSCALLS= ../../kern/makesyscalls.sh +GENERATED= svr4_sysent.c \ + svr4_syscall.h \ + svr4_syscallnames.c \ + svr4_proto.h + all: @echo "make sysent only" -sysent: svr4_sysent.c svr4_syscall.h svr4_proto.h +.ORDER: ${GENERATED} +sysent: ${GENERATED} -svr4_syscallnames.c svr4_sysent.c svr4_syscall.h svr4_proto.h: \ - ../../kern/makesyscalls.sh syscalls.master syscalls.conf - sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf +${GENERATED}: ${MAKESYSCALLS} syscalls.master syscalls.conf + sh ${MAKESYSCALLS} syscalls.master syscalls.conf Copied and modified: stable/11/sys/conf/sysent.mk (from r356868, head/sys/conf/sysent.mk) ============================================================================== --- head/sys/conf/sysent.mk Sat Jan 18 20:37:45 2020 (r356868, copy source) +++ stable/11/sys/conf/sysent.mk Sat Jan 25 05:47:56 2020 (r357108) @@ -21,8 +21,11 @@ SYSENT_CONF?= syscalls.conf # and set GENERATED. SRCS+= ${SYSENT_FILE} SRCS+= ${SYSENT_CONF} -MAKESYSCALLS= ${SYSDIR}/tools/makesyscalls.lua +MAKESYSCALLS_INTERP?= sh +MAKESYSCALLS_SCRIPT?= ${SYSDIR}/kern/makesyscalls.sh +MAKESYSCALLS= ${MAKESYSCALLS_INTERP} ${MAKESYSCALLS_SCRIPT} + all: @echo "make sysent only" @@ -31,5 +34,5 @@ all: .ORDER: ${GENERATED} sysent: ${GENERATED} -${GENERATED}: ${MAKESYSCALLS} ${SRCS} - ${LUA} ${MAKESYSCALLS} ${SYSENT_FILE} ${SYSENT_CONF} +${GENERATED}: ${MAKESYSCALLS_SCRIPT} ${SRCS} + ${MAKESYSCALLS} ${SYSENT_FILE} ${SYSENT_CONF} Modified: stable/11/sys/i386/ibcs2/Makefile ============================================================================== --- stable/11/sys/i386/ibcs2/Makefile Sat Jan 25 05:17:44 2020 (r357107) +++ stable/11/sys/i386/ibcs2/Makefile Sat Jan 25 05:47:56 2020 (r357108) @@ -5,23 +5,32 @@ # Don't use an OBJDIR .OBJDIR: ${.CURDIR} +MAKESYSCALLS= ../../kern/makesyscalls.sh +BASE_GENERATED= ibcs2_syscall.h \ + ibcs2_sysent.c \ + ibcs2_proto.h +ISC_GENERATED= ibcs2_isc_syscall.h \ + ibcs2_isc_sysent.c +XENIX_GENERATED= ibcs2_xenix_syscall.h \ + ibcs2_xenix_sysent.c \ + ibcs2_xenix_proto.h + all: @echo "make sysent, isc_sysent or xenix_sysent only" -sysent: ibcs2_sysent.c ibcs2_syscall.h ibcs2_proto.h +.ORDER: ${BASE_GENERATED} +.ORDER: ${ISC_GENERATED} +.ORDER: ${XENIX_GENERATED} -ibcs2_sysent.c ibcs2_syscall.h ibcs2_proto.h: ../../kern/makesyscalls.sh \ - syscalls.master syscalls.conf - sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf +sysent: ${BASE_GENERATED} +isc_sysent: ${ISC_GENERATED} +xenix_sysent: ${XENIX_GENERATED} -isc_sysent: ibcs2_isc_sysent.c ibcs2_isc_syscall.h +${BASE_GENERATED}: ${MAKESYSCALLS} syscalls.master syscalls.conf + sh ${MAKESYSCALLS} syscalls.master syscalls.conf -ibcs2_isc_sysent.c ibcs2_isc_syscall.h : ../../kern/makesyscalls.sh \ - syscalls.isc syscalls.isc.conf - sh ../../kern/makesyscalls.sh syscalls.isc syscalls.isc.conf +${ISC_GENERATED}: ${MAKESYSCALLS} syscalls.isc syscalls.isc.conf + sh ${MAKESYSCALLS} syscalls.isc syscalls.isc.conf -xenix_sysent: ibcs2_xenix_sysent.c ibcs2_xenix_syscall.h ibcs2_xenix.h - -ibcs2_xenix_sysent.c ibcs2_xenix_syscall.h ibcs2_xenix.h: \ - ../../kern/makesyscalls.sh syscalls.xenix syscalls.xenix.conf - sh ../../kern/makesyscalls.sh syscalls.xenix syscalls.xenix.conf +${XENIX_GENERATED}: ${MAKESYSCALLS} syscalls.xenix syscalls.xenix.conf + sh ${MAKESYSCALLS} syscalls.xenix syscalls.xenix.conf Modified: stable/11/sys/i386/linux/Makefile ============================================================================== --- stable/11/sys/i386/linux/Makefile Sat Jan 25 05:17:44 2020 (r357107) +++ stable/11/sys/i386/linux/Makefile Sat Jan 25 05:47:56 2020 (r357108) @@ -2,14 +2,6 @@ # # $FreeBSD$ -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} +GENERATED_PREFIX= linux_ -all: - @echo "make sysent only" - -sysent: linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c - -linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c: \ - ../../kern/makesyscalls.sh syscalls.master syscalls.conf - sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf +.include "../../conf/sysent.mk" Modified: stable/11/sys/kern/Makefile ============================================================================== --- stable/11/sys/kern/Makefile Sat Jan 25 05:17:44 2020 (r357107) +++ stable/11/sys/kern/Makefile Sat Jan 25 05:47:56 2020 (r357108) @@ -3,16 +3,12 @@ # # Makefile for init_sysent -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} +SYSENT_CONF= +GENERATED= init_sysent.c \ + syscalls.c \ + systrace_args.c \ + ${SYSDIR}/sys/syscall.h \ + ${SYSDIR}/sys/syscall.mk \ + ${SYSDIR}/sys/sysproto.h -all: - @echo "make sysent only" - -sysent: init_sysent.c syscalls.c ../sys/syscall.h ../sys/syscall.mk \ -../sys/sysproto.h - -init_sysent.c syscalls.c systrace_args.c ../sys/syscall.h \ -../sys/syscall.mk ../sys/sysproto.h: makesyscalls.sh syscalls.master \ -capabilities.conf - sh makesyscalls.sh syscalls.master +.include "../conf/sysent.mk" From owner-svn-src-all@freebsd.org Sat Jan 25 05:48:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 038C2234898; Sat, 25 Jan 2020 05:48:01 +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 484Q5r6gYXz47m3; Sat, 25 Jan 2020 05:48:00 +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 E02B838B5; Sat, 25 Jan 2020 05:48:00 +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 00P5m0FV011169; Sat, 25 Jan 2020 05:48:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00P5lwcf011153; Sat, 25 Jan 2020 05:47:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001250547.00P5lwcf011153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 25 Jan 2020 05:47: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: r357108 - in stable: 11/sys/amd64/linux 11/sys/amd64/linux32 11/sys/compat/cloudabi32 11/sys/compat/cloudabi64 11/sys/compat/freebsd32 11/sys/compat/svr4 11/sys/conf 11/sys/i386/ibcs2 1... X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/sys/amd64/linux 11/sys/amd64/linux32 11/sys/compat/cloudabi32 11/sys/compat/cloudabi64 11/sys/compat/freebsd32 11/sys/compat/svr4 11/sys/conf 11/sys/i386/ibcs2 11/sys/i386/linux 11/sys/k... X-SVN-Commit-Revision: 357108 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 25 Jan 2020 05:48:01 -0000 Author: kevans Date: Sat Jan 25 05:47:56 2020 New Revision: 357108 URL: https://svnweb.freebsd.org/changeset/base/357108 Log: MFC r355473, r356540, r356604, r356868, r356937: sysent improvements The main motivation here being .ORDER to render -jN > 1 harmless; svr4/ibcs2 targets were also refactored a bit, but both are irregular and cannot use sysent.mk as-is due to differences in files generated. I have no interest in refactoring, since these are gone in head anyways. r355473: sysent: Reduce duplication and improve readability. Use the power of variable to avoid spelling out source and generated files too many times. The previous Makefiles were hard to read, hard to edit, and badly formatted. r356540: kern/Makefile: systrace_args.c is also generated r356604: Set .ORDER for makesyscalls generated files When either makesyscalls.lua or syscalls.master changes, all of the ${GENERATED} targets are now out-of-date. With make jobs > 1, this means we will run the makesyscalls script in parallel for the same ABI, generating the same set of output files. Prior to r356603 , there is a large window for interlacing output for some of the generated files that we were generating in-place rather than staging in a temp dir. After that, we still should't need to run the script more than once per-ABI as the first invocation should update all of them. Add .ORDER to do so cleanly. r356868: sysent targets: further cleanup and deduplication r355473 vastly improved the readability and cleanliness of these Makefiles. Every single one of them follows the same pattern and duplicates the exact same logic. Now that we have GENERATED/SRCS, split SRCS up into the two parameters we'll use for ${MAKESYSCALLS} rather than assuming a specific ordering of SRCS and include a common sysent.mk to handle the rest. This makes it less tedious to make sweeping changes. Some default values are provided for GENERATED/SYSENT_*; almost all of these just use a 'syscalls.master' and 'syscalls.conf' in cwd, and they all use effectively the same filenames with an arbitrary prefix. Most ABIs will be able to get away with just setting GENERATED_PREFIX and including ^/sys/conf/sysent.mk, while others only need light additions. kern/Makefile is the notable exception, as it doesn't take a SYSENT_CONF and the generated files are spread out between ^/sys/kern and ^/sys/sys, but it otherwise fits the pattern enough to use the common version. r356937: sysent.mk: split interpreter out of target command The main objective here is to make it easy to identify what needs to change in order to use a different sysent generator than the current Lua-based one, which may be used to MFC some of the changes that have happened so we can avoid parallel accidents in stable branches, for instance. As a secondary objective, it's now feasible to override the generator on a per-Makefile basis if needed, so that one could refactor their Makefile to use this while pinning generation to the legacy makesyscalls.sh. I don't anticipate any consistent need for such a thing, but it's low-effort to achieve. Added: stable/12/sys/conf/sysent.mk - copied, changed from r356868, head/sys/conf/sysent.mk Modified: stable/12/sys/amd64/linux/Makefile stable/12/sys/amd64/linux32/Makefile stable/12/sys/arm64/linux/Makefile stable/12/sys/compat/cloudabi32/Makefile stable/12/sys/compat/cloudabi64/Makefile stable/12/sys/compat/freebsd32/Makefile stable/12/sys/i386/ibcs2/Makefile stable/12/sys/i386/linux/Makefile stable/12/sys/kern/Makefile Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Added: stable/11/sys/conf/sysent.mk - copied, changed from r356868, head/sys/conf/sysent.mk Modified: stable/11/sys/amd64/linux/Makefile stable/11/sys/amd64/linux32/Makefile stable/11/sys/compat/cloudabi32/Makefile stable/11/sys/compat/cloudabi64/Makefile stable/11/sys/compat/freebsd32/Makefile stable/11/sys/compat/svr4/Makefile stable/11/sys/i386/ibcs2/Makefile stable/11/sys/i386/linux/Makefile stable/11/sys/kern/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/amd64/linux/Makefile ============================================================================== --- stable/12/sys/amd64/linux/Makefile Sat Jan 25 05:17:44 2020 (r357107) +++ stable/12/sys/amd64/linux/Makefile Sat Jan 25 05:47:56 2020 (r357108) @@ -2,14 +2,6 @@ # # $FreeBSD$ -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} +GENERATED_PREFIX= linux_ -all: - @echo "make sysent only" - -sysent: linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c - -linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c: \ - ../../kern/makesyscalls.sh syscalls.master ${.CURDIR}/syscalls.conf - sh ../../kern/makesyscalls.sh syscalls.master ${.CURDIR}/syscalls.conf +.include "../../conf/sysent.mk" Modified: stable/12/sys/amd64/linux32/Makefile ============================================================================== --- stable/12/sys/amd64/linux32/Makefile Sat Jan 25 05:17:44 2020 (r357107) +++ stable/12/sys/amd64/linux32/Makefile Sat Jan 25 05:47:56 2020 (r357108) @@ -2,14 +2,6 @@ # # $FreeBSD$ -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} +GENERATED_PREFIX= linux32_ -all: - @echo "make sysent only" - -sysent: linux32_sysent.c linux32_syscall.h linux32_proto.h linux32_syscalls.c linux32_systrace_args.c - -linux32_sysent.c linux32_syscall.h linux32_proto.h linux32_syscalls.c linux32_systrace_args.c: ../../kern/makesyscalls.sh \ - syscalls.master ${.CURDIR}/syscalls.conf - sh ../../kern/makesyscalls.sh syscalls.master ${.CURDIR}/syscalls.conf +.include "../../conf/sysent.mk" Modified: stable/12/sys/arm64/linux/Makefile ============================================================================== --- stable/12/sys/arm64/linux/Makefile Sat Jan 25 05:17:44 2020 (r357107) +++ stable/12/sys/arm64/linux/Makefile Sat Jan 25 05:47:56 2020 (r357108) @@ -2,14 +2,6 @@ # # $FreeBSD$ -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} +GENERATED_PREFIX= linux_ -all: - @echo "make sysent only" - -sysent: linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c - -linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c: \ - ../../kern/makesyscalls.sh syscalls.master ${.CURDIR}/syscalls.conf - sh ../../kern/makesyscalls.sh syscalls.master ${.CURDIR}/syscalls.conf +.include "../../conf/sysent.mk" Modified: stable/12/sys/compat/cloudabi32/Makefile ============================================================================== --- stable/12/sys/compat/cloudabi32/Makefile Sat Jan 25 05:17:44 2020 (r357107) +++ stable/12/sys/compat/cloudabi32/Makefile Sat Jan 25 05:47:56 2020 (r357108) @@ -1,17 +1,6 @@ # $FreeBSD$ -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} +SYSENT_FILE= ${SYSDIR}/contrib/cloudabi/syscalls32.master +GENERATED_PREFIX= cloudabi32_ -all: - @echo "make sysent only" - -sysent: cloudabi32_sysent.c cloudabi32_syscall.h cloudabi32_proto.h \ - cloudabi32_syscalls.c cloudabi32_systrace_args.c - -cloudabi32_sysent.c cloudabi32_syscall.h cloudabi32_proto.h \ - cloudabi32_syscalls.c cloudabi32_systrace_args.c: \ - ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls32.master \ - ${.CURDIR}/syscalls.conf - sh ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls32.master \ - ${.CURDIR}/syscalls.conf +.include "../../conf/sysent.mk" Modified: stable/12/sys/compat/cloudabi64/Makefile ============================================================================== --- stable/12/sys/compat/cloudabi64/Makefile Sat Jan 25 05:17:44 2020 (r357107) +++ stable/12/sys/compat/cloudabi64/Makefile Sat Jan 25 05:47:56 2020 (r357108) @@ -1,17 +1,6 @@ # $FreeBSD$ -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} +SYSENT_FILE= ${SYSDIR}/contrib/cloudabi/syscalls64.master +GENERATED_PREFIX= cloudabi64_ -all: - @echo "make sysent only" - -sysent: cloudabi64_sysent.c cloudabi64_syscall.h cloudabi64_proto.h \ - cloudabi64_syscalls.c cloudabi64_systrace_args.c - -cloudabi64_sysent.c cloudabi64_syscall.h cloudabi64_proto.h \ - cloudabi64_syscalls.c cloudabi64_systrace_args.c: \ - ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls64.master \ - ${.CURDIR}/syscalls.conf - sh ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls64.master \ - ${.CURDIR}/syscalls.conf +.include "../../conf/sysent.mk" Modified: stable/12/sys/compat/freebsd32/Makefile ============================================================================== --- stable/12/sys/compat/freebsd32/Makefile Sat Jan 25 05:17:44 2020 (r357107) +++ stable/12/sys/compat/freebsd32/Makefile Sat Jan 25 05:47:56 2020 (r357108) @@ -2,18 +2,6 @@ # # $FreeBSD$ -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} +GENERATED_PREFIX= freebsd32_ -all: - @echo "make sysent only" - -sysent: freebsd32_sysent.c freebsd32_syscall.h freebsd32_proto.h freebsd32_systrace_args.c - -freebsd32_sysent.c freebsd32_syscalls.c freebsd32_syscall.h freebsd32_proto.h freebsd32_systrace_args.c : \ - ../../kern/makesyscalls.sh syscalls.master ${.CURDIR}/syscalls.conf ../../kern/capabilities.conf - sh ../../kern/makesyscalls.sh syscalls.master ${.CURDIR}/syscalls.conf - -clean: - rm -f freebsd32_sysent.c freebsd32_syscalls.c freebsd32_syscall.h freebsd32_proto.h - rm -f freebsd32_systrace_args.c +.include "../../conf/sysent.mk" Copied and modified: stable/12/sys/conf/sysent.mk (from r356868, head/sys/conf/sysent.mk) ============================================================================== --- head/sys/conf/sysent.mk Sat Jan 18 20:37:45 2020 (r356868, copy source) +++ stable/12/sys/conf/sysent.mk Sat Jan 25 05:47:56 2020 (r357108) @@ -4,7 +4,6 @@ .OBJDIR: ${.CURDIR} .include -.include COMMON_GENERATED= proto.h \ syscall.h \ @@ -21,8 +20,11 @@ SYSENT_CONF?= syscalls.conf # and set GENERATED. SRCS+= ${SYSENT_FILE} SRCS+= ${SYSENT_CONF} -MAKESYSCALLS= ${SYSDIR}/tools/makesyscalls.lua +MAKESYSCALLS_INTERP?= sh +MAKESYSCALLS_SCRIPT?= ${SYSDIR}/kern/makesyscalls.sh +MAKESYSCALLS= ${MAKESYSCALLS_INTERP} ${MAKESYSCALLS_SCRIPT} + all: @echo "make sysent only" @@ -31,5 +33,5 @@ all: .ORDER: ${GENERATED} sysent: ${GENERATED} -${GENERATED}: ${MAKESYSCALLS} ${SRCS} - ${LUA} ${MAKESYSCALLS} ${SYSENT_FILE} ${SYSENT_CONF} +${GENERATED}: ${MAKESYSCALLS_SCRIPT} ${SRCS} + ${MAKESYSCALLS} ${SYSENT_FILE} ${SYSENT_CONF} Modified: stable/12/sys/i386/ibcs2/Makefile ============================================================================== --- stable/12/sys/i386/ibcs2/Makefile Sat Jan 25 05:17:44 2020 (r357107) +++ stable/12/sys/i386/ibcs2/Makefile Sat Jan 25 05:47:56 2020 (r357108) @@ -5,23 +5,32 @@ # Don't use an OBJDIR .OBJDIR: ${.CURDIR} +MAKESYSCALLS= ../../kern/makesyscalls.sh +BASE_GENERATED= ibcs2_syscall.h \ + ibcs2_sysent.c \ + ibcs2_proto.h +ISC_GENERATED= ibcs2_isc_syscall.h \ + ibcs2_isc_sysent.c +XENIX_GENERATED= ibcs2_xenix_syscall.h \ + ibcs2_xenix_sysent.c \ + ibcs2_xenix_proto.h + all: @echo "make sysent, isc_sysent or xenix_sysent only" -sysent: ibcs2_sysent.c ibcs2_syscall.h ibcs2_proto.h +.ORDER: ${BASE_GENERATED} +.ORDER: ${ISC_GENERATED} +.ORDER: ${XENIX_GENERATED} -ibcs2_sysent.c ibcs2_syscall.h ibcs2_proto.h: ../../kern/makesyscalls.sh \ - syscalls.master syscalls.conf - sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf +sysent: ${BASE_GENERATED} +isc_sysent: ${ISC_GENERATED} +xenix_sysent: ${XENIX_GENERATED} -isc_sysent: ibcs2_isc_sysent.c ibcs2_isc_syscall.h +${BASE_GENERATED}: ${MAKESYSCALLS} syscalls.master syscalls.conf + sh ${MAKESYSCALLS} syscalls.master syscalls.conf -ibcs2_isc_sysent.c ibcs2_isc_syscall.h : ../../kern/makesyscalls.sh \ - syscalls.isc syscalls.isc.conf - sh ../../kern/makesyscalls.sh syscalls.isc syscalls.isc.conf +${ISC_GENERATED}: ${MAKESYSCALLS} syscalls.isc syscalls.isc.conf + sh ${MAKESYSCALLS} syscalls.isc syscalls.isc.conf -xenix_sysent: ibcs2_xenix_sysent.c ibcs2_xenix_syscall.h ibcs2_xenix.h - -ibcs2_xenix_sysent.c ibcs2_xenix_syscall.h ibcs2_xenix.h: \ - ../../kern/makesyscalls.sh syscalls.xenix syscalls.xenix.conf - sh ../../kern/makesyscalls.sh syscalls.xenix syscalls.xenix.conf +${XENIX_GENERATED}: ${MAKESYSCALLS} syscalls.xenix syscalls.xenix.conf + sh ${MAKESYSCALLS} syscalls.xenix syscalls.xenix.conf Modified: stable/12/sys/i386/linux/Makefile ============================================================================== --- stable/12/sys/i386/linux/Makefile Sat Jan 25 05:17:44 2020 (r357107) +++ stable/12/sys/i386/linux/Makefile Sat Jan 25 05:47:56 2020 (r357108) @@ -2,14 +2,6 @@ # # $FreeBSD$ -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} +GENERATED_PREFIX= linux_ -all: - @echo "make sysent only" - -sysent: linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c - -linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c: \ - ../../kern/makesyscalls.sh syscalls.master ${.CURDIR}/syscalls.conf - sh ../../kern/makesyscalls.sh syscalls.master ${.CURDIR}/syscalls.conf +.include "../../conf/sysent.mk" Modified: stable/12/sys/kern/Makefile ============================================================================== --- stable/12/sys/kern/Makefile Sat Jan 25 05:17:44 2020 (r357107) +++ stable/12/sys/kern/Makefile Sat Jan 25 05:47:56 2020 (r357108) @@ -3,16 +3,12 @@ # # Makefile for init_sysent -# Don't use an OBJDIR -.OBJDIR: ${.CURDIR} +SYSENT_CONF= +GENERATED= init_sysent.c \ + syscalls.c \ + systrace_args.c \ + ${SYSDIR}/sys/syscall.h \ + ${SYSDIR}/sys/syscall.mk \ + ${SYSDIR}/sys/sysproto.h -all: - @echo "make sysent only" - -sysent: init_sysent.c syscalls.c ../sys/syscall.h ../sys/syscall.mk \ -../sys/sysproto.h - -init_sysent.c syscalls.c systrace_args.c ../sys/syscall.h \ -../sys/syscall.mk ../sys/sysproto.h: makesyscalls.sh syscalls.master \ -capabilities.conf - sh makesyscalls.sh syscalls.master +.include "../conf/sysent.mk" From owner-svn-src-all@freebsd.org Sat Jan 25 05:52:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 01AC7234BED; Sat, 25 Jan 2020 05:52:33 +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 484QC46Hmwz48LR; Sat, 25 Jan 2020 05:52:32 +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 D35763AFC; Sat, 25 Jan 2020 05:52:32 +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 00P5qWge016934; Sat, 25 Jan 2020 05:52:32 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00P5qVD4016929; Sat, 25 Jan 2020 05:52:31 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001250552.00P5qVD4016929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 25 Jan 2020 05:52: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: r357109 - in stable: 11/sys/i386/ibcs2 12/sys/i386/ibcs2 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/sys/i386/ibcs2 12/sys/i386/ibcs2 X-SVN-Commit-Revision: 357109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 25 Jan 2020 05:52:33 -0000 Author: kevans Date: Sat Jan 25 05:52:31 2020 New Revision: 357109 URL: https://svnweb.freebsd.org/changeset/base/357109 Log: Regenerate ibcs2 sysent targets, NFC Direct commit; these hadn't been regenerated in a wihle, and it's nice to see no diff going forward in case these get tweaked a little bit more for conventions. Unlikely. Modified: stable/11/sys/i386/ibcs2/ibcs2_isc_syscall.h stable/11/sys/i386/ibcs2/ibcs2_isc_sysent.c stable/11/sys/i386/ibcs2/ibcs2_xenix.h stable/11/sys/i386/ibcs2/ibcs2_xenix_syscall.h stable/11/sys/i386/ibcs2/ibcs2_xenix_sysent.c Changes in other areas also in this revision: Modified: stable/12/sys/i386/ibcs2/ibcs2_isc_syscall.h stable/12/sys/i386/ibcs2/ibcs2_isc_sysent.c stable/12/sys/i386/ibcs2/ibcs2_xenix.h stable/12/sys/i386/ibcs2/ibcs2_xenix_syscall.h stable/12/sys/i386/ibcs2/ibcs2_xenix_sysent.c Modified: stable/11/sys/i386/ibcs2/ibcs2_isc_syscall.h ============================================================================== --- stable/11/sys/i386/ibcs2/ibcs2_isc_syscall.h Sat Jan 25 05:47:56 2020 (r357108) +++ stable/11/sys/i386/ibcs2/ibcs2_isc_syscall.h Sat Jan 25 05:52:31 2020 (r357109) @@ -3,7 +3,6 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/ibcs2/syscalls.isc 160798 2006-07-28 19:05:28Z jhb */ #define IBCS2_ISC_ibcs2_rename 2 Modified: stable/11/sys/i386/ibcs2/ibcs2_isc_sysent.c ============================================================================== --- stable/11/sys/i386/ibcs2/ibcs2_isc_sysent.c Sat Jan 25 05:47:56 2020 (r357108) +++ stable/11/sys/i386/ibcs2/ibcs2_isc_sysent.c Sat Jan 25 05:52:31 2020 (r357109) @@ -3,7 +3,6 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/ibcs2/syscalls.isc 160798 2006-07-28 19:05:28Z jhb */ #include Modified: stable/11/sys/i386/ibcs2/ibcs2_xenix.h ============================================================================== --- stable/11/sys/i386/ibcs2/ibcs2_xenix.h Sat Jan 25 05:47:56 2020 (r357108) +++ stable/11/sys/i386/ibcs2/ibcs2_xenix.h Sat Jan 25 05:52:31 2020 (r357109) @@ -3,7 +3,6 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/ibcs2/syscalls.xenix 160798 2006-07-28 19:05:28Z jhb */ #ifndef _IBCS2_XENIX_H_ @@ -12,8 +11,10 @@ #include #include #include +#include #include #include +#include #include @@ -134,6 +135,12 @@ int xenix_utsname(struct thread *, struct xenix_utsnam #endif /* COMPAT_FREEBSD7 */ + + +#ifdef COMPAT_FREEBSD10 + + +#endif /* COMPAT_FREEBSD10 */ #define IBCS2_XENIX_AUE_xenix_rdchk AUE_NULL #define IBCS2_XENIX_AUE_xenix_chsize AUE_FTRUNCATE Modified: stable/11/sys/i386/ibcs2/ibcs2_xenix_syscall.h ============================================================================== --- stable/11/sys/i386/ibcs2/ibcs2_xenix_syscall.h Sat Jan 25 05:47:56 2020 (r357108) +++ stable/11/sys/i386/ibcs2/ibcs2_xenix_syscall.h Sat Jan 25 05:52:31 2020 (r357109) @@ -3,7 +3,6 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/ibcs2/syscalls.xenix 160798 2006-07-28 19:05:28Z jhb */ #define IBCS2_XENIX_xenix_rdchk 7 Modified: stable/11/sys/i386/ibcs2/ibcs2_xenix_sysent.c ============================================================================== --- stable/11/sys/i386/ibcs2/ibcs2_xenix_sysent.c Sat Jan 25 05:47:56 2020 (r357108) +++ stable/11/sys/i386/ibcs2/ibcs2_xenix_sysent.c Sat Jan 25 05:52:31 2020 (r357109) @@ -3,7 +3,6 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/ibcs2/syscalls.xenix 160798 2006-07-28 19:05:28Z jhb */ #include From owner-svn-src-all@freebsd.org Sat Jan 25 05:52:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DA80234C1B; Sat, 25 Jan 2020 05:52:34 +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 484QC60GxRz48LV; Sat, 25 Jan 2020 05:52:34 +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 04C693AFD; Sat, 25 Jan 2020 05:52:34 +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 00P5qXXJ016944; Sat, 25 Jan 2020 05:52:33 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00P5qXBD016940; Sat, 25 Jan 2020 05:52:33 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202001250552.00P5qXBD016940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 25 Jan 2020 05:52: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: r357109 - in stable: 11/sys/i386/ibcs2 12/sys/i386/ibcs2 X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/sys/i386/ibcs2 12/sys/i386/ibcs2 X-SVN-Commit-Revision: 357109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 25 Jan 2020 05:52:34 -0000 Author: kevans Date: Sat Jan 25 05:52:31 2020 New Revision: 357109 URL: https://svnweb.freebsd.org/changeset/base/357109 Log: Regenerate ibcs2 sysent targets, NFC Direct commit; these hadn't been regenerated in a wihle, and it's nice to see no diff going forward in case these get tweaked a little bit more for conventions. Unlikely. Modified: stable/12/sys/i386/ibcs2/ibcs2_isc_syscall.h stable/12/sys/i386/ibcs2/ibcs2_isc_sysent.c stable/12/sys/i386/ibcs2/ibcs2_xenix.h stable/12/sys/i386/ibcs2/ibcs2_xenix_syscall.h stable/12/sys/i386/ibcs2/ibcs2_xenix_sysent.c Changes in other areas also in this revision: Modified: stable/11/sys/i386/ibcs2/ibcs2_isc_syscall.h stable/11/sys/i386/ibcs2/ibcs2_isc_sysent.c stable/11/sys/i386/ibcs2/ibcs2_xenix.h stable/11/sys/i386/ibcs2/ibcs2_xenix_syscall.h stable/11/sys/i386/ibcs2/ibcs2_xenix_sysent.c Modified: stable/12/sys/i386/ibcs2/ibcs2_isc_syscall.h ============================================================================== --- stable/12/sys/i386/ibcs2/ibcs2_isc_syscall.h Sat Jan 25 05:47:56 2020 (r357108) +++ stable/12/sys/i386/ibcs2/ibcs2_isc_syscall.h Sat Jan 25 05:52:31 2020 (r357109) @@ -1,9 +1,8 @@ /* * System call numbers. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/ibcs2/syscalls.isc 160798 2006-07-28 19:05:28Z jhb */ #define IBCS2_ISC_ibcs2_rename 2 Modified: stable/12/sys/i386/ibcs2/ibcs2_isc_sysent.c ============================================================================== --- stable/12/sys/i386/ibcs2/ibcs2_isc_sysent.c Sat Jan 25 05:47:56 2020 (r357108) +++ stable/12/sys/i386/ibcs2/ibcs2_isc_sysent.c Sat Jan 25 05:52:31 2020 (r357109) @@ -1,9 +1,8 @@ /* * System call switch table. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/ibcs2/syscalls.isc 160798 2006-07-28 19:05:28Z jhb */ #include Modified: stable/12/sys/i386/ibcs2/ibcs2_xenix.h ============================================================================== --- stable/12/sys/i386/ibcs2/ibcs2_xenix.h Sat Jan 25 05:47:56 2020 (r357108) +++ stable/12/sys/i386/ibcs2/ibcs2_xenix.h Sat Jan 25 05:52:31 2020 (r357109) @@ -1,9 +1,8 @@ /* * System call prototypes. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/ibcs2/syscalls.xenix 160798 2006-07-28 19:05:28Z jhb */ #ifndef _IBCS2_XENIX_H_ @@ -12,8 +11,11 @@ #include #include #include +#include +#include #include #include +#include #include @@ -134,6 +136,18 @@ int xenix_utsname(struct thread *, struct xenix_utsnam #endif /* COMPAT_FREEBSD7 */ + + +#ifdef COMPAT_FREEBSD10 + + +#endif /* COMPAT_FREEBSD10 */ + + +#ifdef COMPAT_FREEBSD11 + + +#endif /* COMPAT_FREEBSD11 */ #define IBCS2_XENIX_AUE_xenix_rdchk AUE_NULL #define IBCS2_XENIX_AUE_xenix_chsize AUE_FTRUNCATE Modified: stable/12/sys/i386/ibcs2/ibcs2_xenix_syscall.h ============================================================================== --- stable/12/sys/i386/ibcs2/ibcs2_xenix_syscall.h Sat Jan 25 05:47:56 2020 (r357108) +++ stable/12/sys/i386/ibcs2/ibcs2_xenix_syscall.h Sat Jan 25 05:52:31 2020 (r357109) @@ -1,9 +1,8 @@ /* * System call numbers. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/ibcs2/syscalls.xenix 160798 2006-07-28 19:05:28Z jhb */ #define IBCS2_XENIX_xenix_rdchk 7 Modified: stable/12/sys/i386/ibcs2/ibcs2_xenix_sysent.c ============================================================================== --- stable/12/sys/i386/ibcs2/ibcs2_xenix_sysent.c Sat Jan 25 05:47:56 2020 (r357108) +++ stable/12/sys/i386/ibcs2/ibcs2_xenix_sysent.c Sat Jan 25 05:52:31 2020 (r357109) @@ -1,9 +1,8 @@ /* * System call switch table. * - * DO NOT EDIT-- this file is automatically generated. + * DO NOT EDIT-- this file is automatically @generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/ibcs2/syscalls.xenix 160798 2006-07-28 19:05:28Z jhb */ #include From owner-svn-src-all@freebsd.org Sat Jan 25 08:57:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5BCF9239763; Sat, 25 Jan 2020 08:57:27 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 484VJR1JB3z4HLT; Sat, 25 Jan 2020 08:57:27 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 220DE5C99; Sat, 25 Jan 2020 08:57:27 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00P8vRcs023735; Sat, 25 Jan 2020 08:57:27 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00P8vQ4H023733; Sat, 25 Jan 2020 08:57:26 GMT (envelope-from jah@FreeBSD.org) Message-Id: <202001250857.00P8vQ4H023733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Sat, 25 Jan 2020 08:57:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357110 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: jah X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 357110 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 25 Jan 2020 08:57:27 -0000 Author: jah Date: Sat Jan 25 08:57:26 2020 New Revision: 357110 URL: https://svnweb.freebsd.org/changeset/base/357110 Log: Implement cycle-detecting garbage collector for AF_UNIX sockets The existing AF_UNIX socket garbage collector destroys any socket which may potentially be in a cycle, as indicated by its file reference count being equal to its enqueue count. However, this can produce false positives for in-flight sockets which aren't part of a cycle but are part of one or more SCM_RIGHTS mssages and which have been closed on the sending side. If the garbage collector happens to run at exactly the wrong time, destruction of these sockets will render them unusable on the receiving side, such that no previously-written data may be read. This change rewrites the garbage collector to precisely detect cycles: 1. The existing check of msgcount==f_count is still used to determine whether the socket is potentially in a cycle. 2. The socket is now placed on a local "dead list", which is used to reduce iteration time (and therefore contention on the global unp_link_rwlock). 3. The first pass through the dead list removes each potentially-dead socket's outgoing references from the graph of potentially-dead sockets, using a gc-specific copy of the original reference count. 4. The second series of passes through the dead list removes from the list any socket whose remaining gc refcount is non-zero, as this indicates the socket is actually accessible outside of any possible cycle. Iteration is repeated until no further sockets are removed from the dead list. 5. Sockets remaining in the dead list are destroyed as before. PR: 227285 Submitted by: jan.kokemueller@gmail.com (prior version) Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D23142 Modified: head/sys/kern/uipc_usrreq.c head/sys/sys/unpcb.h Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Sat Jan 25 05:52:31 2020 (r357109) +++ head/sys/kern/uipc_usrreq.c Sat Jan 25 08:57:26 2020 (r357110) @@ -260,7 +260,7 @@ static struct mtx unp_defers_lock; #define UNP_LINK_LOCK_INIT() rw_init(&unp_link_rwlock, \ "unp_link_rwlock") -#define UNP_LINK_LOCK_ASSERT() rw_assert(&unp_link_rwlock, \ +#define UNP_LINK_LOCK_ASSERT() rw_assert(&unp_link_rwlock, \ RA_LOCKED) #define UNP_LINK_UNLOCK_ASSERT() rw_assert(&unp_link_rwlock, \ RA_UNLOCKED) @@ -778,6 +778,8 @@ uipc_detach(struct socket *so) UNP_LINK_WLOCK(); LIST_REMOVE(unp, unp_link); + if (unp->unp_gcflag & UNPGC_DEAD) + LIST_REMOVE(unp, unp_dead); unp->unp_gencnt = ++unp_gencnt; --unp_count; UNP_LINK_WUNLOCK(); @@ -2481,50 +2483,61 @@ unp_externalize_fp(struct file *fp) * synchronization. */ static int unp_marked; -static int unp_unreachable; static void -unp_accessable(struct filedescent **fdep, int fdcount) +unp_remove_dead_ref(struct filedescent **fdep, int fdcount) { struct unpcb *unp; struct file *fp; int i; + /* + * This function can only be called from the gc task. + */ + KASSERT(taskqueue_member(taskqueue_thread, curthread) != 0, + ("%s: not on gc callout", __func__)); + UNP_LINK_LOCK_ASSERT(); + for (i = 0; i < fdcount; i++) { fp = fdep[i]->fde_file; if ((unp = fptounp(fp)) == NULL) continue; - if (unp->unp_gcflag & UNPGC_REF) + if ((unp->unp_gcflag & UNPGC_DEAD) == 0) continue; - unp->unp_gcflag &= ~UNPGC_DEAD; - unp->unp_gcflag |= UNPGC_REF; - unp_marked++; + unp->unp_gcrefs--; } } static void -unp_gc_process(struct unpcb *unp) +unp_restore_undead_ref(struct filedescent **fdep, int fdcount) { - struct socket *so, *soa; + struct unpcb *unp; struct file *fp; + int i; - /* Already processed. */ - if (unp->unp_gcflag & UNPGC_SCANNED) - return; - fp = unp->unp_file; - /* - * Check for a socket potentially in a cycle. It must be in a - * queue as indicated by msgcount, and this must equal the file - * reference count. Note that when msgcount is 0 the file is NULL. + * This function can only be called from the gc task. */ - if ((unp->unp_gcflag & UNPGC_REF) == 0 && fp && - unp->unp_msgcount != 0 && fp->f_count == unp->unp_msgcount) { - unp->unp_gcflag |= UNPGC_DEAD; - unp_unreachable++; - return; + KASSERT(taskqueue_member(taskqueue_thread, curthread) != 0, + ("%s: not on gc callout", __func__)); + UNP_LINK_LOCK_ASSERT(); + + for (i = 0; i < fdcount; i++) { + fp = fdep[i]->fde_file; + if ((unp = fptounp(fp)) == NULL) + continue; + if ((unp->unp_gcflag & UNPGC_DEAD) == 0) + continue; + unp->unp_gcrefs++; + unp_marked++; } +} +static void +unp_gc_scan(struct unpcb *unp, void (*op)(struct filedescent **, int)) +{ + struct socket *so, *soa; + so = unp->unp_socket; SOCK_LOCK(so); if (SOLISTENING(so)) { @@ -2535,7 +2548,7 @@ unp_gc_process(struct unpcb *unp) if (sotounpcb(soa)->unp_gcflag & UNPGC_IGNORE_RIGHTS) continue; SOCKBUF_LOCK(&soa->so_rcv); - unp_scan(soa->so_rcv.sb_mb, unp_accessable); + unp_scan(soa->so_rcv.sb_mb, op); SOCKBUF_UNLOCK(&soa->so_rcv); } } else { @@ -2544,12 +2557,11 @@ unp_gc_process(struct unpcb *unp) */ if ((unp->unp_gcflag & UNPGC_IGNORE_RIGHTS) == 0) { SOCKBUF_LOCK(&so->so_rcv); - unp_scan(so->so_rcv.sb_mb, unp_accessable); + unp_scan(so->so_rcv.sb_mb, op); SOCKBUF_UNLOCK(&so->so_rcv); } } SOCK_UNLOCK(so); - unp->unp_gcflag |= UNPGC_SCANNED; } static int unp_recycled; @@ -2560,67 +2572,115 @@ static int unp_taskcount; SYSCTL_INT(_net_local, OID_AUTO, taskcount, CTLFLAG_RD, &unp_taskcount, 0, "Number of times the garbage collector has run."); +SYSCTL_UINT(_net_local, OID_AUTO, sockcount, CTLFLAG_RD, &unp_count, 0, + "Number of active local sockets."); + static void unp_gc(__unused void *arg, int pending) { struct unp_head *heads[] = { &unp_dhead, &unp_shead, &unp_sphead, NULL }; struct unp_head **head; + struct unp_head unp_deadhead; /* List of potentially-dead sockets. */ struct file *f, **unref; - struct unpcb *unp; - int i, total; + struct unpcb *unp, *unptmp; + int i, total, unp_unreachable; + LIST_INIT(&unp_deadhead); unp_taskcount++; UNP_LINK_RLOCK(); /* - * First clear all gc flags from previous runs, apart from - * UNPGC_IGNORE_RIGHTS. + * First determine which sockets may be in cycles. */ + unp_unreachable = 0; + for (head = heads; *head != NULL; head++) - LIST_FOREACH(unp, *head, unp_link) - unp->unp_gcflag = - (unp->unp_gcflag & UNPGC_IGNORE_RIGHTS); + LIST_FOREACH(unp, *head, unp_link) { + KASSERT((unp->unp_gcflag & ~UNPGC_IGNORE_RIGHTS) == 0, + ("%s: unp %p has unexpected gc flags 0x%x", + __func__, unp, (unsigned int)unp->unp_gcflag)); + + f = unp->unp_file; + + /* + * Check for an unreachable socket potentially in a + * cycle. It must be in a queue as indicated by + * msgcount, and this must equal the file reference + * count. Note that when msgcount is 0 the file is + * NULL. + */ + if (f != NULL && unp->unp_msgcount != 0 && + f->f_count == unp->unp_msgcount) { + LIST_INSERT_HEAD(&unp_deadhead, unp, unp_dead); + unp->unp_gcflag |= UNPGC_DEAD; + unp->unp_gcrefs = unp->unp_msgcount; + unp_unreachable++; + } + } + /* - * Scan marking all reachable sockets with UNPGC_REF. Once a socket - * is reachable all of the sockets it references are reachable. + * Scan all sockets previously marked as potentially being in a cycle + * and remove the references each socket holds on any UNPGC_DEAD + * sockets in its queue. After this step, all remaining references on + * sockets marked UNPGC_DEAD should not be part of any cycle. + */ + LIST_FOREACH(unp, &unp_deadhead, unp_dead) + unp_gc_scan(unp, unp_remove_dead_ref); + + /* + * If a socket still has a non-negative refcount, it cannot be in a + * cycle. In this case increment refcount of all children iteratively. * Stop the scan once we do a complete loop without discovering * a new reachable socket. */ do { - unp_unreachable = 0; unp_marked = 0; - for (head = heads; *head != NULL; head++) - LIST_FOREACH(unp, *head, unp_link) - unp_gc_process(unp); + LIST_FOREACH_SAFE(unp, &unp_deadhead, unp_dead, unptmp) + if (unp->unp_gcrefs > 0) { + unp->unp_gcflag &= ~UNPGC_DEAD; + LIST_REMOVE(unp, unp_dead); + KASSERT(unp_unreachable > 0, + ("%s: unp_unreachable underflow.", + __func__)); + unp_unreachable--; + unp_gc_scan(unp, unp_restore_undead_ref); + } } while (unp_marked); + UNP_LINK_RUNLOCK(); + if (unp_unreachable == 0) return; /* - * Allocate space for a local list of dead unpcbs. + * Allocate space for a local array of dead unpcbs. + * TODO: can this path be simplified by instead using the local + * dead list at unp_deadhead, after taking out references + * on the file object and/or unpcb and dropping the link lock? */ unref = malloc(unp_unreachable * sizeof(struct file *), M_TEMP, M_WAITOK); /* * Iterate looking for sockets which have been specifically marked - * as as unreachable and store them locally. + * as unreachable and store them locally. */ UNP_LINK_RLOCK(); - for (total = 0, head = heads; *head != NULL; head++) - LIST_FOREACH(unp, *head, unp_link) - if ((unp->unp_gcflag & UNPGC_DEAD) != 0) { - f = unp->unp_file; - if (unp->unp_msgcount == 0 || f == NULL || - f->f_count != unp->unp_msgcount || - !fhold(f)) - continue; - unref[total++] = f; - KASSERT(total <= unp_unreachable, - ("unp_gc: incorrect unreachable count.")); - } + total = 0; + LIST_FOREACH(unp, &unp_deadhead, unp_dead) { + KASSERT((unp->unp_gcflag & UNPGC_DEAD) != 0, + ("%s: unp %p not marked UNPGC_DEAD", __func__, unp)); + unp->unp_gcflag &= ~UNPGC_DEAD; + f = unp->unp_file; + if (unp->unp_msgcount == 0 || f == NULL || + f->f_count != unp->unp_msgcount || + !fhold(f)) + continue; + unref[total++] = f; + KASSERT(total <= unp_unreachable, + ("%s: incorrect unreachable count.", __func__)); + } UNP_LINK_RUNLOCK(); /* Modified: head/sys/sys/unpcb.h ============================================================================== --- head/sys/sys/unpcb.h Sat Jan 25 05:52:31 2020 (r357109) +++ head/sys/sys/unpcb.h Sat Jan 25 08:57:26 2020 (r357110) @@ -86,7 +86,9 @@ struct unpcb { unp_gen_t unp_gencnt; /* generation count of this instance */ struct file *unp_file; /* back-pointer to file for gc. */ u_int unp_msgcount; /* references from message queue */ + u_int unp_gcrefs; /* garbage collector refcount */ ino_t unp_ino; /* fake inode number */ + LIST_ENTRY(unpcb) unp_dead; /* link in dead list */ } __aligned(CACHE_LINE_SIZE); /* @@ -113,10 +115,8 @@ struct unpcb { /* * Flags in unp_gcflag. */ -#define UNPGC_REF 0x1 /* unpcb has external ref. */ -#define UNPGC_DEAD 0x2 /* unpcb might be dead. */ -#define UNPGC_SCANNED 0x4 /* Has been scanned. */ -#define UNPGC_IGNORE_RIGHTS 0x8 /* Attached rights are freed */ +#define UNPGC_DEAD 0x1 /* unpcb might be dead. */ +#define UNPGC_IGNORE_RIGHTS 0x2 /* Attached rights are freed */ #define sotounpcb(so) ((struct unpcb *)((so)->so_pcb)) From owner-svn-src-all@freebsd.org Sat Jan 25 09:12:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 14512239DCA; Sat, 25 Jan 2020 09:12:21 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 484Vdc6rT5z4J0V; Sat, 25 Jan 2020 09:12:20 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E62AA6026; Sat, 25 Jan 2020 09:12:20 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00P9CKvQ035369; Sat, 25 Jan 2020 09:12:20 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00P9CKhe035368; Sat, 25 Jan 2020 09:12:20 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202001250912.00P9CKhe035368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 25 Jan 2020 09:12: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: r357111 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 357111 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 25 Jan 2020 09:12:21 -0000 Author: eugen Date: Sat Jan 25 09:12:20 2020 New Revision: 357111 URL: https://svnweb.freebsd.org/changeset/base/357111 Log: MFC r356863: ifa_maintain_loopback_route: adjust debugging output Correction after r333476: - write this as LOG_DEBUG again instead of LOG_INFO; - get back function name into the message; - error may be ESRCH if an address is removed in process (by carp f.e.), not only ENOENT; - expression complexity grows, so try making it more readable. Modified: stable/12/sys/net/if.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if.c ============================================================================== --- stable/12/sys/net/if.c Sat Jan 25 08:57:26 2020 (r357110) +++ stable/12/sys/net/if.c Sat Jan 25 09:12:20 2020 (r357111) @@ -1920,10 +1920,13 @@ ifa_maintain_loopback_route(int cmd, const char *otype error = rtrequest1_fib(cmd, &info, NULL, ifp->if_fib); - if (error != 0 && - !(cmd == RTM_ADD && error == EEXIST) && - !(cmd == RTM_DELETE && error == ENOENT)) - if_printf(ifp, "%s failed: %d\n", otype, error); + if (error == 0 || + (cmd == RTM_ADD && error == EEXIST) || + (cmd == RTM_DELETE && (error == ENOENT || error == ESRCH))) + return (error); + + log(LOG_DEBUG, "%s: %s failed for interface %s: %u\n", + __func__, otype, if_name(ifp), error); return (error); } From owner-svn-src-all@freebsd.org Sat Jan 25 09:22:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2287323A115; Sat, 25 Jan 2020 09:22:29 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 484VsK08X1z4JVs; Sat, 25 Jan 2020 09:22:29 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 005856225; Sat, 25 Jan 2020 09:22:29 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00P9MSIK041252; Sat, 25 Jan 2020 09:22:28 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00P9MSYh041233; Sat, 25 Jan 2020 09:22:28 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202001250922.00P9MSYh041233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 25 Jan 2020 09:22: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: r357112 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 357112 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 25 Jan 2020 09:22:29 -0000 Author: eugen Date: Sat Jan 25 09:22:28 2020 New Revision: 357112 URL: https://svnweb.freebsd.org/changeset/base/357112 Log: MFC r356863: ifa_maintain_loopback_route: adjust debugging output Modified: stable/11/sys/net/if.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if.c ============================================================================== --- stable/11/sys/net/if.c Sat Jan 25 09:12:20 2020 (r357111) +++ stable/11/sys/net/if.c Sat Jan 25 09:22:28 2020 (r357112) @@ -1831,9 +1831,13 @@ ifa_maintain_loopback_route(int cmd, const char *otype error = rtrequest1_fib(cmd, &info, NULL, ifp->if_fib); - if (error != 0) - log(LOG_DEBUG, "%s: %s failed for interface %s: %u\n", - __func__, otype, if_name(ifp), error); + if (error == 0 || + (cmd == RTM_ADD && error == EEXIST) || + (cmd == RTM_DELETE && (error == ENOENT || error == ESRCH))) + return (error); + + log(LOG_DEBUG, "%s: %s failed for interface %s: %u\n", + __func__, otype, if_name(ifp), error); return (error); } From owner-svn-src-all@freebsd.org Sat Jan 25 10:51:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F7D923BC02; Sat, 25 Jan 2020 10:51:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 484XrS3mKqz4MtF; Sat, 25 Jan 2020 10:51:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C82E7185; Sat, 25 Jan 2020 10:51:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00PApq4A095653; Sat, 25 Jan 2020 10:51:52 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00PApqbc095652; Sat, 25 Jan 2020 10:51:52 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202001251051.00PApqbc095652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 25 Jan 2020 10:51:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357113 - head/tests/sys/net/routing X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/net/routing X-SVN-Commit-Revision: 357113 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 25 Jan 2020 10:51:52 -0000 Author: kp Date: Sat Jan 25 10:51:51 2020 New Revision: 357113 URL: https://svnweb.freebsd.org/changeset/base/357113 Log: tests: Routing tests overwrote net tests The routing subdirectory installed into the same directory as the test tests, which caused them to overwrite the net Kyuafile. As a result these tests were not executed. X-MFC-With: r356146 Modified: head/tests/sys/net/routing/Makefile Modified: head/tests/sys/net/routing/Makefile ============================================================================== --- head/tests/sys/net/routing/Makefile Sat Jan 25 09:22:28 2020 (r357112) +++ head/tests/sys/net/routing/Makefile Sat Jan 25 10:51:51 2020 (r357113) @@ -2,7 +2,7 @@ PACKAGE= tests -TESTSDIR= ${TESTSBASE}/sys/net +TESTSDIR= ${TESTSBASE}/sys/net/routing ATF_TESTS_C += test_rtsock_l3 ATF_TESTS_C += test_rtsock_lladdr From owner-svn-src-all@freebsd.org Sat Jan 25 13:11:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B76B23F3C9; Sat, 25 Jan 2020 13:11:15 +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 484bxH1wSjz4VQQ; Sat, 25 Jan 2020 13:11:15 +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 3D3A98AF6; Sat, 25 Jan 2020 13:11:15 +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 00PDBFU4077229; Sat, 25 Jan 2020 13:11:15 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00PDBEKE077227; Sat, 25 Jan 2020 13:11:14 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202001251311.00PDBEKE077227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 25 Jan 2020 13:11:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357114 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 357114 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 25 Jan 2020 13:11:15 -0000 Author: tuexen Date: Sat Jan 25 13:11:14 2020 New Revision: 357114 URL: https://svnweb.freebsd.org/changeset/base/357114 Log: As a TCP client only enable ECN when the corresponding sysctl variable indicates that ECN should be negotiated for the client side. Submitted by: Richard Scheffenegger Reviewed by: rgrimes@, tuexen@ MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D23228 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sat Jan 25 10:51:51 2020 (r357113) +++ head/sys/netinet/tcp_input.c Sat Jan 25 13:11:14 2020 (r357114) @@ -1979,7 +1979,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru tp->t_flags |= TF_ACKNOW; if (((thflags & (TH_CWR | TH_ECE)) == TH_ECE) && - V_tcp_do_ecn) { + (V_tcp_do_ecn == 1)) { tp->t_flags2 |= TF2_ECN_PERMIT; TCPSTAT_INC(tcps_ecn_shs); } Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Sat Jan 25 10:51:51 2020 (r357113) +++ head/sys/netinet/tcp_stacks/rack.c Sat Jan 25 13:11:14 2020 (r357114) @@ -6296,7 +6296,7 @@ rack_do_syn_sent(struct mbuf *m, struct tcphdr *th, st } if (((thflags & (TH_CWR | TH_ECE)) == TH_ECE) && - V_tcp_do_ecn) { + (V_tcp_do_ecn == 1)) { tp->t_flags2 |= TF2_ECN_PERMIT; TCPSTAT_INC(tcps_ecn_shs); } From owner-svn-src-all@freebsd.org Sat Jan 25 13:34:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A3F323F976; Sat, 25 Jan 2020 13:34:30 +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 484cS61gtwz4WVH; Sat, 25 Jan 2020 13:34:30 +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 34FA29064; Sat, 25 Jan 2020 13:34:30 +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 00PDYUFG094345; Sat, 25 Jan 2020 13:34:30 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00PDYTsQ094343; Sat, 25 Jan 2020 13:34:29 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202001251334.00PDYTsQ094343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 25 Jan 2020 13:34:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357115 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 357115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 25 Jan 2020 13:34:30 -0000 Author: tuexen Date: Sat Jan 25 13:34:29 2020 New Revision: 357115 URL: https://svnweb.freebsd.org/changeset/base/357115 Log: Don't set the ECT codepoint on retransmitted packets during SACK loss recovery. This is required by RFC 3168. Submitted by: Richard Scheffenegger Reviewed by: rgrimes@, tuexen@, Cheng Cui MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D23118 Modified: head/sys/netinet/tcp_output.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Sat Jan 25 13:11:14 2020 (r357114) +++ head/sys/netinet/tcp_output.c Sat Jan 25 13:34:29 2020 (r357115) @@ -1162,6 +1162,7 @@ send: * Ignore pure ack packets, retransmissions and window probes. */ if (len > 0 && SEQ_GEQ(tp->snd_nxt, tp->snd_max) && + (sack_rxmit == 0) && !((tp->t_flags & TF_FORCEDATA) && len == 1)) { #ifdef INET6 if (isipv6) Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Sat Jan 25 13:11:14 2020 (r357114) +++ head/sys/netinet/tcp_stacks/rack.c Sat Jan 25 13:34:29 2020 (r357115) @@ -9477,6 +9477,7 @@ send: * retransmissions and window probes. */ if (len > 0 && SEQ_GEQ(tp->snd_nxt, tp->snd_max) && + (sack_rxmit == 0) && !((tp->t_flags & TF_FORCEDATA) && len == 1)) { #ifdef INET6 if (isipv6) From owner-svn-src-all@freebsd.org Sat Jan 25 13:45:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0934323FCCE; Sat, 25 Jan 2020 13:45: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 484chQ6PqYz4Wy4; Sat, 25 Jan 2020 13:45:10 +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 D6840925B; Sat, 25 Jan 2020 13:45:10 +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 00PDjAwK000179; Sat, 25 Jan 2020 13:45:10 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00PDjAOU000176; Sat, 25 Jan 2020 13:45:10 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202001251345.00PDjAOU000176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 25 Jan 2020 13:45:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357116 - in head/sys/netinet: . cc tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys/netinet: . cc tcp_stacks X-SVN-Commit-Revision: 357116 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 25 Jan 2020 13:45:11 -0000 Author: tuexen Date: Sat Jan 25 13:45:10 2020 New Revision: 357116 URL: https://svnweb.freebsd.org/changeset/base/357116 Log: Sending CWR after an RTO is according to RFC 3168 generally required and not only for the DCTCP congestion control. Submitted by: Richard Scheffenegger Reviewed by: rgrimes, tuexen@, Cheng Cui MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D23119 Modified: head/sys/netinet/cc/cc_dctcp.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/cc/cc_dctcp.c ============================================================================== --- head/sys/netinet/cc/cc_dctcp.c Sat Jan 25 13:34:29 2020 (r357115) +++ head/sys/netinet/cc/cc_dctcp.c Sat Jan 25 13:45:10 2020 (r357116) @@ -284,7 +284,6 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type) dctcp_data->ece_curr = 1; break; case CC_RTO: - CCV(ccv, t_flags2) |= TF2_ECN_SND_CWR; dctcp_update_alpha(ccv); dctcp_data->save_sndnxt += CCV(ccv, t_maxseg); dctcp_data->num_cong_events++; Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sat Jan 25 13:34:29 2020 (r357115) +++ head/sys/netinet/tcp_input.c Sat Jan 25 13:45:10 2020 (r357116) @@ -460,6 +460,8 @@ cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, ui tp->snd_ssthresh = max(2, min(tp->snd_wnd, tp->snd_cwnd) / 2 / maxseg) * maxseg; tp->snd_cwnd = maxseg; + if (tp->t_flags2 & TF2_ECN_PERMIT) + tp->t_flags2 |= TF2_ECN_SND_CWR; break; case CC_RTO_ERR: TCPSTAT_INC(tcps_sndrexmitbad); Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Sat Jan 25 13:34:29 2020 (r357115) +++ head/sys/netinet/tcp_stacks/rack.c Sat Jan 25 13:45:10 2020 (r357116) @@ -1813,6 +1813,8 @@ rack_cong_signal(struct tcpcb *tp, struct tcphdr *th, tp->snd_ssthresh = max(2, min(tp->snd_wnd, tp->snd_cwnd) / 2 / ctf_fixed_maxseg(tp)) * ctf_fixed_maxseg(tp); tp->snd_cwnd = ctf_fixed_maxseg(tp); + if (tp->t_flags2 & TF2_ECN_PERMIT) + tp->t_flags2 |= TF2_ECN_SND_CWR; break; case CC_RTO_ERR: TCPSTAT_INC(tcps_sndrexmitbad); From owner-svn-src-all@freebsd.org Sat Jan 25 20:37:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E739B1FA4F5; Sat, 25 Jan 2020 20:37:55 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (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 484nrf5xZzz44Qv; Sat, 25 Jan 2020 20:37:54 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x730.google.com with SMTP id w25so84305qki.3; Sat, 25 Jan 2020 12:37:54 -0800 (PST) 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; bh=1VLRAZeOmtWLN/DxEY+ej59BQzW/UWq8r7sj3UDfTVc=; b=In/yZDj/Z5lmg6yf9NIxq+bxmRGLI1O+15SFi1aFC1BK4EVdFbQoiGW3qPSnd8Rf4p sCPLpLbhcq7XWB+rTpMwNX/HXO6jdIQOviCt0AwuX+tXBeWZo2MGwJGlf8lPo+s0qzck 7kjLVQ7cgPgnE6rpYyS3A3Y3BpifbTiGZa4FBbL1E/bOUA0FvZ4XH0o0EgW+aZWwZkBI 862//gfipD28NvBbB/QKMkQiS2I+ZZFcx8YmN4wP8+Z7iGUZcyRdfoIdQMq15bkXrXhg 7S7sOuMb5fNocH3ScqALFw2EbOhZpNmc7fSt0WuA2v0SetG4rioY9awNW5TfUSe7jHvk DTgw== 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; bh=1VLRAZeOmtWLN/DxEY+ej59BQzW/UWq8r7sj3UDfTVc=; b=pn8z0Q4qyn04dKX/woS/7Bw+HW8zfFeqxrvdlnW+licFeZJgE/UvSrLC97lKPt/Mkr a1EHK71w0BF0BhOULQOtX0PxHBTGgQrN5uZRB0MjYPSmtGCx4tDWd3WPtrP1hGaEp9eT D26o4BK0mne7qnmEstKXDduslZdlfcT0Umh92wxCs3z1rxqy7vBh2NI6d0lubajnNXie HYAihCKKj4hUXwBk23fKsADaGCWN/MKG5rdxPzrcjS0WRcpDsi0htOR2ZzNY1yqtj1tY roLkd1Po4QDCVVPj8acUrML18z3LxfIDbhHO0GvgihAKKUxPds1lgNImxBNQEERghBmj j6gA== X-Gm-Message-State: APjAAAXg8x648hVhIkCx/+1Q771QiBx33ADhv5oELv9gow5UTeQX3tqb uvQoqg56b02e60jIp1qkkIZnU1+q X-Google-Smtp-Source: APXvYqyyjIoPyI3OYkrp9HMYkc8dwO0RyfWPx54CAjZ0WYe72oTWDObpfhxhaKWmAlDo3aVnQcjnAA== X-Received: by 2002:a37:905:: with SMTP id 5mr8996677qkj.404.1579984673353; Sat, 25 Jan 2020 12:37:53 -0800 (PST) Received: from raichu (toroon0560w-lp130-05-69-158-183-252.dsl.bell.ca. [69.158.183.252]) by smtp.gmail.com with ESMTPSA id s20sm5715669qkg.131.2020.01.25.12.37.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Jan 2020 12:37:52 -0800 (PST) Sender: Mark Johnston Date: Sat, 25 Jan 2020 15:37:48 -0500 From: Mark Johnston To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r357090 - head/sys/dev/re Message-ID: <20200125203748.GA56065@raichu> References: <202001241724.00OHO3jn066308@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202001241724.00OHO3jn066308@repo.freebsd.org> X-Rspamd-Queue-Id: 484nrf5xZzz44Qv X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=In/yZDj/; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::730 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-4.33 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-2.63)[ip: (-9.24), ipnet: 2607:f8b0::/32(-2.05), asn: 15169(-1.79), country: US(-0.05)]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[0.3.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 25 Jan 2020 20:37:56 -0000 On Fri, Jan 24, 2020 at 05:24:03PM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Fri Jan 24 17:24:02 2020 > New Revision: 357090 > URL: https://svnweb.freebsd.org/changeset/base/357090 > > Log: > re(4) uses taskqueue to process input packets. Enter network epoch > in there. ena(4) and the virtio network driver are similarly broken. > Modified: > head/sys/dev/re/if_re.c > > Modified: head/sys/dev/re/if_re.c > ============================================================================== > --- head/sys/dev/re/if_re.c Fri Jan 24 17:15:31 2020 (r357089) > +++ head/sys/dev/re/if_re.c Fri Jan 24 17:24:02 2020 (r357090) > @@ -2576,6 +2576,7 @@ re_intr(void *arg) > static void > re_int_task(void *arg, int npending) > { > + struct epoch_tracker et; > struct rl_softc *sc; > struct ifnet *ifp; > u_int16_t status; > @@ -2602,8 +2603,11 @@ re_int_task(void *arg, int npending) > } > #endif > > - if (status & (RL_ISR_RX_OK|RL_ISR_RX_ERR|RL_ISR_FIFO_OFLOW)) > + if (status & (RL_ISR_RX_OK|RL_ISR_RX_ERR|RL_ISR_FIFO_OFLOW)) { > + NET_EPOCH_ENTER(et); > rval = re_rxeof(sc, NULL); > + NET_EPOCH_EXIT(et); > + } > > /* > * Some chips will ignore a second TX request issued From owner-svn-src-all@freebsd.org Sat Jan 25 21:09:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE8A11FB21C; Sat, 25 Jan 2020 21:09:16 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 484pXr5QlWz460f; Sat, 25 Jan 2020 21:09:16 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5311E58E; Sat, 25 Jan 2020 21:09:16 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00PL9Gda073335; Sat, 25 Jan 2020 21:09:16 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00PL9C6n073312; Sat, 25 Jan 2020 21:09:12 GMT (envelope-from phil@FreeBSD.org) Message-Id: <202001252109.00PL9C6n073312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Sat, 25 Jan 2020 21:09:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r357123 - in vendor/Juniper/libxo/dist: . doc encoder/csv libxo tests/core tests/core/saved X-SVN-Group: vendor X-SVN-Commit-Author: phil X-SVN-Commit-Paths: in vendor/Juniper/libxo/dist: . doc encoder/csv libxo tests/core tests/core/saved X-SVN-Commit-Revision: 357123 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 25 Jan 2020 21:09:16 -0000 Author: phil Date: Sat Jan 25 21:09:12 2020 New Revision: 357123 URL: https://svnweb.freebsd.org/changeset/base/357123 Log: Import libxo 1.4.0 Modified: vendor/Juniper/libxo/dist/configure.ac vendor/Juniper/libxo/dist/doc/api.rst vendor/Juniper/libxo/dist/doc/encoders.rst vendor/Juniper/libxo/dist/doc/options.rst vendor/Juniper/libxo/dist/encoder/csv/enc_csv.c vendor/Juniper/libxo/dist/libxo/libxo.c vendor/Juniper/libxo/dist/libxo/xo.h vendor/Juniper/libxo/dist/libxo/xo_encoder.c vendor/Juniper/libxo/dist/libxo/xo_encoder.h vendor/Juniper/libxo/dist/tests/core/Makefile.am vendor/Juniper/libxo/dist/tests/core/saved/test_02.H.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.HIPx.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.HP.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.J.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.JP.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.T.err vendor/Juniper/libxo/dist/tests/core/saved/test_02.X.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.XP.out vendor/Juniper/libxo/dist/tests/core/test_02.c vendor/Juniper/libxo/dist/tests/core/test_12.c Modified: vendor/Juniper/libxo/dist/configure.ac ============================================================================== --- vendor/Juniper/libxo/dist/configure.ac Sat Jan 25 16:46:39 2020 (r357122) +++ vendor/Juniper/libxo/dist/configure.ac Sat Jan 25 21:09:12 2020 (r357123) @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libxo], [1.3.1], [phil@juniper.net]) +AC_INIT([libxo], [1.4.0], [phil@juniper.net]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) # Support silent build rules. Requires at least automake-1.11. Modified: vendor/Juniper/libxo/dist/doc/api.rst ============================================================================== --- vendor/Juniper/libxo/dist/doc/api.rst Sat Jan 25 16:46:39 2020 (r357122) +++ vendor/Juniper/libxo/dist/doc/api.rst Sat Jan 25 21:09:12 2020 (r357123) @@ -1204,6 +1204,11 @@ message associated with either *errno* or the *code* p xo_err(1, "cannot open file '%s'", filename); .. index:: xo_error +.. index:: xo_error_h +.. index:: xo_error_hv +.. index:: xo_errorn +.. index:: xo_errorn_h +.. index:: xo_errorn_hv xo_error ~~~~~~~~ @@ -1214,6 +1219,50 @@ xo_error :type fmt: const char * :returns: void +.. c:function:: void xo_error_h (xo_handle_t *xop, const char *fmt, ...) + + :param xop: libxo handle pointer + :type xop: xo_handle_t * + :param fmt: Format string + :type fmt: const char * + :returns: void + +.. c:function:: void xo_error_hv (xo_handle_t *xop, const char *fmt, va_list vap) + + :param xop: libxo handle pointer + :type xop: xo_handle_t * + :param fmt: Format string + :type fmt: const char * + :param vap: variadic arguments + :type xop: va_list + :returns: void + +.. c:function:: void xo_errorn (const char *fmt, ...) + + :param fmt: Format string + :type fmt: const char * + :returns: void + +.. c:function:: void xo_errorn_h (xo_handle_t *xop, const char *fmt, ...) + + :param xop: libxo handle pointer + :type xop: xo_handle_t * + :param fmt: Format string + :type fmt: const char * + :returns: void + +.. c:function:: void xo_errorn_hv (xo_handle_t *xop, int need_newline, const char *fmt, va_list vap) + + :param xop: libxo handle pointer + :type xop: xo_handle_t * + :param need_newline: boolean indicating need for trailing newline + :type need_newline: int + :param fmt: Format string + :type fmt: const char * + :param vap: variadic arguments + :type xop: va_list + :returns: void + The `xo_error` function can be used for generic errors that should be reported over the handle, rather than to stderr. The `xo_error` function behaves like `xo_err` for TEXT and HTML output styles, but @@ -1225,6 +1274,16 @@ xo_error Does not compute JSON:: "error": { "message": "Does not compute" } + + The `xo_error_h` and `xo_error_hv` add a handle object and a + variadic-ized parameter to the signature, respectively. + + The `xo_errorn` function supplies a newline at the end the error + message if the format string does not include one. The + `xo_errorn_h` and `xo_errorn_hv` functions add a handle object and + a variadic-ized parameter to the signature, respectively. The + `xo_errorn_hv` function also adds a boolean to indicate the need for + a trailing newline. .. index:: xo_no_setlocale .. index:: Locale Modified: vendor/Juniper/libxo/dist/doc/encoders.rst ============================================================================== --- vendor/Juniper/libxo/dist/doc/encoders.rst Sat Jan 25 16:46:39 2020 (r357122) +++ vendor/Juniper/libxo/dist/doc/encoders.rst Sat Jan 25 21:09:12 2020 (r357123) @@ -26,12 +26,13 @@ example uses the "cbor" encoder, saving the output int df --libxo encoder=cbor > df-output.cbor Encoders can support specific options that can be accessed by -following the encoder name with a colon (':') and one of more options, -separated by a plus sign "+":: +following the encoder name with a colon (':') or a plus sign ('+') and +one of more options, separated by the same character:: - df --libxo encoder=csv:path=filesystem+leaf=name+no-header + df --libxo encoder=csv+path=filesystem+leaf=name+no-header + df --libxo encoder=csv:path=filesystem:leaf=name:no-header -This example instructs libxo to load the "csv" encoder and pass the +These examples instructs libxo to load the "csv" encoder and pass the following options:: path=filesystem @@ -41,6 +42,10 @@ following options:: Each of these option is interpreted by the encoder, and all such options names and semantics are specific to the particular encoder. Refer to the intended encoder for documentation on its options. + +The string "@" can be used in place of the string "encoder=". + + df --libxo @csv:no-header .. _csv_encoder: Modified: vendor/Juniper/libxo/dist/doc/options.rst ============================================================================== --- vendor/Juniper/libxo/dist/doc/options.rst Sat Jan 25 16:46:39 2020 (r357122) +++ vendor/Juniper/libxo/dist/doc/options.rst Sat Jan 25 21:09:12 2020 (r357123) @@ -162,3 +162,23 @@ foreground and background output to "yellow", give onl mapping, skipping the first four mappings with bare plus signs ("+"):: --libxo colors=++++yellow/yellow + +Encoders +-------- + +In addition to the four "built-in" formats, libxo supports an +extensible mechanism for adding encoders. These are activated +using the "encoder" keyword:: + + --libxo encoder=cbor + +The encoder can include encoder-specific options, separated by either +colons (":") or plus signs ("+"): + + --libxo encoder=csv+path=filesystem+leaf=name+no-header + --libxo encoder=csv:path=filesystem:leaf=name:no-header + +For brevity, the string "@" can be used in place of the string +"encoder=". + + df --libxo @csv:no-header Modified: vendor/Juniper/libxo/dist/encoder/csv/enc_csv.c ============================================================================== --- vendor/Juniper/libxo/dist/encoder/csv/enc_csv.c Sat Jan 25 16:46:39 2020 (r357122) +++ vendor/Juniper/libxo/dist/encoder/csv/enc_csv.c Sat Jan 25 21:09:12 2020 (r357123) @@ -41,10 +41,12 @@ * (double) quote characters. * - Leading and trialing whitespace require fields be quoted. * - * Cheesy, but simple. The RFC also requires MS-DOS end-of-line, which - * we only do with the "dos" option. Strange that we still live in a - * DOS-friendly world, but then again, we make spaceships based on the - * horse butts (http://www.astrodigital.org/space/stshorse.html). + * Cheesy, but simple. The RFC also requires MS-DOS end-of-line, + * which we only do with the "dos" option. Strange that we still live + * in a DOS-friendly world, but then again, we make spaceships based + * on the horse butts (http://www.astrodigital.org/space/stshorse.html + * though the "built by English expatriates” bit is rubbish; better to + * say the first engines used in America were built by Englishmen.) */ #include @@ -655,10 +657,12 @@ csv_record_path (xo_handle_t *xop, csv_private_t *csv, /* * Extract the option values. The format is: - * -libxo encoder=csv:kw=val+kw=val+kw=val,pretty,etc + * -libxo encoder=csv:kw=val:kw=val:kw=val,pretty + * -libxo encoder=csv+kw=val+kw=val+kw=val,pretty */ static int -csv_options (xo_handle_t *xop, csv_private_t *csv, const char *raw_opts) +csv_options (xo_handle_t *xop, csv_private_t *csv, + const char *raw_opts, char opts_char) { ssize_t len = strlen(raw_opts); char *options = alloca(len + 1); @@ -667,7 +671,7 @@ csv_options (xo_handle_t *xop, csv_private_t *csv, con char *cp, *ep, *np, *vp; for (cp = options, ep = options + len + 1; cp && cp < ep; cp = np) { - np = strchr(cp, '+'); + np = strchr(cp, opts_char); if (np) *np++ = '\0'; @@ -761,7 +765,11 @@ csv_handler (XO_ENCODER_HANDLER_ARGS) break; case XO_OP_OPTIONS: - rc = csv_options(xop, csv, value); + rc = csv_options(xop, csv, value, ':'); + break; + + case XO_OP_OPTIONS_PLUS: + rc = csv_options(xop, csv, value, '+'); break; case XO_OP_OPEN_LIST: Modified: vendor/Juniper/libxo/dist/libxo/libxo.c ============================================================================== --- vendor/Juniper/libxo/dist/libxo/libxo.c Sat Jan 25 16:46:39 2020 (r357122) +++ vendor/Juniper/libxo/dist/libxo/libxo.c Sat Jan 25 21:09:12 2020 (r357123) @@ -2371,6 +2371,25 @@ xo_set_options (xo_handle_t *xop, const char *input) if (np) *np++ = '\0'; + /* + * "@foo" is a shorthand for "encoder=foo". This is driven + * chiefly by a desire to make pluggable encoders not appear + * so distinct from built-in encoders. + */ + if (*cp == '@') { + vp = cp + 1; + + if (*vp == '\0') + xo_failure(xop, "missing value for encoder option"); + else { + rc = xo_encoder_init(xop, vp); + if (rc) + xo_warnx("error initializing encoder: %s", vp); + } + + continue; + } + vp = strchr(cp, '='); if (vp) *vp++ = '\0'; @@ -8007,7 +8026,7 @@ xo_finish_atexit (void) * Generate an error message, such as would be displayed on stderr */ void -xo_error_hv (xo_handle_t *xop, const char *fmt, va_list vap) +xo_errorn_hv (xo_handle_t *xop, int need_newline, const char *fmt, va_list vap) { xop = xo_default(xop); @@ -8015,13 +8034,15 @@ xo_error_hv (xo_handle_t *xop, const char *fmt, va_lis * If the format string doesn't end with a newline, we pop * one on ourselves. */ - ssize_t len = strlen(fmt); - if (len > 0 && fmt[len - 1] != '\n') { - char *newfmt = alloca(len + 2); - memcpy(newfmt, fmt, len); - newfmt[len] = '\n'; - newfmt[len + 1] = '\0'; - fmt = newfmt; + if (need_newline) { + ssize_t len = strlen(fmt); + if (len > 0 && fmt[len - 1] != '\n') { + char *newfmt = alloca(len + 2); + memcpy(newfmt, fmt, len); + newfmt[len] = '\n'; + newfmt[len + 1] = '\0'; + fmt = newfmt; + } } switch (xo_style(xop)) { @@ -8069,7 +8090,7 @@ xo_error_h (xo_handle_t *xop, const char *fmt, ...) va_list vap; va_start(vap, fmt); - xo_error_hv(xop, fmt, vap); + xo_errorn_hv(xop, 0, fmt, vap); va_end(vap); } @@ -8082,11 +8103,34 @@ xo_error (const char *fmt, ...) va_list vap; va_start(vap, fmt); - xo_error_hv(NULL, fmt, vap); + xo_errorn_hv(NULL, 0, fmt, vap); va_end(vap); } +void +xo_errorn_h (xo_handle_t *xop, const char *fmt, ...) +{ + va_list vap; + + va_start(vap, fmt); + xo_errorn_hv(xop, 1, fmt, vap); + va_end(vap); +} + /* + * Generate an error message, such as would be displayed on stderr + */ +void +xo_errorn (const char *fmt, ...) +{ + va_list vap; + + va_start(vap, fmt); + xo_errorn_hv(NULL, 1, fmt, vap); + va_end(vap); +} + +/* * Parse any libxo-specific options from the command line, removing them * so the main() argument parsing won't see them. We return the new value * for argc or -1 for error. If an error occurred, the program should @@ -8099,21 +8143,30 @@ xo_parse_args (int argc, char **argv) char *cp; int i, save; - /* Save our program name for xo_err and friends */ - xo_program = argv[0]; - cp = strrchr(xo_program, '/'); - if (cp) - xo_program = ++cp; - else - cp = argv[0]; /* Reset to front of string */ + /* + * If xo_set_program has always been called, we honor that value + */ + if (xo_program == NULL) { + /* Save our program name for xo_err and friends */ + xo_program = argv[0]; + cp = strrchr(xo_program, '/'); + if (cp) + xo_program = ++cp; + else + cp = argv[0]; /* Reset to front of string */ - /* GNU tools add an annoying ".test" as the program extension; remove it */ - size_t len = strlen(xo_program); - static const char gnu_ext[] = ".test"; - if (len >= sizeof(gnu_ext)) { - cp += len + 1 - sizeof(gnu_ext); - if (xo_streq(cp, gnu_ext)) - *cp = '\0'; + /* + * GNU libtool add an annoying ".test" as the program + * extension; we remove it. libtool also adds a "lt-" prefix + * that we cannot remove. + */ + size_t len = strlen(xo_program); + static const char gnu_ext[] = ".test"; + if (len >= sizeof(gnu_ext)) { + cp += len + 1 - sizeof(gnu_ext); + if (xo_streq(cp, gnu_ext)) + *cp = '\0'; + } } xo_handle_t *xop = xo_default(NULL); Modified: vendor/Juniper/libxo/dist/libxo/xo.h ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo.h Sat Jan 25 16:46:39 2020 (r357122) +++ vendor/Juniper/libxo/dist/libxo/xo.h Sat Jan 25 21:09:12 2020 (r357123) @@ -389,6 +389,15 @@ xo_error_h (xo_handle_t *xop, const char *fmt, ...); void xo_error (const char *fmt, ...); +void +xo_errorn_hv (xo_handle_t *xop, int need_newline, const char *fmt, va_list vap); + +void +xo_errorn_h (xo_handle_t *xop, const char *fmt, ...); + +void +xo_errorn (const char *fmt, ...); + xo_ssize_t xo_flush_h (xo_handle_t *xop); Modified: vendor/Juniper/libxo/dist/libxo/xo_encoder.c ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_encoder.c Sat Jan 25 16:46:39 2020 (r357122) +++ vendor/Juniper/libxo/dist/libxo/xo_encoder.c Sat Jan 25 21:09:12 2020 (r357123) @@ -290,8 +290,21 @@ xo_encoder_init (xo_handle_t *xop, const char *name) { xo_encoder_setup(); - const char *opts = strchr(name, ':'); + char opts_char = '\0'; + const char *col_opts = strchr(name, ':'); + const char *plus_opts = strchr(name, '+'); + + /* + * Find the option-separating character (plus or colon) which + * appears first in the options string. + */ + const char *opts = (col_opts == NULL) ? plus_opts + : (plus_opts == NULL) ? col_opts + : (plus_opts < col_opts) ? plus_opts : col_opts; + if (opts) { + opts_char = *opts; + /* Make a writable copy of the name */ size_t len = strlen(name); char *copy = alloca(len + 1); @@ -329,7 +342,11 @@ xo_encoder_init (xo_handle_t *xop, const char *name) int rc = xo_encoder_handle(xop, XO_OP_CREATE, name, NULL, 0); if (rc == 0 && opts != NULL) { - rc = xo_encoder_handle(xop, XO_OP_OPTIONS, name, opts, 0); + xo_encoder_op_t op; + + /* Encoder API is limited, so we're stuck with two different options */ + op = (opts_char == '+') ? XO_OP_OPTIONS_PLUS : XO_OP_OPTIONS; + rc = xo_encoder_handle(xop, op, name, opts, 0); } return rc; Modified: vendor/Juniper/libxo/dist/libxo/xo_encoder.h ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_encoder.h Sat Jan 25 16:46:39 2020 (r357122) +++ vendor/Juniper/libxo/dist/libxo/xo_encoder.h Sat Jan 25 21:09:12 2020 (r357123) @@ -90,6 +90,7 @@ typedef unsigned xo_encoder_op_t; #define XO_OP_ATTRIBUTE 15 /* Attribute name/value */ #define XO_OP_VERSION 16 /* Version string */ #define XO_OP_OPTIONS 17 /* Additional command line options */ +#define XO_OP_OPTIONS_PLUS 18 /* Additional command line options */ #define XO_ENCODER_HANDLER_ARGS \ xo_handle_t *xop __attribute__ ((__unused__)), \ Modified: vendor/Juniper/libxo/dist/tests/core/Makefile.am ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/Makefile.am Sat Jan 25 16:46:39 2020 (r357122) +++ vendor/Juniper/libxo/dist/tests/core/Makefile.am Sat Jan 25 21:09:12 2020 (r357123) @@ -88,7 +88,7 @@ TEST_JIG = \ TEST_JIG2 = \ echo "... $$test ... $$fmt ..."; \ -xoopts==warn,encoder=csv$$csv ; \ +xoopts==warn,$$csv ; \ ${TEST_JIG}; true; TEST_FORMATS = T XP JP HP X J H HIPx @@ -111,9 +111,12 @@ test tests: ${bin_PROGRAMS} done) \ done) -@ (${TEST_TRACE} test=test_01.c; base=test_01; \ - ( fmt=Ecsv1; csv= ; ${TEST_JIG2} ); \ - ( fmt=Ecsv2; csv=:path=top/data/item+no-header ; ${TEST_JIG2} ); \ - ( fmt=Ecsv3; csv=:path=item+leafs=sku.sold+no-quotes ; ${TEST_JIG2} ); \ + ( fmt=Ecsv1; csv=encoder=csv ; \ + ${TEST_JIG2} ); \ + ( fmt=Ecsv2; csv=encoder=csv:path=top/data/item:no-header ; \ + ${TEST_JIG2} ); \ + ( fmt=Ecsv3; csv=@csv:path=item:leafs=sku.sold:no-quotes ; \ + ${TEST_JIG2} ); \ ) Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.H.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.H.out Sat Jan 25 16:46:39 2020 (r357122) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.H.out Sat Jan 25 21:09:12 2020 (r357123) @@ -4,4 +4,7 @@
length
abcdef
close
-1
returned
Bad file descriptor
good
close
-1
returned
Bad fi
good
improper use of profanity; ten yard penalty; first down
20
30
40
file
0
bytes
1
byte
2
bytes
3
bytes
4
bytes
10
/
20
/
30
mbufs <&> in use (current/cache/total)
50
from
Boston
64
left out of
640
64
left out of
640
beforeworkingafter:
string
:
10
11
1010
packets here/there/everywhere
1010
packets here/there/everywhere
(
15
/
20
/
125
)
(
15
/
20
/
125
)
(
15
/
20
/
125
)
(
15
/
20
/
125
)
Humanize:
21
,
57 K
,
96M
,
44M
,
1.2G
one
two
three
(null)
1:
1000
2:
test5000
3:
ten-longx
4:
xtest
this is an error
two more errors
this is an warning
two more warnings
V1/V2 packets
:
10
0004
tries
improper use of profanity; ten yard penalty; first down
Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<> +
err message (1)
err message (2) +
err message (1) +
err message (2)
\ No newline at end of file Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.HIPx.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.HIPx.out Sat Jan 25 16:46:39 2020 (r357122) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.HIPx.out Sat Jan 25 21:09:12 2020 (r357123) @@ -225,3 +225,18 @@
Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<>
+
+
err message (1)
+
+
+
err message (2) +
+
+
+
err message (1) +
+
+
+
err message (2) +
+
Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.HP.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.HP.out Sat Jan 25 16:46:39 2020 (r357122) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.HP.out Sat Jan 25 21:09:12 2020 (r357123) @@ -225,3 +225,18 @@
Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<>
+
+
err message (1)
+
+
+
err message (2) +
+
+
+
err message (1) +
+
+
+
err message (2) +
+
Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.J.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.J.out Sat Jan 25 16:46:39 2020 (r357122) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.J.out Sat Jan 25 21:09:12 2020 (r357123) @@ -1 +1 @@ -{"top": {"data": {"name":"em0","flags":"0x8843","name":"em0","flags":"0x8843","what":"braces","length":"abcdef","fd":-1,"error":"Bad file descriptor","test":"good","fd":-1,"error":"Bad fi","test":"good","lines":20,"words":30,"characters":40, "bytes": [0,1,2,3,4],"mbuf-current":10,"mbuf-cache":20,"mbuf-total":30,"distance":50,"location":"Boston","memory":64,"total":640,"memory":64,"total":640,"ten":10,"eleven":11,"unknown":1010,"unknown":1010,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"val1":21,"val2":58368,"val3":100663296,"val4":44470272,"val5":1342172800, "flag": ["one","two","three"],"works":null,"empty-tag":true,"t1":"1000","t2":"test5000","t3":"ten-longx","t4":"xtest", "__error": {"message":"this is an error"}, "__error": {"message":"two more errors"}, "__warning": {"message":"this is an warning"}, "__warning": {"message":"two more warnings"},"count":10,"test":4, "error": {"message":"Shut 'er down, Clancey! S he's a-pumpin' mud! <>!,\"!<>\n"}}}} +{"top": {"data": {"name":"em0","flags":"0x8843","name":"em0","flags":"0x8843","what":"braces","length":"abcdef","fd":-1,"error":"Bad file descriptor","test":"good","fd":-1,"error":"Bad fi","test":"good","lines":20,"words":30,"characters":40, "bytes": [0,1,2,3,4],"mbuf-current":10,"mbuf-cache":20,"mbuf-total":30,"distance":50,"location":"Boston","memory":64,"total":640,"memory":64,"total":640,"ten":10,"eleven":11,"unknown":1010,"unknown":1010,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"val1":21,"val2":58368,"val3":100663296,"val4":44470272,"val5":1342172800, "flag": ["one","two","three"],"works":null,"empty-tag":true,"t1":"1000","t2":"test5000","t3":"ten-longx","t4":"xtest", "__error": {"message":"this is an error"}, "__error": {"message":"two more errors"}, "__warning": {"message":"this is an warning"}, "__warning": {"message":"two more warnings"},"count":10,"test":4, "error": {"message":"Shut 'er down, Clancey! S he's a-pumpin' mud! <>!,\"!<>\n"}, "error": {"message":"err message (1)"}, "error": {"message":"err message (2)\n"}, "error": {"message":"err message (1)\n"}, "error": {"message":"err message (2)\n"}}}} Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.JP.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.JP.out Sat Jan 25 16:46:39 2020 (r357122) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.JP.out Sat Jan 25 21:09:12 2020 (r357123) @@ -80,6 +80,18 @@ "test": 4, "error": { "message": "Shut 'er down, Clancey! She's a-pumpin' mud! <>!,\"!<>\n" + }, + "error": { + "message": "err message (1)" + }, + "error": { + "message": "err message (2)\n" + }, + "error": { + "message": "err message (1)\n" + }, + "error": { + "message": "err message (2)\n" } } } Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.T.err ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.T.err Sat Jan 25 16:46:39 2020 (r357122) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.T.err Sat Jan 25 21:09:12 2020 (r357123) @@ -1,2 +1,5 @@ test_02: key field emitted after normal value field: 'name' Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<> +err message (1)err message (2) +err message (1) +err message (2) Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.X.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.X.out Sat Jan 25 16:46:39 2020 (r357122) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.X.out Sat Jan 25 21:09:12 2020 (r357123) @@ -4,4 +4,7 @@ abcdef-1Bad file descriptorgood-1Bad figoodimproper use of profanity; ten yard penalty; first down 2030400123410203050Boston646406464010111010101015201251520125152012515201252158368100663296444702721342172800onetwothreenull1000test5000ten-longxxtest<__error>this is an error<__error>two more er rors<__warning>this is an warning<__warning>two more warnings104improper use of profanity; ten yard penalty; first down Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<> +err message (1)err message (2) +err message (1) +err message (2) \ No newline at end of file Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.XP.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.XP.out Sat Jan 25 16:46:39 2020 (r357122) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.XP.out Sat Jan 25 21:09:12 2020 (r357123) @@ -87,5 +87,20 @@ Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<> + + err message (1) + + + err message (2) + + + + err message (1) + + + + err message (2) + + Modified: vendor/Juniper/libxo/dist/tests/core/test_02.c ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/test_02.c Sat Jan 25 16:46:39 2020 (r357122) +++ vendor/Juniper/libxo/dist/tests/core/test_02.c Sat Jan 25 21:09:12 2020 (r357123) @@ -21,6 +21,8 @@ int main (int argc, char **argv) { + xo_set_program("test_02"); + argc = xo_parse_args(argc, argv); if (argc < 0) return 1; @@ -144,6 +146,10 @@ main (int argc, char **argv) "ten yard penalty", "first down"); xo_error("Shut 'er down, Clancey! She's a-pumpin' mud! <>!,\"!<>\n"); + xo_error("err message (%d)", 1); + xo_error("err message (%d)\n", 2); + xo_errorn("err message (%d)", 1); + xo_errorn("err message (%d)\n", 2); xo_close_container("data"); Modified: vendor/Juniper/libxo/dist/tests/core/test_12.c ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/test_12.c Sat Jan 25 16:46:39 2020 (r357122) +++ vendor/Juniper/libxo/dist/tests/core/test_12.c Sat Jan 25 21:09:12 2020 (r357123) @@ -25,6 +25,8 @@ main (int argc, char **argv) xo_emit_flags_t flags = XOEF_RETAIN; int opt_color = 1; + xo_set_program("test_12"); + argc = xo_parse_args(argc, argv); if (argc < 0) return 1; From owner-svn-src-all@freebsd.org Sat Jan 25 21:09:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 705AE1FB255; Sat, 25 Jan 2020 21:09:28 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 484pY42K29z46Lf; Sat, 25 Jan 2020 21:09:28 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 309D3E58F; Sat, 25 Jan 2020 21:09:28 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00PL9S2Y073387; Sat, 25 Jan 2020 21:09:28 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00PL9S6p073386; Sat, 25 Jan 2020 21:09:28 GMT (envelope-from phil@FreeBSD.org) Message-Id: <202001252109.00PL9S6p073386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Sat, 25 Jan 2020 21:09:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r357124 - vendor/Juniper/libxo/1.4.0 X-SVN-Group: vendor X-SVN-Commit-Author: phil X-SVN-Commit-Paths: vendor/Juniper/libxo/1.4.0 X-SVN-Commit-Revision: 357124 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 25 Jan 2020 21:09:28 -0000 Author: phil Date: Sat Jan 25 21:09:27 2020 New Revision: 357124 URL: https://svnweb.freebsd.org/changeset/base/357124 Log: Tag libxo 1.4.0 Added: - copied from r357123, vendor/Juniper/libxo/dist/ Directory Properties: vendor/Juniper/libxo/1.4.0/ (props changed) From owner-svn-src-all@freebsd.org Sat Jan 25 21:16:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 566951FB923; Sat, 25 Jan 2020 21:16:50 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 484pjZ2HKwz4756; Sat, 25 Jan 2020 21:16:50 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45241E76F; Sat, 25 Jan 2020 21:16:50 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00PLGoYF079389; Sat, 25 Jan 2020 21:16:50 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00PLGjcQ079363; Sat, 25 Jan 2020 21:16:45 GMT (envelope-from phil@FreeBSD.org) Message-Id: <202001252116.00PLGjcQ079363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Sat, 25 Jan 2020 21:16:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357125 - in head: contrib/libxo contrib/libxo/doc contrib/libxo/encoder/csv contrib/libxo/libxo contrib/libxo/tests/core contrib/libxo/tests/core/saved lib/libxo lib/libxo/libxo usr.bi... X-SVN-Group: head X-SVN-Commit-Author: phil X-SVN-Commit-Paths: in head: contrib/libxo contrib/libxo/doc contrib/libxo/encoder/csv contrib/libxo/libxo contrib/libxo/tests/core contrib/libxo/tests/core/saved lib/libxo lib/libxo/libxo usr.bin/xohtml X-SVN-Commit-Revision: 357125 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 25 Jan 2020 21:16:50 -0000 Author: phil Date: Sat Jan 25 21:16:45 2020 New Revision: 357125 URL: https://svnweb.freebsd.org/changeset/base/357125 Log: Import libxo-1.4.0: - Two changes to encoder options: encoder options may use plus or colon, but only one encoder names can be specified as "@name" This results in the syntax: df --libxo @csv:no-header:leafs=name.available-blocks / - If xo_set_program is called before xo_parse_args, honor the requested value - add xo_errorn* function; repair newline-adding-on-xo_error bug - test programs now use fixed name, since linux libtool prefixs "lt-" - Fix "horse butt" comment in source code - update test cases PR: 242686 Modified: head/contrib/libxo/configure.ac head/contrib/libxo/doc/api.rst head/contrib/libxo/doc/encoders.rst head/contrib/libxo/doc/options.rst head/contrib/libxo/encoder/csv/enc_csv.c head/contrib/libxo/libxo/libxo.c head/contrib/libxo/libxo/xo.h head/contrib/libxo/libxo/xo_encoder.c head/contrib/libxo/libxo/xo_encoder.h head/contrib/libxo/tests/core/Makefile.am head/contrib/libxo/tests/core/saved/test_02.H.out head/contrib/libxo/tests/core/saved/test_02.HIPx.out head/contrib/libxo/tests/core/saved/test_02.HP.out head/contrib/libxo/tests/core/saved/test_02.J.out head/contrib/libxo/tests/core/saved/test_02.JP.out head/contrib/libxo/tests/core/saved/test_02.T.err head/contrib/libxo/tests/core/saved/test_02.X.out head/contrib/libxo/tests/core/saved/test_02.XP.out head/contrib/libxo/tests/core/test_02.c head/contrib/libxo/tests/core/test_12.c head/lib/libxo/add.man head/lib/libxo/libxo/xo_config.h head/usr.bin/xohtml/xohtml.sh Directory Properties: head/contrib/libxo/ (props changed) Modified: head/contrib/libxo/configure.ac ============================================================================== --- head/contrib/libxo/configure.ac Sat Jan 25 21:09:27 2020 (r357124) +++ head/contrib/libxo/configure.ac Sat Jan 25 21:16:45 2020 (r357125) @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libxo], [1.3.1], [phil@juniper.net]) +AC_INIT([libxo], [1.4.0], [phil@juniper.net]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) # Support silent build rules. Requires at least automake-1.11. Modified: head/contrib/libxo/doc/api.rst ============================================================================== --- head/contrib/libxo/doc/api.rst Sat Jan 25 21:09:27 2020 (r357124) +++ head/contrib/libxo/doc/api.rst Sat Jan 25 21:16:45 2020 (r357125) @@ -1204,6 +1204,11 @@ message associated with either *errno* or the *code* p xo_err(1, "cannot open file '%s'", filename); .. index:: xo_error +.. index:: xo_error_h +.. index:: xo_error_hv +.. index:: xo_errorn +.. index:: xo_errorn_h +.. index:: xo_errorn_hv xo_error ~~~~~~~~ @@ -1214,6 +1219,50 @@ xo_error :type fmt: const char * :returns: void +.. c:function:: void xo_error_h (xo_handle_t *xop, const char *fmt, ...) + + :param xop: libxo handle pointer + :type xop: xo_handle_t * + :param fmt: Format string + :type fmt: const char * + :returns: void + +.. c:function:: void xo_error_hv (xo_handle_t *xop, const char *fmt, va_list vap) + + :param xop: libxo handle pointer + :type xop: xo_handle_t * + :param fmt: Format string + :type fmt: const char * + :param vap: variadic arguments + :type xop: va_list + :returns: void + +.. c:function:: void xo_errorn (const char *fmt, ...) + + :param fmt: Format string + :type fmt: const char * + :returns: void + +.. c:function:: void xo_errorn_h (xo_handle_t *xop, const char *fmt, ...) + + :param xop: libxo handle pointer + :type xop: xo_handle_t * + :param fmt: Format string + :type fmt: const char * + :returns: void + +.. c:function:: void xo_errorn_hv (xo_handle_t *xop, int need_newline, const char *fmt, va_list vap) + + :param xop: libxo handle pointer + :type xop: xo_handle_t * + :param need_newline: boolean indicating need for trailing newline + :type need_newline: int + :param fmt: Format string + :type fmt: const char * + :param vap: variadic arguments + :type xop: va_list + :returns: void + The `xo_error` function can be used for generic errors that should be reported over the handle, rather than to stderr. The `xo_error` function behaves like `xo_err` for TEXT and HTML output styles, but @@ -1225,6 +1274,16 @@ xo_error Does not compute JSON:: "error": { "message": "Does not compute" } + + The `xo_error_h` and `xo_error_hv` add a handle object and a + variadic-ized parameter to the signature, respectively. + + The `xo_errorn` function supplies a newline at the end the error + message if the format string does not include one. The + `xo_errorn_h` and `xo_errorn_hv` functions add a handle object and + a variadic-ized parameter to the signature, respectively. The + `xo_errorn_hv` function also adds a boolean to indicate the need for + a trailing newline. .. index:: xo_no_setlocale .. index:: Locale Modified: head/contrib/libxo/doc/encoders.rst ============================================================================== --- head/contrib/libxo/doc/encoders.rst Sat Jan 25 21:09:27 2020 (r357124) +++ head/contrib/libxo/doc/encoders.rst Sat Jan 25 21:16:45 2020 (r357125) @@ -26,12 +26,13 @@ example uses the "cbor" encoder, saving the output int df --libxo encoder=cbor > df-output.cbor Encoders can support specific options that can be accessed by -following the encoder name with a colon (':') and one of more options, -separated by a plus sign "+":: +following the encoder name with a colon (':') or a plus sign ('+') and +one of more options, separated by the same character:: - df --libxo encoder=csv:path=filesystem+leaf=name+no-header + df --libxo encoder=csv+path=filesystem+leaf=name+no-header + df --libxo encoder=csv:path=filesystem:leaf=name:no-header -This example instructs libxo to load the "csv" encoder and pass the +These examples instructs libxo to load the "csv" encoder and pass the following options:: path=filesystem @@ -41,6 +42,10 @@ following options:: Each of these option is interpreted by the encoder, and all such options names and semantics are specific to the particular encoder. Refer to the intended encoder for documentation on its options. + +The string "@" can be used in place of the string "encoder=". + + df --libxo @csv:no-header .. _csv_encoder: Modified: head/contrib/libxo/doc/options.rst ============================================================================== --- head/contrib/libxo/doc/options.rst Sat Jan 25 21:09:27 2020 (r357124) +++ head/contrib/libxo/doc/options.rst Sat Jan 25 21:16:45 2020 (r357125) @@ -162,3 +162,23 @@ foreground and background output to "yellow", give onl mapping, skipping the first four mappings with bare plus signs ("+"):: --libxo colors=++++yellow/yellow + +Encoders +-------- + +In addition to the four "built-in" formats, libxo supports an +extensible mechanism for adding encoders. These are activated +using the "encoder" keyword:: + + --libxo encoder=cbor + +The encoder can include encoder-specific options, separated by either +colons (":") or plus signs ("+"): + + --libxo encoder=csv+path=filesystem+leaf=name+no-header + --libxo encoder=csv:path=filesystem:leaf=name:no-header + +For brevity, the string "@" can be used in place of the string +"encoder=". + + df --libxo @csv:no-header Modified: head/contrib/libxo/encoder/csv/enc_csv.c ============================================================================== --- head/contrib/libxo/encoder/csv/enc_csv.c Sat Jan 25 21:09:27 2020 (r357124) +++ head/contrib/libxo/encoder/csv/enc_csv.c Sat Jan 25 21:16:45 2020 (r357125) @@ -41,10 +41,12 @@ * (double) quote characters. * - Leading and trialing whitespace require fields be quoted. * - * Cheesy, but simple. The RFC also requires MS-DOS end-of-line, which - * we only do with the "dos" option. Strange that we still live in a - * DOS-friendly world, but then again, we make spaceships based on the - * horse butts (http://www.astrodigital.org/space/stshorse.html). + * Cheesy, but simple. The RFC also requires MS-DOS end-of-line, + * which we only do with the "dos" option. Strange that we still live + * in a DOS-friendly world, but then again, we make spaceships based + * on the horse butts (http://www.astrodigital.org/space/stshorse.html + * though the "built by English expatriates” bit is rubbish; better to + * say the first engines used in America were built by Englishmen.) */ #include @@ -655,10 +657,12 @@ csv_record_path (xo_handle_t *xop, csv_private_t *csv, /* * Extract the option values. The format is: - * -libxo encoder=csv:kw=val+kw=val+kw=val,pretty,etc + * -libxo encoder=csv:kw=val:kw=val:kw=val,pretty + * -libxo encoder=csv+kw=val+kw=val+kw=val,pretty */ static int -csv_options (xo_handle_t *xop, csv_private_t *csv, const char *raw_opts) +csv_options (xo_handle_t *xop, csv_private_t *csv, + const char *raw_opts, char opts_char) { ssize_t len = strlen(raw_opts); char *options = alloca(len + 1); @@ -667,7 +671,7 @@ csv_options (xo_handle_t *xop, csv_private_t *csv, con char *cp, *ep, *np, *vp; for (cp = options, ep = options + len + 1; cp && cp < ep; cp = np) { - np = strchr(cp, '+'); + np = strchr(cp, opts_char); if (np) *np++ = '\0'; @@ -761,7 +765,11 @@ csv_handler (XO_ENCODER_HANDLER_ARGS) break; case XO_OP_OPTIONS: - rc = csv_options(xop, csv, value); + rc = csv_options(xop, csv, value, ':'); + break; + + case XO_OP_OPTIONS_PLUS: + rc = csv_options(xop, csv, value, '+'); break; case XO_OP_OPEN_LIST: Modified: head/contrib/libxo/libxo/libxo.c ============================================================================== --- head/contrib/libxo/libxo/libxo.c Sat Jan 25 21:09:27 2020 (r357124) +++ head/contrib/libxo/libxo/libxo.c Sat Jan 25 21:16:45 2020 (r357125) @@ -2371,6 +2371,25 @@ xo_set_options (xo_handle_t *xop, const char *input) if (np) *np++ = '\0'; + /* + * "@foo" is a shorthand for "encoder=foo". This is driven + * chiefly by a desire to make pluggable encoders not appear + * so distinct from built-in encoders. + */ + if (*cp == '@') { + vp = cp + 1; + + if (*vp == '\0') + xo_failure(xop, "missing value for encoder option"); + else { + rc = xo_encoder_init(xop, vp); + if (rc) + xo_warnx("error initializing encoder: %s", vp); + } + + continue; + } + vp = strchr(cp, '='); if (vp) *vp++ = '\0'; @@ -8007,7 +8026,7 @@ xo_finish_atexit (void) * Generate an error message, such as would be displayed on stderr */ void -xo_error_hv (xo_handle_t *xop, const char *fmt, va_list vap) +xo_errorn_hv (xo_handle_t *xop, int need_newline, const char *fmt, va_list vap) { xop = xo_default(xop); @@ -8015,13 +8034,15 @@ xo_error_hv (xo_handle_t *xop, const char *fmt, va_lis * If the format string doesn't end with a newline, we pop * one on ourselves. */ - ssize_t len = strlen(fmt); - if (len > 0 && fmt[len - 1] != '\n') { - char *newfmt = alloca(len + 2); - memcpy(newfmt, fmt, len); - newfmt[len] = '\n'; - newfmt[len + 1] = '\0'; - fmt = newfmt; + if (need_newline) { + ssize_t len = strlen(fmt); + if (len > 0 && fmt[len - 1] != '\n') { + char *newfmt = alloca(len + 2); + memcpy(newfmt, fmt, len); + newfmt[len] = '\n'; + newfmt[len + 1] = '\0'; + fmt = newfmt; + } } switch (xo_style(xop)) { @@ -8069,7 +8090,7 @@ xo_error_h (xo_handle_t *xop, const char *fmt, ...) va_list vap; va_start(vap, fmt); - xo_error_hv(xop, fmt, vap); + xo_errorn_hv(xop, 0, fmt, vap); va_end(vap); } @@ -8082,11 +8103,34 @@ xo_error (const char *fmt, ...) va_list vap; va_start(vap, fmt); - xo_error_hv(NULL, fmt, vap); + xo_errorn_hv(NULL, 0, fmt, vap); va_end(vap); } +void +xo_errorn_h (xo_handle_t *xop, const char *fmt, ...) +{ + va_list vap; + + va_start(vap, fmt); + xo_errorn_hv(xop, 1, fmt, vap); + va_end(vap); +} + /* + * Generate an error message, such as would be displayed on stderr + */ +void +xo_errorn (const char *fmt, ...) +{ + va_list vap; + + va_start(vap, fmt); + xo_errorn_hv(NULL, 1, fmt, vap); + va_end(vap); +} + +/* * Parse any libxo-specific options from the command line, removing them * so the main() argument parsing won't see them. We return the new value * for argc or -1 for error. If an error occurred, the program should @@ -8099,21 +8143,30 @@ xo_parse_args (int argc, char **argv) char *cp; int i, save; - /* Save our program name for xo_err and friends */ - xo_program = argv[0]; - cp = strrchr(xo_program, '/'); - if (cp) - xo_program = ++cp; - else - cp = argv[0]; /* Reset to front of string */ + /* + * If xo_set_program has always been called, we honor that value + */ + if (xo_program == NULL) { + /* Save our program name for xo_err and friends */ + xo_program = argv[0]; + cp = strrchr(xo_program, '/'); + if (cp) + xo_program = ++cp; + else + cp = argv[0]; /* Reset to front of string */ - /* GNU tools add an annoying ".test" as the program extension; remove it */ - size_t len = strlen(xo_program); - static const char gnu_ext[] = ".test"; - if (len >= sizeof(gnu_ext)) { - cp += len + 1 - sizeof(gnu_ext); - if (xo_streq(cp, gnu_ext)) - *cp = '\0'; + /* + * GNU libtool add an annoying ".test" as the program + * extension; we remove it. libtool also adds a "lt-" prefix + * that we cannot remove. + */ + size_t len = strlen(xo_program); + static const char gnu_ext[] = ".test"; + if (len >= sizeof(gnu_ext)) { + cp += len + 1 - sizeof(gnu_ext); + if (xo_streq(cp, gnu_ext)) + *cp = '\0'; + } } xo_handle_t *xop = xo_default(NULL); Modified: head/contrib/libxo/libxo/xo.h ============================================================================== --- head/contrib/libxo/libxo/xo.h Sat Jan 25 21:09:27 2020 (r357124) +++ head/contrib/libxo/libxo/xo.h Sat Jan 25 21:16:45 2020 (r357125) @@ -389,6 +389,15 @@ xo_error_h (xo_handle_t *xop, const char *fmt, ...); void xo_error (const char *fmt, ...); +void +xo_errorn_hv (xo_handle_t *xop, int need_newline, const char *fmt, va_list vap); + +void +xo_errorn_h (xo_handle_t *xop, const char *fmt, ...); + +void +xo_errorn (const char *fmt, ...); + xo_ssize_t xo_flush_h (xo_handle_t *xop); Modified: head/contrib/libxo/libxo/xo_encoder.c ============================================================================== --- head/contrib/libxo/libxo/xo_encoder.c Sat Jan 25 21:09:27 2020 (r357124) +++ head/contrib/libxo/libxo/xo_encoder.c Sat Jan 25 21:16:45 2020 (r357125) @@ -290,8 +290,21 @@ xo_encoder_init (xo_handle_t *xop, const char *name) { xo_encoder_setup(); - const char *opts = strchr(name, ':'); + char opts_char = '\0'; + const char *col_opts = strchr(name, ':'); + const char *plus_opts = strchr(name, '+'); + + /* + * Find the option-separating character (plus or colon) which + * appears first in the options string. + */ + const char *opts = (col_opts == NULL) ? plus_opts + : (plus_opts == NULL) ? col_opts + : (plus_opts < col_opts) ? plus_opts : col_opts; + if (opts) { + opts_char = *opts; + /* Make a writable copy of the name */ size_t len = strlen(name); char *copy = alloca(len + 1); @@ -329,7 +342,11 @@ xo_encoder_init (xo_handle_t *xop, const char *name) int rc = xo_encoder_handle(xop, XO_OP_CREATE, name, NULL, 0); if (rc == 0 && opts != NULL) { - rc = xo_encoder_handle(xop, XO_OP_OPTIONS, name, opts, 0); + xo_encoder_op_t op; + + /* Encoder API is limited, so we're stuck with two different options */ + op = (opts_char == '+') ? XO_OP_OPTIONS_PLUS : XO_OP_OPTIONS; + rc = xo_encoder_handle(xop, op, name, opts, 0); } return rc; Modified: head/contrib/libxo/libxo/xo_encoder.h ============================================================================== --- head/contrib/libxo/libxo/xo_encoder.h Sat Jan 25 21:09:27 2020 (r357124) +++ head/contrib/libxo/libxo/xo_encoder.h Sat Jan 25 21:16:45 2020 (r357125) @@ -90,6 +90,7 @@ typedef unsigned xo_encoder_op_t; #define XO_OP_ATTRIBUTE 15 /* Attribute name/value */ #define XO_OP_VERSION 16 /* Version string */ #define XO_OP_OPTIONS 17 /* Additional command line options */ +#define XO_OP_OPTIONS_PLUS 18 /* Additional command line options */ #define XO_ENCODER_HANDLER_ARGS \ xo_handle_t *xop __attribute__ ((__unused__)), \ Modified: head/contrib/libxo/tests/core/Makefile.am ============================================================================== --- head/contrib/libxo/tests/core/Makefile.am Sat Jan 25 21:09:27 2020 (r357124) +++ head/contrib/libxo/tests/core/Makefile.am Sat Jan 25 21:16:45 2020 (r357125) @@ -88,7 +88,7 @@ TEST_JIG = \ TEST_JIG2 = \ echo "... $$test ... $$fmt ..."; \ -xoopts==warn,encoder=csv$$csv ; \ +xoopts==warn,$$csv ; \ ${TEST_JIG}; true; TEST_FORMATS = T XP JP HP X J H HIPx @@ -111,9 +111,12 @@ test tests: ${bin_PROGRAMS} done) \ done) -@ (${TEST_TRACE} test=test_01.c; base=test_01; \ - ( fmt=Ecsv1; csv= ; ${TEST_JIG2} ); \ - ( fmt=Ecsv2; csv=:path=top/data/item+no-header ; ${TEST_JIG2} ); \ - ( fmt=Ecsv3; csv=:path=item+leafs=sku.sold+no-quotes ; ${TEST_JIG2} ); \ + ( fmt=Ecsv1; csv=encoder=csv ; \ + ${TEST_JIG2} ); \ + ( fmt=Ecsv2; csv=encoder=csv:path=top/data/item:no-header ; \ + ${TEST_JIG2} ); \ + ( fmt=Ecsv3; csv=@csv:path=item:leafs=sku.sold:no-quotes ; \ + ${TEST_JIG2} ); \ ) Modified: head/contrib/libxo/tests/core/saved/test_02.H.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.H.out Sat Jan 25 21:09:27 2020 (r357124) +++ head/contrib/libxo/tests/core/saved/test_02.H.out Sat Jan 25 21:16:45 2020 (r357125) @@ -4,4 +4,7 @@
length
abcdef
close
-1
returned
Bad file descriptor
good
close
-1
returned
Bad fi
good
improper use of profanity; ten yard penalty; first down
20
30
40
file
0
bytes
1
byte
2
bytes
3
bytes
4
bytes
10
/
20
/
30
mbufs <&> in use (current/cache/total)
50
from
Boston
64
left out of
640
64
left out of
640
beforeworkingafter:
string
:
10
11
1010
packets here/there/everywhere
1010
packets here/there/everywhere
(
15
/
20
/
125
)
(
15
/
20
/
125
)
(
15
/
20
/
125
)
(
15
/
20
/
125
)
Humanize:
21
,
57 K
,
96M
,
44M
,
1.2G
one
two
three
(null)
1:
1000
2:
test5000
3:
ten-longx
4:
xtest
this is an error
two more errors
this is an warning
two more warnings
V1/V2 packets
:
10
0004
tries
improper use of profanity; ten yard penalty; first down
Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<> +
err message (1)
err message (2) +
err message (1) +
err message (2)
\ No newline at end of file Modified: head/contrib/libxo/tests/core/saved/test_02.HIPx.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.HIPx.out Sat Jan 25 21:09:27 2020 (r357124) +++ head/contrib/libxo/tests/core/saved/test_02.HIPx.out Sat Jan 25 21:16:45 2020 (r357125) @@ -225,3 +225,18 @@
Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<>
+
+
err message (1)
+
+
+
err message (2) +
+
+
+
err message (1) +
+
+
+
err message (2) +
+
Modified: head/contrib/libxo/tests/core/saved/test_02.HP.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.HP.out Sat Jan 25 21:09:27 2020 (r357124) +++ head/contrib/libxo/tests/core/saved/test_02.HP.out Sat Jan 25 21:16:45 2020 (r357125) @@ -225,3 +225,18 @@
Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<>
+
+
err message (1)
+
+
+
err message (2) +
+
+
+
err message (1) +
+
+
+
err message (2) +
+
Modified: head/contrib/libxo/tests/core/saved/test_02.J.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.J.out Sat Jan 25 21:09:27 2020 (r357124) +++ head/contrib/libxo/tests/core/saved/test_02.J.out Sat Jan 25 21:16:45 2020 (r357125) @@ -1 +1 @@ -{"top": {"data": {"name":"em0","flags":"0x8843","name":"em0","flags":"0x8843","what":"braces","length":"abcdef","fd":-1,"error":"Bad file descriptor","test":"good","fd":-1,"error":"Bad fi","test":"good","lines":20,"words":30,"characters":40, "bytes": [0,1,2,3,4],"mbuf-current":10,"mbuf-cache":20,"mbuf-total":30,"distance":50,"location":"Boston","memory":64,"total":640,"memory":64,"total":640,"ten":10,"eleven":11,"unknown":1010,"unknown":1010,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"val1":21,"val2":58368,"val3":100663296,"val4":44470272,"val5":1342172800, "flag": ["one","two","three"],"works":null,"empty-tag":true,"t1":"1000","t2":"test5000","t3":"ten-longx","t4":"xtest", "__error": {"message":"this is an error"}, "__error": {"message":"two more errors"}, "__warning": {"message":"this is an warning"}, "__warning": {"message":"two more warnings"},"count":10,"test":4, "error": {"message":"Shut 'er down, Clancey! S he's a-pumpin' mud! <>!,\"!<>\n"}}}} +{"top": {"data": {"name":"em0","flags":"0x8843","name":"em0","flags":"0x8843","what":"braces","length":"abcdef","fd":-1,"error":"Bad file descriptor","test":"good","fd":-1,"error":"Bad fi","test":"good","lines":20,"words":30,"characters":40, "bytes": [0,1,2,3,4],"mbuf-current":10,"mbuf-cache":20,"mbuf-total":30,"distance":50,"location":"Boston","memory":64,"total":640,"memory":64,"total":640,"ten":10,"eleven":11,"unknown":1010,"unknown":1010,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"val1":21,"val2":58368,"val3":100663296,"val4":44470272,"val5":1342172800, "flag": ["one","two","three"],"works":null,"empty-tag":true,"t1":"1000","t2":"test5000","t3":"ten-longx","t4":"xtest", "__error": {"message":"this is an error"}, "__error": {"message":"two more errors"}, "__warning": {"message":"this is an warning"}, "__warning": {"message":"two more warnings"},"count":10,"test":4, "error": {"message":"Shut 'er down, Clancey! S he's a-pumpin' mud! <>!,\"!<>\n"}, "error": {"message":"err message (1)"}, "error": {"message":"err message (2)\n"}, "error": {"message":"err message (1)\n"}, "error": {"message":"err message (2)\n"}}}} Modified: head/contrib/libxo/tests/core/saved/test_02.JP.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.JP.out Sat Jan 25 21:09:27 2020 (r357124) +++ head/contrib/libxo/tests/core/saved/test_02.JP.out Sat Jan 25 21:16:45 2020 (r357125) @@ -80,6 +80,18 @@ "test": 4, "error": { "message": "Shut 'er down, Clancey! She's a-pumpin' mud! <>!,\"!<>\n" + }, + "error": { + "message": "err message (1)" + }, + "error": { + "message": "err message (2)\n" + }, + "error": { + "message": "err message (1)\n" + }, + "error": { + "message": "err message (2)\n" } } } Modified: head/contrib/libxo/tests/core/saved/test_02.T.err ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.T.err Sat Jan 25 21:09:27 2020 (r357124) +++ head/contrib/libxo/tests/core/saved/test_02.T.err Sat Jan 25 21:16:45 2020 (r357125) @@ -1,2 +1,5 @@ test_02: key field emitted after normal value field: 'name' Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<> +err message (1)err message (2) +err message (1) +err message (2) Modified: head/contrib/libxo/tests/core/saved/test_02.X.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.X.out Sat Jan 25 21:09:27 2020 (r357124) +++ head/contrib/libxo/tests/core/saved/test_02.X.out Sat Jan 25 21:16:45 2020 (r357125) @@ -4,4 +4,7 @@ abcdef-1Bad file descriptorgood-1Bad figoodimproper use of profanity; ten yard penalty; first down 2030400123410203050Boston646406464010111010101015201251520125152012515201252158368100663296444702721342172800onetwothreenull1000test5000ten-longxxtest<__error>this is an error<__error>two more er rors<__warning>this is an warning<__warning>two more warnings104improper use of profanity; ten yard penalty; first down Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<> +err message (1)err message (2) +err message (1) +err message (2) \ No newline at end of file Modified: head/contrib/libxo/tests/core/saved/test_02.XP.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.XP.out Sat Jan 25 21:09:27 2020 (r357124) +++ head/contrib/libxo/tests/core/saved/test_02.XP.out Sat Jan 25 21:16:45 2020 (r357125) @@ -87,5 +87,20 @@ Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<> + + err message (1) + + + err message (2) + + + + err message (1) + + + + err message (2) + + Modified: head/contrib/libxo/tests/core/test_02.c ============================================================================== --- head/contrib/libxo/tests/core/test_02.c Sat Jan 25 21:09:27 2020 (r357124) +++ head/contrib/libxo/tests/core/test_02.c Sat Jan 25 21:16:45 2020 (r357125) @@ -21,6 +21,8 @@ int main (int argc, char **argv) { + xo_set_program("test_02"); + argc = xo_parse_args(argc, argv); if (argc < 0) return 1; @@ -144,6 +146,10 @@ main (int argc, char **argv) "ten yard penalty", "first down"); xo_error("Shut 'er down, Clancey! She's a-pumpin' mud! <>!,\"!<>\n"); + xo_error("err message (%d)", 1); + xo_error("err message (%d)\n", 2); + xo_errorn("err message (%d)", 1); + xo_errorn("err message (%d)\n", 2); xo_close_container("data"); Modified: head/contrib/libxo/tests/core/test_12.c ============================================================================== --- head/contrib/libxo/tests/core/test_12.c Sat Jan 25 21:09:27 2020 (r357124) +++ head/contrib/libxo/tests/core/test_12.c Sat Jan 25 21:16:45 2020 (r357125) @@ -25,6 +25,8 @@ main (int argc, char **argv) xo_emit_flags_t flags = XOEF_RETAIN; int opt_color = 1; + xo_set_program("test_12"); + argc = xo_parse_args(argc, argv); if (argc < 0) return 1; Modified: head/lib/libxo/add.man ============================================================================== --- head/lib/libxo/add.man Sat Jan 25 21:09:27 2020 (r357124) +++ head/lib/libxo/add.man Sat Jan 25 21:16:45 2020 (r357125) @@ -3,10 +3,10 @@ .Fx uses .Nm libxo -version 1.3.1. +version 1.4.0. Complete documentation can be found on github: .Bd -literal -offset indent -https://juniper.github.io/libxo/1.3.1/html/index.html +https://juniper.github.io/libxo/1.4.0/html/index.html .Ed .Pp .Nm libxo Modified: head/lib/libxo/libxo/xo_config.h ============================================================================== --- head/lib/libxo/libxo/xo_config.h Sat Jan 25 21:09:27 2020 (r357124) +++ head/lib/libxo/libxo/xo_config.h Sat Jan 25 21:16:45 2020 (r357125) @@ -183,16 +183,16 @@ /* #undef LIBXO_TEXT_ONLY */ /* Version number as dotted value */ -#define LIBXO_VERSION "1.3.1" +#define LIBXO_VERSION "1.4.0" /* Version number extra information */ #define LIBXO_VERSION_EXTRA "" /* Version number as a number */ -#define LIBXO_VERSION_NUMBER 1003001 +#define LIBXO_VERSION_NUMBER 1004000 /* Version number as string */ -#define LIBXO_VERSION_STRING "1003001" +#define LIBXO_VERSION_STRING "1004000" /* Enable local wcwidth implementation */ #define LIBXO_WCWIDTH 1 @@ -210,7 +210,7 @@ #define PACKAGE_NAME "libxo" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libxo 1.3.1" +#define PACKAGE_STRING "libxo 1.4.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "libxo" @@ -219,7 +219,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "1.3.1" +#define PACKAGE_VERSION "1.4.0" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -236,7 +236,7 @@ /* #undef USE_INT_RETURN_CODES */ /* Version number of package */ -#define VERSION "1.3.1" +#define VERSION "1.4.0" /* Retain hash bucket size */ /* #undef XO_RETAIN_SIZE */ Modified: head/usr.bin/xohtml/xohtml.sh ============================================================================== --- head/usr.bin/xohtml/xohtml.sh Sat Jan 25 21:09:27 2020 (r357124) +++ head/usr.bin/xohtml/xohtml.sh Sat Jan 25 21:16:45 2020 (r357125) @@ -12,7 +12,7 @@ # BASE=/usr/share/libxo -VERSION=1.3.1 +VERSION=1.4.0 CMD=cat DONE= WEB=http://juniper.github.io/libxo/${VERSION}/xohtml From owner-svn-src-all@freebsd.org Sat Jan 25 23:22:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7752C1FE5C4; Sat, 25 Jan 2020 23:22:09 +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 484sV92cYpz4DrV; Sat, 25 Jan 2020 23:22:09 +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 548BCFE8D; Sat, 25 Jan 2020 23:22:09 +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 00PNM9Ue055443; Sat, 25 Jan 2020 23:22:09 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00PNM9JB055442; Sat, 25 Jan 2020 23:22:09 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202001252322.00PNM9JB055442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Sat, 25 Jan 2020 23:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357126 - head/tests/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/netinet X-SVN-Commit-Revision: 357126 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 25 Jan 2020 23:22:09 -0000 Author: lwhsu Date: Sat Jan 25 23:22:08 2020 New Revision: 357126 URL: https://svnweb.freebsd.org/changeset/base/357126 Log: Specify PACKAGE to install tests files MFC after: 3 weeks MFC with: r356984 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/netinet/Makefile Modified: head/tests/sys/netinet/Makefile ============================================================================== --- head/tests/sys/netinet/Makefile Sat Jan 25 21:16:45 2020 (r357125) +++ head/tests/sys/netinet/Makefile Sat Jan 25 23:22:08 2020 (r357126) @@ -1,5 +1,7 @@ # $FreeBSD$ +PACKAGE= tests + TESTSDIR= ${TESTSBASE}/sys/netinet BINDIR= ${TESTSDIR}