From owner-svn-src-head@freebsd.org Sun Dec 15 01:26:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F9071DCBAF; Sun, 15 Dec 2019 01:26: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 47b6FZ26K4z3xxf; Sun, 15 Dec 2019 01:26: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 4396D5898; Sun, 15 Dec 2019 01:26: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 xBF1QwRo028925; Sun, 15 Dec 2019 01:26:58 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBF1QwFd028924; Sun, 15 Dec 2019 01:26:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912150126.xBF1QwFd028924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 15 Dec 2019 01:26:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355761 - head/include X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/include X-SVN-Commit-Revision: 355761 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 01:26:58 -0000 Author: kevans Date: Sun Dec 15 01:26:57 2019 New Revision: 355761 URL: https://svnweb.freebsd.org/changeset/base/355761 Log: : remove redundant __BSD_VISIBLE This bit is already inside of a larger __BSD_VISIBLE block. Reported by: vangyzen Modified: head/include/unistd.h Modified: head/include/unistd.h ============================================================================== --- head/include/unistd.h Sat Dec 14 23:39:32 2019 (r355760) +++ head/include/unistd.h Sun Dec 15 01:26:57 2019 (r355761) @@ -557,11 +557,9 @@ pid_t rfork_thread(int, void *, int (*)(void *), void int rresvport(int *); int rresvport_af(int *, int); int ruserok(const char *, int, const char *, const char *); -#if __BSD_VISIBLE #ifndef _SELECT_DECLARED #define _SELECT_DECLARED int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); -#endif #endif int setdomainname(const char *, int); int setgroups(int, const gid_t *); From owner-svn-src-head@freebsd.org Sun Dec 15 01:56:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E2CDE1DDED4; Sun, 15 Dec 2019 01:56:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47b6w85m4Wz40fp; Sun, 15 Dec 2019 01:56:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0EC75E23; Sun, 15 Dec 2019 01:56:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBF1uuBY046506; Sun, 15 Dec 2019 01:56:56 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBF1uuNx046505; Sun, 15 Dec 2019 01:56:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201912150156.xBF1uuNx046505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 15 Dec 2019 01:56:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355762 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 355762 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 01:56:56 -0000 Author: pfg Date: Sun Dec 15 01:56:56 2019 New Revision: 355762 URL: https://svnweb.freebsd.org/changeset/base/355762 Log: cdefs: use more accurate GCC version for the deprecated attribute. The message argument in the "deprecated" attribute was introduced in GCC 4.5 *. Use the accurate version number for consistency, as done already with other attributes. * https://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Function-Attributes.html Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sun Dec 15 01:26:57 2019 (r355761) +++ head/sys/sys/cdefs.h Sun Dec 15 01:56:56 2019 (r355762) @@ -468,7 +468,7 @@ #define __hidden #endif -#if __GNUC__ > 4 || defined(__clang__) +#if __GNUC_PREREQ__(4, 5) || defined(__clang__) #define __deprecated(m) __attribute__((__deprecated__(m))) #elif defined(__GNUC__) #define __deprecated(m) __attribute__((__deprecated__)) From owner-svn-src-head@freebsd.org Sun Dec 15 02:00:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C1551DE0C3; Sun, 15 Dec 2019 02:00:33 +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 47b70K3k8gz40sp; Sun, 15 Dec 2019 02:00:33 +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 7B1A55F5A; Sun, 15 Dec 2019 02:00:33 +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 xBF20XNs046766; Sun, 15 Dec 2019 02:00:33 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBF20Xd8046764; Sun, 15 Dec 2019 02:00:33 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201912150200.xBF20Xd8046764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 15 Dec 2019 02:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355763 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 355763 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 02:00:33 -0000 Author: jeff Date: Sun Dec 15 02:00:32 2019 New Revision: 355763 URL: https://svnweb.freebsd.org/changeset/base/355763 Log: Handle pagein clustering in vm_page_grab_valid() so that it can be used by exec_map_first_page(). This will also enable pagein clustering for other interested consumers (tmpfs, md, etc). Discussed with: alc Approved by: kib Differential Revision: https://reviews.freebsd.org/D22731 Modified: head/sys/kern/kern_exec.c head/sys/vm/vm_page.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Sun Dec 15 01:56:56 2019 (r355762) +++ head/sys/kern/kern_exec.c Sun Dec 15 02:00:32 2019 (r355763) @@ -974,9 +974,9 @@ exec_fail: int exec_map_first_page(struct image_params *imgp) { - int rv, i, after, initial_pagein; - vm_page_t ma[VM_INITIAL_PAGEIN]; vm_object_t object; + vm_page_t m; + int error; if (imgp->firstpage != NULL) exec_unmap_first_page(imgp); @@ -988,68 +988,14 @@ exec_map_first_page(struct image_params *imgp) #if VM_NRESERVLEVEL > 0 vm_object_color(object, 0); #endif -retry: - ma[0] = vm_page_grab(object, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | - VM_ALLOC_WIRED); - if (!vm_page_all_valid(ma[0])) { - if (vm_page_busy_acquire(ma[0], VM_ALLOC_WAITFAIL) == 0) { - vm_page_unwire_noq(ma[0]); - goto retry; - } - if (vm_page_all_valid(ma[0])) { - vm_page_xunbusy(ma[0]); - goto out; - } - if (!vm_pager_has_page(object, 0, NULL, &after)) { - if (vm_page_unwire_noq(ma[0])) - vm_page_free(ma[0]); - else - vm_page_xunbusy(ma[0]); - VM_OBJECT_WUNLOCK(object); - return (EIO); - } - initial_pagein = min(after, VM_INITIAL_PAGEIN); - KASSERT(initial_pagein <= object->size, - ("%s: initial_pagein %d object->size %ju", - __func__, initial_pagein, (uintmax_t )object->size)); - for (i = 1; i < initial_pagein; i++) { - if ((ma[i] = vm_page_next(ma[i - 1])) != NULL) { - if (ma[i]->valid) - break; - if (!vm_page_tryxbusy(ma[i])) - break; - } else { - ma[i] = vm_page_alloc(object, i, - VM_ALLOC_NORMAL); - if (ma[i] == NULL) - break; - } - } - initial_pagein = i; - rv = vm_pager_get_pages(object, ma, initial_pagein, NULL, NULL); - if (rv != VM_PAGER_OK) { - if (vm_page_unwire_noq(ma[0])) - vm_page_free(ma[0]); - else - vm_page_xunbusy(ma[0]); - for (i = 1; i < initial_pagein; i++) { - if (!vm_page_wired(ma[i])) - vm_page_free(ma[i]); - else - vm_page_xunbusy(ma[i]); - } - VM_OBJECT_WUNLOCK(object); - return (EIO); - } - vm_page_xunbusy(ma[0]); - for (i = 1; i < initial_pagein; i++) - vm_page_readahead_finish(ma[i]); - } - -out: + error = vm_page_grab_valid(&m, object, 0, + VM_ALLOC_COUNT(VM_INITIAL_PAGEIN) | + VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | VM_ALLOC_WIRED); VM_OBJECT_WUNLOCK(object); - imgp->firstpage = sf_buf_alloc(ma[0], 0); + if (error != VM_PAGER_OK) + return (EIO); + imgp->firstpage = sf_buf_alloc(m, 0); imgp->image_header = (char *)sf_buf_kva(imgp->firstpage); return (0); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Dec 15 01:56:56 2019 (r355762) +++ head/sys/vm/vm_page.c Sun Dec 15 02:00:32 2019 (r355763) @@ -4333,15 +4333,18 @@ out: /* * Grab a page and make it valid, paging in if necessary. Pages missing from - * their pager are zero filled and validated. + * their pager are zero filled and validated. If a VM_ALLOC_COUNT is supplied + * and the page is not valid as many as VM_INITIAL_PAGEIN pages can be brought + * in simultaneously. Additional pages will be left on a paging queue but + * will neither be wired nor busy regardless of allocflags. */ int vm_page_grab_valid(vm_page_t *mp, vm_object_t object, vm_pindex_t pindex, int allocflags) { vm_page_t m; + vm_page_t ma[VM_INITIAL_PAGEIN]; bool sleep, xbusy; - int pflags; - int rv; + int after, i, pflags, rv; KASSERT((allocflags & VM_ALLOC_SBUSY) == 0 || (allocflags & VM_ALLOC_IGN_SBUSY) != 0, @@ -4400,15 +4403,40 @@ retrylookup: vm_page_assert_xbusied(m); MPASS(xbusy); - if (vm_pager_has_page(object, pindex, NULL, NULL)) { - rv = vm_pager_get_pages(object, &m, 1, NULL, NULL); + if (vm_pager_has_page(object, pindex, NULL, &after)) { + after = MIN(after, VM_INITIAL_PAGEIN); + after = MIN(after, allocflags >> VM_ALLOC_COUNT_SHIFT); + after = MAX(after, 1); + ma[0] = m; + for (i = 1; i < after; i++) { + if ((ma[i] = vm_page_next(ma[i - 1])) != NULL) { + if (ma[i]->valid || !vm_page_tryxbusy(ma[i])) + break; + } else { + ma[i] = vm_page_alloc(object, m->pindex + i, + VM_ALLOC_NORMAL); + if (ma[i] == NULL) + break; + } + } + after = i; + rv = vm_pager_get_pages(object, ma, after, NULL, NULL); + /* Pager may have replaced a page. */ + m = ma[0]; if (rv != VM_PAGER_OK) { - if (allocflags & VM_ALLOC_WIRED) + if ((allocflags & VM_ALLOC_WIRED) != 0) vm_page_unwire_noq(m); - vm_page_free(m); + for (i = 0; i < after; i++) { + if (!vm_page_wired(ma[i])) + vm_page_free(ma[i]); + else + vm_page_xunbusy(ma[i]); + } *mp = NULL; return (rv); } + for (i = 1; i < after; i++) + vm_page_readahead_finish(ma[i]); MPASS(vm_page_all_valid(m)); } else { vm_page_zero_invalid(m, TRUE); From owner-svn-src-head@freebsd.org Sun Dec 15 02:02:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD92D1DE34D; Sun, 15 Dec 2019 02:02:27 +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 47b72W4jG6z41Fp; Sun, 15 Dec 2019 02:02:27 +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 9CB746011; Sun, 15 Dec 2019 02:02:27 +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 xBF22RNF052433; Sun, 15 Dec 2019 02:02:27 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBF22R6d052432; Sun, 15 Dec 2019 02:02:27 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201912150202.xBF22R6d052432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 15 Dec 2019 02:02:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355764 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355764 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 02:02:27 -0000 Author: jeff Date: Sun Dec 15 02:02:27 2019 New Revision: 355764 URL: https://svnweb.freebsd.org/changeset/base/355764 Log: Slightly optimize locking in vm_map_copy_swap_entry(). Anonymous objects require the object lock to synchronize collapse. Other swap objects such as tmpfs do not. Reported by: mjg Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D22747 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sun Dec 15 02:00:32 2019 (r355763) +++ head/sys/vm/vm_map.c Sun Dec 15 02:02:27 2019 (r355764) @@ -3870,15 +3870,19 @@ vm_map_copy_swap_object(vm_map_entry_t src_entry, vm_m int charged; src_object = src_entry->object.vm_object; - VM_OBJECT_WLOCK(src_object); charged = ENTRY_CHARGED(src_entry); - vm_object_collapse(src_object); - if ((src_object->flags & OBJ_ONEMAPPING) != 0) { - vm_object_split(src_entry); - src_object = src_entry->object.vm_object; - } - vm_object_reference_locked(src_object); - vm_object_clear_flag(src_object, OBJ_ONEMAPPING); + if ((src_object->flags & OBJ_ANON) != 0) { + VM_OBJECT_WLOCK(src_object); + vm_object_collapse(src_object); + if ((src_object->flags & OBJ_ONEMAPPING) != 0) { + vm_object_split(src_entry); + src_object = src_entry->object.vm_object; + } + vm_object_reference_locked(src_object); + vm_object_clear_flag(src_object, OBJ_ONEMAPPING); + VM_OBJECT_WUNLOCK(src_object); + } else + vm_object_reference(src_object); if (src_entry->cred != NULL && !(src_entry->eflags & MAP_ENTRY_NEEDS_COPY)) { KASSERT(src_object->cred == NULL, @@ -3887,7 +3891,6 @@ vm_map_copy_swap_object(vm_map_entry_t src_entry, vm_m src_object->cred = src_entry->cred; src_object->charge = size; } - VM_OBJECT_WUNLOCK(src_object); dst_entry->object.vm_object = src_object; if (charged) { cred = curthread->td_ucred; From owner-svn-src-head@freebsd.org Sun Dec 15 03:15:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B85E1E00BD; Sun, 15 Dec 2019 03:15:08 +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 47b8fN1z8Jz44KX; Sun, 15 Dec 2019 03:15:08 +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 3EB2C6D6A; Sun, 15 Dec 2019 03:15:08 +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 xBF3F8qT094217; Sun, 15 Dec 2019 03:15:08 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBF3F68Z094208; Sun, 15 Dec 2019 03:15:06 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201912150315.xBF3F68Z094208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 15 Dec 2019 03:15:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355765 - 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: 355765 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 03:15:08 -0000 Author: jeff Date: Sun Dec 15 03:15:06 2019 New Revision: 355765 URL: https://svnweb.freebsd.org/changeset/base/355765 Log: Add a deferred free mechanism for freeing swap space that does not require an exclusive object lock. Previously swap space was freed on a best effort basis when a page that had valid swap was dirtied, thus invalidating the swap copy. This may be done inconsistently and requires the object lock which is not always convenient. Instead, track when swap space is present. The first dirty is responsible for deleting space or setting PGA_SWAP_FREE which will trigger background scans to free the swap space. Simplify the locking in vm_fault_dirty() now that we can reliably identify the first dirty. Discussed with: alc, kib, markj Differential Revision: https://reviews.freebsd.org/D22654 Modified: head/sys/dev/md/md.c head/sys/fs/tmpfs/tmpfs_subr.c head/sys/kern/uipc_shm.c head/sys/vm/swap_pager.c head/sys/vm/vm_fault.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c head/sys/vm/vm_pager.h Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Sun Dec 15 02:02:27 2019 (r355764) +++ head/sys/dev/md/md.c Sun Dec 15 03:15:06 2019 (r355765) @@ -1118,10 +1118,7 @@ mdstart_swap(struct md_s *sc, struct bio *bp) } vm_page_valid(m); - if (m->dirty != VM_PAGE_BITS_ALL) { - vm_page_dirty(m); - vm_pager_page_unswapped(m); - } + vm_page_set_dirty(m); } else if (bp->bio_cmd == BIO_DELETE) { if (len == PAGE_SIZE || vm_page_all_valid(m)) rv = VM_PAGER_OK; @@ -1138,10 +1135,7 @@ mdstart_swap(struct md_s *sc, struct bio *bp) /* Page is valid. */ if (len != PAGE_SIZE) { pmap_zero_page_area(m, offs, len); - if (m->dirty != VM_PAGE_BITS_ALL) { - vm_page_dirty(m); - vm_pager_page_unswapped(m); - } + vm_page_set_dirty(m); } else { vm_pager_page_unswapped(m); vm_page_free(m); Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Sun Dec 15 02:02:27 2019 (r355764) +++ head/sys/fs/tmpfs/tmpfs_subr.c Sun Dec 15 03:15:06 2019 (r355765) @@ -1505,9 +1505,8 @@ retry: } if (m != NULL) { pmap_zero_page_area(m, base, PAGE_SIZE - base); - vm_page_dirty(m); + vm_page_set_dirty(m); vm_page_xunbusy(m); - vm_pager_page_unswapped(m); } } Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Sun Dec 15 02:02:27 2019 (r355764) +++ head/sys/kern/uipc_shm.c Sun Dec 15 03:15:06 2019 (r355765) @@ -198,7 +198,7 @@ uiomove_object_page(vm_object_t obj, size_t len, struc * type object. */ rv = vm_page_grab_valid(&m, obj, idx, - VM_ALLOC_NORMAL | VM_ALLOC_WIRED | VM_ALLOC_NOBUSY); + VM_ALLOC_NORMAL | VM_ALLOC_SBUSY | VM_ALLOC_IGN_SBUSY); if (rv != VM_PAGER_OK) { VM_OBJECT_WUNLOCK(obj); printf("uiomove_object: vm_obj %p idx %jd pager error %d\n", @@ -207,13 +207,10 @@ uiomove_object_page(vm_object_t obj, size_t len, struc } VM_OBJECT_WUNLOCK(obj); error = uiomove_fromphys(&m, offset, tlen, uio); - if (uio->uio_rw == UIO_WRITE && error == 0) { - VM_OBJECT_WLOCK(obj); - vm_page_dirty(m); - vm_pager_page_unswapped(m); - VM_OBJECT_WUNLOCK(obj); - } - vm_page_unwire(m, PQ_ACTIVE); + if (uio->uio_rw == UIO_WRITE && error == 0) + vm_page_set_dirty(m); + vm_page_aflag_set(m, PGA_REFERENCED); + vm_page_sunbusy(m); return (error); } @@ -527,9 +524,8 @@ retry: pmap_zero_page_area(m, base, PAGE_SIZE - base); KASSERT(vm_page_all_valid(m), ("shm_dotruncate: page %p is invalid", m)); - vm_page_dirty(m); + vm_page_set_dirty(m); vm_page_xunbusy(m); - vm_pager_page_unswapped(m); } } delta = IDX_TO_OFF(object->size - nobjsize); Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Sun Dec 15 02:02:27 2019 (r355764) +++ head/sys/vm/swap_pager.c Sun Dec 15 03:15:06 2019 (r355765) @@ -155,6 +155,9 @@ static struct sx swdev_syscall_lock; /* serialize swap static u_long swap_reserved; static u_long swap_total; static int sysctl_page_shift(SYSCTL_HANDLER_ARGS); + +static SYSCTL_NODE(_vm_stats, OID_AUTO, swap, CTLFLAG_RD, 0, "VM swap stats"); + SYSCTL_PROC(_vm, OID_AUTO, swap_reserved, CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE, &swap_reserved, 0, sysctl_page_shift, "A", "Amount of swap storage needed to back all allocated anonymous memory."); @@ -173,6 +176,16 @@ static unsigned long swap_maxpages; SYSCTL_ULONG(_vm, OID_AUTO, swap_maxpages, CTLFLAG_RD, &swap_maxpages, 0, "Maximum amount of swap supported"); +static counter_u64_t swap_free_deferred; +SYSCTL_COUNTER_U64(_vm_stats_swap, OID_AUTO, free_deferred, + CTLFLAG_RD, &swap_free_deferred, + "Number of pages that deferred freeing swap space"); + +static counter_u64_t swap_free_completed; +SYSCTL_COUNTER_U64(_vm_stats_swap, OID_AUTO, free_completed, + CTLFLAG_RD, &swap_free_completed, + "Number of deferred frees completed"); + /* bits from overcommit */ #define SWAP_RESERVE_FORCE_ON (1 << 0) #define SWAP_RESERVE_RLIMIT_ON (1 << 1) @@ -513,6 +526,15 @@ swap_pager_init(void) sx_init(&swdev_syscall_lock, "swsysc"); } +static void +swap_pager_counters(void) +{ + + swap_free_deferred = counter_u64_alloc(M_WAITOK); + swap_free_completed = counter_u64_alloc(M_WAITOK); +} +SYSINIT(swap_counters, SI_SUB_CPU, SI_ORDER_ANY, swap_pager_counters, NULL); + /* * SWAP_PAGER_SWAP_INIT() - swap pager initialization from pageout process * @@ -1112,14 +1134,37 @@ swap_pager_haspage(vm_object_t object, vm_pindex_t pin * * This routine may not sleep. * - * The object containing the page must be locked. + * The object containing the page may be locked. */ static void swap_pager_unswapped(vm_page_t m) { struct swblk *sb; + vm_object_t obj; - VM_OBJECT_ASSERT_WLOCKED(m->object); + /* + * Handle enqueing deferred frees first. If we do not have the + * object lock we wait for the page daemon to clear the space. + */ + obj = m->object; + if (!VM_OBJECT_WOWNED(obj)) { + VM_PAGE_OBJECT_BUSY_ASSERT(m); + /* + * The caller is responsible for synchronization but we + * will harmlessly handle races. This is typically provided + * by only calling unswapped() when a page transitions from + * clean to dirty. + */ + if ((m->a.flags & (PGA_SWAP_SPACE | PGA_SWAP_FREE)) == + PGA_SWAP_SPACE) { + vm_page_aflag_set(m, PGA_SWAP_FREE); + counter_u64_add(swap_free_deferred, 1); + } + return; + } + if ((m->a.flags & PGA_SWAP_FREE) != 0) + counter_u64_add(swap_free_completed, 1); + vm_page_aflag_clear(m, PGA_SWAP_FREE | PGA_SWAP_SPACE); /* * The meta data only exists if the object is OBJT_SWAP @@ -1436,6 +1481,7 @@ swap_pager_putpages(vm_object_t object, vm_page_t *ma, VM_OBJECT_WLOCK(object); for (j = 0; j < n; ++j) { mreq = ma[i + j]; + vm_page_aflag_clear(mreq, PGA_SWAP_FREE); addr = swp_pager_meta_build(mreq->object, mreq->pindex, blk + j); if (addr != SWAPBLK_NONE) @@ -1560,6 +1606,9 @@ swp_pager_async_iodone(struct buf *bp) wakeup(&object->handle); } + /* We always have space after I/O, successful or not. */ + vm_page_aflag_set(m, PGA_SWAP_SPACE); + if (bp->b_ioflags & BIO_ERROR) { /* * If an error occurs I'd love to throw the swapblk @@ -1581,6 +1630,7 @@ swp_pager_async_iodone(struct buf *bp) * then finish the I/O. */ MPASS(m->dirty == VM_PAGE_BITS_ALL); + /* PQ_UNSWAPPABLE? */ vm_page_lock(m); vm_page_activate(m); vm_page_unlock(m); Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sun Dec 15 02:02:27 2019 (r355764) +++ head/sys/vm/vm_fault.c Sun Dec 15 03:15:06 2019 (r355765) @@ -214,7 +214,7 @@ 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, bool excl) + vm_prot_t fault_type, int fault_flags) { bool need_dirty; @@ -223,7 +223,6 @@ vm_fault_dirty(vm_map_entry_t entry, vm_page_t m, vm_p (m->oflags & VPO_UNMANAGED) != 0) return; - VM_OBJECT_ASSERT_LOCKED(m->object); VM_PAGE_OBJECT_BUSY_ASSERT(m); need_dirty = ((fault_type & VM_PROT_WRITE) != 0 && @@ -232,49 +231,29 @@ vm_fault_dirty(vm_map_entry_t entry, vm_page_t m, vm_p vm_object_set_writeable_dirty(m->object); - if (!excl) - /* - * If two callers of vm_fault_dirty() with excl == - * FALSE, one for the map entry with MAP_ENTRY_NOSYNC - * flag set, other with flag clear, race, it is - * possible for the no-NOSYNC thread to see m->dirty - * != 0 and not clear PGA_NOSYNC. Take vm_page lock - * around manipulation of PGA_NOSYNC and - * vm_page_dirty() call to avoid the race. - */ - vm_page_lock(m); - /* - * If this is a NOSYNC mmap we do not want to set PGA_NOSYNC - * if the page is already dirty to prevent data written with - * the expectation of being synced from not being synced. - * Likewise if this entry does not request NOSYNC then make - * 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 (m->dirty == 0) { - vm_page_aflag_set(m, PGA_NOSYNC); - } - } else { - vm_page_aflag_clear(m, PGA_NOSYNC); - } - - /* * If the fault is a write, we know that this page is being * written NOW so dirty it explicitly to save on * pmap_is_modified() calls later. * * Also, since the page is now dirty, we can possibly tell - * the pager to release any swap backing the page. Calling - * the pager requires a write lock on the object. + * the pager to release any swap backing the page. */ - if (need_dirty) - vm_page_dirty(m); - if (!excl) - vm_page_unlock(m); - else if (need_dirty) - vm_pager_page_unswapped(m); + if (need_dirty && vm_page_set_dirty(m) == 0) { + /* + * If this is a NOSYNC mmap we do not want to set PGA_NOSYNC + * if the page is already dirty to prevent data written with + * the expectation of being synced from not being synced. + * Likewise if this entry does not request NOSYNC then make + * 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) + vm_page_aflag_set(m, PGA_NOSYNC); + else + vm_page_aflag_clear(m, PGA_NOSYNC); + } + } /* @@ -344,7 +323,7 @@ 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, false); + 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); @@ -502,7 +481,7 @@ vm_fault_populate(struct faultstate *fs, vm_prot_t pro 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, true); + fault_flags); } VM_OBJECT_WUNLOCK(fs->first_object); rv = pmap_enter(fs->map->pmap, vaddr, m, prot, fault_type | @@ -1381,7 +1360,7 @@ readrest: 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, true); + vm_fault_dirty(fs.entry, fs.m, prot, fault_type, fault_flags); /* * Page must be completely valid or it is not fit to Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Dec 15 02:02:27 2019 (r355764) +++ head/sys/vm/vm_page.c Sun Dec 15 03:15:06 2019 (r355765) @@ -1584,6 +1584,10 @@ vm_page_object_remove(vm_page_t m) KASSERT((m->ref_count & VPRC_OBJREF) != 0, ("page %p is missing its object ref", m)); + /* Deferred free of swap space. */ + if ((m->a.flags & PGA_SWAP_FREE) != 0) + vm_pager_page_unswapped(m); + mrem = vm_radix_remove(&object->rtree, m->pindex); KASSERT(mrem == m, ("removed page %p, expected page %p", mrem, m)); @@ -4633,6 +4637,62 @@ vm_page_bits_clear(vm_page_t m, vm_page_bits_t *bits, #endif /* PAGE_SIZE */ } +static inline vm_page_bits_t +vm_page_bits_swap(vm_page_t m, vm_page_bits_t *bits, vm_page_bits_t newbits) +{ +#if PAGE_SIZE == 32768 + uint64_t old; + + old = *bits; + while (atomic_fcmpset_64(bits, &old, newbits) == 0); + return (old); +#elif PAGE_SIZE == 16384 + uint32_t old; + + old = *bits; + while (atomic_fcmpset_32(bits, &old, newbits) == 0); + return (old); +#elif (PAGE_SIZE == 8192) && defined(atomic_fcmpset_16) + uint16_t old; + + old = *bits; + while (atomic_fcmpset_16(bits, &old, newbits) == 0); + return (old); +#elif (PAGE_SIZE == 4096) && defined(atomic_fcmpset_8) + uint8_t old; + + old = *bits; + while (atomic_fcmpset_8(bits, &old, newbits) == 0); + return (old); +#else /* PAGE_SIZE <= 4096*/ + uintptr_t addr; + uint32_t old, new, mask; + int shift; + + addr = (uintptr_t)bits; + /* + * Use a trick to perform a 32-bit atomic on the + * containing aligned word, to not depend on the existence + * of atomic_{set, swap, clear}_{8, 16}. + */ + shift = addr & (sizeof(uint32_t) - 1); +#if BYTE_ORDER == BIG_ENDIAN + shift = (sizeof(uint32_t) - sizeof(vm_page_bits_t) - shift) * NBBY; +#else + shift *= NBBY; +#endif + addr &= ~(sizeof(uint32_t) - 1); + mask = VM_PAGE_BITS_ALL << shift; + + old = *bits; + do { + new = old & ~mask; + new |= newbits << shift; + } while (atomic_fcmpset_32((uint32_t *)addr, &old, new) == 0); + return (old >> shift); +#endif /* PAGE_SIZE */ +} + /* * vm_page_set_valid_range: * @@ -4688,6 +4748,28 @@ vm_page_set_valid_range(vm_page_t m, int base, int siz m->valid |= pagebits; else vm_page_bits_set(m, &m->valid, pagebits); +} + +/* + * Set the page dirty bits and free the invalid swap space if + * present. Returns the previous dirty bits. + */ +vm_page_bits_t +vm_page_set_dirty(vm_page_t m) +{ + vm_page_bits_t old; + + VM_PAGE_OBJECT_BUSY_ASSERT(m); + + if (vm_page_xbusied(m) && !pmap_page_is_write_mapped(m)) { + old = m->dirty; + m->dirty = VM_PAGE_BITS_ALL; + } else + old = vm_page_bits_swap(m, &m->dirty, VM_PAGE_BITS_ALL); + if (old == 0 && (m->a.flags & PGA_SWAP_SPACE) != 0) + vm_pager_page_unswapped(m); + + return (old); } /* Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sun Dec 15 02:02:27 2019 (r355764) +++ head/sys/vm/vm_page.h Sun Dec 15 03:15:06 2019 (r355765) @@ -429,6 +429,10 @@ extern struct mtx_padalign pa_lock[]; * PGA_REQUEUE_HEAD is a special flag for enqueuing pages near the head of * the inactive queue, thus bypassing LRU. The page lock must be held to * set this flag, and the queue lock for the page must be held to clear it. + * + * PGA_SWAP_FREE is used to defer freeing swap space to the pageout daemon + * when the context that dirties the page does not have the object write lock + * held. */ #define PGA_WRITEABLE 0x0001 /* page may be mapped writeable */ #define PGA_REFERENCED 0x0002 /* page has been referenced */ @@ -438,6 +442,8 @@ extern struct mtx_padalign pa_lock[]; #define PGA_REQUEUE 0x0020 /* page is due to be requeued */ #define PGA_REQUEUE_HEAD 0x0040 /* page requeue should bypass LRU */ #define PGA_NOSYNC 0x0080 /* do not collect for syncer */ +#define PGA_SWAP_FREE 0x0100 /* page with swap space was dirtied */ +#define PGA_SWAP_SPACE 0x0200 /* page has allocated swap space */ #define PGA_QUEUE_OP_MASK (PGA_DEQUEUE | PGA_REQUEUE | PGA_REQUEUE_HEAD) #define PGA_QUEUE_STATE_MASK (PGA_ENQUEUED | PGA_QUEUE_OP_MASK) @@ -647,6 +653,7 @@ void vm_page_requeue(vm_page_t m); int vm_page_sbusied(vm_page_t m); vm_page_t vm_page_scan_contig(u_long npages, vm_page_t m_start, vm_page_t m_end, u_long alignment, vm_paddr_t boundary, int options); +vm_page_bits_t vm_page_set_dirty(vm_page_t m); void vm_page_set_valid_range(vm_page_t m, int base, int size); int vm_page_sleep_if_busy(vm_page_t m, const char *msg); int vm_page_sleep_if_xbusy(vm_page_t m, const char *msg); Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sun Dec 15 02:02:27 2019 (r355764) +++ head/sys/vm/vm_pageout.c Sun Dec 15 03:15:06 2019 (r355765) @@ -1307,6 +1307,14 @@ act_scan: act_delta++; } + /* Deferred free of swap space. */ + if ((m->a.flags & PGA_SWAP_FREE) != 0 && + VM_OBJECT_TRYWLOCK(object)) { + if (m->object == object) + vm_pager_page_unswapped(m); + VM_OBJECT_WUNLOCK(object); + } + /* * Advance or decay the act_count based on recent usage. */ @@ -1541,6 +1549,10 @@ recheck: addl_page_shortage++; goto reinsert; } + + /* Deferred free of swap space. */ + if ((m->a.flags & PGA_SWAP_FREE) != 0) + vm_pager_page_unswapped(m); /* * Re-check for wirings now that we hold the object lock and Modified: head/sys/vm/vm_pager.h ============================================================================== --- head/sys/vm/vm_pager.h Sun Dec 15 02:02:27 2019 (r355764) +++ head/sys/vm/vm_pager.h Sun Dec 15 03:15:06 2019 (r355765) @@ -179,9 +179,6 @@ vm_pager_populate(vm_object_t object, vm_pindex_t pidx * * Destroy swap associated with the page. * - * The object containing the page must be locked. - * This function may not block. - * * XXX: A much better name would be "vm_pager_page_dirtied()" * XXX: It is not obvious if this could be profitably used by any * XXX: pagers besides the swap_pager or if it should even be a @@ -191,7 +188,6 @@ static __inline void vm_pager_page_unswapped(vm_page_t m) { - VM_OBJECT_ASSERT_LOCKED(m->object); if (pagertab[m->object->type]->pgo_pageunswapped) (*pagertab[m->object->type]->pgo_pageunswapped)(m); } From owner-svn-src-head@freebsd.org Sun Dec 15 04:08:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBA0C1E0E16; Sun, 15 Dec 2019 04:08:25 +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 47b9qs4SfBz46K8; Sun, 15 Dec 2019 04:08:25 +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 8978C7685; Sun, 15 Dec 2019 04:08:25 +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 xBF48PZR023967; Sun, 15 Dec 2019 04:08:25 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBF48Plm023965; Sun, 15 Dec 2019 04:08:25 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201912150408.xBF48Plm023965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 15 Dec 2019 04:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355766 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355766 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 04:08:25 -0000 Author: jeff Date: Sun Dec 15 04:08:24 2019 New Revision: 355766 URL: https://svnweb.freebsd.org/changeset/base/355766 Log: Previously we did not support invalid pages in default objects. This means that if fault fails to progress and needs to restart the loop it must free the page it is working on and allocate again on restart. Resolve the few places that need to be modified to support this condition and simply deactivate the page. Presently, we only permit this when fault restarts for busy contention. This has an added benefit of removing some object trylocking in this case. While here consolidate some page cleanup logic into fault_page_free() and fault_page_release() to reduce redundant code and automate some teardown. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D22653 Modified: head/sys/vm/vm_fault.c head/sys/vm/vm_object.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sun Dec 15 03:15:06 2019 (r355765) +++ head/sys/vm/vm_fault.c Sun Dec 15 04:08:24 2019 (r355766) @@ -151,23 +151,42 @@ SYSCTL_INT(_vm, OID_AUTO, pfault_oom_wait, CTLFLAG_RWT "the page fault handler"); static inline void -release_page(struct faultstate *fs) +fault_page_release(vm_page_t *mp) { + vm_page_t m; - if (fs->m != NULL) { + m = *mp; + if (m != NULL) { /* - * fs->m's object lock might not be held, so the page must be - * kept busy until we are done with it. + * We are likely to loop around again and attempt to busy + * this page. Deactivating it leaves it available for + * pageout while optimizing fault restarts. */ - vm_page_lock(fs->m); - vm_page_deactivate(fs->m); - vm_page_unlock(fs->m); - vm_page_xunbusy(fs->m); - fs->m = NULL; + vm_page_lock(m); + vm_page_deactivate(m); + vm_page_unlock(m); + vm_page_xunbusy(m); + *mp = NULL; } } static inline void +fault_page_free(vm_page_t *mp) +{ + vm_page_t m; + + m = *mp; + if (m != NULL) { + VM_OBJECT_ASSERT_WLOCKED(m->object); + if (!vm_page_wired(m)) + vm_page_free(m); + else + vm_page_xunbusy(m); + *mp = NULL; + } +} + +static inline void unlock_map(struct faultstate *fs) { @@ -191,13 +210,13 @@ static void fault_deallocate(struct faultstate *fs) { + fault_page_release(&fs->m); vm_object_pip_wakeup(fs->object); if (fs->object != fs->first_object) { VM_OBJECT_WLOCK(fs->first_object); - vm_page_free(fs->first_m); - vm_object_pip_wakeup(fs->first_object); + fault_page_free(&fs->first_m); VM_OBJECT_WUNLOCK(fs->first_object); - fs->first_m = NULL; + vm_object_pip_wakeup(fs->first_object); } vm_object_deallocate(fs->first_object); unlock_map(fs); @@ -657,7 +676,6 @@ vm_fault_lock_vnode(struct faultstate *fs) } vhold(vp); - release_page(fs); unlock_and_deallocate(fs); error = vget(vp, locked | LK_RETRY | LK_CANRECURSE, curthread); vdrop(vp); @@ -774,7 +792,7 @@ RetryFault_oom: fs.lookup_still_valid = true; - fs.first_m = NULL; + fs.m = fs.first_m = NULL; /* * Search for the page at object/offset. @@ -782,6 +800,8 @@ RetryFault_oom: fs.object = fs.first_object; fs.pindex = fs.first_pindex; while (TRUE) { + KASSERT(fs.m == NULL, + ("page still set %p at loop start", fs.m)); /* * If the object is marked for imminent termination, * we retry here, since the collapse pass has raced @@ -826,23 +846,15 @@ RetryFault_oom: */ vm_page_aflag_set(fs.m, PGA_REFERENCED); if (fs.object != fs.first_object) { - if (!VM_OBJECT_TRYWLOCK( - fs.first_object)) { - VM_OBJECT_WUNLOCK(fs.object); - VM_OBJECT_WLOCK(fs.first_object); - VM_OBJECT_WLOCK(fs.object); - } - vm_page_free(fs.first_m); + fault_page_release(&fs.first_m); vm_object_pip_wakeup(fs.first_object); - VM_OBJECT_WUNLOCK(fs.first_object); - fs.first_m = NULL; } unlock_map(&fs); + vm_object_pip_wakeup(fs.object); if (fs.m == vm_page_lookup(fs.object, fs.pindex)) { vm_page_sleep_if_busy(fs.m, "vmpfw"); } - vm_object_pip_wakeup(fs.object); VM_OBJECT_WUNLOCK(fs.object); VM_CNT_INC(v_intrans); vm_object_deallocate(fs.first_object); @@ -1091,40 +1103,28 @@ readrest: * an error. */ if (rv == VM_PAGER_ERROR || rv == VM_PAGER_BAD) { - if (!vm_page_wired(fs.m)) - vm_page_free(fs.m); - else - vm_page_xunbusy(fs.m); - fs.m = NULL; + fault_page_free(&fs.m); unlock_and_deallocate(&fs); return (KERN_OUT_OF_BOUNDS); } - /* - * 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) { - if (!vm_page_wired(fs.m)) - vm_page_free(fs.m); - else - vm_page_xunbusy(fs.m); - fs.m = NULL; - } } /* - * We get here if the object has default pager (or unwiring) - * or the pager doesn't have the page. + * 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) + 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 @@ -1142,9 +1142,11 @@ readrest: fs.object = fs.first_object; fs.pindex = fs.first_pindex; - fs.m = fs.first_m; VM_OBJECT_WLOCK(fs.object); } + MPASS(fs.first_m != NULL); + MPASS(fs.m == NULL); + fs.m = fs.first_m; fs.first_m = NULL; /* @@ -1161,6 +1163,7 @@ readrest: 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); @@ -1257,7 +1260,7 @@ readrest: /* * We no longer need the old page or object. */ - release_page(&fs); + fault_page_release(&fs.m); } /* * fs.object != fs.first_object due to above @@ -1295,7 +1298,6 @@ readrest: */ if (!fs.lookup_still_valid) { if (!vm_map_trylock_read(fs.map)) { - release_page(&fs); unlock_and_deallocate(&fs); goto RetryFault; } @@ -1310,7 +1312,6 @@ readrest: * pageout will grab it eventually. */ if (result != KERN_SUCCESS) { - release_page(&fs); unlock_and_deallocate(&fs); /* @@ -1323,7 +1324,6 @@ readrest: } if ((retry_object != fs.first_object) || (retry_pindex != fs.first_pindex)) { - release_page(&fs); unlock_and_deallocate(&fs); goto RetryFault; } @@ -1339,7 +1339,6 @@ readrest: prot &= retry_prot; fault_type &= retry_prot; if (prot == 0) { - release_page(&fs); unlock_and_deallocate(&fs); goto RetryFault; } @@ -1400,6 +1399,7 @@ readrest: vm_page_wire(fs.m); } vm_page_xunbusy(fs.m); + fs.m = NULL; /* * Unlock everything, and return Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sun Dec 15 03:15:06 2019 (r355765) +++ head/sys/vm/vm_object.c Sun Dec 15 04:08:24 2019 (r355766) @@ -1477,6 +1477,18 @@ retry: goto retry; } + /* + * The page was left invalid. Likely placed there by + * an incomplete fault. Just remove and ignore. + */ + if (vm_page_none_valid(m)) { + if (vm_page_remove(m)) + vm_page_free(m); + else + vm_page_xunbusy(m); + continue; + } + /* vm_page_rename() will dirty the page. */ if (vm_page_rename(m, new_object, idx)) { vm_page_xunbusy(m); @@ -1688,8 +1700,18 @@ vm_object_collapse_scan(vm_object_t object, int op) continue; } - KASSERT(pp == NULL || !vm_page_none_valid(pp), - ("unbusy invalid page %p", pp)); + if (pp != NULL && vm_page_none_valid(pp)) { + /* + * The page was invalid in the parent. Likely placed + * there by an incomplete fault. Just remove and + * ignore. p can replace it. + */ + if (vm_page_remove(pp)) + vm_page_free(pp); + else + vm_page_xunbusy(pp); + pp = NULL; + } if (pp != NULL || vm_pager_has_page(object, new_pindex, NULL, NULL)) { From owner-svn-src-head@freebsd.org Sun Dec 15 04:22:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7803A1E1454; Sun, 15 Dec 2019 04:22:51 +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 47bB8W2bmzz47Dc; Sun, 15 Dec 2019 04:22:51 +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 548B57A20; Sun, 15 Dec 2019 04:22:51 +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 xBF4Mpwg035244; Sun, 15 Dec 2019 04:22:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBF4Mpfl035243; Sun, 15 Dec 2019 04:22:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912150422.xBF4Mpfl035243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 15 Dec 2019 04:22:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355769 - head/sys/dev/kbd X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/kbd X-SVN-Commit-Revision: 355769 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 04:22:51 -0000 Author: kevans Date: Sun Dec 15 04:22:50 2019 New Revision: 355769 URL: https://svnweb.freebsd.org/changeset/base/355769 Log: kbd: drop _KERNEL #ifdef in kbdreg.h This #ifdef is misleading as there are actually no user-serviceable parts inside and, as far as I can tell, there is no pollution leading from userland to this header. Furthermore, it becomes a slight nuisance when attempting to move things around in this header. Modified: head/sys/dev/kbd/kbdreg.h Modified: head/sys/dev/kbd/kbdreg.h ============================================================================== --- head/sys/dev/kbd/kbdreg.h Sun Dec 15 04:20:57 2019 (r355768) +++ head/sys/dev/kbd/kbdreg.h Sun Dec 15 04:22:50 2019 (r355769) @@ -215,8 +215,6 @@ typedef struct keyboard_driver { int (*configure)(int); /* backdoor for the console driver */ } keyboard_driver_t; -#ifdef _KERNEL - #define KEYBOARD_DRIVER(name, sw, config) \ static struct keyboard_driver name##_kbd_driver = { \ { NULL }, #name, &sw, config \ @@ -307,7 +305,5 @@ kbd_diag_t genkbd_diag; int genkbd_commonioctl(keyboard_t *kbd, u_long cmd, caddr_t arg); int genkbd_keyaction(keyboard_t *kbd, int keycode, int up, int *shiftstate, int *accents); - -#endif /* _KERNEL */ #endif /* !_DEV_KBD_KBDREG_H_ */ From owner-svn-src-head@freebsd.org Sun Dec 15 06:26:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 19C9B1E33C3; Sun, 15 Dec 2019 06:26:48 +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 47bDvW6grnz4CFS; Sun, 15 Dec 2019 06:26:47 +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 DC3C68F37; Sun, 15 Dec 2019 06:26:47 +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 xBF6QlN9005741; Sun, 15 Dec 2019 06:26:47 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBF6QlVh005740; Sun, 15 Dec 2019 06:26:47 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201912150626.xBF6QlVh005740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 15 Dec 2019 06:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355771 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 06:26:48 -0000 Author: jeff Date: Sun Dec 15 06:26:47 2019 New Revision: 355771 URL: https://svnweb.freebsd.org/changeset/base/355771 Log: Fix a mistake in r355765. We need to activate the page if it is not yet on a pagequeue. Reported by: pho Modified: head/sys/kern/uipc_shm.c Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Sun Dec 15 05:50:56 2019 (r355770) +++ head/sys/kern/uipc_shm.c Sun Dec 15 06:26:47 2019 (r355771) @@ -209,7 +209,9 @@ uiomove_object_page(vm_object_t obj, size_t len, struc error = uiomove_fromphys(&m, offset, tlen, uio); if (uio->uio_rw == UIO_WRITE && error == 0) vm_page_set_dirty(m); - vm_page_aflag_set(m, PGA_REFERENCED); + vm_page_lock(m); + vm_page_activate(m); + vm_page_unlock(m); vm_page_sunbusy(m); return (error); From owner-svn-src-head@freebsd.org Sun Dec 15 07:21:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A56581E46CD; Sun, 15 Dec 2019 07:21:00 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com [209.85.222.194]) (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 47bG643sWCz4FD7; Sun, 15 Dec 2019 07:21:00 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-qk1-f194.google.com with SMTP id a203so1723222qkc.3; Sat, 14 Dec 2019 23:21:00 -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=N1asKt6rcvgs4USbir7TnQHNMBxntaIWEmSBAecSA1A=; b=pfwqpNxgvnMOcPqsaJBmgrTZ2IvBTCSyw8ahn1uKfW/22jPHSgtUBiM0HIii9NEFLm cBflwTF+58CcPjEasTTiQt3HHmIQiURjZra1v4B0s5hPR5XnD7RmVrAGXM+9YnqEF4+R n3z+tGGxTdxuKMs6GFlarcqiW5GMVJnC+27b7S+binmRvi8ojd6/B6sHdDsNL2IJbJoH fSRlZXwrsPnWnEw4c91tbMTDPfTKqNqZ7FATIHwAVjH2DMDtTlayvH2RechA5u3Calmz Lq3OjwodavBA3Lqj0EGX+BxzYaAHGffaoHPRk0gWkQ4vfqjXJOUlKi4A7ozs6KIw9ms3 Q7kw== X-Gm-Message-State: APjAAAVI6uDG74w7BQ53ShPxe58a7/1ZvFflxZSaPPi0NGPSpEohn353 +oAfKfkjG8skbiP+H7FM7f/RXTrguXd1HruugaJd2v0b X-Google-Smtp-Source: APXvYqwNDBxzlAfwksa+bFun5JhS6itvRhuvUsVr57hf5BNuKvHWroLV8LGVuQTEx0ExaZvnA6HNvaV4kxBYh9WwHAw= X-Received: by 2002:a37:a197:: with SMTP id k145mr21350020qke.486.1576394458337; Sat, 14 Dec 2019 23:20:58 -0800 (PST) MIME-Version: 1.0 References: <201912140828.xBE8SAXq027656@repo.freebsd.org> In-Reply-To: <201912140828.xBE8SAXq027656@repo.freebsd.org> From: Antoine Brodin Date: Sun, 15 Dec 2019 08:20:46 +0100 Message-ID: Subject: Re: svn commit: r355747 - in head: . include lib/libc/stdlib lib/libxo To: Conrad Meyer Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 47bG643sWCz4FD7 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]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 07:21:00 -0000 On Sat, Dec 14, 2019 at 9:28 AM Conrad Meyer wrote: > > Author: cem > Date: Sat Dec 14 08:28:10 2019 > New Revision: 355747 > URL: https://svnweb.freebsd.org/changeset/base/355747 > > Log: > Deprecate sranddev(3) API Hi, The stdlib.h header is now broken and most ports are broken. /usr/include/stdlib.h:317:8: error: unknown type name 'inline' static inline void ^ Please fix. Atnoine (with hat: portmgr) From owner-svn-src-head@freebsd.org Sun Dec 15 07:21:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 29AAC1E472B; Sun, 15 Dec 2019 07:21:20 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "anubis.delphij.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47bG6S05S2z4FSq; Sun, 15 Dec 2019 07:21:19 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from p51.home.us.delphij.net (c-24-6-173-228.hsd1.ca.comcast.net [24.6.173.228]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 71DF53BF33; Sat, 14 Dec 2019 23:21:11 -0800 (PST) Reply-To: d@delphij.net Subject: Re: svn commit: r355759 - in head: include sys/sys To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201912142152.xBELqnYJ005845@repo.freebsd.org> From: Xin Li Autocrypt: addr=delphij@delphij.net; keydata= mQINBFuSR4oBEACvvEgwRIHs6IcSP/yaDtySF78Ji3rP29qdiQsxhMsOtvtffdbS56VApIWO UFb3/iN2gA8HwLvrmjijN0HEoLVX7na1WARmxRYzQMtApsZIUTtx7hnUYlsi2F5odZa6CDW9 a954DLRzYxiUwYDcu5Zjl9bglK1H8e/N9uC0Vuigr4teWfh86brzOyf819QzwFVYfMIK4ihw QGwMvTzbyVuCFy+LENkmcVYni70oQy6rZ5ktSuYbuOFvu7inRRfhSWPHziV7k+bW88sJ7xhv lBlegcnhkSudWX2M8tZ3MO1PJOcyys0CJlsBY5Weiog2lIPi05h/E9pZ9mc1Vud17iqDaL6w RaggOUhuPfDGCdO5ro82W4BZGeQMRnRF5Ntk+t2ShIH4nn3xRLV0E5nziCiKlgiMqOrz/ZTL QTVbHrCuiwD+fSK14y0oHbkOLYTYLlgh1JbwfY2Ty7elOYiWzyeJ7sJh2dF91NSEneWIOys3 mBpuvtU3nSzzTvAB48VV+Nbg1CpIOgNlPjj7uhIum/Z/VjUaJEyaLpTIRh0MVJVcbP7hXSqZ NA35EEZZVnWEOYdycm4CmEdeNPWkrAf2Ya77iR5VLGypwMlsUMQPh+sKVWDD38M8stFGBBNm d01Hi74Bsq5hKan654dOqMt5eYklrVj0ucMzFQtus7oE502UswARAQABtBxYaW4gTEkgPGRl bHBoaWpAZGVscGhpai5uZXQ+iQJUBBMBCgA+FiEEceNg5NEMZIki80nQQHl/fJX0g08FAluS R/YCGwMFCQmuhAAFCwkIBwMFFQoJCAsFFgIDAQACHgECF4AACgkQQHl/fJX0g0+2Og//bWpE F2V5/M5l6YW1T8oLcT9rIOH6oq9M0LMNRgFeiNNnilGIeeIgtOGBRueG4CZiZAvsRPJkrO70 1R2SrdkCIvwGUzUAxx1NfBWb+vgm4fgkW/MotGonceM5v0qfSKKXasWvDctkK28aG+IoQzmi FjXNW4+ju4zeQFYwD4ZDWqw9MqO0hVb24uW3dxtQhbfmOLgJ/PEDMQaFuANbW1c+iR0BQA3D Go/EeMY4kpN8on6Aqt/S/4JVltudfQ9OXdjQsC7netSaB9K3mHGt9aKAAB7RzlRY00DKkYS/ /eQwLzGPmK7yX13M68mMDjBs6mIR8t/E1S5OdBNhHRPNPlEbwugR4KaiCsN5yqzJoSV99fKY z2VyxjWPaG8yhHE+jmKUgIBKTfFUQEfkriQR4EASoeJ+soaMTiFDBij1Zw5n3ndLRFMB1ZCl fZLER36mAgW4m4kP83TWnDiJLxOxSOxifV8HpTFjff902H85cybg9KMwrfPDr6W19GGk5Vo1 fkza5krRMGbKWb7+74Evusi0ZxJLIOFwp5Y8eVqUMZaAD3f1ZX1M3pgXOp20QgAy+2KvMHij rLa4q+tMGRzYYD1BnFVSVdXAX5VOoTmHBcDz67DkuRwk2Byp1sgd407oEOmSwrNJlKS0TPCm xUJ2fdSQF+1/MMSRfee49vtMvz7cOrC5Ag0EW5JHigEQANiBmIFAfRNH3nzYNWC0yC+tfx3z sUwAsH1VaBM/cTib+yKtbBOSIlXWjJZWX3MHwoI/1LeGghB2mxkkX1L0pJ/vj1eXNR+sFZ32 0pYcl61Fxg/5fioG4QDTM4i3i7NR5PxDnc6UVaynSlII93DedRhZ1ROtdn4vyMgzsDiqhbL7 BthDOt5KxjqdRk4qRPSw7BovEqZLOcG5IJtf/zZUzRbM7SBljEbOAfekDGx1Br+RrYSD7/Ef Pwwzou9T8315IpBpIHyQF/dZNk3iFiB9Ed5CA71ZRYV5YoLWE9lL0j9kxOLQ5vHnX3mVq7QZ Bc7nzwZ6UhQgYmrG5+RWvuiPpGwvDRIsugJUGXucYkAQh5kuNblmkwpv6u9rNMjCNbzAylOa qdogra5EW+RUSbRz0b4iIr8nnZeAlh7BihCe7JjOwbDjoBEEEtSfVc4hD/LENqpcYVrChphf aOLB9YIXhnVDTVvMc9OklWT/81HzAaDQqOQCzEfY92199Ct9/CwRoQ2OpO8TO5+8A7b9Nb33 nmxMn09mb48ruRacMrfHxCWbgU4w9SEfbip4GcS5wGG6yTC+hw55Iwnnwus40NrJ0GEr8a4r cdsLbkvlyoNHB8ZGgyJ4aFCQ1V4qE1BnlTk7Z8BYBUkJM1odPSkVvHpCnMUjVpJ3hEOC+73Z YH1dh7lZABEBAAGJAjwEGAEKACYWIQRx42Dk0QxkiSLzSdBAeX98lfSDTwUCW5JHigIbDAUJ Ca6EAAAKCRBAeX98lfSDTz8DEACMh3poeUb+gWNF4RWFZuLteZVo0+E1JLYXQkmtrRBLXviP +Qy0pXyFAVxLM4hNIBoIDYfK9BcwrBYf7AwSKrH0GiNwFpgHCkbZd6qoZy2gB+adTnCpVCTJ KJetsH/8awkrChJWMK0ckGf3EeWMPvawG7kW7FBz70NYEZ0pOMiaEZNVtzD3wwbYWUiDFYth 83XGglOExg+1ShTW5XjQPRrdyJAO+aUW4o3lVjfyUJXMgI4rmhMiLVm06GuNrbpKIF0s+4Vd jQAjhrDQjfoXi9CkfsA/cONseuHNv1JGj3RqHiqHJq1dbrpodXp925zGDAnUGxCOBPoFopAH gVzR89GTut059GpwqsddZmU6y7rqifuam/ekJ+QRwc16vgt7pHqCrTY8WPxRZr2UpFU1wlTo COdeiFep1gq1F9jzFjJnoMaAdmC6k7bgAA+RQusOgIhJL0jIej7DoAHxmxFFCfRy+lDtpXwF gQ8HMvzHI65QWmQnMo7s6SQH/ZH5s1yR6SJq8+3lDz+dCuT42qJVqIPVvxd10LW0FNN+t7HF eLadU6ekSgD13/EYMYXlvNHkw7dAItSDxIzgRyykLz0bCU9xwNWoS4Z43+ifF9anJ+uR0ltW El1j++h6ZrD3LLuCgJIt1so0m49GzdcSpOI7LCwMlacyvafiEyjUn+tSNDsnfw== Organization: The FreeBSD Project Message-ID: <8a1c7bb9-1230-96b5-1aa8-20e82fcca7e9@delphij.net> Date: Sat, 14 Dec 2019 23:21:06 -0800 MIME-Version: 1.0 In-Reply-To: <201912142152.xBELqnYJ005845@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="FxINvwYXCBpumpMy6vsPEQ8l0KUeIwAh3" X-Rspamd-Queue-Id: 47bG6S05S2z4FSq X-Spamd-Bar: ----- X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 07:21:20 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --FxINvwYXCBpumpMy6vsPEQ8l0KUeIwAh3 Content-Type: multipart/mixed; boundary="MuEeTOjXRrATepYbUHpUrafWvCnVsjIJx"; protected-headers="v1" From: Xin Li Reply-To: d@delphij.net To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <8a1c7bb9-1230-96b5-1aa8-20e82fcca7e9@delphij.net> Subject: Re: svn commit: r355759 - in head: include sys/sys References: <201912142152.xBELqnYJ005845@repo.freebsd.org> In-Reply-To: <201912142152.xBELqnYJ005845@repo.freebsd.org> --MuEeTOjXRrATepYbUHpUrafWvCnVsjIJx Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2019-12-14 13:52, Conrad Meyer wrote: > Author: cem > Date: Sat Dec 14 21:52:49 2019 > New Revision: 355759 > URL: https://svnweb.freebsd.org/changeset/base/355759 >=20 > Log: > cdefs: Add __deprecated(message) function attribute macro This conflicts with Linux kernel and breaks DRM. Please use a different name. Cheers, --MuEeTOjXRrATepYbUHpUrafWvCnVsjIJx-- --FxINvwYXCBpumpMy6vsPEQ8l0KUeIwAh3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.2.19 (FreeBSD) iQIzBAEBCgAdFiEEceNg5NEMZIki80nQQHl/fJX0g08FAl313uYACgkQQHl/fJX0 g0/KRg//VK0zrY8Ns5PGbMYhYB4ULjIvbsuTghv3AU3qSFW4nnhfGeegI30HKqla 88t46wdzdP6PGTipSmDq++zlOH7MTjZBnrd9t1QctlIcvfGFQJnY2XSU55zVNmZm rPHbMpSmePyXaEerF87xUcTKWkQSFAY56YVqUi2Jo3Q4WnLCacPODaeEdc8OT8/g 9AqIV5imLd+H5T3uw5KJYSnf1p1lqbShNDyElRcfGOhOX0BG0zIaKGUMcF1B/rLr r8LbFmGXKcmyFzk0YMid/ibl/M4yazZ8vY7svMd7YxZtPX3WhpcC55PPg/ZeyMeq Epkc9EVblpAeMJJeE5CQLg2y1lRQ9HZPHnQ8kVvQjXnUhdrsozAIYIiHa6ETvH8Q hQUI0Jdf+2F7o8ff+/nIZs3mTebJ9bupj81Nz2+H9Bcv97M2VEqdZBPgBJcp33Mn 3sbBftb3WE39b6eBsgXne3PROlHDOCbaFTuio7T5cg9zC5acElifxSB4iGtEJsXH DvzPuef5Tk8TtqD7nRJokLPUhcUrUJg29sAwPj2vcjAarYpclGfsgtmmIJOf5TbM Se+HTkcgQofeoa7xHYY3IC2XBuUHzyENMasa0UqPoZ7wng8C/p494IMzzFQJGplg G5VpbK0ZPDQEIp1ZTkVHwqyRia8c8sz1fYu+DPGx/0XBEkIk0bY= =0w9K -----END PGP SIGNATURE----- --FxINvwYXCBpumpMy6vsPEQ8l0KUeIwAh3-- From owner-svn-src-head@freebsd.org Sun Dec 15 14:09:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A0751EDA41; Sun, 15 Dec 2019 14:09:50 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47bR9p1Tv5z4YmV; Sun, 15 Dec 2019 14:09:50 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13FE5E268; Sun, 15 Dec 2019 14:09:50 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBFE9oPJ076764; Sun, 15 Dec 2019 14:09:50 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBFE9oCe076763; Sun, 15 Dec 2019 14:09:50 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201912151409.xBFE9oCe076763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 15 Dec 2019 14:09:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355773 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 355773 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 14:09:50 -0000 Author: tsoome Date: Sun Dec 15 14:09:49 2019 New Revision: 355773 URL: https://svnweb.freebsd.org/changeset/base/355773 Log: loader: zfsimpl.c cstyle cleanup No functional changes intended. MFC after: 1 week Modified: head/stand/libsa/zfs/zfsimpl.c Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Sun Dec 15 08:23:38 2019 (r355772) +++ head/stand/libsa/zfs/zfsimpl.c Sun Dec 15 14:09:49 2019 (r355773) @@ -104,7 +104,7 @@ typedef struct indirect_vsd { */ static vdev_list_t zfs_vdevs; - /* +/* * List of ZFS features supported for read */ static const char *features_for_read[] = { @@ -140,7 +140,7 @@ static char *dnode_cache_buf; static char *zap_scratch; static char *zfs_temp_buf, *zfs_temp_end, *zfs_temp_ptr; -#define TEMP_SIZE (1024 * 1024) +#define TEMP_SIZE (1024 * 1024) static int zio_read(const spa_t *spa, const blkptr_t *bp, void *buf); static int zfs_get_root(const spa_t *spa, uint64_t *objid); @@ -223,13 +223,13 @@ xdr_uint64_t(const unsigned char **xdr, uint64_t *lp) xdr_u_int(xdr, &hi); xdr_u_int(xdr, &lo); - *lp = (((uint64_t) hi) << 32) | lo; + *lp = (((uint64_t)hi) << 32) | lo; return (0); } static int nvlist_find(const unsigned char *nvlist, const char *name, int type, - int *elementsp, void *valuep) + int *elementsp, void *valuep) { const unsigned char *p, *pair; int junk; @@ -247,33 +247,34 @@ nvlist_find(const unsigned char *nvlist, const char *n const char *pairname; xdr_int(&p, &namelen); - pairname = (const char*) p; + pairname = (const char*)p; p += roundup(namelen, 4); xdr_int(&p, &pairtype); - if (!memcmp(name, pairname, namelen) && type == pairtype) { + if (memcmp(name, pairname, namelen) == 0 && type == pairtype) { xdr_int(&p, &elements); if (elementsp) *elementsp = elements; if (type == DATA_TYPE_UINT64) { - xdr_uint64_t(&p, (uint64_t *) valuep); + xdr_uint64_t(&p, (uint64_t *)valuep); return (0); } else if (type == DATA_TYPE_STRING) { int len; xdr_int(&p, &len); - (*(const char**) valuep) = (const char*) p; + (*(const char**)valuep) = (const char*)p; return (0); - } else if (type == DATA_TYPE_NVLIST - || type == DATA_TYPE_NVLIST_ARRAY) { - (*(const unsigned char**) valuep) = - (const unsigned char*) p; + } else if (type == DATA_TYPE_NVLIST || + type == DATA_TYPE_NVLIST_ARRAY) { + (*(const unsigned char**)valuep) = + (const unsigned char*)p; return (0); } else { return (EIO); } } else { /* - * Not the pair we are looking for, skip to the next one. + * Not the pair we are looking for, skip to the + * next one. */ p = pair + encoded_size; } @@ -311,12 +312,13 @@ nvlist_check_features_for_read(const unsigned char *nv found = 0; xdr_int(&p, &namelen); - pairname = (const char*) p; + pairname = (const char*)p; p += roundup(namelen, 4); xdr_int(&p, &pairtype); for (i = 0; features_for_read[i] != NULL; i++) { - if (!memcmp(pairname, features_for_read[i], namelen)) { + if (memcmp(pairname, features_for_read[i], + namelen) == 0) { found = 1; break; } @@ -362,7 +364,7 @@ nvlist_next(const unsigned char *nvlist) xdr_int(&p, &decoded_size); } - return p; + return (p); } #ifdef TEST @@ -370,7 +372,7 @@ nvlist_next(const unsigned char *nvlist) static const unsigned char * nvlist_print(const unsigned char *nvlist, unsigned int indent) { - static const char* typenames[] = { + static const char *typenames[] = { "DATA_TYPE_UNKNOWN", "DATA_TYPE_BOOLEAN", "DATA_TYPE_BYTE", @@ -417,7 +419,7 @@ nvlist_print(const unsigned char *nvlist, unsigned int const char *pairname; xdr_int(&p, &namelen); - pairname = (const char*) p; + pairname = (const char*)p; p += roundup(namelen, 4); xdr_int(&p, &pairtype); @@ -453,7 +455,8 @@ nvlist_print(const unsigned char *nvlist, unsigned int if (j != elements - 1) { for (i = 0; i < indent; i++) printf(" "); - printf("%s %s", typenames[pairtype], pairname); + printf("%s %s", typenames[pairtype], + pairname); } } break; @@ -469,7 +472,7 @@ nvlist_print(const unsigned char *nvlist, unsigned int xdr_int(&p, &decoded_size); } - return p; + return (p); } #endif @@ -490,7 +493,6 @@ vdev_read_phys(vdev_t *vdev, const blkptr_t *bp, void psize = size; } - /*printf("ZFS: reading %zu bytes at 0x%jx to %p\n", psize, (uintmax_t)offset, buf);*/ rc = vdev->v_phys_read(vdev, vdev->v_read_priv, offset, buf, psize); if (rc) return (rc); @@ -851,7 +853,7 @@ vdev_indirect_remap(vdev_t *vd, uint64_t offset, uint6 printf("vdev_indirect_remap: out of memory.\n"); zio->io_error = ENOMEM; } - for ( ; rs != NULL; rs = list_remove_head(&stack)) { + for (; rs != NULL; rs = list_remove_head(&stack)) { vdev_t *v = rs->rs_vd; uint64_t num_entries = 0; /* vdev_indirect_mapping_t *vim = v->v_mapping; */ @@ -1022,7 +1024,7 @@ vdev_disk_read(vdev_t *vdev, const blkptr_t *bp, void { return (vdev_read_phys(vdev, bp, buf, - offset + VDEV_LABEL_START_SIZE, bytes)); + offset + VDEV_LABEL_START_SIZE, bytes)); } @@ -1121,15 +1123,16 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde return (ENOENT); } - if (strcmp(type, VDEV_TYPE_MIRROR) - && strcmp(type, VDEV_TYPE_DISK) + if (strcmp(type, VDEV_TYPE_MIRROR) != 0 && + strcmp(type, VDEV_TYPE_DISK) != 0 && #ifdef ZFS_TEST - && strcmp(type, VDEV_TYPE_FILE) + strcmp(type, VDEV_TYPE_FILE) != 0 && #endif - && strcmp(type, VDEV_TYPE_RAIDZ) - && strcmp(type, VDEV_TYPE_INDIRECT) - && strcmp(type, VDEV_TYPE_REPLACING)) { - printf("ZFS: can only boot from disk, mirror, raidz1, raidz2 and raidz3 vdevs\n"); + strcmp(type, VDEV_TYPE_RAIDZ) != 0 && + strcmp(type, VDEV_TYPE_INDIRECT) != 0 && + strcmp(type, VDEV_TYPE_REPLACING) != 0) { + printf("ZFS: can only boot from disk, mirror, raidz1, " + "raidz2 and raidz3 vdevs\n"); return (EIO); } @@ -1153,13 +1156,13 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde if (!vdev) { is_new = 1; - if (!strcmp(type, VDEV_TYPE_MIRROR)) + if (strcmp(type, VDEV_TYPE_MIRROR) == 0) vdev = vdev_create(guid, vdev_mirror_read); - else if (!strcmp(type, VDEV_TYPE_RAIDZ)) + else if (strcmp(type, VDEV_TYPE_RAIDZ) == 0) vdev = vdev_create(guid, vdev_raidz_read); - else if (!strcmp(type, VDEV_TYPE_REPLACING)) + else if (strcmp(type, VDEV_TYPE_REPLACING) == 0) vdev = vdev_create(guid, vdev_replacing_read); - else if (!strcmp(type, VDEV_TYPE_INDIRECT)) { + else if (strcmp(type, VDEV_TYPE_INDIRECT) == 0) { vdev_indirect_config_t *vic; vdev = vdev_create(guid, vdev_indirect_read); @@ -1205,7 +1208,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde } else { char *name; - if (!strcmp(type, "raidz")) { + if (strcmp(type, "raidz") == 0) { if (vdev->v_nparity < 1 || vdev->v_nparity > 3) { printf("ZFS: can only boot from disk, " @@ -1213,12 +1216,12 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde "vdevs\n"); return (EIO); } - asprintf(&name, "%s%d-%jd", type, + rc = asprintf(&name, "%s%d-%jd", type, vdev->v_nparity, id); } else { - asprintf(&name, "%s-%jd", type, id); + rc = asprintf(&name, "%s-%jd", type, id); } - if (name == NULL) + if (rc < 0) return (ENOMEM); vdev->v_name = name; } @@ -1258,7 +1261,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde return (rc); if (is_new) STAILQ_INSERT_TAIL(&vdev->v_children, kid, - v_childlink); + v_childlink); kids = nvlist_next(kids); } } else { @@ -1320,7 +1323,7 @@ spa_find_by_guid(uint64_t guid) if (spa->spa_guid == guid) return (spa); - return (0); + return (NULL); } static spa_t * @@ -1329,10 +1332,10 @@ spa_find_by_name(const char *name) spa_t *spa; STAILQ_FOREACH(spa, &zfs_pools, spa_link) - if (!strcmp(spa->spa_name, name)) + if (strcmp(spa->spa_name, name) == 0) return (spa); - return (0); + return (NULL); } #ifdef BOOT2 @@ -1357,7 +1360,7 @@ spa_get_primary_vdev(const spa_t *spa) if (vdev == NULL) return (NULL); for (kid = STAILQ_FIRST(&vdev->v_children); kid != NULL; - kid = STAILQ_FIRST(&vdev->v_children)) + kid = STAILQ_FIRST(&vdev->v_children)) vdev = kid; return (vdev); } @@ -1384,7 +1387,7 @@ spa_create(uint64_t guid, const char *name) static const char * state_name(vdev_state_t state) { - static const char* names[] = { + static const char *names[] = { "UNKNOWN", "CLOSED", "OFFLINE", @@ -1394,7 +1397,7 @@ state_name(vdev_state_t state) "DEGRADED", "ONLINE" }; - return names[state]; + return (names[state]); } #ifdef BOOT2 @@ -1418,7 +1421,7 @@ pager_printf(const char *fmt, ...) #endif -#define STATUS_FORMAT " %s %s\n" +#define STATUS_FORMAT " %s %s\n" static int print_state(int indent, const char *name, vdev_state_t state) @@ -1441,7 +1444,7 @@ vdev_status(vdev_t *vdev, int indent) int ret; if (vdev->v_islog) { - (void)pager_output(" logs\n"); + (void) pager_output(" logs\n"); indent++; } @@ -1736,7 +1739,7 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s if (!SPA_VERSION_IS_SUPPORTED(val)) { printf("ZFS: unsupported ZFS version %u (should be %u)\n", - (unsigned) val, (unsigned) SPA_VERSION); + (unsigned)val, (unsigned)SPA_VERSION); free(nvlist); return (EIO); } @@ -1877,8 +1880,8 @@ ilog2(int n) for (v = 0; v < 32; v++) if (n == (1 << v)) - return v; - return -1; + return (v); + return (-1); } static int @@ -1949,8 +1952,8 @@ zio_read(const spa_t *spa, const blkptr_t *bp, void *b zfs_free(pbuf, size); } if (error != 0) - printf("ZFS: i/o error - unable to decompress block pointer data, error %d\n", - error); + printf("ZFS: i/o error - unable to decompress " + "block pointer data, error %d\n", error); return (error); } @@ -2007,7 +2010,8 @@ zio_read(const spa_t *spa, const blkptr_t *bp, void *b } static int -dnode_read(const spa_t *spa, const dnode_phys_t *dnode, off_t offset, void *buf, size_t buflen) +dnode_read(const spa_t *spa, const dnode_phys_t *dnode, off_t offset, + void *buf, size_t buflen) { int ibshift = dnode->dn_indblkshift - SPA_BLKPTRSHIFT; int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; @@ -2067,7 +2071,7 @@ dnode_read(const spa_t *spa, const dnode_phys_t *dnode i = bsize - boff; if (i > buflen) i = buflen; memcpy(buf, &dnode_cache_buf[boff], i); - buf = ((char*) buf) + i; + buf = ((char*)buf) + i; offset += i; buflen -= i; } @@ -2098,7 +2102,7 @@ mzap_lookup(const dnode_phys_t *dnode, const char *nam for (i = 0; i < chunks; i++) { mze = &mz->mz_chunk[i]; - if (!strcmp(mze->mze_name, name)) { + if (strcmp(mze->mze_name, name) == 0) { *value = mze->mze_value; return (0); } @@ -2112,7 +2116,8 @@ mzap_lookup(const dnode_phys_t *dnode, const char *nam * matches. */ static int -fzap_name_equal(const zap_leaf_t *zl, const zap_leaf_chunk_t *zc, const char *name) +fzap_name_equal(const zap_leaf_t *zl, const zap_leaf_chunk_t *zc, + const char *name) { size_t namelen; const zap_leaf_chunk_t *nc; @@ -2124,6 +2129,7 @@ fzap_name_equal(const zap_leaf_t *zl, const zap_leaf_c p = name; while (namelen > 0) { size_t len; + len = namelen; if (len > ZAP_LEAF_ARRAY_BYTES) len = ZAP_LEAF_ARRAY_BYTES; @@ -2134,7 +2140,7 @@ fzap_name_equal(const zap_leaf_t *zl, const zap_leaf_c nc = &ZAP_LEAF_CHUNK(zl, nc->l_array.la_next); } - return 1; + return (1); } /* @@ -2153,7 +2159,7 @@ fzap_leaf_value(const zap_leaf_t *zl, const zap_leaf_c value = (value << 8) | p[i]; } - return value; + return (value); } static void @@ -2225,7 +2231,7 @@ fzap_lookup(const spa_t *spa, const dnode_phys_t *dnod uint64_t integer_size, uint64_t num_integers, void *value) { int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; - zap_phys_t zh = *(zap_phys_t *) zap_scratch; + zap_phys_t zh = *(zap_phys_t *)zap_scratch; fat_zap_t z; uint64_t *ptrtbl; uint64_t hash; @@ -2235,17 +2241,17 @@ fzap_lookup(const spa_t *spa, const dnode_phys_t *dnod return (EIO); z.zap_block_shift = ilog2(bsize); - z.zap_phys = (zap_phys_t *) zap_scratch; + z.zap_phys = (zap_phys_t *)zap_scratch; /* * Figure out where the pointer table is and read it in if necessary. */ if (zh.zap_ptrtbl.zt_blk) { rc = dnode_read(spa, dnode, zh.zap_ptrtbl.zt_blk * bsize, - zap_scratch, bsize); + zap_scratch, bsize); if (rc) return (rc); - ptrtbl = (uint64_t *) zap_scratch; + ptrtbl = (uint64_t *)zap_scratch; } else { ptrtbl = &ZAP_EMBEDDED_PTRTBL_ENT(&z, 0); } @@ -2262,20 +2268,21 @@ fzap_lookup(const spa_t *spa, const dnode_phys_t *dnod if (rc) return (rc); - zl.l_phys = (zap_leaf_phys_t *) zap_scratch; + zl.l_phys = (zap_leaf_phys_t *)zap_scratch; /* * Make sure this chunk matches our hash. */ - if (zl.l_phys->l_hdr.lh_prefix_len > 0 - && zl.l_phys->l_hdr.lh_prefix - != hash >> (64 - zl.l_phys->l_hdr.lh_prefix_len)) + if (zl.l_phys->l_hdr.lh_prefix_len > 0 && + zl.l_phys->l_hdr.lh_prefix != + hash >> (64 - zl.l_phys->l_hdr.lh_prefix_len)) return (ENOENT); /* * Hash within the chunk to find our entry. */ - int shift = (64 - ZAP_LEAF_HASH_SHIFT(&zl) - zl.l_phys->l_hdr.lh_prefix_len); + int shift = (64 - ZAP_LEAF_HASH_SHIFT(&zl) - + zl.l_phys->l_hdr.lh_prefix_len); int h = (hash >> shift) & ((1 << ZAP_LEAF_HASH_SHIFT(&zl)) - 1); h = zl.l_phys->l_hash[h]; if (h == 0xffff) @@ -2312,12 +2319,12 @@ zap_lookup(const spa_t *spa, const dnode_phys_t *dnode if (rc) return (rc); - zap_type = *(uint64_t *) zap_scratch; + zap_type = *(uint64_t *)zap_scratch; if (zap_type == ZBT_MICRO) - return mzap_lookup(dnode, name, value); + return (mzap_lookup(dnode, name, value)); else if (zap_type == ZBT_HEADER) { - return fzap_lookup(spa, dnode, name, integer_size, - num_integers, value); + return (fzap_lookup(spa, dnode, name, integer_size, + num_integers, value)); } printf("ZFS: invalid zap_type=%d\n", (int)zap_type); return (EIO); @@ -2360,10 +2367,11 @@ mzap_list(const dnode_phys_t *dnode, int (*callback)(c * the directory header. */ static int -fzap_list(const spa_t *spa, const dnode_phys_t *dnode, int (*callback)(const char *, uint64_t)) +fzap_list(const spa_t *spa, const dnode_phys_t *dnode, + int (*callback)(const char *, uint64_t)) { int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; - zap_phys_t zh = *(zap_phys_t *) zap_scratch; + zap_phys_t zh = *(zap_phys_t *)zap_scratch; fat_zap_t z; int i, j, rc; @@ -2371,7 +2379,7 @@ fzap_list(const spa_t *spa, const dnode_phys_t *dnode, return (EIO); z.zap_block_shift = ilog2(bsize); - z.zap_phys = (zap_phys_t *) zap_scratch; + z.zap_phys = (zap_phys_t *)zap_scratch; /* * This assumes that the leaf blocks start at block 1. The @@ -2387,7 +2395,7 @@ fzap_list(const spa_t *spa, const dnode_phys_t *dnode, if (dnode_read(spa, dnode, off, zap_scratch, bsize)) return (EIO); - zl.l_phys = (zap_leaf_phys_t *) zap_scratch; + zl.l_phys = (zap_leaf_phys_t *)zap_scratch; for (j = 0; j < ZAP_LEAF_NUMCHUNKS(&zl); j++) { zap_leaf_chunk_t *zc, *nc; @@ -2422,7 +2430,7 @@ fzap_list(const spa_t *spa, const dnode_phys_t *dnode, */ value = fzap_leaf_value(&zl, zc); - //printf("%s 0x%jx\n", name, (uintmax_t)value); + /* printf("%s 0x%jx\n", name, (uintmax_t)value); */ rc = callback((const char *)name, value); if (rc != 0) return (rc); @@ -2452,15 +2460,16 @@ zap_list(const spa_t *spa, const dnode_phys_t *dnode) if (dnode_read(spa, dnode, 0, zap_scratch, size)) return (EIO); - zap_type = *(uint64_t *) zap_scratch; + zap_type = *(uint64_t *)zap_scratch; if (zap_type == ZBT_MICRO) - return mzap_list(dnode, zfs_printf); + return (mzap_list(dnode, zfs_printf)); else - return fzap_list(spa, dnode, zfs_printf); + return (fzap_list(spa, dnode, zfs_printf)); } static int -objset_get_dnode(const spa_t *spa, const objset_phys_t *os, uint64_t objnum, dnode_phys_t *dnode) +objset_get_dnode(const spa_t *spa, const objset_phys_t *os, uint64_t objnum, + dnode_phys_t *dnode) { off_t offset; @@ -2470,7 +2479,8 @@ objset_get_dnode(const spa_t *spa, const objset_phys_t } static int -mzap_rlookup(const spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) +mzap_rlookup(const spa_t *spa, const dnode_phys_t *dnode, char *name, + uint64_t value) { const mzap_phys_t *mz; const mzap_ent_phys_t *mze; @@ -2483,7 +2493,7 @@ mzap_rlookup(const spa_t *spa, const dnode_phys_t *dno */ size = dnode->dn_datablkszsec * 512; - mz = (const mzap_phys_t *) zap_scratch; + mz = (const mzap_phys_t *)zap_scratch; chunks = size / MZAP_ENT_LEN - 1; for (i = 0; i < chunks; i++) { @@ -2523,7 +2533,8 @@ fzap_name_copy(const zap_leaf_t *zl, const zap_leaf_ch } static int -fzap_rlookup(const spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) +fzap_rlookup(const spa_t *spa, const dnode_phys_t *dnode, char *name, + uint64_t value) { int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; zap_phys_t zh = *(zap_phys_t *) zap_scratch; @@ -2534,7 +2545,7 @@ fzap_rlookup(const spa_t *spa, const dnode_phys_t *dno return (EIO); z.zap_block_shift = ilog2(bsize); - z.zap_phys = (zap_phys_t *) zap_scratch; + z.zap_phys = (zap_phys_t *)zap_scratch; /* * This assumes that the leaf blocks start at block 1. The @@ -2548,7 +2559,7 @@ fzap_rlookup(const spa_t *spa, const dnode_phys_t *dno if (dnode_read(spa, dnode, off, zap_scratch, bsize)) return (EIO); - zl.l_phys = (zap_leaf_phys_t *) zap_scratch; + zl.l_phys = (zap_leaf_phys_t *)zap_scratch; for (j = 0; j < ZAP_LEAF_NUMCHUNKS(&zl); j++) { zap_leaf_chunk_t *zc; @@ -2571,7 +2582,8 @@ fzap_rlookup(const spa_t *spa, const dnode_phys_t *dno } static int -zap_rlookup(const spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) +zap_rlookup(const spa_t *spa, const dnode_phys_t *dnode, char *name, + uint64_t value) { int rc; uint64_t zap_type; @@ -2581,11 +2593,11 @@ zap_rlookup(const spa_t *spa, const dnode_phys_t *dnod if (rc) return (rc); - zap_type = *(uint64_t *) zap_scratch; + zap_type = *(uint64_t *)zap_scratch; if (zap_type == ZBT_MICRO) - return mzap_rlookup(spa, dnode, name, value); + return (mzap_rlookup(spa, dnode, name, value)); else - return fzap_rlookup(spa, dnode, name, value); + return (fzap_rlookup(spa, dnode, name, value)); } static int @@ -2616,15 +2628,17 @@ zfs_rlookup(const spa_t *spa, uint64_t objnum, char *r dd = (dsl_dir_phys_t *)&dir.dn_bonus; /* Actual loop condition. */ - parent_obj = dd->dd_parent_obj; + parent_obj = dd->dd_parent_obj; if (parent_obj == 0) break; - if (objset_get_dnode(spa, &spa->spa_mos, parent_obj, &parent) != 0) + if (objset_get_dnode(spa, &spa->spa_mos, parent_obj, + &parent) != 0) return (EIO); dd = (dsl_dir_phys_t *)&parent.dn_bonus; child_dir_zapobj = dd->dd_child_dir_zapobj; - if (objset_get_dnode(spa, &spa->spa_mos, child_dir_zapobj, &child_dir_zap) != 0) + if (objset_get_dnode(spa, &spa->spa_mos, child_dir_zapobj, + &child_dir_zap) != 0) return (EIO); if (zap_rlookup(spa, &child_dir_zap, component, dir_obj) != 0) return (EIO); @@ -2655,7 +2669,8 @@ zfs_lookup_dataset(const spa_t *spa, const char *name, dsl_dir_phys_t *dd; const char *p, *q; - if (objset_get_dnode(spa, &spa->spa_mos, DMU_POOL_DIRECTORY_OBJECT, &dir)) + if (objset_get_dnode(spa, &spa->spa_mos, + DMU_POOL_DIRECTORY_OBJECT, &dir)) return (EIO); if (zap_lookup(spa, &dir, DMU_POOL_ROOT_DATASET, sizeof (dir_obj), 1, &dir_obj)) @@ -2684,7 +2699,8 @@ zfs_lookup_dataset(const spa_t *spa, const char *name, } child_dir_zapobj = dd->dd_child_dir_zapobj; - if (objset_get_dnode(spa, &spa->spa_mos, child_dir_zapobj, &child_dir_zap) != 0) + if (objset_get_dnode(spa, &spa->spa_mos, child_dir_zapobj, + &child_dir_zap) != 0) return (EIO); /* Actual loop condition #2. */ @@ -2710,7 +2726,7 @@ zfs_list_dataset(const spa_t *spa, uint64_t objnum/*, printf("ZFS: can't find dataset %ju\n", (uintmax_t)objnum); return (EIO); } - ds = (dsl_dataset_phys_t *) &dataset.dn_bonus; + ds = (dsl_dataset_phys_t *)&dataset.dn_bonus; dir_obj = ds->ds_dir_obj; if (objset_get_dnode(spa, &spa->spa_mos, dir_obj, &dir)) { @@ -2720,7 +2736,8 @@ zfs_list_dataset(const spa_t *spa, uint64_t objnum/*, dd = (dsl_dir_phys_t *)&dir.dn_bonus; child_dir_zapobj = dd->dd_child_dir_zapobj; - if (objset_get_dnode(spa, &spa->spa_mos, child_dir_zapobj, &child_dir_zap) != 0) { + if (objset_get_dnode(spa, &spa->spa_mos, child_dir_zapobj, + &child_dir_zap) != 0) { printf("ZFS: can't find child zap %ju\n", (uintmax_t)dir_obj); return (EIO); } @@ -2729,7 +2746,8 @@ zfs_list_dataset(const spa_t *spa, uint64_t objnum/*, } int -zfs_callback_dataset(const spa_t *spa, uint64_t objnum, int (*callback)(const char *, uint64_t)) +zfs_callback_dataset(const spa_t *spa, uint64_t objnum, + int (*callback)(const char *, uint64_t)) { uint64_t dir_obj, child_dir_zapobj, zap_type; dnode_phys_t child_dir_zap, dir, dataset; @@ -2742,7 +2760,7 @@ zfs_callback_dataset(const spa_t *spa, uint64_t objnum printf("ZFS: can't find dataset %ju\n", (uintmax_t)objnum); return (err); } - ds = (dsl_dataset_phys_t *) &dataset.dn_bonus; + ds = (dsl_dataset_phys_t *)&dataset.dn_bonus; dir_obj = ds->ds_dir_obj; err = objset_get_dnode(spa, &spa->spa_mos, dir_obj, &dir); @@ -2753,21 +2771,23 @@ zfs_callback_dataset(const spa_t *spa, uint64_t objnum dd = (dsl_dir_phys_t *)&dir.dn_bonus; child_dir_zapobj = dd->dd_child_dir_zapobj; - err = objset_get_dnode(spa, &spa->spa_mos, child_dir_zapobj, &child_dir_zap); + err = objset_get_dnode(spa, &spa->spa_mos, child_dir_zapobj, + &child_dir_zap); if (err != 0) { printf("ZFS: can't find child zap %ju\n", (uintmax_t)dir_obj); return (err); } - err = dnode_read(spa, &child_dir_zap, 0, zap_scratch, child_dir_zap.dn_datablkszsec * 512); + err = dnode_read(spa, &child_dir_zap, 0, zap_scratch, + child_dir_zap.dn_datablkszsec * 512); if (err != 0) return (err); - zap_type = *(uint64_t *) zap_scratch; + zap_type = *(uint64_t *)zap_scratch; if (zap_type == ZBT_MICRO) - return mzap_list(&child_dir_zap, callback); + return (mzap_list(&child_dir_zap, callback)); else - return fzap_list(spa, &child_dir_zap, callback); + return (fzap_list(spa, &child_dir_zap, callback)); } #endif @@ -2786,7 +2806,7 @@ zfs_mount_dataset(const spa_t *spa, uint64_t objnum, o return (EIO); } - ds = (dsl_dataset_phys_t *) &dataset.dn_bonus; + ds = (dsl_dataset_phys_t *)&dataset.dn_bonus; if (zio_read(spa, &ds->ds_bp, objset)) { printf("ZFS: can't read object set for dataset %ju\n", (uintmax_t)objnum); @@ -2811,7 +2831,8 @@ zfs_get_root(const spa_t *spa, uint64_t *objid) /* * Start with the MOS directory object. */ - if (objset_get_dnode(spa, &spa->spa_mos, DMU_POOL_DIRECTORY_OBJECT, &dir)) { + if (objset_get_dnode(spa, &spa->spa_mos, + DMU_POOL_DIRECTORY_OBJECT, &dir)) { printf("ZFS: can't read MOS object directory\n"); return (EIO); } @@ -2819,19 +2840,21 @@ zfs_get_root(const spa_t *spa, uint64_t *objid) /* * Lookup the pool_props and see if we can find a bootfs. */ - if (zap_lookup(spa, &dir, DMU_POOL_PROPS, sizeof (props), 1, &props) == 0 - && objset_get_dnode(spa, &spa->spa_mos, props, &propdir) == 0 - && zap_lookup(spa, &propdir, "bootfs", sizeof (bootfs), 1, &bootfs) == 0 - && bootfs != 0) - { + if (zap_lookup(spa, &dir, DMU_POOL_PROPS, + sizeof(props), 1, &props) == 0 && + objset_get_dnode(spa, &spa->spa_mos, props, &propdir) == 0 && + zap_lookup(spa, &propdir, "bootfs", + sizeof(bootfs), 1, &bootfs) == 0 && + bootfs != 0) { *objid = bootfs; return (0); } /* * Lookup the root dataset directory */ - if (zap_lookup(spa, &dir, DMU_POOL_ROOT_DATASET, sizeof (root), 1, &root) - || objset_get_dnode(spa, &spa->spa_mos, root, &dir)) { + if (zap_lookup(spa, &dir, DMU_POOL_ROOT_DATASET, + sizeof(root), 1, &root) || + objset_get_dnode(spa, &spa->spa_mos, root, &dir)) { printf("ZFS: can't find root dsl_dir\n"); return (EIO); } @@ -2840,7 +2863,7 @@ zfs_get_root(const spa_t *spa, uint64_t *objid) * Use the information from the dataset directory's bonus buffer * to find the dataset object and from that the object set itself. */ - dsl_dir_phys_t *dd = (dsl_dir_phys_t *) &dir.dn_bonus; + dsl_dir_phys_t *dd = (dsl_dir_phys_t *)&dir.dn_bonus; *objid = dd->dd_head_dataset_obj; return (0); } @@ -2923,7 +2946,7 @@ check_mos_features(const spa_t *spa) if (dnode_read(spa, &dir, 0, zap_scratch, size)) return (EIO); - zap_type = *(uint64_t *) zap_scratch; + zap_type = *(uint64_t *)zap_scratch; if (zap_type == ZBT_MICRO) rc = mzap_list(&dir, check_feature); else @@ -3019,8 +3042,7 @@ zfs_spa_init(spa_t *spa) goto done; } - if (nvlist_find(nv, ZPOOL_CONFIG_TYPE, DATA_TYPE_STRING, - NULL, &type)) { + if (nvlist_find(nv, ZPOOL_CONFIG_TYPE, DATA_TYPE_STRING, NULL, &type)) { printf("ZFS: can't find vdev details\n"); rc = ENOENT; goto done; @@ -3217,7 +3239,7 @@ zfs_lookup(const struct zfsmount *mount, const char *u return (rc); } - rc = zap_lookup(spa, &dn, ZFS_ROOT_OBJ, sizeof (objnum), 1, &objnum); + rc = zap_lookup(spa, &dn, ZFS_ROOT_OBJ, sizeof(objnum), 1, &objnum); if (rc) { free(entry); return (rc); From owner-svn-src-head@freebsd.org Sun Dec 15 14:28:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 921521EDF56; Sun, 15 Dec 2019 14:28:38 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47bRbV3Knkz4ZV7; Sun, 15 Dec 2019 14:28:38 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DAE2E5FF; Sun, 15 Dec 2019 14:28:38 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBFESclM088541; Sun, 15 Dec 2019 14:28:38 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBFEScHJ088540; Sun, 15 Dec 2019 14:28:38 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201912151428.xBFEScHJ088540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 15 Dec 2019 14:28:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355774 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 355774 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 14:28:38 -0000 Author: mmel Date: Sun Dec 15 14:28:38 2019 New Revision: 355774 URL: https://svnweb.freebsd.org/changeset/base/355774 Log: 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. MFC after: 3 weeks Modified: head/sys/dev/nvme/nvme_qpair.c Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Sun Dec 15 14:09:49 2019 (r355773) +++ head/sys/dev/nvme/nvme_qpair.c Sun Dec 15 14:28:38 2019 (r355774) @@ -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-head@freebsd.org Sun Dec 15 15:49:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 816EF1EF633 for ; Sun, 15 Dec 2019 15:49:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) (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 47bTNj4ZdJz4dQP for ; Sun, 15 Dec 2019 15:49:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf2c.google.com with SMTP id dc14so37234qvb.9 for ; Sun, 15 Dec 2019 07:49:25 -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=I8/BIooMsvs4I+qITET5qLXKlnxCTRM/Rktp5zZv9no=; b=gFp/agakmc5l86JxSh14/l+uPAllxgaF2UcL/uVien3n0wO47arqFdVTX9NCLrgjoE j8qxvG3+/xSChct+XXFj7SbU1/sFu2UiGAMle3T0YK1ClbCViPjf7Wl8jZ/FvvPzuKNa hNTngXZDrkxf0LATWf9OHXQ/I5NISSWfetcB3ODs9kQ6IepatKswbLncHt8Lo717zl8Y c4f+G+JtZra+H5W6YvHMo0qcaJBXfBIHKs6h3G3CzB3rnZQd7JJMq/Qg/RXwItMrauBm RoRutY8LR029XInL5nV2AndJk3TZ+Bdx44X0RRWtZbmyOMaealP+s3gRMOcb7HZW7sKz y40g== 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=I8/BIooMsvs4I+qITET5qLXKlnxCTRM/Rktp5zZv9no=; b=E9nJVMFNqBwH17rVcGi5mNkuRPvB7ble0dKypKjyRbwp1yb3nJmYg9vZP3qc1F/PoD eeQqqD5Hz+hFDpnApLkmsradeeB+lsxf/YpiCFuxB9BX0vcVsl2hSkdgZa18rifWj142 mFqQ68BFzS29FsX1qqv0iITgsDcN61YB6gJHpa7PoZlL3R5q0HFXt9L6UPc/k3P08uDk ZkxC3qbjbO0b1i4IuKcXV14eQYvDVkWzDqW3izz1iIh8lfNX6oXzCOs6mHpWfayrf9hG egjo+0XlockEjLvRuSGsBbXJyCmuxTMZnNWxzL3rM/YUS6/IMfChQyNh3xowkVar63Ke z8LA== X-Gm-Message-State: APjAAAVoNuiLDMX/mDA7r3IdaKyPs+CpDZ9847vIwvrTxuATz8TX8RWt l9NiYWr4t0dzjhlBoNKCq+1d/Xs5jkJjmLYhls3zOQ== X-Google-Smtp-Source: APXvYqzK8PNOK5Z0jO8OOAtPBBgW8sY9/UBFQePNTIuzZfi0O+FdZPh3XtWKMEkw4X2E5rbp/09V8LcRvjPhQeGEQV4= X-Received: by 2002:ad4:4810:: with SMTP id g16mr1951313qvy.22.1576424958953; Sun, 15 Dec 2019 07:49:18 -0800 (PST) MIME-Version: 1.0 References: <201912142152.xBELqnYJ005845@repo.freebsd.org> <8a1c7bb9-1230-96b5-1aa8-20e82fcca7e9@delphij.net> In-Reply-To: <8a1c7bb9-1230-96b5-1aa8-20e82fcca7e9@delphij.net> From: Warner Losh Date: Sun, 15 Dec 2019 08:49:06 -0700 Message-ID: Subject: Re: svn commit: r355759 - in head: include sys/sys To: Xin LI Cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 47bTNj4ZdJz4dQP X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=gFp/agak; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::f2c) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-1.82 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.997,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[3]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-0.83)[ipnet: 2607:f8b0::/32(-2.20), asn: 15169(-1.91), 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 15:49:26 -0000 On Sun, Dec 15, 2019, 12:21 AM Xin Li wrote: > > > On 2019-12-14 13:52, Conrad Meyer wrote: > > Author: cem > > Date: Sat Dec 14 21:52:49 2019 > > New Revision: 355759 > > URL: https://svnweb.freebsd.org/changeset/base/355759 > > > > Log: > > cdefs: Add __deprecated(message) function attribute macro > > This conflicts with Linux kernel and breaks DRM. Please use a different > name. > Yes. We need a different name for this. We should revert this and the linux lkpi change. I had no clue there was a conflict when I reviewed... Warner > From owner-svn-src-head@freebsd.org Sun Dec 15 16:28:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 16E101C86C3; Sun, 15 Dec 2019 16:28:13 +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 47bVFS5MRWz4g6y; Sun, 15 Dec 2019 16:28:12 +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 99C9CFB7B; Sun, 15 Dec 2019 16:28:12 +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 xBFGSCfm060008; Sun, 15 Dec 2019 16:28:12 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBFGSCN2060007; Sun, 15 Dec 2019 16:28:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912151628.xBFGSCN2060007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 15 Dec 2019 16:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355775 - head/sys/dev/kbd X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/kbd X-SVN-Commit-Revision: 355775 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 16:28:13 -0000 Author: kevans Date: Sun Dec 15 16:28:12 2019 New Revision: 355775 URL: https://svnweb.freebsd.org/changeset/base/355775 Log: kbd: convert kbdd_* macros to inline functions This reduces the noise when interested parties wish to de-Giant kbd; these accesses to kbdsw will need to be properly locked. Modified: head/sys/dev/kbd/kbdreg.h Modified: head/sys/dev/kbd/kbdreg.h ============================================================================== --- head/sys/dev/kbd/kbdreg.h Sun Dec 15 14:28:38 2019 (r355774) +++ head/sys/dev/kbd/kbdreg.h Sun Dec 15 16:28:12 2019 (r355775) @@ -163,50 +163,6 @@ typedef struct keyboard_switch { kbd_diag_t *diag; } keyboard_switch_t; -/* - * Keyboard disciplines: call actual handlers via kbdsw[]. - */ -#define kbdd_probe(kbd, unit, arg, flags) \ - (*kbdsw[(kbd)->kb_index]->probe)((unit), (arg), (flags)) -#define kbdd_init(kbd, unit, kbdpp, arg, flags) \ - (*kbdsw[(kbd)->kb_index]->init)((unit), (kbdpp), (arg), (flags)) -#define kbdd_term(kbd) \ - (*kbdsw[(kbd)->kb_index]->term)((kbd)) -#define kbdd_intr(kbd, arg) \ - (*kbdsw[(kbd)->kb_index]->intr)((kbd), (arg)) -#define kbdd_test_if(kbd) \ - (*kbdsw[(kbd)->kb_index]->test_if)((kbd)) -#define kbdd_enable(kbd) \ - (*kbdsw[(kbd)->kb_index]->enable)((kbd)) -#define kbdd_disable(kbd) \ - (*kbdsw[(kbd)->kb_index]->disable)((kbd)) -#define kbdd_read(kbd, wait) \ - (*kbdsw[(kbd)->kb_index]->read)((kbd), (wait)) -#define kbdd_check(kbd) \ - (*kbdsw[(kbd)->kb_index]->check)((kbd)) -#define kbdd_read_char(kbd, wait) \ - (*kbdsw[(kbd)->kb_index]->read_char)((kbd), (wait)) -#define kbdd_check_char(kbd) \ - (*kbdsw[(kbd)->kb_index]->check_char)((kbd)) -#define kbdd_ioctl(kbd, cmd, arg) \ - (((kbd) == NULL) ? \ - ENODEV : \ - (*kbdsw[(kbd)->kb_index]->ioctl)((kbd), (cmd), (arg))) -#define kbdd_lock(kbd, lockf) \ - (*kbdsw[(kbd)->kb_index]->lock)((kbd), (lockf)) -#define kbdd_clear_state(kbd) \ - (*kbdsw[(kbd)->kb_index]->clear_state)((kbd)) -#define kbdd_get_state(kbd, buf, len) \ - (*kbdsw[(kbd)->kb_index]->get_state)((kbd), (buf), (len)) -#define kbdd_set_state(kbd, buf, len) \ - (*kbdsw[(kbd)->kb_index]->set_state)((kbd), (buf), (len)) -#define kbdd_get_fkeystr(kbd, fkey, len) \ - (*kbdsw[(kbd)->kb_index]->get_fkeystr)((kbd), (fkey), (len)) -#define kbdd_poll(kbd, on) \ - (*kbdsw[(kbd)->kb_index]->poll)((kbd), (on)) -#define kbdd_diag(kbd, level) \ - (*kbdsw[(kbd)->kb_index]->diag)((kbd), (leve)) - /* keyboard driver */ typedef struct keyboard_driver { SLIST_ENTRY(keyboard_driver) link; @@ -215,14 +171,151 @@ typedef struct keyboard_driver { int (*configure)(int); /* backdoor for the console driver */ } keyboard_driver_t; +extern keyboard_switch_t **kbdsw; + +/* + * Keyboard disciplines: call actual handlers via kbdsw[]. + */ +static __inline int +kbdd_probe(keyboard_t *kbd, int unit, void *arg, int flags) +{ + + return ((*kbdsw[kbd->kb_index]->probe)(unit, arg, flags)); +} + +static __inline int +kbdd_init(keyboard_t *kbd, int unit, keyboard_t **kbdpp, void *arg, int flags) +{ + + return ((*kbdsw[kbd->kb_index]->init)(unit, kbdpp, arg, flags)); +} + +static __inline int +kbdd_term(keyboard_t *kbd) +{ + + return ((*kbdsw[kbd->kb_index]->term)(kbd)); +} + +static __inline int +kbdd_intr(keyboard_t *kbd, void *arg) +{ + + return ((*kbdsw[kbd->kb_index]->intr)(kbd, arg)); +} + +static __inline int +kbdd_test_if(keyboard_t *kbd) +{ + + return ((*kbdsw[kbd->kb_index]->test_if)(kbd)); +} + +static __inline int +kbdd_enable(keyboard_t *kbd) +{ + + return ((*kbdsw[kbd->kb_index]->enable)(kbd)); +} + +static __inline int +kbdd_disable(keyboard_t *kbd) +{ + + return ((*kbdsw[kbd->kb_index]->disable)(kbd)); +} + +static __inline int +kbdd_read(keyboard_t *kbd, int wait) +{ + + return ((*kbdsw[kbd->kb_index]->read)(kbd, wait)); +} + +static __inline int +kbdd_check(keyboard_t *kbd) +{ + + return ((*kbdsw[kbd->kb_index]->check)(kbd)); +} + +static __inline u_int +kbdd_read_char(keyboard_t *kbd, int wait) +{ + + return ((*kbdsw[kbd->kb_index]->read_char)(kbd, wait)); +} + +static __inline int +kbdd_check_char(keyboard_t *kbd) +{ + + return ((*kbdsw[kbd->kb_index]->check_char)(kbd)); +} + +static __inline int +kbdd_ioctl(keyboard_t *kbd, u_long cmd, caddr_t data) +{ + + if (kbd == NULL) + return (ENODEV); + return ((*kbdsw[kbd->kb_index]->ioctl)(kbd, cmd, data)); +} + +static __inline int +kbdd_lock(keyboard_t *kbd, int lock) +{ + + return ((*kbdsw[kbd->kb_index]->lock)(kbd, lock)); +} + +static __inline void +kbdd_clear_state(keyboard_t *kbd) +{ + + (*kbdsw[kbd->kb_index]->clear_state)(kbd); +} + +static __inline int +kbdd_get_state(keyboard_t *kbd, void *buf, int len) +{ + + return ((*kbdsw[kbd->kb_index]->get_state)(kbd, buf, len)); +} + +static __inline int +kbdd_set_state(keyboard_t *kbd, void *buf, int len) +{ + + return ((*kbdsw[kbd->kb_index]->set_state)(kbd, buf, len)); +} + +static __inline u_char * +kbdd_get_fkeystr(keyboard_t *kbd, int fkey, size_t *len) +{ + + return ((*kbdsw[kbd->kb_index]->get_fkeystr)(kbd, fkey, len)); +} + +static __inline int +kbdd_poll(keyboard_t *kbd, int on) +{ + + return ((*kbdsw[kbd->kb_index]->poll)(kbd, on)); +} + +static __inline void +kbdd_diag(keyboard_t *kbd, int level) +{ + + (*kbdsw[kbd->kb_index]->diag)(kbd, level); +} + #define KEYBOARD_DRIVER(name, sw, config) \ static struct keyboard_driver name##_kbd_driver = { \ { NULL }, #name, &sw, config \ }; \ DATA_SET(kbddriver_set, name##_kbd_driver); - -/* global variables */ -extern keyboard_switch_t **kbdsw; /* functions for the keyboard driver */ int kbd_add_driver(keyboard_driver_t *driver); From owner-svn-src-head@freebsd.org Sun Dec 15 17:33:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7435B1C9F1D; Sun, 15 Dec 2019 17:33:27 +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 47bWhl2W0qz3FbC; Sun, 15 Dec 2019 17:33:27 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 515EC18805; Sun, 15 Dec 2019 17:33:27 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBFHXRkn001285; Sun, 15 Dec 2019 17:33:27 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBFHXQjR001282; Sun, 15 Dec 2019 17:33:26 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201912151733.xBFHXQjR001282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sun, 15 Dec 2019 17:33:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355776 - in head: include sys/compat/linuxkpi/common/include/linux sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: include sys/compat/linuxkpi/common/include/linux sys/sys X-SVN-Commit-Revision: 355776 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 17:33:27 -0000 Author: cem Date: Sun Dec 15 17:33:26 2019 New Revision: 355776 URL: https://svnweb.freebsd.org/changeset/base/355776 Log: Revert r355760, r355759 And remove the inline/deprecated attribute use entirely in stdlib.h, from r355747. The intent was to provide a buildable API transitionary period, but clearly that was counter-productive. Reported by: delphij, imp, others Modified: head/include/stdlib.h head/sys/compat/linuxkpi/common/include/linux/compiler.h head/sys/sys/cdefs.h Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Sun Dec 15 16:28:12 2019 (r355775) +++ head/include/stdlib.h Sun Dec 15 17:33:26 2019 (r355776) @@ -314,12 +314,6 @@ long long strtonum(const char *, long long, long long, const char **); /* Deprecated interfaces, to be removed. */ -static inline void -__deprecated("sranddev to be removed in FreeBSD 13") -sranddev(void) -{ -} - __int64_t strtoq(const char *, char **, int); __uint64_t Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/compiler.h Sun Dec 15 16:28:12 2019 (r355775) +++ head/sys/compat/linuxkpi/common/include/linux/compiler.h Sun Dec 15 17:33:26 2019 (r355776) @@ -50,6 +50,7 @@ #define __cond_lock(x,c) (c) #define __bitwise #define __devinitdata +#define __deprecated #define __init #define __initconst #define __devinit Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sun Dec 15 16:28:12 2019 (r355775) +++ head/sys/sys/cdefs.h Sun Dec 15 17:33:26 2019 (r355776) @@ -468,14 +468,6 @@ #define __hidden #endif -#if __GNUC_PREREQ__(4, 5) || defined(__clang__) -#define __deprecated(m) __attribute__((__deprecated__(m))) -#elif defined(__GNUC__) -#define __deprecated(m) __attribute__((__deprecated__)) -#else -#define __deprecated(m) -#endif - /* * We define this here since , , and * require it. From owner-svn-src-head@freebsd.org Sun Dec 15 18:05:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A15F01CA7D5; Sun, 15 Dec 2019 18:05:19 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47bXPW3mRFz3H6j; Sun, 15 Dec 2019 18:05:19 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77FEA18D67; Sun, 15 Dec 2019 18:05:19 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBFI5Jmn019076; Sun, 15 Dec 2019 18:05:19 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBFI5JpU019074; Sun, 15 Dec 2019 18:05:19 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201912151805.xBFI5JpU019074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 15 Dec 2019 18:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355777 - head/usr.bin/uniq X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/usr.bin/uniq X-SVN-Commit-Revision: 355777 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 18:05:19 -0000 Author: ian Date: Sun Dec 15 18:05:18 2019 New Revision: 355777 URL: https://svnweb.freebsd.org/changeset/base/355777 Log: Support --all-repeats in uniq(1) for compatibility with gnu coreutils. This adds a new -D/--all-repeats option to uniq(1), which outputs each copy of any repeated lines (as opposed to a single copy of a repeated line). You can specify a separator option to output a blank line before or after each group of repeated lines. This adds compatibility with the GNU coreutils version of uniq(1). This change also re-groups the -c, -d, -D, -u options in the usage display and man page to indicate that they are mutally exclusive of each other. This matches the posix/opengroup definition of uniq(1) command line args. Note that this change does NOT actually enforce the mutual exclusion in the code, for now, it simply documents that the arguments should be considered exclusive with each other. Differential Revision: https://reviews.freebsd.org/D22262 Modified: head/usr.bin/uniq/uniq.1 head/usr.bin/uniq/uniq.c Modified: head/usr.bin/uniq/uniq.1 ============================================================================== --- head/usr.bin/uniq/uniq.1 Sun Dec 15 17:33:26 2019 (r355776) +++ head/usr.bin/uniq/uniq.1 Sun Dec 15 18:05:18 2019 (r355777) @@ -31,7 +31,7 @@ .\" From: @(#)uniq.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd May 1, 2018 +.Dd December 15, 2019 .Dt UNIQ 1 .Os .Sh NAME @@ -39,8 +39,7 @@ .Nd report or filter out repeated lines in a file .Sh SYNOPSIS .Nm -.Op Fl c -.Op Fl d | Fl u +.Op Fl c | Fl d | Fl D | Fl u .Op Fl i .Op Fl f Ar num .Op Fl s Ar chars @@ -75,7 +74,24 @@ The following options are available: Precede each output line with the count of the number of times the line occurred in the input, followed by a single space. .It Fl d , Fl -repeated -Only output lines that are repeated in the input. +Output a single copy of each line that is repeated in the input. +.It Fl D , Fl -all-repeated Op Ar septype +Output all lines that are repeated (like +.Fl d , +but each copy of the repeated line is written). +The optional +.Ar septype +argument controls how to separate groups of repeated lines in the output; +it must be one of the following values: +.Pp +.Bl -tag -compact -width separate +.It none +Do not separate groups of lines (this is the default). +.It prepend +Output an empty line before each group of lines. +.It separate +Output an empty line after each group of lines. +.El .It Fl f Ar num , Fl -skip-fields Ar num Ignore the first .Ar num Modified: head/usr.bin/uniq/uniq.c ============================================================================== --- head/usr.bin/uniq/uniq.c Sun Dec 15 17:33:26 2019 (r355776) +++ head/usr.bin/uniq/uniq.c Sun Dec 15 18:05:18 2019 (r355777) @@ -65,11 +65,18 @@ static const char rcsid[] = #include #include -static int cflag, dflag, uflag, iflag; +static int Dflag, cflag, dflag, uflag, iflag; static int numchars, numfields, repeats; +/* Dflag values */ +#define DF_NONE 0 +#define DF_NOSEP 1 +#define DF_PRESEP 2 +#define DF_POSTSEP 3 + static const struct option long_opts[] = { + {"all-repeated",optional_argument, NULL, 'D'}, {"count", no_argument, NULL, 'c'}, {"repeated", no_argument, NULL, 'd'}, {"skip-fields", required_argument, NULL, 'f'}, @@ -101,9 +108,19 @@ main (int argc, char *argv[]) (void) setlocale(LC_ALL, ""); obsolete(argv); - while ((ch = getopt_long(argc, argv, "+cdif:s:u", long_opts, + while ((ch = getopt_long(argc, argv, "+D::cdif:s:u", long_opts, NULL)) != -1) switch (ch) { + case 'D': + if (optarg == NULL || strcasecmp(optarg, "none") == 0) + Dflag = DF_NOSEP; + else if (strcasecmp(optarg, "prepend") == 0) + Dflag = DF_PRESEP; + else if (strcasecmp(optarg, "separate") == 0) + Dflag = DF_POSTSEP; + else + usage(); + break; case 'c': cflag = 1; break; @@ -194,7 +211,10 @@ main (int argc, char *argv[]) if (comp) { /* If different, print; set previous to new value. */ - show(ofp, prevline); + if (Dflag == DF_POSTSEP && repeats > 0) + fputc('\n', ofp); + if (!Dflag) + show(ofp, prevline); p = prevline; b1 = prevbuflen; prevline = thisline; @@ -206,12 +226,22 @@ main (int argc, char *argv[]) thisbuflen = b1; tthis = NULL; repeats = 0; - } else + } else { + if (Dflag) { + if (repeats == 0) { + if (Dflag == DF_PRESEP) + fputc('\n', ofp); + show(ofp, prevline); + } + show(ofp, thisline); + } ++repeats; + } } if (ferror(ifp)) err(1, "%s", ifn); - show(ofp, prevline); + if (!Dflag) + show(ofp, prevline); exit(0); } @@ -276,7 +306,7 @@ static void show(FILE *ofp, const char *str) { - if ((dflag && repeats == 0) || (uflag && repeats > 0)) + if ((!Dflag && dflag && repeats == 0) || (uflag && repeats > 0)) return; if (cflag) (void)fprintf(ofp, "%4d %s", repeats + 1, str); @@ -343,6 +373,6 @@ static void usage(void) { (void)fprintf(stderr, -"usage: uniq [-c] [-d | -u] [-i] [-f fields] [-s chars] [input [output]]\n"); +"usage: uniq [-c | -d | -D | -u] [-i] [-f fields] [-s chars] [input [output]]\n"); exit(1); } From owner-svn-src-head@freebsd.org Sun Dec 15 18:51:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 369FB1CB860; Sun, 15 Dec 2019 18:51:31 +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 47bYQn6lpJz3KnN; Sun, 15 Dec 2019 18:51:29 +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 xBFIpLS6090430; Sun, 15 Dec 2019 10:51:21 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id xBFIpLaX090429; Sun, 15 Dec 2019 10:51:21 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201912151851.xBFIpLaX090429@gndrsh.dnsmgr.net> Subject: Re: svn commit: r355737 - head/share/man/man9 In-Reply-To: <201912132232.xBDMW5LL074330@repo.freebsd.org> To: Warner Losh Date: Sun, 15 Dec 2019 10:51:21 -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: 47bYQn6lpJz3KnN X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd@gndrsh.dnsmgr.net X-Spamd-Result: default: False [1.27 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; TO_DN_SOME(0.00)[]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.07)[0.068,0]; IP_SCORE(0.04)[ip: (0.14), ipnet: 69.59.192.0/19(0.07), asn: 13868(0.02), country: US(-0.05)]; NEURAL_SPAM_LONG(0.26)[0.262,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 18:51:31 -0000 > Author: imp > Date: Fri Dec 13 22:32:05 2019 > New Revision: 355737 > URL: https://svnweb.freebsd.org/changeset/base/355737 > > Log: > Better copyright advice > > Document the common practices around copyrights with "all rights reserved" in > them as new copyright notices get added. > > It's an open question qhether to point people at the fact that since the Berne > convention was ratified, All rights reserved is largely obsolete. > https://en.wikipedia.org/wiki/All_rights_reserved#Obsolescence has the > details. The committer's guide will be revised shortly, and it's likely that's a > better place for this discussion. If not, I'll add a blurb here. > > Reviewed by: jhb@, brooks@ > Differential Review: https://reviews.freebsd.org/D22800 I object to the a review that specifically invites people to it, is authored and committed in anything short of 24 hours and more reasonable to actually ALLOW people time to repond of 72 hours. Regards, Rod Better copyright advice AcceptedPublic Authored by imp on Fri, Dec 13, 12:33. > Modified: > head/share/man/man9/style.9 > > Modified: head/share/man/man9/style.9 > ============================================================================== > --- head/share/man/man9/style.9 Fri Dec 13 22:04:13 2019 (r355736) > +++ head/share/man/man9/style.9 Fri Dec 13 22:32:05 2019 (r355737) > @@ -1,6 +1,5 @@ > .\"- > -.\" Copyright (c) 1995-2005 The FreeBSD Project > -.\" All rights reserved. > +.\" Copyright (c) 1995-2019 The FreeBSD Project > .\" > .\" Redistribution and use in source and binary forms, with or without > .\" modification, are permitted provided that the following conditions > @@ -26,7 +25,7 @@ > .\" From: @(#)style 1.14 (Berkeley) 4/28/95 > .\" $FreeBSD$ > .\" > -.Dd June 3, 2019 > +.Dd December 13, 2019 > .Dt STYLE 9 > .Os > .Sh NAME > @@ -84,8 +83,32 @@ comments. > Comments starting in columns other than the first are never > considered license statements. > Use the appropriate SPDX-License-Identifier line before the copyright. > +If the copyright assertion contains the phrase > +.Dq Li "All Rights Reserved" > +that should be on the same line as the word > +.Dq Li "Copyright" . > +You should not insert a new copyright line between an old > +copyright line and this phrase. > +Instead, you should insert a new copyright phrase after > +a pre-existing > +.Dq Li "All Rights Reserved" > +line. > +When making changes, it is acceptable to fold an > +.Dq Li "All Rights Reserved" > +line with each of the > +.Dq Li "Copyright" > +lines. > +For files that have the > +.Dq Li "All Rights Reserved" > +line on the same line(s) as the word > +.Dq Li "Copyright" , > +new copyright assertions should be added last. > +New > +.Dq Li "Copyright" > +lines should only be added when making substantial changes to the file, > +not for trivial changes. > .Pp > -After any copyright header, there is a blank line, and the > +After any copyright and license comment, there is a blank line, and the > .Li $\&FreeBSD$ > for non C/C++ language source files. > Version control system ID tags should only exist once in a file > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Dec 15 19:44:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 28A391CCD20; Sun, 15 Dec 2019 19:44:50 +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 47bZcK0WWzz3N3v; Sun, 15 Dec 2019 19:44:48 +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 xBFJijxl090592; Sun, 15 Dec 2019 11:44:45 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id xBFJijrq090591; Sun, 15 Dec 2019 11:44:45 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201912151944.xBFJijrq090591@gndrsh.dnsmgr.net> Subject: Re: svn commit: r355692 - head/sbin/fsirand In-Reply-To: <201912130412.xBD4CDZm017850@repo.freebsd.org> To: Conrad Meyer Date: Sun, 15 Dec 2019 11:44:45 -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: 47bZcK0WWzz3N3v X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd@gndrsh.dnsmgr.net X-Spamd-Result: default: False [1.14 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; NEURAL_SPAM_MEDIUM(0.15)[0.148,0]; IP_SCORE(0.04)[ip: (0.14), ipnet: 69.59.192.0/19(0.07), asn: 13868(0.02), country: US(-0.05)]; NEURAL_SPAM_LONG(0.05)[0.054,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 19:44:50 -0000 > Author: cem > Date: Fri Dec 13 04:12:13 2019 > New Revision: 355692 > URL: https://svnweb.freebsd.org/changeset/base/355692 > > Log: > fsirand(8): Just use arc4random(3) > > Remove single use of dubious srandomdev(3) + random(3) and replace with > arc4random(3), as is used already in this program. > > Follow-up question: Do we really need this program anymore? In base? The proper place to ask that is on -arch, not a commit message. > Modified: > head/sbin/fsirand/fsirand.c > > Modified: head/sbin/fsirand/fsirand.c > ============================================================================== > --- head/sbin/fsirand/fsirand.c Fri Dec 13 04:03:05 2019 (r355691) > +++ head/sbin/fsirand/fsirand.c Fri Dec 13 04:12:13 2019 (r355692) > @@ -83,8 +83,6 @@ main(int argc, char *argv[]) > if (argc - optind < 1) > usage(); > > - srandomdev(); > - > /* Increase our data size to the max */ > if (getrlimit(RLIMIT_DATA, &rl) == 0) { > rl.rlim_cur = rl.rlim_max; > @@ -167,7 +165,7 @@ fsirand(char *device) > if (!printonly) { > /* Randomize fs_id and write out new sblock and backups */ > sblock->fs_id[0] = (u_int32_t)time(NULL); > - sblock->fs_id[1] = random(); > + sblock->fs_id[1] = arc4random(); > if (sbput(devfd, sblock, sblock->fs_ncg) != 0) { > warn("could not write updated superblock"); > return (1); > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Dec 15 21:08:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1EF81CF30C; Sun, 15 Dec 2019 21:08:40 +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 47bcT45HWcz3xXh; Sun, 15 Dec 2019 21:08:40 +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 B08C81AECC; Sun, 15 Dec 2019 21:08:40 +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 xBFL8eFn025656; Sun, 15 Dec 2019 21:08:40 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBFL8e7p025655; Sun, 15 Dec 2019 21:08:40 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201912152108.xBFL8e7p025655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 15 Dec 2019 21:08:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355778 - head/sys/powerpc/mpc85xx X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/mpc85xx X-SVN-Commit-Revision: 355778 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 21:08:40 -0000 Author: jhibbits Date: Sun Dec 15 21:08:40 2019 New Revision: 355778 URL: https://svnweb.freebsd.org/changeset/base/355778 Log: powerpc/mpc85xx: Clean up Freescale SATA driver a little * Remove unused ATA_IN/OUT macros, they just clutter up the file. * Fix some RID management bits for the channel memory resource. Modified: head/sys/powerpc/mpc85xx/fsl_sata.c Modified: head/sys/powerpc/mpc85xx/fsl_sata.c ============================================================================== --- head/sys/powerpc/mpc85xx/fsl_sata.c Sun Dec 15 18:05:18 2019 (r355777) +++ head/sys/powerpc/mpc85xx/fsl_sata.c Sun Dec 15 21:08:40 2019 (r355778) @@ -253,7 +253,7 @@ struct fsl_sata_device { /* structure describing an ATA channel */ struct fsl_sata_channel { device_t dev; /* Device handle */ - int unit; /* Physical channel */ + int r_mid; /* Physical channel RID */ struct resource *r_mem; /* Memory of this channel */ struct resource *r_irq; /* Interrupt of this channel */ void *ih; /* Interrupt handle */ @@ -307,34 +307,10 @@ enum fsl_sata_err_type { }; /* macros to hide busspace uglyness */ -#define ATA_INB(res, offset) \ - bus_read_1((res), (offset)) -#define ATA_INW(res, offset) \ - bus_read_2((res), (offset)) #define ATA_INL(res, offset) \ bus_read_4((res), (offset)) -#define ATA_INSW(res, offset, addr, count) \ - bus_read_multi_2((res), (offset), (addr), (count)) -#define ATA_INSW_STRM(res, offset, addr, count) \ - bus_read_multi_stream_2((res), (offset), (addr), (count)) -#define ATA_INSL(res, offset, addr, count) \ - bus_read_multi_4((res), (offset), (addr), (count)) -#define ATA_INSL_STRM(res, offset, addr, count) \ - bus_read_multi_stream_4((res), (offset), (addr), (count)) -#define ATA_OUTB(res, offset, value) \ - bus_write_1((res), (offset), (value)) -#define ATA_OUTW(res, offset, value) \ - bus_write_2((res), (offset), (value)) #define ATA_OUTL(res, offset, value) \ bus_write_4((res), (offset), (value)) -#define ATA_OUTSW(res, offset, addr, count) \ - bus_write_multi_2((res), (offset), (addr), (count)) -#define ATA_OUTSW_STRM(res, offset, addr, count) \ - bus_write_multi_stream_2((res), (offset), (addr), (count)) -#define ATA_OUTSL(res, offset, addr, count) \ - bus_write_multi_4((res), (offset), (addr), (count)) -#define ATA_OUTSL_STRM(res, offset, addr, count) \ - bus_write_multi_stream_4((res), (offset), (addr), (count)) static int fsl_sata_probe(device_t dev) @@ -356,7 +332,6 @@ fsl_sata_attach(device_t dev) int rid, error, i, sata_rev = 0; ch->dev = dev; - ch->unit = (intptr_t)device_get_ivars(dev); mtx_init(&ch->mtx, "FSL SATA channel lock", NULL, MTX_DEF); ch->pm_level = 0; resource_int_value(device_get_name(dev), @@ -379,9 +354,9 @@ fsl_sata_attach(device_t dev) } ch->user[i].caps |= CTS_SATA_CAPS_H_AN; } - rid = 0; + ch->r_mid = 0; if (!(ch->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &rid, RF_ACTIVE))) + &ch->r_mid, RF_ACTIVE))) return (ENXIO); rman_set_bustag(ch->r_mem, &bs_le_tag); fsl_sata_dmainit(dev); @@ -445,7 +420,7 @@ err1: mtx_unlock(&ch->mtx); bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq); err0: - bus_release_resource(dev, SYS_RES_MEMORY, ch->unit, ch->r_mem); + bus_release_resource(dev, SYS_RES_MEMORY, ch->r_mid, ch->r_mem); mtx_destroy(&ch->mtx); return (error); } @@ -472,7 +447,7 @@ fsl_sata_detach(device_t dev) fsl_sata_slotsfree(dev); fsl_sata_dmafini(dev); - bus_release_resource(dev, SYS_RES_MEMORY, ch->unit, ch->r_mem); + bus_release_resource(dev, SYS_RES_MEMORY, ch->r_mid, ch->r_mem); mtx_destroy(&ch->mtx); return (0); } From owner-svn-src-head@freebsd.org Sun Dec 15 21:11:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F9871CF69B; Sun, 15 Dec 2019 21:11:20 +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 47bcX80GQJz3xyJ; Sun, 15 Dec 2019 21:11:20 +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 03F5C1B028; Sun, 15 Dec 2019 21:11:20 +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 xBFLBJCc029572; Sun, 15 Dec 2019 21:11:19 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBFLBG95029553; Sun, 15 Dec 2019 21:11:16 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201912152111.xBFLBG95029553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 15 Dec 2019 21:11:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355779 - in head/sys: cddl/compat/opensolaris/sys compat/linux compat/linuxkpi/common/src dev/ocs_fc kern mips/nlm sys vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: cddl/compat/opensolaris/sys compat/linux compat/linuxkpi/common/src dev/ocs_fc kern mips/nlm sys vm X-SVN-Commit-Revision: 355779 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 21:11:20 -0000 Author: jeff Date: Sun Dec 15 21:11:15 2019 New Revision: 355779 URL: https://svnweb.freebsd.org/changeset/base/355779 Log: schedlock 1/4 Eliminate recursion from most thread_lock consumers. Return from sched_add() without the thread_lock held. This eliminates unnecessary atomics and lock word loads as well as reducing the hold time for scheduler locks. This will eventually allow for lockless remote adds. Discussed with: kib Reviewed by: jhb Tested by: pho Differential Revision: https://reviews.freebsd.org/D22626 Modified: head/sys/cddl/compat/opensolaris/sys/proc.h head/sys/compat/linux/linux_fork.c head/sys/compat/linuxkpi/common/src/linux_kthread.c head/sys/dev/ocs_fc/ocs_os.c head/sys/kern/init_main.c head/sys/kern/kern_clock.c head/sys/kern/kern_fork.c head/sys/kern/kern_intr.c head/sys/kern/kern_kthread.c head/sys/kern/kern_mutex.c head/sys/kern/kern_resource.c head/sys/kern/kern_sig.c head/sys/kern/kern_synch.c head/sys/kern/kern_thr.c head/sys/kern/kern_thread.c head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c head/sys/kern/subr_gtaskqueue.c head/sys/kern/subr_pcpu.c head/sys/kern/subr_sleepqueue.c head/sys/kern/subr_taskqueue.c head/sys/kern/subr_turnstile.c head/sys/mips/nlm/cms.c head/sys/sys/proc.h head/sys/sys/resourcevar.h head/sys/sys/sched.h head/sys/vm/vm_swapout.c Modified: head/sys/cddl/compat/opensolaris/sys/proc.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/proc.h Sun Dec 15 21:08:40 2019 (r355778) +++ head/sys/cddl/compat/opensolaris/sys/proc.h Sun Dec 15 21:11:15 2019 (r355779) @@ -89,7 +89,6 @@ do_thread_create(caddr_t stk, size_t stksize, void (*p thread_lock(td); sched_prio(td, pri); sched_add(td, SRQ_BORING); - thread_unlock(td); } return (td); } Modified: head/sys/compat/linux/linux_fork.c ============================================================================== --- head/sys/compat/linux/linux_fork.c Sun Dec 15 21:08:40 2019 (r355778) +++ head/sys/compat/linux/linux_fork.c Sun Dec 15 21:11:15 2019 (r355779) @@ -92,7 +92,6 @@ linux_fork(struct thread *td, struct linux_fork_args * thread_lock(td2); TD_SET_CAN_RUN(td2); sched_add(td2, SRQ_BORING); - thread_unlock(td2); return (0); } @@ -123,7 +122,6 @@ linux_vfork(struct thread *td, struct linux_vfork_args thread_lock(td2); TD_SET_CAN_RUN(td2); sched_add(td2, SRQ_BORING); - thread_unlock(td2); return (0); } @@ -228,7 +226,6 @@ linux_clone_proc(struct thread *td, struct linux_clone thread_lock(td2); TD_SET_CAN_RUN(td2); sched_add(td2, SRQ_BORING); - thread_unlock(td2); td->td_retval[0] = p2->p_pid; @@ -343,7 +340,6 @@ linux_clone_thread(struct thread *td, struct linux_clo thread_lock(newtd); TD_SET_CAN_RUN(newtd); sched_add(newtd, SRQ_BORING); - thread_unlock(newtd); td->td_retval[0] = newtd->td_tid; Modified: head/sys/compat/linuxkpi/common/src/linux_kthread.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_kthread.c Sun Dec 15 21:08:40 2019 (r355778) +++ head/sys/compat/linuxkpi/common/src/linux_kthread.c Sun Dec 15 21:11:15 2019 (r355779) @@ -142,7 +142,6 @@ linux_kthread_setup_and_run(struct thread *td, linux_t sched_prio(td, PI_SWI(SWI_NET)); /* put thread into run-queue */ sched_add(td, SRQ_BORING); - thread_unlock(td); return (task); } Modified: head/sys/dev/ocs_fc/ocs_os.c ============================================================================== --- head/sys/dev/ocs_fc/ocs_os.c Sun Dec 15 21:08:40 2019 (r355778) +++ head/sys/dev/ocs_fc/ocs_os.c Sun Dec 15 21:11:15 2019 (r355779) @@ -659,6 +659,8 @@ ocs_thread_create(ocs_os_handle_t os, ocs_thread_t *th int32_t ocs_thread_start(ocs_thread_t *thread) { + + thread_lock(thread->tcb); sched_add(thread->tcb, SRQ_BORING); return 0; } Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Sun Dec 15 21:08:40 2019 (r355778) +++ head/sys/kern/init_main.c Sun Dec 15 21:11:15 2019 (r355779) @@ -853,6 +853,5 @@ kick_init(const void *udata __unused) thread_lock(td); TD_SET_CAN_RUN(td); sched_add(td, SRQ_BORING); - thread_unlock(td); } SYSINIT(kickinit, SI_SUB_KTHREAD_INIT, SI_ORDER_MIDDLE, kick_init, NULL); Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Sun Dec 15 21:08:40 2019 (r355778) +++ head/sys/kern/kern_clock.c Sun Dec 15 21:11:15 2019 (r355779) @@ -282,8 +282,7 @@ deadlkres(void) if (TD_ON_LOCK(td)) deadlres_td_on_lock(p, td, blkticks); - else if (TD_IS_SLEEPING(td) && - TD_ON_SLEEPQ(td)) + else if (TD_IS_SLEEPING(td)) deadlres_td_sleep_q(p, td, slpticks); thread_unlock(td); Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Sun Dec 15 21:08:40 2019 (r355778) +++ head/sys/kern/kern_fork.c Sun Dec 15 21:11:15 2019 (r355779) @@ -758,7 +758,6 @@ do_fork(struct thread *td, struct fork_req *fr, struct thread_lock(td2); TD_SET_CAN_RUN(td2); sched_add(td2, SRQ_BORING); - thread_unlock(td2); } else { *fr->fr_procp = p2; } Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Sun Dec 15 21:08:40 2019 (r355778) +++ head/sys/kern/kern_intr.c Sun Dec 15 21:11:15 2019 (r355779) @@ -558,8 +558,8 @@ ithread_destroy(struct intr_thread *ithread) if (TD_AWAITING_INTR(td)) { TD_CLR_IWAIT(td); sched_add(td, SRQ_INTR); - } - thread_unlock(td); + } else + thread_unlock(td); } int @@ -985,8 +985,8 @@ intr_event_schedule_thread(struct intr_event *ie) } else { CTR5(KTR_INTR, "%s: pid %d (%s): it_need %d, state %d", __func__, td->td_proc->p_pid, td->td_name, it->it_need, td->td_state); + thread_unlock(td); } - thread_unlock(td); return (0); } Modified: head/sys/kern/kern_kthread.c ============================================================================== --- head/sys/kern/kern_kthread.c Sun Dec 15 21:08:40 2019 (r355778) +++ head/sys/kern/kern_kthread.c Sun Dec 15 21:11:15 2019 (r355779) @@ -146,7 +146,8 @@ kproc_create(void (*func)(void *), void *arg, /* Delay putting it on the run queue until now. */ if (!(flags & RFSTOPPED)) sched_add(td, SRQ_BORING); - thread_unlock(td); + else + thread_unlock(td); return 0; } @@ -324,7 +325,6 @@ kthread_add(void (*func)(void *), void *arg, struct pr if (!(flags & RFSTOPPED)) { thread_lock(newtd); sched_add(newtd, SRQ_BORING); - thread_unlock(newtd); } if (newtdp) *newtdp = newtd; Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Sun Dec 15 21:08:40 2019 (r355778) +++ head/sys/kern/kern_mutex.c Sun Dec 15 21:11:15 2019 (r355779) @@ -960,10 +960,9 @@ thread_lock_block(struct thread *td) { struct mtx *lock; - THREAD_LOCK_ASSERT(td, MA_OWNED); lock = td->td_lock; + mtx_assert(lock, MA_OWNED); td->td_lock = &blocked_lock; - mtx_unlock_spin(lock); return (lock); } @@ -971,19 +970,33 @@ thread_lock_block(struct thread *td) void thread_lock_unblock(struct thread *td, struct mtx *new) { + mtx_assert(new, MA_OWNED); - MPASS(td->td_lock == &blocked_lock); + KASSERT(td->td_lock == &blocked_lock, + ("thread %p lock %p not blocked_lock %p", + td, td->td_lock, &blocked_lock)); atomic_store_rel_ptr((volatile void *)&td->td_lock, (uintptr_t)new); } void +thread_lock_block_wait(struct thread *td) +{ + + while (td->td_lock == &blocked_lock) + cpu_spinwait(); + + /* Acquire fence to be certain that all thread state is visible. */ + atomic_thread_fence_acq(); +} + +void thread_lock_set(struct thread *td, struct mtx *new) { struct mtx *lock; mtx_assert(new, MA_OWNED); - THREAD_LOCK_ASSERT(td, MA_OWNED); lock = td->td_lock; + mtx_assert(lock, MA_OWNED); td->td_lock = new; mtx_unlock_spin(lock); } Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Sun Dec 15 21:08:40 2019 (r355778) +++ head/sys/kern/kern_resource.c Sun Dec 15 21:11:15 2019 (r355779) @@ -78,7 +78,7 @@ static void calcru1(struct proc *p, struct rusage_ext struct timeval *up, struct timeval *sp); static int donice(struct thread *td, struct proc *chgp, int n); static struct uidinfo *uilookup(uid_t uid); -static void ruxagg_locked(struct rusage_ext *rux, struct thread *td); +static void ruxagg_ext_locked(struct rusage_ext *rux, struct thread *td); /* * Resource controls and accounting. @@ -858,7 +858,7 @@ rufetchtd(struct thread *td, struct rusage *ru) td->td_incruntime += runtime; PCPU_SET(switchtime, u); } - ruxagg(p, td); + ruxagg_locked(p, td); *ru = td->td_ru; calcru1(p, &td->td_rux, &ru->ru_utime, &ru->ru_stime); } @@ -1114,11 +1114,9 @@ ruadd(struct rusage *ru, struct rusage_ext *rux, struc * Aggregate tick counts into the proc's rusage_ext. */ static void -ruxagg_locked(struct rusage_ext *rux, struct thread *td) +ruxagg_ext_locked(struct rusage_ext *rux, struct thread *td) { - THREAD_LOCK_ASSERT(td, MA_OWNED); - PROC_STATLOCK_ASSERT(td->td_proc, MA_OWNED); rux->rux_runtime += td->td_incruntime; rux->rux_uticks += td->td_uticks; rux->rux_sticks += td->td_sticks; @@ -1126,16 +1124,25 @@ ruxagg_locked(struct rusage_ext *rux, struct thread *t } void -ruxagg(struct proc *p, struct thread *td) +ruxagg_locked(struct proc *p, struct thread *td) { + THREAD_LOCK_ASSERT(td, MA_OWNED); + PROC_STATLOCK_ASSERT(td->td_proc, MA_OWNED); - thread_lock(td); - ruxagg_locked(&p->p_rux, td); - ruxagg_locked(&td->td_rux, td); + ruxagg_ext_locked(&p->p_rux, td); + ruxagg_ext_locked(&td->td_rux, td); td->td_incruntime = 0; td->td_uticks = 0; td->td_iticks = 0; td->td_sticks = 0; +} + +void +ruxagg(struct proc *p, struct thread *td) +{ + + thread_lock(td); + ruxagg_locked(p, td); thread_unlock(td); } Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Sun Dec 15 21:08:40 2019 (r355778) +++ head/sys/kern/kern_sig.c Sun Dec 15 21:11:15 2019 (r355779) @@ -2250,6 +2250,8 @@ tdsendsignal(struct proc *p, struct thread *td, int si p->p_step = 0; wakeup(&p->p_step); } + wakeup_swapper = 0; + /* * Some signals have a process-wide effect and a per-thread * component. Most processing occurs when the process next @@ -2352,15 +2354,13 @@ tdsendsignal(struct proc *p, struct thread *td, int si * the PROCESS runnable, leave it stopped. * It may run a bit until it hits a thread_suspend_check(). */ - wakeup_swapper = 0; PROC_SLOCK(p); thread_lock(td); - if (TD_ON_SLEEPQ(td) && (td->td_flags & TDF_SINTR)) + if (TD_CAN_ABORT(td)) wakeup_swapper = sleepq_abort(td, intrval); - thread_unlock(td); + else + thread_unlock(td); PROC_SUNLOCK(p); - if (wakeup_swapper) - kick_proc0(); goto out; /* * Mutexes are short lived. Threads waiting on them will @@ -2394,8 +2394,6 @@ tdsendsignal(struct proc *p, struct thread *td, int si sigqueue_delete_proc(p, p->p_xsig); } else PROC_SUNLOCK(p); - if (wakeup_swapper) - kick_proc0(); goto out; } } else { @@ -2416,6 +2414,9 @@ runfast: out: /* If we jump here, proc slock should not be owned. */ PROC_SLOCK_ASSERT(p, MA_NOTOWNED); + if (wakeup_swapper) + kick_proc0(); + return (ret); } @@ -2428,10 +2429,8 @@ static void tdsigwakeup(struct thread *td, int sig, sig_t action, int intrval) { struct proc *p = td->td_proc; - int prop; - int wakeup_swapper; + int prop, wakeup_swapper; - wakeup_swapper = 0; PROC_LOCK_ASSERT(p, MA_OWNED); prop = sigprop(sig); @@ -2487,22 +2486,25 @@ tdsigwakeup(struct thread *td, int sig, sig_t action, sched_prio(td, PUSER); wakeup_swapper = sleepq_abort(td, intrval); - } else { - /* - * Other states do nothing with the signal immediately, - * other than kicking ourselves if we are running. - * It will either never be noticed, or noticed very soon. - */ + PROC_SUNLOCK(p); + if (wakeup_swapper) + kick_proc0(); + return; + } + + /* + * Other states do nothing with the signal immediately, + * other than kicking ourselves if we are running. + * It will either never be noticed, or noticed very soon. + */ #ifdef SMP - if (TD_IS_RUNNING(td) && td != curthread) - forward_signal(td); + if (TD_IS_RUNNING(td) && td != curthread) + forward_signal(td); #endif - } + out: PROC_SUNLOCK(p); thread_unlock(td); - if (wakeup_swapper) - kick_proc0(); } static int @@ -2530,12 +2532,13 @@ sig_suspend_threads(struct thread *td, struct proc *p, */ KASSERT(!TD_IS_SUSPENDED(td2), ("thread with deferred stops suspended")); - if (TD_SBDRY_INTR(td2)) + if (TD_SBDRY_INTR(td2)) { wakeup_swapper |= sleepq_abort(td2, TD_SBDRY_ERRNO(td2)); - } else if (!TD_IS_SUSPENDED(td2)) { + continue; + } + } else if (!TD_IS_SUSPENDED(td2)) thread_suspend_one(td2); - } } else if (!TD_IS_SUSPENDED(td2)) { if (sending || td != td2) td2->td_flags |= TDF_ASTPENDING; Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Sun Dec 15 21:08:40 2019 (r355778) +++ head/sys/kern/kern_synch.c Sun Dec 15 21:11:15 2019 (r355779) @@ -538,40 +538,48 @@ mi_switch(int flags, struct thread *newtd) * Change thread state to be runnable, placing it on the run queue if * it is in memory. If it is swapped out, return true so our caller * will know to awaken the swapper. + * + * Requires the thread lock on entry, drops on exit. */ int -setrunnable(struct thread *td) +setrunnable(struct thread *td, int srqflags) { + int swapin; THREAD_LOCK_ASSERT(td, MA_OWNED); KASSERT(td->td_proc->p_state != PRS_ZOMBIE, ("setrunnable: pid %d is a zombie", td->td_proc->p_pid)); + + swapin = 0; switch (td->td_state) { case TDS_RUNNING: case TDS_RUNQ: + break; + case TDS_CAN_RUN: + KASSERT((td->td_flags & TDF_INMEM) != 0, + ("setrunnable: td %p not in mem, flags 0x%X inhibit 0x%X", + td, td->td_flags, td->td_inhibitors)); + /* unlocks thread lock according to flags */ + sched_wakeup(td, srqflags); return (0); case TDS_INHIBITED: /* * If we are only inhibited because we are swapped out - * then arange to swap in this process. Otherwise just return. + * arrange to swap in this process. */ - if (td->td_inhibitors != TDI_SWAPPED) - return (0); - /* FALLTHROUGH */ - case TDS_CAN_RUN: + if (td->td_inhibitors == TDI_SWAPPED && + (td->td_flags & TDF_SWAPINREQ) == 0) { + td->td_flags |= TDF_SWAPINREQ; + swapin = 1; + } break; default: - printf("state is 0x%x", td->td_state); - panic("setrunnable(2)"); + panic("setrunnable: state 0x%x", td->td_state); } - if ((td->td_flags & TDF_INMEM) == 0) { - if ((td->td_flags & TDF_SWAPINREQ) == 0) { - td->td_flags |= TDF_SWAPINREQ; - return (1); - } - } else - sched_wakeup(td); - return (0); + if ((srqflags & (SRQ_HOLD | SRQ_HOLDTD)) == 0) + thread_unlock(td); + + return (swapin); } /* Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Sun Dec 15 21:08:40 2019 (r355778) +++ head/sys/kern/kern_thr.c Sun Dec 15 21:11:15 2019 (r355779) @@ -281,7 +281,6 @@ thread_create(struct thread *td, struct rtprio *rtp, } TD_SET_CAN_RUN(newtd); sched_add(newtd, SRQ_BORING); - thread_unlock(newtd); return (0); Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Sun Dec 15 21:08:40 2019 (r355778) +++ head/sys/kern/kern_thread.c Sun Dec 15 21:11:15 2019 (r355779) @@ -565,7 +565,6 @@ thread_exit(void) thread_lock(p->p_singlethread); wakeup_swapper = thread_unsuspend_one( p->p_singlethread, p, false); - thread_unlock(p->p_singlethread); if (wakeup_swapper) kick_proc0(); } @@ -606,7 +605,7 @@ thread_exit(void) /* Save our resource usage in our process. */ td->td_ru.ru_nvcsw++; - ruxagg(p, td); + ruxagg_locked(p, td); rucollect(&p->p_ru, &td->td_ru); PROC_STATUNLOCK(p); @@ -730,19 +729,36 @@ weed_inhib(int mode, struct thread *td2, struct proc * THREAD_LOCK_ASSERT(td2, MA_OWNED); wakeup_swapper = 0; + + /* + * Since the thread lock is dropped by the scheduler we have + * to retry to check for races. + */ +restart: switch (mode) { case SINGLE_EXIT: - if (TD_IS_SUSPENDED(td2)) + if (TD_IS_SUSPENDED(td2)) { wakeup_swapper |= thread_unsuspend_one(td2, p, true); - if (TD_ON_SLEEPQ(td2) && (td2->td_flags & TDF_SINTR) != 0) + thread_lock(td2); + goto restart; + } + if (TD_CAN_ABORT(td2)) { wakeup_swapper |= sleepq_abort(td2, EINTR); + return (wakeup_swapper); + } break; case SINGLE_BOUNDARY: case SINGLE_NO_EXIT: - if (TD_IS_SUSPENDED(td2) && (td2->td_flags & TDF_BOUNDARY) == 0) + if (TD_IS_SUSPENDED(td2) && + (td2->td_flags & TDF_BOUNDARY) == 0) { wakeup_swapper |= thread_unsuspend_one(td2, p, false); - if (TD_ON_SLEEPQ(td2) && (td2->td_flags & TDF_SINTR) != 0) + thread_lock(td2); + goto restart; + } + if (TD_CAN_ABORT(td2)) { wakeup_swapper |= sleepq_abort(td2, ERESTART); + return (wakeup_swapper); + } break; case SINGLE_ALLPROC: /* @@ -754,18 +770,25 @@ weed_inhib(int mode, struct thread *td2, struct proc * * is used to avoid immediate un-suspend. */ if (TD_IS_SUSPENDED(td2) && (td2->td_flags & (TDF_BOUNDARY | - TDF_ALLPROCSUSP)) == 0) + TDF_ALLPROCSUSP)) == 0) { wakeup_swapper |= thread_unsuspend_one(td2, p, false); - if (TD_ON_SLEEPQ(td2) && (td2->td_flags & TDF_SINTR) != 0) { + thread_lock(td2); + goto restart; + } + if (TD_CAN_ABORT(td2)) { if ((td2->td_flags & TDF_SBDRY) == 0) { thread_suspend_one(td2); td2->td_flags |= TDF_ALLPROCSUSP; } else { wakeup_swapper |= sleepq_abort(td2, ERESTART); + return (wakeup_swapper); } } break; + default: + break; } + thread_unlock(td2); return (wakeup_swapper); } @@ -842,9 +865,10 @@ thread_single(struct proc *p, int mode) #ifdef SMP } else if (TD_IS_RUNNING(td2) && td != td2) { forward_signal(td2); + thread_unlock(td2); #endif - } - thread_unlock(td2); + } else + thread_unlock(td2); } if (wakeup_swapper) kick_proc0(); @@ -1028,7 +1052,6 @@ thread_suspend_check(int return_instead) thread_lock(p->p_singlethread); wakeup_swapper = thread_unsuspend_one( p->p_singlethread, p, false); - thread_unlock(p->p_singlethread); if (wakeup_swapper) kick_proc0(); } @@ -1112,7 +1135,7 @@ thread_unsuspend_one(struct thread *td, struct proc *p p->p_boundary_count--; } } - return (setrunnable(td)); + return (setrunnable(td, 0)); } /* @@ -1133,8 +1156,8 @@ thread_unsuspend(struct proc *p) if (TD_IS_SUSPENDED(td)) { wakeup_swapper |= thread_unsuspend_one(td, p, true); - } - thread_unlock(td); + } else + thread_unlock(td); } } else if (P_SHOULDSTOP(p) == P_STOPPED_SINGLE && p->p_numthreads == p->p_suspcount) { @@ -1147,7 +1170,6 @@ thread_unsuspend(struct proc *p) thread_lock(p->p_singlethread); wakeup_swapper = thread_unsuspend_one( p->p_singlethread, p, false); - thread_unlock(p->p_singlethread); } } if (wakeup_swapper) @@ -1193,8 +1215,8 @@ thread_single_end(struct proc *p, int mode) if (TD_IS_SUSPENDED(td)) { wakeup_swapper |= thread_unsuspend_one(td, p, mode == SINGLE_BOUNDARY); - } - thread_unlock(td); + } else + thread_unlock(td); } } KASSERT(mode != SINGLE_BOUNDARY || p->p_boundary_count == 0, Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Sun Dec 15 21:08:40 2019 (r355778) +++ head/sys/kern/sched_4bsd.c Sun Dec 15 21:11:15 2019 (r355779) @@ -846,7 +846,7 @@ sched_priority(struct thread *td, u_char prio) td->td_priority = prio; if (TD_ON_RUNQ(td) && td->td_rqindex != (prio / RQ_PPQ)) { sched_rem(td); - sched_add(td, SRQ_BORING); + sched_add(td, SRQ_BORING | SRQ_HOLDTD); } } @@ -980,25 +980,12 @@ sched_switch(struct thread *td, struct thread *newtd, struct proc *p; int preempted; - tmtx = NULL; + tmtx = &sched_lock; ts = td_get_sched(td); p = td->td_proc; THREAD_LOCK_ASSERT(td, MA_OWNED); - /* - * Switch to the sched lock to fix things up and pick - * a new thread. - * Block the td_lock in order to avoid breaking the critical path. - */ - if (td->td_lock != &sched_lock) { - mtx_lock_spin(&sched_lock); - tmtx = thread_lock_block(td); - } - - if ((td->td_flags & TDF_NOLOAD) == 0) - sched_load_rem(); - td->td_lastcpu = td->td_oncpu; preempted = (td->td_flags & TDF_SLICEEND) == 0 && (flags & SW_PREEMPT) != 0; @@ -1021,10 +1008,25 @@ sched_switch(struct thread *td, struct thread *newtd, if (TD_IS_RUNNING(td)) { /* Put us back on the run queue. */ sched_add(td, preempted ? - SRQ_OURSELF|SRQ_YIELDING|SRQ_PREEMPTED : - SRQ_OURSELF|SRQ_YIELDING); + SRQ_HOLDTD|SRQ_OURSELF|SRQ_YIELDING|SRQ_PREEMPTED : + SRQ_HOLDTD|SRQ_OURSELF|SRQ_YIELDING); } } + + /* + * Switch to the sched lock to fix things up and pick + * a new thread. Block the td_lock in order to avoid + * breaking the critical path. + */ + if (td->td_lock != &sched_lock) { + mtx_lock_spin(&sched_lock); + tmtx = thread_lock_block(td); + mtx_unlock_spin(tmtx); + } + + if ((td->td_flags & TDF_NOLOAD) == 0) + sched_load_rem(); + if (newtd) { /* * The thread we are about to run needs to be counted @@ -1042,9 +1044,10 @@ sched_switch(struct thread *td, struct thread *newtd, sched_load_add(); } else { newtd = choosethread(); - MPASS(newtd->td_lock == &sched_lock); } + MPASS(newtd->td_lock == &sched_lock); + #if (KTR_COMPILE & KTR_SCHED) != 0 if (TD_IS_IDLETHREAD(td)) KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "idle", @@ -1075,7 +1078,7 @@ sched_switch(struct thread *td, struct thread *newtd, (*dtrace_vtime_switch_func)(newtd); #endif - cpu_switch(td, newtd, tmtx != NULL ? tmtx : td->td_lock); + cpu_switch(td, newtd, tmtx); lock_profile_obtain_lock_success(&sched_lock.lock_object, 0, 0, __FILE__, __LINE__); /* @@ -1100,8 +1103,10 @@ sched_switch(struct thread *td, struct thread *newtd, if (PMC_PROC_IS_USING_PMCS(td->td_proc)) PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_IN); #endif - } else + } else { + td->td_lock = &sched_lock; SDT_PROBE0(sched, , , remain__cpu); + } KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "running", "prio:%d", td->td_priority); @@ -1116,7 +1121,7 @@ sched_switch(struct thread *td, struct thread *newtd, } void -sched_wakeup(struct thread *td) +sched_wakeup(struct thread *td, int srqflags) { struct td_sched *ts; @@ -1130,7 +1135,7 @@ sched_wakeup(struct thread *td) td->td_slptick = 0; ts->ts_slptime = 0; ts->ts_slice = sched_slice; - sched_add(td, SRQ_BORING); + sched_add(td, srqflags); } #ifdef SMP @@ -1316,7 +1321,11 @@ sched_add(struct thread *td, int flags) */ if (td->td_lock != &sched_lock) { mtx_lock_spin(&sched_lock); - thread_lock_set(td, &sched_lock); + if ((flags & SRQ_HOLD) != 0) + td->td_lock = &sched_lock; + else + thread_lock_set(td, &sched_lock); + } TD_SET_RUNQ(td); @@ -1380,6 +1389,8 @@ sched_add(struct thread *td, int flags) maybe_resched(td); } } + if ((flags & SRQ_HOLDTD) == 0) + thread_unlock(td); } #else /* SMP */ { @@ -1407,7 +1418,10 @@ sched_add(struct thread *td, int flags) */ if (td->td_lock != &sched_lock) { mtx_lock_spin(&sched_lock); - thread_lock_set(td, &sched_lock); + if ((flags & SRQ_HOLD) != 0) + td->td_lock = &sched_lock; + else + thread_lock_set(td, &sched_lock); } TD_SET_RUNQ(td); CTR2(KTR_RUNQ, "sched_add: adding td_sched:%p (td:%p) to runq", ts, td); @@ -1418,6 +1432,8 @@ sched_add(struct thread *td, int flags) runq_add(ts->ts_runq, td, flags); if (!maybe_preempt(td)) maybe_resched(td); + if ((flags & SRQ_HOLDTD) == 0) + thread_unlock(td); } #endif /* SMP */ @@ -1776,7 +1792,7 @@ sched_affinity(struct thread *td) /* Put this thread on a valid per-CPU runqueue. */ sched_rem(td); - sched_add(td, SRQ_BORING); + sched_add(td, SRQ_HOLDTD | SRQ_BORING); break; case TDS_RUNNING: /* Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Sun Dec 15 21:08:40 2019 (r355778) +++ head/sys/kern/sched_ule.c Sun Dec 15 21:11:15 2019 (r355779) @@ -464,7 +464,7 @@ tdq_runq_add(struct tdq *tdq, struct thread *td, int f u_char pri; TDQ_LOCK_ASSERT(tdq, MA_OWNED); - THREAD_LOCK_ASSERT(td, MA_OWNED); + THREAD_LOCK_BLOCKED_ASSERT(td, MA_OWNED); pri = td->td_priority; ts = td_get_sched(td); @@ -515,6 +515,7 @@ tdq_runq_rem(struct tdq *tdq, struct thread *td) ts = td_get_sched(td); TDQ_LOCK_ASSERT(tdq, MA_OWNED); + THREAD_LOCK_BLOCKED_ASSERT(td, MA_OWNED); KASSERT(ts->ts_runq != NULL, ("tdq_runq_remove: thread %p null ts_runq", td)); if (ts->ts_flags & TSF_XFERABLE) { @@ -539,7 +540,7 @@ tdq_load_add(struct tdq *tdq, struct thread *td) { TDQ_LOCK_ASSERT(tdq, MA_OWNED); - THREAD_LOCK_ASSERT(td, MA_OWNED); + THREAD_LOCK_BLOCKED_ASSERT(td, MA_OWNED); tdq->tdq_load++; if ((td->td_flags & TDF_NOLOAD) == 0) @@ -556,8 +557,8 @@ static void tdq_load_rem(struct tdq *tdq, struct thread *td) { - THREAD_LOCK_ASSERT(td, MA_OWNED); TDQ_LOCK_ASSERT(tdq, MA_OWNED); + THREAD_LOCK_BLOCKED_ASSERT(td, MA_OWNED); KASSERT(tdq->tdq_load != 0, ("tdq_load_rem: Removing with 0 load on queue %d", TDQ_ID(tdq))); @@ -949,7 +950,6 @@ sched_balance_pair(struct tdq *high, struct tdq *low) static struct thread * tdq_move(struct tdq *from, struct tdq *to) { - struct td_sched *ts; struct thread *td; struct tdq *tdq; int cpu; @@ -962,18 +962,18 @@ tdq_move(struct tdq *from, struct tdq *to) td = tdq_steal(tdq, cpu); if (td == NULL) return (NULL); - ts = td_get_sched(td); + /* - * Although the run queue is locked the thread may be blocked. Lock - * it to clear this and acquire the run-queue lock. + * Although the run queue is locked the thread may be + * blocked. We can not set the lock until it is unblocked. */ - thread_lock(td); - /* Drop recursive lock on from acquired via thread_lock(). */ - TDQ_UNLOCK(from); + thread_lock_block_wait(td); sched_rem(td); - ts->ts_cpu = cpu; + THREAD_LOCKPTR_ASSERT(td, TDQ_LOCKPTR(from)); td->td_lock = TDQ_LOCKPTR(to); + td_get_sched(td)->ts_cpu = cpu; tdq_add(to, td, SRQ_YIELDING); + return (td); } @@ -1205,6 +1205,7 @@ sched_setcpu(struct thread *td, int cpu, int flags) { struct tdq *tdq; + struct mtx *mtx; THREAD_LOCK_ASSERT(td, MA_OWNED); tdq = TDQ_CPU(cpu); @@ -1212,26 +1213,20 @@ sched_setcpu(struct thread *td, int cpu, int flags) /* * If the lock matches just return the queue. */ - if (td->td_lock == TDQ_LOCKPTR(tdq)) + if (td->td_lock == TDQ_LOCKPTR(tdq)) { + KASSERT((flags & SRQ_HOLD) == 0, + ("sched_setcpu: Invalid lock for SRQ_HOLD")); return (tdq); -#ifdef notyet - /* - * If the thread isn't running its lockptr is a - * turnstile or a sleepqueue. We can just lock_set without - * blocking. - */ - if (TD_CAN_RUN(td)) { - TDQ_LOCK(tdq); - thread_lock_set(td, TDQ_LOCKPTR(tdq)); - return (tdq); } -#endif + /* * The hard case, migration, we need to block the thread first to * prevent order reversals with other cpus locks. */ spinlock_enter(); - thread_lock_block(td); + mtx = thread_lock_block(td); + if ((flags & SRQ_HOLD) == 0) + mtx_unlock_spin(mtx); TDQ_LOCK(tdq); thread_lock_unblock(td, TDQ_LOCKPTR(tdq)); spinlock_exit(); @@ -1422,8 +1417,7 @@ tdq_setup(struct tdq *tdq, int id) tdq->tdq_id = id; snprintf(tdq->tdq_name, sizeof(tdq->tdq_name), "sched lock %d", (int)TDQ_ID(tdq)); - mtx_init(&tdq->tdq_lock, tdq->tdq_name, "sched lock", - MTX_SPIN | MTX_RECURSE); + mtx_init(&tdq->tdq_lock, tdq->tdq_name, "sched lock", MTX_SPIN); #ifdef KTR snprintf(tdq->tdq_loadname, sizeof(tdq->tdq_loadname), "CPU %d load", (int)TDQ_ID(tdq)); @@ -1785,7 +1779,7 @@ sched_thread_priority(struct thread *td, u_char prio) if (TD_ON_RUNQ(td) && prio < td->td_priority) { sched_rem(td); td->td_priority = prio; - sched_add(td, SRQ_BORROWING); + sched_add(td, SRQ_BORROWING | SRQ_HOLDTD); return; } /* @@ -2011,6 +2005,7 @@ static struct mtx * sched_switch_migrate(struct tdq *tdq, struct thread *td, int flags) { struct tdq *tdn; + struct mtx *mtx; KASSERT(!CPU_ABSENT(td_get_sched(td)->ts_cpu), ("sched_switch_migrate: " "thread %s queued on absent CPU %d.", td->td_name, @@ -2024,7 +2019,8 @@ sched_switch_migrate(struct tdq *tdq, struct thread *t * not holding either run-queue lock. */ spinlock_enter(); - thread_lock_block(td); /* This releases the lock on tdq. */ + mtx = thread_lock_block(td); + mtx_unlock_spin(mtx); /* * Acquire both run-queue locks before placing the thread on the new @@ -2044,8 +2040,7 @@ sched_switch_migrate(struct tdq *tdq, struct thread *t } /* - * Variadic version of thread_lock_unblock() that does not assume td_lock - * is blocked. + * thread_lock_unblock() that does not assume td_lock is blocked. */ static inline void thread_unblock_switch(struct thread *td, struct mtx *mtx) @@ -2114,8 +2109,13 @@ sched_switch(struct thread *td, struct thread *newtd, } } else { /* This thread must be going to sleep. */ - TDQ_LOCK(tdq); mtx = thread_lock_block(td); + if (mtx != TDQ_LOCKPTR(tdq)) { + spinlock_enter(); + mtx_unlock_spin(mtx); + TDQ_LOCK(tdq); + spinlock_exit(); + } tdq_load_rem(tdq, td); #ifdef SMP if (tdq->tdq_load == 0) @@ -2237,9 +2237,11 @@ sched_sleep(struct thread *td, int prio) /* * Schedule a thread to resume execution and record how long it voluntarily * slept. We also update the pctcpu, interactivity, and priority. + * + * Requires the thread lock on entry, drops on exit. */ void -sched_wakeup(struct thread *td) +sched_wakeup(struct thread *td, int srqflags) { struct td_sched *ts; int slptick; @@ -2247,6 +2249,7 @@ sched_wakeup(struct thread *td) THREAD_LOCK_ASSERT(td, MA_OWNED); ts = td_get_sched(td); td->td_flags &= ~TDF_CANSWAP; + /* * If we slept for more than a tick update our interactivity and * priority. @@ -2262,7 +2265,7 @@ sched_wakeup(struct thread *td) * Reset the slice value since we slept and advanced the round-robin. */ ts->ts_slice = 0; - sched_add(td, SRQ_BORING); + sched_add(td, SRQ_BORING | srqflags); } /* @@ -2578,6 +2581,7 @@ tdq_add(struct tdq *tdq, struct thread *td, int flags) { TDQ_LOCK_ASSERT(tdq, MA_OWNED); + THREAD_LOCK_BLOCKED_ASSERT(td, MA_OWNED); KASSERT((td->td_inhibitors == 0), ("sched_add: trying to run inhibited thread")); KASSERT((TD_CAN_RUN(td) || TD_IS_RUNNING(td)), @@ -2594,6 +2598,8 @@ tdq_add(struct tdq *tdq, struct thread *td, int flags) /* * Select the target thread queue and add a thread to it. Request * preemption or IPI a remote processor if required. + * + * Requires the thread lock on entry, drops on exit. */ void sched_add(struct thread *td, int flags) @@ -2625,10 +2631,10 @@ sched_add(struct thread *td, int flags) cpu = sched_pickcpu(td, flags); tdq = sched_setcpu(td, cpu, flags); tdq_add(tdq, td, flags); - if (cpu != PCPU_GET(cpuid)) { + if (cpu != PCPU_GET(cpuid)) tdq_notify(tdq, td); - return; - } + else if (!(flags & SRQ_YIELDING)) + sched_setpreempt(td); #else tdq = TDQ_SELF(); TDQ_LOCK(tdq); @@ -2636,11 +2642,16 @@ sched_add(struct thread *td, int flags) * Now that the thread is moving to the run-queue, set the lock *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Dec 15 21:16:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C6DE41CF805; Sun, 15 Dec 2019 21:16:36 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47bcfD5bJDz3yDm; Sun, 15 Dec 2019 21:16:36 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA9AC1B0A3; Sun, 15 Dec 2019 21:16:36 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBFLGajT031506; Sun, 15 Dec 2019 21:16:36 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBFLGZdc031501; Sun, 15 Dec 2019 21:16:35 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201912152116.xBFLGZdc031501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 15 Dec 2019 21:16:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355780 - in head/sys: arm/arm arm/include kern sys X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: arm/arm arm/include kern sys X-SVN-Commit-Revision: 355780 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 21:16:36 -0000 Author: ian Date: Sun Dec 15 21:16:35 2019 New Revision: 355780 URL: https://svnweb.freebsd.org/changeset/base/355780 Log: Rewrite arm kernel stack unwind code to work when unwinding through modules. The arm kernel stack unwinder has apparently never been able to unwind when the path of execution leads through a kernel module. There was code that tried to handle modules by looking for the unwind data in them, but it did so by trying to find symbols which have never existed in arm kernel modules. That caused the unwind code to panic, and because part of panic handling calls into the unwind code, that just created a recursion loop. Locating the unwind data in a loaded module requires accessing the Elf section headers to find the SHT_ARM_EXIDX section. For preloaded modules those headers are present in a metadata blob. For dynamically loaded modules, the headers are present only while the loading is in progress; the memory is freed once the module is ready to use. For that reason, there is new code in kern/link_elf.c, wrapped in #ifdef __arm__, to extract the unwind info while the headers are loaded. The values are saved into new fields in the linker_file structure which are also conditional on __arm__. In arm/unwind.c there is new code to locally cache the per-module info needed to find the unwind tables. The local cache is crafted for lockless read access, because the unwind code often needs to run in context where sleeping is not allowed. A large comment block describes the local cache list, so I won't repeat it all here. Modified: head/sys/arm/arm/elf_machdep.c head/sys/arm/arm/unwind.c head/sys/arm/include/stack.h head/sys/kern/kern_linker.c head/sys/kern/link_elf.c head/sys/sys/linker.h Modified: head/sys/arm/arm/elf_machdep.c ============================================================================== --- head/sys/arm/arm/elf_machdep.c Sun Dec 15 21:11:15 2019 (r355779) +++ head/sys/arm/arm/elf_machdep.c Sun Dec 15 21:16:35 2019 (r355780) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #ifdef VFP #include #endif @@ -309,12 +310,21 @@ elf_cpu_load_file(linker_file_t lf) cpu_l2cache_wb_range((vm_offset_t)lf->address, (vm_size_t)lf->size); cpu_icache_sync_range((vm_offset_t)lf->address, (vm_size_t)lf->size); #endif + + /* + * Inform the stack(9) code of the new module, so it can acquire its + * per-module unwind data. + */ + unwind_module_loaded(lf); + return (0); } int -elf_cpu_unload_file(linker_file_t lf __unused) +elf_cpu_unload_file(linker_file_t lf) { + /* Inform the stack(9) code that this module is gone. */ + unwind_module_unloaded(lf); return (0); } Modified: head/sys/arm/arm/unwind.c ============================================================================== --- head/sys/arm/arm/unwind.c Sun Dec 15 21:11:15 2019 (r355779) +++ head/sys/arm/arm/unwind.c Sun Dec 15 21:16:35 2019 (r355780) @@ -32,8 +32,11 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include +#include +#include +#include #include #include @@ -94,79 +97,236 @@ struct unwind_idx { uint32_t insn; }; -/* Expand a 31-bit signed value to a 32-bit signed value */ -static __inline int32_t -expand_prel31(uint32_t prel31) +/* + * Local cache of unwind info for loaded modules. + * + * To unwind the stack through the code in a loaded module, we need to access + * the module's exidx unwind data. To locate that data, one must search the + * elf section headers for the SHT_ARM_EXIDX section. Those headers are + * available at the time the module is being loaded, but are discarded by time + * the load process has completed. Code in kern/link_elf.c locates the data we + * need and stores it into the linker_file structure before calling the arm + * machdep routine for handling loaded modules (in arm/elf_machdep.c). That + * function calls into this code to pass along the unwind info, which we save + * into one of these module_info structures. + * + * Because we have to help stack(9) gather stack info at any time, including in + * contexts where sleeping is not allowed, we cannot use linker_file_foreach() + * to walk the kernel's list of linker_file structs, because doing so requires + * acquiring an exclusive sx_lock. So instead, we keep a local list of these + * structures, one for each loaded module (and one for the kernel itself that we + * synthesize at init time). New entries are added to the end of this list as + * needed, but entries are never deleted from the list. Instead, they are + * cleared out in-place to mark them as unused. That means the code doing stack + * unwinding can always safely walk the list without locking, because the + * structure of the list never changes in a way that would cause the walker to + * follow a bad link. + * + * A cleared-out entry on the list has module start=UINTPTR_MAX and end=0, so + * start <= addr < end cannot be true for any value of addr being searched for. + * We also don't have to worry about races where we look up the unwind info just + * before a module is unloaded and try to access it concurrently with or just + * after the unloading happens in another thread, because that means the path of + * execution leads through a now-unloaded module, and that's already well into + * undefined-behavior territory. + * + * List entries marked as unused get reused when new modules are loaded. We + * don't worry about holding a few unused bytes of memory in the list after + * unloading a module. + */ +struct module_info { + uintptr_t module_start; /* Start of loaded module */ + uintptr_t module_end; /* End of loaded module */ + uintptr_t exidx_start; /* Start of unwind data */ + uintptr_t exidx_end; /* End of unwind data */ + STAILQ_ENTRY(module_info) + link; /* Link to next entry */ +}; +static STAILQ_HEAD(, module_info) module_list; + +/* + * Hide ugly casting in somewhat-less-ugly macros. + * CADDR - cast a pointer or number to caddr_t. + * UADDR - cast a pointer or number to uintptr_t. + */ +#define CADDR(addr) ((caddr_t)(void*)(uintptr_t)(addr)) +#define UADDR(addr) ((uintptr_t)(addr)) + +/* + * Clear the info in an existing module_info entry on the list. The + * module_start/end addresses are set to values that cannot match any real + * memory address. The entry remains on the list, but will be ignored until it + * is populated with new data. + */ +static void +clear_module_info(struct module_info *info) { + info->module_start = UINTPTR_MAX; + info->module_end = 0; +} - return ((int32_t)(prel31 & 0x7fffffffu) << 1) / 2; +/* + * Populate an existing module_info entry (which is already on the list) with + * the info for a new module. + */ +static void +populate_module_info(struct module_info *info, linker_file_t lf) +{ + + /* + * Careful! The module_start and module_end fields must not be set + * until all other data in the structure is valid. + */ + info->exidx_start = UADDR(lf->exidx_addr); + info->exidx_end = UADDR(lf->exidx_addr) + lf->exidx_size; + info->module_start = UADDR(lf->address); + info->module_end = UADDR(lf->address) + lf->size; } -struct search_context { - uint32_t addr; - caddr_t exidx_start; - caddr_t exidx_end; -}; +/* + * Create a new empty module_info entry and add it to the tail of the list. + */ +static struct module_info * +create_module_info(void) +{ + struct module_info *info; -static int -module_search(linker_file_t lf, void *context) + info = malloc(sizeof(*info), M_CACHE, M_WAITOK | M_ZERO); + clear_module_info(info); + STAILQ_INSERT_TAIL(&module_list, info, link); + return (info); +} + +/* + * Search for a module_info entry on the list whose address range contains the + * given address. If the search address is zero (no module will be loaded at + * zero), then we're looking for an empty item to reuse, which is indicated by + * module_start being set to UINTPTR_MAX in the entry. + */ +static struct module_info * +find_module_info(uintptr_t addr) { - struct search_context *sc = context; - linker_symval_t symval; - c_linker_sym_t sym; + struct module_info *info; - if (lf->address <= (caddr_t)sc->addr && - (lf->address + lf->size) >= (caddr_t)sc->addr) { - if ((LINKER_LOOKUP_SYMBOL(lf, "__exidx_start", &sym) == 0 || - LINKER_LOOKUP_SYMBOL(lf, "exidx_start", &sym) == 0) && - LINKER_SYMBOL_VALUES(lf, sym, &symval) == 0) - sc->exidx_start = symval.value; + STAILQ_FOREACH(info, &module_list, link) { + if ((addr >= info->module_start && addr < info->module_end) || + (addr == 0 && info->module_start == UINTPTR_MAX)) + return (info); + } + return (NULL); +} - if ((LINKER_LOOKUP_SYMBOL(lf, "__exidx_end", &sym) == 0 || - LINKER_LOOKUP_SYMBOL(lf, "exidx_end", &sym) == 0) && - LINKER_SYMBOL_VALUES(lf, sym, &symval) == 0) - sc->exidx_end = symval.value; +/* + * Handle the loading of a new module by populating a module_info for it. This + * is called for both preloaded and dynamically loaded modules. + */ +void +unwind_module_loaded(struct linker_file *lf) +{ + struct module_info *info; - if (sc->exidx_start != NULL && sc->exidx_end != NULL) - return (1); - panic("Invalid module %s, no unwind tables\n", lf->filename); + /* + * A module that contains only data may have no unwind info; don't + * create any module info for it. + */ + if (lf->exidx_size == 0) + return; + + /* + * Find an unused entry in the existing list to reuse. If we don't find + * one, create a new one and link it into the list. This is the only + * place the module_list is modified. Adding a new entry to the list + * will not perturb any other threads currently walking the list. This + * function is invoked while kern_linker is still holding its lock + * to prevent its module list from being modified, so we don't have to + * worry about racing other threads doing an insert concurrently. + */ + if ((info = find_module_info(0)) == NULL) { + info = create_module_info(); } + populate_module_info(info, lf); +} + +/* Handle the unloading of a module. */ +void +unwind_module_unloaded(struct linker_file *lf) +{ + struct module_info *info; + + /* + * A module that contains only data may have no unwind info and there + * won't be a list entry for it. + */ + if (lf->exidx_size == 0) + return; + + /* + * When a module is unloaded, we clear the info out of its entry in the + * module list, making that entry available for later reuse. + */ + if ((info = find_module_info(UADDR(lf->address))) == NULL) { + printf("arm unwind: module '%s' not on list at unload time\n", + lf->filename); + return; + } + clear_module_info(info); +} + +/* + * Initialization must run fairly early, as soon as malloc(9) is available, and + * definitely before witness, which uses stack(9). We synthesize a module_info + * entry for the kernel, because unwind_module_loaded() doesn't get called for + * it. Also, it is unlike other modules in that the elf metadata for locating + * the unwind tables might be stripped, so instead we have to use the + * _exidx_start/end symbols created by ldscript.arm. + */ +static int +module_info_init(void *arg __unused) +{ + struct linker_file thekernel; + + STAILQ_INIT(&module_list); + + thekernel.filename = "kernel"; + thekernel.address = CADDR(&_start); + thekernel.size = UADDR(&_end) - UADDR(&_start); + thekernel.exidx_addr = CADDR(&_exidx_start); + thekernel.exidx_size = UADDR(&_exidx_end) - UADDR(&_exidx_start); + populate_module_info(create_module_info(), &thekernel); + return (0); } +SYSINIT(unwind_init, SI_SUB_KMEM, SI_ORDER_ANY, module_info_init, NULL); +/* Expand a 31-bit signed value to a 32-bit signed value */ +static __inline int32_t +expand_prel31(uint32_t prel31) +{ + + return ((int32_t)(prel31 & 0x7fffffffu) << 1) / 2; +} + /* * Perform a binary search of the index table to find the function * with the largest address that doesn't exceed addr. */ static struct unwind_idx * -find_index(uint32_t addr, int search_modules) +find_index(uint32_t addr) { - struct search_context sc; - caddr_t idx_start, idx_end; + struct module_info *info; unsigned int min, mid, max; struct unwind_idx *start; struct unwind_idx *item; int32_t prel31_addr; uint32_t func_addr; - start = (struct unwind_idx *)&_exidx_start; - idx_start = (caddr_t)&_exidx_start; - idx_end = (caddr_t)&_exidx_end; + info = find_module_info(addr); + if (info == NULL) + return NULL; - /* This may acquire a lock */ - if (search_modules) { - bzero(&sc, sizeof(sc)); - sc.addr = addr; - if (linker_file_foreach(module_search, &sc) != 0 && - sc.exidx_start != NULL && sc.exidx_end != NULL) { - start = (struct unwind_idx *)sc.exidx_start; - idx_start = sc.exidx_start; - idx_end = sc.exidx_end; - } - } - min = 0; - max = (idx_end - idx_start) / sizeof(struct unwind_idx); + max = (info->exidx_end - info->exidx_start) / sizeof(struct unwind_idx); + start = (struct unwind_idx *)CADDR(info->exidx_start); while (min != max) { mid = min + (max - min + 1) / 2; @@ -377,11 +537,17 @@ unwind_tab(struct unwind_state *state) return 0; } +/* + * Unwind a single stack frame. + * Return 0 on success or 1 if the stack cannot be unwound any further. + * + * XXX The can_lock argument is no longer germane; a sweep of callers should be + * made to remove it after this new code has proven itself for a while. + */ int -unwind_stack_one(struct unwind_state *state, int can_lock) +unwind_stack_one(struct unwind_state *state, int can_lock __unused) { struct unwind_idx *index; - int finished; /* Reset the mask of updated registers */ state->update_mask = 0; @@ -390,26 +556,20 @@ unwind_stack_one(struct unwind_state *state, int can_l state->start_pc = state->registers[PC]; /* Find the item to run */ - index = find_index(state->start_pc, can_lock); + index = find_index(state->start_pc); + if (index == NULL || index->insn == EXIDX_CANTUNWIND) + return 1; - finished = 0; - if (index->insn != EXIDX_CANTUNWIND) { - if (index->insn & (1U << 31)) { - /* The data is within the instruction */ - state->insn = &index->insn; - } else { - /* A prel31 offset to the unwind table */ - state->insn = (uint32_t *) - ((uintptr_t)&index->insn + - expand_prel31(index->insn)); - } - /* Run the unwind function */ - finished = unwind_tab(state); + if (index->insn & (1U << 31)) { + /* The data is within the instruction */ + state->insn = &index->insn; + } else { + /* A prel31 offset to the unwind table */ + state->insn = (uint32_t *) + ((uintptr_t)&index->insn + + expand_prel31(index->insn)); } - /* This is the top of the stack, finish */ - if (index->insn == EXIDX_CANTUNWIND) - finished = 1; - - return (finished); + /* Run the unwind function, return its finished/not-finished status. */ + return (unwind_tab(state)); } Modified: head/sys/arm/include/stack.h ============================================================================== --- head/sys/arm/include/stack.h Sun Dec 15 21:11:15 2019 (r355779) +++ head/sys/arm/include/stack.h Sun Dec 15 21:16:35 2019 (r355780) @@ -55,6 +55,14 @@ struct unwind_state { #define LR 14 #define PC 15 +#ifdef _KERNEL + int unwind_stack_one(struct unwind_state *, int); + +struct linker_file; +void unwind_module_loaded(struct linker_file *); +void unwind_module_unloaded(struct linker_file *); + +#endif #endif /* !_MACHINE_STACK_H_ */ Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Sun Dec 15 21:11:15 2019 (r355779) +++ head/sys/kern/kern_linker.c Sun Dec 15 21:16:35 2019 (r355780) @@ -624,6 +624,10 @@ linker_make_file(const char *pathname, linker_class_t lf->ndeps = 0; lf->deps = NULL; lf->loadcnt = ++loadcnt; +#ifdef __arm__ + lf->exidx_addr = 0; + lf->exidx_size = 0; +#endif STAILQ_INIT(&lf->common); TAILQ_INIT(&lf->modules); TAILQ_INSERT_TAIL(&linker_files, lf, link); Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Sun Dec 15 21:11:15 2019 (r355779) +++ head/sys/kern/link_elf.c Sun Dec 15 21:16:35 2019 (r355780) @@ -773,6 +773,50 @@ preload_protect(elf_file_t ef, vm_prot_t prot) #endif } +#ifdef __arm__ +/* + * Locate the ARM exception/unwind table info for DDB and stack(9) use by + * searching for the section header that describes it. There may be no unwind + * info, for example in a module containing only data. + */ +static void +link_elf_locate_exidx(linker_file_t lf, Elf_Shdr *shdr, int nhdr) +{ + int i; + + for (i = 0; i < nhdr; i++) { + if (shdr[i].sh_type == SHT_ARM_EXIDX) { + lf->exidx_addr = shdr[i].sh_addr + lf->address; + lf->exidx_size = shdr[i].sh_size; + break; + } + } +} + +/* + * Locate the section headers metadata in a preloaded module, then use it to + * locate the exception/unwind table in the module. The size of the metadata + * block is stored in a uint32 word immediately before the data itself, and a + * comment in preload_search_info() says it is safe to rely on that. + */ +static void +link_elf_locate_exidx_preload(struct linker_file *lf, caddr_t modptr) +{ + uint32_t *modinfo; + Elf_Shdr *shdr; + uint32_t nhdr; + + modinfo = (uint32_t *)preload_search_info(modptr, + MODINFO_METADATA | MODINFOMD_SHDR); + if (modinfo != NULL) { + shdr = (Elf_Shdr *)modinfo; + nhdr = modinfo[-1] / sizeof(Elf_Shdr); + link_elf_locate_exidx(lf, shdr, nhdr); + } +} + +#endif /* __arm__ */ + static int link_elf_link_preload(linker_class_t cls, const char *filename, linker_file_t *result) @@ -828,6 +872,10 @@ link_elf_link_preload(linker_class_t cls, const char * lf->ctors_size = *ctors_sizep; } +#ifdef __arm__ + link_elf_locate_exidx_preload(lf, modptr); +#endif + error = parse_dynamic(ef); if (error == 0) error = parse_dpcpu(ef); @@ -1225,6 +1273,11 @@ link_elf_load_file(linker_class_t cls, const char* fil ef->ddbstrtab = ef->strbase; nosyms: + +#ifdef __arm__ + link_elf_locate_exidx(lf, shdr, hdr->e_shnum); +#endif + error = link_elf_link_common_finish(lf); if (error != 0) goto out; Modified: head/sys/sys/linker.h ============================================================================== --- head/sys/sys/linker.h Sun Dec 15 21:11:15 2019 (r355779) +++ head/sys/sys/linker.h Sun Dec 15 21:16:35 2019 (r355780) @@ -97,6 +97,11 @@ struct linker_file { */ int nenabled; /* number of enabled probes. */ int fbt_nentries; /* number of fbt entries created. */ + +#ifdef __arm__ + caddr_t exidx_addr; /* Unwind data index table start */ + size_t exidx_size; /* Unwind data index table size */ +#endif }; /* From owner-svn-src-head@freebsd.org Sun Dec 15 21:18:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 312741CF8D2; Sun, 15 Dec 2019 21:18:08 +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 47bch00ZyXz3yNh; Sun, 15 Dec 2019 21:18:08 +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 0F4DD1B0B1; Sun, 15 Dec 2019 21:18:08 +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 xBFLI7sF031614; Sun, 15 Dec 2019 21:18:07 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBFLI72d031613; Sun, 15 Dec 2019 21:18:07 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201912152118.xBFLI72d031613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 15 Dec 2019 21:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355781 - 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: 355781 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 21:18:08 -0000 Author: jeff Date: Sun Dec 15 21:18:07 2019 New Revision: 355781 URL: https://svnweb.freebsd.org/changeset/base/355781 Log: schedlock 2/4 Do all sleepqueue post-processing in sleepq_remove_thread() so that we do not require the thread lock after a context switch. Reviewed by: jhb, kib Differential Revision: https://reviews.freebsd.org/D22745 Modified: head/sys/kern/subr_sleepqueue.c head/sys/sys/proc.h Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Sun Dec 15 21:16:35 2019 (r355780) +++ head/sys/kern/subr_sleepqueue.c Sun Dec 15 21:18:07 2019 (r355781) @@ -164,8 +164,8 @@ static uma_zone_t sleepq_zone; * Prototypes for non-exported routines. */ static int sleepq_catch_signals(void *wchan, int pri); -static int sleepq_check_signals(void); -static int sleepq_check_timeout(void); +static inline int sleepq_check_signals(void); +static inline int sleepq_check_timeout(void); #ifdef INVARIANTS static void sleepq_dtor(void *mem, int size, void *arg); #endif @@ -378,9 +378,10 @@ sleepq_add(void *wchan, struct lock_object *lock, cons td->td_wchan = wchan; td->td_wmesg = wmesg; if (flags & SLEEPQ_INTERRUPTIBLE) { + td->td_intrval = 0; td->td_flags |= TDF_SINTR; - td->td_flags &= ~TDF_SLEEPABORT; } + td->td_flags &= ~TDF_TIMEOUT; thread_unlock(td); } @@ -624,63 +625,35 @@ sleepq_switch(void *wchan, int pri) /* * Check to see if we timed out. */ -static int +static inline int sleepq_check_timeout(void) { struct thread *td; int res; - td = curthread; - THREAD_LOCK_ASSERT(td, MA_OWNED); - - /* - * If TDF_TIMEOUT is set, we timed out. But recheck - * td_sleeptimo anyway. - */ res = 0; + td = curthread; if (td->td_sleeptimo != 0) { if (td->td_sleeptimo <= sbinuptime()) res = EWOULDBLOCK; td->td_sleeptimo = 0; } - if (td->td_flags & TDF_TIMEOUT) - td->td_flags &= ~TDF_TIMEOUT; - else - /* - * We ignore the situation where timeout subsystem was - * unable to stop our callout. The struct thread is - * type-stable, the callout will use the correct - * memory when running. The checks of the - * td_sleeptimo value in this function and in - * sleepq_timeout() ensure that the thread does not - * get spurious wakeups, even if the callout was reset - * or thread reused. - */ - callout_stop(&td->td_slpcallout); return (res); } /* * Check to see if we were awoken by a signal. */ -static int +static inline int sleepq_check_signals(void) { struct thread *td; td = curthread; - THREAD_LOCK_ASSERT(td, MA_OWNED); + KASSERT((td->td_flags & TDF_SINTR) == 0, + ("thread %p still in interruptible sleep?", td)); - /* We are no longer in an interruptible sleep. */ - if (td->td_flags & TDF_SINTR) - td->td_flags &= ~TDF_SINTR; - - if (td->td_flags & TDF_SLEEPABORT) { - td->td_flags &= ~TDF_SLEEPABORT; - return (td->td_intrval); - } - - return (0); + return (td->td_intrval); } /* @@ -706,14 +679,12 @@ int sleepq_wait_sig(void *wchan, int pri) { int rcatch; - int rval; rcatch = sleepq_catch_signals(wchan, pri); - rval = sleepq_check_signals(); thread_unlock(curthread); if (rcatch) return (rcatch); - return (rval); + return (sleepq_check_signals()); } /* @@ -724,16 +695,14 @@ int sleepq_timedwait(void *wchan, int pri) { struct thread *td; - int rval; td = curthread; MPASS(!(td->td_flags & TDF_SINTR)); thread_lock(td); sleepq_switch(wchan, pri); - rval = sleepq_check_timeout(); thread_unlock(td); - return (rval); + return (sleepq_check_timeout()); } /* @@ -746,9 +715,11 @@ sleepq_timedwait_sig(void *wchan, int pri) int rcatch, rvalt, rvals; rcatch = sleepq_catch_signals(wchan, pri); + thread_unlock(curthread); + + /* We must always call check_timeout() to clear sleeptimo. */ rvalt = sleepq_check_timeout(); rvals = sleepq_check_signals(); - thread_unlock(curthread); if (rcatch) return (rcatch); if (rvals) @@ -877,9 +848,22 @@ sleepq_remove_thread(struct sleepqueue *sq, struct thr td->td_sleepqueue = LIST_FIRST(&sq->sq_free); LIST_REMOVE(td->td_sleepqueue, sq_hash); + if ((td->td_flags & TDF_TIMEOUT) == 0 && td->td_sleeptimo != 0) + /* + * We ignore the situation where timeout subsystem was + * unable to stop our callout. The struct thread is + * type-stable, the callout will use the correct + * memory when running. The checks of the + * td_sleeptimo value in this function and in + * sleepq_timeout() ensure that the thread does not + * get spurious wakeups, even if the callout was reset + * or thread reused. + */ + callout_stop(&td->td_slpcallout); + td->td_wmesg = NULL; td->td_wchan = NULL; - td->td_flags &= ~TDF_SINTR; + td->td_flags &= ~(TDF_SINTR | TDF_TIMEOUT); CTR3(KTR_PROC, "sleepq_wakeup: thread %p (pid %ld, %s)", (void *)td, (long)td->td_proc->p_pid, td->td_name); @@ -1047,7 +1031,7 @@ sleepq_timeout(void *arg) (void *)td, (long)td->td_proc->p_pid, (void *)td->td_name); thread_lock(td); - if (td->td_sleeptimo > sbinuptime() || td->td_sleeptimo == 0) { + if (td->td_sleeptimo == 0 || td->td_sleeptimo > sbinuptime()) { /* * The thread does not want a timeout (yet). */ @@ -1146,7 +1130,6 @@ sleepq_abort(struct thread *td, int intrval) CTR3(KTR_PROC, "sleepq_abort: thread %p (pid %ld, %s)", (void *)td, (long)td->td_proc->p_pid, (void *)td->td_name); td->td_intrval = intrval; - td->td_flags |= TDF_SLEEPABORT; /* * If the thread has not slept yet it will find the signal in Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sun Dec 15 21:16:35 2019 (r355780) +++ head/sys/sys/proc.h Sun Dec 15 21:18:07 2019 (r355781) @@ -431,7 +431,7 @@ do { \ #define TDF_TIMEOUT 0x00000010 /* Timing out during sleep. */ #define TDF_IDLETD 0x00000020 /* This is a per-CPU idle thread. */ #define TDF_CANSWAP 0x00000040 /* Thread can be swapped. */ -#define TDF_SLEEPABORT 0x00000080 /* sleepq_abort was called. */ +#define TDF_UNUSED80 0x00000080 /* unused. */ #define TDF_KTH_SUSP 0x00000100 /* kthread is suspended */ #define TDF_ALLPROCSUSP 0x00000200 /* suspended by SINGLE_ALLPROC */ #define TDF_BOUNDARY 0x00000400 /* Thread suspended at user boundary */ From owner-svn-src-head@freebsd.org Sun Dec 15 21:19:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 575851CF961; Sun, 15 Dec 2019 21:19:42 +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 47bcjp1ckHz3yWj; Sun, 15 Dec 2019 21:19:42 +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 32A471B0B8; Sun, 15 Dec 2019 21:19:42 +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 xBFLJf6U031724; Sun, 15 Dec 2019 21:19:41 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBFLJfrk031723; Sun, 15 Dec 2019 21:19:41 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201912152119.xBFLJfrk031723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 15 Dec 2019 21:19:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355782 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355782 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 21:19:42 -0000 Author: jeff Date: Sun Dec 15 21:19:41 2019 New Revision: 355782 URL: https://svnweb.freebsd.org/changeset/base/355782 Log: schedlock 3/4 Eliminate lock recursion from turnstiles. This was simply used to avoid tracking the top-level turnstile lock. explicitly check for it before picking up and dropping locks. Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D22746 Modified: head/sys/kern/subr_turnstile.c Modified: head/sys/kern/subr_turnstile.c ============================================================================== --- head/sys/kern/subr_turnstile.c Sun Dec 15 21:18:07 2019 (r355781) +++ head/sys/kern/subr_turnstile.c Sun Dec 15 21:19:41 2019 (r355782) @@ -175,6 +175,22 @@ SDT_PROBE_DEFINE(sched, , , sleep); SDT_PROBE_DEFINE2(sched, , , wakeup, "struct thread *", "struct proc *"); +static inline void +propagate_unlock_ts(struct turnstile *top, struct turnstile *ts) +{ + + if (ts != top) + mtx_unlock_spin(&ts->ts_lock); +} + +static inline void +propagate_unlock_td(struct turnstile *top, struct thread *td) +{ + + if (td->td_lock != &top->ts_lock) + thread_unlock(td); +} + /* * Walks the chain of turnstiles and their owners to propagate the priority * of the thread being blocked to all the threads holding locks that have to @@ -183,20 +199,19 @@ SDT_PROBE_DEFINE2(sched, , , wakeup, "struct thread *" static void propagate_priority(struct thread *td) { - struct turnstile *ts; + struct turnstile *ts, *top; int pri; THREAD_LOCK_ASSERT(td, MA_OWNED); pri = td->td_priority; - ts = td->td_blocked; + top = ts = td->td_blocked; THREAD_LOCKPTR_ASSERT(td, &ts->ts_lock); + /* - * Grab a recursive lock on this turnstile chain so it stays locked - * for the whole operation. The caller expects us to return with - * the original lock held. We only ever lock down the chain so - * the lock order is constant. + * The original turnstile lock is held across the entire + * operation. We only ever lock down the chain so the lock + * order is constant. */ - mtx_lock_spin(&ts->ts_lock); for (;;) { td = ts->ts_owner; @@ -205,12 +220,19 @@ propagate_priority(struct thread *td) * This might be a read lock with no owner. There's * not much we can do, so just bail. */ - mtx_unlock_spin(&ts->ts_lock); + propagate_unlock_ts(top, ts); return; } - thread_lock_flags(td, MTX_DUPOK); - mtx_unlock_spin(&ts->ts_lock); + /* + * Wait for the thread lock to be stable and then only + * acquire if it is not the turnstile lock. + */ + thread_lock_block_wait(td); + if (td->td_lock != &ts->ts_lock) { + thread_lock_flags(td, MTX_DUPOK); + propagate_unlock_ts(top, ts); + } MPASS(td->td_proc != NULL); MPASS(td->td_proc->p_magic == P_MAGIC); @@ -233,7 +255,7 @@ propagate_priority(struct thread *td) * thread that is being blocked, we are finished. */ if (td->td_priority <= pri) { - thread_unlock(td); + propagate_unlock_td(top, td); return; } @@ -248,7 +270,7 @@ propagate_priority(struct thread *td) */ if (TD_IS_RUNNING(td) || TD_ON_RUNQ(td)) { MPASS(td->td_blocked == NULL); - thread_unlock(td); + propagate_unlock_td(top, td); return; } @@ -276,7 +298,7 @@ propagate_priority(struct thread *td) THREAD_LOCKPTR_ASSERT(td, &ts->ts_lock); /* Resort td on the list if needed. */ if (!turnstile_adjust_thread(ts, td)) { - mtx_unlock_spin(&ts->ts_lock); + propagate_unlock_ts(top, ts); return; } /* The thread lock is released as ts lock above. */ @@ -498,7 +520,7 @@ turnstile_init(void *mem, int size, int flags) TAILQ_INIT(&ts->ts_blocked[TS_SHARED_QUEUE]); TAILQ_INIT(&ts->ts_pending); LIST_INIT(&ts->ts_free); - mtx_init(&ts->ts_lock, "turnstile lock", NULL, MTX_SPIN | MTX_RECURSE); + mtx_init(&ts->ts_lock, "turnstile lock", NULL, MTX_SPIN); return (0); } From owner-svn-src-head@freebsd.org Sun Dec 15 21:20:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 70DED1CF9F5; Sun, 15 Dec 2019 21:20:19 +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 47bckW2MvYz3yfP; Sun, 15 Dec 2019 21:20:19 +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 4CA2A1B0C1; Sun, 15 Dec 2019 21:20:19 +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 xBFLKJg0031841; Sun, 15 Dec 2019 21:20:19 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBFLKIaV031839; Sun, 15 Dec 2019 21:20:18 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201912152120.xBFLKIaV031839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 15 Dec 2019 21:20:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355783 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 355783 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 21:20:19 -0000 Author: jhibbits Date: Sun Dec 15 21:20:18 2019 New Revision: 355783 URL: https://svnweb.freebsd.org/changeset/base/355783 Log: powerpc/powernv: Set the PTCR for the Nest MMU The Nest MMU manages address translation for accelerators on the POWER9. To do so, it needs a page table, so export the system page table to the Nest MMU. This will quietly fail on pre-POWER9 systems that do not have a NMMU. The NMMU is currently unused, so this change is currently effectively a NOP, but the NMMU and VAS will eventually be used. Modified: head/sys/powerpc/powernv/opal.h head/sys/powerpc/powernv/platform_powernv.c Modified: head/sys/powerpc/powernv/opal.h ============================================================================== --- head/sys/powerpc/powernv/opal.h Sun Dec 15 21:19:41 2019 (r355782) +++ head/sys/powerpc/powernv/opal.h Sun Dec 15 21:20:18 2019 (r355783) @@ -91,6 +91,7 @@ int opal_call(uint64_t token, ...); #define OPAL_INT_EOI 124 #define OPAL_INT_SET_MFRR 125 #define OPAL_PCI_TCE_KILL 126 +#define OPAL_NMMU_SET_PTCR 127 #define OPAL_XIVE_RESET 128 #define OPAL_XIVE_GET_IRQ_INFO 129 #define OPAL_XIVE_GET_IRQ_CONFIG 130 Modified: head/sys/powerpc/powernv/platform_powernv.c ============================================================================== --- head/sys/powerpc/powernv/platform_powernv.c Sun Dec 15 21:19:41 2019 (r355782) +++ head/sys/powerpc/powernv/platform_powernv.c Sun Dec 15 21:20:18 2019 (r355783) @@ -494,3 +494,14 @@ static void powernv_cpu_idle(sbintime_t sbt) { } + +/* Set up the Nest MMU on POWER9 relatively early, but after pmap is setup. */ +static void +powernv_setup_nmmu(void *unused) +{ + if (opal_check() != 0) + return; + opal_call(OPAL_NMMU_SET_PTCR, -1, mfspr(SPR_PTCR)); +} + +SYSINIT(powernv_setup_nmmu, SI_SUB_CPU, SI_ORDER_ANY, powernv_setup_nmmu, NULL); From owner-svn-src-head@freebsd.org Sun Dec 15 21:26:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E8391CFC5C; Sun, 15 Dec 2019 21:26:54 +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 47bct62wY6z402g; Sun, 15 Dec 2019 21:26:54 +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 5A74B1B292; Sun, 15 Dec 2019 21:26:54 +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 xBFLQsHT037459; Sun, 15 Dec 2019 21:26:54 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBFLQoJ7037440; Sun, 15 Dec 2019 21:26:50 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201912152126.xBFLQoJ7037440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 15 Dec 2019 21:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355784 - in head/sys: compat/linuxkpi/common/src dev/dpaa kern mips/nlm sys X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/src dev/dpaa kern mips/nlm sys X-SVN-Commit-Revision: 355784 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 21:26:54 -0000 Author: jeff Date: Sun Dec 15 21:26:50 2019 New Revision: 355784 URL: https://svnweb.freebsd.org/changeset/base/355784 Log: schedlock 4/4 Don't hold the scheduler lock while doing context switches. Instead we unlock after selecting the new thread and switch within a spinlock section leaving interrupts and preemption disabled to prevent local concurrency. This means that mi_switch() is entered with the thread locked but returns without. This dramatically simplifies scheduler locking because we will not hold the schedlock while spinning on blocked lock in switch. This change has not been made to 4BSD but in principle it would be more straightforward. Discussed with: markj Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D22778 Modified: head/sys/compat/linuxkpi/common/src/linux_rcu.c head/sys/dev/dpaa/bman_portals.c head/sys/dev/dpaa/qman_portals.c head/sys/kern/kern_intr.c head/sys/kern/kern_poll.c head/sys/kern/kern_switch.c head/sys/kern/kern_synch.c head/sys/kern/kern_thread.c head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c head/sys/kern/subr_epoch.c head/sys/kern/subr_sleepqueue.c head/sys/kern/subr_trap.c head/sys/kern/subr_turnstile.c head/sys/kern/vfs_bio.c head/sys/mips/nlm/cms.c head/sys/sys/proc.h head/sys/sys/sched.h Modified: head/sys/compat/linuxkpi/common/src/linux_rcu.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_rcu.c Sun Dec 15 21:20:18 2019 (r355783) +++ head/sys/compat/linuxkpi/common/src/linux_rcu.c Sun Dec 15 21:26:50 2019 (r355784) @@ -258,15 +258,7 @@ linux_synchronize_rcu_cb(ck_epoch_t *epoch __unused, c /* set new thread priority */ sched_prio(td, prio); /* task switch */ - mi_switch(SW_VOL | SWT_RELINQUISH, NULL); - - /* - * Release the thread lock while yielding to - * allow other threads to acquire the lock - * pointed to by TDQ_LOCKPTR(td). Else a - * deadlock like situation might happen. - */ - thread_unlock(td); + mi_switch(SW_VOL | SWT_RELINQUISH); thread_lock(td); } } else { Modified: head/sys/dev/dpaa/bman_portals.c ============================================================================== --- head/sys/dev/dpaa/bman_portals.c Sun Dec 15 21:20:18 2019 (r355783) +++ head/sys/dev/dpaa/bman_portals.c Sun Dec 15 21:26:50 2019 (r355784) @@ -142,8 +142,7 @@ bman_portal_setup(struct bman_softc *bsc) /* Not inititialized and "owned" by another thread */ thread_lock(curthread); - mi_switch(SW_VOL, NULL); - thread_unlock(curthread); + mi_switch(SW_VOL); } /* Map portal registers */ Modified: head/sys/dev/dpaa/qman_portals.c ============================================================================== --- head/sys/dev/dpaa/qman_portals.c Sun Dec 15 21:20:18 2019 (r355783) +++ head/sys/dev/dpaa/qman_portals.c Sun Dec 15 21:26:50 2019 (r355784) @@ -147,8 +147,7 @@ qman_portal_setup(struct qman_softc *qsc) /* Not inititialized and "owned" by another thread */ thread_lock(curthread); - mi_switch(SW_VOL, NULL); - thread_unlock(curthread); + mi_switch(SW_VOL); } /* Map portal registers */ Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Sun Dec 15 21:20:18 2019 (r355783) +++ head/sys/kern/kern_intr.c Sun Dec 15 21:26:50 2019 (r355784) @@ -1251,13 +1251,14 @@ ithread_loop(void *arg) (ithd->it_flags & (IT_DEAD | IT_WAIT)) == 0) { TD_SET_IWAIT(td); ie->ie_count = 0; - mi_switch(SW_VOL | SWT_IWAIT, NULL); + mi_switch(SW_VOL | SWT_IWAIT); + } else { + if (ithd->it_flags & IT_WAIT) { + wake = 1; + ithd->it_flags &= ~IT_WAIT; + } + thread_unlock(td); } - if (ithd->it_flags & IT_WAIT) { - wake = 1; - ithd->it_flags &= ~IT_WAIT; - } - thread_unlock(td); if (wake) { wakeup(ithd); wake = 0; Modified: head/sys/kern/kern_poll.c ============================================================================== --- head/sys/kern/kern_poll.c Sun Dec 15 21:20:18 2019 (r355783) +++ head/sys/kern/kern_poll.c Sun Dec 15 21:26:50 2019 (r355784) @@ -557,8 +557,7 @@ poll_idle(void) idlepoll_sleeping = 0; ether_poll(poll_each_burst); thread_lock(td); - mi_switch(SW_VOL, NULL); - thread_unlock(td); + mi_switch(SW_VOL); } else { idlepoll_sleeping = 1; tsleep(&idlepoll_sleeping, 0, "pollid", hz * 3); Modified: head/sys/kern/kern_switch.c ============================================================================== --- head/sys/kern/kern_switch.c Sun Dec 15 21:20:18 2019 (r355783) +++ head/sys/kern/kern_switch.c Sun Dec 15 21:26:50 2019 (r355784) @@ -240,8 +240,7 @@ critical_exit_preempt(void) flags |= SWT_IDLE; else flags |= SWT_OWEPREEMPT; - mi_switch(flags, NULL); - thread_unlock(td); + mi_switch(flags); } void Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Sun Dec 15 21:20:18 2019 (r355783) +++ head/sys/kern/kern_synch.c Sun Dec 15 21:26:50 2019 (r355784) @@ -464,9 +464,11 @@ kdb_switch(void) /* * The machine independent parts of context switching. + * + * The thread lock is required on entry and is no longer held on return. */ void -mi_switch(int flags, struct thread *newtd) +mi_switch(int flags) { uint64_t runtime, new_switchtime; struct thread *td; @@ -482,7 +484,6 @@ mi_switch(int flags, struct thread *newtd) ("mi_switch: switch in a critical section")); KASSERT((flags & (SW_INVOL | SW_VOL)) != 0, ("mi_switch: switch must be voluntary or involuntary")); - KASSERT(newtd != curthread, ("mi_switch: preempting back to ourself")); /* * Don't perform context switches from the debugger. @@ -521,7 +522,7 @@ mi_switch(int flags, struct thread *newtd) (flags & SW_TYPE_MASK) == SWT_NEEDRESCHED))) SDT_PROBE0(sched, , , preempt); #endif - sched_switch(td, newtd, flags); + sched_switch(td, flags); CTR4(KTR_PROC, "mi_switch: new thread %ld (td_sched %p, pid %ld, %s)", td->td_tid, td_get_sched(td), td->td_proc->p_pid, td->td_name); @@ -532,6 +533,7 @@ mi_switch(int flags, struct thread *newtd) PCPU_SET(deadthread, NULL); thread_stash(td); } + spinlock_exit(); } /* @@ -646,8 +648,7 @@ kern_yield(int prio) prio = td->td_user_pri; if (prio >= 0) sched_prio(td, prio); - mi_switch(SW_VOL | SWT_RELINQUISH, NULL); - thread_unlock(td); + mi_switch(SW_VOL | SWT_RELINQUISH); PICKUP_GIANT(); } @@ -661,8 +662,7 @@ sys_yield(struct thread *td, struct yield_args *uap) thread_lock(td); if (PRI_BASE(td->td_pri_class) == PRI_TIMESHARE) sched_prio(td, PRI_MAX_TIMESHARE); - mi_switch(SW_VOL | SWT_RELINQUISH, NULL); - thread_unlock(td); + mi_switch(SW_VOL | SWT_RELINQUISH); td->td_retval[0] = 0; return (0); } Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Sun Dec 15 21:20:18 2019 (r355783) +++ head/sys/kern/kern_thread.c Sun Dec 15 21:26:50 2019 (r355784) @@ -1068,8 +1068,7 @@ thread_suspend_check(int return_instead) td->td_flags |= TDF_BOUNDARY; } PROC_SUNLOCK(p); - mi_switch(SW_INVOL | SWT_SUSPEND, NULL); - thread_unlock(td); + mi_switch(SW_INVOL | SWT_SUSPEND); PROC_LOCK(p); } return (0); @@ -1097,8 +1096,7 @@ thread_suspend_switch(struct thread *td, struct proc * sched_sleep(td, 0); PROC_SUNLOCK(p); DROP_GIANT(); - mi_switch(SW_VOL | SWT_SUSPEND, NULL); - thread_unlock(td); + mi_switch(SW_VOL | SWT_SUSPEND); PICKUP_GIANT(); PROC_LOCK(p); PROC_SLOCK(p); Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Sun Dec 15 21:20:18 2019 (r355783) +++ head/sys/kern/sched_4bsd.c Sun Dec 15 21:26:50 2019 (r355784) @@ -671,7 +671,7 @@ schedinit(void) */ thread0.td_lock = &sched_lock; td_get_sched(&thread0)->ts_slice = sched_slice; - mtx_init(&sched_lock, "sched lock", NULL, MTX_SPIN | MTX_RECURSE); + mtx_init(&sched_lock, "sched lock", NULL, MTX_SPIN); } int @@ -973,8 +973,9 @@ sched_sleep(struct thread *td, int pri) } void -sched_switch(struct thread *td, struct thread *newtd, int flags) +sched_switch(struct thread *td, int flags) { + struct thread *newtd; struct mtx *tmtx; struct td_sched *ts; struct proc *p; @@ -1027,25 +1028,7 @@ sched_switch(struct thread *td, struct thread *newtd, if ((td->td_flags & TDF_NOLOAD) == 0) sched_load_rem(); - if (newtd) { - /* - * The thread we are about to run needs to be counted - * as if it had been added to the run queue and selected. - * It came from: - * * A preemption - * * An upcall - * * A followon - */ - KASSERT((newtd->td_inhibitors == 0), - ("trying to run inhibited thread")); - newtd->td_flags |= TDF_DIDRUN; - TD_SET_RUNNING(newtd); - if ((newtd->td_flags & TDF_NOLOAD) == 0) - sched_load_add(); - } else { - newtd = choosethread(); - } - + newtd = choosethread(); MPASS(newtd->td_lock == &sched_lock); #if (KTR_COMPILE & KTR_SCHED) != 0 @@ -1117,7 +1100,8 @@ sched_switch(struct thread *td, struct thread *newtd, #endif sched_lock.mtx_lock = (uintptr_t)td; td->td_oncpu = PCPU_GET(cpuid); - MPASS(td->td_lock == &sched_lock); + spinlock_enter(); + mtx_unlock_spin(&sched_lock); } void @@ -1517,12 +1501,12 @@ sched_preempt(struct thread *td) { SDT_PROBE2(sched, , , surrender, td, td->td_proc); - thread_lock(td); - if (td->td_critnest > 1) + if (td->td_critnest > 1) { td->td_owepreempt = 1; - else - mi_switch(SW_INVOL | SW_PREEMPT | SWT_PREEMPT, NULL); - thread_unlock(td); + } else { + thread_lock(td); + mi_switch(SW_INVOL | SW_PREEMPT | SWT_PREEMPT); + } } void @@ -1551,7 +1535,8 @@ sched_bind(struct thread *td, int cpu) if (PCPU_GET(cpuid) == cpu) return; - mi_switch(SW_VOL, NULL); + mi_switch(SW_VOL); + thread_lock(td); #endif } @@ -1574,8 +1559,7 @@ void sched_relinquish(struct thread *td) { thread_lock(td); - mi_switch(SW_VOL | SWT_RELINQUISH, NULL); - thread_unlock(td); + mi_switch(SW_VOL | SWT_RELINQUISH); } int @@ -1666,8 +1650,7 @@ sched_idletd(void *dummy) } mtx_lock_spin(&sched_lock); - mi_switch(SW_VOL | SWT_IDLE, NULL); - mtx_unlock_spin(&sched_lock); + mi_switch(SW_VOL | SWT_IDLE); } } Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Sun Dec 15 21:20:18 2019 (r355783) +++ head/sys/kern/sched_ule.c Sun Dec 15 21:26:50 2019 (r355784) @@ -332,7 +332,6 @@ static void sched_balance(void); static int sched_balance_pair(struct tdq *, struct tdq *); static inline struct tdq *sched_setcpu(struct thread *, int, int); static inline void thread_unblock_switch(struct thread *, struct mtx *); -static struct mtx *sched_switch_migrate(struct tdq *, struct thread *, int); static int sysctl_kern_sched_topology_spec(SYSCTL_HANDLER_ARGS); static int sysctl_kern_sched_topology_spec_internal(struct sbuf *sb, struct cpu_group *cg, int indent); @@ -1058,8 +1057,7 @@ tdq_idled(struct tdq *tdq) tdq_unlock_pair(tdq, steal); } TDQ_UNLOCK(steal); - mi_switch(SW_VOL | SWT_IDLE, NULL); - thread_unlock(curthread); + mi_switch(SW_VOL | SWT_IDLE); return (0); } @@ -2005,8 +2003,10 @@ static struct mtx * sched_switch_migrate(struct tdq *tdq, struct thread *td, int flags) { struct tdq *tdn; - struct mtx *mtx; + KASSERT(THREAD_CAN_MIGRATE(td) || + (td_get_sched(td)->ts_flags & TSF_BOUND) != 0, + ("Thread %p shouldn't migrate", td)); KASSERT(!CPU_ABSENT(td_get_sched(td)->ts_cpu), ("sched_switch_migrate: " "thread %s queued on absent CPU %d.", td->td_name, td_get_sched(td)->ts_cpu)); @@ -2014,27 +2014,16 @@ sched_switch_migrate(struct tdq *tdq, struct thread *t #ifdef SMP tdq_load_rem(tdq, td); /* - * Do the lock dance required to avoid LOR. We grab an extra - * spinlock nesting to prevent preemption while we're - * not holding either run-queue lock. + * Do the lock dance required to avoid LOR. We have an + * extra spinlock nesting from sched_switch() which will + * prevent preemption while we're holding neither run-queue lock. */ - spinlock_enter(); - mtx = thread_lock_block(td); - mtx_unlock_spin(mtx); - - /* - * Acquire both run-queue locks before placing the thread on the new - * run-queue to avoid deadlocks created by placing a thread with a - * blocked lock on the run-queue of a remote processor. The deadlock - * occurs when a third processor attempts to lock the two queues in - * question while the target processor is spinning with its own - * run-queue lock held while waiting for the blocked lock to clear. - */ - tdq_lock_pair(tdn, tdq); + TDQ_UNLOCK(tdq); + TDQ_LOCK(tdn); tdq_add(tdn, td, flags); tdq_notify(tdn, td); TDQ_UNLOCK(tdn); - spinlock_exit(); + TDQ_LOCK(tdq); #endif return (TDQ_LOCKPTR(tdn)); } @@ -2056,8 +2045,9 @@ thread_unblock_switch(struct thread *td, struct mtx *m * be assigned elsewhere via binding. */ void -sched_switch(struct thread *td, struct thread *newtd, int flags) +sched_switch(struct thread *td, int flags) { + struct thread *newtd; struct tdq *tdq; struct td_sched *ts; struct mtx *mtx; @@ -2065,16 +2055,13 @@ sched_switch(struct thread *td, struct thread *newtd, int cpuid, preempted; THREAD_LOCK_ASSERT(td, MA_OWNED); - KASSERT(newtd == NULL, ("sched_switch: Unsupported newtd argument")); cpuid = PCPU_GET(cpuid); tdq = TDQ_SELF(); ts = td_get_sched(td); - mtx = td->td_lock; sched_pctcpu_update(ts, 1); ts->ts_rltick = ticks; td->td_lastcpu = td->td_oncpu; - td->td_oncpu = NOCPU; preempted = (td->td_flags & TDF_SLICEEND) == 0 && (flags & SW_PREEMPT) != 0; td->td_flags &= ~(TDF_NEEDRESCHED | TDF_SLICEEND); @@ -2084,14 +2071,15 @@ sched_switch(struct thread *td, struct thread *newtd, tdq->tdq_switchcnt++; /* - * The lock pointer in an idle thread should never change. Reset it - * to CAN_RUN as well. + * Always block the thread lock so we can drop the tdq lock early. */ + mtx = thread_lock_block(td); + spinlock_enter(); if (TD_IS_IDLETHREAD(td)) { - MPASS(td->td_lock == TDQ_LOCKPTR(tdq)); + MPASS(mtx == TDQ_LOCKPTR(tdq)); TD_SET_CAN_RUN(td); } else if (TD_IS_RUNNING(td)) { - MPASS(td->td_lock == TDQ_LOCKPTR(tdq)); + MPASS(mtx == TDQ_LOCKPTR(tdq)); srqflag = preempted ? SRQ_OURSELF|SRQ_YIELDING|SRQ_PREEMPTED : SRQ_OURSELF|SRQ_YIELDING; @@ -2101,20 +2089,13 @@ sched_switch(struct thread *td, struct thread *newtd, #endif if (ts->ts_cpu == cpuid) tdq_runq_add(tdq, td, srqflag); - else { - KASSERT(THREAD_CAN_MIGRATE(td) || - (ts->ts_flags & TSF_BOUND) != 0, - ("Thread %p shouldn't migrate", td)); + else mtx = sched_switch_migrate(tdq, td, srqflag); - } } else { /* This thread must be going to sleep. */ - mtx = thread_lock_block(td); if (mtx != TDQ_LOCKPTR(tdq)) { - spinlock_enter(); mtx_unlock_spin(mtx); TDQ_LOCK(tdq); - spinlock_exit(); } tdq_load_rem(tdq, td); #ifdef SMP @@ -2140,6 +2121,9 @@ sched_switch(struct thread *td, struct thread *newtd, */ TDQ_LOCK_ASSERT(tdq, MA_OWNED | MA_NOTRECURSED); newtd = choosethread(); + sched_pctcpu_update(td_get_sched(newtd), 0); + TDQ_UNLOCK(tdq); + /* * Call the MD code to switch contexts if necessary. */ @@ -2149,9 +2133,6 @@ sched_switch(struct thread *td, struct thread *newtd, PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); #endif SDT_PROBE2(sched, , , off__cpu, newtd, newtd->td_proc); - lock_profile_release_lock(&TDQ_LOCKPTR(tdq)->lock_object); - TDQ_LOCKPTR(tdq)->mtx_lock = (uintptr_t)newtd; - sched_pctcpu_update(td_get_sched(newtd), 0); #ifdef KDTRACE_HOOKS /* @@ -2162,17 +2143,9 @@ sched_switch(struct thread *td, struct thread *newtd, if (dtrace_vtime_active) (*dtrace_vtime_switch_func)(newtd); #endif - + td->td_oncpu = NOCPU; cpu_switch(td, newtd, mtx); - /* - * We may return from cpu_switch on a different cpu. However, - * we always return with td_lock pointing to the current cpu's - * run queue lock. - */ - cpuid = PCPU_GET(cpuid); - tdq = TDQ_SELF(); - lock_profile_obtain_lock_success( - &TDQ_LOCKPTR(tdq)->lock_object, 0, 0, __FILE__, __LINE__); + cpuid = td->td_oncpu = PCPU_GET(cpuid); SDT_PROBE0(sched, , , on__cpu); #ifdef HWPMC_HOOKS @@ -2183,16 +2156,11 @@ sched_switch(struct thread *td, struct thread *newtd, thread_unblock_switch(td, mtx); SDT_PROBE0(sched, , , remain__cpu); } + KASSERT(curthread->td_md.md_spinlock_count == 1, + ("invalid count %d", curthread->td_md.md_spinlock_count)); KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "running", "prio:%d", td->td_priority); - - /* - * Assert that all went well and return. - */ - TDQ_LOCK_ASSERT(tdq, MA_OWNED|MA_NOTRECURSED); - MPASS(td->td_lock == TDQ_LOCKPTR(tdq)); - td->td_oncpu = cpuid; } /* @@ -2390,6 +2358,7 @@ void sched_preempt(struct thread *td) { struct tdq *tdq; + int flags; SDT_PROBE2(sched, , , surrender, td, td->td_proc); @@ -2397,15 +2366,15 @@ sched_preempt(struct thread *td) tdq = TDQ_SELF(); TDQ_LOCK_ASSERT(tdq, MA_OWNED); if (td->td_priority > tdq->tdq_lowpri) { - int flags; - - flags = SW_INVOL | SW_PREEMPT; - if (td->td_critnest > 1) - td->td_owepreempt = 1; - else if (TD_IS_IDLETHREAD(td)) - mi_switch(flags | SWT_REMOTEWAKEIDLE, NULL); - else - mi_switch(flags | SWT_REMOTEPREEMPT, NULL); + if (td->td_critnest == 1) { + flags = SW_INVOL | SW_PREEMPT; + flags |= TD_IS_IDLETHREAD(td) ? SWT_REMOTEWAKEIDLE : + SWT_REMOTEPREEMPT; + mi_switch(flags); + /* Switch dropped thread lock. */ + return; + } + td->td_owepreempt = 1; } else { tdq->tdq_owepreempt = 0; } @@ -2756,7 +2725,8 @@ sched_bind(struct thread *td, int cpu) return; ts->ts_cpu = cpu; /* When we return from mi_switch we'll be on the correct cpu. */ - mi_switch(SW_VOL, NULL); + mi_switch(SW_VOL); + thread_lock(td); } /* @@ -2790,8 +2760,7 @@ void sched_relinquish(struct thread *td) { thread_lock(td); - mi_switch(SW_VOL | SWT_RELINQUISH, NULL); - thread_unlock(td); + mi_switch(SW_VOL | SWT_RELINQUISH); } /* @@ -2851,8 +2820,7 @@ sched_idletd(void *dummy) for (;;) { if (tdq->tdq_load) { thread_lock(td); - mi_switch(SW_VOL | SWT_IDLE, NULL); - thread_unlock(td); + mi_switch(SW_VOL | SWT_IDLE); } switchcnt = tdq->tdq_switchcnt + tdq->tdq_oldswitchcnt; #ifdef SMP @@ -2938,17 +2906,18 @@ sched_throw(struct thread *td) PCPU_SET(switchticks, ticks); PCPU_GET(idlethread)->td_lock = TDQ_LOCKPTR(tdq); } else { - THREAD_LOCK_ASSERT(td, MA_OWNED); tdq = TDQ_SELF(); - MPASS(td->td_lock == TDQ_LOCKPTR(tdq)); + THREAD_LOCK_ASSERT(td, MA_OWNED); + THREAD_LOCKPTR_ASSERT(td, TDQ_LOCKPTR(tdq)); tdq_load_rem(tdq, td); - lock_profile_release_lock(&TDQ_LOCKPTR(tdq)->lock_object); td->td_lastcpu = td->td_oncpu; td->td_oncpu = NOCPU; } - KASSERT(curthread->td_md.md_spinlock_count == 1, ("invalid count")); newtd = choosethread(); - TDQ_LOCKPTR(tdq)->mtx_lock = (uintptr_t)newtd; + 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 */ } @@ -2966,14 +2935,14 @@ sched_fork_exit(struct thread *td) * Finish setting up thread glue so that it begins execution in a * non-nested critical section with the scheduler lock held. */ + KASSERT(curthread->td_md.md_spinlock_count == 1, + ("invalid count %d", curthread->td_md.md_spinlock_count)); cpuid = PCPU_GET(cpuid); tdq = TDQ_SELF(); + TDQ_LOCK(tdq); + spinlock_exit(); MPASS(td->td_lock == TDQ_LOCKPTR(tdq)); td->td_oncpu = cpuid; - TDQ_LOCK_ASSERT(tdq, MA_OWNED | MA_NOTRECURSED); - lock_profile_obtain_lock_success( - &TDQ_LOCKPTR(tdq)->lock_object, 0, 0, __FILE__, __LINE__); - KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "running", "prio:%d", td->td_priority); SDT_PROBE0(sched, , , on__cpu); Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Sun Dec 15 21:20:18 2019 (r355783) +++ head/sys/kern/subr_epoch.c Sun Dec 15 21:26:50 2019 (r355784) @@ -577,15 +577,7 @@ epoch_block_handler_preempt(struct ck_epoch *global __ * so we have nothing to do except context switch away. */ counter_u64_add(switch_count, 1); - mi_switch(SW_VOL | SWT_RELINQUISH, NULL); - - /* - * Release the thread lock while yielding to - * allow other threads to acquire the lock - * pointed to by TDQ_LOCKPTR(td). Else a - * deadlock like situation might happen. (HPS) - */ - thread_unlock(td); + mi_switch(SW_VOL | SWT_RELINQUISH); thread_lock(td); } Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Sun Dec 15 21:20:18 2019 (r355783) +++ head/sys/kern/subr_sleepqueue.c Sun Dec 15 21:26:50 2019 (r355784) @@ -546,8 +546,10 @@ out: sq = sleepq_lookup(wchan); sleepq_remove_thread(sq, td); } - mtx_unlock_spin(&sc->sc_lock); MPASS(td->td_lock != &sc->sc_lock); + mtx_unlock_spin(&sc->sc_lock); + thread_unlock(td); + return (ret); } @@ -574,6 +576,7 @@ sleepq_switch(void *wchan, int pri) */ if (td->td_sleepqueue != NULL) { mtx_unlock_spin(&sc->sc_lock); + thread_unlock(td); return; } @@ -605,6 +608,7 @@ sleepq_switch(void *wchan, int pri) sq = sleepq_lookup(wchan); sleepq_remove_thread(sq, td); mtx_unlock_spin(&sc->sc_lock); + thread_unlock(td); return; } #ifdef SLEEPQUEUE_PROFILING @@ -616,7 +620,7 @@ sleepq_switch(void *wchan, int pri) thread_lock_set(td, &sc->sc_lock); SDT_PROBE0(sched, , , sleep); TD_SET_SLEEPING(td); - mi_switch(SW_VOL | SWT_SLEEPQ, NULL); + mi_switch(SW_VOL | SWT_SLEEPQ); KASSERT(TD_IS_RUNNING(td), ("running but not TDS_RUNNING")); CTR3(KTR_PROC, "sleepq resume: thread %p (pid %ld, %s)", (void *)td, (long)td->td_proc->p_pid, (void *)td->td_name); @@ -668,7 +672,6 @@ sleepq_wait(void *wchan, int pri) MPASS(!(td->td_flags & TDF_SINTR)); thread_lock(td); sleepq_switch(wchan, pri); - thread_unlock(td); } /* @@ -681,7 +684,6 @@ sleepq_wait_sig(void *wchan, int pri) int rcatch; rcatch = sleepq_catch_signals(wchan, pri); - thread_unlock(curthread); if (rcatch) return (rcatch); return (sleepq_check_signals()); @@ -698,9 +700,9 @@ sleepq_timedwait(void *wchan, int pri) td = curthread; MPASS(!(td->td_flags & TDF_SINTR)); + thread_lock(td); sleepq_switch(wchan, pri); - thread_unlock(td); return (sleepq_check_timeout()); } @@ -715,8 +717,6 @@ sleepq_timedwait_sig(void *wchan, int pri) int rcatch, rvalt, rvals; rcatch = sleepq_catch_signals(wchan, pri); - thread_unlock(curthread); - /* We must always call check_timeout() to clear sleeptimo. */ rvalt = sleepq_check_timeout(); rvals = sleepq_check_signals(); Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Sun Dec 15 21:20:18 2019 (r355783) +++ head/sys/kern/subr_trap.c Sun Dec 15 21:26:50 2019 (r355784) @@ -280,8 +280,7 @@ ast(struct trapframe *framep) #endif thread_lock(td); sched_prio(td, td->td_user_pri); - mi_switch(SW_INVOL | SWT_NEEDRESCHED, NULL); - thread_unlock(td); + mi_switch(SW_INVOL | SWT_NEEDRESCHED); #ifdef KTRACE if (KTRPOINT(td, KTR_CSW)) ktrcsw(0, 1, __func__); Modified: head/sys/kern/subr_turnstile.c ============================================================================== --- head/sys/kern/subr_turnstile.c Sun Dec 15 21:20:18 2019 (r355783) +++ head/sys/kern/subr_turnstile.c Sun Dec 15 21:26:50 2019 (r355784) @@ -813,12 +813,11 @@ turnstile_wait(struct turnstile *ts, struct thread *ow SDT_PROBE0(sched, , , sleep); THREAD_LOCKPTR_ASSERT(td, &ts->ts_lock); - mi_switch(SW_VOL | SWT_TURNSTILE, NULL); + mi_switch(SW_VOL | SWT_TURNSTILE); if (LOCK_LOG_TEST(lock, 0)) CTR4(KTR_LOCK, "%s: td %d free from blocked on [%p] %s", __func__, td->td_tid, lock, lock->lo_name); - thread_unlock(td); } /* Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sun Dec 15 21:20:18 2019 (r355783) +++ head/sys/kern/vfs_bio.c Sun Dec 15 21:26:50 2019 (r355784) @@ -1383,8 +1383,7 @@ bufshutdown(int show_busybufs) */ for (subiter = 0; subiter < 50 * iter; subiter++) { thread_lock(curthread); - mi_switch(SW_VOL, NULL); - thread_unlock(curthread); + mi_switch(SW_VOL); DELAY(1000); } #endif Modified: head/sys/mips/nlm/cms.c ============================================================================== --- head/sys/mips/nlm/cms.c Sun Dec 15 21:20:18 2019 (r355783) +++ head/sys/mips/nlm/cms.c Sun Dec 15 21:26:50 2019 (r355784) @@ -356,8 +356,7 @@ msgring_process(void * arg) } sched_class(td, PRI_ITHD); TD_SET_IWAIT(td); - mi_switch(SW_VOL, NULL); - thread_unlock(td); + mi_switch(SW_VOL); } else pause("wmsg", 1); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sun Dec 15 21:20:18 2019 (r355783) +++ head/sys/sys/proc.h Sun Dec 15 21:26:50 2019 (r355784) @@ -1075,7 +1075,7 @@ void killjobc(void); int leavepgrp(struct proc *p); int maybe_preempt(struct thread *td); void maybe_yield(void); -void mi_switch(int flags, struct thread *newtd); +void mi_switch(int flags); int p_candebug(struct thread *td, struct proc *p); int p_cansee(struct thread *td, struct proc *p); int p_cansched(struct thread *td, struct proc *p); Modified: head/sys/sys/sched.h ============================================================================== --- head/sys/sys/sched.h Sun Dec 15 21:20:18 2019 (r355783) +++ head/sys/sys/sched.h Sun Dec 15 21:26:50 2019 (r355784) @@ -100,7 +100,7 @@ void sched_lend_user_prio_cond(struct thread *td, u_ch fixpt_t sched_pctcpu(struct thread *td); void sched_prio(struct thread *td, u_char prio); void sched_sleep(struct thread *td, int prio); -void sched_switch(struct thread *td, struct thread *newtd, int flags); +void sched_switch(struct thread *td, int flags); void sched_throw(struct thread *td); void sched_unlend_prio(struct thread *td, u_char prio); void sched_user_prio(struct thread *td, u_char prio); From owner-svn-src-head@freebsd.org Sun Dec 15 21:52:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3EA51D0638; Sun, 15 Dec 2019 21:52:40 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47bdRr4b5rz41gR; Sun, 15 Dec 2019 21:52:40 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E84B1B7EF; Sun, 15 Dec 2019 21:52:40 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBFLqeU0055580; Sun, 15 Dec 2019 21:52:40 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBFLqeVE055578; Sun, 15 Dec 2019 21:52:40 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201912152152.xBFLqeVE055578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 15 Dec 2019 21:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355786 - in head: stand/libsa/zfs sys/cddl/boot/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head: stand/libsa/zfs sys/cddl/boot/zfs X-SVN-Commit-Revision: 355786 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 21:52:40 -0000 Author: tsoome Date: Sun Dec 15 21:52:40 2019 New Revision: 355786 URL: https://svnweb.freebsd.org/changeset/base/355786 Log: loader: rewrite zfs vdev initialization In some cases the pool discovery will get stuck in infinite loop while setting up the vdev children. To fix, we split the vdev setup into two parts, first we create vdevs based on configuration we do get from pool label, then, we process pool config from MOS and update the pool config if needed. Testing done: confirm previously hung loader is not hung any more. MFC after: 1 week Modified: head/stand/libsa/zfs/zfsimpl.c head/sys/cddl/boot/zfs/zfsimpl.h head/sys/cddl/boot/zfs/zfssubr.c Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Sun Dec 15 21:28:08 2019 (r355785) +++ head/stand/libsa/zfs/zfsimpl.c Sun Dec 15 21:52:40 2019 (r355786) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "zfsimpl.h" #include "zfssubr.c" @@ -247,7 +248,7 @@ nvlist_find(const unsigned char *nvlist, const char *n const char *pairname; xdr_int(&p, &namelen); - pairname = (const char*)p; + pairname = (const char *)p; p += roundup(namelen, 4); xdr_int(&p, &pairtype); @@ -261,12 +262,12 @@ nvlist_find(const unsigned char *nvlist, const char *n } else if (type == DATA_TYPE_STRING) { int len; xdr_int(&p, &len); - (*(const char**)valuep) = (const char*)p; + (*(const char **)valuep) = (const char *)p; return (0); } else if (type == DATA_TYPE_NVLIST || type == DATA_TYPE_NVLIST_ARRAY) { - (*(const unsigned char**)valuep) = - (const unsigned char*)p; + (*(const unsigned char **)valuep) = + (const unsigned char *)p; return (0); } else { return (EIO); @@ -312,7 +313,7 @@ nvlist_check_features_for_read(const unsigned char *nv found = 0; xdr_int(&p, &namelen); - pairname = (const char*)p; + pairname = (const char *)p; p += roundup(namelen, 4); xdr_int(&p, &pairtype); @@ -419,7 +420,7 @@ nvlist_print(const unsigned char *nvlist, unsigned int const char *pairname; xdr_int(&p, &namelen); - pairname = (const char*)p; + pairname = (const char *)p; p += roundup(namelen, 4); xdr_int(&p, &pairtype); @@ -494,12 +495,12 @@ vdev_read_phys(vdev_t *vdev, const blkptr_t *bp, void } rc = vdev->v_phys_read(vdev, vdev->v_read_priv, offset, buf, psize); - if (rc) - return (rc); - if (bp != NULL) - return (zio_checksum_verify(vdev->spa, bp, buf)); + if (rc == 0) { + if (bp != NULL) + rc = zio_checksum_verify(vdev->v_spa, bp, buf); + } - return (0); + return (rc); } typedef struct remap_segment { @@ -567,6 +568,7 @@ vdev_indirect_mapping_open(spa_t *spa, objset_phys_t * vim->vim_havecounts = (vim->vim_dn->dn_bonuslen > VDEV_INDIRECT_MAPPING_SIZE_V0); + return (vim); } @@ -777,8 +779,10 @@ static vdev_t * vdev_lookup_top(spa_t *spa, uint64_t vdev) { vdev_t *rvd; + vdev_list_t *vlist; - STAILQ_FOREACH(rvd, &spa->spa_vdevs, v_childlink) + vlist = &spa->spa_root_vdev->v_children; + STAILQ_FOREACH(rvd, vlist, v_childlink) if (rvd->v_id == vdev) break; @@ -841,7 +845,7 @@ static void vdev_indirect_remap(vdev_t *vd, uint64_t offset, uint64_t asize, void *arg) { list_t stack; - spa_t *spa = vd->spa; + spa_t *spa = vd->v_spa; zio_t *zio = arg; remap_segment_t *rs; @@ -899,7 +903,6 @@ vdev_indirect_remap(vdev_t *vd, uint64_t offset, uint6 */ if (zio->io_error != 0) break; - rs->rs_offset += inner_size; rs->rs_asize -= inner_size; rs->rs_split_offset += inner_size; @@ -935,19 +938,20 @@ static int vdev_indirect_read(vdev_t *vdev, const blkptr_t *bp, void *buf, off_t offset, size_t bytes) { - zio_t zio = { 0 }; - spa_t *spa = vdev->spa; - indirect_vsd_t *iv = malloc(sizeof (*iv)); + zio_t zio; + spa_t *spa = vdev->v_spa; + indirect_vsd_t *iv; indirect_split_t *first; int rc = EIO; + iv = calloc(1, sizeof(*iv)); if (iv == NULL) return (ENOMEM); - bzero(iv, sizeof (*iv)); list_create(&iv->iv_splits, sizeof (indirect_split_t), offsetof(indirect_split_t, is_node)); + bzero(&zio, sizeof(zio)); zio.io_spa = spa; zio.io_bp = (blkptr_t *)bp; zio.io_data = buf; @@ -1086,40 +1090,72 @@ vdev_create(uint64_t guid, vdev_read_t *_read) vdev_t *vdev; vdev_indirect_config_t *vic; - vdev = malloc(sizeof(vdev_t)); - memset(vdev, 0, sizeof(vdev_t)); - STAILQ_INIT(&vdev->v_children); - vdev->v_guid = guid; - vdev->v_state = VDEV_STATE_OFFLINE; - vdev->v_read = _read; + vdev = calloc(1, sizeof(vdev_t)); + if (vdev != NULL) { + STAILQ_INIT(&vdev->v_children); + vdev->v_guid = guid; + vdev->v_read = _read; - vic = &vdev->vdev_indirect_config; - vic->vic_prev_indirect_vdev = UINT64_MAX; - STAILQ_INSERT_TAIL(&zfs_vdevs, vdev, v_alllink); + /* + * root vdev has no read function. + * We only point root vdev from spa. + */ + if (_read != NULL) { + vic = &vdev->vdev_indirect_config; + vic->vic_prev_indirect_vdev = UINT64_MAX; + STAILQ_INSERT_TAIL(&zfs_vdevs, vdev, v_alllink); + } + } return (vdev); } -static int -vdev_init_from_nvlist(const unsigned char *nvlist, vdev_t *pvdev, - vdev_t **vdevp, int is_newer) +static void +vdev_set_initial_state(vdev_t *vdev, const unsigned char *nvlist) { - int rc; - uint64_t guid, id, ashift, asize, nparity; - const char *type; - const char *path; - vdev_t *vdev, *kid; - const unsigned char *kids; - int nkids, i, is_new; uint64_t is_offline, is_faulted, is_degraded, is_removed, isnt_present; uint64_t is_log; - if (nvlist_find(nvlist, ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64, - NULL, &guid) - || nvlist_find(nvlist, ZPOOL_CONFIG_ID, DATA_TYPE_UINT64, NULL, &id) - || nvlist_find(nvlist, ZPOOL_CONFIG_TYPE, DATA_TYPE_STRING, + is_offline = is_removed = is_faulted = is_degraded = isnt_present = 0; + is_log = 0; + (void) nvlist_find(nvlist, ZPOOL_CONFIG_OFFLINE, DATA_TYPE_UINT64, NULL, + &is_offline); + (void) nvlist_find(nvlist, ZPOOL_CONFIG_REMOVED, DATA_TYPE_UINT64, NULL, + &is_removed); + (void) nvlist_find(nvlist, ZPOOL_CONFIG_FAULTED, DATA_TYPE_UINT64, NULL, + &is_faulted); + (void) nvlist_find(nvlist, ZPOOL_CONFIG_DEGRADED, DATA_TYPE_UINT64, + NULL, &is_degraded); + (void) nvlist_find(nvlist, ZPOOL_CONFIG_NOT_PRESENT, DATA_TYPE_UINT64, + NULL, &isnt_present); + (void) nvlist_find(nvlist, ZPOOL_CONFIG_IS_LOG, DATA_TYPE_UINT64, NULL, + &is_log); + + if (is_offline != 0) + vdev->v_state = VDEV_STATE_OFFLINE; + else if (is_removed != 0) + vdev->v_state = VDEV_STATE_REMOVED; + else if (is_faulted != 0) + vdev->v_state = VDEV_STATE_FAULTED; + else if (is_degraded != 0) + vdev->v_state = VDEV_STATE_DEGRADED; + else if (isnt_present != 0) + vdev->v_state = VDEV_STATE_CANT_OPEN; + + vdev->v_islog = is_log == 1; +} + +static int +vdev_init(uint64_t guid, const unsigned char *nvlist, vdev_t **vdevp) +{ + uint64_t id, ashift, asize, nparity; + const char *path; + const char *type; + vdev_t *vdev; + + if (nvlist_find(nvlist, ZPOOL_CONFIG_ID, DATA_TYPE_UINT64, NULL, &id) || + nvlist_find(nvlist, ZPOOL_CONFIG_TYPE, DATA_TYPE_STRING, NULL, &type)) { - printf("ZFS: can't find vdev details\n"); return (ENOENT); } @@ -1136,143 +1172,224 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde return (EIO); } - is_offline = is_removed = is_faulted = is_degraded = isnt_present = 0; - is_log = 0; + if (strcmp(type, VDEV_TYPE_MIRROR) == 0) + vdev = vdev_create(guid, vdev_mirror_read); + else if (strcmp(type, VDEV_TYPE_RAIDZ) == 0) + vdev = vdev_create(guid, vdev_raidz_read); + else if (strcmp(type, VDEV_TYPE_REPLACING) == 0) + vdev = vdev_create(guid, vdev_replacing_read); + else if (strcmp(type, VDEV_TYPE_INDIRECT) == 0) { + vdev_indirect_config_t *vic; - nvlist_find(nvlist, ZPOOL_CONFIG_OFFLINE, DATA_TYPE_UINT64, NULL, - &is_offline); - nvlist_find(nvlist, ZPOOL_CONFIG_REMOVED, DATA_TYPE_UINT64, NULL, - &is_removed); - nvlist_find(nvlist, ZPOOL_CONFIG_FAULTED, DATA_TYPE_UINT64, NULL, - &is_faulted); - nvlist_find(nvlist, ZPOOL_CONFIG_DEGRADED, DATA_TYPE_UINT64, NULL, - &is_degraded); - nvlist_find(nvlist, ZPOOL_CONFIG_NOT_PRESENT, DATA_TYPE_UINT64, NULL, - &isnt_present); - nvlist_find(nvlist, ZPOOL_CONFIG_IS_LOG, DATA_TYPE_UINT64, NULL, - &is_log); - - vdev = vdev_find(guid); - if (!vdev) { - is_new = 1; - - if (strcmp(type, VDEV_TYPE_MIRROR) == 0) - vdev = vdev_create(guid, vdev_mirror_read); - else if (strcmp(type, VDEV_TYPE_RAIDZ) == 0) - vdev = vdev_create(guid, vdev_raidz_read); - else if (strcmp(type, VDEV_TYPE_REPLACING) == 0) - vdev = vdev_create(guid, vdev_replacing_read); - else if (strcmp(type, VDEV_TYPE_INDIRECT) == 0) { - vdev_indirect_config_t *vic; - - vdev = vdev_create(guid, vdev_indirect_read); + vdev = vdev_create(guid, vdev_indirect_read); + if (vdev != NULL) { vdev->v_state = VDEV_STATE_HEALTHY; vic = &vdev->vdev_indirect_config; nvlist_find(nvlist, - ZPOOL_CONFIG_INDIRECT_OBJECT, DATA_TYPE_UINT64, + ZPOOL_CONFIG_INDIRECT_OBJECT, + DATA_TYPE_UINT64, NULL, &vic->vic_mapping_object); nvlist_find(nvlist, - ZPOOL_CONFIG_INDIRECT_BIRTHS, DATA_TYPE_UINT64, + ZPOOL_CONFIG_INDIRECT_BIRTHS, + DATA_TYPE_UINT64, NULL, &vic->vic_births_object); nvlist_find(nvlist, - ZPOOL_CONFIG_PREV_INDIRECT_VDEV, DATA_TYPE_UINT64, + ZPOOL_CONFIG_PREV_INDIRECT_VDEV, + DATA_TYPE_UINT64, NULL, &vic->vic_prev_indirect_vdev); - } else - vdev = vdev_create(guid, vdev_disk_read); - - vdev->v_id = id; - vdev->v_top = pvdev != NULL ? pvdev : vdev; - if (nvlist_find(nvlist, ZPOOL_CONFIG_ASHIFT, - DATA_TYPE_UINT64, NULL, &ashift) == 0) { - vdev->v_ashift = ashift; - } else { - vdev->v_ashift = 0; } - if (nvlist_find(nvlist, ZPOOL_CONFIG_ASIZE, - DATA_TYPE_UINT64, NULL, &asize) == 0) { - vdev->v_psize = asize + - VDEV_LABEL_START_SIZE + VDEV_LABEL_END_SIZE; - } - if (nvlist_find(nvlist, ZPOOL_CONFIG_NPARITY, - DATA_TYPE_UINT64, NULL, &nparity) == 0) { - vdev->v_nparity = nparity; - } else { - vdev->v_nparity = 0; - } - if (nvlist_find(nvlist, ZPOOL_CONFIG_PATH, - DATA_TYPE_STRING, NULL, &path) == 0) { - if (strncmp(path, "/dev/", 5) == 0) - path += 5; - vdev->v_name = strdup(path); - } else { - char *name; + } else { + vdev = vdev_create(guid, vdev_disk_read); + } - if (strcmp(type, "raidz") == 0) { - if (vdev->v_nparity < 1 || - vdev->v_nparity > 3) { - printf("ZFS: can only boot from disk, " - "mirror, raidz1, raidz2 and raidz3 " - "vdevs\n"); - return (EIO); - } - rc = asprintf(&name, "%s%d-%jd", type, - vdev->v_nparity, id); - } else { - rc = asprintf(&name, "%s-%jd", type, id); + if (vdev == NULL) + return (ENOMEM); + + vdev_set_initial_state(vdev, nvlist); + vdev->v_id = id; + if (nvlist_find(nvlist, ZPOOL_CONFIG_ASHIFT, + DATA_TYPE_UINT64, NULL, &ashift) == 0) + vdev->v_ashift = ashift; + + if (nvlist_find(nvlist, ZPOOL_CONFIG_ASIZE, + DATA_TYPE_UINT64, NULL, &asize) == 0) { + vdev->v_psize = asize + + VDEV_LABEL_START_SIZE + VDEV_LABEL_END_SIZE; + } + + if (nvlist_find(nvlist, ZPOOL_CONFIG_NPARITY, + DATA_TYPE_UINT64, NULL, &nparity) == 0) + vdev->v_nparity = nparity; + + if (nvlist_find(nvlist, ZPOOL_CONFIG_PATH, + DATA_TYPE_STRING, NULL, &path) == 0) { + if (strncmp(path, "/dev/", 5) == 0) + path += 5; + vdev->v_name = strdup(path); + } else { + char *name; + + name = NULL; + if (strcmp(type, "raidz") == 0) { + if (vdev->v_nparity < 1 || + vdev->v_nparity > 3) { + printf("ZFS: can only boot from disk, " + "mirror, raidz1, raidz2 and raidz3 " + "vdevs\n"); + return (EIO); } - if (rc < 0) - return (ENOMEM); - vdev->v_name = name; + (void) asprintf(&name, "%s%d-%" PRIu64, type, + vdev->v_nparity, id); + } else { + (void) asprintf(&name, "%s-%" PRIu64, type, id); } - vdev->v_islog = is_log == 1; - } else { - is_new = 0; + vdev->v_name = name; } + *vdevp = vdev; + return (0); +} - if (is_new || is_newer) { - /* - * This is either new vdev or we've already seen this vdev, - * but from an older vdev label, so let's refresh its state - * from the newer label. - */ - if (is_offline) - vdev->v_state = VDEV_STATE_OFFLINE; - else if (is_removed) - vdev->v_state = VDEV_STATE_REMOVED; - else if (is_faulted) - vdev->v_state = VDEV_STATE_FAULTED; - else if (is_degraded) - vdev->v_state = VDEV_STATE_DEGRADED; - else if (isnt_present) - vdev->v_state = VDEV_STATE_CANT_OPEN; +/* + * Find slot for vdev. We return either NULL to signal to use + * STAILQ_INSERT_HEAD, or we return link element to be used with + * STAILQ_INSERT_AFTER. + */ +static vdev_t * +vdev_find_previous(vdev_t *top_vdev, vdev_t *vdev) +{ + vdev_t *v, *previous; + + if (STAILQ_EMPTY(&top_vdev->v_children)) + return (NULL); + + previous = NULL; + STAILQ_FOREACH(v, &top_vdev->v_children, v_childlink) { + if (v->v_id > vdev->v_id) + return (previous); + + if (v->v_id == vdev->v_id) + return (v); + + if (v->v_id < vdev->v_id) + previous = v; } + return (previous); +} - rc = nvlist_find(nvlist, ZPOOL_CONFIG_CHILDREN, DATA_TYPE_NVLIST_ARRAY, - &nkids, &kids); +static size_t +vdev_child_count(vdev_t *vdev) +{ + vdev_t *v; + size_t count; + + count = 0; + STAILQ_FOREACH(v, &vdev->v_children, v_childlink) { + count++; + } + return (count); +} + +/* + * Insert vdev into top_vdev children list. List is ordered by v_id. + */ +static void +vdev_insert(vdev_t *top_vdev, vdev_t *vdev) +{ + vdev_t *previous; + size_t count; + /* - * Its ok if we don't have any kids. + * The top level vdev can appear in random order, depending how + * the firmware is presenting the disk devices. + * However, we will insert vdev to create list ordered by v_id, + * so we can use either STAILQ_INSERT_HEAD or STAILQ_INSERT_AFTER + * as STAILQ does not have insert before. */ + previous = vdev_find_previous(top_vdev, vdev); + + if (previous == NULL) { + STAILQ_INSERT_HEAD(&top_vdev->v_children, vdev, v_childlink); + count = vdev_child_count(top_vdev); + if (top_vdev->v_nchildren < count) + top_vdev->v_nchildren = count; + return; + } + + if (previous->v_id == vdev->v_id) + return; + + STAILQ_INSERT_AFTER(&top_vdev->v_children, previous, vdev, v_childlink); + count = vdev_child_count(top_vdev); + if (top_vdev->v_nchildren < count) + top_vdev->v_nchildren = count; +} + +static int +vdev_from_nvlist(spa_t *spa, uint64_t top_guid, const unsigned char *nvlist) +{ + vdev_t *top_vdev, *vdev; + const unsigned char *kids; + int rc, nkids; + + /* Get top vdev. */ + top_vdev = vdev_find(top_guid); + if (top_vdev == NULL) { + rc = vdev_init(top_guid, nvlist, &top_vdev); + if (rc != 0) + return (rc); + top_vdev->v_spa = spa; + top_vdev->v_top = top_vdev; + vdev_insert(spa->spa_root_vdev, top_vdev); + } + + /* Add children if there are any. */ + rc = nvlist_find(nvlist, ZPOOL_CONFIG_CHILDREN, DATA_TYPE_NVLIST_ARRAY, + &nkids, &kids); if (rc == 0) { - vdev->v_nchildren = nkids; - for (i = 0; i < nkids; i++) { - rc = vdev_init_from_nvlist(kids, vdev, &kid, is_newer); - if (rc) + for (int i = 0; i < nkids; i++) { + uint64_t guid; + + rc = nvlist_find(kids, ZPOOL_CONFIG_GUID, + DATA_TYPE_UINT64, NULL, &guid); + if (rc != 0) return (rc); - if (is_new) - STAILQ_INSERT_TAIL(&vdev->v_children, kid, - v_childlink); + rc = vdev_init(guid, kids, &vdev); + if (rc != 0) + return (rc); + + vdev->v_spa = spa; + vdev->v_top = top_vdev; + vdev_insert(top_vdev, vdev); + kids = nvlist_next(kids); } } else { - vdev->v_nchildren = 0; + rc = 0; } - if (vdevp) - *vdevp = vdev; - return (0); + return (rc); } +static int +vdev_init_from_label(spa_t *spa, const unsigned char *nvlist) +{ + uint64_t pool_guid, top_guid; + const unsigned char *vdevs; + + if (nvlist_find(nvlist, ZPOOL_CONFIG_POOL_GUID, DATA_TYPE_UINT64, + NULL, &pool_guid) || + nvlist_find(nvlist, ZPOOL_CONFIG_TOP_GUID, DATA_TYPE_UINT64, + NULL, &top_guid) || + nvlist_find(nvlist, ZPOOL_CONFIG_VDEV_TREE, DATA_TYPE_NVLIST, + NULL, &vdevs)) { + printf("ZFS: can't find vdev details\n"); + return (ENOENT); + } + + return (vdev_from_nvlist(spa, top_guid, vdevs)); +} + static void vdev_set_state(vdev_t *vdev) { @@ -1280,6 +1397,10 @@ vdev_set_state(vdev_t *vdev) int good_kids; int bad_kids; + STAILQ_FOREACH(kid, &vdev->v_children, v_childlink) { + vdev_set_state(kid); + } + /* * A mirror or raidz is healthy if all its kids are healthy. A * mirror is degraded if any of its kids is healthy; a raidz @@ -1314,6 +1435,104 @@ vdev_set_state(vdev_t *vdev) } } +static int +vdev_update_from_nvlist(uint64_t top_guid, const unsigned char *nvlist) +{ + vdev_t *vdev; + const unsigned char *kids; + int rc, nkids; + + /* Update top vdev. */ + vdev = vdev_find(top_guid); + if (vdev != NULL) + vdev_set_initial_state(vdev, nvlist); + + /* Update children if there are any. */ + rc = nvlist_find(nvlist, ZPOOL_CONFIG_CHILDREN, DATA_TYPE_NVLIST_ARRAY, + &nkids, &kids); + if (rc == 0) { + for (int i = 0; i < nkids; i++) { + uint64_t guid; + + rc = nvlist_find(kids, ZPOOL_CONFIG_GUID, + DATA_TYPE_UINT64, NULL, &guid); + if (rc != 0) + break; + + vdev = vdev_find(guid); + if (vdev != NULL) + vdev_set_initial_state(vdev, kids); + + kids = nvlist_next(kids); + } + } else { + rc = 0; + } + + return (rc); +} + +static int +vdev_init_from_nvlist(spa_t *spa, const unsigned char *nvlist) +{ + uint64_t pool_guid, vdev_children; + const unsigned char *vdevs, *kids; + int rc, nkids; + + if (nvlist_find(nvlist, ZPOOL_CONFIG_POOL_GUID, DATA_TYPE_UINT64, + NULL, &pool_guid) || + nvlist_find(nvlist, ZPOOL_CONFIG_VDEV_CHILDREN, DATA_TYPE_UINT64, + NULL, &vdev_children) || + nvlist_find(nvlist, ZPOOL_CONFIG_VDEV_TREE, DATA_TYPE_NVLIST, + NULL, &vdevs)) { + printf("ZFS: can't find vdev details\n"); + return (ENOENT); + } + + /* Wrong guid?! */ + if (spa->spa_guid != pool_guid) + return (EIO); + + spa->spa_root_vdev->v_nchildren = vdev_children; + + rc = nvlist_find(vdevs, ZPOOL_CONFIG_CHILDREN, DATA_TYPE_NVLIST_ARRAY, + &nkids, &kids); + + /* + * MOS config has at least one child for root vdev. + */ + if (rc != 0) + return (EIO); + + for (int i = 0; i < nkids; i++) { + uint64_t guid; + vdev_t *vdev; + + rc = nvlist_find(kids, ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64, + NULL, &guid); + if (rc != 0) + break; + vdev = vdev_find(guid); + /* + * Top level vdev is missing, create it. + */ + if (vdev == NULL) + rc = vdev_from_nvlist(spa, guid, kids); + else + rc = vdev_update_from_nvlist(guid, kids); + if (rc != 0) + break; + kids = nvlist_next(kids); + } + + /* + * Re-evaluate top-level vdev state. + */ + vdev_set_state(spa->spa_root_vdev); + + return (rc); +} + static spa_t * spa_find_by_guid(uint64_t guid) { @@ -1356,7 +1575,7 @@ spa_get_primary_vdev(const spa_t *spa) spa = spa_get_primary(); if (spa == NULL) return (NULL); - vdev = STAILQ_FIRST(&spa->spa_vdevs); + vdev = spa->spa_root_vdev; if (vdev == NULL) return (NULL); for (kid = STAILQ_FIRST(&vdev->v_children); kid != NULL; @@ -1377,8 +1596,14 @@ spa_create(uint64_t guid, const char *name) free(spa); return (NULL); } - STAILQ_INIT(&spa->spa_vdevs); spa->spa_guid = guid; + spa->spa_root_vdev = vdev_create(guid, NULL); + if (spa->spa_root_vdev == NULL) { + free(spa->spa_name); + free(spa); + return (NULL); + } + spa->spa_root_vdev->v_name = strdup("root"); STAILQ_INSERT_TAIL(&zfs_pools, spa, spa_link); return (spa); @@ -1413,9 +1638,8 @@ pager_printf(const char *fmt, ...) va_list args; va_start(args, fmt); - vsprintf(line, fmt, args); + vsnprintf(line, sizeof(line), fmt, args); va_end(args); - return (pager_output(line)); } @@ -1426,14 +1650,13 @@ pager_printf(const char *fmt, ...) static int print_state(int indent, const char *name, vdev_state_t state) { - char buf[512]; int i; + char buf[512]; buf[0] = 0; for (i = 0; i < indent; i++) strcat(buf, " "); strcat(buf, name); - return (pager_printf(STATUS_FORMAT, buf, state_name(state))); } @@ -1465,6 +1688,7 @@ spa_status(spa_t *spa) { static char bootfs[ZFS_MAXNAMELEN]; uint64_t rootid; + vdev_list_t *vlist; vdev_t *vdev; int good_kids, bad_kids, degraded_kids, ret; vdev_state_t state; @@ -1493,7 +1717,8 @@ spa_status(spa_t *spa) good_kids = 0; degraded_kids = 0; bad_kids = 0; - STAILQ_FOREACH(vdev, &spa->spa_vdevs, v_childlink) { + vlist = &spa->spa_root_vdev->v_children; + STAILQ_FOREACH(vdev, vlist, v_childlink) { if (vdev->v_state == VDEV_STATE_HEALTHY) good_kids++; else if (vdev->v_state == VDEV_STATE_DEGRADED) @@ -1511,7 +1736,8 @@ spa_status(spa_t *spa) ret = print_state(0, spa->spa_name, state); if (ret != 0) return (ret); - STAILQ_FOREACH(vdev, &spa->spa_vdevs, v_childlink) { + + STAILQ_FOREACH(vdev, vlist, v_childlink) { ret = vdev_status(vdev, 1); if (ret != 0) return (ret); @@ -1703,15 +1929,14 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s { vdev_t vtmp; spa_t *spa; - vdev_t *vdev, *top_vdev, *pool_vdev; + vdev_t *vdev; unsigned char *nvlist; uint64_t val; - uint64_t guid; + uint64_t guid, vdev_children; uint64_t pool_txg, pool_guid; const char *pool_name; - const unsigned char *vdevs; const unsigned char *features; - int rc, is_newer; + int rc; /* * Load the vdev label and figure out which @@ -1783,18 +2008,17 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s */ spa = spa_find_by_guid(pool_guid); if (spa == NULL) { + nvlist_find(nvlist, ZPOOL_CONFIG_VDEV_CHILDREN, + DATA_TYPE_UINT64, NULL, &vdev_children); spa = spa_create(pool_guid, pool_name); if (spa == NULL) { free(nvlist); return (ENOMEM); } + spa->spa_root_vdev->v_nchildren = vdev_children; } - if (pool_txg > spa->spa_txg) { + if (pool_txg > spa->spa_txg) spa->spa_txg = pool_txg; - is_newer = 1; - } else { - is_newer = 0; - } /* * Get the vdev tree and create our in-core copy of it. @@ -1814,39 +2038,25 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s return (EIO); } - if (nvlist_find(nvlist, ZPOOL_CONFIG_VDEV_TREE, DATA_TYPE_NVLIST, - NULL, &vdevs)) { - free(nvlist); - return (EIO); - } - - rc = vdev_init_from_nvlist(vdevs, NULL, &top_vdev, is_newer); + rc = vdev_init_from_label(spa, nvlist); free(nvlist); if (rc != 0) return (rc); /* - * Add the toplevel vdev to the pool if its not already there. - */ - STAILQ_FOREACH(pool_vdev, &spa->spa_vdevs, v_childlink) - if (top_vdev == pool_vdev) - break; - - if (!pool_vdev && top_vdev) { - top_vdev->spa = spa; - STAILQ_INSERT_TAIL(&spa->spa_vdevs, top_vdev, v_childlink); - } - - /* * We should already have created an incomplete vdev for this * vdev. Find it and initialise it with our read proc. */ vdev = vdev_find(guid); - if (vdev) { + if (vdev != NULL) { vdev->v_phys_read = _read; vdev->v_read_priv = read_priv; - vdev->v_state = VDEV_STATE_HEALTHY; vdev->v_psize = vtmp.v_psize; + /* + * If no other state is set, mark vdev healthy. + */ + if (vdev->v_state == VDEV_STATE_UNKNOWN) + vdev->v_state = VDEV_STATE_HEALTHY; } else { printf("ZFS: inconsistent nvlist contents\n"); return (EIO); @@ -1858,7 +2068,7 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s /* * Re-evaluate top-level vdev state. */ - vdev_set_state(top_vdev); + vdev_set_state(vdev->v_top); /* * Ok, we are happy with the pool so far. Lets find @@ -1867,7 +2077,6 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s */ vdev_uberblock_load(vdev, &spa->spa_uberblock); - vdev->spa = spa; if (spap != NULL) *spap = spa; return (0); @@ -1962,7 +2171,8 @@ zio_read(const spa_t *spa, const blkptr_t *bp, void *b for (i = 0; i < SPA_DVAS_PER_BP; i++) { const dva_t *dva = &bp->blk_dva[i]; vdev_t *vdev; - int vdevid; + vdev_list_t *vlist; + uint64_t vdevid; off_t offset; if (!dva->dva_word[0] && !dva->dva_word[1]) @@ -1970,7 +2180,8 @@ zio_read(const spa_t *spa, const blkptr_t *bp, void *b vdevid = DVA_GET_VDEV(dva); offset = DVA_GET_OFFSET(dva); - STAILQ_FOREACH(vdev, &spa->spa_vdevs, v_childlink) { + vlist = &spa->spa_root_vdev->v_children; + STAILQ_FOREACH(vdev, vlist, v_childlink) { if (vdev->v_id == vdevid) break; } @@ -1979,7 +2190,7 @@ zio_read(const spa_t *spa, const blkptr_t *bp, void *b size = BP_GET_PSIZE(bp); if (vdev->v_read == vdev_raidz_read) { - align = 1ULL << vdev->v_top->v_ashift; + align = 1ULL << vdev->v_ashift; if (P2PHASE(size, align) != 0) size = P2ROUNDUP(size, align); } @@ -2067,11 +2278,11 @@ dnode_read(const spa_t *spa, const dnode_phys_t *dnode /* * The buffer contains our data block. Copy what we * need from it and loop. - */ + */ i = bsize - boff; if (i > buflen) i = buflen; memcpy(buf, &dnode_cache_buf[boff], i); - buf = ((char*)buf) + i; + buf = ((char *)buf) + i; offset += i; buflen -= i; } @@ -2124,7 +2335,7 @@ fzap_name_equal(const zap_leaf_t *zl, const zap_leaf_c const char *p; namelen = zc->l_entry.le_name_numints; - + nc = &ZAP_LEAF_CHUNK(zl, zc->l_entry.le_name_chunk); p = name; while (namelen > 0) { @@ -2222,6 +2433,26 @@ fzap_leaf_array(const zap_leaf_t *zl, const zap_leaf_c } } +static int +fzap_check_size(uint64_t integer_size, uint64_t num_integers) +{ + + switch (integer_size) { + case 1: + case 2: + case 4: + case 8: + break; + default: + return (EINVAL); + } + + if (integer_size * num_integers > ZAP_MAXVALUELEN) + return (E2BIG); + + return (0); +} + /* * Lookup a value in a fatzap directory. Assumes that the zap scratch * buffer contains the directory header. @@ -2240,6 +2471,9 @@ fzap_lookup(const spa_t *spa, const dnode_phys_t *dnod if (zh.zap_magic != ZAP_MAGIC) return (EIO); + if ((rc = fzap_check_size(integer_size, num_integers)) != 0) + return (rc); + z.zap_block_shift = ilog2(bsize); z.zap_phys = (zap_phys_t *)zap_scratch; @@ -2388,7 +2622,7 @@ fzap_list(const spa_t *spa, const dnode_phys_t *dnode, zap_leaf_t zl; zl.l_bs = z.zap_block_shift; for (i = 0; i < zh.zap_num_leafs; i++) { - off_t off = (i + 1) << zl.l_bs; + off_t off = ((off_t)(i + 1)) << zl.l_bs; char name[256], *p; uint64_t value; @@ -2537,7 +2771,7 @@ fzap_rlookup(const spa_t *spa, const dnode_phys_t *dno uint64_t value) { int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; - zap_phys_t zh = *(zap_phys_t *) zap_scratch; + zap_phys_t zh = *(zap_phys_t *)zap_scratch; fat_zap_t z; int i, j; @@ -2554,7 +2788,7 @@ fzap_rlookup(const spa_t *spa, const dnode_phys_t *dno zap_leaf_t zl; zl.l_bs = z.zap_block_shift; for (i = 0; i < zh.zap_num_leafs; i++) { - off_t off = (i + 1) << zl.l_bs; + off_t off = ((off_t)(i + 1)) << zl.l_bs; if (dnode_read(spa, dnode, off, zap_scratch, bsize)) return (EIO); @@ -2844,8 +3078,7 @@ zfs_get_root(const spa_t *spa, uint64_t *objid) sizeof(props), 1, &props) == 0 && objset_get_dnode(spa, &spa->spa_mos, props, &propdir) == 0 && zap_lookup(spa, &propdir, "bootfs", - sizeof(bootfs), 1, &bootfs) == 0 && - bootfs != 0) { + sizeof(bootfs), 1, &bootfs) == 0 && bootfs != 0) { *objid = bootfs; return (0); } @@ -2995,9 +3228,7 @@ zfs_spa_init(spa_t *spa) dnode_phys_t dir; uint64_t config_object; unsigned char *nvlist; - char *type; - const unsigned char *nv; - int nkids, rc; + int rc; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Dec 15 22:41:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8DA131D11F6; Sun, 15 Dec 2019 22:41:58 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47bfXk39Ltz43KJ; Sun, 15 Dec 2019 22:41:58 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 67C271C094; Sun, 15 Dec 2019 22:41:58 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBFMfwlk083182; Sun, 15 Dec 2019 22:41:58 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBFMfwZE083181; Sun, 15 Dec 2019 22:41:58 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201912152241.xBFMfwZE083181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 15 Dec 2019 22:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355787 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 355787 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 22:41:58 -0000 Author: alc Date: Sun Dec 15 22:41:57 2019 New Revision: 355787 URL: https://svnweb.freebsd.org/changeset/base/355787 Log: Apply a small optimization to pmap_remove_l3_range(). Specifically, hoist a PHYS_TO_VM_PAGE() operation that always returns the same vm_page_t out of the loop. (Since arm64 is configured as VM_PHYSSEG_SPARSE, the implementation of PHYS_TO_VM_PAGE() is more costly than that of VM_PHYSSEG_DENSE platforms, like amd64.) MFC after: 1 week Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Sun Dec 15 21:52:40 2019 (r355786) +++ head/sys/arm64/arm64/pmap.c Sun Dec 15 22:41:57 2019 (r355787) @@ -2616,11 +2616,13 @@ pmap_remove_l3_range(pmap_t pmap, pd_entry_t l2e, vm_o struct rwlock *new_lock; pt_entry_t *l3, old_l3; vm_offset_t va; - vm_page_t m; + vm_page_t l3pg, m; PMAP_LOCK_ASSERT(pmap, MA_OWNED); KASSERT(rounddown2(sva, L2_SIZE) + L2_SIZE == roundup2(eva, L2_SIZE), ("pmap_remove_l3_range: range crosses an L3 page table boundary")); + l3pg = sva < VM_MAXUSER_ADDRESS ? PHYS_TO_VM_PAGE(l2e & ~ATTR_MASK) : + NULL; va = eva; for (l3 = pmap_l2_to_l3(&l2e, sva); sva != eva; l3++, sva += L3_SIZE) { if (!pmap_l3_valid(pmap_load(l3))) { @@ -2671,7 +2673,7 @@ pmap_remove_l3_range(pmap_t pmap, pd_entry_t l2e, vm_o } if (va == eva) va = sva; - if (pmap_unuse_pt(pmap, sva, l2e, free)) { + if (l3pg != NULL && pmap_unwire_l3(pmap, sva, l3pg, free)) { sva += L3_SIZE; break; } From owner-svn-src-head@freebsd.org Sun Dec 15 23:28:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BEFBA1D24AE; Sun, 15 Dec 2019 23:28:53 +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 47bgZs4d7xz45Q9; Sun, 15 Dec 2019 23:28:53 +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 9A1E81C7DB; Sun, 15 Dec 2019 23:28:53 +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 xBFNSrda008380; Sun, 15 Dec 2019 23:28:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBFNSr2f008379; Sun, 15 Dec 2019 23:28:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201912152328.xBFNSr2f008379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 15 Dec 2019 23:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355788 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 355788 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Dec 2019 23:28:53 -0000 Author: mav Date: Sun Dec 15 23:28:53 2019 New Revision: 355788 URL: https://svnweb.freebsd.org/changeset/base/355788 Log: Properly detect ATA sanitize errors. It seems I read specifications not careful enough. There are devices not setting successful completion bit, causing previous code report false error. MFC after: 1 week Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Sun Dec 15 22:41:57 2019 (r355787) +++ head/sbin/camcontrol/camcontrol.c Sun Dec 15 23:28:53 2019 (r355788) @@ -6667,6 +6667,25 @@ sanitize_wait_ata(struct cam_device *device, union ccb return (retval); } if (status & ATA_STATUS_ERROR) { + if (error & ATA_ERROR_ABORT) { + switch (lba & 0xff) { + case 0x00: + warnx("Reason not reported or sanitize failed."); + return (1); + case 0x01: + warnx("Sanitize command unsuccessful. "); + return (1); + case 0x02: + warnx("Unsupported sanitize device command. "); + return (1); + case 0x03: + warnx("Device is in sanitize frozen state. "); + return (1); + case 0x04: + warnx("Sanitize antifreeze lock is enabled. "); + return (1); + } + } warnx("SANITIZE STATUS EXT failed, " "sanitize may still run."); return (1); @@ -6683,9 +6702,6 @@ sanitize_wait_ata(struct cam_device *device, union ccb fflush(stdout); } sleep(1); - } else if ((count & 0x8000) == 0) { - warnx("Sanitize complete with an error. "); - return (1); } else break; } while (1); From owner-svn-src-head@freebsd.org Mon Dec 16 00:04:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 42E231D3057; Mon, 16 Dec 2019 00:04:34 +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 47bhN2121fz46wV; Mon, 16 Dec 2019 00:04:34 +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 1E9631CEF9; Mon, 16 Dec 2019 00:04:34 +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 xBG04YfA031516; Mon, 16 Dec 2019 00:04:34 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBG04XJW031515; Mon, 16 Dec 2019 00:04:33 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201912160004.xBG04XJW031515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 16 Dec 2019 00:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355789 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355789 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 00:04:34 -0000 Author: mjg Date: Mon Dec 16 00:04:33 2019 New Revision: 355789 URL: https://svnweb.freebsd.org/changeset/base/355789 Log: mtx: eliminate recursion support from thread lock Now that it is not used after schedlock changes got merged. Note the unlock routine temporarily still checks for it on account of just using regular spin unlock. This is a prelude towards a general clean up. Modified: head/sys/kern/kern_mutex.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Sun Dec 15 23:28:53 2019 (r355788) +++ head/sys/kern/kern_mutex.c Mon Dec 16 00:04:33 2019 (r355789) @@ -797,10 +797,9 @@ thread_lock_validate(struct mtx *m, int opts, const ch KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_spin, ("thread_lock() of sleep mutex %s @ %s:%d", m->lock_object.lo_name, file, line)); - if (mtx_owned(m)) - KASSERT((m->lock_object.lo_flags & LO_RECURSABLE) != 0, - ("thread_lock: recursed on non-recursive mutex %s @ %s:%d\n", - m->lock_object.lo_name, file, line)); + KASSERT((m->lock_object.lo_flags & LO_RECURSABLE) == 0, + ("thread_lock: got a recursive mutex %s @ %s:%d\n", + m->lock_object.lo_name, file, line)); WITNESS_CHECKORDER(&m->lock_object, opts | LOP_NEWORDER | LOP_EXCLUSIVE, file, line, NULL); } @@ -818,7 +817,7 @@ _thread_lock(struct thread *td) #endif { struct mtx *m; - uintptr_t tid, v; + uintptr_t tid; tid = (uintptr_t)curthread; @@ -827,19 +826,14 @@ _thread_lock(struct thread *td) spinlock_enter(); m = td->td_lock; thread_lock_validate(m, 0, file, line); - v = MTX_READ_VALUE(m); - if (__predict_true(v == MTX_UNOWNED)) { - if (__predict_false(!_mtx_obtain_lock(m, tid))) - goto slowpath_unlocked; - } else if (v == tid) { - m->mtx_recurse++; - } else + if (__predict_false(m == &blocked_lock)) goto slowpath_unlocked; + if (__predict_false(!_mtx_obtain_lock(m, tid))) + goto slowpath_unlocked; if (__predict_true(m == td->td_lock)) { WITNESS_LOCK(&m->lock_object, LOP_EXCLUSIVE, file, line); return; } - MPASS(m->mtx_recurse == 0); _mtx_release_lock_quick(m); slowpath_unlocked: spinlock_exit(); @@ -907,11 +901,7 @@ retry: break; continue; } - if (v == tid) { - m->mtx_recurse++; - MPASS(m == td->td_lock); - break; - } + MPASS(v != tid); lock_profile_obtain_lock_failed(&m->lock_object, &contested, &waittime); /* Give interrupts a chance while we spin. */ @@ -932,7 +922,6 @@ retry: } if (m == td->td_lock) break; - MPASS(m->mtx_recurse == 0); _mtx_release_lock_quick(m); } LOCK_LOG_LOCK("LOCK", &m->lock_object, opts, m->mtx_recurse, file, @@ -946,9 +935,8 @@ retry: #ifdef KDTRACE_HOOKS spin_time += lockstat_nsecs(&m->lock_object); #endif - if (m->mtx_recurse == 0) - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, m, - contested, waittime, file, line); + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, m, contested, + waittime, file, line); #ifdef KDTRACE_HOOKS if (lda.spin_cnt != 0) LOCKSTAT_RECORD1(thread__spin, m, spin_time); From owner-svn-src-head@freebsd.org Mon Dec 16 00:06:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95CD31D3166; Mon, 16 Dec 2019 00:06: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 47bhQD4G1Vz474j; Mon, 16 Dec 2019 00:06: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 88E9B1CEFA; Mon, 16 Dec 2019 00:06: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 xBG06S4F031671; Mon, 16 Dec 2019 00:06:28 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBG06Mvu031642; Mon, 16 Dec 2019 00:06:22 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201912160006.xBG06Mvu031642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 16 Dec 2019 00:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355790 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/autofs fs/cd9660 fs/deadfs fs/devfs fs/ext2fs fs/fdescfs fs/fifofs fs/fuse fs/msdosfs fs/nfsclient fs/nullfs fs/pseu... X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/autofs fs/cd9660 fs/deadfs fs/devfs fs/ext2fs fs/fdescfs fs/fifofs fs/fuse fs/msdosfs fs/nfsclient fs/nullfs fs/pseudofs fs/smbfs fs/tmpfs fs... X-SVN-Commit-Revision: 355790 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 00:06:28 -0000 Author: mjg Date: Mon Dec 16 00:06:22 2019 New Revision: 355790 URL: https://svnweb.freebsd.org/changeset/base/355790 Log: vfs: flatten vop vectors This eliminates the following loop from all VOP calls: while(vop != NULL && \ vop->vop_spare2 == NULL && vop->vop_bypass == NULL) vop = vop->vop_default; Reviewed by: jeff Tesetd by: pho Differential Revision: https://reviews.freebsd.org/D22738 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/fs/autofs/autofs_vnops.c head/sys/fs/cd9660/cd9660_vnops.c head/sys/fs/deadfs/dead_vnops.c head/sys/fs/devfs/devfs_vnops.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/fdescfs/fdesc_vnops.c head/sys/fs/fifofs/fifo_vnops.c head/sys/fs/fuse/fuse_vnops.c head/sys/fs/msdosfs/msdosfs_vnops.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/nullfs/null_vnops.c head/sys/fs/pseudofs/pseudofs_vnops.c head/sys/fs/smbfs/smbfs_vnops.c head/sys/fs/tmpfs/tmpfs_fifoops.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/fs/udf/udf_vnops.c head/sys/fs/unionfs/union_vnops.c head/sys/kern/uipc_mqueue.c head/sys/kern/vfs_default.c head/sys/kern/vfs_lookup.c head/sys/kern/vfs_subr.c head/sys/sys/vnode.h head/sys/tools/vnode_if.awk head/sys/ufs/ffs/ffs_vnops.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Mon Dec 16 00:06:22 2019 (r355790) @@ -826,6 +826,7 @@ static struct vop_vector zfsctl_ops_root = { .vop_pathconf = zfsctl_common_pathconf, .vop_getacl = zfsctl_common_getacl, }; +VFS_VOP_VECTOR_REGISTER(zfsctl_ops_root); static int zfsctl_snapshot_zname(vnode_t *vp, const char *name, int len, char *zname) @@ -1159,6 +1160,7 @@ static struct vop_vector zfsctl_ops_snapdir = { .vop_pathconf = zfsctl_common_pathconf, .vop_getacl = zfsctl_common_getacl, }; +VFS_VOP_VECTOR_REGISTER(zfsctl_ops_snapdir); static int zfsctl_snapshot_inactive(ap) @@ -1257,6 +1259,7 @@ static struct vop_vector zfsctl_ops_snapshot = { .vop_advlockpurge = vop_stdadvlockpurge, /* called by vgone */ .vop_print = zfsctl_common_print, }; +VFS_VOP_VECTOR_REGISTER(zfsctl_ops_snapshot); int zfsctl_lookup_objset(vfs_t *vfsp, uint64_t objsetid, zfsvfs_t **zfsvfsp) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Dec 16 00:06:22 2019 (r355790) @@ -5995,6 +5995,7 @@ struct vop_vector zfs_vnodeops = { .vop_unlock = vop_unlock, .vop_islocked = vop_islocked, }; +VFS_VOP_VECTOR_REGISTER(zfs_vnodeops); struct vop_vector zfs_fifoops = { .vop_default = &fifo_specops, @@ -6012,6 +6013,7 @@ struct vop_vector zfs_fifoops = { .vop_setacl = zfs_freebsd_setacl, .vop_aclcheck = zfs_freebsd_aclcheck, }; +VFS_VOP_VECTOR_REGISTER(zfs_fifoops); /* * special share hidden files vnode operations template @@ -6024,3 +6026,4 @@ struct vop_vector zfs_shareops = { .vop_fid = zfs_freebsd_fid, .vop_pathconf = zfs_freebsd_pathconf, }; +VFS_VOP_VECTOR_REGISTER(zfs_shareops); Modified: head/sys/fs/autofs/autofs_vnops.c ============================================================================== --- head/sys/fs/autofs/autofs_vnops.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/fs/autofs/autofs_vnops.c Mon Dec 16 00:06:22 2019 (r355790) @@ -554,6 +554,7 @@ struct vop_vector autofs_vnodeops = { .vop_write = VOP_EOPNOTSUPP, .vop_reclaim = autofs_reclaim, }; +VFS_VOP_VECTOR_REGISTER(autofs_vnodeops); int autofs_node_new(struct autofs_node *parent, struct autofs_mount *amp, Modified: head/sys/fs/cd9660/cd9660_vnops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vnops.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/fs/cd9660/cd9660_vnops.c Mon Dec 16 00:06:22 2019 (r355790) @@ -906,6 +906,7 @@ struct vop_vector cd9660_vnodeops = { .vop_vptofh = cd9660_vptofh, .vop_getpages = cd9660_getpages, }; +VFS_VOP_VECTOR_REGISTER(cd9660_vnodeops); /* * Special device vnode ops @@ -920,3 +921,4 @@ struct vop_vector cd9660_fifoops = { .vop_setattr = cd9660_setattr, .vop_vptofh = cd9660_vptofh, }; +VFS_VOP_VECTOR_REGISTER(cd9660_fifoops); Modified: head/sys/fs/deadfs/dead_vnops.c ============================================================================== --- head/sys/fs/deadfs/dead_vnops.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/fs/deadfs/dead_vnops.c Mon Dec 16 00:06:22 2019 (r355790) @@ -80,6 +80,7 @@ struct vop_vector dead_vnodeops = { .vop_unset_text = dead_unset_text, .vop_write = dead_write, }; +VFS_VOP_VECTOR_REGISTER(dead_vnodeops); static int dead_getwritemount(struct vop_getwritemount_args *ap) Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/fs/devfs/devfs_vnops.c Mon Dec 16 00:06:22 2019 (r355790) @@ -1928,6 +1928,7 @@ static struct vop_vector devfs_vnodeops = { .vop_symlink = devfs_symlink, .vop_vptocnp = devfs_vptocnp, }; +VFS_VOP_VECTOR_REGISTER(devfs_vnodeops); /* Vops for VCHR vnodes in /dev. */ static struct vop_vector devfs_specops = { @@ -1965,6 +1966,7 @@ static struct vop_vector devfs_specops = { .vop_vptocnp = devfs_vptocnp, .vop_write = dead_write, }; +VFS_VOP_VECTOR_REGISTER(devfs_specops); /* * Our calling convention to the device drivers used to be that we passed Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/fs/ext2fs/ext2_vnops.c Mon Dec 16 00:06:22 2019 (r355790) @@ -182,6 +182,7 @@ struct vop_vector ext2_vnodeops = { #endif /* UFS_ACL */ .vop_vptofh = ext2_vptofh, }; +VFS_VOP_VECTOR_REGISTER(ext2_vnodeops); struct vop_vector ext2_fifoops = { .vop_default = &fifo_specops, @@ -199,6 +200,7 @@ struct vop_vector ext2_fifoops = { .vop_write = VOP_PANIC, .vop_vptofh = ext2_vptofh, }; +VFS_VOP_VECTOR_REGISTER(ext2_fifoops); /* * A virgin directory (no blushing please). Modified: head/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vnops.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/fs/fdescfs/fdesc_vnops.c Mon Dec 16 00:06:22 2019 (r355790) @@ -91,6 +91,7 @@ static struct vop_vector fdesc_vnodeops = { .vop_reclaim = fdesc_reclaim, .vop_setattr = fdesc_setattr, }; +VFS_VOP_VECTOR_REGISTER(fdesc_vnodeops); static void fdesc_insmntque_dtr(struct vnode *, void *); static void fdesc_remove_entry(struct fdescnode *); Modified: head/sys/fs/fifofs/fifo_vnops.c ============================================================================== --- head/sys/fs/fifofs/fifo_vnops.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/fs/fifofs/fifo_vnops.c Mon Dec 16 00:06:22 2019 (r355790) @@ -102,6 +102,7 @@ struct vop_vector fifo_specops = { .vop_symlink = VOP_PANIC, .vop_write = VOP_PANIC, }; +VFS_VOP_VECTOR_REGISTER(fifo_specops); /* * Dispose of fifo resources. Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/fs/fuse/fuse_vnops.c Mon Dec 16 00:06:22 2019 (r355790) @@ -174,6 +174,7 @@ struct vop_vector fuse_fifoops = { .vop_write = VOP_PANIC, .vop_vptofh = fuse_vnop_vptofh, }; +VFS_VOP_VECTOR_REGISTER(fuse_fifoops); struct vop_vector fuse_vnops = { .vop_allocate = VOP_EINVAL, @@ -223,6 +224,7 @@ struct vop_vector fuse_vnops = { .vop_print = fuse_vnop_print, .vop_vptofh = fuse_vnop_vptofh, }; +VFS_VOP_VECTOR_REGISTER(fuse_vnops); uma_zone_t fuse_pbuf_zone; Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Mon Dec 16 00:06:22 2019 (r355790) @@ -1962,3 +1962,4 @@ struct vop_vector msdosfs_vnodeops = { .vop_write = msdosfs_write, .vop_vptofh = msdosfs_vptofh, }; +VFS_VOP_VECTOR_REGISTER(msdosfs_vnodeops); Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/fs/nfsclient/nfs_clvnops.c Mon Dec 16 00:06:22 2019 (r355790) @@ -200,6 +200,7 @@ static struct vop_vector newnfs_vnodeops_nosig = { .vop_listextattr = nfs_listextattr, .vop_deleteextattr = nfs_deleteextattr, }; +VFS_VOP_VECTOR_REGISTER(newnfs_vnodeops_nosig); static int nfs_vnodeops_bypass(struct vop_generic_args *a) @@ -212,6 +213,7 @@ struct vop_vector newnfs_vnodeops = { .vop_default = &default_vnodeops, .vop_bypass = nfs_vnodeops_bypass, }; +VFS_VOP_VECTOR_REGISTER(newnfs_vnodeops); static struct vop_vector newnfs_fifoops_nosig = { .vop_default = &fifo_specops, @@ -227,6 +229,7 @@ static struct vop_vector newnfs_fifoops_nosig = { .vop_setattr = nfs_setattr, .vop_write = nfsfifo_write, }; +VFS_VOP_VECTOR_REGISTER(newnfs_fifoops_nosig); static int nfs_fifoops_bypass(struct vop_generic_args *a) @@ -239,6 +242,7 @@ struct vop_vector newnfs_fifoops = { .vop_default = &default_vnodeops, .vop_bypass = nfs_fifoops_bypass, }; +VFS_VOP_VECTOR_REGISTER(newnfs_fifoops); static int nfs_mknodrpc(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, struct vattr *vap); Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/fs/nullfs/null_vnops.c Mon Dec 16 00:06:22 2019 (r355790) @@ -943,3 +943,4 @@ struct vop_vector null_vnodeops = { .vop_vptofh = null_vptofh, .vop_add_writecount = null_add_writecount, }; +VFS_VOP_VECTOR_REGISTER(null_vnodeops); Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Mon Dec 16 00:06:22 2019 (r355790) @@ -1095,3 +1095,4 @@ struct vop_vector pfs_vnodeops = { .vop_write = pfs_write, /* XXX I've probably forgotten a few that need VOP_EOPNOTSUPP */ }; +VFS_VOP_VECTOR_REGISTER(pfs_vnodeops); Modified: head/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vnops.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/fs/smbfs/smbfs_vnops.c Mon Dec 16 00:06:22 2019 (r355790) @@ -114,6 +114,7 @@ struct vop_vector smbfs_vnodeops = { .vop_symlink = smbfs_symlink, .vop_write = smbfs_write, }; +VFS_VOP_VECTOR_REGISTER(smbfs_vnodeops); static int smbfs_access(ap) Modified: head/sys/fs/tmpfs/tmpfs_fifoops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_fifoops.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/fs/tmpfs/tmpfs_fifoops.c Mon Dec 16 00:06:22 2019 (r355790) @@ -75,3 +75,4 @@ struct vop_vector tmpfs_fifoop_entries = { .vop_pathconf = tmpfs_pathconf, .vop_print = tmpfs_print, }; +VFS_VOP_VECTOR_REGISTER(tmpfs_fifoop_entries); Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Mon Dec 16 00:06:22 2019 (r355790) @@ -1636,6 +1636,7 @@ struct vop_vector tmpfs_vnodeop_entries = { .vop_unlock = vop_unlock, .vop_islocked = vop_islocked, }; +VFS_VOP_VECTOR_REGISTER(tmpfs_vnodeop_entries); /* * Same vector for mounts which do not use namecache. @@ -1644,3 +1645,4 @@ struct vop_vector tmpfs_vnodeop_nonc_entries = { .vop_default = &tmpfs_vnodeop_entries, .vop_lookup = tmpfs_lookup, }; +VFS_VOP_VECTOR_REGISTER(tmpfs_vnodeop_nonc_entries); Modified: head/sys/fs/udf/udf_vnops.c ============================================================================== --- head/sys/fs/udf/udf_vnops.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/fs/udf/udf_vnops.c Mon Dec 16 00:06:22 2019 (r355790) @@ -97,6 +97,7 @@ static struct vop_vector udf_vnodeops = { .vop_strategy = udf_strategy, .vop_vptofh = udf_vptofh, }; +VFS_VOP_VECTOR_REGISTER(udf_vnodeops); struct vop_vector udf_fifoops = { .vop_default = &fifo_specops, @@ -108,6 +109,7 @@ struct vop_vector udf_fifoops = { .vop_setattr = udf_setattr, .vop_vptofh = udf_vptofh, }; +VFS_VOP_VECTOR_REGISTER(udf_fifoops); static MALLOC_DEFINE(M_UDFFID, "udf_fid", "UDF FileId structure"); static MALLOC_DEFINE(M_UDFDS, "udf_ds", "UDF Dirstream structure"); Modified: head/sys/fs/unionfs/union_vnops.c ============================================================================== --- head/sys/fs/unionfs/union_vnops.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/fs/unionfs/union_vnops.c Mon Dec 16 00:06:22 2019 (r355790) @@ -2556,3 +2556,4 @@ struct vop_vector unionfs_vnodeops = { .vop_vptofh = unionfs_vptofh, .vop_add_writecount = unionfs_add_writecount, }; +VFS_VOP_VECTOR_REGISTER(unionfs_vnodeops); Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/kern/uipc_mqueue.c Mon Dec 16 00:06:22 2019 (r355790) @@ -2690,6 +2690,7 @@ static struct vop_vector mqfs_vnodeops = { .vop_mkdir = VOP_EOPNOTSUPP, .vop_rmdir = VOP_EOPNOTSUPP }; +VFS_VOP_VECTOR_REGISTER(mqfs_vnodeops); static struct vfsops mqfs_vfsops = { .vfs_init = mqfs_init, Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/kern/vfs_default.c Mon Dec 16 00:06:22 2019 (r355790) @@ -145,6 +145,7 @@ struct vop_vector default_vnodeops = { .vop_add_writecount = vop_stdadd_writecount, .vop_copy_file_range = vop_stdcopy_file_range, }; +VFS_VOP_VECTOR_REGISTER(default_vnodeops); /* * Series of placeholder functions for various error returns for Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/kern/vfs_lookup.c Mon Dec 16 00:06:22 2019 (r355790) @@ -139,6 +139,10 @@ static struct vop_vector crossmp_vnodeops = { .vop_lock1 = crossmp_vop_lock1, .vop_unlock = crossmp_vop_unlock, }; +/* + * VFS_VOP_VECTOR_REGISTER(crossmp_vnodeops) is not used here since the vnode + * gets allocated early. See nameiinit for the direct call below. + */ struct nameicap_tracker { struct vnode *dp; @@ -156,6 +160,7 @@ nameiinit(void *dummy __unused) UMA_ALIGN_PTR, 0); nt_zone = uma_zcreate("rentr", sizeof(struct nameicap_tracker), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); + vfs_vector_op_register(&crossmp_vnodeops); getnewvnode("crossmp", NULL, &crossmp_vnodeops, &vp_crossmp); } SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_SECOND, nameiinit, NULL); Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/kern/vfs_subr.c Mon Dec 16 00:06:22 2019 (r355790) @@ -1558,6 +1558,10 @@ getnewvnode(const char *tag, struct mount *mp, struct int error __unused; CTR3(KTR_VFS, "%s: mp %p with tag %s", __func__, mp, tag); + + KASSERT(vops->registered, + ("%s: not registered vector op %p\n", __func__, vops)); + vp = NULL; td = curthread; if (td->td_vp_reserv > 0) { @@ -4502,6 +4506,7 @@ static struct vop_vector sync_vnodeops = { .vop_unlock = vop_stdunlock, /* unlock */ .vop_islocked = vop_stdislocked, /* islocked */ }; +VFS_VOP_VECTOR_REGISTER(sync_vnodeops); /* * Create a new filesystem syncer vnode for the specified mount point. Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/sys/vnode.h Mon Dec 16 00:06:22 2019 (r355790) @@ -955,6 +955,14 @@ int vn_chown(struct file *fp, uid_t uid, gid_t gid, st void vn_fsid(struct vnode *vp, struct vattr *va); +#include + +#define VFS_VOP_VECTOR_REGISTER(vnodeops) \ + SYSINIT(vfs_vector_##vnodeops##_f, SI_SUB_VFS, SI_ORDER_ANY, \ + vfs_vector_op_register, &vnodeops) + +void vfs_vector_op_register(struct vop_vector *vop); + #endif /* _KERNEL */ #endif /* !_SYS_VNODE_H_ */ Modified: head/sys/tools/vnode_if.awk ============================================================================== --- head/sys/tools/vnode_if.awk Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/tools/vnode_if.awk Mon Dec 16 00:06:22 2019 (r355790) @@ -323,6 +323,7 @@ while ((getline < srcfile) > 0) { } if (cfile) { + funcarr[name] = 1; # Print out the vop_F_vp_offsets structure. This all depends # on naming conventions and nothing else. printc("static int " name "_vp_offsets[] = {"); @@ -361,9 +362,6 @@ while ((getline < srcfile) > 0) { printc(""); printc("\tVNASSERT(a->a_gen.a_desc == &" name "_desc, a->a_" args[0]","); printc("\t (\"Wrong a_desc in " name "(%p, %p)\", a->a_" args[0]", a));"); - printc("\twhile(vop != NULL && \\"); - printc("\t vop->"name" == NULL && vop->vop_bypass == NULL)") - printc("\t\tvop = vop->vop_default;") printc("\tVNASSERT(vop != NULL, a->a_" args[0]", (\"No "name"(%p, %p)\", a->a_" args[0]", a));") printc("\tSDT_PROBE2(vfs, vop, " name ", entry, a->a_" args[0] ", a);\n"); for (i = 0; i < numargs; ++i) @@ -422,9 +420,44 @@ while ((getline < srcfile) > 0) { printc("};\n"); } } - -if (pfile) + +if (cfile) { + printc("void"); + printc("vfs_vector_op_register(struct vop_vector *orig_vop)"); + printc("{"); + printc("\tstruct vop_vector *vop;"); + printc(""); + printc("\tif (orig_vop->registered)"); + printc("\t\tpanic(\"%s: vop_vector %p already registered\",") + printc("\t\t __func__, orig_vop);"); + printc(""); + for (name in funcarr) { + printc("\tvop = orig_vop;"); + printc("\twhile (vop != NULL && \\"); + printc("\t vop->"name" == NULL && vop->vop_bypass == NULL)") + printc("\t\tvop = vop->vop_default;") + printc("\tif (vop != NULL)"); + printc("\t\torig_vop->"name" = vop->"name";"); + printc(""); + } + printc("\tvop = orig_vop;"); + printc("\twhile (vop != NULL && vop->vop_bypass == NULL)") + printc("\t\tvop = vop->vop_default;") + printc("\tif (vop != NULL)"); + printc("\t\torig_vop->vop_bypass = vop->vop_bypass;"); + printc(""); + printc("\torig_vop->registered = true;"); + printc("}") +} + +if (hfile) { + printh("void vfs_vector_op_register(struct vop_vector *orig_vop);"); +} + +if (pfile) { + printp("\tbool\tregistered;") printp("};") +} if (hfile) close(hfile); Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/ufs/ffs/ffs_vnops.c Mon Dec 16 00:06:22 2019 (r355790) @@ -140,6 +140,7 @@ struct vop_vector ffs_vnodeops1 = { .vop_write = ffs_write, .vop_vptofh = ffs_vptofh, }; +VFS_VOP_VECTOR_REGISTER(ffs_vnodeops1); struct vop_vector ffs_fifoops1 = { .vop_default = &ufs_fifoops, @@ -148,6 +149,7 @@ struct vop_vector ffs_fifoops1 = { .vop_lock1 = ffs_lock, .vop_vptofh = ffs_vptofh, }; +VFS_VOP_VECTOR_REGISTER(ffs_fifoops1); /* Global vfs data structures for ufs. */ struct vop_vector ffs_vnodeops2 = { @@ -168,6 +170,7 @@ struct vop_vector ffs_vnodeops2 = { .vop_setextattr = ffs_setextattr, .vop_vptofh = ffs_vptofh, }; +VFS_VOP_VECTOR_REGISTER(ffs_vnodeops2); struct vop_vector ffs_fifoops2 = { .vop_default = &ufs_fifoops, @@ -184,6 +187,7 @@ struct vop_vector ffs_fifoops2 = { .vop_setextattr = ffs_setextattr, .vop_vptofh = ffs_vptofh, }; +VFS_VOP_VECTOR_REGISTER(ffs_fifoops2); /* * Synch an open file. Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Mon Dec 16 00:04:33 2019 (r355789) +++ head/sys/ufs/ufs/ufs_vnops.c Mon Dec 16 00:06:22 2019 (r355790) @@ -2771,6 +2771,7 @@ struct vop_vector ufs_vnodeops = { .vop_aclcheck = ufs_aclcheck, #endif }; +VFS_VOP_VECTOR_REGISTER(ufs_vnodeops); struct vop_vector ufs_fifoops = { .vop_default = &fifo_specops, @@ -2801,3 +2802,4 @@ struct vop_vector ufs_fifoops = { .vop_aclcheck = ufs_aclcheck, #endif }; +VFS_VOP_VECTOR_REGISTER(ufs_fifoops); From owner-svn-src-head@freebsd.org Mon Dec 16 00:07:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 810221D3289; Mon, 16 Dec 2019 00:07: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 47bhRr2tvyz47DB; Mon, 16 Dec 2019 00:07: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 5E8681CEFD; Mon, 16 Dec 2019 00:07: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 xBG07q19031778; Mon, 16 Dec 2019 00:07:52 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBG07qXb031777; Mon, 16 Dec 2019 00:07:52 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201912160007.xBG07qXb031777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 16 Dec 2019 00:07:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355791 - head/sys/tools X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/tools X-SVN-Commit-Revision: 355791 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 00:07:52 -0000 Author: mjg Date: Mon Dec 16 00:07:51 2019 New Revision: 355791 URL: https://svnweb.freebsd.org/changeset/base/355791 Log: vfs: allow tail call optimisation in vops in the common case Most frequently used vops boil down to checking SDT probes, doing the call and checking again. There is no vop_post/pre in their case but the check after the call prevents tail call optimisation from taking place. Instead, check once upfront. Kernels with debug or vops with non-empty vop_post still don't short circuit. Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D22739 Modified: head/sys/tools/vnode_if.awk Modified: head/sys/tools/vnode_if.awk ============================================================================== --- head/sys/tools/vnode_if.awk Mon Dec 16 00:06:22 2019 (r355790) +++ head/sys/tools/vnode_if.awk Mon Dec 16 00:07:51 2019 (r355791) @@ -363,16 +363,20 @@ while ((getline < srcfile) > 0) { printc("\tVNASSERT(a->a_gen.a_desc == &" name "_desc, a->a_" args[0]","); printc("\t (\"Wrong a_desc in " name "(%p, %p)\", a->a_" args[0]", a));"); printc("\tVNASSERT(vop != NULL, a->a_" args[0]", (\"No "name"(%p, %p)\", a->a_" args[0]", a));") - printc("\tSDT_PROBE2(vfs, vop, " name ", entry, a->a_" args[0] ", a);\n"); - for (i = 0; i < numargs; ++i) - add_debug_code(name, args[i], "Entry", "\t"); printc("\tKTR_START" ctrstr); add_pre(name); - printc("\tif (vop->"name" != NULL)") + for (i = 0; i < numargs; ++i) + add_debug_code(name, args[i], "Entry", "\t"); + printc("\tif (__predict_true(!SDT_PROBES_ENABLED() && vop->"name" != NULL)) {"); printc("\t\trc = vop->"name"(a);") - printc("\telse") - printc("\t\trc = vop->vop_bypass(&a->a_gen);") - printc("\tSDT_PROBE3(vfs, vop, " name ", return, a->a_" args[0] ", a, rc);\n"); + printc("\t} else {") + printc("\t\tSDT_PROBE2(vfs, vop, " name ", entry, a->a_" args[0] ", a);"); + printc("\t\tif (vop->"name" != NULL)") + printc("\t\t\trc = vop->"name"(a);") + printc("\t\telse") + printc("\t\t\trc = vop->vop_bypass(&a->a_gen);") + printc("\t\tSDT_PROBE3(vfs, vop, " name ", return, a->a_" args[0] ", a, rc);"); + printc("\t}") printc("\tif (rc == 0) {"); for (i = 0; i < numargs; ++i) add_debug_code(name, args[i], "OK", "\t\t"); From owner-svn-src-head@freebsd.org Mon Dec 16 01:27:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A466A1D4C84; Mon, 16 Dec 2019 01:27:14 +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 47bkCQ3sSlz4BDt; Mon, 16 Dec 2019 01:27:14 +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 7FE6D1DD78; Mon, 16 Dec 2019 01:27:14 +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 xBG1REPp078781; Mon, 16 Dec 2019 01:27:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBG1REFK078780; Mon, 16 Dec 2019 01:27:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201912160127.xBG1REFK078780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 16 Dec 2019 01:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355792 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 355792 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 01:27:14 -0000 Author: markj Date: Mon Dec 16 01:27:14 2019 New Revision: 355792 URL: https://svnweb.freebsd.org/changeset/base/355792 Log: Remove a declaration of sched_clock() redundant after r355779. Modified: head/sys/sys/sched.h Modified: head/sys/sys/sched.h ============================================================================== --- head/sys/sys/sched.h Mon Dec 16 00:07:51 2019 (r355791) +++ head/sys/sys/sched.h Mon Dec 16 01:27:14 2019 (r355792) @@ -134,7 +134,6 @@ sched_userret(struct thread *td) * Threads are moved on and off of run queues */ void sched_add(struct thread *td, int flags); -void sched_clock(struct thread *td, int ticks); struct thread *sched_choose(void); void sched_clock(struct thread *td, int cnt); void sched_idletd(void *); From owner-svn-src-head@freebsd.org Mon Dec 16 01:37:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8331F1D4EE0; Mon, 16 Dec 2019 01:37:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47bkQm2tDnz4Bbd; Mon, 16 Dec 2019 01:37:04 +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 5E0521DF2E; Mon, 16 Dec 2019 01:37:04 +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 xBG1b4iX084412; Mon, 16 Dec 2019 01:37:04 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBG1b3En084409; Mon, 16 Dec 2019 01:37:03 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912160137.xBG1b3En084409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 16 Dec 2019 01:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355793 - in head/sys: arm/versatile dev/gpio dev/hyperv/input dev/usb/input X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: arm/versatile dev/gpio dev/hyperv/input dev/usb/input X-SVN-Commit-Revision: 355793 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 01:37:04 -0000 Author: kevans Date: Mon Dec 16 01:37:03 2019 New Revision: 355793 URL: https://svnweb.freebsd.org/changeset/base/355793 Log: kbd drivers: use kbdd_* indirection for diag invocation These invocations were directly calling enkbd_diag(), rather than indirection back through kbdd_diag/kbdsw. While they're functionally equivent, invoking kbdd_diag where feasible (i.e. not in a diag implementation) makes it easier to visually identify locking needs in these other drivers. Modified: head/sys/arm/versatile/pl050.c head/sys/dev/gpio/gpiokeys.c head/sys/dev/hyperv/input/hv_kbd.c head/sys/dev/usb/input/ukbd.c Modified: head/sys/arm/versatile/pl050.c ============================================================================== --- head/sys/arm/versatile/pl050.c Mon Dec 16 01:27:14 2019 (r355792) +++ head/sys/arm/versatile/pl050.c Mon Dec 16 01:37:03 2019 (r355793) @@ -717,7 +717,7 @@ pl050_kmi_attach(device_t dev) #endif if (bootverbose) { - genkbd_diag(kbd, bootverbose); + kbdd_diag(kbd, bootverbose); } kmi_attached = 1; return (0); Modified: head/sys/dev/gpio/gpiokeys.c ============================================================================== --- head/sys/dev/gpio/gpiokeys.c Mon Dec 16 01:27:14 2019 (r355792) +++ head/sys/dev/gpio/gpiokeys.c Mon Dec 16 01:37:03 2019 (r355793) @@ -432,7 +432,7 @@ gpiokeys_attach(device_t dev) #endif if (bootverbose) { - genkbd_diag(kbd, 1); + kbdd_diag(kbd, 1); } total_keys = 0; Modified: head/sys/dev/hyperv/input/hv_kbd.c ============================================================================== --- head/sys/dev/hyperv/input/hv_kbd.c Mon Dec 16 01:27:14 2019 (r355792) +++ head/sys/dev/hyperv/input/hv_kbd.c Mon Dec 16 01:37:03 2019 (r355793) @@ -535,7 +535,7 @@ hv_kbd_drv_attach(device_t dev) } #endif if (bootverbose) { - genkbd_diag(kbd, bootverbose); + kbdd_diag(kbd, bootverbose); } return (0); detach: Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Mon Dec 16 01:27:14 2019 (r355792) +++ head/sys/dev/usb/input/ukbd.c Mon Dec 16 01:37:03 2019 (r355793) @@ -1369,7 +1369,7 @@ ukbd_attach(device_t dev) sc->sc_flags |= UKBD_FLAG_ATTACHED; if (bootverbose) { - genkbd_diag(kbd, bootverbose); + kbdd_diag(kbd, bootverbose); } #ifdef USB_DEBUG From owner-svn-src-head@freebsd.org Mon Dec 16 02:05:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC4161D576C; Mon, 16 Dec 2019 02:05: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 47bl3s4Kq2z4Cjf; Mon, 16 Dec 2019 02:05: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 8A3041E480; Mon, 16 Dec 2019 02:05: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 xBG25jri002251; Mon, 16 Dec 2019 02:05:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBG25iWs002247; Mon, 16 Dec 2019 02:05:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912160205.xBG25iWs002247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 16 Dec 2019 02:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355794 - in head/sys/dev: adb atkbdc hyperv/input uart X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys/dev: adb atkbdc hyperv/input uart X-SVN-Commit-Revision: 355794 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 02:05:45 -0000 Author: kevans Date: Mon Dec 16 02:05:44 2019 New Revision: 355794 URL: https://svnweb.freebsd.org/changeset/base/355794 Log: keyboard switch definitions: standardize on c99 initializers A future change will provide default implementations for some of these where it makes sense and most of them are already using the genkbd implementation (e.g. get_fkeystr, diag). Modified: head/sys/dev/adb/adb_kbd.c head/sys/dev/atkbdc/atkbd.c head/sys/dev/hyperv/input/hv_kbd.c head/sys/dev/uart/uart_kbd_sun.c Modified: head/sys/dev/adb/adb_kbd.c ============================================================================== --- head/sys/dev/adb/adb_kbd.c Mon Dec 16 01:37:03 2019 (r355793) +++ head/sys/dev/adb/adb_kbd.c Mon Dec 16 02:05:44 2019 (r355794) @@ -198,25 +198,25 @@ static kbd_set_state_t akbd_set_state; static kbd_poll_mode_t akbd_poll; keyboard_switch_t akbdsw = { - akbd_probe, - akbd_init, - akbd_term, - akbd_interrupt, - akbd_test_if, - akbd_enable, - akbd_disable, - akbd_read, - akbd_check, - akbd_read_char, - akbd_check_char, - akbd_ioctl, - akbd_lock, - akbd_clear_state, - akbd_get_state, - akbd_set_state, - genkbd_get_fkeystr, - akbd_poll, - genkbd_diag, + .probe = akbd_probe, + .init = akbd_init, + .term = akbd_term, + .intr = akbd_interrupt, + .test_if = akbd_test_if, + .enable = akbd_enable, + .disable = akbd_disable, + .read = akbd_read, + .check = akbd_check, + .read_char = akbd_read_char, + .check_char = akbd_check_char, + .ioctl = akbd_ioctl, + .lock = akbd_lock, + .clear_state = akbd_clear_state, + .get_state = akbd_get_state, + .set_state = akbd_set_state, + .get_fkeystr = genkbd_get_fkeystr, + .poll = akbd_poll, + .diag = genkbd_diag, }; KEYBOARD_DRIVER(akbd, akbdsw, akbd_configure); Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Mon Dec 16 01:37:03 2019 (r355793) +++ head/sys/dev/atkbdc/atkbd.c Mon Dec 16 02:05:44 2019 (r355794) @@ -231,25 +231,25 @@ static kbd_set_state_t atkbd_set_state; static kbd_poll_mode_t atkbd_poll; static keyboard_switch_t atkbdsw = { - atkbd_probe, - atkbd_init, - atkbd_term, - atkbd_intr, - atkbd_test_if, - atkbd_enable, - atkbd_disable, - atkbd_read, - atkbd_check, - atkbd_read_char, - atkbd_check_char, - atkbd_ioctl, - atkbd_lock, - atkbd_clear_state, - atkbd_get_state, - atkbd_set_state, - genkbd_get_fkeystr, - atkbd_poll, - genkbd_diag, + .probe = atkbd_probe, + .init = atkbd_init, + .term = atkbd_term, + .intr = atkbd_intr, + .test_if = atkbd_test_if, + .enable = atkbd_enable, + .disable = atkbd_disable, + .read = atkbd_read, + .check = atkbd_check, + .read_char = atkbd_read_char, + .check_char = atkbd_check_char, + .ioctl = atkbd_ioctl, + .lock = atkbd_lock, + .clear_state = atkbd_clear_state, + .get_state = atkbd_get_state, + .set_state = atkbd_set_state, + .get_fkeystr = genkbd_get_fkeystr, + .poll = atkbd_poll, + .diag = genkbd_diag, }; KEYBOARD_DRIVER(atkbd, atkbdsw, atkbd_configure); Modified: head/sys/dev/hyperv/input/hv_kbd.c ============================================================================== --- head/sys/dev/hyperv/input/hv_kbd.c Mon Dec 16 01:37:03 2019 (r355793) +++ head/sys/dev/hyperv/input/hv_kbd.c Mon Dec 16 02:05:44 2019 (r355794) @@ -446,25 +446,25 @@ hvkbd_read(keyboard_t *kbd, int wait) } static keyboard_switch_t hvkbdsw = { - hvkbd_probe, /* not used */ - hvkbd_init, - hvkbd_term, /* not used */ - hvkbd_intr, /* not used */ - hvkbd_test_if, /* not used */ - hvkbd_enable, - hvkbd_disable, - hvkbd_read, - hvkbd_check, - hvkbd_read_char, - hvkbd_check_char, - hvkbd_ioctl, - hvkbd_lock, /* not used */ - hvkbd_clear_state, - hvkbd_get_state, /* not used */ - hvkbd_set_state, /* not used */ - genkbd_get_fkeystr, - hvkbd_poll, - genkbd_diag, + .probe = hvkbd_probe, /* not used */ + .init = hvkbd_init, + .term = hvkbd_term, /* not used */ + .intr = hvkbd_intr, /* not used */ + .test_if = hvkbd_test_if, /* not used */ + .enable = hvkbd_enable, + .disable = hvkbd_disable, + .read = hvkbd_read, + .check = hvkbd_check, + .read_char = hvkbd_read_char, + .check_char = hvkbd_check_char, + .ioctl = hvkbd_ioctl, + .lock = hvkbd_lock, /* not used */ + .clear_state = hvkbd_clear_state, + .get_state = hvkbd_get_state, /* not used */ + .set_state = hvkbd_set_state, /* not used */ + .get_fkeystr = genkbd_get_fkeystr, + .poll = hvkbd_poll, + .diag = genkbd_diag, }; KEYBOARD_DRIVER(hvkbd, hvkbdsw, hvkbd_configure); Modified: head/sys/dev/uart/uart_kbd_sun.c ============================================================================== --- head/sys/dev/uart/uart_kbd_sun.c Mon Dec 16 01:37:03 2019 (r355793) +++ head/sys/dev/uart/uart_kbd_sun.c Mon Dec 16 02:05:44 2019 (r355794) @@ -118,25 +118,25 @@ static int keycode2scancode(int keycode, int shift, in #endif static keyboard_switch_t sunkbdsw = { - sunkbd_probe, - sunkbd_init, - sunkbd_term, - sunkbd_intr, - sunkbd_test_if, - sunkbd_enable, - sunkbd_disable, - sunkbd_read, - sunkbd_check, - sunkbd_read_char, - sunkbd_check_char, - sunkbd_ioctl, - sunkbd_lock, - sunkbd_clear_state, - sunkbd_get_state, - sunkbd_set_state, - genkbd_get_fkeystr, - sunkbd_poll_mode, - sunkbd_diag + .probe = sunkbd_probe, + .init = sunkbd_init, + .term = sunkbd_term, + .intr = sunkbd_intr, + .test_if = sunkbd_test_if, + .enable = sunkbd_enable, + .disable = sunkbd_disable, + .read = sunkbd_read, + .check = sunkbd_check, + .read_char = sunkbd_read_char, + .check_char = sunkbd_check_char, + .ioctl = sunkbd_ioctl, + .lock = sunkbd_lock, + .clear_state = sunkbd_clear_state, + .get_state = sunkbd_get_state, + .set_state = sunkbd_set_state, + .get_fkeystr = genkbd_get_fkeystr, + .poll = sunkbd_poll_mode, + .diag = sunkbd_diag }; KEYBOARD_DRIVER(sunkbd, sunkbdsw, sunkbd_configure); From owner-svn-src-head@freebsd.org Mon Dec 16 02:44:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B815E1D6406; Mon, 16 Dec 2019 02:44: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 47blx64FnHz4FM0; Mon, 16 Dec 2019 02:44: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 88A981EB7A; Mon, 16 Dec 2019 02:44: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 xBG2iwij025550; Mon, 16 Dec 2019 02:44:58 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBG2iubq025538; Mon, 16 Dec 2019 02:44:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912160244.xBG2iubq025538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 16 Dec 2019 02:44:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355796 - in head/sys/dev: adb atkbdc gpio hyperv/input kbd kbdmux uart usb/input vkbd X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys/dev: adb atkbdc gpio hyperv/input kbd kbdmux uart usb/input vkbd X-SVN-Commit-Revision: 355796 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 02:44:58 -0000 Author: kevans Date: Mon Dec 16 02:44:56 2019 New Revision: 355796 URL: https://svnweb.freebsd.org/changeset/base/355796 Log: kbd: provide default implementations of get_fkeystr/diag Most keyboard drivers are using the genkbd implementations as it is; formally use them for any that aren't set and make genkbd_get_fkeystr/genkbd_diag private. Modified: head/sys/dev/adb/adb_kbd.c head/sys/dev/atkbdc/atkbd.c head/sys/dev/gpio/gpiokeys.c head/sys/dev/hyperv/input/hv_kbd.c head/sys/dev/kbd/kbd.c head/sys/dev/kbd/kbdreg.h head/sys/dev/kbdmux/kbdmux.c head/sys/dev/uart/uart_kbd_sun.c head/sys/dev/usb/input/ukbd.c head/sys/dev/vkbd/vkbd.c Modified: head/sys/dev/adb/adb_kbd.c ============================================================================== --- head/sys/dev/adb/adb_kbd.c Mon Dec 16 02:38:47 2019 (r355795) +++ head/sys/dev/adb/adb_kbd.c Mon Dec 16 02:44:56 2019 (r355796) @@ -214,9 +214,7 @@ keyboard_switch_t akbdsw = { .clear_state = akbd_clear_state, .get_state = akbd_get_state, .set_state = akbd_set_state, - .get_fkeystr = genkbd_get_fkeystr, .poll = akbd_poll, - .diag = genkbd_diag, }; KEYBOARD_DRIVER(akbd, akbdsw, akbd_configure); Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Mon Dec 16 02:38:47 2019 (r355795) +++ head/sys/dev/atkbdc/atkbd.c Mon Dec 16 02:44:56 2019 (r355796) @@ -247,9 +247,7 @@ static keyboard_switch_t atkbdsw = { .clear_state = atkbd_clear_state, .get_state = atkbd_get_state, .set_state = atkbd_set_state, - .get_fkeystr = genkbd_get_fkeystr, .poll = atkbd_poll, - .diag = genkbd_diag, }; KEYBOARD_DRIVER(atkbd, atkbdsw, atkbd_configure); Modified: head/sys/dev/gpio/gpiokeys.c ============================================================================== --- head/sys/dev/gpio/gpiokeys.c Mon Dec 16 02:38:47 2019 (r355795) +++ head/sys/dev/gpio/gpiokeys.c Mon Dec 16 02:44:56 2019 (r355796) @@ -975,9 +975,7 @@ static keyboard_switch_t gpiokeyssw = { .clear_state = &gpiokeys_clear_state, .get_state = &gpiokeys_get_state, .set_state = &gpiokeys_set_state, - .get_fkeystr = &genkbd_get_fkeystr, .poll = &gpiokeys_poll, - .diag = &genkbd_diag, }; KEYBOARD_DRIVER(gpiokeys, gpiokeyssw, gpiokeys_configure); Modified: head/sys/dev/hyperv/input/hv_kbd.c ============================================================================== --- head/sys/dev/hyperv/input/hv_kbd.c Mon Dec 16 02:38:47 2019 (r355795) +++ head/sys/dev/hyperv/input/hv_kbd.c Mon Dec 16 02:44:56 2019 (r355796) @@ -462,9 +462,7 @@ static keyboard_switch_t hvkbdsw = { .clear_state = hvkbd_clear_state, .get_state = hvkbd_get_state, /* not used */ .set_state = hvkbd_set_state, /* not used */ - .get_fkeystr = genkbd_get_fkeystr, .poll = hvkbd_poll, - .diag = genkbd_diag, }; KEYBOARD_DRIVER(hvkbd, hvkbdsw, hvkbd_configure); Modified: head/sys/dev/kbd/kbd.c ============================================================================== --- head/sys/dev/kbd/kbd.c Mon Dec 16 02:38:47 2019 (r355795) +++ head/sys/dev/kbd/kbd.c Mon Dec 16 02:44:56 2019 (r355796) @@ -64,6 +64,9 @@ typedef struct genkbd_softc { unsigned int gkb_q_length; } genkbd_softc_t; +static u_char *genkbd_get_fkeystr(keyboard_t *kbd, int fkey, size_t *len); +static void genkbd_diag(keyboard_t *kbd, int level); + static SLIST_HEAD(, keyboard_driver) keyboard_drivers = SLIST_HEAD_INITIALIZER(keyboard_drivers); @@ -176,6 +179,10 @@ kbd_add_driver(keyboard_driver_t *driver) { if (SLIST_NEXT(driver, link)) return (EINVAL); + if (driver->kbdsw->get_fkeystr == NULL) + driver->kbdsw->get_fkeystr = genkbd_get_fkeystr; + if (driver->kbdsw->diag == NULL) + driver->kbdsw->diag = genkbd_diag; SLIST_INSERT_HEAD(&keyboard_drivers, driver, link); return (0); } @@ -1121,7 +1128,7 @@ fkey_change_ok(fkeytab_t *oldkey, fkeyarg_t *newkey, s #endif /* get a pointer to the string associated with the given function key */ -u_char * +static u_char * genkbd_get_fkeystr(keyboard_t *kbd, int fkey, size_t *len) { if (kbd == NULL) @@ -1154,7 +1161,7 @@ get_kbd_type_name(int type) return ("unknown"); } -void +static void genkbd_diag(keyboard_t *kbd, int level) { if (level > 0) { Modified: head/sys/dev/kbd/kbdreg.h ============================================================================== --- head/sys/dev/kbd/kbdreg.h Mon Dec 16 02:38:47 2019 (r355795) +++ head/sys/dev/kbd/kbdreg.h Mon Dec 16 02:44:56 2019 (r355796) @@ -392,9 +392,6 @@ int kbd_detach(keyboard_t *kbd); #define LED_MASK (LED_CAP | LED_NUM | LED_SCR) */ -kbd_get_fkeystr_t genkbd_get_fkeystr; -kbd_diag_t genkbd_diag; - int genkbd_commonioctl(keyboard_t *kbd, u_long cmd, caddr_t arg); int genkbd_keyaction(keyboard_t *kbd, int keycode, int up, int *shiftstate, int *accents); Modified: head/sys/dev/kbdmux/kbdmux.c ============================================================================== --- head/sys/dev/kbdmux/kbdmux.c Mon Dec 16 02:38:47 2019 (r355795) +++ head/sys/dev/kbdmux/kbdmux.c Mon Dec 16 02:44:56 2019 (r355796) @@ -378,9 +378,7 @@ static keyboard_switch_t kbdmuxsw = { .clear_state = kbdmux_clear_state, .get_state = kbdmux_get_state, .set_state = kbdmux_set_state, - .get_fkeystr = genkbd_get_fkeystr, .poll = kbdmux_poll, - .diag = genkbd_diag, }; #ifdef EVDEV_SUPPORT Modified: head/sys/dev/uart/uart_kbd_sun.c ============================================================================== --- head/sys/dev/uart/uart_kbd_sun.c Mon Dec 16 02:38:47 2019 (r355795) +++ head/sys/dev/uart/uart_kbd_sun.c Mon Dec 16 02:44:56 2019 (r355796) @@ -134,7 +134,6 @@ static keyboard_switch_t sunkbdsw = { .clear_state = sunkbd_clear_state, .get_state = sunkbd_get_state, .set_state = sunkbd_set_state, - .get_fkeystr = genkbd_get_fkeystr, .poll = sunkbd_poll_mode, .diag = sunkbd_diag }; Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Mon Dec 16 02:38:47 2019 (r355795) +++ head/sys/dev/usb/input/ukbd.c Mon Dec 16 02:44:56 2019 (r355796) @@ -2282,9 +2282,7 @@ static keyboard_switch_t ukbdsw = { .clear_state = &ukbd_clear_state, .get_state = &ukbd_get_state, .set_state = &ukbd_set_state, - .get_fkeystr = &genkbd_get_fkeystr, .poll = &ukbd_poll, - .diag = &genkbd_diag, }; KEYBOARD_DRIVER(ukbd, ukbdsw, ukbd_configure); Modified: head/sys/dev/vkbd/vkbd.c ============================================================================== --- head/sys/dev/vkbd/vkbd.c Mon Dec 16 02:38:47 2019 (r355795) +++ head/sys/dev/vkbd/vkbd.c Mon Dec 16 02:44:56 2019 (r355796) @@ -579,9 +579,7 @@ static keyboard_switch_t vkbdsw = { .clear_state = vkbd_clear_state, .get_state = vkbd_get_state, .set_state = vkbd_set_state, - .get_fkeystr = genkbd_get_fkeystr, .poll = vkbd_poll, - .diag = genkbd_diag, }; static int typematic(int delay, int rate); From owner-svn-src-head@freebsd.org Mon Dec 16 03:05:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F12321D69AE; Mon, 16 Dec 2019 03:05: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 47bmNv69Y6z4GSR; Mon, 16 Dec 2019 03:05: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 CD69B1EF8F; Mon, 16 Dec 2019 03:05:35 +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 xBG35ZvK038663; Mon, 16 Dec 2019 03:05:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBG35Z3N038661; Mon, 16 Dec 2019 03:05:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912160305.xBG35Z3N038661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 16 Dec 2019 03:05:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355797 - head/sys/arm/samsung/exynos X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/samsung/exynos X-SVN-Commit-Revision: 355797 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 03:05:36 -0000 Author: kevans Date: Mon Dec 16 03:05:35 2019 New Revision: 355797 URL: https://svnweb.freebsd.org/changeset/base/355797 Log: chrome_kb: remove default get_fkeystr/diag implementations This file was missed in r355796, but no harm would have come from this. Modified: head/sys/arm/samsung/exynos/chrome_kb.c Modified: head/sys/arm/samsung/exynos/chrome_kb.c ============================================================================== --- head/sys/arm/samsung/exynos/chrome_kb.c Mon Dec 16 02:44:56 2019 (r355796) +++ head/sys/arm/samsung/exynos/chrome_kb.c Mon Dec 16 03:05:35 2019 (r355797) @@ -662,9 +662,7 @@ keyboard_switch_t ckbdsw = { .clear_state = &ckb_clear_state, .get_state = &ckb_get_state, .set_state = &ckb_set_state, - .get_fkeystr = &genkbd_get_fkeystr, .poll = &ckb_poll, - .diag = &genkbd_diag, }; static int From owner-svn-src-head@freebsd.org Mon Dec 16 03:12:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8EAB41D6C70; Mon, 16 Dec 2019 03:12: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 47bmYL21lkz4H28; Mon, 16 Dec 2019 03:12: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 40AF61F152; Mon, 16 Dec 2019 03:12: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 xBG3Csld044705; Mon, 16 Dec 2019 03:12:54 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBG3Crw0044702; Mon, 16 Dec 2019 03:12:53 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912160312.xBG3Crw0044702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 16 Dec 2019 03:12:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355798 - in head/sys: dev/kbd sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: dev/kbd sys X-SVN-Commit-Revision: 355798 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 03:12:54 -0000 Author: kevans Date: Mon Dec 16 03:12:53 2019 New Revision: 355798 URL: https://svnweb.freebsd.org/changeset/base/355798 Log: kbd: remove kbdsw, store pointer to driver in each keyboard_t The previous implementation relied on a kbdsw array that mirrored the global keyboards array. This is fine, but also requires extra locking consideration when accessing to ensure that it's not being resized as new keyboards are added. The extra pointer costs little in a struct that there are relatively few of on any given system, and simplifies locking requirements ever-so-slightly as we only need to consider the locking requirements of whichever method is being invoked. __FreeBSD_version is bumped as any kbd modules will need rebuilt following this change. Modified: head/sys/dev/kbd/kbd.c head/sys/dev/kbd/kbdreg.h head/sys/sys/param.h Modified: head/sys/dev/kbd/kbd.c ============================================================================== --- head/sys/dev/kbd/kbd.c Mon Dec 16 03:05:35 2019 (r355797) +++ head/sys/dev/kbd/kbd.c Mon Dec 16 03:12:53 2019 (r355798) @@ -83,8 +83,6 @@ SET_DECLARE(kbddriver_set, const keyboard_driver_t); static int keyboards = 1; static keyboard_t *kbd_ini; static keyboard_t **keyboard = &kbd_ini; -static keyboard_switch_t *kbdsw_ini; - keyboard_switch_t **kbdsw = &kbdsw_ini; static int keymap_restrict_change; static SYSCTL_NODE(_hw, OID_AUTO, kbd, CTLFLAG_RD, 0, "kbd"); @@ -97,7 +95,6 @@ static int kbd_realloc_array(void) { keyboard_t **new_kbd; - keyboard_switch_t **new_kbdsw; int newsize; int s; @@ -108,21 +105,10 @@ kbd_realloc_array(void) splx(s); return (ENOMEM); } - new_kbdsw = malloc(sizeof(*new_kbdsw)*newsize, M_DEVBUF, - M_NOWAIT|M_ZERO); - if (new_kbdsw == NULL) { - free(new_kbd, M_DEVBUF); - splx(s); - return (ENOMEM); - } bcopy(keyboard, new_kbd, sizeof(*keyboard)*keyboards); - bcopy(kbdsw, new_kbdsw, sizeof(*kbdsw)*keyboards); - if (keyboards > 1) { + if (keyboards > 1) free(keyboard, M_DEVBUF); - free(kbdsw, M_DEVBUF); - } keyboard = new_kbd; - kbdsw = new_kbdsw; keyboards = newsize; splx(s); @@ -226,8 +212,8 @@ kbd_register(keyboard_t *kbd) SLIST_FOREACH(p, &keyboard_drivers, link) { if (strcmp(p->name, kbd->kb_name) == 0) { + kbd->kb_drv = p; keyboard[index] = kbd; - kbdsw[index] = p->kbdsw; if (mux != NULL) { bzero(&ki, sizeof(ki)); @@ -243,8 +229,8 @@ kbd_register(keyboard_t *kbd) SET_FOREACH(list, kbddriver_set) { p = *list; if (strcmp(p->name, kbd->kb_name) == 0) { + kbd->kb_drv = p; keyboard[index] = kbd; - kbdsw[index] = p->kbdsw; if (mux != NULL) { bzero(&ki, sizeof(ki)); @@ -287,7 +273,6 @@ kbd_unregister(keyboard_t *kbd) } KBD_INVALID(kbd); keyboard[kbd->kb_index] = NULL; - kbdsw[kbd->kb_index] = NULL; splx(s); return (0); Modified: head/sys/dev/kbd/kbdreg.h ============================================================================== --- head/sys/dev/kbd/kbdreg.h Mon Dec 16 03:05:35 2019 (r355797) +++ head/sys/dev/kbd/kbdreg.h Mon Dec 16 03:12:53 2019 (r355798) @@ -41,6 +41,30 @@ struct cdevsw; /* call back funcion */ typedef int kbd_callback_func_t(keyboard_t *kbd, int event, void *arg); + +/* keyboard function table */ +typedef int kbd_probe_t(int unit, void *arg, int flags); +typedef int kbd_init_t(int unit, keyboard_t **kbdp, void *arg, + int flags); +typedef int kbd_term_t(keyboard_t *kbd); +typedef int kbd_intr_t(keyboard_t *kbd, void *arg); +typedef int kbd_test_if_t(keyboard_t *kbd); +typedef int kbd_enable_t(keyboard_t *kbd); +typedef int kbd_disable_t(keyboard_t *kbd); +typedef int kbd_read_t(keyboard_t *kbd, int wait); +typedef int kbd_check_t(keyboard_t *kbd); +typedef u_int kbd_read_char_t(keyboard_t *kbd, int wait); +typedef int kbd_check_char_t(keyboard_t *kbd); +typedef int kbd_ioctl_t(keyboard_t *kbd, u_long cmd, caddr_t data); +typedef int kbd_lock_t(keyboard_t *kbd, int lock); +typedef void kbd_clear_state_t(keyboard_t *kbd); +typedef int kbd_get_state_t(keyboard_t *kbd, void *buf, size_t len); +typedef int kbd_set_state_t(keyboard_t *kbd, void *buf, size_t len); +typedef u_char *kbd_get_fkeystr_t(keyboard_t *kbd, int fkey, + size_t *len); +typedef int kbd_poll_mode_t(keyboard_t *kbd, int on); +typedef void kbd_diag_t(keyboard_t *kbd, int level); + /* event types */ #define KBDIO_KEYINPUT 0 #define KBDIO_UNLOADING 1 @@ -50,6 +74,36 @@ typedef struct keyboard_callback { void *kc_arg; } keyboard_callback_t; +typedef struct keyboard_switch { + kbd_probe_t *probe; + kbd_init_t *init; + kbd_term_t *term; + kbd_intr_t *intr; + kbd_test_if_t *test_if; + kbd_enable_t *enable; + kbd_disable_t *disable; + kbd_read_t *read; + kbd_check_t *check; + kbd_read_char_t *read_char; + kbd_check_char_t *check_char; + kbd_ioctl_t *ioctl; + kbd_lock_t *lock; + kbd_clear_state_t *clear_state; + kbd_get_state_t *get_state; + kbd_set_state_t *set_state; + kbd_get_fkeystr_t *get_fkeystr; + kbd_poll_mode_t *poll; + kbd_diag_t *diag; +} keyboard_switch_t; + +/* keyboard driver */ +typedef struct keyboard_driver { + SLIST_ENTRY(keyboard_driver) link; + char *name; + keyboard_switch_t *kbdsw; + int (*configure)(int); /* backdoor for the console driver */ +} keyboard_driver_t; + /* keyboard */ struct keyboard { /* the following fields are managed by kbdio */ @@ -94,6 +148,7 @@ struct keyboard { unsigned long kb_count; /* # of processed key strokes */ u_char kb_lastact[NUM_KEYS/2]; struct cdev *kb_dev; + const keyboard_driver_t *kb_drv; }; #define KBD_IS_VALID(k) ((k)->kb_flags & KB_VALID) @@ -118,61 +173,6 @@ struct keyboard { #define KBD_DEACTIVATE(k) (--(k)->kb_active) #define KBD_LED_VAL(k) ((k)->kb_led) -/* keyboard function table */ -typedef int kbd_probe_t(int unit, void *arg, int flags); -typedef int kbd_init_t(int unit, keyboard_t **kbdp, void *arg, - int flags); -typedef int kbd_term_t(keyboard_t *kbd); -typedef int kbd_intr_t(keyboard_t *kbd, void *arg); -typedef int kbd_test_if_t(keyboard_t *kbd); -typedef int kbd_enable_t(keyboard_t *kbd); -typedef int kbd_disable_t(keyboard_t *kbd); -typedef int kbd_read_t(keyboard_t *kbd, int wait); -typedef int kbd_check_t(keyboard_t *kbd); -typedef u_int kbd_read_char_t(keyboard_t *kbd, int wait); -typedef int kbd_check_char_t(keyboard_t *kbd); -typedef int kbd_ioctl_t(keyboard_t *kbd, u_long cmd, caddr_t data); -typedef int kbd_lock_t(keyboard_t *kbd, int lock); -typedef void kbd_clear_state_t(keyboard_t *kbd); -typedef int kbd_get_state_t(keyboard_t *kbd, void *buf, size_t len); -typedef int kbd_set_state_t(keyboard_t *kbd, void *buf, size_t len); -typedef u_char *kbd_get_fkeystr_t(keyboard_t *kbd, int fkey, - size_t *len); -typedef int kbd_poll_mode_t(keyboard_t *kbd, int on); -typedef void kbd_diag_t(keyboard_t *kbd, int level); - -typedef struct keyboard_switch { - kbd_probe_t *probe; - kbd_init_t *init; - kbd_term_t *term; - kbd_intr_t *intr; - kbd_test_if_t *test_if; - kbd_enable_t *enable; - kbd_disable_t *disable; - kbd_read_t *read; - kbd_check_t *check; - kbd_read_char_t *read_char; - kbd_check_char_t *check_char; - kbd_ioctl_t *ioctl; - kbd_lock_t *lock; - kbd_clear_state_t *clear_state; - kbd_get_state_t *get_state; - kbd_set_state_t *set_state; - kbd_get_fkeystr_t *get_fkeystr; - kbd_poll_mode_t *poll; - kbd_diag_t *diag; -} keyboard_switch_t; - -/* keyboard driver */ -typedef struct keyboard_driver { - SLIST_ENTRY(keyboard_driver) link; - char *name; - keyboard_switch_t *kbdsw; - int (*configure)(int); /* backdoor for the console driver */ -} keyboard_driver_t; - -extern keyboard_switch_t **kbdsw; - /* * Keyboard disciplines: call actual handlers via kbdsw[]. */ @@ -180,77 +180,77 @@ static __inline int kbdd_probe(keyboard_t *kbd, int unit, void *arg, int flags) { - return ((*kbdsw[kbd->kb_index]->probe)(unit, arg, flags)); + return ((*kbd->kb_drv->kbdsw->probe)(unit, arg, flags)); } static __inline int kbdd_init(keyboard_t *kbd, int unit, keyboard_t **kbdpp, void *arg, int flags) { - return ((*kbdsw[kbd->kb_index]->init)(unit, kbdpp, arg, flags)); + return ((*kbd->kb_drv->kbdsw->init)(unit, kbdpp, arg, flags)); } static __inline int kbdd_term(keyboard_t *kbd) { - return ((*kbdsw[kbd->kb_index]->term)(kbd)); + return ((*kbd->kb_drv->kbdsw->term)(kbd)); } static __inline int kbdd_intr(keyboard_t *kbd, void *arg) { - return ((*kbdsw[kbd->kb_index]->intr)(kbd, arg)); + return ((*kbd->kb_drv->kbdsw->intr)(kbd, arg)); } static __inline int kbdd_test_if(keyboard_t *kbd) { - return ((*kbdsw[kbd->kb_index]->test_if)(kbd)); + return ((*kbd->kb_drv->kbdsw->test_if)(kbd)); } static __inline int kbdd_enable(keyboard_t *kbd) { - return ((*kbdsw[kbd->kb_index]->enable)(kbd)); + return ((*kbd->kb_drv->kbdsw->enable)(kbd)); } static __inline int kbdd_disable(keyboard_t *kbd) { - return ((*kbdsw[kbd->kb_index]->disable)(kbd)); + return ((*kbd->kb_drv->kbdsw->disable)(kbd)); } static __inline int kbdd_read(keyboard_t *kbd, int wait) { - return ((*kbdsw[kbd->kb_index]->read)(kbd, wait)); + return ((*kbd->kb_drv->kbdsw->read)(kbd, wait)); } static __inline int kbdd_check(keyboard_t *kbd) { - return ((*kbdsw[kbd->kb_index]->check)(kbd)); + return ((*kbd->kb_drv->kbdsw->check)(kbd)); } static __inline u_int kbdd_read_char(keyboard_t *kbd, int wait) { - return ((*kbdsw[kbd->kb_index]->read_char)(kbd, wait)); + return ((*kbd->kb_drv->kbdsw->read_char)(kbd, wait)); } static __inline int kbdd_check_char(keyboard_t *kbd) { - return ((*kbdsw[kbd->kb_index]->check_char)(kbd)); + return ((*kbd->kb_drv->kbdsw->check_char)(kbd)); } static __inline int @@ -259,56 +259,56 @@ kbdd_ioctl(keyboard_t *kbd, u_long cmd, caddr_t data) if (kbd == NULL) return (ENODEV); - return ((*kbdsw[kbd->kb_index]->ioctl)(kbd, cmd, data)); + return ((*kbd->kb_drv->kbdsw->ioctl)(kbd, cmd, data)); } static __inline int kbdd_lock(keyboard_t *kbd, int lock) { - return ((*kbdsw[kbd->kb_index]->lock)(kbd, lock)); + return ((*kbd->kb_drv->kbdsw->lock)(kbd, lock)); } static __inline void kbdd_clear_state(keyboard_t *kbd) { - (*kbdsw[kbd->kb_index]->clear_state)(kbd); + (*kbd->kb_drv->kbdsw->clear_state)(kbd); } static __inline int kbdd_get_state(keyboard_t *kbd, void *buf, int len) { - return ((*kbdsw[kbd->kb_index]->get_state)(kbd, buf, len)); + return ((*kbd->kb_drv->kbdsw->get_state)(kbd, buf, len)); } static __inline int kbdd_set_state(keyboard_t *kbd, void *buf, int len) { - return ((*kbdsw[kbd->kb_index]->set_state)(kbd, buf, len)); + return ((*kbd->kb_drv->kbdsw->set_state)(kbd, buf, len)); } static __inline u_char * kbdd_get_fkeystr(keyboard_t *kbd, int fkey, size_t *len) { - return ((*kbdsw[kbd->kb_index]->get_fkeystr)(kbd, fkey, len)); + return ((*kbd->kb_drv->kbdsw->get_fkeystr)(kbd, fkey, len)); } static __inline int kbdd_poll(keyboard_t *kbd, int on) { - return ((*kbdsw[kbd->kb_index]->poll)(kbd, on)); + return ((*kbd->kb_drv->kbdsw->poll)(kbd, on)); } static __inline void kbdd_diag(keyboard_t *kbd, int level) { - (*kbdsw[kbd->kb_index]->diag)(kbd, level); + (*kbd->kb_drv->kbdsw->diag)(kbd, level); } #define KEYBOARD_DRIVER(name, sw, config) \ Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Dec 16 03:05:35 2019 (r355797) +++ head/sys/sys/param.h Mon Dec 16 03:12:53 2019 (r355798) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300067 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300068 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Mon Dec 16 04:52:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DDEFC1D87D3; Mon, 16 Dec 2019 04:52:06 +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 47bplp5fddz4Ljq; Mon, 16 Dec 2019 04:52:06 +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 BD8F0202E0; Mon, 16 Dec 2019 04:52:06 +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 xBG4q6pP000952; Mon, 16 Dec 2019 04:52:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBG4q6wP000951; Mon, 16 Dec 2019 04:52:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912160452.xBG4q6wP000951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 16 Dec 2019 04:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355799 - head/sys/dev/kbd X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/kbd X-SVN-Commit-Revision: 355799 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 04:52:06 -0000 Author: kevans Date: Mon Dec 16 04:52:06 2019 New Revision: 355799 URL: https://svnweb.freebsd.org/changeset/base/355799 Log: kbd: patch linker set methods, too This is needed after r355796. Some double-registration of kbd drivers needs to be sorted out, then this sysinit will simply add these drivers into the normal list and kill off any other bits in the driver that are aware of the linker set, for simplicity. Modified: head/sys/dev/kbd/kbd.c Modified: head/sys/dev/kbd/kbd.c ============================================================================== --- head/sys/dev/kbd/kbd.c Mon Dec 16 03:12:53 2019 (r355798) +++ head/sys/dev/kbd/kbd.c Mon Dec 16 04:52:06 2019 (r355799) @@ -1506,3 +1506,20 @@ kbd_ev_event(keyboard_t *kbd, uint16_t type, uint16_t kbdd_ioctl(kbd, KDSETREPEAT, (caddr_t)delay); } } + +static void +kbd_drv_init(void) +{ + const keyboard_driver_t **list; + const keyboard_driver_t *p; + + SET_FOREACH(list, kbddriver_set) { + p = *list; + if (p->kbdsw->get_fkeystr == NULL) + p->kbdsw->get_fkeystr = genkbd_get_fkeystr; + if (p->kbdsw->diag == NULL) + p->kbdsw->diag = genkbd_diag; + } +} + +SYSINIT(kbd_drv_init, SI_SUB_DRIVERS, SI_ORDER_FIRST, kbd_drv_init, NULL); From owner-svn-src-head@freebsd.org Mon Dec 16 08:42:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCE071DDFC9; Mon, 16 Dec 2019 08:42:08 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (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 47bvsD0mb5z4XFt; Mon, 16 Dec 2019 08:42:07 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f193.google.com with SMTP id m6so5868103ljc.1; Mon, 16 Dec 2019 00:42:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=OoefEFQdhc94Y4c04i+5T/6BKsVX8zlsMf7ZsH++xrQ=; b=Q4T9er+Q/98k/LvgsTUeRCaQ4Y5lhAnWirgH3Ha6J/fN6vJ8rRpwfNLplmqMZGuGFl rIy86HFhtTd8+e+M4VWuEpWUGvxT/+rpDbTD6hgllyP3gwQrg4qCVtul8ewb9RyINFKA u0h4NnS9JOrzNmIovpOHFg6fabrYo4Dug7bldazVR5vFKv/7kkylBmRYyscianCEuWuN J3Mp4UOG1/BwlV357YsZtZCxh8h61B6z/75OSTixV7LRB6q2vPvz5LUTd6q8SGXHNeTJ o5TJFWMYkAP41UhtzL/sk9hJhxDTahJRC7nACC8LeppW3aA3ZNdu76JgCtgfJnOuuIlH n6ug== X-Gm-Message-State: APjAAAXpF6MzOtm69Uqkr2CKgeMARroLc4oc16M3er5YjmSVdyYlBbR9 ZHe7nbEc7fJuZszVpEhCHWr298fgVV4= X-Google-Smtp-Source: APXvYqynEIzmMfkfTwu+8OeFNj0/IKLE8mqK5D28BxjQKViwbN5WoBHZKpejf0xbtE7T+C12aReqeQ== X-Received: by 2002:a2e:9906:: with SMTP id v6mr18988836lji.90.1576485724987; Mon, 16 Dec 2019 00:42:04 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id i4sm11961080lji.0.2019.12.16.00.42.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Dec 2019 00:42:04 -0800 (PST) Subject: Re: svn commit: r355611 - head/sys/kern To: Konstantin Belousov Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201912111552.xBBFqUq9009116@repo.freebsd.org> <20191211220028.GW2744@kib.kiev.ua> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <4e5b7351-d68d-37c9-ed9a-573262a9864e@FreeBSD.org> Date: Mon, 16 Dec 2019 10:42:03 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191211220028.GW2744@kib.kiev.ua> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47bvsD0mb5z4XFt X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.208.193 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-3.08 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; 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)[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)[]; RCVD_IN_DNSWL_NONE(0.00)[193.208.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; IP_SCORE(-1.08)[ip: (-0.34), ipnet: 209.85.128.0/17(-3.12), asn: 15169(-1.91), country: US(-0.05)]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; FREEMAIL_TO(0.00)[gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[193.208.85.209.rep.mailspike.net : 127.0.0.17]; 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)[avg@FreeBSD.org,agapon@gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[96.151.72.93.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 08:42:08 -0000 On 12/12/2019 00:00, Konstantin Belousov wrote: > On Wed, Dec 11, 2019 at 03:52:30PM +0000, Andriy Gapon wrote: >> Author: avg >> Date: Wed Dec 11 15:52:29 2019 >> New Revision: 355611 >> URL: https://svnweb.freebsd.org/changeset/base/355611 >> >> Log: >> add a sanity check to the system call registration code >> >> A system call number should be at least reserved. >> We do not expect an attempt to register a fixed number system call >> when nothing at all is known about it. >> >> MFC after: 3 weeks >> Sponsored by: Panzura >> >> Modified: >> head/sys/kern/kern_syscalls.c >> >> Modified: head/sys/kern/kern_syscalls.c >> ============================================================================== >> --- head/sys/kern/kern_syscalls.c Wed Dec 11 15:15:21 2019 (r355610) >> +++ head/sys/kern/kern_syscalls.c Wed Dec 11 15:52:29 2019 (r355611) >> @@ -120,11 +120,14 @@ kern_syscall_register(struct sysent *sysents, int *off >> if (i == SYS_MAXSYSCALL) >> return (ENFILE); >> *offset = i; >> - } else if (*offset < 0 || *offset >= SYS_MAXSYSCALL) >> + } else if (*offset < 0 || *offset >= SYS_MAXSYSCALL) { >> return (EINVAL); >> - else if (sysents[*offset].sy_call != (sy_call_t *)lkmnosys && >> - sysents[*offset].sy_call != (sy_call_t *)lkmressys) >> + } else if (sysents[*offset].sy_call != (sy_call_t *)lkmnosys && >> + sysents[*offset].sy_call != (sy_call_t *)lkmressys) { >> + KASSERT(sysents[*offset].sy_call != NULL, >> + ("undefined syscall %d", *offset)); > I do not think that the assert is very useful. On debug kernels, where > the development would most likely take place, its only function is to annoy > developer by requiring him to reboot the host if he did not guessed a > free syscall number right. > > I suggest to convert this into printf, might be also under bootverbose. > > Also, why do you say that the syscall is undefined ? I would state that > it is not reusable for dynamically loaded syscall, instead. I admit that panic() could be an overreaction to a problem that I somehow created for myself. And the check is not very robust too (but without false positives) . But we should never see sy_call == NULL in sysents, NULL is not a valid value for the field. I think that somehow my init_sysent.c was out-of-sync with the rest of files generated from syscalls.master. So, I got a situation where I tried to dynamically register a system that was below SYS_MAXSYSCALL but beyond the end of sysent[], and apparently that region happened to be zero-filled. So, confusingly, kern_syscall_register() returned EEXIST. >> return (EEXIST); >> + } >> >> KASSERT(sysents[*offset].sy_thrcnt == SY_THR_ABSENT, >> ("dynamic syscall is not protected")); -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon Dec 16 09:11:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 90F0B1DEB46; Mon, 16 Dec 2019 09:11:39 +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 47bwWH3Pdrz4YcN; Mon, 16 Dec 2019 09:11:39 +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 5F1162307C; Mon, 16 Dec 2019 09:11:39 +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 xBG9Bdgq053889; Mon, 16 Dec 2019 09:11:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBG9Bdoq053888; Mon, 16 Dec 2019 09:11:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201912160911.xBG9Bdoq053888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 16 Dec 2019 09:11:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355800 - head/lib/libpcap X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/lib/libpcap X-SVN-Commit-Revision: 355800 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 09:11:39 -0000 Author: hselasky Date: Mon Dec 16 09:11:38 2019 New Revision: 355800 URL: https://svnweb.freebsd.org/changeset/base/355800 Log: Install missing pcap(3) manual pages and add missing manpage section substitutions. Submitted by: Martin Beran PR: 237893 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/lib/libpcap/Makefile Modified: head/lib/libpcap/Makefile ============================================================================== --- head/lib/libpcap/Makefile Mon Dec 16 04:52:06 2019 (r355799) +++ head/lib/libpcap/Makefile Mon Dec 16 09:11:38 2019 (r355800) @@ -109,7 +109,11 @@ MAN= pcap.3 \ pcap_statustostr.3 \ pcap_strerror.3 \ pcap_tstamp_type_name_to_val.3 \ - pcap_tstamp_type_val_to_name.3 + pcap_tstamp_type_val_to_name.3 \ + pcap-savefile.5 \ + pcap-filter.7 \ + pcap-linktype.7 \ + pcap-tstamp.7 MLINKS= \ pcap_datalink_val_to_name.3 pcap_datalink_val_to_description.3 \ @@ -173,7 +177,7 @@ tokdefs.h: grammar.h .NOMETA ${_page}: if [ -f ${PCAP_DISTDIR}/${_page:S/3$/3pcap/} ]; then \ F=${_page:S/3$/3pcap/}; \ - elif [ -f ${PCAP_DISTDIR}/${_page:S/3$/3pcap.in/} ]; then \ + elif [ -f ${PCAP_DISTDIR}/${_page:S/3$/3pcap.in/} ]; then \ F=${_page:S/3$/3pcap.in/}; \ elif [ -f ${PCAP_DISTDIR}/${_page:S/5$/manfile.in/} ]; then \ F=${_page:S/5$/manfile.in/}; \ @@ -182,7 +186,12 @@ ${_page}: else \ F=${_page:S/7$/manmisc.in/}; \ fi; \ - sed -e 's/3PCAP/3/g' ${PCAP_DISTDIR}/$$F > ${_page} + sed \ + -e 's/3PCAP/3/g' \ + -e 's/@MAN_FILE_FORMATS@/5/g' \ + -e 's/@MAN_MISC_INFO@/7/g' \ + -e 's/@MAN_ADMIN_COMMANDS@/8/g' \ + ${PCAP_DISTDIR}/$$F > ${_page} .endfor .include From owner-svn-src-head@freebsd.org Mon Dec 16 13:17:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C0871E3D70; Mon, 16 Dec 2019 13:17:40 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47c1z82J2Jz3JM9; Mon, 16 Dec 2019 13:17:40 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3159C25C91; Mon, 16 Dec 2019 13:17:40 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBGDHdEC099866; Mon, 16 Dec 2019 13:17:39 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBGDHdhc099864; Mon, 16 Dec 2019 13:17:39 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201912161317.xBGDHdhc099864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Mon, 16 Dec 2019 13:17:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355801 - in head/sys: gdb powerpc/include powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: in head/sys: gdb powerpc/include powerpc/powerpc X-SVN-Commit-Revision: 355801 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 13:17:40 -0000 Author: luporl Date: Mon Dec 16 13:17:39 2019 New Revision: 355801 URL: https://svnweb.freebsd.org/changeset/base/355801 Log: [PPC] Handle qOffsets packet On PowerPC, this is needed in order for the debugger to find out the memory offset where the kernel image was loaded on the remote target. This fixes symbol resolution when remote debugging a PowerPC kernel. Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D22767 Modified: head/sys/gdb/gdb_main.c head/sys/powerpc/include/gdb_machdep.h head/sys/powerpc/powerpc/gdb_machdep.c Modified: head/sys/gdb/gdb_main.c ============================================================================== --- head/sys/gdb/gdb_main.c Mon Dec 16 09:11:38 2019 (r355800) +++ head/sys/gdb/gdb_main.c Mon Dec 16 13:17:39 2019 (r355801) @@ -769,6 +769,10 @@ gdb_trap(int type, int code) do_qXfer(); } else if (gdb_rx_equal("Search:memory:")) { gdb_do_mem_search(); +#ifdef __powerpc__ + } else if (gdb_rx_equal("Offsets")) { + gdb_cpu_do_offsets(); +#endif } else if (!gdb_cpu_query()) gdb_tx_empty(); break; Modified: head/sys/powerpc/include/gdb_machdep.h ============================================================================== --- head/sys/powerpc/include/gdb_machdep.h Mon Dec 16 09:11:38 2019 (r355800) +++ head/sys/powerpc/include/gdb_machdep.h Mon Dec 16 13:17:39 2019 (r355801) @@ -131,5 +131,6 @@ gdb_end_write(void *arg __unused) void *gdb_cpu_getreg(int, size_t *); void gdb_cpu_setreg(int, void *); int gdb_cpu_signal(int, int); +void gdb_cpu_do_offsets(void); #endif /* !_MACHINE_GDB_MACHDEP_H_ */ Modified: head/sys/powerpc/powerpc/gdb_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/gdb_machdep.c Mon Dec 16 09:11:38 2019 (r355800) +++ head/sys/powerpc/powerpc/gdb_machdep.c Mon Dec 16 13:17:39 2019 (r355801) @@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$"); #include #include +extern vm_offset_t __startkernel; + void * gdb_cpu_getreg(int regnum, size_t *regsz) { @@ -100,4 +102,29 @@ gdb_cpu_signal(int vector, int dummy __unused) return (vector); else return (SIGEMT); +} + +void +gdb_cpu_do_offsets(void) +{ + /* + * On PowerPC, .text starts at KERNBASE + SIZEOF_HEADERS and + * text segment at KERNBASE - SIZEOF_HEADERS. + * On PowerPC64, .text starts at KERNBASE and text segment at + * KERNBASE - 0x100. + * In both cases, the text segment offset is aligned to 64KB. + * + * The __startkernel variable holds the relocated KERNBASE offset. + * Thus, as long as SIZEOF_HEADERS doesn't get bigger than 0x100 + * (which would lead to other issues), aligning __startkernel to + * 64KB gives the text segment offset. + * + * TODO: Add DataSeg to response. On PowerPC64 all sections reside + * in a single LOAD segment, but on PowerPC modifiable data reside + * in a separate segment, that GDB should also relocate. + */ + gdb_tx_begin(0); + gdb_tx_str("TextSeg="); + gdb_tx_varhex(__startkernel & ~0xffff); + gdb_tx_end(); } From owner-svn-src-head@freebsd.org Mon Dec 16 13:32:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 516671E425F; Mon, 16 Dec 2019 13:32:07 +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 47c2Hq1XVgz3K9W; Mon, 16 Dec 2019 13:32:07 +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 2FFCA25FED; Mon, 16 Dec 2019 13:32:07 +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 xBGDW77r010694; Mon, 16 Dec 2019 13:32:07 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBGDW7DY010693; Mon, 16 Dec 2019 13:32:07 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201912161332.xBGDW7DY010693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 16 Dec 2019 13:32:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355802 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 355802 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 13:32:07 -0000 Author: lwhsu Date: Mon Dec 16 13:32:06 2019 New Revision: 355802 URL: https://svnweb.freebsd.org/changeset/base/355802 Log: Fix gcc build after r355790 Sponsored by: The FreeBSD Foundation Modified: head/sys/sys/vnode.h Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Mon Dec 16 13:17:39 2019 (r355801) +++ head/sys/sys/vnode.h Mon Dec 16 13:32:06 2019 (r355802) @@ -961,8 +961,6 @@ void vn_fsid(struct vnode *vp, struct vattr *va); SYSINIT(vfs_vector_##vnodeops##_f, SI_SUB_VFS, SI_ORDER_ANY, \ vfs_vector_op_register, &vnodeops) -void vfs_vector_op_register(struct vop_vector *vop); - #endif /* _KERNEL */ #endif /* !_SYS_VNODE_H_ */ From owner-svn-src-head@freebsd.org Mon Dec 16 14:08:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C6DF81E504D; Mon, 16 Dec 2019 14:08:50 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47c36B4wKCz3LwS; Mon, 16 Dec 2019 14:08:50 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F9D226595; Mon, 16 Dec 2019 14:08:50 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBGE8oqQ029503; Mon, 16 Dec 2019 14:08:50 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBGE8npu029498; Mon, 16 Dec 2019 14:08:49 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201912161408.xBGE8npu029498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Mon, 16 Dec 2019 14:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355803 - in head: contrib/libunwind/src lib/libgcc_s lib/libgcc_s/arm X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: in head: contrib/libunwind/src lib/libgcc_s lib/libgcc_s/arm X-SVN-Commit-Revision: 355803 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 14:08:50 -0000 Author: mmel Date: Mon Dec 16 14:08:49 2019 New Revision: 355803 URL: https://svnweb.freebsd.org/changeset/base/355803 Log: Fix LLVM libunwnwind _Unwind_Backtrace symbol version for ARM. In original GNU libgcc, _Unwind_Backtrace is published with GCC_3.3 version for all architectures but ARM. For ARM should be publishes with GCC_4.3.0 version. This was originally omitted in r255095, fixed in r318024 and omitted aging in LLVM libunwind implementation in r354347. For ARM _Unwind_Backtrace should be published as default with GCC_4.3.0 version , (because this is right original version) and again as normal(not-default) with GCC_3.3 version (to maintain ABI compatibility compiled/linked with wrong pre r318024 libgcc) PR: 233664 Added: head/lib/libgcc_s/SymbolDefault.map (contents, props changed) Modified: head/contrib/libunwind/src/UnwindLevel1-gcc-ext.c head/lib/libgcc_s/Makefile head/lib/libgcc_s/Symbol.map head/lib/libgcc_s/arm/Symbol.map Modified: head/contrib/libunwind/src/UnwindLevel1-gcc-ext.c ============================================================================== --- head/contrib/libunwind/src/UnwindLevel1-gcc-ext.c Mon Dec 16 13:32:06 2019 (r355802) +++ head/contrib/libunwind/src/UnwindLevel1-gcc-ext.c Mon Dec 16 14:08:49 2019 (r355803) @@ -182,8 +182,8 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callback, void *ref } } #ifdef __arm__ -/* Preserve legacy libgcc ARM ABI mistake. */ -__sym_compat(_Unwind_Backtrace, _Unwind_Backtrace, GCC_4.3.0); +/* Preserve legacy libgcc (pre r318024) ARM ABI mistake */ +__sym_compat(_Unwind_Backtrace, _Unwind_Backtrace, GCC_3.3); #endif Modified: head/lib/libgcc_s/Makefile ============================================================================== --- head/lib/libgcc_s/Makefile Mon Dec 16 13:32:06 2019 (r355802) +++ head/lib/libgcc_s/Makefile Mon Dec 16 14:08:49 2019 (r355803) @@ -18,6 +18,8 @@ SYMBOL_MAPS= ${.CURDIR}/Symbol.map # Export ARM AEABI unwind routines needed by libc and libthr. .if exists(${.CURDIR}/${MACHINE_CPUARCH}/Symbol.map) SYMBOL_MAPS+= ${.CURDIR}/${MACHINE_CPUARCH}/Symbol.map +.else +SYMBOL_MAPS+= ${.CURDIR}/SymbolDefault.map .endif .endif Modified: head/lib/libgcc_s/Symbol.map ============================================================================== --- head/lib/libgcc_s/Symbol.map Mon Dec 16 13:32:06 2019 (r355802) +++ head/lib/libgcc_s/Symbol.map Mon Dec 16 14:08:49 2019 (r355803) @@ -86,7 +86,6 @@ GCC_3.0 { }; GCC_3.3 { - _Unwind_Backtrace; _Unwind_FindEnclosingFunction; _Unwind_GetCFA; _Unwind_Resume_or_Rethrow; Added: head/lib/libgcc_s/SymbolDefault.map ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libgcc_s/SymbolDefault.map Mon Dec 16 14:08:49 2019 (r355803) @@ -0,0 +1,7 @@ +/* + * $FreeBSD$ + */ +/* _Unwind_Backtrace should be exported with different version on ARM */ +GCC_3.3 { + _Unwind_Backtrace; +}; Modified: head/lib/libgcc_s/arm/Symbol.map ============================================================================== --- head/lib/libgcc_s/arm/Symbol.map Mon Dec 16 13:32:06 2019 (r355802) +++ head/lib/libgcc_s/arm/Symbol.map Mon Dec 16 14:08:49 2019 (r355803) @@ -10,3 +10,7 @@ GCC_3.5 { __aeabi_unwind_cpp_pr2; __gnu_unwind_frame; }; + +GCC_4.3.0 { + _Unwind_Backtrace; +}; From owner-svn-src-head@freebsd.org Mon Dec 16 15:30:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A26C1E6F14; Mon, 16 Dec 2019 15:30:37 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (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 47c4wY1mbHz3RLL; Mon, 16 Dec 2019 15:30:36 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f45.google.com with SMTP id i11so4221881ioi.12; Mon, 16 Dec 2019 07:30: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=OeX/Zk6dAB8dJ41NZLJHGmRIRUP3NUfyjJWkWVIMV1E=; b=nWKRPn9c5OzamIh1Cg98lUQbpAaXXHoK6aMKQzCNPMm9R53cZYpHkbb3XZIAAbDPF8 /Lg2MMzxGbE7U4YRm77q/2FYrSKDqJJDKtRwsZ8YEr5XbffSmZZ04U6iELgm+tNkxht1 0NrFzakDH/MFFkbFHUXIaB5Ap0L/+e2aRN/K8QhDO1YsrRO0k3yBe2z+sQX30iDDSBtn 4Voc7by/G1SPmFzucqXjDtdFC+hJL0rK4n79sA/0gJ++31LIX+mfvTmiQ7sXc+p11Kd+ 4ut9S0HgB0L79AVmkw8u5g6tWkTcfn36m7wG8k11TV2AivEZzmnZp8JcahTy+uy5qHlq w8Sg== X-Gm-Message-State: APjAAAXvuTJ70e1sviO8E3Fr2Ztzg/j+KN+nhzjnFrHdY8qDogDjkm+K St09vTr0s5XS+WdGfeDENaXBAPkOHKOCjfN1//2el+qB7tU= X-Google-Smtp-Source: APXvYqzUKFsaHtVixKngekL57/CCI+Yxq2V1/IM8lwPfDGzvTq4xfbgNCmqQYTSZWbPKqK/Z6wLEHgqfNeyMPht7Wxo= X-Received: by 2002:a6b:6712:: with SMTP id b18mr11853394ioc.256.1576510234694; Mon, 16 Dec 2019 07:30:34 -0800 (PST) MIME-Version: 1.0 References: <201912152126.xBFLQoJ7037440@repo.freebsd.org> In-Reply-To: <201912152126.xBFLQoJ7037440@repo.freebsd.org> From: Ed Maste Date: Mon, 16 Dec 2019 06:44:12 -0500 Message-ID: Subject: Re: svn commit: r355784 - in head/sys: compat/linuxkpi/common/src dev/dpaa kern mips/nlm sys To: Jeff Roberson Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 47c4wY1mbHz3RLL 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)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 15:30:37 -0000 On Sun, 15 Dec 2019 at 16:27, Jeff Roberson wrote: > > Author: jeff > Date: Sun Dec 15 21:26:50 2019 > New Revision: 355784 > URL: https://svnweb.freebsd.org/changeset/base/355784 > > Log: > schedlock 4/4 FYI i386, arm, arm64, riscv fail to boot now, with "panic: invalid count 2" Boot logs: i386: https://ci.freebsd.org/job/FreeBSD-head-i386-test/7797/console arm: https://ci.freebsd.org/hwlab/job/FreeBSD-device-head-beaglebone-test/1317/artifact/device_tests/beaglebone.boot.log arm64: https://ci.freebsd.org/hwlab/job/FreeBSD-device-head-pinea64-test/1194/artifact/device_tests/pinea64.boot.log riscv: https://ci.freebsd.org/hwlab/job/FreeBSD-device-head-pinea64-test/1194/artifact/device_tests/pinea64.boot.log arm64 is: panic: invalid count 2 cpuid = 0 time = 1 KDB: stack backtrace: db_trace_self() at db_trace_self_wrapper+0x28 pc = 0xffff0000007359ec lr = 0xffff000000106744 sp = 0xffff000056b063c0 fp = 0xffff000056b065d0 db_trace_self_wrapper() at vpanic+0x18c pc = 0xffff000000106744 lr = 0xffff000000408128 sp = 0xffff000056b065e0 fp = 0xffff000056b06690 vpanic() at panic+0x44 pc = 0xffff000000408128 lr = 0xffff000000407ed8 sp = 0xffff000056b066a0 fp = 0xffff000056b06720 panic() at sched_switch+0x81c pc = 0xffff000000407ed8 lr = 0xffff000000434264 sp = 0xffff000056b06730 fp = 0xffff000056b06810 sched_switch() at mi_switch+0x170 pc = 0xffff000000434264 lr = 0xffff000000413690 sp = 0xffff000056b06820 fp = 0xffff000056b06840 mi_switch() at cpu_idle+0xc8 pc = 0xffff000000413690 lr = 0xffff0000007400a0 sp = 0xffff000056b06850 fp = 0xffff000056b06860 cpu_idle() at sched_idletd+0x380 pc = 0xffff0000007400a0 lr = 0xffff000000436a90 sp = 0xffff000056b06870 fp = 0xffff000056b06940 sched_idletd() at fork_exit+0x7c pc = 0xffff000000436a90 lr = 0xffff0000003c7ba4 sp = 0xffff000056b06950 fp = 0xffff000056b06980 fork_exit() at fork_trampoline+0x10 pc = 0xffff0000003c7ba4 lr = 0xffff0000007521ac sp = 0xffff000056b06990 fp = 0x0000000000000000 KDB: enter: panic [ thread pid 11 tid 100003 ] Stopped at 0 db> From owner-svn-src-head@freebsd.org Mon Dec 16 16:41:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D32CE1C8807; Mon, 16 Dec 2019 16:41:25 +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 47c6VF3ntSz41CG; Mon, 16 Dec 2019 16:41: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 7CC571C9; Mon, 16 Dec 2019 16:41: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 xBGGfPV3023261; Mon, 16 Dec 2019 16:41:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBGGfONf023254; Mon, 16 Dec 2019 16:41:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912161641.xBGGfONf023254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 16 Dec 2019 16:41:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355806 - in head/sys/dev: adb gpio hyperv/input kbdmux usb/input vkbd X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys/dev: adb gpio hyperv/input kbdmux usb/input vkbd X-SVN-Commit-Revision: 355806 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 16:41:25 -0000 Author: kevans Date: Mon Dec 16 16:41:24 2019 New Revision: 355806 URL: https://svnweb.freebsd.org/changeset/base/355806 Log: kbd drivers: don't double register keyboard drivers Keyboard drivers are generally registered via linker set. In these cases, they're also available as kmods which use KPI for registering/unregistering keyboard drivers outside of the linker set. For built-in modules, we still fire off MOD_LOAD and maybe even MOD_UNLOAD if an error occurs, leading to registration via linker set and at MOD_LOAD time. This is a minor optimization at best, but it keeps the internal kbd driver tidy as a future change will merge the linker set driver list into its internal keyboard_drivers list via SYSINIT and simplify driver lookup by removing the need to consult the linker set. Modified: head/sys/dev/adb/adb_kbd.c head/sys/dev/gpio/gpiokeys.c head/sys/dev/hyperv/input/hv_kbd.c head/sys/dev/kbdmux/kbdmux.c head/sys/dev/usb/input/ukbd.c head/sys/dev/vkbd/vkbd.c Modified: head/sys/dev/adb/adb_kbd.c ============================================================================== --- head/sys/dev/adb/adb_kbd.c Mon Dec 16 15:41:32 2019 (r355805) +++ head/sys/dev/adb/adb_kbd.c Mon Dec 16 16:41:24 2019 (r355806) @@ -850,11 +850,15 @@ akbd_modevent(module_t mod, int type, void *data) { switch (type) { case MOD_LOAD: +#ifdef KLD_MODULE kbd_add_driver(&akbd_kbd_driver); +#endif break; case MOD_UNLOAD: +#ifdef KLD_MODULE kbd_delete_driver(&akbd_kbd_driver); +#endif break; default: Modified: head/sys/dev/gpio/gpiokeys.c ============================================================================== --- head/sys/dev/gpio/gpiokeys.c Mon Dec 16 15:41:32 2019 (r355805) +++ head/sys/dev/gpio/gpiokeys.c Mon Dec 16 16:41:24 2019 (r355806) @@ -983,6 +983,8 @@ KEYBOARD_DRIVER(gpiokeys, gpiokeyssw, gpiokeys_configu static int gpiokeys_driver_load(module_t mod, int what, void *arg) { + +#ifdef KLD_MODULE switch (what) { case MOD_LOAD: kbd_add_driver(&gpiokeys_kbd_driver); @@ -991,6 +993,7 @@ gpiokeys_driver_load(module_t mod, int what, void *arg kbd_delete_driver(&gpiokeys_kbd_driver); break; } +#endif return (0); } Modified: head/sys/dev/hyperv/input/hv_kbd.c ============================================================================== --- head/sys/dev/hyperv/input/hv_kbd.c Mon Dec 16 15:41:32 2019 (r355805) +++ head/sys/dev/hyperv/input/hv_kbd.c Mon Dec 16 16:41:24 2019 (r355806) @@ -490,6 +490,8 @@ hv_kbd_intr(hv_kbd_sc *sc) int hvkbd_driver_load(module_t mod, int what, void *arg) { + +#ifdef KLD_MODULE switch (what) { case MOD_LOAD: kbd_add_driver(&hvkbd_kbd_driver); @@ -498,6 +500,7 @@ hvkbd_driver_load(module_t mod, int what, void *arg) kbd_delete_driver(&hvkbd_kbd_driver); break; } +#endif return (0); } Modified: head/sys/dev/kbdmux/kbdmux.c ============================================================================== --- head/sys/dev/kbdmux/kbdmux.c Mon Dec 16 15:41:32 2019 (r355805) +++ head/sys/dev/kbdmux/kbdmux.c Mon Dec 16 16:41:24 2019 (r355806) @@ -1423,11 +1423,15 @@ kbdmux_modevent(module_t mod, int type, void *data) switch (type) { case MOD_LOAD: +#ifdef KLD_MODULE if ((error = kbd_add_driver(&kbdmux_kbd_driver)) != 0) break; +#endif if ((sw = kbd_get_switch(KEYBOARD_NAME)) == NULL) { +#ifdef KLD_MODULE kbd_delete_driver(&kbdmux_kbd_driver); +#endif error = ENXIO; break; } @@ -1436,14 +1440,18 @@ kbdmux_modevent(module_t mod, int type, void *data) if ((error = (*sw->probe)(0, NULL, 0)) != 0 || (error = (*sw->init)(0, &kbd, NULL, 0)) != 0) { +#ifdef KLD_MODULE kbd_delete_driver(&kbdmux_kbd_driver); +#endif break; } #ifdef KBD_INSTALL_CDEV if ((error = kbd_attach(kbd)) != 0) { (*sw->term)(kbd); +#ifdef KLD_MODULE kbd_delete_driver(&kbdmux_kbd_driver); +#endif break; } #endif @@ -1454,7 +1462,9 @@ kbdmux_modevent(module_t mod, int type, void *data) kbd_detach(kbd); #endif (*sw->term)(kbd); +#ifdef KLD_MODULE kbd_delete_driver(&kbdmux_kbd_driver); +#endif break; } break; @@ -1470,7 +1480,9 @@ kbdmux_modevent(module_t mod, int type, void *data) kbd_detach(kbd); #endif (*sw->term)(kbd); +#ifdef KLD_MODULE kbd_delete_driver(&kbdmux_kbd_driver); +#endif } error = 0; break; Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Mon Dec 16 15:41:32 2019 (r355805) +++ head/sys/dev/usb/input/ukbd.c Mon Dec 16 16:41:24 2019 (r355806) @@ -2290,6 +2290,7 @@ KEYBOARD_DRIVER(ukbd, ukbdsw, ukbd_configure); static int ukbd_driver_load(module_t mod, int what, void *arg) { +#ifdef KLD_MODULE switch (what) { case MOD_LOAD: kbd_add_driver(&ukbd_kbd_driver); @@ -2298,6 +2299,7 @@ ukbd_driver_load(module_t mod, int what, void *arg) kbd_delete_driver(&ukbd_kbd_driver); break; } +#endif return (0); } Modified: head/sys/dev/vkbd/vkbd.c ============================================================================== --- head/sys/dev/vkbd/vkbd.c Mon Dec 16 15:41:32 2019 (r355805) +++ head/sys/dev/vkbd/vkbd.c Mon Dec 16 16:41:24 2019 (r355806) @@ -1360,11 +1360,15 @@ vkbd_modevent(module_t mod, int type, void *data) clone_cleanup(&vkbd_dev_clones); return (ENOMEM); } +#ifdef KLD_MODULE kbd_add_driver(&vkbd_kbd_driver); +#endif break; case MOD_UNLOAD: +#ifdef KLD_MODULE kbd_delete_driver(&vkbd_kbd_driver); +#endif EVENTHANDLER_DEREGISTER(dev_clone, tag); clone_cleanup(&vkbd_dev_clones); break; From owner-svn-src-head@freebsd.org Mon Dec 16 17:09:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94A641C9315; Mon, 16 Dec 2019 17:09:03 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) (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 47c7673NLZz4306; Mon, 16 Dec 2019 17:09:03 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: by mail-qk1-f196.google.com with SMTP id a203so4802391qkc.3; Mon, 16 Dec 2019 09:09:03 -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=JSfxnJ1odUxIcncq2OawH8b1wELVF3cGDB9A7ua4n+A=; b=Na9TBpi7U7DsdJqBoLCR1piJVYSLM+maNjiUf69kD8N0eCAaNYp3i2kHG+83+Dlwsp FM/oG1sOKTC8DGbtT7w/3GBjT7ZwO5dpkt2RpozVhx2YW6hHmDQx+knHwhK3ithsszTV fDQmac0/DO14GrngTMX8vMyCrpw+ZZCxLlMfLBg/PjqN0voGupfh+BXl068XKrysWFyc jCGbYtK0Y8/vOLkgs1tjQwM4ZL9CBHar5Jcg3T+YejyVBqfFD1Iwh1vYIY6l4AJYGc6T 0ICSQa7INVGl+JFgQ/IDWk8P34tl/zNGX+sBrMNF/w6FHIlvP8XiMhTg/+O5XMUtM7Ux dgxw== X-Gm-Message-State: APjAAAXsWe4Y28bSdzz62xux/tPNpTJDRfy7qKoMIne7rp6J+LOhNJox haMhw1BMxuOxxl/A+C0PALjv6a1VVbs= X-Google-Smtp-Source: APXvYqxRxfo0WPdnE8dNswmlSREIuKUQUItfb/6XOh0Scnj/t3N5F98JvnLHs5CTWuVLUyRVweHp9A== X-Received: by 2002:a05:620a:1249:: with SMTP id a9mr253715qkl.147.1576516141879; Mon, 16 Dec 2019 09:09:01 -0800 (PST) Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com. [209.85.219.44]) by smtp.gmail.com with ESMTPSA id v7sm7103347qtk.89.2019.12.16.09.09.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Dec 2019 09:09:01 -0800 (PST) Received: by mail-qv1-f44.google.com with SMTP id o18so3020072qvf.1; Mon, 16 Dec 2019 09:09:01 -0800 (PST) X-Received: by 2002:a05:6214:14b3:: with SMTP id bo19mr230025qvb.93.1576516140917; Mon, 16 Dec 2019 09:09:00 -0800 (PST) MIME-Version: 1.0 References: <201912152126.xBFLQoJ7037440@repo.freebsd.org> In-Reply-To: From: Ryan Libby Date: Mon, 16 Dec 2019 09:08:50 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r355784 - in head/sys: compat/linuxkpi/common/src dev/dpaa kern mips/nlm sys To: Ed Maste , Jeff Roberson Cc: src-committers , svn-src-all , svn-src-head , Mark Johnston , Konstantin Belousov Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 47c7673NLZz4306 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]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 17:09:03 -0000 On Mon, Dec 16, 2019 at 7:30 AM Ed Maste wrote: > > On Sun, 15 Dec 2019 at 16:27, Jeff Roberson wrote: > > > > Author: jeff > > Date: Sun Dec 15 21:26:50 2019 > > New Revision: 355784 > > URL: https://svnweb.freebsd.org/changeset/base/355784 > > > > Log: > > schedlock 4/4 > > FYI i386, arm, arm64, riscv fail to boot now, with "panic: invalid count 2" > > Boot logs: > i386: https://ci.freebsd.org/job/FreeBSD-head-i386-test/7797/console > arm: https://ci.freebsd.org/hwlab/job/FreeBSD-device-head-beaglebone-test/1317/artifact/device_tests/beaglebone.boot.log > arm64: https://ci.freebsd.org/hwlab/job/FreeBSD-device-head-pinea64-test/1194/artifact/device_tests/pinea64.boot.log > riscv: https://ci.freebsd.org/hwlab/job/FreeBSD-device-head-pinea64-test/1194/artifact/device_tests/pinea64.boot.log > > arm64 is: > > panic: invalid count 2 > cpuid = 0 > time = 1 > KDB: stack backtrace: > db_trace_self() at db_trace_self_wrapper+0x28 > pc = 0xffff0000007359ec lr = 0xffff000000106744 > sp = 0xffff000056b063c0 fp = 0xffff000056b065d0 > > db_trace_self_wrapper() at vpanic+0x18c > pc = 0xffff000000106744 lr = 0xffff000000408128 > sp = 0xffff000056b065e0 fp = 0xffff000056b06690 > > vpanic() at panic+0x44 > pc = 0xffff000000408128 lr = 0xffff000000407ed8 > sp = 0xffff000056b066a0 fp = 0xffff000056b06720 > > panic() at sched_switch+0x81c > pc = 0xffff000000407ed8 lr = 0xffff000000434264 > sp = 0xffff000056b06730 fp = 0xffff000056b06810 > > sched_switch() at mi_switch+0x170 > pc = 0xffff000000434264 lr = 0xffff000000413690 > sp = 0xffff000056b06820 fp = 0xffff000056b06840 > > mi_switch() at cpu_idle+0xc8 > pc = 0xffff000000413690 lr = 0xffff0000007400a0 > sp = 0xffff000056b06850 fp = 0xffff000056b06860 > > cpu_idle() at sched_idletd+0x380 > pc = 0xffff0000007400a0 lr = 0xffff000000436a90 > sp = 0xffff000056b06870 fp = 0xffff000056b06940 > > sched_idletd() at fork_exit+0x7c > pc = 0xffff000000436a90 lr = 0xffff0000003c7ba4 > sp = 0xffff000056b06950 fp = 0xffff000056b06980 > > fork_exit() at fork_trampoline+0x10 > pc = 0xffff0000003c7ba4 lr = 0xffff0000007521ac > sp = 0xffff000056b06990 fp = 0x0000000000000000 > > KDB: enter: panic > [ thread pid 11 tid 100003 ] > Stopped at 0 > db> It looks like amd64 vs i386, riscv, etc are using different motifs in spinlock_exit(). Perhaps we just need to rearrange them to drop the spinlock count before critical_exit(), like in amd64. Ryan From owner-svn-src-head@freebsd.org Mon Dec 16 17:45:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62DEB1CA293; Mon, 16 Dec 2019 17:45:16 +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 47c7vw1x6Hz45ZT; Mon, 16 Dec 2019 17:45:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D6EDCF3; Mon, 16 Dec 2019 17:45:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBGHjGc4061409; Mon, 16 Dec 2019 17:45:16 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBGHjG9E061408; Mon, 16 Dec 2019 17:45:16 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201912161745.xBGHjG9E061408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 16 Dec 2019 17:45:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355807 - 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: 355807 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 17:45:16 -0000 Author: trasz Date: Mon Dec 16 17:45:15 2019 New Revision: 355807 URL: https://svnweb.freebsd.org/changeset/base/355807 Log: Don't use K&R definitions. No functional changes. Reported by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/compat/linux/linux_file.c Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Mon Dec 16 16:41:24 2019 (r355806) +++ head/sys/compat/linux/linux_file.c Mon Dec 16 17:45:15 2019 (r355807) @@ -899,18 +899,14 @@ linux_linkat(struct thread *td, struct linux_linkat_ar } int -linux_fdatasync(td, uap) - struct thread *td; - struct linux_fdatasync_args *uap; +linux_fdatasync(struct thread *td, struct linux_fdatasync_args *uap) { return (kern_fsync(td, uap->fd, false)); } int -linux_sync_file_range(td, uap) - struct thread *td; - struct linux_sync_file_range_args *uap; +linux_sync_file_range(struct thread *td, struct linux_sync_file_range_args *uap) { if (uap->offset < 0 || uap->nbytes < 0 || From owner-svn-src-head@freebsd.org Mon Dec 16 17:58:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A475E1CA531 for ; Mon, 16 Dec 2019 17:58:09 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) (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 47c8Bm1B3Cz46TZ for ; Mon, 16 Dec 2019 17:58:08 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by mail-pl1-x642.google.com with SMTP id d15so4802213pll.3 for ; Mon, 16 Dec 2019 09:58:07 -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=Xp3BzVa71P3oe89anaj/7scMlIHCNg4rvvQSnhX4NcA=; b=nGXA2Qk6pO6guSbfsoLd9etJU29wLblTlUZ2NfFGGvKXHRpF8YqYGa1NpMDns9ysWW Hsw1S4UrvIxN9efPTGKIh4ms7gQ3pIncXasuK0wVCh5dsIqEDMUhw+W8P9UMK2LLHIJb e+CkelFSrmO+vy3UGBOxv/4XQX7AHB54kxzghC1zEUnBloi+8QIETPulcbkmqbUxN5Rj +klvSsu2dAh3SqVvDCH06fdN2+8/yQOev2a2y2Mvv+nYQjh7ALjRuHeeetQ23a3DKepo gINh+NDDSDYaWI3yiKoWF8bq+N/AV+D/XbIgYszbRJc45FK+YL93fPVTmtE/1TcaKu8v RomA== 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=Xp3BzVa71P3oe89anaj/7scMlIHCNg4rvvQSnhX4NcA=; b=Feb1a2uOx5l5Y24k/LPxCvOwUA4/SkQJWTBjWruHECObKAmo14nmBFoJsDAKPEfdZZ xn162ZwiioH6IJ97f73F/eIdkYEoLsO6Wly7qZy/+/jsya/XsDfmtSj6Cebx0JmOgWBH KyLFkPcH+/dapW5qfTln8aySRsVsOWAt//or4OOOX5M0amNq5rDX8FqJLrBkdOvA4rss JydMgJDAiP+muoqOg5UjhGoGlZZuKvtsZt1LJgw0nkDqwjvCKz+xkUdkY2fbo+kjWPWr ewkGBcPNlegqfWT4tK+GvrSPMPSHMqCqerfsoStmp98nrZ0JJUM9Lix9/iJJ8llBFbcN GEHA== X-Gm-Message-State: APjAAAUBMyxT65fy7yB+VE0B9Rh9TybsEWOZ6qd3PWDHTjeQvBv94F4N ay9jX/DhqBeCvuktf02FiOiJPA== X-Google-Smtp-Source: APXvYqwVTBOiwA5Q3b4WkzRDytCzMwZHxpzun5p5cdFoSBkuyLPWKMoRz7lo2KSq874gDay9sHurRg== X-Received: by 2002:a17:902:8603:: with SMTP id f3mr17566302plo.198.1576519086689; Mon, 16 Dec 2019 09:58:06 -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 x65sm19802164pfb.171.2019.12.16.09.58.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Dec 2019 09:58:06 -0800 (PST) Date: Mon, 16 Dec 2019 07:58:03 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Ryan Libby cc: Ed Maste , Jeff Roberson , src-committers , svn-src-all , svn-src-head , Mark Johnston , Konstantin Belousov Subject: Re: svn commit: r355784 - in head/sys: compat/linuxkpi/common/src dev/dpaa kern mips/nlm sys In-Reply-To: Message-ID: References: <201912152126.xBFLQoJ7037440@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: 47c8Bm1B3Cz46TZ X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=jroberson-net.20150623.gappssmtp.com header.s=20150623 header.b=nGXA2Qk6; dmarc=none; spf=none (mx1.freebsd.org: domain of jroberson@jroberson.net has no SPF policy when checking 2607:f8b0:4864:20::642) smtp.mailfrom=jroberson@jroberson.net X-Spamd-Result: default: False [-2.74 / 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)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[jroberson.net]; 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:+]; RCPT_COUNT_SEVEN(0.00)[8]; RCVD_IN_DNSWL_NONE(0.00)[2.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]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-0.94)[ip: (-0.57), ipnet: 2607:f8b0::/32(-2.19), asn: 15169(-1.90), country: US(-0.05)] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 17:58:09 -0000 On Mon, 16 Dec 2019, Ryan Libby wrote: > On Mon, Dec 16, 2019 at 7:30 AM Ed Maste wrote: >> >> On Sun, 15 Dec 2019 at 16:27, Jeff Roberson wrote: >>> >>> Author: jeff >>> Date: Sun Dec 15 21:26:50 2019 >>> New Revision: 355784 >>> URL: https://svnweb.freebsd.org/changeset/base/355784 >>> >>> Log: >>> schedlock 4/4 >> >> FYI i386, arm, arm64, riscv fail to boot now, with "panic: invalid count 2" >> >> Boot logs: >> i386: https://ci.freebsd.org/job/FreeBSD-head-i386-test/7797/console >> arm: https://ci.freebsd.org/hwlab/job/FreeBSD-device-head-beaglebone-test/1317/artifact/device_tests/beaglebone.boot.log >> arm64: https://ci.freebsd.org/hwlab/job/FreeBSD-device-head-pinea64-test/1194/artifact/device_tests/pinea64.boot.log >> riscv: https://ci.freebsd.org/hwlab/job/FreeBSD-device-head-pinea64-test/1194/artifact/device_tests/pinea64.boot.log >> >> arm64 is: >> >> panic: invalid count 2 >> cpuid = 0 >> time = 1 >> KDB: stack backtrace: >> db_trace_self() at db_trace_self_wrapper+0x28 >> pc = 0xffff0000007359ec lr = 0xffff000000106744 >> sp = 0xffff000056b063c0 fp = 0xffff000056b065d0 >> >> db_trace_self_wrapper() at vpanic+0x18c >> pc = 0xffff000000106744 lr = 0xffff000000408128 >> sp = 0xffff000056b065e0 fp = 0xffff000056b06690 >> >> vpanic() at panic+0x44 >> pc = 0xffff000000408128 lr = 0xffff000000407ed8 >> sp = 0xffff000056b066a0 fp = 0xffff000056b06720 >> >> panic() at sched_switch+0x81c >> pc = 0xffff000000407ed8 lr = 0xffff000000434264 >> sp = 0xffff000056b06730 fp = 0xffff000056b06810 >> >> sched_switch() at mi_switch+0x170 >> pc = 0xffff000000434264 lr = 0xffff000000413690 >> sp = 0xffff000056b06820 fp = 0xffff000056b06840 >> >> mi_switch() at cpu_idle+0xc8 >> pc = 0xffff000000413690 lr = 0xffff0000007400a0 >> sp = 0xffff000056b06850 fp = 0xffff000056b06860 >> >> cpu_idle() at sched_idletd+0x380 >> pc = 0xffff0000007400a0 lr = 0xffff000000436a90 >> sp = 0xffff000056b06870 fp = 0xffff000056b06940 >> >> sched_idletd() at fork_exit+0x7c >> pc = 0xffff000000436a90 lr = 0xffff0000003c7ba4 >> sp = 0xffff000056b06950 fp = 0xffff000056b06980 >> >> fork_exit() at fork_trampoline+0x10 >> pc = 0xffff0000003c7ba4 lr = 0xffff0000007521ac >> sp = 0xffff000056b06990 fp = 0x0000000000000000 >> >> KDB: enter: panic >> [ thread pid 11 tid 100003 ] >> Stopped at 0 >> db> > > It looks like amd64 vs i386, riscv, etc are using different motifs in > spinlock_exit(). Perhaps we just need to rearrange them to drop the > spinlock count before critical_exit(), like in amd64. It took me a moment to see why but I believe you are right. Interrupts being disabled would prevent a local preemption with the flags out of sync but critical_exit() might have owepreempt set so we will switch before updating the count. Jeff > > Ryan > From owner-svn-src-head@freebsd.org Mon Dec 16 18:16:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24FE61CB229; Mon, 16 Dec 2019 18:16:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47c8cF0CdDz48TW; Mon, 16 Dec 2019 18:16:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F28241281; Mon, 16 Dec 2019 18:16:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBGIGi3n078940; Mon, 16 Dec 2019 18:16:44 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBGIGijv078938; Mon, 16 Dec 2019 18:16:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912161816.xBGIGijv078938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 16 Dec 2019 18:16:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355813 - in head/sys/cam: ata scsi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/cam: ata scsi X-SVN-Commit-Revision: 355813 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 18:16:45 -0000 Author: imp Date: Mon Dec 16 18:16:44 2019 New Revision: 355813 URL: https://svnweb.freebsd.org/changeset/base/355813 Log: Implement a system-wide limit or da and ada devices for delete. Excesively large TRIMs can result in timeouts, which cause big problems. Limit trims to 1GB to mititgate these issues. Reviewed by: scottl Differential Revision: https://reviews.freebsd.org/D22809 Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Mon Dec 16 18:05:28 2019 (r355812) +++ head/sys/cam/ata/ata_da.c Mon Dec 16 18:16:44 2019 (r355813) @@ -858,6 +858,10 @@ static void adaresume(void *arg); #define ADA_DEFAULT_WRITE_CACHE 1 #endif +#ifndef ADA_DEFAULT_MAX_DELETE +#define ADA_DEFAULT_MAX_DELETE (1 * 1024 * 1024 * 1024) /* 1GB max trim by default */ +#endif + #define ADA_RA (softc->read_ahead >= 0 ? \ softc->read_ahead : ada_read_ahead) #define ADA_WC (softc->write_cache >= 0 ? \ @@ -878,6 +882,7 @@ static int ada_spindown_shutdown = ADA_DEFAULT_SPINDOW static int ada_spindown_suspend = ADA_DEFAULT_SPINDOWN_SUSPEND; static int ada_read_ahead = ADA_DEFAULT_READ_AHEAD; static int ada_write_cache = ADA_DEFAULT_WRITE_CACHE; +static int64_t ada_default_max_delete = ADA_DEFAULT_MAX_DELETE; static SYSCTL_NODE(_kern_cam, OID_AUTO, ada, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); @@ -895,6 +900,9 @@ SYSCTL_INT(_kern_cam_ada, OID_AUTO, read_ahead, CTLFLA &ada_read_ahead, 0, "Enable disk read-ahead"); SYSCTL_INT(_kern_cam_ada, OID_AUTO, write_cache, CTLFLAG_RWTUN, &ada_write_cache, 0, "Enable disk write cache"); +SYSCTL_QUAD(_kern_cam_ada, OID_AUTO, default_max_delete, CTLFLAG_RWTUN, + &ada_default_max_delete, 0, + "Default system wide maximum delete"); /* * ADA_ORDEREDTAG_INTERVAL determines how often, relative @@ -3392,6 +3400,8 @@ adasetgeom(struct ada_softc *softc, struct ccb_getdev softc->disk->d_delmaxsize = 256 * softc->params.secsize; } else softc->disk->d_delmaxsize = maxio; + if (softc->disk->d_delmaxsize > ada_default_max_delete) + softc->disk->d_delmaxsize = ada_default_max_delete; if ((softc->cpi.hba_misc & PIM_UNMAPPED) != 0) { d_flags |= DISKFLAG_UNMAPPED_BIO; softc->unmappedio = 1; Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Dec 16 18:05:28 2019 (r355812) +++ head/sys/cam/scsi/scsi_da.c Mon Dec 16 18:16:44 2019 (r355813) @@ -1516,12 +1516,17 @@ static callout_func_t damediapoll; #define DA_DEFAULT_SEND_ORDERED 1 #endif +#ifndef DA_DEFAULT_MAX_DELETE +#define DA_DEFAULT_MAX_DELETE (1 * 1024 * 1024 * 1024) /* 1GB max trim by default */ +#endif + static int da_poll_period = DA_DEFAULT_POLL_PERIOD; static int da_retry_count = DA_DEFAULT_RETRY; static int da_default_timeout = DA_DEFAULT_TIMEOUT; static sbintime_t da_default_softtimeout = DA_DEFAULT_SOFTTIMEOUT; static int da_send_ordered = DA_DEFAULT_SEND_ORDERED; static int da_disable_wp_detection = 0; +static int64_t da_default_max_delete = DA_DEFAULT_MAX_DELETE; static SYSCTL_NODE(_kern_cam, OID_AUTO, da, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); @@ -1536,6 +1541,9 @@ SYSCTL_INT(_kern_cam_da, OID_AUTO, send_ordered, CTLFL SYSCTL_INT(_kern_cam_da, OID_AUTO, disable_wp_detection, CTLFLAG_RWTUN, &da_disable_wp_detection, 0, "Disable detection of write-protected disks"); +SYSCTL_INT64(_kern_cam_da, OID_AUTO, default_max_delete, CTLFLAG_RWTUN, + &da_default_max_delete, 0, + "Default system wide maximum delete"); SYSCTL_PROC(_kern_cam_da, OID_AUTO, default_softtimeout, CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, dasysctlsofttimeout, "I", @@ -2500,8 +2508,8 @@ dadeletemaxsize(struct da_softc *softc, da_delete_meth return 0; } - return (off_t)softc->params.secsize * - omin(sectors, softc->params.sectors); + return (off_t)MIN(da_default_max_delete, softc->params.secsize * + omin(sectors, softc->params.sectors)); } static void From owner-svn-src-head@freebsd.org Mon Dec 16 18:42:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 832851CBA91 for ; Mon, 16 Dec 2019 18:42:30 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) (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 47c99x5Yjsz4BJy for ; Mon, 16 Dec 2019 18:42:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x735.google.com with SMTP id w127so6053258qkb.11 for ; Mon, 16 Dec 2019 10:42:29 -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=bvV+WUUYDUBE1b3mutBPQ+7HtSKP3IqQ6tJ6J+Sgqjo=; b=l/TRb71aFW/F0KdaqRea4DXUq5ImrS2crJYo8WkH2unEGRVHCDUanpCYrvZjtNPli6 F9ioRCF56kOsvZQ9MXyEQWz54oQ1iNKYX8SNIu1IfP3KejDBFlcd+8rcBcAwkV039lKu SFV5ca0PvUMYpsr+iKnLybrVhnGO3eVVy1D029evNWCYGKZu9bbn24Fxp+VTnt0QNyFJ iE94m2omQCIkTvaeizI5mJX0IhbF4Iv54B0lai5no6rTG32u8HTwLm5VU6MhCfRqxmTk /oW808lEyuQIj5s8kx9wzafsKYgMmseJPbi/yKdK/v3nlgPxS9kp4+3IWBNTxJfrAQsp 4pqg== 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=bvV+WUUYDUBE1b3mutBPQ+7HtSKP3IqQ6tJ6J+Sgqjo=; b=G1azE1xX2FgdtDBY9OswVsAmgka6B+gA27q7B5/iR3A7qWcXRy7ybIRqhstJQFI1Dz XBQqOL+zA9QfDwIrcNwTyzP/fwnTA8p8R0g6m/C7iWOCT0xgcZTI2N1LWstGoCl4Ut5s xTpXByDnkygqz9LJRuhk5sWHNS1b7GdSlQ8tvc46P0CKiHRR7Z0ijIE1MkPNXYFC0Gy5 P+v/vAEFo7zNdlcAfoxTs3Yu3AZ8F2xetSPXNf/rM329Hr9J55U7jGIwe55Dm4j4rmoC IOpWKG1LVIRv2M/zZPAf8u+ytK5gHt1SRxYE1uRHhnmc4F4PBMIsaHuC69EQ5KyyOM4Y R4lg== X-Gm-Message-State: APjAAAXQXsfa9iV6l7Kk0dr8DTJtDyyqUHx99BOjWP9MJcjXTTxtqzmY zUnFKcK5QOnHQLWFb8ETywRxNkwpT4QN96kPJ++oUw== X-Google-Smtp-Source: APXvYqx6n2SK5oQk9fFDIMpk+WCTgHY2hO95bQZH3jMRij4TRGKiQ1+mXfamWNPbn4Xa8m5y+DC89SZnTfcfI0Rpgi8= X-Received: by 2002:a37:4f8e:: with SMTP id d136mr678258qkb.495.1576521748154; Mon, 16 Dec 2019 10:42:28 -0800 (PST) MIME-Version: 1.0 References: <201912132232.xBDMW5LL074330@repo.freebsd.org> <201912151851.xBFIpLaX090429@gndrsh.dnsmgr.net> In-Reply-To: <201912151851.xBFIpLaX090429@gndrsh.dnsmgr.net> From: Warner Losh Date: Mon, 16 Dec 2019 11:42:16 -0700 Message-ID: Subject: Re: svn commit: r355737 - head/share/man/man9 To: "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 47c99x5Yjsz4BJy X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=l/TRb71a; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::735) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.69 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[9]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[5.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]; 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.69)[ip: (-9.32), ipnet: 2607:f8b0::/32(-2.19), asn: 15169(-1.90), 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 18:42:30 -0000 On Sun, Dec 15, 2019, 11:51 AM Rodney W. Grimes wrote: > > Author: imp > > Date: Fri Dec 13 22:32:05 2019 > > New Revision: 355737 > > URL: https://svnweb.freebsd.org/changeset/base/355737 > > > > Log: > > Better copyright advice > > > > Document the common practices around copyrights with "all rights > reserved" in > > them as new copyright notices get added. > > > > It's an open question qhether to point people at the fact that since > the Berne > > convention was ratified, All rights reserved is largely obsolete. > > https://en.wikipedia.org/wiki/All_rights_reserved#Obsolescence has the > > details. The committer's guide will be revised shortly, and it's > likely that's a > > better place for this discussion. If not, I'll add a blurb here. > > > > Reviewed by: jhb@, brooks@ > > Differential Review: https://reviews.freebsd.org/D22800 > > I object to the a review that specifically invites people to it, > is authored and committed in anything short of 24 hours and more > reasonable to actually ALLOW people time to repond of 72 hours. > The project has no fixed policies around reviews and giving time. Several people did look at it and approve it before I committed it. Having said that, this isn't like you've lost your ability to say something forever now that this is in the tree. If you have suggestions to improvement, I'm all ears. I like your notion around (c) being noise, but I'll address that in the review. Warner Regards, > Rod > > > Better copyright advice > AcceptedPublic > Authored by imp on Fri, Dec 13, 12:33. > > > Modified: > > head/share/man/man9/style.9 > > > > Modified: head/share/man/man9/style.9 > > > ============================================================================== > > --- head/share/man/man9/style.9 Fri Dec 13 22:04:13 2019 > (r355736) > > +++ head/share/man/man9/style.9 Fri Dec 13 22:32:05 2019 > (r355737) > > @@ -1,6 +1,5 @@ > > .\"- > > -.\" Copyright (c) 1995-2005 The FreeBSD Project > > -.\" All rights reserved. > > +.\" Copyright (c) 1995-2019 The FreeBSD Project > > .\" > > .\" Redistribution and use in source and binary forms, with or without > > .\" modification, are permitted provided that the following conditions > > @@ -26,7 +25,7 @@ > > .\" From: @(#)style 1.14 (Berkeley) 4/28/95 > > .\" $FreeBSD$ > > .\" > > -.Dd June 3, 2019 > > +.Dd December 13, 2019 > > .Dt STYLE 9 > > .Os > > .Sh NAME > > @@ -84,8 +83,32 @@ comments. > > Comments starting in columns other than the first are never > > considered license statements. > > Use the appropriate SPDX-License-Identifier line before the copyright. > > +If the copyright assertion contains the phrase > > +.Dq Li "All Rights Reserved" > > +that should be on the same line as the word > > +.Dq Li "Copyright" . > > +You should not insert a new copyright line between an old > > +copyright line and this phrase. > > +Instead, you should insert a new copyright phrase after > > +a pre-existing > > +.Dq Li "All Rights Reserved" > > +line. > > +When making changes, it is acceptable to fold an > > +.Dq Li "All Rights Reserved" > > +line with each of the > > +.Dq Li "Copyright" > > +lines. > > +For files that have the > > +.Dq Li "All Rights Reserved" > > +line on the same line(s) as the word > > +.Dq Li "Copyright" , > > +new copyright assertions should be added last. > > +New > > +.Dq Li "Copyright" > > +lines should only be added when making substantial changes to the file, > > +not for trivial changes. > > .Pp > > -After any copyright header, there is a blank line, and the > > +After any copyright and license comment, there is a blank line, and the > > .Li $\&FreeBSD$ > > for non C/C++ language source files. > > Version control system ID tags should only exist once in a file > > > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-head@freebsd.org Mon Dec 16 19:08:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 362561CC402; Mon, 16 Dec 2019 19:08:50 +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 47c9mL0ft4z4Cv0; Mon, 16 Dec 2019 19:08:50 +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 11DDB1BDA; Mon, 16 Dec 2019 19:08:50 +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 xBGJ8nND008950; Mon, 16 Dec 2019 19:08:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBGJ8nnc008949; Mon, 16 Dec 2019 19:08:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912161908.xBGJ8nnc008949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 16 Dec 2019 19:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355816 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 355816 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 19:08:50 -0000 Author: emaste Date: Mon Dec 16 19:08:49 2019 New Revision: 355816 URL: https://svnweb.freebsd.org/changeset/base/355816 Log: UPDATING: remove outdated caution against make -j Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22836 Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Dec 16 18:43:57 2019 (r355815) +++ head/UPDATING Mon Dec 16 19:08:49 2019 (r355816) @@ -1934,19 +1934,14 @@ COMMON ITEMS: General Notes ------------- - Avoid using make -j when upgrading. While generally safe, there are - sometimes problems using -j to upgrade. If your upgrade fails with - -j, please try again without -j. From time to time in the past there - have been problems using -j with buildworld and/or installworld. This - is especially true when upgrading between "distant" versions (eg one - that cross a major release boundary or several minor releases, or when - several months have passed on the -current branch). - Sometimes, obscure build problems are the result of environment poisoning. This can happen because the make utility reads its environment when searching for values for global variables. To run your build attempts in an "environmental clean room", prefix all make commands with 'env -i '. See the env(1) manual page for more details. + Occasionally a build failure will occur with "make -j" due to a race + condition. If this happens try building again without -j, and please + report a bug if it happens consistently. When upgrading from one major version to another it is generally best to upgrade to the latest code in the currently installed branch first, then From owner-svn-src-head@freebsd.org Mon Dec 16 19:16:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 70B101CC73C; Mon, 16 Dec 2019 19:16:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47c9x72SnVz4DNq; Mon, 16 Dec 2019 19:16:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FDB61DA6; Mon, 16 Dec 2019 19:16:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBGJGRxW014845; Mon, 16 Dec 2019 19:16:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBGJGQ4k014843; Mon, 16 Dec 2019 19:16:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912161916.xBGJGQ4k014843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 16 Dec 2019 19:16:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355817 - in head/sys/cam: ata scsi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/cam: ata scsi X-SVN-Commit-Revision: 355817 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 19:16:27 -0000 Author: imp Date: Mon Dec 16 19:16:26 2019 New Revision: 355817 URL: https://svnweb.freebsd.org/changeset/base/355817 Log: Revert r355813 It was extracted from a larger tree and is incomplete. Will resubmit after reworking. Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Mon Dec 16 19:08:49 2019 (r355816) +++ head/sys/cam/ata/ata_da.c Mon Dec 16 19:16:26 2019 (r355817) @@ -858,10 +858,6 @@ static void adaresume(void *arg); #define ADA_DEFAULT_WRITE_CACHE 1 #endif -#ifndef ADA_DEFAULT_MAX_DELETE -#define ADA_DEFAULT_MAX_DELETE (1 * 1024 * 1024 * 1024) /* 1GB max trim by default */ -#endif - #define ADA_RA (softc->read_ahead >= 0 ? \ softc->read_ahead : ada_read_ahead) #define ADA_WC (softc->write_cache >= 0 ? \ @@ -882,7 +878,6 @@ static int ada_spindown_shutdown = ADA_DEFAULT_SPINDOW static int ada_spindown_suspend = ADA_DEFAULT_SPINDOWN_SUSPEND; static int ada_read_ahead = ADA_DEFAULT_READ_AHEAD; static int ada_write_cache = ADA_DEFAULT_WRITE_CACHE; -static int64_t ada_default_max_delete = ADA_DEFAULT_MAX_DELETE; static SYSCTL_NODE(_kern_cam, OID_AUTO, ada, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); @@ -900,9 +895,6 @@ SYSCTL_INT(_kern_cam_ada, OID_AUTO, read_ahead, CTLFLA &ada_read_ahead, 0, "Enable disk read-ahead"); SYSCTL_INT(_kern_cam_ada, OID_AUTO, write_cache, CTLFLAG_RWTUN, &ada_write_cache, 0, "Enable disk write cache"); -SYSCTL_QUAD(_kern_cam_ada, OID_AUTO, default_max_delete, CTLFLAG_RWTUN, - &ada_default_max_delete, 0, - "Default system wide maximum delete"); /* * ADA_ORDEREDTAG_INTERVAL determines how often, relative @@ -3400,8 +3392,6 @@ adasetgeom(struct ada_softc *softc, struct ccb_getdev softc->disk->d_delmaxsize = 256 * softc->params.secsize; } else softc->disk->d_delmaxsize = maxio; - if (softc->disk->d_delmaxsize > ada_default_max_delete) - softc->disk->d_delmaxsize = ada_default_max_delete; if ((softc->cpi.hba_misc & PIM_UNMAPPED) != 0) { d_flags |= DISKFLAG_UNMAPPED_BIO; softc->unmappedio = 1; Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Dec 16 19:08:49 2019 (r355816) +++ head/sys/cam/scsi/scsi_da.c Mon Dec 16 19:16:26 2019 (r355817) @@ -1516,17 +1516,12 @@ static callout_func_t damediapoll; #define DA_DEFAULT_SEND_ORDERED 1 #endif -#ifndef DA_DEFAULT_MAX_DELETE -#define DA_DEFAULT_MAX_DELETE (1 * 1024 * 1024 * 1024) /* 1GB max trim by default */ -#endif - static int da_poll_period = DA_DEFAULT_POLL_PERIOD; static int da_retry_count = DA_DEFAULT_RETRY; static int da_default_timeout = DA_DEFAULT_TIMEOUT; static sbintime_t da_default_softtimeout = DA_DEFAULT_SOFTTIMEOUT; static int da_send_ordered = DA_DEFAULT_SEND_ORDERED; static int da_disable_wp_detection = 0; -static int64_t da_default_max_delete = DA_DEFAULT_MAX_DELETE; static SYSCTL_NODE(_kern_cam, OID_AUTO, da, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); @@ -1541,9 +1536,6 @@ SYSCTL_INT(_kern_cam_da, OID_AUTO, send_ordered, CTLFL SYSCTL_INT(_kern_cam_da, OID_AUTO, disable_wp_detection, CTLFLAG_RWTUN, &da_disable_wp_detection, 0, "Disable detection of write-protected disks"); -SYSCTL_INT64(_kern_cam_da, OID_AUTO, default_max_delete, CTLFLAG_RWTUN, - &da_default_max_delete, 0, - "Default system wide maximum delete"); SYSCTL_PROC(_kern_cam_da, OID_AUTO, default_softtimeout, CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, dasysctlsofttimeout, "I", @@ -2508,8 +2500,8 @@ dadeletemaxsize(struct da_softc *softc, da_delete_meth return 0; } - return (off_t)MIN(da_default_max_delete, softc->params.secsize * - omin(sectors, softc->params.sectors)); + return (off_t)softc->params.secsize * + omin(sectors, softc->params.sectors); } static void From owner-svn-src-head@freebsd.org Mon Dec 16 19:39:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B083F1CD087; Mon, 16 Dec 2019 19:39:55 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450: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 47cBSB5mLFz4FSB; Mon, 16 Dec 2019 19:39:54 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x441.google.com with SMTP id c9so8737690wrw.8; Mon, 16 Dec 2019 11:39:54 -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=lm02+9y8gY0tFXLCOtsh3zsT3YpTQ/7ULo+wLLenKZU=; b=tEO8Pb0SyaE4mRy7tS7OXK4TaM/6+1IKkwPRJeFCi6g1Z4vy+j56kJ+JH8VBsWaaGN gqTSAVbhgkaxeAvyOg+nN2ttZSv8pYlaj7KRsYmzYrX95yIxvK52L5PtkR2zWK2ObkLU eUGSBtMQClmYI1LCaUArJD74DOvQTIZn5JvteK1SQkYz2AF7CmAur2y4gNIcOONILWYL scZnk5Hmg080WoHHJ2R9EK9D30it3O+2ZtuAFHJqVLPosi8XHurH71SbYXTT++Q170c6 t5+RCNPYDZoo5ac86cQ7ePZCqTZl1zrgjkrWT27JYBvxcPrngzp5JP//QYwVanAllxhl 5EAA== 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=lm02+9y8gY0tFXLCOtsh3zsT3YpTQ/7ULo+wLLenKZU=; b=PKHjDPXdt12TMtvGoIxNS0XI12hGK0mZpJWcjok8ytKNbBV88wzoRM+ozLbg2N758C SjrER2nKxo9707Llkm3LkzXqMikhCRaP0H1kYeVCOISmz7rJC4ROkTxQzy0PjibfbgWI x86UiTa9aIkHdh7S/XLpD9TGDoITYuWFl9E2yxiskcR24NRjkVhD+qmSDe3ReBQMRR00 KeIQnqOZ+NOZza0xMwajmEZcdYSjDOHlib+5KTf9FGC3n5OuknpGMUFRnWPJvRWJoPg1 wKOMzZutS1Jh/NgKXI9incbrJLJVpdMNREfarhV46rmLcE3oE8rHjxhWv+vSVIwk4PLI 9vBA== X-Gm-Message-State: APjAAAW5qnnYqJxIcpPrv7HIfvNXLLqx10V89euyb6qTwZIIF4NVkrIo RdHBZy5yMNEw39hOMYZTifABdKv/WUJkcWBUKreF8Q== X-Google-Smtp-Source: APXvYqyWC85tSvbSsmJAfGBu5szooxAFn2I8XyQImJ6ET8sdbdc+M9WKUQQYPWoiXYZ6CiJQE2Ds/D/z0KuyX5EY0nU= X-Received: by 2002:a5d:4d8d:: with SMTP id b13mr33861558wru.6.1576525193269; Mon, 16 Dec 2019 11:39:53 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a5d:6b02:0:0:0:0:0 with HTTP; Mon, 16 Dec 2019 11:39:52 -0800 (PST) In-Reply-To: References: <201912152126.xBFLQoJ7037440@repo.freebsd.org> From: Mateusz Guzik Date: Mon, 16 Dec 2019 20:39:52 +0100 Message-ID: Subject: Re: svn commit: r355784 - in head/sys: compat/linuxkpi/common/src dev/dpaa kern mips/nlm sys To: Jeff Roberson Cc: Ryan Libby , Ed Maste , Jeff Roberson , src-committers , svn-src-all , svn-src-head , Mark Johnston , Konstantin Belousov Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 47cBSB5mLFz4FSB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=tEO8Pb0S; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::441 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)[]; 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.38), ipnet: 2a00:1450::/32(-2.67), asn: 15169(-1.90), country: US(-0.05)]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; 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.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; RCPT_COUNT_SEVEN(0.00)[9]; 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 19:39:55 -0000 The entire thing reads like a bug -- for each platform critical_exit can venture into mi_switch with interrupts disabled. On amd64 it just happens to do it after the count was updated, but still before they got-reenabled. Other platform also do critical enter/exit dance on each call instead of just on the 0<->1 transition of md_spinlock_count. iow each platform should be probably doing something like this instead: diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 7aadd86e3cd6..c90fe8ef961d 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1991,10 +1991,10 @@ spinlock_enter(void) td = curthread; if (td->td_md.md_spinlock_count == 0) { + critical_enter(); flags = intr_disable(); td->td_md.md_spinlock_count = 1; td->td_md.md_saved_flags = flags; - critical_enter(); } else td->td_md.md_spinlock_count++; } @@ -2009,8 +2009,8 @@ spinlock_exit(void) flags = td->td_md.md_saved_flags; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) { - critical_exit(); intr_restore(flags); + critical_exit(); } } On 12/16/19, Jeff Roberson wrote: > On Mon, 16 Dec 2019, Ryan Libby wrote: > >> On Mon, Dec 16, 2019 at 7:30 AM Ed Maste wrote: >>> >>> On Sun, 15 Dec 2019 at 16:27, Jeff Roberson wrote: >>>> >>>> Author: jeff >>>> Date: Sun Dec 15 21:26:50 2019 >>>> New Revision: 355784 >>>> URL: https://svnweb.freebsd.org/changeset/base/355784 >>>> >>>> Log: >>>> schedlock 4/4 >>> >>> FYI i386, arm, arm64, riscv fail to boot now, with "panic: invalid count >>> 2" >>> >>> Boot logs: >>> i386: https://ci.freebsd.org/job/FreeBSD-head-i386-test/7797/console >>> arm: >>> https://ci.freebsd.org/hwlab/job/FreeBSD-device-head-beaglebone-test/1317/artifact/device_tests/beaglebone.boot.log >>> arm64: >>> https://ci.freebsd.org/hwlab/job/FreeBSD-device-head-pinea64-test/1194/artifact/device_tests/pinea64.boot.log >>> riscv: >>> https://ci.freebsd.org/hwlab/job/FreeBSD-device-head-pinea64-test/1194/artifact/device_tests/pinea64.boot.log >>> >>> arm64 is: >>> >>> panic: invalid count 2 >>> cpuid = 0 >>> time = 1 >>> KDB: stack backtrace: >>> db_trace_self() at db_trace_self_wrapper+0x28 >>> pc = 0xffff0000007359ec lr = 0xffff000000106744 >>> sp = 0xffff000056b063c0 fp = 0xffff000056b065d0 >>> >>> db_trace_self_wrapper() at vpanic+0x18c >>> pc = 0xffff000000106744 lr = 0xffff000000408128 >>> sp = 0xffff000056b065e0 fp = 0xffff000056b06690 >>> >>> vpanic() at panic+0x44 >>> pc = 0xffff000000408128 lr = 0xffff000000407ed8 >>> sp = 0xffff000056b066a0 fp = 0xffff000056b06720 >>> >>> panic() at sched_switch+0x81c >>> pc = 0xffff000000407ed8 lr = 0xffff000000434264 >>> sp = 0xffff000056b06730 fp = 0xffff000056b06810 >>> >>> sched_switch() at mi_switch+0x170 >>> pc = 0xffff000000434264 lr = 0xffff000000413690 >>> sp = 0xffff000056b06820 fp = 0xffff000056b06840 >>> >>> mi_switch() at cpu_idle+0xc8 >>> pc = 0xffff000000413690 lr = 0xffff0000007400a0 >>> sp = 0xffff000056b06850 fp = 0xffff000056b06860 >>> >>> cpu_idle() at sched_idletd+0x380 >>> pc = 0xffff0000007400a0 lr = 0xffff000000436a90 >>> sp = 0xffff000056b06870 fp = 0xffff000056b06940 >>> >>> sched_idletd() at fork_exit+0x7c >>> pc = 0xffff000000436a90 lr = 0xffff0000003c7ba4 >>> sp = 0xffff000056b06950 fp = 0xffff000056b06980 >>> >>> fork_exit() at fork_trampoline+0x10 >>> pc = 0xffff0000003c7ba4 lr = 0xffff0000007521ac >>> sp = 0xffff000056b06990 fp = 0x0000000000000000 >>> >>> KDB: enter: panic >>> [ thread pid 11 tid 100003 ] >>> Stopped at 0 >>> db> >> >> It looks like amd64 vs i386, riscv, etc are using different motifs in >> spinlock_exit(). Perhaps we just need to rearrange them to drop the >> spinlock count before critical_exit(), like in amd64. > > It took me a moment to see why but I believe you are right. Interrupts > being disabled would prevent a local preemption with the flags out of sync > but critical_exit() might have owepreempt set so we will switch before > updating the count. > > Jeff > >> >> Ryan >> > -- Mateusz Guzik From owner-svn-src-head@freebsd.org Mon Dec 16 20:07:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7CD861CD9A5; Mon, 16 Dec 2019 20:07:06 +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 47cC3Z2nprz4GmN; Mon, 16 Dec 2019 20:07:06 +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 5B23026F0; Mon, 16 Dec 2019 20:07:06 +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 xBGK76i5043931; Mon, 16 Dec 2019 20:07:06 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBGK74ij043925; Mon, 16 Dec 2019 20:07:04 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201912162007.xBGK74ij043925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 16 Dec 2019 20:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355818 - in head: share/man/man4 sys/amd64/linux sys/amd64/linux32 sys/arm64/linux sys/compat/linux sys/i386/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: share/man/man4 sys/amd64/linux sys/amd64/linux32 sys/arm64/linux sys/compat/linux sys/i386/linux X-SVN-Commit-Revision: 355818 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 20:07:06 -0000 Author: trasz Date: Mon Dec 16 20:07:04 2019 New Revision: 355818 URL: https://svnweb.freebsd.org/changeset/base/355818 Log: Add compat.linux.emul_path, so it can be set to something other than "/compat/linux". Useful when you have several compat directories with different Linux versions and you don't want to clash with files installed by linux-c7 packages. Reviewed by: bcr (manpages) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22574 Modified: head/share/man/man4/linux.4 head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/arm64/linux/linux_sysvec.c head/sys/compat/linux/linux_util.c head/sys/compat/linux/linux_util.h head/sys/i386/linux/linux_sysvec.c Modified: head/share/man/man4/linux.4 ============================================================================== --- head/share/man/man4/linux.4 Mon Dec 16 19:16:26 2019 (r355817) +++ head/share/man/man4/linux.4 Mon Dec 16 20:07:04 2019 (r355818) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 13, 2019 +.Dd December 16, 2019 .Dt LINUX 4 .Os .Sh NAME @@ -95,6 +95,10 @@ variables and .Xr loader 8 tunables: .Bl -tag -width indent +.It Va compat.linux.emul_path +Path to the Linux run-time environment. +Defaults to +.Pa /compat/linux . .It Va compat.linux.osname Linux kernel operating system name. .It Va compat.linux.osrelease Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Mon Dec 16 19:16:26 2019 (r355817) +++ head/sys/amd64/linux/linux_sysvec.c Mon Dec 16 20:07:04 2019 (r355818) @@ -836,7 +836,7 @@ static Elf64_Brandinfo linux_glibc2brand = { .brand = ELFOSABI_LINUX, .machine = EM_X86_64, .compat_3_brand = "Linux", - .emul_path = "/compat/linux", + .emul_path = linux_emul_path, .interp_path = "/lib64/ld-linux-x86-64.so.2", .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, @@ -848,7 +848,7 @@ static Elf64_Brandinfo linux_glibc2brandshort = { .brand = ELFOSABI_LINUX, .machine = EM_X86_64, .compat_3_brand = "Linux", - .emul_path = "/compat/linux", + .emul_path = linux_emul_path, .interp_path = "/lib64/ld-linux.so.2", .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, @@ -860,7 +860,7 @@ static Elf64_Brandinfo linux_muslbrand = { .brand = ELFOSABI_LINUX, .machine = EM_X86_64, .compat_3_brand = "Linux", - .emul_path = "/compat/linux", + .emul_path = linux_emul_path, .interp_path = "/lib/ld-musl-x86_64.so.1", .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Mon Dec 16 19:16:26 2019 (r355817) +++ head/sys/amd64/linux32/linux32_sysvec.c Mon Dec 16 20:07:04 2019 (r355818) @@ -992,7 +992,7 @@ static Elf32_Brandinfo linux_brand = { .brand = ELFOSABI_LINUX, .machine = EM_386, .compat_3_brand = "Linux", - .emul_path = "/compat/linux", + .emul_path = linux_emul_path, .interp_path = "/lib/ld-linux.so.1", .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, @@ -1004,7 +1004,7 @@ static Elf32_Brandinfo linux_glibc2brand = { .brand = ELFOSABI_LINUX, .machine = EM_386, .compat_3_brand = "Linux", - .emul_path = "/compat/linux", + .emul_path = linux_emul_path, .interp_path = "/lib/ld-linux.so.2", .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, @@ -1016,7 +1016,7 @@ static Elf32_Brandinfo linux_muslbrand = { .brand = ELFOSABI_LINUX, .machine = EM_386, .compat_3_brand = "Linux", - .emul_path = "/compat/linux", + .emul_path = linux_emul_path, .interp_path = "/lib/ld-musl-i386.so.1", .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, Modified: head/sys/arm64/linux/linux_sysvec.c ============================================================================== --- head/sys/arm64/linux/linux_sysvec.c Mon Dec 16 19:16:26 2019 (r355817) +++ head/sys/arm64/linux/linux_sysvec.c Mon Dec 16 20:07:04 2019 (r355818) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include MODULE_VERSION(linux64elf, 1); @@ -494,7 +495,7 @@ static Elf64_Brandinfo linux_glibc2brand = { .brand = ELFOSABI_LINUX, .machine = EM_AARCH64, .compat_3_brand = "Linux", - .emul_path = "/compat/linux", + .emul_path = linux_emul_path, .interp_path = "/lib64/ld-linux-x86-64.so.2", .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, Modified: head/sys/compat/linux/linux_util.c ============================================================================== --- head/sys/compat/linux/linux_util.c Mon Dec 16 19:16:26 2019 (r355817) +++ head/sys/compat/linux/linux_util.c Mon Dec 16 20:07:04 2019 (r355818) @@ -46,11 +46,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include #include MALLOC_DEFINE(M_LINUX, "linux", "Linux mode structures"); @@ -58,7 +60,11 @@ MALLOC_DEFINE(M_EPOLL, "lepoll", "Linux events structu MALLOC_DEFINE(M_FUTEX, "futex", "Linux futexes"); MALLOC_DEFINE(M_FUTEX_WP, "futex wp", "Linux futex waiting proc"); -const char linux_emul_path[] = "/compat/linux"; +char linux_emul_path[MAXPATHLEN] = "/compat/linux"; + +SYSCTL_STRING(_compat_linux, OID_AUTO, emul_path, CTLFLAG_RWTUN, + linux_emul_path, sizeof(linux_emul_path), + "Linux runtime environment path"); /* * Search an alternate path before passing pathname arguments on to Modified: head/sys/compat/linux/linux_util.h ============================================================================== --- head/sys/compat/linux/linux_util.h Mon Dec 16 19:16:26 2019 (r355817) +++ head/sys/compat/linux/linux_util.h Mon Dec 16 20:07:04 2019 (r355818) @@ -50,7 +50,7 @@ MALLOC_DECLARE(M_EPOLL); MALLOC_DECLARE(M_FUTEX); MALLOC_DECLARE(M_FUTEX_WP); -extern const char linux_emul_path[]; +extern char linux_emul_path[]; int linux_emul_convpath(struct thread *, const char *, enum uio_seg, char **, int, int); Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Mon Dec 16 19:16:26 2019 (r355817) +++ head/sys/i386/linux/linux_sysvec.c Mon Dec 16 20:07:04 2019 (r355818) @@ -974,7 +974,7 @@ static Elf32_Brandinfo linux_brand = { .brand = ELFOSABI_LINUX, .machine = EM_386, .compat_3_brand = "Linux", - .emul_path = "/compat/linux", + .emul_path = linux_emul_path, .interp_path = "/lib/ld-linux.so.1", .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, @@ -986,7 +986,7 @@ static Elf32_Brandinfo linux_glibc2brand = { .brand = ELFOSABI_LINUX, .machine = EM_386, .compat_3_brand = "Linux", - .emul_path = "/compat/linux", + .emul_path = linux_emul_path, .interp_path = "/lib/ld-linux.so.2", .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, @@ -998,7 +998,7 @@ static Elf32_Brandinfo linux_muslbrand = { .brand = ELFOSABI_LINUX, .machine = EM_386, .compat_3_brand = "Linux", - .emul_path = "/compat/linux", + .emul_path = linux_emul_path, .interp_path = "/lib/ld-musl-i386.so.1", .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, From owner-svn-src-head@freebsd.org Mon Dec 16 20:15:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4CF5D1CDC63; Mon, 16 Dec 2019 20:15:06 +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 47cCDp1F3Dz4HG7; Mon, 16 Dec 2019 20:15:06 +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 25C3028C3; Mon, 16 Dec 2019 20:15:06 +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 xBGKF66l050293; Mon, 16 Dec 2019 20:15:06 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBGKF4v2050284; Mon, 16 Dec 2019 20:15:04 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201912162015.xBGKF4v2050284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Mon, 16 Dec 2019 20:15:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355819 - in head/sys: arm/arm arm64/arm64 i386/i386 mips/mips powerpc/powerpc riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: arm/arm arm64/arm64 i386/i386 mips/mips powerpc/powerpc riscv/riscv X-SVN-Commit-Revision: 355819 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 20:15:06 -0000 Author: jeff Date: Mon Dec 16 20:15:04 2019 New Revision: 355819 URL: https://svnweb.freebsd.org/changeset/base/355819 Log: 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. Reported by: emaste Suggested by: rlibby Discussed with: jhb, rlibby Tested by: manu (arm64) Modified: head/sys/arm/arm/machdep.c head/sys/arm64/arm64/machdep.c head/sys/i386/i386/machdep.c head/sys/mips/mips/machdep.c head/sys/powerpc/powerpc/machdep.c head/sys/riscv/riscv/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Mon Dec 16 20:07:04 2019 (r355818) +++ head/sys/arm/arm/machdep.c Mon Dec 16 20:15:04 2019 (r355819) @@ -389,9 +389,9 @@ spinlock_enter(void) cspr = disable_interrupts(PSR_I | PSR_F); td->td_md.md_spinlock_count = 1; td->td_md.md_saved_cspr = cspr; + critical_enter(); } else td->td_md.md_spinlock_count++; - critical_enter(); } void @@ -401,11 +401,12 @@ spinlock_exit(void) register_t cspr; td = curthread; - critical_exit(); cspr = td->td_md.md_saved_cspr; td->td_md.md_spinlock_count--; - if (td->td_md.md_spinlock_count == 0) + if (td->td_md.md_spinlock_count == 0) { + critical_exit(); restore_interrupts(cspr); + } } /* Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Mon Dec 16 20:07:04 2019 (r355818) +++ head/sys/arm64/arm64/machdep.c Mon Dec 16 20:15:04 2019 (r355819) @@ -635,9 +635,9 @@ spinlock_enter(void) daif = intr_disable(); td->td_md.md_spinlock_count = 1; td->td_md.md_saved_daif = daif; + critical_enter(); } else td->td_md.md_spinlock_count++; - critical_enter(); } void @@ -647,11 +647,12 @@ spinlock_exit(void) register_t daif; td = curthread; - critical_exit(); daif = td->td_md.md_saved_daif; td->td_md.md_spinlock_count--; - if (td->td_md.md_spinlock_count == 0) + if (td->td_md.md_spinlock_count == 0) { + critical_exit(); intr_restore(daif); + } } #ifndef _SYS_SYSPROTO_H_ Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Mon Dec 16 20:07:04 2019 (r355818) +++ head/sys/i386/i386/machdep.c Mon Dec 16 20:15:04 2019 (r355819) @@ -2679,9 +2679,9 @@ spinlock_enter(void) flags = intr_disable(); td->td_md.md_spinlock_count = 1; td->td_md.md_saved_flags = flags; + critical_enter(); } else td->td_md.md_spinlock_count++; - critical_enter(); } void @@ -2691,11 +2691,12 @@ spinlock_exit(void) register_t flags; td = curthread; - critical_exit(); flags = td->td_md.md_saved_flags; td->td_md.md_spinlock_count--; - if (td->td_md.md_spinlock_count == 0) + if (td->td_md.md_spinlock_count == 0) { + critical_exit(); intr_restore(flags); + } } #if defined(I586_CPU) && !defined(NO_F00F_HACK) Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Mon Dec 16 20:07:04 2019 (r355818) +++ head/sys/mips/mips/machdep.c Mon Dec 16 20:15:04 2019 (r355819) @@ -516,9 +516,9 @@ spinlock_enter(void) intr = intr_disable(); td->td_md.md_spinlock_count = 1; td->td_md.md_saved_intr = intr; + critical_enter(); } else td->td_md.md_spinlock_count++; - critical_enter(); } void @@ -528,11 +528,12 @@ spinlock_exit(void) register_t intr; td = curthread; - critical_exit(); intr = td->td_md.md_saved_intr; td->td_md.md_spinlock_count--; - if (td->td_md.md_spinlock_count == 0) + if (td->td_md.md_spinlock_count == 0) { + critical_exit(); intr_restore(intr); + } } /* Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Mon Dec 16 20:07:04 2019 (r355818) +++ head/sys/powerpc/powerpc/machdep.c Mon Dec 16 20:15:04 2019 (r355819) @@ -499,9 +499,9 @@ spinlock_enter(void) msr = intr_disable(); td->td_md.md_spinlock_count = 1; td->td_md.md_saved_msr = msr; + critical_enter(); } else td->td_md.md_spinlock_count++; - critical_enter(); } void @@ -511,10 +511,10 @@ spinlock_exit(void) register_t msr; td = curthread; - critical_exit(); msr = td->td_md.md_saved_msr; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) { + critical_exit(); intr_restore(msr); nop_prio_medium(); } Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Mon Dec 16 20:07:04 2019 (r355818) +++ head/sys/riscv/riscv/machdep.c Mon Dec 16 20:15:04 2019 (r355819) @@ -489,9 +489,9 @@ spinlock_enter(void) reg = intr_disable(); td->td_md.md_spinlock_count = 1; td->td_md.md_saved_sstatus_ie = reg; + critical_enter(); } else td->td_md.md_spinlock_count++; - critical_enter(); } void @@ -501,11 +501,12 @@ spinlock_exit(void) register_t sstatus_ie; td = curthread; - critical_exit(); sstatus_ie = td->td_md.md_saved_sstatus_ie; td->td_md.md_spinlock_count--; - if (td->td_md.md_spinlock_count == 0) + if (td->td_md.md_spinlock_count == 0) { + critical_exit(); intr_restore(sstatus_ie); + } } #ifndef _SYS_SYSPROTO_H_ From owner-svn-src-head@freebsd.org Mon Dec 16 20:15:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7281E1CDCDD; Mon, 16 Dec 2019 20:15:45 +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 47cCFY2L6Nz4HNt; Mon, 16 Dec 2019 20:15:45 +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 4B83728CB; Mon, 16 Dec 2019 20:15:45 +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 xBGKFjZp050368; Mon, 16 Dec 2019 20:15:45 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBGKFibw050363; Mon, 16 Dec 2019 20:15:44 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201912162015.xBGKFibw050363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 16 Dec 2019 20:15:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355820 - in head: share/man/man4 sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: share/man/man4 sys/compat/linux X-SVN-Commit-Revision: 355820 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 20:15:45 -0000 Author: trasz Date: Mon Dec 16 20:15:44 2019 New Revision: 355820 URL: https://svnweb.freebsd.org/changeset/base/355820 Log: Add a hack to make ^T work for Linux binaries, enabled with 'compat.linux.preserve_vstatus=1' sysctl. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21967 Modified: head/share/man/man4/linux.4 head/sys/compat/linux/linux_ioctl.c head/sys/compat/linux/linux_ioctl.h head/sys/compat/linux/linux_mib.c head/sys/compat/linux/linux_mib.h Modified: head/share/man/man4/linux.4 ============================================================================== --- head/share/man/man4/linux.4 Mon Dec 16 20:15:04 2019 (r355819) +++ head/share/man/man4/linux.4 Mon Dec 16 20:15:44 2019 (r355820) @@ -109,6 +109,14 @@ Recent versions of GNU libc are known to use different on the value of this sysctl. .It Va compat.linux.oss_version Linux Open Sound System version. +.It Va compat.linux.preserve_vstatus +When set to 1, it prevents Linux applications from resetting the +.Xr termios 4 +VSTATUS setting. +From a user perspective, this makes +.Va SIGINFO +work for Linux executables. +Defaults to 0. .Sh FILES .Bl -tag -width /compat/linux/dev/shm -compact .It Pa /compat/linux Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Mon Dec 16 20:15:04 2019 (r355819) +++ head/sys/compat/linux/linux_ioctl.c Mon Dec 16 20:15:44 2019 (r355820) @@ -500,6 +500,8 @@ bsd_to_linux_termios(struct termios *bios, struct linu lios->c_cc[LINUX_VDISCARD] = bios->c_cc[VDISCARD]; lios->c_cc[LINUX_VWERASE] = bios->c_cc[VWERASE]; lios->c_cc[LINUX_VLNEXT] = bios->c_cc[VLNEXT]; + if (linux_preserve_vstatus) + lios->c_cc[LINUX_VSTATUS] = bios->c_cc[VSTATUS]; for (i=0; ic_cc[VDISCARD] = lios->c_cc[LINUX_VDISCARD]; bios->c_cc[VWERASE] = lios->c_cc[LINUX_VWERASE]; bios->c_cc[VLNEXT] = lios->c_cc[LINUX_VLNEXT]; + if (linux_preserve_vstatus) + bios->c_cc[VSTATUS] = lios->c_cc[LINUX_VSTATUS]; for (i=0; i= LINUX_KERNVER_2006000) +extern int linux_preserve_vstatus; + #endif /* _LINUX_MIB_H_ */ From owner-svn-src-head@freebsd.org Mon Dec 16 20:59:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1D981CE866; Mon, 16 Dec 2019 20:59:30 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) (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 47cDD255T3z4K0f; Mon, 16 Dec 2019 20:59:30 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x431.google.com with SMTP id x185so6281985pfc.5; Mon, 16 Dec 2019 12:59:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=/EWCLg2ANZ/5AUB16TUOvLp0mVhVBCMt4XRUEfqH6LE=; b=S5P+Fk+mCZ7FUcX53Z+WufHlK7gqUKysJlG2w/1dYMMGiCP+OA1WOmGqUyx1XwciNn 2LKYsS/3F6MQryVmrfE1oegp32lqT0erpDKHqbmf3K2VjUcGDqjHD6geRSDAvGJDn7/b ofHcOQF7pwUb84tbNx7LTuZkUKAIipyqXMTxRhSYe9nMolFPLZkxVhrOhyVJxaQohvxE UhbBBmku6U8Gib9pyRKPe1W0LzVGrOqguDhi33UvPaPxhJJG1TuA5EUnbJfn+lUSlNLo fhK68bnAqcm/PIyZejIGa6bFr9Z6RH3LeObkVVYfPo5dy6wvJyFbmuNE7wyUNVj+1rrk PMRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=/EWCLg2ANZ/5AUB16TUOvLp0mVhVBCMt4XRUEfqH6LE=; b=h3d2YmsJzu7P/kxBNKgprzEyI/7pXCqB9PlY4923oeNrtNBphNIDjfyMmxwtCkKYuF hzES0TXvVvhyjewZlxJhNO/h74Y7bQ3wSeZ792ijPe1dlQix8hJTiPmx5bwRJkzD4GUX eTzmkK101pmOS12pyTXI1+/Hbbn/KmMYUkClIq99hfAQkzTYB3URVpmpI/cqr52JECYf 23OP7EQxktfGtP+0EPP3wksx/begtTmuTxuOhWmCmrSWhxvSJk1T8/E7lqPfnB1AJwkO bgoDUVkXne5xXlNkvNJKMrdo0OS7b3oEgBZNvY9SZB4kElCX/mFWPd9bGULgAi8UC8zL F4Ag== X-Gm-Message-State: APjAAAWdwl7xih+lc4ZSqpx1zrfcJnz/dNzHr3d6dON7NFpZp3EM/F3z 8Mh+YDTwuGtMIZ+UBWIo6tBrG21c X-Google-Smtp-Source: APXvYqxalhkkAw8zoLsndBkcJ8XE/Wf7pNtPCT3WMCj4e5Kmoek8/dpSUoTXE8v8a/MzhPmsjQLv/A== X-Received: by 2002:a63:fc01:: with SMTP id j1mr21455950pgi.220.1576529968724; Mon, 16 Dec 2019 12:59:28 -0800 (PST) Received: from ?IPv6:2607:fb90:a69b:1e81:294b:2de:2ee7:fcf1? ([2607:fb90:a69b:1e81:294b:2de:2ee7:fcf1]) by smtp.gmail.com with ESMTPSA id z1sm24009303pfk.61.2019.12.16.12.59.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Dec 2019 12:59:27 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Enji Cooper Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r355818 - in head: share/man/man4 sys/amd64/linux sys/amd64/linux32 sys/arm64/linux sys/compat/linux sys/i386/linux Date: Mon, 16 Dec 2019 12:59:26 -0800 Message-Id: References: <201912162007.xBGK74ij043925@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201912162007.xBGK74ij043925@repo.freebsd.org> To: Edward Tomasz Napierala X-Mailer: iPhone Mail (17A878) X-Rspamd-Queue-Id: 47cDD255T3z4K0f 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)[-0.999,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 20:59:30 -0000 > On Dec 16, 2019, at 12:07, Edward Tomasz Napierala wro= te: >=20 > =EF=BB=BFAuthor: trasz > Date: Mon Dec 16 20:07:04 2019 > New Revision: 355818 > URL: https://svnweb.freebsd.org/changeset/base/355818 >=20 > Log: > Add compat.linux.emul_path, so it can be set to something other > than "/compat/linux". Useful when you have several compat directories > with different Linux versions and you don't want to clash with files > installed by linux-c7 packages. Hi Edward! Great feature :).. i was wondering if it made sense to implement this sy= sctl as a per-jail setting so one jail could have one setting and another ha= ve another setting? Arguably, one could just leave the default, but it=E2=80= =99s a just thought I had when reading your commit message. Thank you :)! -Enji= From owner-svn-src-head@freebsd.org Mon Dec 16 21:06:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 589601CEADE; Mon, 16 Dec 2019 21:06:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cDN11c0Zz4KPg; Mon, 16 Dec 2019 21:06:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 324EE3226; Mon, 16 Dec 2019 21:06:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBGL6OmL079217; Mon, 16 Dec 2019 21:06:24 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBGL6O18079215; Mon, 16 Dec 2019 21:06:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912162106.xBGL6O18079215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 16 Dec 2019 21:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355821 - in head: sbin/geom usr.sbin/ppp X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: sbin/geom usr.sbin/ppp X-SVN-Commit-Revision: 355821 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 21:06:25 -0000 Author: imp Date: Mon Dec 16 21:06:24 2019 New Revision: 355821 URL: https://svnweb.freebsd.org/changeset/base/355821 Log: Remove all the RELEASE_CRUNCH defines, they are useless. RELEASE_CRUNCH has been broken for a very long time. Remove the last remants from the tree. Modified: head/sbin/geom/Makefile head/usr.sbin/ppp/Makefile Modified: head/sbin/geom/Makefile ============================================================================== --- head/sbin/geom/Makefile Mon Dec 16 20:15:44 2019 (r355820) +++ head/sbin/geom/Makefile Mon Dec 16 21:06:24 2019 (r355821) @@ -13,7 +13,7 @@ CFLAGS+= -DGEOM_CLASS_DIR=\"${GEOM_CLASS_DIR}\" LIBADD= geom util -.if defined(RESCUE) || defined(RELEASE_CRUNCH) +.if defined(RESCUE) .PATH: ${SRCTOP}/lib/geom/part \ ${SRCTOP}/lib/geom/label Modified: head/usr.sbin/ppp/Makefile ============================================================================== --- head/usr.sbin/ppp/Makefile Mon Dec 16 20:15:44 2019 (r355820) +++ head/usr.sbin/ppp/Makefile Mon Dec 16 21:06:24 2019 (r355821) @@ -11,14 +11,6 @@ SRCS= acf.c arp.c async.c auth.c bundle.c cbcp.c ccp.c proto.c route.c server.c sig.c slcompress.c sync.c systems.c tcp.c \ tcpmss.c throughput.c timer.c tty.c tun.c udp.c vjcomp.c WARNS?= 3 -.if defined(RELEASE_CRUNCH) -PPP_NO_DES= -PPP_NO_KLDLOAD= -PPP_NO_NAT= -PPP_NO_PAM= -PPP_NO_RADIUS= -PPP_NO_SUID= -.endif CONFS= ppp.conf CONFSDIR= ${CONFDIR}/ppp CONFSMODE= 600 From owner-svn-src-head@freebsd.org Mon Dec 16 21:34:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA94A1CF49C; Mon, 16 Dec 2019 21:34:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cF0r523Tz4LrH; Mon, 16 Dec 2019 21:34:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7B643995; Mon, 16 Dec 2019 21:34:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBGLYqtb096763; Mon, 16 Dec 2019 21:34:52 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBGLYp6i096758; Mon, 16 Dec 2019 21:34:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912162134.xBGLYp6i096758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 16 Dec 2019 21:34:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355822 - in head/sys: conf dev/pccbb modules/cbb X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: conf dev/pccbb modules/cbb X-SVN-Commit-Revision: 355822 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 21:34:52 -0000 Author: imp Date: Mon Dec 16 21:34:51 2019 New Revision: 355822 URL: https://svnweb.freebsd.org/changeset/base/355822 Log: We'll never have multiple slots a cardbus bridge. So, replace exca array with a singleton. Also, pccbb isa attachment is never going to happen, do disconnect it from the build (will delete this in future commit). It would need to be updated as well, but since this code is effectively dead code, remove it from the build instead. Modified: head/sys/conf/files head/sys/dev/pccbb/pccbb.c head/sys/dev/pccbb/pccbb_pci.c head/sys/dev/pccbb/pccbbvar.h head/sys/modules/cbb/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Dec 16 21:06:24 2019 (r355821) +++ head/sys/conf/files Mon Dec 16 21:34:51 2019 (r355822) @@ -2552,7 +2552,6 @@ dev/pccard/pccard_cis_quirks.c optional pccard dev/pccard/pccard_device.c optional pccard dev/pccard/power_if.m standard dev/pccbb/pccbb.c optional cbb -dev/pccbb/pccbb_isa.c optional cbb isa dev/pccbb/pccbb_pci.c optional cbb pci dev/pcf/pcf.c optional pcf dev/pci/fixup_pci.c optional pci Modified: head/sys/dev/pccbb/pccbb.c ============================================================================== --- head/sys/dev/pccbb/pccbb.c Mon Dec 16 21:06:24 2019 (r355821) +++ head/sys/dev/pccbb/pccbb.c Mon Dec 16 21:34:51 2019 (r355822) @@ -253,9 +253,9 @@ cbb_disable_func_intr(struct cbb_softc *sc) #if 0 uint8_t reg; - reg = (exca_getb(&sc->exca[0], EXCA_INTR) & ~EXCA_INTR_IRQ_MASK) | + reg = (exca_getb(&sc->exca, EXCA_INTR) & ~EXCA_INTR_IRQ_MASK) | EXCA_INTR_IRQ_RESERVED1; - exca_putb(&sc->exca[0], EXCA_INTR, reg); + exca_putb(&sc->exca, EXCA_INTR, reg); #endif } @@ -271,11 +271,9 @@ cbb_enable_func_intr(struct cbb_softc *sc) { uint8_t reg; - reg = (exca_getb(&sc->exca[0], EXCA_INTR) & ~EXCA_INTR_IRQ_MASK) | + reg = (exca_getb(&sc->exca, EXCA_INTR) & ~EXCA_INTR_IRQ_MASK) | EXCA_INTR_IRQ_NONE; - exca_putb(&sc->exca[0], EXCA_INTR, reg); - PCI_MASK_CONFIG(sc->dev, CBBR_BRIDGECTRL, - & ~CBBM_BRIDGECTRL_INTR_IREQ_ISA_EN, 2); + exca_putb(&sc->exca, EXCA_INTR, reg); } int @@ -322,7 +320,7 @@ cbb_detach(device_t brdev) cbb_set(sc, CBB_SOCKET_MASK, 0); /* reset 16-bit pcmcia bus */ - exca_clrb(&sc->exca[0], EXCA_INTR, EXCA_INTR_RESET); + exca_clrb(&sc->exca, EXCA_INTR, EXCA_INTR_RESET); /* turn off power */ cbb_power(brdev, CARD_OFF); @@ -442,7 +440,7 @@ cbb_child_detached(device_t brdev, device_t child) struct cbb_softc *sc = device_get_softc(brdev); /* I'm not sure we even need this */ - if (child != sc->cbdev && child != sc->exca[0].pccarddev) + if (child != sc->cbdev && child != sc->exca.pccarddev) device_printf(brdev, "Unknown child detached: %s\n", device_get_nameunit(child)); } @@ -549,9 +547,9 @@ cbb_insert(struct cbb_softc *sc) sockevent, sockstate)); if (sockstate & CBB_STATE_R2_CARD) { - if (device_is_attached(sc->exca[0].pccarddev)) { + if (device_is_attached(sc->exca.pccarddev)) { sc->flags |= CBB_16BIT_CARD; - exca_insert(&sc->exca[0]); + exca_insert(&sc->exca); } else { device_printf(sc->dev, "16-bit card inserted, but no pccard bus.\n"); @@ -578,7 +576,7 @@ cbb_removal(struct cbb_softc *sc) { sc->cardok = 0; if (sc->flags & CBB_16BIT_CARD) { - exca_removal(&sc->exca[0]); + exca_removal(&sc->exca); } else { if (device_is_attached(sc->cbdev)) CARD_DETACH_CARD(sc->cbdev); @@ -708,8 +706,8 @@ cbb_o2micro_power_hack(struct cbb_softc *sc) * keyboard controller's interrupts being suppressed occurred when * we did this. */ - reg = exca_getb(&sc->exca[0], EXCA_INTR); - exca_putb(&sc->exca[0], EXCA_INTR, (reg & 0xf0) | 1); + reg = exca_getb(&sc->exca, EXCA_INTR); + exca_putb(&sc->exca, EXCA_INTR, (reg & 0xf0) | 1); return (reg); } @@ -721,7 +719,7 @@ cbb_o2micro_power_hack(struct cbb_softc *sc) static void cbb_o2micro_power_hack2(struct cbb_softc *sc, uint8_t reg) { - exca_putb(&sc->exca[0], EXCA_INTR, reg); + exca_putb(&sc->exca, EXCA_INTR, reg); } int @@ -921,7 +919,7 @@ cbb_do_power(device_t brdev) uint32_t status; /* Don't enable OE (output enable) until power stable */ - exca_clrb(&sc->exca[0], EXCA_PWRCTL, EXCA_PWRCTL_OE); + exca_clrb(&sc->exca, EXCA_PWRCTL, EXCA_PWRCTL_OE); voltage = cbb_detect_voltage(brdev); curpwr = cbb_current_voltage(brdev); @@ -1312,7 +1310,7 @@ cbb_pcic_power_enable_socket(device_t brdev, device_t err = cbb_do_power(brdev); if (err) return (err); - exca_reset(&sc->exca[0], child); + exca_reset(&sc->exca, child); return (0); } @@ -1325,18 +1323,18 @@ cbb_pcic_power_disable_socket(device_t brdev, device_t DPRINTF(("cbb_pcic_socket_disable\n")); /* Turn off the card's interrupt and leave it in reset, wait 10ms */ - exca_putb(&sc->exca[0], EXCA_INTR, 0); + exca_putb(&sc->exca, EXCA_INTR, 0); pause("cbbP1", hz / 100); /* power down the socket */ cbb_power(brdev, CARD_OFF); - exca_putb(&sc->exca[0], EXCA_PWRCTL, 0); + exca_putb(&sc->exca, EXCA_PWRCTL, 0); /* wait 300ms until power fails (Tpf). */ pause("cbbP2", hz * 300 / 1000); /* enable CSC interrupts */ - exca_putb(&sc->exca[0], EXCA_INTR, EXCA_INTR_ENABLE); + exca_putb(&sc->exca, EXCA_INTR, EXCA_INTR_ENABLE); return (0); } @@ -1370,7 +1368,7 @@ cbb_pcic_activate_resource(device_t brdev, device_t ch struct cbb_softc *sc = device_get_softc(brdev); int error; - error = exca_activate_resource(&sc->exca[0], child, type, rid, res); + error = exca_activate_resource(&sc->exca, child, type, rid, res); if (error == 0) cbb_activate_window(brdev, type); return (error); @@ -1381,7 +1379,7 @@ cbb_pcic_deactivate_resource(device_t brdev, device_t int rid, struct resource *res) { struct cbb_softc *sc = device_get_softc(brdev); - return (exca_deactivate_resource(&sc->exca[0], child, type, rid, res)); + return (exca_deactivate_resource(&sc->exca, child, type, rid, res)); } static struct resource * @@ -1476,7 +1474,7 @@ cbb_pcic_set_res_flags(device_t brdev, device_t child, "set_res_flags: specified rid not found\n"); return (ENOENT); } - return (exca_mem_set_flags(&sc->exca[0], res, flags)); + return (exca_mem_set_flags(&sc->exca, res, flags)); } int @@ -1492,7 +1490,7 @@ cbb_pcic_set_memory_offset(device_t brdev, device_t ch "set_memory_offset: specified rid not found\n"); return (ENOENT); } - return (exca_mem_set_offset(&sc->exca[0], res, cardaddr, deltap)); + return (exca_mem_set_offset(&sc->exca, res, cardaddr, deltap)); } /************************************************************************/ Modified: head/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- head/sys/dev/pccbb/pccbb_pci.c Mon Dec 16 21:06:24 2019 (r355821) +++ head/sys/dev/pccbb/pccbb_pci.c Mon Dec 16 21:34:51 2019 (r355822) @@ -294,7 +294,6 @@ cbb_pci_attach(device_t brdev) sc->chipset = cbb_chipset(pci_get_devid(brdev), NULL); sc->dev = brdev; sc->cbdev = NULL; - sc->exca[0].pccarddev = NULL; sc->domain = pci_get_domain(brdev); sc->pribus = pcib_get_bus(parent); #if defined(NEW_PCIB) && defined(PCI_RES_BUS) @@ -320,9 +319,9 @@ cbb_pci_attach(device_t brdev) sc->bst = rman_get_bustag(sc->base_res); sc->bsh = rman_get_bushandle(sc->base_res); - exca_init(&sc->exca[0], brdev, sc->bst, sc->bsh, CBB_EXCA_OFFSET); - sc->exca[0].flags |= EXCA_HAS_MEMREG_WIN; - sc->exca[0].chipset = EXCA_CARDBUS; + exca_init(&sc->exca, brdev, sc->bst, sc->bsh, CBB_EXCA_OFFSET); + sc->exca.flags |= EXCA_HAS_MEMREG_WIN; + sc->exca.chipset = EXCA_CARDBUS; sc->chipinit = cbb_chipinit; sc->chipinit(sc); @@ -381,10 +380,10 @@ cbb_pci_attach(device_t brdev) else if (device_probe_and_attach(sc->cbdev) != 0) DEVPRINTF((brdev, "WARNING: cannot attach cardbus bus!\n")); - sc->exca[0].pccarddev = device_add_child(brdev, "pccard", -1); - if (sc->exca[0].pccarddev == NULL) + sc->exca.pccarddev = device_add_child(brdev, "pccard", -1); + if (sc->exca.pccarddev == NULL) DEVPRINTF((brdev, "WARNING: cannot add pccard bus.\n")); - else if (device_probe_and_attach(sc->exca[0].pccarddev) != 0) + else if (device_probe_and_attach(sc->exca.pccarddev) != 0) DEVPRINTF((brdev, "WARNING: cannot attach pccard bus.\n")); /* Map and establish the interrupt. */ @@ -403,7 +402,7 @@ cbb_pci_attach(device_t brdev) } /* reset 16-bit pcmcia bus */ - exca_clrb(&sc->exca[0], EXCA_INTR, EXCA_INTR_RESET); + exca_clrb(&sc->exca, EXCA_INTR, EXCA_INTR_RESET); /* turn off power */ cbb_power(brdev, CARD_OFF); @@ -580,10 +579,10 @@ cbb_chipinit(struct cbb_softc *sc) * still be correctly generated if NO ISA IRQ is * selected (ExCA regs 03h or 05h are cleared). */ - reg = exca_getb(&sc->exca[0], EXCA_O2MICRO_CTRL_C); + reg = exca_getb(&sc->exca, EXCA_O2MICRO_CTRL_C); reg = (reg & 0x0f) | EXCA_O2CC_IREQ_INTC | EXCA_O2CC_STSCHG_INTC; - exca_putb(&sc->exca[0], EXCA_O2MICRO_CTRL_C, reg); + exca_putb(&sc->exca, EXCA_O2MICRO_CTRL_C, reg); break; case CB_TOPIC97: /* @@ -601,7 +600,7 @@ cbb_chipinit(struct cbb_softc *sc) * ToPIC97, 100 * Need to assert support for low voltage cards */ - exca_setb(&sc->exca[0], EXCA_TOPIC97_CTRL, + exca_setb(&sc->exca, EXCA_TOPIC97_CTRL, EXCA_TOPIC97_CTRL_LV_MASK); goto topic_common; case CB_TOPIC95: @@ -644,8 +643,8 @@ cbb_chipinit(struct cbb_softc *sc) * INTR_ENABLE and the other is to set CSC to 0. Since both * methods are mutually compatible, we do both. */ - exca_putb(&sc->exca[0], EXCA_INTR, EXCA_INTR_ENABLE); - exca_putb(&sc->exca[0], EXCA_CSC_INTR, 0); + exca_putb(&sc->exca, EXCA_INTR, EXCA_INTR_ENABLE); + exca_putb(&sc->exca, EXCA_CSC_INTR, 0); cbb_disable_func_intr(sc); @@ -684,7 +683,7 @@ cbb_pci_shutdown(device_t brdev) * down the socket. */ PCI_MASK_CONFIG(brdev, CBBR_BRIDGECTRL, |CBBM_BRIDGECTRL_RESET, 2); - exca_clrb(&sc->exca[0], EXCA_INTR, EXCA_INTR_RESET); + exca_clrb(&sc->exca, EXCA_INTR, EXCA_INTR_RESET); cbb_set(sc, CBB_SOCKET_MASK, 0); cbb_set(sc, CBB_SOCKET_EVENT, 0xffffffff); cbb_power(brdev, CARD_OFF); @@ -693,7 +692,7 @@ cbb_pci_shutdown(device_t brdev) * For paranoia, turn off all address decoding. Really not needed, * it seems, but it can't hurt */ - exca_putb(&sc->exca[0], EXCA_ADDRWIN_ENABLE, 0); + exca_putb(&sc->exca, EXCA_ADDRWIN_ENABLE, 0); pci_write_config(brdev, CBBR_MEMBASE0, 0, 4); pci_write_config(brdev, CBBR_MEMLIMIT0, 0, 4); pci_write_config(brdev, CBBR_MEMBASE1, 0, 4); @@ -733,7 +732,7 @@ cbb_pci_filt(void *arg) * in one place and a double wakeup would be benign there. */ if (sc->flags & CBB_16BIT_CARD) { - csc = exca_getb(&sc->exca[0], EXCA_CSC); + csc = exca_getb(&sc->exca, EXCA_CSC); if (csc & EXCA_CSC_READY) { atomic_add_int(&sc->powerintr, 1); wakeup((void *)&sc->powerintr); Modified: head/sys/dev/pccbb/pccbbvar.h ============================================================================== --- head/sys/dev/pccbb/pccbbvar.h Mon Dec 16 21:06:24 2019 (r355821) +++ head/sys/dev/pccbb/pccbbvar.h Mon Dec 16 21:34:51 2019 (r355822) @@ -53,11 +53,10 @@ struct cbb_reslist { }; #define CBB_AUTO_OPEN_SMALLHOLE 0x100 -#define CBB_NSLOTS 4 struct cbb_softc { device_t dev; - struct exca_softc exca[CBB_NSLOTS]; + struct exca_softc exca; struct resource *base_res; struct resource *irq_res; void *intrhand; Modified: head/sys/modules/cbb/Makefile ============================================================================== --- head/sys/modules/cbb/Makefile Mon Dec 16 21:06:24 2019 (r355821) +++ head/sys/modules/cbb/Makefile Mon Dec 16 21:34:51 2019 (r355822) @@ -3,8 +3,8 @@ .PATH: ${SRCTOP}/sys/dev/pccbb KMOD= cbb -SRCS= pccbb.c pccbb_isa.c pccbb_pci.c \ - device_if.h bus_if.h power_if.h card_if.h isa_if.h pci_if.h pcib_if.h +SRCS= pccbb.c pccbb_pci.c \ + device_if.h bus_if.h power_if.h card_if.h pci_if.h pcib_if.h .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" CFLAGS += -DNEW_PCIB From owner-svn-src-head@freebsd.org Mon Dec 16 21:34:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AEA021CF4C6; Mon, 16 Dec 2019 21:34:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cF0y4H2Xz4LyB; Mon, 16 Dec 2019 21:34:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E2AE3996; Mon, 16 Dec 2019 21:34:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBGLYwhb096818; Mon, 16 Dec 2019 21:34:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBGLYwhP096816; Mon, 16 Dec 2019 21:34:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912162134.xBGLYwhP096816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 16 Dec 2019 21:34:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355823 - in head/sys/dev: exca pccbb X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/dev: exca pccbb X-SVN-Commit-Revision: 355823 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 21:34:58 -0000 Author: imp Date: Mon Dec 16 21:34:57 2019 New Revision: 355823 URL: https://svnweb.freebsd.org/changeset/base/355823 Log: Add slot number ivar to return which slot number the child is attached to. This will always be 0 for pccbb, but may be non-zero for other kinds of bridges, should they show up in the tree. Make querying it generic. Modified: head/sys/dev/exca/excavar.h head/sys/dev/pccbb/pccbb.c Modified: head/sys/dev/exca/excavar.h ============================================================================== --- head/sys/dev/exca/excavar.h Mon Dec 16 21:34:51 2019 (r355822) +++ head/sys/dev/exca/excavar.h Mon Dec 16 21:34:57 2019 (r355823) @@ -151,4 +151,17 @@ exca_clrb(struct exca_softc *sc, int reg, uint8_t mask exca_putb(sc, reg, exca_getb(sc, reg) & ~mask); } +enum { + EXCA_IVAR_SLOT = 100, +}; + +#define EXCA_ACCESSOR(A, B, T) \ +static inline int \ +exca_get_ ## A(device_t dev, T *t) \ +{ \ + return BUS_READ_IVAR(device_get_parent(dev), dev, \ + EXCA_IVAR_ ## B, (uintptr_t *) t); \ +} + +EXCA_ACCESSOR(slot, SLOT, uint32_t) #endif /* !_SYS_DEV_EXCA_EXCAVAR_H */ Modified: head/sys/dev/pccbb/pccbb.c ============================================================================== --- head/sys/dev/pccbb/pccbb.c Mon Dec 16 21:34:51 2019 (r355822) +++ head/sys/dev/pccbb/pccbb.c Mon Dec 16 21:34:57 2019 (r355823) @@ -1565,6 +1565,9 @@ cbb_read_ivar(device_t brdev, device_t child, int whic case PCIB_IVAR_BUS: *result = sc->bus.sec; return (0); + case EXCA_IVAR_SLOT: + *result = 0; + return (0); } return (ENOENT); } @@ -1577,6 +1580,8 @@ cbb_write_ivar(device_t brdev, device_t child, int whi case PCIB_IVAR_DOMAIN: return (EINVAL); case PCIB_IVAR_BUS: + return (EINVAL); + case EXCA_IVAR_SLOT: return (EINVAL); } return (ENOENT); From owner-svn-src-head@freebsd.org Mon Dec 16 21:35:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B943A1CF50A; Mon, 16 Dec 2019 21:35:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cF134ZNwz4M4m; Mon, 16 Dec 2019 21:35:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 941583997; Mon, 16 Dec 2019 21:35:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBGLZ3cO096892; Mon, 16 Dec 2019 21:35:03 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBGLZ3TN096890; Mon, 16 Dec 2019 21:35:03 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912162135.xBGLZ3TN096890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 16 Dec 2019 21:35:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355824 - in head/sys/dev: exca pccbb X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/dev: exca pccbb X-SVN-Commit-Revision: 355824 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 21:35:03 -0000 Author: imp Date: Mon Dec 16 21:35:02 2019 New Revision: 355824 URL: https://svnweb.freebsd.org/changeset/base/355824 Log: Move attachment of pccard children into exca library. Attach the cardbus and pccard children before the sysctls are added rather than after. Modified: head/sys/dev/exca/exca.c head/sys/dev/pccbb/pccbb_pci.c Modified: head/sys/dev/exca/exca.c ============================================================================== --- head/sys/dev/exca/exca.c Mon Dec 16 21:34:57 2019 (r355823) +++ head/sys/dev/exca/exca.c Mon Dec 16 21:35:02 2019 (r355824) @@ -646,6 +646,11 @@ exca_init(struct exca_softc *sc, device_t dev, sc->flags = 0; sc->getb = exca_mem_getb; sc->putb = exca_mem_putb; + sc->pccarddev = device_add_child(dev, "pccard", -1); + if (sc->pccarddev == NULL) + DEVPRINTF(brdev, "WARNING: cannot add pccard bus.\n"); + else if (device_probe_and_attach(sc->pccarddev) != 0) + DEVPRINTF(brdev, "WARNING: cannot attach pccard bus.\n"); } /* @@ -742,6 +747,8 @@ exca_valid_slot(struct exca_softc *exca) * Intel i82365sl-DF step or maybe a vlsi 82c146 * we detected the vlsi case earlier, so if the controller * isn't set, we know it is a i82365sl step D. + * XXXX Except we didn't -- this is a regression but VLSI + * controllers are super hard to find these days for testing. */ exca->chipset = EXCA_I82365SL_DF; break; Modified: head/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- head/sys/dev/pccbb/pccbb_pci.c Mon Dec 16 21:34:57 2019 (r355823) +++ head/sys/dev/pccbb/pccbb_pci.c Mon Dec 16 21:35:02 2019 (r355824) @@ -317,6 +317,13 @@ cbb_pci_attach(device_t brdev) rman_get_start(sc->base_res))); } + /* attach children */ + sc->cbdev = device_add_child(brdev, "cardbus", -1); + if (sc->cbdev == NULL) + DEVPRINTF((brdev, "WARNING: cannot add cardbus bus.\n")); + else if (device_probe_and_attach(sc->cbdev) != 0) + DEVPRINTF((brdev, "WARNING: cannot attach cardbus bus!\n")); + sc->bst = rman_get_bustag(sc->base_res); sc->bsh = rman_get_bushandle(sc->base_res); exca_init(&sc->exca, brdev, sc->bst, sc->bsh, CBB_EXCA_OFFSET); @@ -372,19 +379,6 @@ cbb_pci_attach(device_t brdev) pci_write_config(brdev, PCIR_SUBBUS_2, sc->bus.sub, 1); } #endif - - /* attach children */ - sc->cbdev = device_add_child(brdev, "cardbus", -1); - if (sc->cbdev == NULL) - DEVPRINTF((brdev, "WARNING: cannot add cardbus bus.\n")); - else if (device_probe_and_attach(sc->cbdev) != 0) - DEVPRINTF((brdev, "WARNING: cannot attach cardbus bus!\n")); - - sc->exca.pccarddev = device_add_child(brdev, "pccard", -1); - if (sc->exca.pccarddev == NULL) - DEVPRINTF((brdev, "WARNING: cannot add pccard bus.\n")); - else if (device_probe_and_attach(sc->exca.pccarddev) != 0) - DEVPRINTF((brdev, "WARNING: cannot attach pccard bus.\n")); /* Map and establish the interrupt. */ rid = 0; From owner-svn-src-head@freebsd.org Mon Dec 16 21:52:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D9291CFA29; Mon, 16 Dec 2019 21:52:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cFNs3lTXz4N4X; Mon, 16 Dec 2019 21:52:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BDA13DB8; Mon, 16 Dec 2019 21:52:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBGLqDXq005989; Mon, 16 Dec 2019 21:52:13 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBGLqDqn005987; Mon, 16 Dec 2019 21:52:13 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912162152.xBGLqDqn005987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 16 Dec 2019 21:52:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355825 - in head/stand/i386: common libi386 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand/i386: common libi386 X-SVN-Commit-Revision: 355825 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 21:52:13 -0000 Author: imp Date: Mon Dec 16 21:52:12 2019 New Revision: 355825 URL: https://svnweb.freebsd.org/changeset/base/355825 Log: Use symbolic names for int13 calls For all the INT13 calls, use symbolic names instead of magic numbers. This makes it easier to understand what the code is doing w/o a trip to google to find what these numbers mean. Modified: head/stand/i386/common/edd.h head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/common/edd.h ============================================================================== --- head/stand/i386/common/edd.h Mon Dec 16 21:35:02 2019 (r355824) +++ head/stand/i386/common/edd.h Mon Dec 16 21:52:12 2019 (r355825) @@ -107,4 +107,7 @@ struct edd_params_v4 { #define EDD_DEVICE_PATH_KEY 0xbedd +#define EDD_QUERY_MAGIC 0x55aa +#define EDD_INSTALLED 0xaa55 + #endif /* !_EDD_H_ */ Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Mon Dec 16 21:35:02 2019 (r355824) +++ head/stand/i386/libi386/biosdisk.c Mon Dec 16 21:52:12 2019 (r355825) @@ -64,6 +64,22 @@ __FBSDID("$FreeBSD$"); #define ACDMAJOR 117 #define CDMAJOR 15 +/* + * INT13 commands + */ +#define CMD_RESET 0x0000 +#define CMD_READ_CHS 0x0200 +#define CMD_WRITE_CHS 0x0300 +#define CMD_READ_PARAM 0x0800 +#define CMD_DRIVE_TYPE 0x1500 +#define CMD_CHECK_EDD 0x4100 +#define CMD_READ_LBA 0x4200 +#define CMD_WRITE_LBA 0x4300 +#define CMD_EXT_PARAM 0x4800 +#define CMD_CD_GET_STATUS 0x4b01 + +#define DISK_BIOS 0x13 + #ifdef DISK_DEBUG #define DPRINTF(fmt, args...) printf("%s: " fmt "\n", __func__, ## args) #else @@ -265,8 +281,8 @@ fd_count(void) bd_reset_disk(drive); v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0x1500; + v86.addr = DISK_BIOS; + v86.eax = CMD_DRIVE_TYPE; v86.edx = drive; v86int(); @@ -367,8 +383,8 @@ bc_add(int biosdev) return (-1); v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0x4b01; + v86.addr = DISK_BIOS; + v86.eax = CMD_CD_GET_STATUS; v86.edx = biosdev; v86.ds = VTOPSEG(&bc_sp); v86.esi = VTOPOFF(&bc_sp); @@ -422,14 +438,14 @@ bd_check_extensions(int unit) /* Determine if we can use EDD with this device. */ v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0x4100; + v86.addr = DISK_BIOS; + v86.eax = CMD_CHECK_EDD; v86.edx = unit; - v86.ebx = 0x55aa; + v86.ebx = EDD_QUERY_MAGIC; v86int(); if (V86_CY(v86.efl) || /* carry set */ - (v86.ebx & 0xffff) != 0xaa55) /* signature */ + (v86.ebx & 0xffff) != EDD_INSTALLED) /* signature */ return (0); /* extended disk access functions (AH=42h-44h,47h,48h) supported */ @@ -444,8 +460,8 @@ bd_reset_disk(int unit) { /* reset disk */ v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0; + v86.addr = DISK_BIOS; + v86.eax = CMD_RESET; v86.edx = unit; v86int(); } @@ -458,8 +474,8 @@ bd_get_diskinfo_std(struct bdinfo *bd) { bzero(&v86, sizeof(v86)); v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0x800; + v86.addr = DISK_BIOS; + v86.eax = CMD_READ_PARAM; v86.edx = bd->bd_unit; v86int(); @@ -493,8 +509,8 @@ bd_get_diskinfo_ext(struct bdinfo *bd) bzero(¶ms, sizeof(params)); params.len = sizeof(params); v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0x4800; + v86.addr = DISK_BIOS; + v86.eax = CMD_EXT_PARAM; v86.edx = bd->bd_unit; v86.ds = VTOPSEG(¶ms); v86.esi = VTOPOFF(¶ms); @@ -560,8 +576,8 @@ bd_int13probe(bdinfo_t *bd) /* Get disk type */ v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0x1500; + v86.addr = DISK_BIOS; + v86.eax = CMD_DRIVE_TYPE; v86.edx = bd->bd_unit; v86int(); if (V86_CY(v86.efl) || (v86.eax & 0x300) == 0) @@ -1076,12 +1092,11 @@ bd_edd_io(bdinfo_t *bd, daddr_t dblk, int blks, caddr_ packet.seg = VTOPSEG(dest); packet.lba = dblk; v86.ctl = V86_FLAGS; - v86.addr = 0x13; - /* Should we Write with verify ?? 0x4302 ? */ + v86.addr = DISK_BIOS; if (dowrite == BD_WR) - v86.eax = 0x4300; + v86.eax = CMD_WRITE_LBA; /* maybe Write with verify 0x4302? */ else - v86.eax = 0x4200; + v86.eax = CMD_READ_LBA; v86.edx = bd->bd_unit; v86.ds = VTOPSEG(&packet); v86.esi = VTOPOFF(&packet); @@ -1113,11 +1128,11 @@ bd_chs_io(bdinfo_t *bd, daddr_t dblk, int blks, caddr_ } v86.ctl = V86_FLAGS; - v86.addr = 0x13; + v86.addr = DISK_BIOS; if (dowrite == BD_WR) - v86.eax = 0x300 | blks; + v86.eax = CMD_WRITE_CHS | blks; else - v86.eax = 0x200 | blks; + v86.eax = CMD_READ_CHS | blks; v86.ecx = ((cyl & 0xff) << 8) | ((cyl & 0x300) >> 2) | sec; v86.edx = (hd << 8) | bd->bd_unit; v86.es = VTOPSEG(dest); @@ -1222,8 +1237,8 @@ bd_getbigeom(int bunit) { v86.ctl = V86_FLAGS; - v86.addr = 0x13; - v86.eax = 0x800; + v86.addr = DISK_BIOS; + v86.eax = CMD_READ_PARAM; v86.edx = 0x80 + bunit; v86int(); if (V86_CY(v86.efl)) From owner-svn-src-head@freebsd.org Mon Dec 16 22:05:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 313861CFDBB; Mon, 16 Dec 2019 22:05:05 +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 47cFgj10b0z4NWZ; Mon, 16 Dec 2019 22:05:05 +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 1929A3F9F; Mon, 16 Dec 2019 22:05:05 +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 xBGM55mr014651; Mon, 16 Dec 2019 22:05:05 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBGM534s014645; Mon, 16 Dec 2019 22:05:03 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201912162205.xBGM534s014645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Mon, 16 Dec 2019 22:05:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355826 - head/lib/libxo head/lib/libxo/encoder/csv head/lib/libxo/libxo head/lib/libxo/tests head/lib/libxo/tests/encoder head/usr.bin/xo vendor/Juniper/libxo X-SVN-Group: head X-SVN-Commit-Author: phil X-SVN-Commit-Paths: head/lib/libxo head/lib/libxo/encoder/csv head/lib/libxo/libxo head/lib/libxo/tests head/lib/libxo/tests/encoder head/usr.bin/xo vendor/Juniper/libxo X-SVN-Commit-Revision: 355826 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 22:05:05 -0000 Author: phil Date: Mon Dec 16 22:05:03 2019 New Revision: 355826 URL: https://svnweb.freebsd.org/changeset/base/355826 Log: Allow proper builds of libxo's CSV encoder: - Move libxo.a build to subdirectory (lib/libxo/libxo/Makefile) - Add .WAIT target to delay encoder build til after libxo - Use FILES to install encoder library as csv.enc - Update import script to put xo_config.h in new location Added: head/lib/libxo/libxo/ head/lib/libxo/libxo/Makefile (contents, props changed) head/lib/libxo/libxo/xo_config.h - copied unchanged from r355672, head/lib/libxo/xo_config.h Deleted: head/lib/libxo/xo_config.h Modified: head/lib/libxo/Makefile head/lib/libxo/encoder/csv/Makefile head/lib/libxo/tests/Makefile head/lib/libxo/tests/encoder/Makefile head/usr.bin/xo/Makefile Changes in other areas also in this revision: Modified: vendor/Juniper/libxo/.svnignore vendor/Juniper/libxo/import.sh Directory Properties: vendor/Juniper/libxo/ (props changed) Modified: head/lib/libxo/Makefile ============================================================================== --- head/lib/libxo/Makefile Mon Dec 16 21:52:12 2019 (r355825) +++ head/lib/libxo/Makefile Mon Dec 16 22:05:03 2019 (r355826) @@ -1,119 +1,10 @@ # $FreeBSD$ -SHLIBDIR?= /lib - .include -PACKAGE= runtime - -LIBXOSRC= ${SRCTOP}/contrib/libxo - -.PATH: ${LIBXOSRC}/libxo - -LIB= xo -SHLIB_MAJOR=0 - -SRCS= libxo.c xo_encoder.c xo_syslog.c - -CFLAGS+=-I${LIBXOSRC}/libxo -I${.CURDIR} -CFLAGS+=-DXO_ENCODERDIR=\"/usr/lib/libxo/encoder\" - -INCS= xo.h xo_encoder.h -INCSDIR=${INCLUDEDIR}/libxo - -LIBADD= util - -WARNS?= 5 - -MAN+= libxo.3 -MAN+= xo_attr.3 \ - xo_create.3 \ - xo_emit.3 \ - xo_emit_err.3 \ - xo_err.3 \ - xo_error.3 \ - xo_finish.3 \ - xo_flush.3 \ - xo_message.3 \ - xo_no_setlocale.3 \ - xo_open_container.3 \ - xo_open_list.3 \ - xo_open_marker.3 \ - xo_parse_args.3 \ - xo_set_allocator.3 \ - xo_set_flags.3 \ - xo_set_info.3 \ - xo_set_options.3 \ - xo_set_style.3 \ - xo_set_syslog_enterprise_id.3 \ - xo_set_version.3 \ - xo_set_writer.3 \ - xo_syslog.3 - -MAN+= xo_format.5 - -MAN+= xo_options.7 - -MLINKS= xo_attr.3 xo_attr_h.3 \ - xo_attr.3 xo_attr_hv.3 \ - xo_create.3 xo_create_to_file.3 \ - xo_create.3 xo_destroy.3 \ - xo_emit.3 xo_emit_h.3 \ - xo_emit.3 xo_emit_hv.3 \ - xo_emit_err.3 xo_emit_errc.3 \ - xo_emit_err.3 xo_emit_errx.3 \ - xo_emit_err.3 xo_emit_warn.3 \ - xo_emit_err.3 xo_emit_warnx.3 \ - xo_emit_err.3 xo_emit_warn_c.3 \ - xo_emit_err.3 xo_emit_warn_hc.3 \ - xo_err.3 xo_errc.3 \ - xo_err.3 xo_errx.3 \ - xo_err.3 xo_warn.3 \ - xo_err.3 xo_warnx.3 \ - xo_err.3 xo_warn_c.3 \ - xo_err.3 xo_warn_hc.3 \ - xo_finish.3 xo_finish_h.3 \ - xo_flush.3 xo_flush_h.3 \ - xo_message.3 xo_message_c.3 \ - xo_message.3 xo_message_hc.3 \ - xo_message.3 xo_message_hcv.3 \ - xo_open_container.3 xo_open_container_h.3 \ - xo_open_container.3 xo_open_container_hd.3 \ - xo_open_container.3 xo_open_container_d.3 \ - xo_open_container.3 xo_close_container.3 \ - xo_open_container.3 xo_close_container_h.3 \ - xo_open_container.3 xo_close_container_hd.3 \ - xo_open_container.3 xo_close_container_d.3 \ - xo_open_list.3 xo_open_list_h.3 \ - xo_open_list.3 xo_open_list_hd.3 \ - xo_open_list.3 xo_open_list_d.3 \ - xo_open_list.3 xo_open_instance.3 \ - xo_open_list.3 xo_open_instance_h.3 \ - xo_open_list.3 xo_open_instance_hd.3 \ - xo_open_list.3 xo_open_instance_d.3 \ - xo_open_list.3 xo_close_instance.3 \ - xo_open_list.3 xo_close_instance_h.3 \ - xo_open_list.3 xo_close_instance_hd.3 \ - xo_open_list.3 xo_close_instance_d.3 \ - xo_open_list.3 xo_close_list.3 \ - xo_open_list.3 xo_close_list_h.3 \ - xo_open_list.3 xo_close_list_hd.3 \ - xo_open_list.3 xo_close_list_d.3 \ - xo_open_marker.3 xo_open_marker_h.3 \ - xo_open_marker.3 xo_close_marker.3 \ - xo_open_marker.3 xo_close_marker_h.3 \ - xo_parse_args.3 xo_set_program.3 \ - xo_set_flags.3 xo_clear_flags.3 \ - xo_set_style.3 xo_set_style_name.3 \ - xo_set_version.3 xo_set_version_h.3 \ - xo_syslog.3 xo_close_log.3 \ - xo_syslog.3 xo_open_log.3 \ - xo_syslog.3 xo_set_logmask.3 \ - xo_syslog.3 xo_vsyslog.3 - HAS_TESTS= SUBDIR.${MK_TESTS}+= tests -#SUBDIR = encoder +SUBDIR = libxo .WAIT encoder -.include +.include Modified: head/lib/libxo/encoder/csv/Makefile ============================================================================== --- head/lib/libxo/encoder/csv/Makefile Mon Dec 16 21:52:12 2019 (r355825) +++ head/lib/libxo/encoder/csv/Makefile Mon Dec 16 22:05:03 2019 (r355826) @@ -1,9 +1,5 @@ # $FreeBSD$ -LIBXODIR= ${STAGEDIR}${PREFIX}/usr/lib/libxo/encoder -SHLIBDIR?= ${LIBXODIR} -LIBDIR?= ${LIBXODIR} - .include PACKAGE= runtime @@ -12,8 +8,16 @@ LIBXOSRC= ${SRCTOP}/contrib/libxo .PATH: ${LIBXOSRC}/encoder/csv +# We use FILES to install the encoder library under the proper/magic +# name, in the proper/magic directory. libxo looks for encoders from +# "--libxo encoder=name" as "${prefix}/lib/libxo/encoder/${name}.enc" +FILES = libenc_csv.so +FILESNAME_libenc_csv.so= csv.enc +FILESDIR = /usr/lib/libxo/encoder + LIB= enc_csv SHLIB_MAJOR=0 +SHLIB_NAME= lib${LIB}.so SRCS= enc_csv.c @@ -21,10 +25,13 @@ CFLAGS+=-I${LIBXOSRC}/libxo -I${.CURDIR} CFLAGS+=-DXO_ENCODERDIR=\"/usr/lib/libxo/encoder\" LIBADD= util xo -LDFLAGS += -L${.OBJDIR}/../../wildebeast +LDFLAGS += -L${.OBJDIR:H:H}/libxo WARNS?= 5 -SYMLINKS+= ${SHLIB_NAME} ${LIBXODIR}/csv.enc +# Need to define a fake "install" target to block the one in bsd.lib.mk, +# since that one will install our lib in the wrong place (/usr/lib/). +install: realinstall .include +.include Added: head/lib/libxo/libxo/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libxo/libxo/Makefile Mon Dec 16 22:05:03 2019 (r355826) @@ -0,0 +1,114 @@ +# $FreeBSD$ + +SHLIBDIR?= /lib + +.include + +PACKAGE= runtime + +LIBXOSRC= ${SRCTOP}/contrib/libxo + +.PATH: ${LIBXOSRC}/libxo + +LIB= xo +SHLIB_MAJOR=0 + +SRCS= libxo.c xo_encoder.c xo_syslog.c + +CFLAGS+=-I${LIBXOSRC}/libxo -I${.CURDIR} +CFLAGS+=-DXO_ENCODERDIR=\"/usr/lib/libxo/encoder\" + +INCS= xo.h xo_encoder.h +INCSDIR=${INCLUDEDIR}/libxo + +LIBADD= util + +WARNS?= 5 + +MAN+= libxo.3 +MAN+= xo_attr.3 \ + xo_create.3 \ + xo_emit.3 \ + xo_emit_err.3 \ + xo_err.3 \ + xo_error.3 \ + xo_finish.3 \ + xo_flush.3 \ + xo_message.3 \ + xo_no_setlocale.3 \ + xo_open_container.3 \ + xo_open_list.3 \ + xo_open_marker.3 \ + xo_parse_args.3 \ + xo_set_allocator.3 \ + xo_set_flags.3 \ + xo_set_info.3 \ + xo_set_options.3 \ + xo_set_style.3 \ + xo_set_syslog_enterprise_id.3 \ + xo_set_version.3 \ + xo_set_writer.3 \ + xo_syslog.3 + +MAN+= xo_format.5 + +MAN+= xo_options.7 + +MLINKS= xo_attr.3 xo_attr_h.3 \ + xo_attr.3 xo_attr_hv.3 \ + xo_create.3 xo_create_to_file.3 \ + xo_create.3 xo_destroy.3 \ + xo_emit.3 xo_emit_h.3 \ + xo_emit.3 xo_emit_hv.3 \ + xo_emit_err.3 xo_emit_errc.3 \ + xo_emit_err.3 xo_emit_errx.3 \ + xo_emit_err.3 xo_emit_warn.3 \ + xo_emit_err.3 xo_emit_warnx.3 \ + xo_emit_err.3 xo_emit_warn_c.3 \ + xo_emit_err.3 xo_emit_warn_hc.3 \ + xo_err.3 xo_errc.3 \ + xo_err.3 xo_errx.3 \ + xo_err.3 xo_warn.3 \ + xo_err.3 xo_warnx.3 \ + xo_err.3 xo_warn_c.3 \ + xo_err.3 xo_warn_hc.3 \ + xo_finish.3 xo_finish_h.3 \ + xo_flush.3 xo_flush_h.3 \ + xo_message.3 xo_message_c.3 \ + xo_message.3 xo_message_hc.3 \ + xo_message.3 xo_message_hcv.3 \ + xo_open_container.3 xo_open_container_h.3 \ + xo_open_container.3 xo_open_container_hd.3 \ + xo_open_container.3 xo_open_container_d.3 \ + xo_open_container.3 xo_close_container.3 \ + xo_open_container.3 xo_close_container_h.3 \ + xo_open_container.3 xo_close_container_hd.3 \ + xo_open_container.3 xo_close_container_d.3 \ + xo_open_list.3 xo_open_list_h.3 \ + xo_open_list.3 xo_open_list_hd.3 \ + xo_open_list.3 xo_open_list_d.3 \ + xo_open_list.3 xo_open_instance.3 \ + xo_open_list.3 xo_open_instance_h.3 \ + xo_open_list.3 xo_open_instance_hd.3 \ + xo_open_list.3 xo_open_instance_d.3 \ + xo_open_list.3 xo_close_instance.3 \ + xo_open_list.3 xo_close_instance_h.3 \ + xo_open_list.3 xo_close_instance_hd.3 \ + xo_open_list.3 xo_close_instance_d.3 \ + xo_open_list.3 xo_close_list.3 \ + xo_open_list.3 xo_close_list_h.3 \ + xo_open_list.3 xo_close_list_hd.3 \ + xo_open_list.3 xo_close_list_d.3 \ + xo_open_marker.3 xo_open_marker_h.3 \ + xo_open_marker.3 xo_close_marker.3 \ + xo_open_marker.3 xo_close_marker_h.3 \ + xo_parse_args.3 xo_set_program.3 \ + xo_set_flags.3 xo_clear_flags.3 \ + xo_set_style.3 xo_set_style_name.3 \ + xo_set_version.3 xo_set_version_h.3 \ + xo_syslog.3 xo_close_log.3 \ + xo_syslog.3 xo_open_log.3 \ + xo_syslog.3 xo_set_logmask.3 \ + xo_syslog.3 xo_vsyslog.3 + +.include Copied: head/lib/libxo/libxo/xo_config.h (from r355672, head/lib/libxo/xo_config.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libxo/libxo/xo_config.h Mon Dec 16 22:05:03 2019 (r355826, copy of r355672, head/lib/libxo/xo_config.h) @@ -0,0 +1,257 @@ +/* $FreeBSD$ */ +/* libxo/xo_config.h. Generated from xo_config.h.in by configure. */ +/* libxo/xo_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +/* #undef CRAY_STACKSEG_END */ + +/* Define to 1 if using `alloca.c'. */ +/* #undef C_ALLOCA */ + +/* Define to 1 if you have `alloca', as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +/* #undef HAVE_ALLOCA_H */ + +/* Define to 1 if you have the `asprintf' function. */ +#define HAVE_ASPRINTF 1 + +/* Define to 1 if you have the `bzero' function. */ +#define HAVE_BZERO 1 + +/* Define to 1 if you have the `ctime' function. */ +#define HAVE_CTIME 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_CTYPE_H 1 + +/* Define to 1 if you have the declaration of `__isthreaded', and to 0 if you + don't. */ +#define HAVE_DECL___ISTHREADED 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the `dlfunc' function. */ +#define HAVE_DLFUNC 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ERRNO_H 1 + +/* Define to 1 if you have the `fdopen' function. */ +#define HAVE_FDOPEN 1 + +/* Define to 1 if you have the `flock' function. */ +#define HAVE_FLOCK 1 + +/* Define to 1 if you have the `getpass' function. */ +#define HAVE_GETPASS 1 + +/* Define to 1 if you have the `getprogname' function. */ +#define HAVE_GETPROGNAME 1 + +/* Define to 1 if you have the `getrusage' function. */ +#define HAVE_GETRUSAGE 1 + +/* gettext(3) */ +/* #undef HAVE_GETTEXT */ + +/* Define to 1 if you have the `gettimeofday' function. */ +#define HAVE_GETTIMEOFDAY 1 + +/* humanize_number(3) */ +#define HAVE_HUMANIZE_NUMBER 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `crypto' library (-lcrypto). */ +#define HAVE_LIBCRYPTO 1 + +/* Define to 1 if you have the `m' library (-lm). */ +#define HAVE_LIBM 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIBUTIL_H 1 + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#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. */ +/* #undef HAVE_MONITOR_H */ + +/* Support printflike */ +/* #undef HAVE_PRINTFLIKE */ + +/* Define to 1 if your system has a GNU libc compatible `realloc' function, + and to 0 otherwise. */ +#define HAVE_REALLOC 1 + +/* Define to 1 if you have the `srand' function. */ +#define HAVE_SRAND 1 + +/* Define to 1 if you have the `sranddev' function. */ +#define HAVE_SRANDDEV 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STDIO_EXT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STDTIME_TZFILE_H */ + +/* Define to 1 if you have the `strchr' function. */ +#define HAVE_STRCHR 1 + +/* Define to 1 if you have the `strcspn' function. */ +#define HAVE_STRCSPN 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 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 `strlcpy' function. */ +#define HAVE_STRLCPY 1 + +/* Define to 1 if you have the `strspn' function. */ +#define HAVE_STRSPN 1 + +/* Have struct sockaddr_un.sun_len */ +#define HAVE_SUN_LEN 1 + +/* Define to 1 if you have the `sysctlbyname' function. */ +#define HAVE_SYSCTLBYNAME 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_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SYSCTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* 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_THREADS_H 1 + +/* thread-local setting */ +#define HAVE_THREAD_LOCAL THREAD_LOCAL_before + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_TZFILE_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `__flbf' function. */ +/* #undef HAVE___FLBF */ + +/* Enable debugging */ +/* #undef LIBXO_DEBUG */ + +/* Enable text-only rendering */ +/* #undef LIBXO_TEXT_ONLY */ + +/* Version number as dotted value */ +#define LIBXO_VERSION "1.3.1" + +/* Version number extra information */ +#define LIBXO_VERSION_EXTRA "" + +/* Version number as a number */ +#define LIBXO_VERSION_NUMBER 1003001 + +/* Version number as string */ +#define LIBXO_VERSION_STRING "1003001" + +/* Enable local wcwidth implementation */ +#define LIBXO_WCWIDTH 1 + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libxo" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "phil@juniper.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libxo" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libxo 1.3.1" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libxo" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.3.1" + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +/* #undef STACK_DIRECTION */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Use int return codes */ +/* #undef USE_INT_RETURN_CODES */ + +/* Version number of package */ +#define VERSION "1.3.1" + +/* Retain hash bucket size */ +/* #undef XO_RETAIN_SIZE */ + +/* 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 rpl_malloc if the replacement function should be used. */ +/* #undef malloc */ + +/* Define to rpl_realloc if the replacement function should be used. */ +/* #undef realloc */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ Modified: head/lib/libxo/tests/Makefile ============================================================================== --- head/lib/libxo/tests/Makefile Mon Dec 16 21:52:12 2019 (r355825) +++ head/lib/libxo/tests/Makefile Mon Dec 16 22:05:03 2019 (r355826) @@ -240,7 +240,7 @@ PROGS+= test_09 PROGS+= test_10 PROGS+= test_11 -CFLAGS+= -I${LIBXOSRC}/libxo -I${.CURDIR:H} +CFLAGS+= -I${LIBXOSRC}/libxo -I${.CURDIR:H}/libxo LIBADD= xo util Modified: head/lib/libxo/tests/encoder/Makefile ============================================================================== --- head/lib/libxo/tests/encoder/Makefile Mon Dec 16 21:52:12 2019 (r355825) +++ head/lib/libxo/tests/encoder/Makefile Mon Dec 16 22:05:03 2019 (r355826) @@ -12,7 +12,7 @@ SYMLINKS+= ${LIBDIR}/${SHLIB_NAME} /usr/lib/libxo/enco SRCS= enc_test.c -CFLAGS+= -I${LIBXOSRC}/libxo +CFLAGS+= -I${LIBXOSRC}/libxo -I${.CURDIR:H:H}/libxo LIBADD= xo Modified: head/usr.bin/xo/Makefile ============================================================================== --- head/usr.bin/xo/Makefile Mon Dec 16 21:52:12 2019 (r355825) +++ head/usr.bin/xo/Makefile Mon Dec 16 22:05:03 2019 (r355826) @@ -14,7 +14,7 @@ MAN= xo.1 CFLAGS+=-I${LIBXOSRC}/libxo # XXX For xo_config.h -CFLAGS+=-I${SRCTOP}/lib/libxo +CFLAGS+=-I${SRCTOP}/lib/libxo/libxo LIBADD= xo util From owner-svn-src-head@freebsd.org Mon Dec 16 23:08:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F38331D0DE7; Mon, 16 Dec 2019 23:08:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cH4T5vkWz4R46; Mon, 16 Dec 2019 23:08:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0FAE4A9A; Mon, 16 Dec 2019 23:08:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBGN89sx049754; Mon, 16 Dec 2019 23:08:09 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBGN89jg049753; Mon, 16 Dec 2019 23:08:09 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912162308.xBGN89jg049753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 16 Dec 2019 23:08:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355827 - head/sys/dev/pccbb X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/pccbb X-SVN-Commit-Revision: 355827 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 23:08:10 -0000 Author: imp Date: Mon Dec 16 23:08:09 2019 New Revision: 355827 URL: https://svnweb.freebsd.org/changeset/base/355827 Log: Add back accidentally dropped masking... - PCI_MASK_CONFIG(sc->dev, CBBR_BRIDGECTRL, - & ~CBBM_BRIDGECTRL_INTR_IREQ_ISA_EN, 2); was accidentally dropped from r355822 in the refactor. Restore it since 16-bit cards may fail without it (some bridges autodetect this properly, so my laptop worked when I tested it). Noticed by: rpokala@ Modified: head/sys/dev/pccbb/pccbb.c Modified: head/sys/dev/pccbb/pccbb.c ============================================================================== --- head/sys/dev/pccbb/pccbb.c Mon Dec 16 22:05:03 2019 (r355826) +++ head/sys/dev/pccbb/pccbb.c Mon Dec 16 23:08:09 2019 (r355827) @@ -59,9 +59,6 @@ /* * Driver for PCI to CardBus Bridge chips - * and PCI to PCMCIA Bridge chips - * and ISA to PCMCIA host adapters - * and C Bus to PCMCIA host adapters * * References: * TI Datasheets: @@ -273,6 +270,8 @@ cbb_enable_func_intr(struct cbb_softc *sc) reg = (exca_getb(&sc->exca, EXCA_INTR) & ~EXCA_INTR_IRQ_MASK) | EXCA_INTR_IRQ_NONE; + PCI_MASK_CONFIG(sc->dev, CBBR_BRIDGECTRL, + & ~CBBM_BRIDGECTRL_INTR_IREQ_ISA_EN, 2); exca_putb(&sc->exca, EXCA_INTR, reg); } From owner-svn-src-head@freebsd.org Mon Dec 16 23:10:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E5511D0F7C for ; Mon, 16 Dec 2019 23:10:16 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic314-20.consmr.mail.gq1.yahoo.com (sonic314-20.consmr.mail.gq1.yahoo.com [98.137.69.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47cH6v0hTpz4RLj for ; Mon, 16 Dec 2019 23:10:14 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: wf9PNyQVM1lL4.niL62cFzyfSC_jqZQflmD5knPDIVmjBYIxkkC3ydMgxtIMODS yfymBEnvzzPoJz7F0UNcP8dfrc_x__FJIGxdTbCPI2OlVqtXGQGrYjP4lN1SW416SHptlgpswHg. dJ_9LXlYjY3VOo8Qk6mNAWvgux_GbPoHeY7ab2vtDUl1f2C76I.34rgOWhQpp9jWy3ZCzf4DB8fU ENnuGvSyOkPwdQZRgYV5OEBR3vT3lPrLAe3nhK9ERxi3g2P6O6qyDNH6sn8VU1R859aX9vs4u2fR 0l8vV1b673ltnpc8g5gEG9Ppe5CsjaaSisRUUuLlpWqskpEiH_1.gsMk2Unh9dWWdHnKufEQP8rF SHN9QLqYBilja2I6Hv_Zzr2LhwxQjdd9pRsEY2h3djT1AVOnigKsh2mcW9B4hs4Zy_D0rhJsTIAC yf4td8owbsHkhw5Y5TER0W3IzmRYjZJWyCiIjq_YrYqIY91ag35g4nKC_NVoniRgf.fWxE5cKeWT nWTE5TzSosNhBhIqAerSse3PxOz4rDS2DhucLzMdJ6cVoQXWv7rJxKGou2.MhMeFAiHdpuAmWuTv 4bboiQkR5WAJ_.hAJwrOI66Gk.K6JzIJ0iutAnYpbHylpBUsyjGlXH_5_1PtgjJY9N801TPVCeaW yLmayu1OBNQEh0ICJ04U6eYFkpNHKW24mEiYbgEW4yhzYiXX4_PvPHWDC_mH1iJDPobafoEZ9jtM YFmoNRG0ikp739EE0CwKppr1bgnzxveQCn7Fo1Sg4LA1WzYG7yaBDM1EWLXIZQtlOPi1MKJe9FV2 iheKs5M5ZyBiqTxzKND1rKOD8P37jsXots9YUx8xEJEpcPFUSW.wNrcGvJrCZrmf41uyIJScApfG Zy7481hwFZcKNxfYh_dCBtG9tHAsEoBidHjSgefaK39b1PFKh2K3RpouP3STs4bn8VZuORiuu83s G37uqnzU6tTpP4oMJu64ZoH2csnjUMCY94Q.vsk9FXeMVDkfKXNcvIsJuFqg0zEMcewRT63edKDp xd3mKdwgxy.i6dM7iKhdP_qKC9399lAwyW6GFj_K80nqJam8Ivksr8hNwEnPo7YPReYb6K8yuyKV dn291qUps.pexwbSLc7Bo10ysm4R.yNXDQaFuSCDVRy5QhWmHKZz4AbXFo_zk32E1dCc2YGKIeKI dPdl6lHVQ6SrZI80Imhn8iN0WR1w2wsgsRO2LOs93NqoDU6dVEQ696DcVJILzfWfLdJS0vD05YBp hRmREjTlhKA07F7Ba9gstBlHX59k07WJCzzu7EYzk3OXSBEnHBLkwU1B_ticeNl5M1LSArgxXKhX Z1dKdoeBq1LxqScqCQ0IcN7o9m3H9rLj_jVQvKv.hOKmr3fAXMP13u4wSMYZepbqtj9y.g8Txw2J tLnnNIvODZT1N8ZmMKRbfw79Shi_aa1vALD4- Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.gq1.yahoo.com with HTTP; Mon, 16 Dec 2019 23:10:12 +0000 Received: by smtp429.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID ff788fb7ab3f2c847bde8afa754ea791; Mon, 16 Dec 2019 23:10:06 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Subject: Re: svn commit: r355819 - in head/sys: arm/arm arm64/arm64 i386/i386 mips/mips powerpc/powerpc riscv/riscv Message-Id: <3C939E47-40DB-484D-9948-A88378051682@yahoo.com> Date: Mon, 16 Dec 2019 15:10:04 -0800 To: "jeff@freebsd.org " , svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3608.40.2.2.4) References: <3C939E47-40DB-484D-9948-A88378051682.ref@yahoo.com> X-Rspamd-Queue-Id: 47cH6v0hTpz4RLj X-Spamd-Bar: - X-Spamd-Result: default: False [-1.65 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; NEURAL_HAM_MEDIUM(-0.71)[-0.706,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; FREEMAIL_FROM(0.00)[yahoo.com]; MIME_GOOD(-0.10)[text/plain]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-0.44)[-0.440,0]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[83.69.137.98.list.dnswl.org : 127.0.5.0]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.00)[ip: (5.74), ipnet: 98.137.64.0/21(0.89), asn: 36647(0.71), country: US(-0.05)]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 23:10:16 -0000 > Author: jeff > Date: Mon Dec 16 20:15:04 2019 > New Revision: 355819 > URL:=20 > https://svnweb.freebsd.org/changeset/base/355819 >=20 >=20 > Log: > 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. > =20 > Reported by: emaste > Suggested by: rlibby > Discussed with: jhb, rlibby > Tested by: manu (arm64) >=20 > Modified: > head/sys/arm/arm/machdep.c > head/sys/arm64/arm64/machdep.c > head/sys/i386/i386/machdep.c > head/sys/mips/mips/machdep.c > head/sys/powerpc/powerpc/machdep.c > head/sys/riscv/riscv/machdep.c It looks like sparc64 still has the old code structure: =46rom /usr/src/sys/sparc64/sparc64/machdep.c . . . void spinlock_enter(void) { struct thread *td; register_t pil; td =3D curthread; if (td->td_md.md_spinlock_count =3D=3D 0) { pil =3D rdpr(pil); wrpr(pil, 0, PIL_TICK); td->td_md.md_spinlock_count =3D 1; td->td_md.md_saved_pil =3D pil; } else td->td_md.md_spinlock_count++; critical_enter(); } void spinlock_exit(void) { struct thread *td; register_t pil; td =3D curthread; critical_exit(); pil =3D td->td_md.md_saved_pil; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count =3D=3D 0) wrpr(pil, pil, 0); } (Not that I ever do anything with sparc64 machines.) =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Mon Dec 16 23:13:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C14B1D12C3 for ; Mon, 16 Dec 2019 23:13:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (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 47cHC90ZJ2z4Rm3 for ; Mon, 16 Dec 2019 23:13:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82b.google.com with SMTP id q20so2547870qtp.3 for ; Mon, 16 Dec 2019 15:13:56 -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=rXrLNQx87ar5r1tGl2VUgQJtR4M3pOtl8//fWeoAH5s=; b=juRQgxgtwyiu1/WLDHIa8TOer7u5VBPM/W3x/2psSC/S+sn+cvvWdg3IoDCdZxtKY7 5FAqyrAb0TIVDgTq83xzywYfTl76a8lE1ZhlLzA/vCPf+MHiApj4kyJm6deec/B5CWSR P6mJPkQnmt8FT5r57kda1dfPUwtRJtHs02dUWkXWB48QImUSHdWxzWJPohVMFJeofLUJ I83iZHMHtribTEnXFU7kISvjaLOwQut36v/k0kU/trmRs0Ka8vWaS5WfOXQUPdeTZl8N afKvklPjDtr5pBrHaTXMgrNN/HpKl6X50pmy1VR66BbbaLyFMd8hl03ltz+jrnEesWo7 EmJQ== 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=rXrLNQx87ar5r1tGl2VUgQJtR4M3pOtl8//fWeoAH5s=; b=hQ0rvgIzeVxC1Gd/odLThnAwMoSAe//3CLSNDA/l3bYd8pR6zs542Arai9oo98L6nn JjsySoO0uH67h0ncGSciaoJ12QLW9iwVlYjXRO8toqH4cUhF4/I/O2K7WbYEPMLQ6N2v rDsLxA8HJ2tip3n9A1PR2NtXqLf2MD0EDUktuHUiopl4JhDOntgXQcCwZh7IIkJbmTM/ e/3o+uUzQaCXL7A7S/l7792dyzxQuZQaXxyiZ6KTQot7AzGvRp77aNRS74fquIDdgU9W Q8BHhDtlSc1CwKwYU8P5fGl1/0Dhz9PU7w8zl6j4WnSGE5/WDx22wx8HEnZzt86Cgckz 1ZcQ== X-Gm-Message-State: APjAAAVNIh4llUgtEbtusthzjg/nzfspmFsUZFboVhN9FjSgIkJkNGIg JBYn5ElcsyzUDYGLZBR0+K/WtPk9yCWdjMzWqxOVWw== X-Google-Smtp-Source: APXvYqxaRKHkfsFMbrBLDa2MGDSI+Ly1GpEpJ3ADey3CwImA++TpeS5dr1drJHpW8lpSCa0y25F+LOYcUXy4mN7AZfU= X-Received: by 2002:ac8:74cb:: with SMTP id j11mr1850309qtr.32.1576538035786; Mon, 16 Dec 2019 15:13:55 -0800 (PST) MIME-Version: 1.0 References: <201912162308.xBGN89jg049753@repo.freebsd.org> In-Reply-To: <201912162308.xBGN89jg049753@repo.freebsd.org> From: Warner Losh Date: Mon, 16 Dec 2019 16:13:44 -0700 Message-ID: Subject: Re: svn commit: r355827 - head/sys/dev/pccbb To: Warner Losh Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 47cHC90ZJ2z4Rm3 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=juRQgxgt; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::82b) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.70 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[b.2.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.70)[ip: (-9.36), ipnet: 2607:f8b0::/32(-2.19), asn: 15169(-1.90), 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 23:13:58 -0000 On Mon, Dec 16, 2019 at 4:08 PM Warner Losh wrote: > Author: imp > Date: Mon Dec 16 23:08:09 2019 > New Revision: 355827 > URL: https://svnweb.freebsd.org/changeset/base/355827 > > Log: > Add back accidentally dropped masking... > > - PCI_MASK_CONFIG(sc->dev, CBBR_BRIDGECTRL, > - & ~CBBM_BRIDGECTRL_INTR_IREQ_ISA_EN, 2); > > was accidentally dropped from r355822 in the refactor. Restore it since > 16-bit > cards may fail without it (some bridges autodetect this properly, so my > laptop > worked when I tested it). > > Noticed by: rpokala@ > > Modified: > head/sys/dev/pccbb/pccbb.c > > Modified: head/sys/dev/pccbb/pccbb.c > > ============================================================================== > --- head/sys/dev/pccbb/pccbb.c Mon Dec 16 22:05:03 2019 (r355826) > +++ head/sys/dev/pccbb/pccbb.c Mon Dec 16 23:08:09 2019 (r355827) > @@ -59,9 +59,6 @@ > > /* > * Driver for PCI to CardBus Bridge chips > - * and PCI to PCMCIA Bridge chips > - * and ISA to PCMCIA host adapters > - * and C Bus to PCMCIA host adapters > * > * References: > * TI Datasheets: > This was intentional, btw. I'd planned on doing it in a separate commit, but it wound up in this one. Not worth reverting and redoing, imho, so I won't. The cbb driver will just be for CardBus Bridges. There's a pcic driver, out of tree because it's broken and mostly irrelevant after the NIC purge, that will handle PCI and ISA to 16-bit PCMCIA bridges. And C Bus is no longer relevant because PC 98 support has been removed from FreeBSD (and the driver it would have been was relevant for only a few very old PC 98 laptops with custom NEC PCMCIA interface that's impossible to find docs for these days). Warner > @@ -273,6 +270,8 @@ cbb_enable_func_intr(struct cbb_softc *sc) > > reg = (exca_getb(&sc->exca, EXCA_INTR) & ~EXCA_INTR_IRQ_MASK) | > EXCA_INTR_IRQ_NONE; > + PCI_MASK_CONFIG(sc->dev, CBBR_BRIDGECTRL, > + & ~CBBM_BRIDGECTRL_INTR_IREQ_ISA_EN, 2); > exca_putb(&sc->exca, EXCA_INTR, reg); > } > > From owner-svn-src-head@freebsd.org Mon Dec 16 23:55:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5AB721D1C23; Mon, 16 Dec 2019 23:55:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cJ771bmvz4TH0; Mon, 16 Dec 2019 23:55:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DAED535A; Mon, 16 Dec 2019 23:55:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBGNtUSF078841; Mon, 16 Dec 2019 23:55:30 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBGNtUq6078840; Mon, 16 Dec 2019 23:55:30 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201912162355.xBGNtUq6078840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 16 Dec 2019 23:55:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355828 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 355828 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 23:55:31 -0000 Author: pfg Date: Mon Dec 16 23:55:30 2019 New Revision: 355828 URL: https://svnweb.freebsd.org/changeset/base/355828 Log: Double the size of ARG_MAX on LP64 platforms. As modern software keeps growing in size, we get requests to update the value of ARG_MAX in order to link the resulting object files. Other OSs have much higher values but Increasiong ARG_MAX has a multiplied effect on KVA, so just bumping this value is dangerous in some archs like ARM32 that can exhaust KVA rather easily. While it would be better to have a unique value for all archs, other OSs (Illumos in partidular) can have different ARG_MAX limits depending on the platform, For now we want to be really conservative so we are avoidng the change on ILP32 and in the alternative case we only double it since that seems to work well enough for recent Code Aster. I was planning to bump the _FreeBSD_version but it was bumped recently (r355798) so we can reuse the 1300068 value for this change. PR: 241710 MFC after: 5 days Modified: head/sys/sys/syslimits.h Modified: head/sys/sys/syslimits.h ============================================================================== --- head/sys/sys/syslimits.h Mon Dec 16 23:08:09 2019 (r355827) +++ head/sys/sys/syslimits.h Mon Dec 16 23:55:30 2019 (r355828) @@ -48,7 +48,11 @@ * Do not add any new variables here. (See the comment at the end of * the file for why.) */ -#define ARG_MAX 262144 /* max bytes for an exec function */ +#ifndef __ILP32__ +#define ARG_MAX (2 * 256 * 1024) /* max bytes for an exec function */ +#else +#define ARG_MAX (256 * 1024) /* max bytes for KVA-starved archs */ +#endif #ifndef CHILD_MAX #define CHILD_MAX 40 /* max simultaneous processes */ #endif From owner-svn-src-head@freebsd.org Tue Dec 17 00:00:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D01161D1F2D; Tue, 17 Dec 2019 00:00:03 +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 47cJDM51Q9z4TVK; Tue, 17 Dec 2019 00:00:03 +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 A78825370; Tue, 17 Dec 2019 00:00:03 +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 xBH003WF079151; Tue, 17 Dec 2019 00:00:03 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBH003kL079149; Tue, 17 Dec 2019 00:00:03 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201912170000.xBH003kL079149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 17 Dec 2019 00:00:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355829 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 355829 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 00:00:03 -0000 Author: adrian Date: Tue Dec 17 00:00:03 2019 New Revision: 355829 URL: https://svnweb.freebsd.org/changeset/base/355829 Log: [atheros] [mips] Add the GPIO driver (back) to the TL-WDR3600/TL-WDR4300 kernel. So it turns out that sometime in the past I removed the GPIO bits here and was going to move it into a module in order to save a little space. However, it turns out that was a mistake on this particular AP - it uses a pair of GPIO lines to control the two receive LNAs on the 2GHz radio and without them enabled the radio is a LOT DEAF. With this re-introduced (and some replacement userland tools to save space, *cough* cpio/libarchive) I can actually use these chipsets again as a 2G station. Without the LNA the AP was seeing a per-radio RSSI upstairs here of around 3-5dB, with the LNA on it's around 15dB, more than enough to actually use wifi upstairs and also in line with the other Atheros / Intel devices I have up here. Big oopsie to Adrian. Big, big oopsie. Modified: head/sys/mips/conf/TL-WDR4300 Modified: head/sys/mips/conf/TL-WDR4300 ============================================================================== --- head/sys/mips/conf/TL-WDR4300 Mon Dec 16 23:55:30 2019 (r355828) +++ head/sys/mips/conf/TL-WDR4300 Tue Dec 17 00:00:03 2019 (r355829) @@ -50,5 +50,12 @@ options AR71XX_ATH_EEPROM device firmware # Used by the above options ATH_EEPROM_FIRMWARE +options ATH_DEBUG_ALQ + # Boot off of the rootfs, as defined in the geom_map setup. options ROOTDEVNAME=\"ufs:map/rootfs.uzip\" + +# This is required for the 2GHz LNAs on the AR9340 SoC. +# Without this the 2GHz radio is Quite Deaf. +device gpio +device gpioled From owner-svn-src-head@freebsd.org Tue Dec 17 00:10:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47BCC1D285C; Tue, 17 Dec 2019 00:10:20 +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 47cJSD0zpLz4VGJ; Tue, 17 Dec 2019 00:10:20 +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 1A71F5531; Tue, 17 Dec 2019 00:10:20 +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 xBH0AJCV085050; Tue, 17 Dec 2019 00:10:19 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBH0AJw3085049; Tue, 17 Dec 2019 00:10:19 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201912170010.xBH0AJw3085049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 17 Dec 2019 00:10:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355830 - head/sys/dev/ata/chipsets X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/dev/ata/chipsets X-SVN-Commit-Revision: 355830 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 00:10:20 -0000 Author: brooks Date: Tue Dec 17 00:10:19 2019 New Revision: 355830 URL: https://svnweb.freebsd.org/changeset/base/355830 Log: Avoid a tautological bitwise compare. This looks like a bit of debugging code that sliped into the initial import of the new ATA framework. This changes the behavior to omit a line of output that appears to have been intended for omission. Reviewed by: mav MFC after: 3 days Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22845 Modified: head/sys/dev/ata/chipsets/ata-promise.c Modified: head/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-promise.c Tue Dec 17 00:00:03 2019 (r355829) +++ head/sys/dev/ata/chipsets/ata-promise.c Tue Dec 17 00:10:19 2019 (r355830) @@ -795,7 +795,7 @@ ata_promise_mio_reset(device_t dev) if (ata_sata_phy_reset(dev, -1, 1)) { u_int32_t signature = ch->hw.softreset(dev, ATA_PM); - if (1 | bootverbose) + if (bootverbose) device_printf(dev, "SIGNATURE: %08x\n", signature); switch (signature >> 16) { From owner-svn-src-head@freebsd.org Tue Dec 17 00:11:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 095031D2A47; Tue, 17 Dec 2019 00:11:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cJTw6PWNz4VSk; Tue, 17 Dec 2019 00:11:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D699555AD; Tue, 17 Dec 2019 00:11:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBH0Bmw1088827; Tue, 17 Dec 2019 00:11:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBH0Bm5I088826; Tue, 17 Dec 2019 00:11:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912170011.xBH0Bm5I088826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 Dec 2019 00:11:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355831 - head/sys/cam/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/nvme X-SVN-Commit-Revision: 355831 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 00:11:49 -0000 Author: imp Date: Tue Dec 17 00:11:48 2019 New Revision: 355831 URL: https://svnweb.freebsd.org/changeset/base/355831 Log: NVME trim stuff. Add two sysctls to control pacing of nvme trims. kern.cam.nda.X.goal_trim is the number of upper layer BIO_DEELETE requests to try to collecet before sending TRIM down too the nvme drive. trim_ticks is the number of ticks, at mosot, to wait for at least goal_trim BIOS_DELEETE requests to come in. Trim pacing is useful when a large number off disjoint trims are comoing in from the upper layers. Since we have no way to chain toogether trims from the upper layers that are sent down, this acts as a hueristic to group trims into reasonable sized chunks. What's reasonable varies from drive to drive. Sponsored by: Netflix Modified: head/sys/cam/nvme/nvme_da.c Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Tue Dec 17 00:10:19 2019 (r355830) +++ head/sys/cam/nvme/nvme_da.c Tue Dec 17 00:11:48 2019 (r355831) @@ -177,6 +177,14 @@ static int nda_max_trim_entries = NDA_MAX_TRIM_ENTRIES SYSCTL_INT(_kern_cam_nda, OID_AUTO, max_trim, CTLFLAG_RDTUN, &nda_max_trim_entries, NDA_MAX_TRIM_ENTRIES, "Maximum number of BIO_DELETE to send down as a DSM TRIM."); +static int nda_goal_trim_entries = NDA_MAX_TRIM_ENTRIES / 2; +SYSCTL_INT(_kern_cam_nda, OID_AUTO, goal_trim, CTLFLAG_RDTUN, + &nda_goal_trim_entries, NDA_MAX_TRIM_ENTRIES / 2, + "Number of BIO_DELETE to try to accumulate before sending a DSM TRIM."); +static int nda_trim_ticks = 50; /* 50ms ~ 1000 Hz */ +SYSCTL_INT(_kern_cam_nda, OID_AUTO, trim_ticks, CTLFLAG_RDTUN, + &nda_trim_ticks, 50, + "Number of ticks to hold BIO_DELETEs before sending down a trim"); /* * All NVMe media is non-rotational, so all nvme device instances @@ -741,6 +749,9 @@ ndaregister(struct cam_periph *periph, void *arg) free(softc, M_DEVBUF); return(CAM_REQ_CMP_ERR); } + /* Statically set these for the moment */ + cam_iosched_set_trim_goal(softc->cam_iosched, nda_goal_trim_entries); + cam_iosched_set_trim_ticks(softc->cam_iosched, nda_trim_ticks); /* ident_data parsing */ From owner-svn-src-head@freebsd.org Tue Dec 17 00:13:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1ABAA1D2B29; Tue, 17 Dec 2019 00:13:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cJWj70lGz4Vll; Tue, 17 Dec 2019 00:13:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBA8556EC; Tue, 17 Dec 2019 00:13:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBH0DL88090459; Tue, 17 Dec 2019 00:13:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBH0DLnh090458; Tue, 17 Dec 2019 00:13:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912170013.xBH0DLnh090458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 Dec 2019 00:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355832 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 355832 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 00:13:22 -0000 Author: imp Date: Tue Dec 17 00:13:21 2019 New Revision: 355832 URL: https://svnweb.freebsd.org/changeset/base/355832 Log: Add rate limiters to TRIM. Add rate limiters to trims. Trims are a bit different than reads or writes in that they can be combined, so some care needs to be taken where we rate limit them. Additional work will be needed to push the working rate limit below the I/O quanta rate for things like IOPS. Sponsored by: Netflix Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Tue Dec 17 00:11:48 2019 (r355831) +++ head/sys/cam/cam_iosched.c Tue Dec 17 00:13:21 2019 (r355832) @@ -755,7 +755,20 @@ cam_iosched_has_io(struct cam_iosched_softc *isc) static inline bool cam_iosched_has_more_trim(struct cam_iosched_softc *isc) { + struct bio *bp; + bp = bioq_first(&isc->trim_queue); +#ifdef CAM_IOSCHED_DYNAMIC + if (do_dynamic_iosched) { + /* + * If we're limiting trims, then defer action on trims + * for a bit. + */ + if (bp == NULL || cam_iosched_limiter_caniop(&isc->trim_stats, bp) != 0) + return false; + } +#endif + /* * If we've set a trim_goal, then if we exceed that allow trims * to be passed back to the driver. If we've also set a tick timeout @@ -771,8 +784,8 @@ cam_iosched_has_more_trim(struct cam_iosched_softc *is return false; } - return !(isc->flags & CAM_IOSCHED_FLAG_TRIM_ACTIVE) && - bioq_first(&isc->trim_queue); + /* NB: Should perhaps have a max trim active independent of I/O limiters */ + return !(isc->flags & CAM_IOSCHED_FLAG_TRIM_ACTIVE) && bp != NULL; } #define cam_iosched_sort_queue(isc) ((isc)->sort_io_queue >= 0 ? \ @@ -1389,10 +1402,17 @@ cam_iosched_next_trim(struct cam_iosched_softc *isc) struct bio * cam_iosched_get_trim(struct cam_iosched_softc *isc) { +#ifdef CAM_IOSCHED_DYNAMIC + struct bio *bp; +#endif if (!cam_iosched_has_more_trim(isc)) return NULL; #ifdef CAM_IOSCHED_DYNAMIC + bp = bioq_first(&isc->trim_queue); + if (bp == NULL) + return NULL; + /* * If pending read, prefer that based on current read bias setting. The * read bias is shared for both writes and TRIMs, but on TRIMs the bias @@ -1414,6 +1434,26 @@ cam_iosched_get_trim(struct cam_iosched_softc *isc) */ isc->current_read_bias = isc->read_bias; } + + /* + * See if our current limiter allows this I/O. Because we only call this + * here, and not in next_trim, the 'bandwidth' limits for trims won't + * work, while the iops or max queued limits will work. It's tricky + * because we want the limits to be from the perspective of the + * "commands sent to the device." To make iops work, we need to check + * only here (since we want all the ops we combine to count as one). To + * make bw limits work, we'd need to check in next_trim, but that would + * have the effect of limiting the iops as seen from the upper layers. + */ + if (cam_iosched_limiter_iop(&isc->trim_stats, bp) != 0) { + if (iosched_debug) + printf("Can't trim because limiter says no.\n"); + isc->trim_stats.state_flags |= IOP_RATE_LIMITED; + return NULL; + } + isc->current_read_bias = isc->read_bias; + isc->trim_stats.state_flags &= ~IOP_RATE_LIMITED; + /* cam_iosched_next_trim below keeps proper book */ #endif return cam_iosched_next_trim(isc); } From owner-svn-src-head@freebsd.org Tue Dec 17 00:13:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A8F111D2B4E; Tue, 17 Dec 2019 00:13:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cJWp3jHVz4Vnj; Tue, 17 Dec 2019 00:13:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78C7456ED; Tue, 17 Dec 2019 00:13:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBH0DQft090513; Tue, 17 Dec 2019 00:13:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBH0DQ0k090512; Tue, 17 Dec 2019 00:13:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912170013.xBH0DQ0k090512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 Dec 2019 00:13:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355833 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 355833 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 00:13:26 -0000 Author: imp Date: Tue Dec 17 00:13:26 2019 New Revision: 355833 URL: https://svnweb.freebsd.org/changeset/base/355833 Log: Tweak the ddb show cam iosched command a bit. For each of the different queue types, list the name of the queue. While it can be worked out from context, this makes it more useful and clearer. Sponsored by: Netflix Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Tue Dec 17 00:13:21 2019 (r355832) +++ head/sys/cam/cam_iosched.c Tue Dec 17 00:13:26 2019 (r355833) @@ -1903,7 +1903,7 @@ DB_SHOW_COMMAND(iosched, cam_iosched_db_show) db_printf("in_reads: %d\n", isc->read_stats.in); db_printf("out_reads: %d\n", isc->read_stats.out); db_printf("queued_reads: %d\n", isc->read_stats.queued); - db_printf("Current Q len %d\n", biolen(&isc->bio_queue)); + db_printf("Read Q len %d\n", biolen(&isc->bio_queue)); db_printf("pending_writes: %d\n", isc->write_stats.pending); db_printf("min_writes: %d\n", isc->write_stats.min); db_printf("max_writes: %d\n", isc->write_stats.max); @@ -1911,7 +1911,7 @@ DB_SHOW_COMMAND(iosched, cam_iosched_db_show) db_printf("in_writes: %d\n", isc->write_stats.in); db_printf("out_writes: %d\n", isc->write_stats.out); db_printf("queued_writes: %d\n", isc->write_stats.queued); - db_printf("Current Q len %d\n", biolen(&isc->write_queue)); + db_printf("Write Q len %d\n", biolen(&isc->write_queue)); db_printf("pending_trims: %d\n", isc->trim_stats.pending); db_printf("min_trims: %d\n", isc->trim_stats.min); db_printf("max_trims: %d\n", isc->trim_stats.max); @@ -1919,7 +1919,7 @@ DB_SHOW_COMMAND(iosched, cam_iosched_db_show) db_printf("in_trims: %d\n", isc->trim_stats.in); db_printf("out_trims: %d\n", isc->trim_stats.out); db_printf("queued_trims: %d\n", isc->trim_stats.queued); - db_printf("Current Q len %d\n", biolen(&isc->trim_queue)); + db_printf("Trim Q len %d\n", biolen(&isc->trim_queue)); db_printf("read_bias: %d\n", isc->read_bias); db_printf("current_read_bias: %d\n", isc->current_read_bias); db_printf("Trim active? %s\n", From owner-svn-src-head@freebsd.org Tue Dec 17 00:13:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9DF861D2B8E; Tue, 17 Dec 2019 00:13:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cJWv2dRVz4VxR; Tue, 17 Dec 2019 00:13:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 246B856EE; Tue, 17 Dec 2019 00:13:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBH0DUMH090567; Tue, 17 Dec 2019 00:13:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBH0DUPA090566; Tue, 17 Dec 2019 00:13:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912170013.xBH0DUPA090566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 Dec 2019 00:13:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355834 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 355834 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 00:13:31 -0000 Author: imp Date: Tue Dec 17 00:13:30 2019 New Revision: 355834 URL: https://svnweb.freebsd.org/changeset/base/355834 Log: Eliminate the TRIM_ACTIVE flag. Rather than a trim active flag, have a counter that can be used to have a absolute limit on the number of trims in flight independent of any I/O limiting factors. Sponsored by: Netflix Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Tue Dec 17 00:13:26 2019 (r355833) +++ head/sys/cam/cam_iosched.c Tue Dec 17 00:13:30 2019 (r355834) @@ -281,6 +281,8 @@ struct cam_iosched_softc { int trim_ticks; /* Max ticks to hold trims */ int last_trim_tick; /* Last 'tick' time ld a trim */ int queued_trims; /* Number of trims in the queue */ + int max_trims; /* Maximum number of trims pending at once */ + int pend_trims; /* Number of pending trims now */ #ifdef CAM_IOSCHED_DYNAMIC int read_bias; /* Read bias setting */ int current_read_bias; /* Current read bias state */ @@ -707,11 +709,6 @@ cam_iosched_cl_maybe_steer(struct control_loop *clp) } #endif -/* - * Trim or similar currently pending completion. Should only be set for - * those drivers wishing only one Trim active at a time. - */ -#define CAM_IOSCHED_FLAG_TRIM_ACTIVE (1ul << 0) /* Callout active, and needs to be torn down */ #define CAM_IOSCHED_FLAG_CALLOUT_ACTIVE (1ul << 1) @@ -784,8 +781,7 @@ cam_iosched_has_more_trim(struct cam_iosched_softc *is return false; } - /* NB: Should perhaps have a max trim active independent of I/O limiters */ - return !(isc->flags & CAM_IOSCHED_FLAG_TRIM_ACTIVE) && bp != NULL; + return isc->pend_trims <= isc->max_trims && bp != NULL; } #define cam_iosched_sort_queue(isc) ((isc)->sort_io_queue >= 0 ? \ @@ -1109,6 +1105,7 @@ cam_iosched_init(struct cam_iosched_softc **iscp, stru (*iscp)->sort_io_queue = -1; bioq_init(&(*iscp)->bio_queue); bioq_init(&(*iscp)->trim_queue); + (*iscp)->max_trims = 1; #ifdef CAM_IOSCHED_DYNAMIC if (do_dynamic_iosched) { bioq_init(&(*iscp)->write_queue); @@ -1609,7 +1606,7 @@ void cam_iosched_trim_done(struct cam_iosched_softc *isc) { - isc->flags &= ~CAM_IOSCHED_FLAG_TRIM_ACTIVE; + isc->pend_trims--; } /* @@ -1677,7 +1674,7 @@ void cam_iosched_submit_trim(struct cam_iosched_softc *isc) { - isc->flags |= CAM_IOSCHED_FLAG_TRIM_ACTIVE; + isc->pend_trims++; } /* @@ -1922,8 +1919,8 @@ DB_SHOW_COMMAND(iosched, cam_iosched_db_show) db_printf("Trim Q len %d\n", biolen(&isc->trim_queue)); db_printf("read_bias: %d\n", isc->read_bias); db_printf("current_read_bias: %d\n", isc->current_read_bias); - db_printf("Trim active? %s\n", - (isc->flags & CAM_IOSCHED_FLAG_TRIM_ACTIVE) ? "yes" : "no"); + db_printf("Trims active %d\n", isc->pend_trim); + db_printf("Max trims active %d\n", isc->max_trim); } #endif #endif From owner-svn-src-head@freebsd.org Tue Dec 17 00:13:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE0F21D2BE7; Tue, 17 Dec 2019 00:13:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cJX03P0Lz4W5S; Tue, 17 Dec 2019 00:13:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 394CF56EF; Tue, 17 Dec 2019 00:13:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBH0DadH090623; Tue, 17 Dec 2019 00:13:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBH0DZGD090620; Tue, 17 Dec 2019 00:13:35 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912170013.xBH0DZGD090620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 Dec 2019 00:13:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355835 - in head/sys: geom sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: geom sys X-SVN-Commit-Revision: 355835 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 00:13:36 -0000 Author: imp Date: Tue Dec 17 00:13:35 2019 New Revision: 355835 URL: https://svnweb.freebsd.org/changeset/base/355835 Log: Add BIO_SPEEDUP Add BIO_SPEEDUP bio command and g_io_speedup wrapper. It tells the lower layers that the upper layers are dealing with some shortage (dirty pages and/or disk blocks). The lower layers should do what they can to speed up anything that's been delayed. The first use will be to tell the CAM I/O scheduler that any TRIM shaping should be short-circuited because the system needs blocks. We'll also call it when there's too many resources used by UFS. Reviewed by: kirk, kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D18351 Modified: head/sys/geom/geom.h head/sys/geom/geom_io.c head/sys/sys/bio.h Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Tue Dec 17 00:13:30 2019 (r355834) +++ head/sys/geom/geom.h Tue Dec 17 00:13:35 2019 (r355835) @@ -343,6 +343,7 @@ void g_io_deliver(struct bio *bp, int error); int g_io_getattr(const char *attr, struct g_consumer *cp, int *len, void *ptr); int g_io_zonecmd(struct disk_zone_args *zone_args, struct g_consumer *cp); int g_io_flush(struct g_consumer *cp); +int g_io_speedup(size_t shortage, u_int flags, size_t *resid, struct g_consumer *cp); int g_register_classifier(struct g_classifier_hook *hook); void g_unregister_classifier(struct g_classifier_hook *hook); void g_io_request(struct bio *bp, struct g_consumer *cp); Modified: head/sys/geom/geom_io.c ============================================================================== --- head/sys/geom/geom_io.c Tue Dec 17 00:13:30 2019 (r355834) +++ head/sys/geom/geom_io.c Tue Dec 17 00:13:35 2019 (r355835) @@ -340,6 +340,42 @@ g_io_zonecmd(struct disk_zone_args *zone_args, struct return (error); } +/* + * Send a BIO_SPEEDUP down the stack. This is used to tell the lower layers that + * the upper layers have detected a resource shortage. The lower layers are + * advised to stop delaying I/O that they might be holding for performance + * reasons and to schedule it (non-trims) or complete it successfully (trims) as + * quickly as it can. bio_length is the amount of the shortage. This call + * should be non-blocking. bio_resid is used to communicate back if the lower + * layers couldn't find bio_length worth of I/O to schedule or discard. A length + * of 0 means to do as much as you can (schedule the h/w queues full, discard + * all trims). flags are a hint from the upper layers to the lower layers what + * operation should be done. + */ +int +g_io_speedup(size_t shortage, u_int flags, size_t *resid, struct g_consumer *cp) +{ + struct bio *bp; + int error; + + KASSERT((flags & (BIO_SPEEDUP_TRIM | BIO_SPEEDUP_WRITE)) != 0, + ("Invalid flags passed to g_io_speedup: %#x", flags)); + g_trace(G_T_BIO, "bio_speedup(%s, %zu, %#x)", cp->provider->name, + shortage, flags); + bp = g_new_bio(); + if (bp == NULL) + return (ENOMEM); + bp->bio_cmd = BIO_SPEEDUP; + bp->bio_length = shortage; + bp->bio_done = NULL; + bp->bio_flags |= flags; + g_io_request(bp, cp); + error = biowait(bp, "gflush"); + *resid = bp->bio_resid; + g_destroy_bio(bp); + return (error); +} + int g_io_flush(struct g_consumer *cp) { Modified: head/sys/sys/bio.h ============================================================================== --- head/sys/sys/bio.h Tue Dec 17 00:13:30 2019 (r355834) +++ head/sys/sys/bio.h Tue Dec 17 00:13:35 2019 (r355835) @@ -53,6 +53,7 @@ #define BIO_CMD1 0x07 /* Available for local hacks */ #define BIO_CMD2 0x08 /* Available for local hacks */ #define BIO_ZONE 0x09 /* Zone command */ +#define BIO_SPEEDUP 0x0a /* Upper layers face shortage */ /* bio_flags */ #define BIO_ERROR 0x01 /* An error occurred processing this bio. */ @@ -69,6 +70,9 @@ #define PRINT_BIO_FLAGS "\20\7vlist\6transient_mapping\5unmapped" \ "\4ordered\3onqueue\2done\1error" + +#define BIO_SPEEDUP_WRITE 0x4000 /* Resource shortage at upper layers */ +#define BIO_SPEEDUP_TRIM 0x8000 /* Resource shortage at upper layers */ #ifdef _KERNEL struct disk; From owner-svn-src-head@freebsd.org Tue Dec 17 00:13:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1BA451D2C41; Tue, 17 Dec 2019 00:13:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cJX46vMkz4W9c; Tue, 17 Dec 2019 00:13:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E11CE56F0; Tue, 17 Dec 2019 00:13:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBH0Deu5090675; Tue, 17 Dec 2019 00:13:40 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBH0Deci090674; Tue, 17 Dec 2019 00:13:40 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912170013.xBH0Deci090674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 Dec 2019 00:13:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355836 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 355836 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 00:13:41 -0000 Author: imp Date: Tue Dec 17 00:13:40 2019 New Revision: 355836 URL: https://svnweb.freebsd.org/changeset/base/355836 Log: Add BIO_SPEEDUP signalling to UFS When we have a resource shortage in UFS, send down a BIO_SPEEDUP to give the CAM I/O scheduler a heads up that we have a resource shortage and that it should bias its decisions knowing that. Reviewed by: kirk, kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D18351 Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Tue Dec 17 00:13:35 2019 (r355835) +++ head/sys/ufs/ffs/ffs_softdep.c Tue Dec 17 00:13:40 2019 (r355836) @@ -3343,8 +3343,7 @@ softdep_synchronize(bp, ump, caller1) bp->bio_length = 0; bp->bio_done = softdep_synchronize_completed; bp->bio_caller1 = caller1; - g_io_request(bp, - (struct g_consumer *)ump->um_devvp->v_bufobj.bo_private); + g_io_request(bp, ump->um_cp); } /* @@ -13353,6 +13352,7 @@ softdep_request_cleanup(fs, vp, cred, resource) struct ufsmount *ump; struct mount *mp; long starttime; + size_t resid; ufs2_daddr_t needed; int error, failed_vnode; @@ -13428,6 +13428,10 @@ softdep_request_cleanup(fs, vp, cred, resource) } starttime = time_second; retry: + if (resource == FLUSH_BLOCKS_WAIT && + fs->fs_cstotal.cs_nbfree <= needed) + g_io_speedup(needed * fs->fs_bsize, BIO_SPEEDUP_TRIM, &resid, + ump->um_cp); if ((resource == FLUSH_BLOCKS_WAIT && ump->softdep_on_worklist > 0 && fs->fs_cstotal.cs_nbfree <= needed) || (resource == FLUSH_INODES_WAIT && fs->fs_pendinginodes > 0 && @@ -13740,13 +13744,23 @@ static void check_clear_deps(mp) struct mount *mp; { + size_t resid; /* + * Tell the lower layers that any TRIM or WRITE transactions + * that have been delayed for performance reasons should + * proceed to help alleviate the shortage faster. + */ + g_io_speedup(0, BIO_SPEEDUP_TRIM | BIO_SPEEDUP_WRITE, &resid, + VFSTOUFS(mp)->um_cp); + + /* * If we are suspended, it may be because of our using * too many inodedeps, so help clear them out. */ if (MOUNTEDSUJ(mp) && VFSTOUFS(mp)->softdep_jblocks->jb_suspended) clear_inodedeps(mp); + /* * General requests for cleanup of backed up dependencies */ From owner-svn-src-head@freebsd.org Tue Dec 17 00:13:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B2B691D2CA1; Tue, 17 Dec 2019 00:13:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cJX93dmPz4WHN; Tue, 17 Dec 2019 00:13:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 784AA56F1; Tue, 17 Dec 2019 00:13:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBH0Djg2090731; Tue, 17 Dec 2019 00:13:45 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBH0DjZY090730; Tue, 17 Dec 2019 00:13:45 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912170013.xBH0DjZY090730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 Dec 2019 00:13:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355837 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 355837 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 00:13:45 -0000 Author: imp Date: Tue Dec 17 00:13:45 2019 New Revision: 355837 URL: https://svnweb.freebsd.org/changeset/base/355837 Log: Implement bio_speedup React to the BIO_SPEED command in the cam io scheduler by completing as successful BIO_DELETE commands that are pending, up to the length passed down in the BIO_SPEEDUP cmomand. The length passed down is a hint for how much space on the drive needs to be recovered. By completing the BIO_DELETE comomands, this allows the upper layers to allocate and write to the blocks that were about to be trimmed. Since FreeBSD implements TRIMSs as advisory, we can eliminliminate them and go directly to writing. The biggest benefit from TRIMS coomes ffrom the drive being able t ooptimize its free block pool inthe log run. There's little nto no bene3efit in the shoort term. , sepeciall whn the trim is followed by a write. Speedup lets us make this tradeoff. Reviewed by: kirk, kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D18351 Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Tue Dec 17 00:13:40 2019 (r355836) +++ head/sys/cam/cam_iosched.c Tue Dec 17 00:13:45 2019 (r355837) @@ -1534,6 +1534,41 @@ cam_iosched_queue_work(struct cam_iosched_softc *isc, { /* + * A BIO_SPEEDUP from the uppper layers means that they have a block + * shortage. At the present, this is only sent when we're trying to + * allocate blocks, but have a shortage before giving up. bio_length is + * the size of their shortage. We will complete just enough BIO_DELETEs + * in the queue to satisfy the need. If bio_length is 0, we'll complete + * them all. This allows the scheduler to delay BIO_DELETEs to improve + * read/write performance without worrying about the upper layers. When + * it's possibly a problem, we respond by pretending the BIO_DELETEs + * just worked. We can't do anything about the BIO_DELETEs in the + * hardware, though. We have to wait for them to complete. + */ + if (bp->bio_cmd == BIO_SPEEDUP) { + off_t len; + struct bio *nbp; + + len = 0; + while (bioq_first(&isc->trim_queue) && + (bp->bio_length == 0 || len < bp->bio_length)) { + nbp = bioq_takefirst(&isc->trim_queue); + len += nbp->bio_length; + nbp->bio_error = 0; + biodone(nbp); + } + if (bp->bio_length > 0) { + if (bp->bio_length > len) + bp->bio_resid = bp->bio_length - len; + else + bp->bio_resid = 0; + } + bp->bio_error = 0; + biodone(bp); + return; + } + + /* * If we get a BIO_FLUSH, and we're doing delayed BIO_DELETEs then we * set the last tick time to one less than the current ticks minus the * delay to force the BIO_DELETEs to be presented to the client driver. @@ -1919,8 +1954,8 @@ DB_SHOW_COMMAND(iosched, cam_iosched_db_show) db_printf("Trim Q len %d\n", biolen(&isc->trim_queue)); db_printf("read_bias: %d\n", isc->read_bias); db_printf("current_read_bias: %d\n", isc->current_read_bias); - db_printf("Trims active %d\n", isc->pend_trim); - db_printf("Max trims active %d\n", isc->max_trim); + db_printf("Trims active %d\n", isc->pend_trims); + db_printf("Max trims active %d\n", isc->max_trims); } #endif #endif From owner-svn-src-head@freebsd.org Tue Dec 17 00:28:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 01E661D3056 for ; Tue, 17 Dec 2019 00:28:20 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) (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 47cJrz1Kpcz4WqQ for ; Tue, 17 Dec 2019 00:28:19 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm1-x332.google.com with SMTP id m24so1163552wmc.3 for ; Mon, 16 Dec 2019 16:28:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=17DXskGW4LtVR5PNsMRbaHMe62krSpBAAu6p40Y/pO0=; b=IBoqyea1WYSoaubsnsjP6YT7M0Mdg7g4TimYk3G9HzMBM4dJPZ/TvQVCBSDb7vck5e AdJS9AULr8vGJqCv1zh+3JfT2A1UV4ToJmoD0WAR74ru/I9dYbeIQw3zDHUt0UojFGaG 6Dlby+XFRLUwAJ5oYbwi2vfJJfKlSNhNKI9GEuQh5bNW36QtyM0Q/YpQyLCA2m/mqSNe FtKYHsxEUe8gRgC4SjknAljdYK7eYqdjgn8XGSTOwAbZ1L3LNpWvRnSY357dErz1jBvA VwWpAH3+FYNPplpY4GLblxCioGUjdGG0zlAluaed2QUfSlcxVxHpCtN69P26sGN95DGG or4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=17DXskGW4LtVR5PNsMRbaHMe62krSpBAAu6p40Y/pO0=; b=of7wUAF/opaoCivKgwe39HKathUL1EQ2jJGAO0XQktyUh6GMp/LOXP+aJA/FQwHB8y hh16IKh1uYQ5/kxQb8jAunN5s26c8yjU85xEBRS3j4WoX06UTFLJFHMsB2oHz4ICIB8L PKt94dKkUjlBvlbNL++P6TeYG+k5DCUxk3W88L3k8T+7Pehv8XeOxpSUAdT8naejoL05 XWqsMEuavuVuphT5eRoc7yI+zmybw8e8CK9o6mQg0kR2bhHtQkhxe0S7RDAZxaycqJ/P uIocyt7pfH1HBDQ4OPPoVedenwz8FaZYyeZmYC1Ko7ejrQ5rrGO40bgXgqaSCRys1zB6 syow== X-Gm-Message-State: APjAAAVvPpwX0SkomOCGOI/OXUOuuE1k6m0VMPOkqXRS7xgOjNZ9kyl6 k+g0//HuSfcNX+B6G/bt+ceH0FQL1t0= X-Google-Smtp-Source: APXvYqxFncI1nBIFoEl2jGaKGNRs8Smyewy83Xd4EFAlB6FVCFDJVIbNQ8rzsja2aAKsJn8qkPur9g== X-Received: by 2002:a7b:cd91:: with SMTP id y17mr1887412wmj.140.1576542496943; Mon, 16 Dec 2019 16:28:16 -0800 (PST) Received: from [10.44.128.75] ([193.117.175.106]) by smtp.gmail.com with ESMTPSA id r5sm22799612wrt.43.2019.12.16.16.28.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Dec 2019 16:28:16 -0800 (PST) Subject: Re: svn commit: r355831 - head/sys/cam/nvme To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201912170011.xBH0Bm5I088826@repo.freebsd.org> From: Steven Hartland Message-ID: <4c5ce3c8-d074-f907-af03-20f4752f428c@multiplay.co.uk> Date: Tue, 17 Dec 2019 00:28:15 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <201912170011.xBH0Bm5I088826@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB X-Rspamd-Queue-Id: 47cJrz1Kpcz4WqQ X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=multiplay-co-uk.20150623.gappssmtp.com header.s=20150623 header.b=IBoqyea1; dmarc=pass (policy=none) header.from=multiplay.co.uk; spf=pass (mx1.freebsd.org: domain of steven.hartland@multiplay.co.uk designates 2a00:1450:4864:20::332 as permitted sender) smtp.mailfrom=steven.hartland@multiplay.co.uk X-Spamd-Result: default: False [-5.76 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[multiplay-co-uk.20150623.gappssmtp.com:s=20150623]; 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:2a00:1450:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[multiplay-co-uk.20150623.gappssmtp.com:+]; DMARC_POLICY_ALLOW(-0.50)[multiplay.co.uk,none]; RCVD_IN_DNSWL_NONE(0.00)[2.3.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:+]; IP_SCORE(-2.76)[ip: (-9.20), ipnet: 2a00:1450::/32(-2.67), asn: 15169(-1.90), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 00:28:20 -0000 Be aware that ZFS already does a pretty decent job of this already, so the statement about upper layers isn't true for all. It even has different priorities for different request types so I'm a little concerned that doing it at both layers could cause issues. In addition to this if its anything like SSD's numbers of requests are only a small part of the story with total trim size being the other one. I this case you could hit total desired size with just one BIO_DELETE request. With this code what's the impact of this? On 17/12/2019 00:11, Warner Losh wrote: > Author: imp > Date: Tue Dec 17 00:11:48 2019 > New Revision: 355831 > URL: https://svnweb.freebsd.org/changeset/base/355831 > > Log: > NVME trim stuff. > > Add two sysctls to control pacing of nvme > trims. kern.cam.nda.X.goal_trim is the number of upper layer > BIO_DEELETE requests to try to collecet before sending TRIM down too > the nvme drive. trim_ticks is the number of ticks, at mosot, to wait > for at least goal_trim BIOS_DELEETE requests to come in. > > Trim pacing is useful when a large number off disjoint trims are > comoing in from the upper layers. Since we have no way to chain > toogether trims from the upper layers that are sent down, this acts as > a hueristic to group trims into reasonable sized chunks. What's > reasonable varies from drive to drive. > > Sponsored by: Netflix > > Modified: > head/sys/cam/nvme/nvme_da.c > > Modified: head/sys/cam/nvme/nvme_da.c > ============================================================================== > --- head/sys/cam/nvme/nvme_da.c Tue Dec 17 00:10:19 2019 (r355830) > +++ head/sys/cam/nvme/nvme_da.c Tue Dec 17 00:11:48 2019 (r355831) > @@ -177,6 +177,14 @@ static int nda_max_trim_entries = NDA_MAX_TRIM_ENTRIES > SYSCTL_INT(_kern_cam_nda, OID_AUTO, max_trim, CTLFLAG_RDTUN, > &nda_max_trim_entries, NDA_MAX_TRIM_ENTRIES, > "Maximum number of BIO_DELETE to send down as a DSM TRIM."); > +static int nda_goal_trim_entries = NDA_MAX_TRIM_ENTRIES / 2; > +SYSCTL_INT(_kern_cam_nda, OID_AUTO, goal_trim, CTLFLAG_RDTUN, > + &nda_goal_trim_entries, NDA_MAX_TRIM_ENTRIES / 2, > + "Number of BIO_DELETE to try to accumulate before sending a DSM TRIM."); > +static int nda_trim_ticks = 50; /* 50ms ~ 1000 Hz */ > +SYSCTL_INT(_kern_cam_nda, OID_AUTO, trim_ticks, CTLFLAG_RDTUN, > + &nda_trim_ticks, 50, > + "Number of ticks to hold BIO_DELETEs before sending down a trim"); > > /* > * All NVMe media is non-rotational, so all nvme device instances > @@ -741,6 +749,9 @@ ndaregister(struct cam_periph *periph, void *arg) > free(softc, M_DEVBUF); > return(CAM_REQ_CMP_ERR); > } > + /* Statically set these for the moment */ > + cam_iosched_set_trim_goal(softc->cam_iosched, nda_goal_trim_entries); > + cam_iosched_set_trim_ticks(softc->cam_iosched, nda_trim_ticks); > > /* ident_data parsing */ > From owner-svn-src-head@freebsd.org Tue Dec 17 00:32:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 02A4D1D325C for ; Tue, 17 Dec 2019 00:32:20 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450: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 47cJxb18zHz4XBH for ; Tue, 17 Dec 2019 00:32:19 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wr1-x441.google.com with SMTP id t2so9450824wrr.1 for ; Mon, 16 Dec 2019 16:32:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=6Ojk3vXOJr7FWRbBqhnu7l1PQhTyOFNnxQu94Gh1UXw=; b=xRlHCgYjb0rKTER/vmJYPaOgQNrj6OclWV6dG7jMQ/q47NivFeTVgf6Tz9GG+znRTc c9//wLfX7VUR+cdxM5bQK+H5ILwFiXEH2ENPjPXCg8V0cfzTTw5Mk71wG/GoV9Eupzja YmztPDZb4q7tkiE6EDz9kganTGSO0sf1yp26nkr3u2MmCQkQ/gKtrmaYQJ62O/qYlnbe 1BbYvSEkr7DmNXV0rDb9ZY1uexoCt2lw3+fAd84Kn9EWiimCwU6KddgkBl3JD0osZZTH EAIcB7EJTJdFCU+tVFCwH0riiu93FdwL+RDPhvYPoceeBx4Odg0al2of1y1Zs+kPZJoA N4/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=6Ojk3vXOJr7FWRbBqhnu7l1PQhTyOFNnxQu94Gh1UXw=; b=Rep95glj1lZQcKzolP8JHsj5rLd3bUgWG6aQH2fb60D0lKnJQaaNSPIlPR519aMeay Eo7aHrTBDNJO2swB/d7oQ33R0T718sLW227wNILjbw2vBX0FlxIindFQmZzP/QFOXBm/ hfD55E8e05PSAA+YxhTLbuBKVWOAc3CuuH6Di0Ix/k2jUnXURSYF++V+2o6OCz3yeeiH 1FYsQDKq1xRABqAb9ebhrLlgXEk2m8rzOpQ3TK6wtrJmK+iCWn+97WJfqN45lTaWxw/U 3HiKatchAWEuyYmG7Ey/01rD0+81cA4R/DwCH0tR1oY+GqdBdLOBvv+Pq+bS3JhI5SEp i60g== X-Gm-Message-State: APjAAAXwjO5wTMA3CMaNvqLF/gmSPObTUZXEcuiYg/fqR7NumtAUgEyC kqyeKE/I9YjA1tlFzNtTky5gBWSIE1o= X-Google-Smtp-Source: APXvYqzIoUlNNWiAxCXRLHrgM0As0Q20EudFuDlnPdLrJRmk6m0ymgVnkNpwpRSjVZO4H1WSiEwgDA== X-Received: by 2002:adf:f10a:: with SMTP id r10mr33408512wro.202.1576542736895; Mon, 16 Dec 2019 16:32:16 -0800 (PST) Received: from [10.44.128.75] ([193.117.175.106]) by smtp.gmail.com with ESMTPSA id e18sm23371357wrr.95.2019.12.16.16.32.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Dec 2019 16:32:16 -0800 (PST) Subject: Re: svn commit: r355832 - head/sys/cam To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201912170013.xBH0DLnh090458@repo.freebsd.org> From: Steven Hartland Message-ID: <135a3dcc-5e32-153d-6398-822e106bd79d@multiplay.co.uk> Date: Tue, 17 Dec 2019 00:32:15 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <201912170013.xBH0DLnh090458@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB X-Rspamd-Queue-Id: 47cJxb18zHz4XBH X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=multiplay-co-uk.20150623.gappssmtp.com header.s=20150623 header.b=xRlHCgYj; dmarc=pass (policy=none) header.from=multiplay.co.uk; spf=pass (mx1.freebsd.org: domain of steven.hartland@multiplay.co.uk designates 2a00:1450:4864:20::441 as permitted sender) smtp.mailfrom=steven.hartland@multiplay.co.uk X-Spamd-Result: default: False [-3.45 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[multiplay-co-uk.20150623.gappssmtp.com:s=20150623]; 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:2a00:1450:4000::/36:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[multiplay-co-uk.20150623.gappssmtp.com:+]; DMARC_POLICY_ALLOW(-0.50)[multiplay.co.uk,none]; 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.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-0.45)[ip: (2.37), ipnet: 2a00:1450::/32(-2.67), asn: 15169(-1.90), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 00:32:20 -0000 What if any is the impact on request ordering with this new delayed TRIM? On 17/12/2019 00:13, Warner Losh wrote: > Author: imp > Date: Tue Dec 17 00:13:21 2019 > New Revision: 355832 > URL: https://svnweb.freebsd.org/changeset/base/355832 > > Log: > Add rate limiters to TRIM. > > Add rate limiters to trims. Trims are a bit different than reads or > writes in that they can be combined, so some care needs to be taken > where we rate limit them. Additional work will be needed to push the > working rate limit below the I/O quanta rate for things like IOPS. > > Sponsored by: Netflix > > Modified: > head/sys/cam/cam_iosched.c > > Modified: head/sys/cam/cam_iosched.c > ============================================================================== > --- head/sys/cam/cam_iosched.c Tue Dec 17 00:11:48 2019 (r355831) > +++ head/sys/cam/cam_iosched.c Tue Dec 17 00:13:21 2019 (r355832) > @@ -755,7 +755,20 @@ cam_iosched_has_io(struct cam_iosched_softc *isc) > static inline bool > cam_iosched_has_more_trim(struct cam_iosched_softc *isc) > { > + struct bio *bp; > > + bp = bioq_first(&isc->trim_queue); > +#ifdef CAM_IOSCHED_DYNAMIC > + if (do_dynamic_iosched) { > + /* > + * If we're limiting trims, then defer action on trims > + * for a bit. > + */ > + if (bp == NULL || cam_iosched_limiter_caniop(&isc->trim_stats, bp) != 0) > + return false; > + } > +#endif > + > /* > * If we've set a trim_goal, then if we exceed that allow trims > * to be passed back to the driver. If we've also set a tick timeout > @@ -771,8 +784,8 @@ cam_iosched_has_more_trim(struct cam_iosched_softc *is > return false; > } > > - return !(isc->flags & CAM_IOSCHED_FLAG_TRIM_ACTIVE) && > - bioq_first(&isc->trim_queue); > + /* NB: Should perhaps have a max trim active independent of I/O limiters */ > + return !(isc->flags & CAM_IOSCHED_FLAG_TRIM_ACTIVE) && bp != NULL; > } > > #define cam_iosched_sort_queue(isc) ((isc)->sort_io_queue >= 0 ? \ > @@ -1389,10 +1402,17 @@ cam_iosched_next_trim(struct cam_iosched_softc *isc) > struct bio * > cam_iosched_get_trim(struct cam_iosched_softc *isc) > { > +#ifdef CAM_IOSCHED_DYNAMIC > + struct bio *bp; > +#endif > > if (!cam_iosched_has_more_trim(isc)) > return NULL; > #ifdef CAM_IOSCHED_DYNAMIC > + bp = bioq_first(&isc->trim_queue); > + if (bp == NULL) > + return NULL; > + > /* > * If pending read, prefer that based on current read bias setting. The > * read bias is shared for both writes and TRIMs, but on TRIMs the bias > @@ -1414,6 +1434,26 @@ cam_iosched_get_trim(struct cam_iosched_softc *isc) > */ > isc->current_read_bias = isc->read_bias; > } > + > + /* > + * See if our current limiter allows this I/O. Because we only call this > + * here, and not in next_trim, the 'bandwidth' limits for trims won't > + * work, while the iops or max queued limits will work. It's tricky > + * because we want the limits to be from the perspective of the > + * "commands sent to the device." To make iops work, we need to check > + * only here (since we want all the ops we combine to count as one). To > + * make bw limits work, we'd need to check in next_trim, but that would > + * have the effect of limiting the iops as seen from the upper layers. > + */ > + if (cam_iosched_limiter_iop(&isc->trim_stats, bp) != 0) { > + if (iosched_debug) > + printf("Can't trim because limiter says no.\n"); > + isc->trim_stats.state_flags |= IOP_RATE_LIMITED; > + return NULL; > + } > + isc->current_read_bias = isc->read_bias; > + isc->trim_stats.state_flags &= ~IOP_RATE_LIMITED; > + /* cam_iosched_next_trim below keeps proper book */ > #endif > return cam_iosched_next_trim(isc); > } From owner-svn-src-head@freebsd.org Tue Dec 17 00:43:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC7591D3496 for ; Tue, 17 Dec 2019 00:43:58 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) 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 47cKC20Dh9z4XcC for ; Tue, 17 Dec 2019 00:43:57 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wr1-x42e.google.com with SMTP id y11so9432973wrt.6 for ; Mon, 16 Dec 2019 16:43:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=jDm8P9swc3dTndiNZsXulqiaAb9O+072DRsswfSxPSI=; b=qtMfh18+r+GEvxdi4FF8PzQx7tiENbiMDxiQfS4acnWY9pD4tJNMflbmNL/YahKszR 97fY7dBzy24Fb3j3fivSf5Fepzdc0QQ7y9w9gaLaSYlywlmhL1+IUqzxYab8NYNkpgpD oc55P+SkC/wjGeokKDnDleYqRBj1rcvLEHwPg7e7HmfKs3EGWeRXi5wXUTKxcMsRYJ4F 1y3Mmnou0gTn/sRbOrAZi3K2tWWKKItpPML1FXYDdeyUqIWTaYerSWlmua/KBc3JePcx 7W3XaMP/fUInXlYQ5dH/KNiIbS6Sd/i7V0rUE3lP69guPqbZAJqx1l4q3W6MGszUmZ0B eZkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=jDm8P9swc3dTndiNZsXulqiaAb9O+072DRsswfSxPSI=; b=Q9inOkukPUJZC1WzW5aA2JSogrvTgkzTzQKlx7ek2tOYQPXmM36KWtcv/Q8k5f1AiC 63Pl/5HQzXikAYNZzO1c3Hwhue5qmgtbpSzAq6QFLPS7JdWy/GdyQNliiJPBi/j4ULAT vNJrqtwL50sBsIfjWEr/cXZ62bOLmffyHWHoHIvjq5PY4KQDdA4KobsvRQYkfx+pYdio r8bYx7Zh4YEAeGcBZVtdR1FqxcW07WgbFwahuZAEUPKFABlqLJkVUfSQdZeSxhQqi+ES kCFwaderlol7bU7phFPRXZK083QFuNbWIbeiRPCA6CfJyZOlmr/qssacwEh3Lz1m7ON8 sFJw== X-Gm-Message-State: APjAAAW4nSc4eq2Wk3pqR1KVEztvCr3NzY2EEby/pPg5tKyi3UqKJ3Zm P/MNR2vK3Ld+pI6Mfz/TwU0sSFQcLTw= X-Google-Smtp-Source: APXvYqwkuU+PMU4/Lxx8vCV6qZNvJMrLIKdYCEzKAfjMNsZn9ThkpHqGHusnKTcdRTeUB//iXAnVuw== X-Received: by 2002:a5d:6408:: with SMTP id z8mr34156721wru.122.1576543435416; Mon, 16 Dec 2019 16:43:55 -0800 (PST) Received: from [10.44.128.75] ([193.117.175.106]) by smtp.gmail.com with ESMTPSA id z11sm23825291wrt.82.2019.12.16.16.43.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Dec 2019 16:43:54 -0800 (PST) Subject: Re: svn commit: r355837 - head/sys/cam To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201912170013.xBH0DjZY090730@repo.freebsd.org> From: Steven Hartland Message-ID: <5b944742-51ff-861b-10bc-c01d67c02933@multiplay.co.uk> Date: Tue, 17 Dec 2019 00:43:54 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <201912170013.xBH0DjZY090730@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-Rspamd-Queue-Id: 47cKC20Dh9z4XcC X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=multiplay-co-uk.20150623.gappssmtp.com header.s=20150623 header.b=qtMfh18+; dmarc=pass (policy=none) header.from=multiplay.co.uk; spf=pass (mx1.freebsd.org: domain of steven.hartland@multiplay.co.uk designates 2a00:1450:4864:20::42e as permitted sender) smtp.mailfrom=steven.hartland@multiplay.co.uk X-Spamd-Result: default: False [-5.73 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[multiplay-co-uk.20150623.gappssmtp.com:s=20150623]; 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:2a00:1450:4000::/36:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[multiplay-co-uk.20150623.gappssmtp.com:+]; DMARC_POLICY_ALLOW(-0.50)[multiplay.co.uk,none]; RCVD_IN_DNSWL_NONE(0.00)[e.2.4.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:+]; IP_SCORE(-2.73)[ip: (-9.04), ipnet: 2a00:1450::/32(-2.67), asn: 15169(-1.90), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 00:43:58 -0000 Sticky keyboard there Warner? On a more serious note the fact that the controllers lie about the underlying location of data, the impact of skipping the TRIM requests can have a much more serious impact than one might think depending on the drive, so this type of optimisation can significantly harm performance instead of increasing it. This was the main reasons we sponsored the initial ZFS TRIM implementation; as drive performance go so bad with no TRIM that SSD's performed worse than HDD's. Now obviously this was some time ago, but I wouldn't be surprised if there's bad hardware / firmware like this still being produced. Given that might be a good idea to make this optional, possibly even opt in not opt out?     Regards     Steve On 17/12/2019 00:13, Warner Losh wrote: > Author: imp > Date: Tue Dec 17 00:13:45 2019 > New Revision: 355837 > URL: https://svnweb.freebsd.org/changeset/base/355837 > > Log: > Implement bio_speedup > > React to the BIO_SPEED command in the cam io scheduler by completing > as successful BIO_DELETE commands that are pending, up to the length > passed down in the BIO_SPEEDUP cmomand. The length passed down is a > hint for how much space on the drive needs to be recovered. By > completing the BIO_DELETE comomands, this allows the upper layers to > allocate and write to the blocks that were about to be trimmed. Since > FreeBSD implements TRIMSs as advisory, we can eliminliminate them and > go directly to writing. > > The biggest benefit from TRIMS coomes ffrom the drive being able t > ooptimize its free block pool inthe log run. There's little nto no > bene3efit in the shoort term. , sepeciall whn the trim is followed by > a write. Speedup lets us make this tradeoff. > > Reviewed by: kirk, kib > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D18351 > > Modified: > head/sys/cam/cam_iosched.c > > Modified: head/sys/cam/cam_iosched.c > ============================================================================== > --- head/sys/cam/cam_iosched.c Tue Dec 17 00:13:40 2019 (r355836) > +++ head/sys/cam/cam_iosched.c Tue Dec 17 00:13:45 2019 (r355837) > @@ -1534,6 +1534,41 @@ cam_iosched_queue_work(struct cam_iosched_softc *isc, > { > > /* > + * A BIO_SPEEDUP from the uppper layers means that they have a block > + * shortage. At the present, this is only sent when we're trying to > + * allocate blocks, but have a shortage before giving up. bio_length is > + * the size of their shortage. We will complete just enough BIO_DELETEs > + * in the queue to satisfy the need. If bio_length is 0, we'll complete > + * them all. This allows the scheduler to delay BIO_DELETEs to improve > + * read/write performance without worrying about the upper layers. When > + * it's possibly a problem, we respond by pretending the BIO_DELETEs > + * just worked. We can't do anything about the BIO_DELETEs in the > + * hardware, though. We have to wait for them to complete. > + */ > + if (bp->bio_cmd == BIO_SPEEDUP) { > + off_t len; > + struct bio *nbp; > + > + len = 0; > + while (bioq_first(&isc->trim_queue) && > + (bp->bio_length == 0 || len < bp->bio_length)) { > + nbp = bioq_takefirst(&isc->trim_queue); > + len += nbp->bio_length; > + nbp->bio_error = 0; > + biodone(nbp); > + } > + if (bp->bio_length > 0) { > + if (bp->bio_length > len) > + bp->bio_resid = bp->bio_length - len; > + else > + bp->bio_resid = 0; > + } > + bp->bio_error = 0; > + biodone(bp); > + return; > + } > + > + /* > * If we get a BIO_FLUSH, and we're doing delayed BIO_DELETEs then we > * set the last tick time to one less than the current ticks minus the > * delay to force the BIO_DELETEs to be presented to the client driver. > @@ -1919,8 +1954,8 @@ DB_SHOW_COMMAND(iosched, cam_iosched_db_show) > db_printf("Trim Q len %d\n", biolen(&isc->trim_queue)); > db_printf("read_bias: %d\n", isc->read_bias); > db_printf("current_read_bias: %d\n", isc->current_read_bias); > - db_printf("Trims active %d\n", isc->pend_trim); > - db_printf("Max trims active %d\n", isc->max_trim); > + db_printf("Trims active %d\n", isc->pend_trims); > + db_printf("Max trims active %d\n", isc->max_trims); > } > #endif > #endif From owner-svn-src-head@freebsd.org Tue Dec 17 00:54:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 934BE1D384C for ; Tue, 17 Dec 2019 00:54:32 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (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 47cKRC5kMhz4YbJ for ; Tue, 17 Dec 2019 00:54:31 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-il1-x12b.google.com with SMTP id t8so5554801iln.4 for ; Mon, 16 Dec 2019 16:54:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DaO6v1j+hMOKFc2lVyjN8eIBdsz79JhsMdpXPG6syJw=; b=kr8cyuyKcH9etVaP3p67q+gGMbcv/ix3qj8wV5mwP+CuPG8eIqubXKlQNLgHa3H6Qx pXByVW1xFbwSIMAJ5hXF/cqlyNbkIYGbJkXsMsN0ugD/Qp6clV8GhoaSjVPgEMsZD0lv RrFDlkxN8UX3h52x3qxmP1FIGPFpzt+QS6+zg= 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=DaO6v1j+hMOKFc2lVyjN8eIBdsz79JhsMdpXPG6syJw=; b=tksBlyZngqAUwLgVM3s1FMi4VXZdLWCGwX2FLksjNLHpQw2c4lzJs+k4arDCaqQWmL rqmINxzl702bEIgCOaSMAeoTcIP+SKMLarMhWV5PWOtquoGCuB3aJw6C/jNsaA0Xr1ZE sA98FjoizFKxXQE8M/zBPly4ovR4mu3wNOwQlChz6rLt902ur5SayYK3xHr2vQWUfScA IF1oJTBwNcWabgJGB8Fa+tuDpdH2Fnr26V6PI1zyiqI0kD6sGcZnxDKz9A0yKzoiJgUa x6npdVUBuImA8KKcKmoWqj1ybMYnm/T6UWU5V2q7j+4WrHSL8ZyNn+USaaRFc0lZL3Xo t92A== X-Gm-Message-State: APjAAAXupsTd/mg6f9oyjQbl4OqiSSH0ro9d5ISsaa3NUAfTv8FqWSFp wT/3IiHQHm9iGQIVQQdjVPbzIkdZMbqGfKZVMgC09A== X-Google-Smtp-Source: APXvYqxI5m0wQhQojmNxqzFb68ju2co086dL8F8ajiiPpGHOCtQJW9XqN1Q5l+fR40qH3gT+JFXLrbbsNDffqO63qqA= X-Received: by 2002:a92:8441:: with SMTP id l62mr1777782ild.85.1576544070396; Mon, 16 Dec 2019 16:54:30 -0800 (PST) MIME-Version: 1.0 References: <201912170013.xBH0DjZY090730@repo.freebsd.org> <5b944742-51ff-861b-10bc-c01d67c02933@multiplay.co.uk> In-Reply-To: <5b944742-51ff-861b-10bc-c01d67c02933@multiplay.co.uk> From: Kevin Bowling Date: Mon, 16 Dec 2019 17:54:19 -0700 Message-ID: Subject: Re: svn commit: r355837 - head/sys/cam To: Steven Hartland Cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 47cKRC5kMhz4YbJ X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none (invalid DKIM record) header.d=kev009.com header.s=google header.b=kr8cyuyK; dmarc=none; spf=pass (mx1.freebsd.org: domain of kevin.bowling@kev009.com designates 2607:f8b0:4864:20::12b as permitted sender) smtp.mailfrom=kevin.bowling@kev009.com X-Spamd-Result: default: False [-3.70 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[kev009.com]; URI_COUNT_ODD(1.00)[9]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[kev009.com:~]; RCVD_IN_DNSWL_NONE(0.00)[b.2.1.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_DKIM_PERMFAIL(0.00)[kev009.com:s=google]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.40)[ip: (-7.84), ipnet: 2607:f8b0::/32(-2.19), asn: 15169(-1.90), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 00:54:32 -0000 On Mon, Dec 16, 2019 at 5:44 PM Steven Hartland < steven.hartland@multiplay.co.uk> wrote: > Sticky keyboard there Warner? LOL > On a more serious note the fact that the controllers lie about the > underlying > location of data, the impact of skipping the TRIM requests can have a > much more > serious impact than one might think depending on the drive, so this type = of > optimisation can significantly harm performance instead of increasing it. > > This was the main reasons we sponsored the initial ZFS TRIM > implementation; as > drive performance go so bad with no TRIM that SSD's performed worse than > HDD's. Have you been able to test the new OpenZFS/ZoF TRIM? I notice the current FBSD one gets quite beleaguered with highly concurrent poudriere as the snapshots are being reaped, I.e TRIMs totally swamp r/w ops on the Plextor PCIe SSD I have. I haven=E2=80=99t tried ZoF on this ma= chine yet since it is my main workstation but will do so once it is ready for mainline. > Now obviously this was some time ago, but I wouldn't be surprised if > there's bad > hardware / firmware like this still being produced. > > Given that might be a good idea to make this optional, possibly even opt > in not opt > out? > > Regards > Steve > > On 17/12/2019 00:13, Warner Losh wrote: > > Author: imp > > Date: Tue Dec 17 00:13:45 2019 > > New Revision: 355837 > > URL: https://svnweb.freebsd.org/changeset/base/355837 > > > > Log: > > Implement bio_speedup > > > > React to the BIO_SPEED command in the cam io scheduler by completing > > as successful BIO_DELETE commands that are pending, up to the length > > passed down in the BIO_SPEEDUP cmomand. The length passed down is a > > hint for how much space on the drive needs to be recovered. By > > completing the BIO_DELETE comomands, this allows the upper layers to > > allocate and write to the blocks that were about to be trimmed. Sinc= e > > FreeBSD implements TRIMSs as advisory, we can eliminliminate them an= d > > go directly to writing. > > > > The biggest benefit from TRIMS coomes ffrom the drive being able t > > ooptimize its free block pool inthe log run. There's little nto no > > bene3efit in the shoort term. , sepeciall whn the trim is followed b= y > > a write. Speedup lets us make this tradeoff. > > > > Reviewed by: kirk, kib > > Sponsored by: Netflix > > Differential Revision: https://reviews.freebsd.org/D18351 > > > > Modified: > > head/sys/cam/cam_iosched.c > > > > Modified: head/sys/cam/cam_iosched.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > --- head/sys/cam/cam_iosched.c Tue Dec 17 00:13:40 2019 > (r355836) > > +++ head/sys/cam/cam_iosched.c Tue Dec 17 00:13:45 2019 > (r355837) > > @@ -1534,6 +1534,41 @@ cam_iosched_queue_work(struct cam_iosched_softc > *isc, > > { > > > > /* > > + * A BIO_SPEEDUP from the uppper layers means that they have a > block > > + * shortage. At the present, this is only sent when we're trying = to > > + * allocate blocks, but have a shortage before giving up. > bio_length is > > + * the size of their shortage. We will complete just enough > BIO_DELETEs > > + * in the queue to satisfy the need. If bio_length is 0, we'll > complete > > + * them all. This allows the scheduler to delay BIO_DELETEs to > improve > > + * read/write performance without worrying about the upper layers= . > When > > + * it's possibly a problem, we respond by pretending the > BIO_DELETEs > > + * just worked. We can't do anything about the BIO_DELETEs in the > > + * hardware, though. We have to wait for them to complete. > > + */ > > + if (bp->bio_cmd =3D=3D BIO_SPEEDUP) { > > + off_t len; > > + struct bio *nbp; > > + > > + len =3D 0; > > + while (bioq_first(&isc->trim_queue) && > > + (bp->bio_length =3D=3D 0 || len < bp->bio_length)) { > > + nbp =3D bioq_takefirst(&isc->trim_queue); > > + len +=3D nbp->bio_length; > > + nbp->bio_error =3D 0; > > + biodone(nbp); > > + } > > + if (bp->bio_length > 0) { > > + if (bp->bio_length > len) > > + bp->bio_resid =3D bp->bio_length - len; > > + else > > + bp->bio_resid =3D 0; > > + } > > + bp->bio_error =3D 0; > > + biodone(bp); > > + return; > > + } > > + > > + /* > > * If we get a BIO_FLUSH, and we're doing delayed BIO_DELETEs the= n > we > > * set the last tick time to one less than the current ticks minu= s > the > > * delay to force the BIO_DELETEs to be presented to the client > driver. > > @@ -1919,8 +1954,8 @@ DB_SHOW_COMMAND(iosched, cam_iosched_db_show) > > db_printf("Trim Q len %d\n", biolen(&isc->trim_queue)); > > db_printf("read_bias: %d\n", isc->read_bias); > > db_printf("current_read_bias: %d\n", isc->current_read_bias); > > - db_printf("Trims active %d\n", isc->pend_trim); > > - db_printf("Max trims active %d\n", isc->max_trim); > > + db_printf("Trims active %d\n", isc->pend_trims); > > + db_printf("Max trims active %d\n", isc->max_trims); > > } > > #endif > > #endif > > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Tue Dec 17 01:33:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D0A8A1D5ADD; Tue, 17 Dec 2019 01:33:26 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cLJ65Dl8z4cJY; Tue, 17 Dec 2019 01:33:26 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE80865ED; Tue, 17 Dec 2019 01:33:26 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBH1XQr7038770; Tue, 17 Dec 2019 01:33:26 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBH1XQZM038769; Tue, 17 Dec 2019 01:33:26 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201912170133.xBH1XQZM038769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 17 Dec 2019 01:33:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355838 - head/lib/libvmmapi X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/lib/libvmmapi X-SVN-Commit-Revision: 355838 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 01:33:26 -0000 Author: araujo Date: Tue Dec 17 01:33:26 2019 New Revision: 355838 URL: https://svnweb.freebsd.org/changeset/base/355838 Log: Attempt to load vmm(4) module before creating a guest using vm_create() wrapper in libvmmapi. Submitted by: Rob Fairbanks Reviewed by: jhb MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D19400 Modified: head/lib/libvmmapi/vmmapi.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Tue Dec 17 00:13:45 2019 (r355837) +++ head/lib/libvmmapi/vmmapi.c Tue Dec 17 01:33:26 2019 (r355838) @@ -34,7 +34,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include @@ -103,7 +105,11 @@ vm_device_open(const char *name) int vm_create(const char *name) { - + /* Try to load vmm(4) module before creating a guest. */ + if (modfind("vmm") < 0) { + if (modfind("vmm") < 0) + kldload("vmm"); + } return (CREATE((char *)name)); } From owner-svn-src-head@freebsd.org Tue Dec 17 01:37:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 248241D5E51; Tue, 17 Dec 2019 01:37:03 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cLNH099jz4cZh; Tue, 17 Dec 2019 01:37:03 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00E796621; Tue, 17 Dec 2019 01:37:03 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBH1b2kN038975; Tue, 17 Dec 2019 01:37:02 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBH1b2bN038974; Tue, 17 Dec 2019 01:37:02 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201912170137.xBH1b2bN038974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 17 Dec 2019 01:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355839 - head/lib/libvmmapi X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/lib/libvmmapi X-SVN-Commit-Revision: 355839 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 01:37:03 -0000 Author: araujo Date: Tue Dec 17 01:37:02 2019 New Revision: 355839 URL: https://svnweb.freebsd.org/changeset/base/355839 Log: Forgotten to remove the previous if statement in commit r355838. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D19400 Modified: head/lib/libvmmapi/vmmapi.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Tue Dec 17 01:33:26 2019 (r355838) +++ head/lib/libvmmapi/vmmapi.c Tue Dec 17 01:37:02 2019 (r355839) @@ -106,10 +106,8 @@ int vm_create(const char *name) { /* Try to load vmm(4) module before creating a guest. */ - if (modfind("vmm") < 0) { - if (modfind("vmm") < 0) - kldload("vmm"); - } + if (modfind("vmm") < 0) + kldload("vmm"); return (CREATE((char *)name)); } From owner-svn-src-head@freebsd.org Tue Dec 17 02:02:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B78BF1D71E6; Tue, 17 Dec 2019 02:02:27 +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 47cLxb4VRlz4f6b; Tue, 17 Dec 2019 02:02: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 958516BEF; Tue, 17 Dec 2019 02:02: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 xBH22Rd0055949; Tue, 17 Dec 2019 02:02:27 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBH22RZb055946; Tue, 17 Dec 2019 02:02:27 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201912170202.xBH22RZb055946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 17 Dec 2019 02:02:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355840 - in head: sys/net usr.bin/netstat X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head: sys/net usr.bin/netstat X-SVN-Commit-Revision: 355840 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 02:02:27 -0000 Author: glebius Date: Tue Dec 17 02:02:26 2019 New Revision: 355840 URL: https://svnweb.freebsd.org/changeset/base/355840 Log: Convert routing statistics to VNET_PCPUSTAT. Submitted by: ocochard Reviewed by: melifaro, glebius Differential Revision: https://reviews.freebsd.org/D22834 Modified: head/sys/net/route.c head/sys/net/route.h head/usr.bin/netstat/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Tue Dec 17 01:37:02 2019 (r355839) +++ head/sys/net/route.c Tue Dec 17 02:02:26 2019 (r355840) @@ -108,9 +108,16 @@ VNET_DEFINE(u_int, rt_add_addr_allfibs) = 1; SYSCTL_UINT(_net, OID_AUTO, add_addr_allfibs, CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(rt_add_addr_allfibs), 0, ""); -VNET_DEFINE(struct rtstat, rtstat); -#define V_rtstat VNET(rtstat) +VNET_PCPUSTAT_DEFINE_STATIC(struct rtstat, rtstat); +#define RTSTAT_ADD(name, val) \ + VNET_PCPUSTAT_ADD(struct rtstat, rtstat, name, (val)) +#define RTSTAT_INC(name) RTSTAT_ADD(name, 1) +VNET_PCPUSTAT_SYSINIT(rtstat); +#ifdef VIMAGE +VNET_PCPUSTAT_SYSUNINIT(rtstat); +#endif + VNET_DEFINE(struct rib_head *, rt_tables); #define V_rt_tables VNET(rt_tables) @@ -476,7 +483,7 @@ rtalloc1_fib(struct sockaddr *dst, int report, u_long * which basically means: "cannot get there from here". */ miss: - V_rtstat.rts_unreach++; + RTSTAT_INC(rts_unreach); if (report) { /* @@ -587,7 +594,6 @@ rtredirect_fib(struct sockaddr *dst, { struct rtentry *rt; int error = 0; - short *stat = NULL; struct rt_addrinfo info; struct ifaddr *ifa; struct rib_head *rnh; @@ -661,8 +667,8 @@ rtredirect_fib(struct sockaddr *dst, RT_LOCK(rt); flags = rt->rt_flags; } - - stat = &V_rtstat.rts_dynamic; + if (error == 0) + RTSTAT_INC(rts_dynamic); } else { /* @@ -673,7 +679,7 @@ rtredirect_fib(struct sockaddr *dst, rt->rt_flags &= ~RTF_GATEWAY; rt->rt_flags |= RTF_MODIFIED; flags |= RTF_MODIFIED; - stat = &V_rtstat.rts_newgateway; + RTSTAT_INC(rts_newgateway); /* * add the key and gateway (in one malloc'd chunk). */ @@ -690,9 +696,7 @@ done: RTFREE_LOCKED(rt); out: if (error) - V_rtstat.rts_badredirect++; - else if (stat != NULL) - (*stat)++; + RTSTAT_INC(rts_badredirect); bzero((caddr_t)&info, sizeof(info)); info.rti_info[RTAX_DST] = dst; info.rti_info[RTAX_GATEWAY] = gateway; Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Tue Dec 17 01:37:02 2019 (r355839) +++ head/sys/net/route.h Tue Dec 17 02:02:26 2019 (r355840) @@ -237,13 +237,14 @@ rt_update_ro_flags(struct route *ro) /* * Routing statistics. */ -struct rtstat { - short rts_badredirect; /* bogus redirect calls */ - short rts_dynamic; /* routes created by redirects */ - short rts_newgateway; /* routes modified by redirects */ - short rts_unreach; /* lookups which failed */ - short rts_wildcard; /* lookups satisfied by a wildcard */ +struct rtstat { + uint64_t rts_badredirect; /* bogus redirect calls */ + uint64_t rts_dynamic; /* routes created by redirects */ + uint64_t rts_newgateway; /* routes modified by redirects */ + uint64_t rts_unreach; /* lookups which failed */ + uint64_t rts_wildcard; /* lookups satisfied by a wildcard */ }; + /* * Structures for routing messages. */ Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Tue Dec 17 01:37:02 2019 (r355839) +++ head/usr.bin/netstat/route.c Tue Dec 17 02:02:26 2019 (r355840) @@ -776,22 +776,22 @@ rt_stats(void) xo_emit("{W:rttrash: symbol not in namelist}\n"); return; } - kread(rtsaddr, (char *)&rtstat, sizeof (rtstat)); + kread_counters(rtsaddr, (char *)&rtstat, sizeof (rtstat)); kread(rttaddr, (char *)&rttrash, sizeof (rttrash)); xo_emit("{T:routing}:\n"); #define p(f, m) if (rtstat.f || sflag <= 1) \ xo_emit(m, rtstat.f, plural(rtstat.f)) - p(rts_badredirect, "\t{:bad-redirects/%hu} " + p(rts_badredirect, "\t{:bad-redirects/%ju} " "{N:/bad routing redirect%s}\n"); - p(rts_dynamic, "\t{:dynamically-created/%hu} " + p(rts_dynamic, "\t{:dynamically-created/%ju} " "{N:/dynamically created route%s}\n"); - p(rts_newgateway, "\t{:new-gateways/%hu} " + p(rts_newgateway, "\t{:new-gateways/%ju} " "{N:/new gateway%s due to redirects}\n"); - p(rts_unreach, "\t{:unreachable-destination/%hu} " + p(rts_unreach, "\t{:unreachable-destination/%ju} " "{N:/destination%s found unreachable}\n"); - p(rts_wildcard, "\t{:wildcard-uses/%hu} " + p(rts_wildcard, "\t{:wildcard-uses/%ju} " "{N:/use%s of a wildcard route}\n"); #undef p From owner-svn-src-head@freebsd.org Tue Dec 17 02:17:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D41E1D7BBE for ; Tue, 17 Dec 2019 02:17:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) (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 47cMGy38K3z4fp9 for ; Tue, 17 Dec 2019 02:17:30 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x733.google.com with SMTP id c16so3288718qko.6 for ; Mon, 16 Dec 2019 18:17:30 -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=TY0mfLzoOPXrELVd80NxVe6kdVj8PAX1j5xzDtR3S3g=; b=Ju29o93hWPKp8BAqeu4VQa84+ZQKbqGBV1wSFR4rIoVEyqb1NSADRZAeLj3x0J96ou HxSHbuiUbgbU8n3J3xcU3KFfKFvF9IyvmyVMnxXEluKO82obin7WYFgeQilSXU7c70Kw jj4Y9CaK0jRfoaEAmqTXS1jJIeln6iR//L5o0S3pDYO96Z11Q9O/eOxwvAmdHVT54Zl6 6L8pqYJiLWu8elSMJRWn+C0+v9rytKqKYGZWpcZhf7lNmsiDx2F5L9w2+rakJXH1g+T4 TwXH/0eUidNkwDE04h0u6S2HBkEekhoPnR3fljJkBtURgm46OX2TscyfXozI3M6gbdeP Wyow== 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=TY0mfLzoOPXrELVd80NxVe6kdVj8PAX1j5xzDtR3S3g=; b=Oi1Hrhrvg8cuSdK+kjlFYL/lpqD+jYi3j3FSI6scautvzwWBMHqxOGxjVLbF4E80bn jAOT8lEuUFwrHTtlaaewP0xfGa3BZYu377jIFxB+qhwnWmBxAQFQHOvW5k3vEUqkEeKq am4/My8PhuS4VtUUK8/7K257DJ/SYhL+06rH9/Tl7DbWnlETUQQ1iGgc2ESjVixAMEfx GpHonfXhrttORZmdGkSNxAup41r8lpnHxoOziHX2SseOF6vS/MfWlOa7f3v/lOHmyVYT 40tdRo7HRPI8aJREunw8xYG3mBrbx9pCtbmFqWP3wrbGCSKF2eSZJHsHHspp0YH40Lhl uBrg== X-Gm-Message-State: APjAAAW94rcg2Faqh+dzugPQZK2PdA4g7TCE+RbMe7UB5rZLcsgXu+Xa U9l+eJMzqvzCSOY2r44SVJgZs9HUGP3dEVi6IAeLpw== X-Google-Smtp-Source: APXvYqw0/dtls9EKwsh4zqr15giUfElvfEH9Gm1q7xVf7//R9VXWj/5YmNiCNMUjltve6luKoUo7+/fqIm1peGpP8eE= X-Received: by 2002:a05:620a:94f:: with SMTP id w15mr2655229qkw.380.1576549049108; Mon, 16 Dec 2019 18:17:29 -0800 (PST) MIME-Version: 1.0 References: <201912170013.xBH0DLnh090458@repo.freebsd.org> <135a3dcc-5e32-153d-6398-822e106bd79d@multiplay.co.uk> In-Reply-To: <135a3dcc-5e32-153d-6398-822e106bd79d@multiplay.co.uk> From: Warner Losh Date: Mon, 16 Dec 2019 19:17:10 -0700 Message-ID: Subject: Re: svn commit: r355832 - head/sys/cam To: Steven Hartland Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 47cMGy38K3z4fp9 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=Ju29o93h; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::733) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.67 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; 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-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[3]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[3.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]; 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.67)[ip: (-9.22), ipnet: 2607:f8b0::/32(-2.19), asn: 15169(-1.90), 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 02:17:31 -0000 The order is relaxed. Nothing in the system depends on ordering wrt BIO_DELETE requests. Apart from flushes, and one softdep thing in UFS, nothing does ordered writes. In a multithreaded world they don't really make sense because multiple upper layer consumers race each other to submit requests anyway... Warner On Mon, Dec 16, 2019, 5:32 PM Steven Hartland < steven.hartland@multiplay.co.uk> wrote: > What if any is the impact on request ordering with this new delayed TRIM? > > On 17/12/2019 00:13, Warner Losh wrote: > > Author: imp > > Date: Tue Dec 17 00:13:21 2019 > > New Revision: 355832 > > URL: https://svnweb.freebsd.org/changeset/base/355832 > > > > Log: > > Add rate limiters to TRIM. > > > > Add rate limiters to trims. Trims are a bit different than reads or > > writes in that they can be combined, so some care needs to be taken > > where we rate limit them. Additional work will be needed to push the > > working rate limit below the I/O quanta rate for things like IOPS. > > > > Sponsored by: Netflix > > > > Modified: > > head/sys/cam/cam_iosched.c > > > > Modified: head/sys/cam/cam_iosched.c > > > ============================================================================== > > --- head/sys/cam/cam_iosched.c Tue Dec 17 00:11:48 2019 > (r355831) > > +++ head/sys/cam/cam_iosched.c Tue Dec 17 00:13:21 2019 > (r355832) > > @@ -755,7 +755,20 @@ cam_iosched_has_io(struct cam_iosched_softc *isc) > > static inline bool > > cam_iosched_has_more_trim(struct cam_iosched_softc *isc) > > { > > + struct bio *bp; > > > > + bp = bioq_first(&isc->trim_queue); > > +#ifdef CAM_IOSCHED_DYNAMIC > > + if (do_dynamic_iosched) { > > + /* > > + * If we're limiting trims, then defer action on trims > > + * for a bit. > > + */ > > + if (bp == NULL || > cam_iosched_limiter_caniop(&isc->trim_stats, bp) != 0) > > + return false; > > + } > > +#endif > > + > > /* > > * If we've set a trim_goal, then if we exceed that allow trims > > * to be passed back to the driver. If we've also set a tick > timeout > > @@ -771,8 +784,8 @@ cam_iosched_has_more_trim(struct cam_iosched_softc > *is > > return false; > > } > > > > - return !(isc->flags & CAM_IOSCHED_FLAG_TRIM_ACTIVE) && > > - bioq_first(&isc->trim_queue); > > + /* NB: Should perhaps have a max trim active independent of I/O > limiters */ > > + return !(isc->flags & CAM_IOSCHED_FLAG_TRIM_ACTIVE) && bp != NULL; > > } > > > > #define cam_iosched_sort_queue(isc) ((isc)->sort_io_queue >= 0 ? \ > > @@ -1389,10 +1402,17 @@ cam_iosched_next_trim(struct cam_iosched_softc > *isc) > > struct bio * > > cam_iosched_get_trim(struct cam_iosched_softc *isc) > > { > > +#ifdef CAM_IOSCHED_DYNAMIC > > + struct bio *bp; > > +#endif > > > > if (!cam_iosched_has_more_trim(isc)) > > return NULL; > > #ifdef CAM_IOSCHED_DYNAMIC > > + bp = bioq_first(&isc->trim_queue); > > + if (bp == NULL) > > + return NULL; > > + > > /* > > * If pending read, prefer that based on current read bias > setting. The > > * read bias is shared for both writes and TRIMs, but on TRIMs the > bias > > @@ -1414,6 +1434,26 @@ cam_iosched_get_trim(struct cam_iosched_softc > *isc) > > */ > > isc->current_read_bias = isc->read_bias; > > } > > + > > + /* > > + * See if our current limiter allows this I/O. Because we only > call this > > + * here, and not in next_trim, the 'bandwidth' limits for trims > won't > > + * work, while the iops or max queued limits will work. It's tricky > > + * because we want the limits to be from the perspective of the > > + * "commands sent to the device." To make iops work, we need to > check > > + * only here (since we want all the ops we combine to count as > one). To > > + * make bw limits work, we'd need to check in next_trim, but that > would > > + * have the effect of limiting the iops as seen from the upper > layers. > > + */ > > + if (cam_iosched_limiter_iop(&isc->trim_stats, bp) != 0) { > > + if (iosched_debug) > > + printf("Can't trim because limiter says no.\n"); > > + isc->trim_stats.state_flags |= IOP_RATE_LIMITED; > > + return NULL; > > + } > > + isc->current_read_bias = isc->read_bias; > > + isc->trim_stats.state_flags &= ~IOP_RATE_LIMITED; > > + /* cam_iosched_next_trim below keeps proper book */ > > #endif > > return cam_iosched_next_trim(isc); > > } > > From owner-svn-src-head@freebsd.org Tue Dec 17 02:53:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D7C91D8DAA for ; Tue, 17 Dec 2019 02:53:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) (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 47cN4R4GqRz3CxF for ; Tue, 17 Dec 2019 02:53:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf2e.google.com with SMTP id o18so3629117qvf.1 for ; Mon, 16 Dec 2019 18:53:27 -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=auxWG4zOX89zBsVORtjijiDwKXg+AuDHwJO7eT79kWk=; b=wswElnWQJWlVjSUUwcps2+dbNyrc51CalCFAzdfODm9zSfIqI32kQdXS+6ExYX5zGH jgBEnFXa5aLagd5xh8tD4AxyGVeNVOFQ4gBn4qQ6Z/aLBm82BnHMT4AJi7VgQmaZ/Rsb GSdlottWSoObj8o9twY72reLGuNnAWtjSbJ9IobjGrhP4+/BCcIP9C7Fj68DnVcxReL1 NMeMC97UUupTHzw3WEzvd//WnNPoE7ekxOVUepVooFnQtpSiozGHzs3Dqj1qaxzreQmo awn8bdOrYtBPqSQMJC7M+FOpkIXmb4X72K6OKDZ2boJzfNOaUyAFR/2sKz9juh48EPIt n29g== 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=auxWG4zOX89zBsVORtjijiDwKXg+AuDHwJO7eT79kWk=; b=aaEioVT4mTPUW14+9db0hejlpQDOTM+ewybrPKPH74qDBirAJjsx+Te5h8uaiDi8Uo OX8gB/DlXkfJYwWgyT3fRsB1y8sDLB0rakPFcdtEI0+vFA1RNkm7zu7w6sw6Un8la2in m7D1i+42hPHi68pAEfPEefFXQEBN7At65xN+BRVGUstkm5ga9Hau6VL81ytZE0u37TjC UEIYADFGd5zbIPFzXKOClBoefkTYJz/4Bc4MehxrsU9TM5Fq0QGM0uWbKW9kOZ2N2CcT naX5KQ8h0RVR93x8OJAVLxmkpAyBvEoIOHXJZJ7Ym6pgWmkU3h36MxgIztT0QewQ9KE8 zUkg== X-Gm-Message-State: APjAAAW76GapgCkquZRv8SBre8PdCvABYDi1fDoGYU24JGMgOo63dlAJ aatzVZdTbb1731kWloJAhFuKTGyV6/1PvrVTlEq7QA== X-Google-Smtp-Source: APXvYqyG+Kx/qGBLVOWLr5rTN/7/PWVvV3oo0Q4GYm4BVp9QTekB7f0dWUV9E6tHVqpO9UAPS7edRuOtTGhJ2fPDiX0= X-Received: by 2002:a0c:e74d:: with SMTP id g13mr2589781qvn.125.1576551201415; Mon, 16 Dec 2019 18:53:21 -0800 (PST) MIME-Version: 1.0 References: <201912170011.xBH0Bm5I088826@repo.freebsd.org> <4c5ce3c8-d074-f907-af03-20f4752f428c@multiplay.co.uk> In-Reply-To: <4c5ce3c8-d074-f907-af03-20f4752f428c@multiplay.co.uk> From: Warner Losh Date: Mon, 16 Dec 2019 19:53:10 -0700 Message-ID: Subject: Re: svn commit: r355831 - head/sys/cam/nvme To: Steven Hartland Cc: Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 47cN4R4GqRz3CxF X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=wswElnWQ; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::f2e) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-1.83 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[3]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-0.83)[ipnet: 2607:f8b0::/32(-2.19), asn: 15169(-1.90), 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 02:53:28 -0000 On Mon, Dec 16, 2019, 5:28 PM Steven Hartland < steven.hartland@multiplay.co.uk> wrote: > Be aware that ZFS already does a pretty decent job of this already, so > the statement > about upper layers isn't true for all. It even has different priorities > for different request > types so I'm a little concerned that doing it at both layers could cause > issues. > ZFS' BIO_DELETE scheduling works well for enterprise drives, but needs tuning the further away you get from enterprise performance. I don't anticipate any effect on performance here since this is not enabled by default, unless I've messed something up (and if I have screwed this up, please let me know). I've honestly not tried to enable these things on ZFS. In addition to this if its anything like SSD's numbers of requests are > only a small part > of the story with total trim size being the other one. I this case you > could hit total > desired size with just one BIO_DELETE request. > > With this code what's the impact of this? > You're correct. It tends to be the number of segments and/or the size of the segment. This steers cases where the number of segments dominates. For cases where total size dominates, you're often better off using the I/O scheduler to rate limit the size of the trims. This feature is designed to allow a large number of files to be deleted at once while doing the trims from them a little at a time to even the load out. Warner > On 17/12/2019 00:11, Warner Losh wrote: > > Author: imp > > Date: Tue Dec 17 00:11:48 2019 > > New Revision: 355831 > > URL: https://svnweb.freebsd.org/changeset/base/355831 > > > > Log: > > NVME trim stuff. > > > > Add two sysctls to control pacing of nvme > > trims. kern.cam.nda.X.goal_trim is the number of upper layer > > BIO_DEELETE requests to try to collecet before sending TRIM down too > > the nvme drive. trim_ticks is the number of ticks, at mosot, to wait > > for at least goal_trim BIOS_DELEETE requests to come in. > > > > Trim pacing is useful when a large number off disjoint trims are > > comoing in from the upper layers. Since we have no way to chain > > toogether trims from the upper layers that are sent down, this acts as > > a hueristic to group trims into reasonable sized chunks. What's > > reasonable varies from drive to drive. > > > > Sponsored by: Netflix > > > > Modified: > > head/sys/cam/nvme/nvme_da.c > > > > Modified: head/sys/cam/nvme/nvme_da.c > > > ============================================================================== > > --- head/sys/cam/nvme/nvme_da.c Tue Dec 17 00:10:19 2019 > (r355830) > > +++ head/sys/cam/nvme/nvme_da.c Tue Dec 17 00:11:48 2019 > (r355831) > > @@ -177,6 +177,14 @@ static int nda_max_trim_entries = > NDA_MAX_TRIM_ENTRIES > > SYSCTL_INT(_kern_cam_nda, OID_AUTO, max_trim, CTLFLAG_RDTUN, > > &nda_max_trim_entries, NDA_MAX_TRIM_ENTRIES, > > "Maximum number of BIO_DELETE to send down as a DSM TRIM."); > > +static int nda_goal_trim_entries = NDA_MAX_TRIM_ENTRIES / 2; > > +SYSCTL_INT(_kern_cam_nda, OID_AUTO, goal_trim, CTLFLAG_RDTUN, > > + &nda_goal_trim_entries, NDA_MAX_TRIM_ENTRIES / 2, > > + "Number of BIO_DELETE to try to accumulate before sending a DSM > TRIM."); > > +static int nda_trim_ticks = 50; /* 50ms ~ 1000 Hz */ > > +SYSCTL_INT(_kern_cam_nda, OID_AUTO, trim_ticks, CTLFLAG_RDTUN, > > + &nda_trim_ticks, 50, > > + "Number of ticks to hold BIO_DELETEs before sending down a trim"); > > > > /* > > * All NVMe media is non-rotational, so all nvme device instances > > @@ -741,6 +749,9 @@ ndaregister(struct cam_periph *periph, void *arg) > > free(softc, M_DEVBUF); > > return(CAM_REQ_CMP_ERR); > > } > > + /* Statically set these for the moment */ > > + cam_iosched_set_trim_goal(softc->cam_iosched, > nda_goal_trim_entries); > > + cam_iosched_set_trim_ticks(softc->cam_iosched, nda_trim_ticks); > > > > /* ident_data parsing */ > > > > From owner-svn-src-head@freebsd.org Tue Dec 17 03:06:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 674DC1D941B for ; Tue, 17 Dec 2019 03:06:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cNMy3zW5z3Dml for ; Tue, 17 Dec 2019 03:06:54 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72a.google.com with SMTP id d71so5261565qkc.0 for ; Mon, 16 Dec 2019 19:06:54 -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=66RSl90IplwnNOioQ0VhqMf2arE1UBZ7qqL6yCbQUVE=; b=I+ja5MiQaxhzqdF/dpyGRSUYGgtDZtcBBxkwGf4IjNYIHq6XhysRHEXV7A98NYzDKY VWve/BcDrt2bJtadlp27bc6MLtSNxNJpEsBTlPZ00hErPX7zcZH6HaOs2gh1OsMmZW+S QO/iXCMJsty+rkhfoPIx6mCQfsB1533qi4j2n5NgnNW5JGhVNO0ErBX1ASb285fDVsIV kArmKaGYIsYYjufee63Q0tvFQVsl/BEar7N//kGsr2TGaMZegMpZyQr9BS/m++dZ6TIV soPKymkuHCxha+oNIOc5/bk5oiksbztDpxdbuUWAz6/+mR3zHxov+C0/wDz8DUYZ16p5 D/fQ== 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=66RSl90IplwnNOioQ0VhqMf2arE1UBZ7qqL6yCbQUVE=; b=tqtl4fUB5e9hPmxisoqlJL+df4W9+i7g7UckEcsXsLes2HpHF1HIN1Tg6XLqYtOR85 gHhqKuNU0aViFMxl9a4h9xWsZPHb6cr/7p9+b4ZnM9q3geG6Gpt+QwO6/nAKV/75vEkj FDz+660WsvXYUDIDCrNBzjh4CIBBmUAsdtJDDspWCZk2sNHwO/yJNN6IPa5ImXHnuRNA gplHvgbDDVdnpbhbIMEDoB4u5kRDzfocm2pnLTxYhK20RokeF7FZEYWZBs+gN40fRTEA QmNZdlgnevO9kdVsK3r/fzbxefEoOM980SzF/Wfpu0MOjKc+BImG/yN4GD684KpcDf3G Ir1w== X-Gm-Message-State: APjAAAURwhHtemKSLDmUE9eArtJdc5/oYMXaF2yiBH+dwpxAGnBXoeo7 0tjRyniNugcSu0JotbLC2S89cjpe83BNKaZ1MfNJFw== X-Google-Smtp-Source: APXvYqz+PF/Tzv73JKb8Seuynk1n77CzJCjsTPo2XtIkZGATUMJ7k6SYTVD4oqI2XydqCOGm8iXF1hyvLF5eEvDk6UU= X-Received: by 2002:a37:52d5:: with SMTP id g204mr2908336qkb.215.1576552013174; Mon, 16 Dec 2019 19:06:53 -0800 (PST) MIME-Version: 1.0 References: <201912170013.xBH0DjZY090730@repo.freebsd.org> <5b944742-51ff-861b-10bc-c01d67c02933@multiplay.co.uk> In-Reply-To: <5b944742-51ff-861b-10bc-c01d67c02933@multiplay.co.uk> From: Warner Losh Date: Mon, 16 Dec 2019 20:06:42 -0700 Message-ID: Subject: Re: svn commit: r355837 - head/sys/cam To: Steven Hartland Cc: Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 47cNMy3zW5z3Dml X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=I+ja5MiQ; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::72a) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-4.69 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[a.2.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]; 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.69)[ip: (-9.30), ipnet: 2607:f8b0::/32(-2.19), asn: 15169(-1.90), 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 03:06:55 -0000 On Mon, Dec 16, 2019 at 5:43 PM Steven Hartland < steven.hartland@multiplay.co.uk> wrote: > Sticky keyboard there Warner? > Yea. I thought I'd fixed all those messages. > On a more serious note the fact that the controllers lie about the > underlying > location of data, the impact of skipping the TRIM requests can have a > much more > serious impact than one might think depending on the drive, so this type of > optimisation can significantly harm performance instead of increasing it. > The underlying location of an LBA is never fixed. There's always a intermediate layer that does the mapping so you can get good performance writing to the drive in chunks smaller than the erase block. A trim followed quickly by a write is nearly the same as just doing the write. In the cases where we have a severe shortage, we'll skip the trim to a block that's likely to be written to shortly anyway. It's only done when there's a shortage, and it only affects the trims that we've not yet scheduled. > This was the main reasons we sponsored the initial ZFS TRIM > implementation; as > drive performance go so bad with no TRIM that SSD's performed worse than > HDD's. > Yes. You can't omit trims generally, but when the choice is to freeze all the other I/O in the system and do every single trim, or skip a few trims to allow the I/O to flow more quickly, this is an obvious tradeoff. The reason you want to generally do trim is to keep the write amp on the drive down. Skipping it occasionally, especially for blocks that will soon be written, is fine. It won't materially affect the write amp. Turning it off completely will affect the write amp terribly, on some drive, as you discovered as the underlying nand pool of blocks get fragmented. Now obviously this was some time ago, but I wouldn't be surprised if > there's bad > hardware / firmware like this still being produced. > I've never encountered firmware so bad that this would cause it any trouble, despite encountering a lot of bad firmware out there... DSM TRIMs are optional, and nothing requires that they be done. If you do the overwhelming majority but fail to do so for a few trims, the drive will still behave decently even with really bad firmware and garbage collection routines. > Given that might be a good idea to make this optional, possibly even opt > in not opt > out? > It's 100% off if you don't use the I/O scheduler with option IOSCHED. Since the cam io scheduler can delay I/O, this helps when there's a severe resource shortage in the system (which happens somewhat infrequently). As such, I viewed it as part of IOSCHED and not something needing a knob to turn off separately. I had a hard time triggering the shortages that would exercise the speedup path, and the code review moved the speedup code to an even less frequent location. Warner > Regards > Steve > > On 17/12/2019 00:13, Warner Losh wrote: > > Author: imp > > Date: Tue Dec 17 00:13:45 2019 > > New Revision: 355837 > > URL: https://svnweb.freebsd.org/changeset/base/355837 > > > > Log: > > Implement bio_speedup > > > > React to the BIO_SPEED command in the cam io scheduler by completing > > as successful BIO_DELETE commands that are pending, up to the length > > passed down in the BIO_SPEEDUP cmomand. The length passed down is a > > hint for how much space on the drive needs to be recovered. By > > completing the BIO_DELETE comomands, this allows the upper layers to > > allocate and write to the blocks that were about to be trimmed. Since > > FreeBSD implements TRIMSs as advisory, we can eliminliminate them and > > go directly to writing. > > > > The biggest benefit from TRIMS coomes ffrom the drive being able t > > ooptimize its free block pool inthe log run. There's little nto no > > bene3efit in the shoort term. , sepeciall whn the trim is followed by > > a write. Speedup lets us make this tradeoff. > > > > Reviewed by: kirk, kib > > Sponsored by: Netflix > > Differential Revision: https://reviews.freebsd.org/D18351 > > > > Modified: > > head/sys/cam/cam_iosched.c > > > > Modified: head/sys/cam/cam_iosched.c > > > ============================================================================== > > --- head/sys/cam/cam_iosched.c Tue Dec 17 00:13:40 2019 > (r355836) > > +++ head/sys/cam/cam_iosched.c Tue Dec 17 00:13:45 2019 > (r355837) > > @@ -1534,6 +1534,41 @@ cam_iosched_queue_work(struct cam_iosched_softc > *isc, > > { > > > > /* > > + * A BIO_SPEEDUP from the uppper layers means that they have a > block > > + * shortage. At the present, this is only sent when we're trying to > > + * allocate blocks, but have a shortage before giving up. > bio_length is > > + * the size of their shortage. We will complete just enough > BIO_DELETEs > > + * in the queue to satisfy the need. If bio_length is 0, we'll > complete > > + * them all. This allows the scheduler to delay BIO_DELETEs to > improve > > + * read/write performance without worrying about the upper layers. > When > > + * it's possibly a problem, we respond by pretending the > BIO_DELETEs > > + * just worked. We can't do anything about the BIO_DELETEs in the > > + * hardware, though. We have to wait for them to complete. > > + */ > > + if (bp->bio_cmd == BIO_SPEEDUP) { > > + off_t len; > > + struct bio *nbp; > > + > > + len = 0; > > + while (bioq_first(&isc->trim_queue) && > > + (bp->bio_length == 0 || len < bp->bio_length)) { > > + nbp = bioq_takefirst(&isc->trim_queue); > > + len += nbp->bio_length; > > + nbp->bio_error = 0; > > + biodone(nbp); > > + } > > + if (bp->bio_length > 0) { > > + if (bp->bio_length > len) > > + bp->bio_resid = bp->bio_length - len; > > + else > > + bp->bio_resid = 0; > > + } > > + bp->bio_error = 0; > > + biodone(bp); > > + return; > > + } > > + > > + /* > > * If we get a BIO_FLUSH, and we're doing delayed BIO_DELETEs then > we > > * set the last tick time to one less than the current ticks minus > the > > * delay to force the BIO_DELETEs to be presented to the client > driver. > > @@ -1919,8 +1954,8 @@ DB_SHOW_COMMAND(iosched, cam_iosched_db_show) > > db_printf("Trim Q len %d\n", biolen(&isc->trim_queue)); > > db_printf("read_bias: %d\n", isc->read_bias); > > db_printf("current_read_bias: %d\n", isc->current_read_bias); > > - db_printf("Trims active %d\n", isc->pend_trim); > > - db_printf("Max trims active %d\n", isc->max_trim); > > + db_printf("Trims active %d\n", isc->pend_trims); > > + db_printf("Max trims active %d\n", isc->max_trims); > > } > > #endif > > #endif > > From owner-svn-src-head@freebsd.org Tue Dec 17 03:13:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 14F611D97C5 for ; Tue, 17 Dec 2019 03:13:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cNWB15ZSz3FFp for ; Tue, 17 Dec 2019 03:13:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x832.google.com with SMTP id l12so7594884qtq.12 for ; Mon, 16 Dec 2019 19:13:10 -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=i/BKBrF5PhTZF4Xqvh7YgLqsbqD1n1JcNvwJ52VuORY=; b=N2lcW/vJanuzV3Q7uMB3IePpT7rdnFvqi/hmaUZr1ik19Hr/hixJZNkVpaXowJh3TH 2Qx5uLFwX69ST+EsVi0IucH/RP3pd+mq7vB2/tOyPPj0u/RO26Ortw1/1v/GDlpW8AMI OF87wrIvKWbVRjFABxPik0dEbGYt1CtRZ3xzlsVqxWW2AZ+e1aKqFRtWDEA2oLejvBRd lmd36yC6CBE3djip50yNYyRYBUrtZ02AkQP8kVVwXfjAZCjdvM/OsN5VJLrpn5AYKUUY KPKsUf7cUUYQB3kAMroSMhFTFF01l1FiPlGpWCdxbDScq4AbPnecxNp/UX+4akVgkdfZ Jv6w== 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=i/BKBrF5PhTZF4Xqvh7YgLqsbqD1n1JcNvwJ52VuORY=; b=HVc0VDjO2nGTGym/W3jK0Nz0ovQUpnHEqLSvnzLwqtDJ/pSNZ9mKtZsUsb/ZlLFiUR Cq9XHwCp7K2iuKvEQtln+ibdz+klQMJvJJy+RUIpsGGNMUQyC9AJkxKMotPt0LTEKMPQ LLyOO0jSDwXxHp1GRUTgVWLU4k01C6X3dqL3N5ApFbCNG7nW01pfNGg3TR+dryb2vaWn ujmXalr3yaPFjyPUMRwjSOTop2CeT2ZewwM2mTBHZSSH5WXwZXRoMsirGsKXYdiyxuJZ mIKZ7+aWXJdBcUG+yytKsz/N3YonAncRSrEyQtPvw6/XEGrLfEPAW/IwA9EQvJiu+x1u JiVg== X-Gm-Message-State: APjAAAWZSUcbXWyK7SFEjm46GwG9sV1HCRi4wDUMZDUcSur4oLQIUDhw GmHEM5wKTSY9kqWJ9BnpZvAFbAamOALVXgsAOJNYyw== X-Google-Smtp-Source: APXvYqwxUfHopNoUtCs8wtC9dcCVpsk8H4z7dcKrx7Ou2QSQQSmCj+OCScn9Vhz19ScOLq0Jm7bEDtNMu2xie115ptU= X-Received: by 2002:ac8:68c:: with SMTP id f12mr2511839qth.187.1576552389104; Mon, 16 Dec 2019 19:13:09 -0800 (PST) MIME-Version: 1.0 References: <201912170013.xBH0DjZY090730@repo.freebsd.org> <5b944742-51ff-861b-10bc-c01d67c02933@multiplay.co.uk> In-Reply-To: From: Warner Losh Date: Mon, 16 Dec 2019 20:12:58 -0700 Message-ID: Subject: Re: svn commit: r355837 - head/sys/cam To: Kevin Bowling Cc: Steven Hartland , Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 47cNWB15ZSz3FFp X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=N2lcW/vJ; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::832) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.70 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[9]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[2.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.70)[ip: (-9.35), ipnet: 2607:f8b0::/32(-2.19), asn: 15169(-1.90), 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" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 03:13:11 -0000 On Mon, Dec 16, 2019 at 5:54 PM Kevin Bowling wrote: > > > On Mon, Dec 16, 2019 at 5:44 PM Steven Hartland < > steven.hartland@multiplay.co.uk> wrote: > >> Sticky keyboard there Warner? > > > LOL > Yea. I have a mac with a keyboard with a stuck delete key. I tried to edit the commit message on a flight to california last week. It screwed up a few of the commit messages so I quit for the night. I fixed all the others, but missed this one :(. On a more serious note the fact that the controllers lie about the >> underlying >> location of data, the impact of skipping the TRIM requests can have a >> much more >> serious impact than one might think depending on the drive, so this type >> of >> optimisation can significantly harm performance instead of increasing it= . >> >> This was the main reasons we sponsored the initial ZFS TRIM >> implementation; as >> drive performance go so bad with no TRIM that SSD's performed worse than >> HDD's. > > > Have you been able to test the new OpenZFS/ZoF TRIM? > > I notice the current FBSD one gets quite beleaguered with highly > concurrent poudriere as the snapshots are being reaped, I.e TRIMs totally > swamp r/w ops on the Plextor PCIe SSD I have. I haven=E2=80=99t tried Zo= F on this > machine yet since it is my main workstation but will do so once it is rea= dy > for mainline. > Trims totally swamping r/w ops is why I started this work in the first place. I'd wager that the new ZoF TRIM code may not be as well tuned as FreeBSD and/or makes performance assumptions that are unwise in practice. I've not looked at it to know, but I suspect it is combining adjacent trims less. If you are using nvd it will shot gun all requests into the device's queue, which on less than high end enterprise drives can lead to issues like you described... I'm willing to help people characterize what's going on, but I won't have time to look into this until sometime in January. In general, at least for the drives we use, fewer trims that are larger work a lot better. Also, biasing your I/O selection towards reads by some factor helps mitigate the trim factor a bit, though they can still swamp if there's no reads for a short while to keep the trims at bay (which is why I wrote the pacing code). Warner > >> Now obviously this was some time ago, but I wouldn't be surprised if >> there's bad >> hardware / firmware like this still being produced. >> >> Given that might be a good idea to make this optional, possibly even opt >> in not opt >> out? >> >> Regards >> Steve >> >> On 17/12/2019 00:13, Warner Losh wrote: >> > Author: imp >> > Date: Tue Dec 17 00:13:45 2019 >> > New Revision: 355837 >> > URL: https://svnweb.freebsd.org/changeset/base/355837 >> > >> > Log: >> > Implement bio_speedup >> > >> > React to the BIO_SPEED command in the cam io scheduler by completin= g >> > as successful BIO_DELETE commands that are pending, up to the lengt= h >> > passed down in the BIO_SPEEDUP cmomand. The length passed down is a >> > hint for how much space on the drive needs to be recovered. By >> > completing the BIO_DELETE comomands, this allows the upper layers t= o >> > allocate and write to the blocks that were about to be trimmed. Sin= ce >> > FreeBSD implements TRIMSs as advisory, we can eliminliminate them a= nd >> > go directly to writing. >> > >> > The biggest benefit from TRIMS coomes ffrom the drive being able t >> > ooptimize its free block pool inthe log run. There's little nto no >> > bene3efit in the shoort term. , sepeciall whn the trim is followed = by >> > a write. Speedup lets us make this tradeoff. >> > >> > Reviewed by: kirk, kib >> > Sponsored by: Netflix >> > Differential Revision: https://reviews.freebsd.org/D18351 >> > >> > Modified: >> > head/sys/cam/cam_iosched.c >> > >> > Modified: head/sys/cam/cam_iosched.c >> > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> > --- head/sys/cam/cam_iosched.c Tue Dec 17 00:13:40 2019 >> (r355836) >> > +++ head/sys/cam/cam_iosched.c Tue Dec 17 00:13:45 2019 >> (r355837) >> > @@ -1534,6 +1534,41 @@ cam_iosched_queue_work(struct cam_iosched_softc >> *isc, >> > { >> > >> > /* >> > + * A BIO_SPEEDUP from the uppper layers means that they have a >> block >> > + * shortage. At the present, this is only sent when we're trying >> to >> > + * allocate blocks, but have a shortage before giving up. >> bio_length is >> > + * the size of their shortage. We will complete just enough >> BIO_DELETEs >> > + * in the queue to satisfy the need. If bio_length is 0, we'll >> complete >> > + * them all. This allows the scheduler to delay BIO_DELETEs to >> improve >> > + * read/write performance without worrying about the upper >> layers. When >> > + * it's possibly a problem, we respond by pretending the >> BIO_DELETEs >> > + * just worked. We can't do anything about the BIO_DELETEs in th= e >> > + * hardware, though. We have to wait for them to complete. >> > + */ >> > + if (bp->bio_cmd =3D=3D BIO_SPEEDUP) { >> > + off_t len; >> > + struct bio *nbp; >> > + >> > + len =3D 0; >> > + while (bioq_first(&isc->trim_queue) && >> > + (bp->bio_length =3D=3D 0 || len < bp->bio_length)) { >> > + nbp =3D bioq_takefirst(&isc->trim_queue); >> > + len +=3D nbp->bio_length; >> > + nbp->bio_error =3D 0; >> > + biodone(nbp); >> > + } >> > + if (bp->bio_length > 0) { >> > + if (bp->bio_length > len) >> > + bp->bio_resid =3D bp->bio_length - len; >> > + else >> > + bp->bio_resid =3D 0; >> > + } >> > + bp->bio_error =3D 0; >> > + biodone(bp); >> > + return; >> > + } >> > + >> > + /* >> > * If we get a BIO_FLUSH, and we're doing delayed BIO_DELETEs >> then we >> > * set the last tick time to one less than the current ticks >> minus the >> > * delay to force the BIO_DELETEs to be presented to the client >> driver. >> > @@ -1919,8 +1954,8 @@ DB_SHOW_COMMAND(iosched, cam_iosched_db_show) >> > db_printf("Trim Q len %d\n", biolen(&isc->trim_queue)); >> > db_printf("read_bias: %d\n", isc->read_bias); >> > db_printf("current_read_bias: %d\n", isc->current_read_bias); >> > - db_printf("Trims active %d\n", isc->pend_trim); >> > - db_printf("Max trims active %d\n", isc->max_trim); >> > + db_printf("Trims active %d\n", isc->pend_trims); >> > + db_printf("Max trims active %d\n", isc->max_trims); >> > } >> > #endif >> > #endif >> >> _______________________________________________ >> svn-src-head@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-head >> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" >> > From owner-svn-src-head@freebsd.org Tue Dec 17 03:20:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E7991D9B14; Tue, 17 Dec 2019 03:20:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cNgp2nwCz3FhJ; Tue, 17 Dec 2019 03:20:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B49B7982; Tue, 17 Dec 2019 03:20:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBH3Kcds098484; Tue, 17 Dec 2019 03:20:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBH3KcU5098483; Tue, 17 Dec 2019 03:20:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912170320.xBH3KcU5098483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 Dec 2019 03:20:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355841 - head/sys/mips/include X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/mips/include X-SVN-Commit-Revision: 355841 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 03:20:38 -0000 Author: imp Date: Tue Dec 17 03:20:37 2019 New Revision: 355841 URL: https://svnweb.freebsd.org/changeset/base/355841 Log: Two minor issues: (1) Don't define load/store 64 atomics for o32. They aren't atomic there. (2) Add comment about why we need 64 atomic define on n32 only. Modified: head/sys/mips/include/atomic.h Modified: head/sys/mips/include/atomic.h ============================================================================== --- head/sys/mips/include/atomic.h Tue Dec 17 02:02:26 2019 (r355840) +++ head/sys/mips/include/atomic.h Tue Dec 17 03:20:37 2019 (r355841) @@ -345,10 +345,16 @@ atomic_store_rel_##WIDTH(__volatile uint##WIDTH##_t *p } ATOMIC_STORE_LOAD(32) +#if defined(__mips_n64) || defined(__mips_n32) ATOMIC_STORE_LOAD(64) +#endif #undef ATOMIC_STORE_LOAD -#ifdef __mips_n32 +/* + * MIPS n32 is not a LP64 API, so atomic_load_64 isn't defined there. Define it + * here since n32 is an oddball !LP64 but that can do 64-bit atomics. + */ +#if defined(__mips_n32) #define atomic_load_64 atomic_load_acq_64 #endif From owner-svn-src-head@freebsd.org Tue Dec 17 03:30:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B6D581DA057; Tue, 17 Dec 2019 03:30:49 +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 47cNvY44RGz3GD7; Tue, 17 Dec 2019 03:30:49 +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 872837B61; Tue, 17 Dec 2019 03:30:49 +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 xBH3UnL6006014; Tue, 17 Dec 2019 03:30:49 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBH3UnKZ006013; Tue, 17 Dec 2019 03:30:49 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912170330.xBH3UnKZ006013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 17 Dec 2019 03:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355842 - head/sys/dev/kbd X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/kbd X-SVN-Commit-Revision: 355842 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 03:30:49 -0000 Author: kevans Date: Tue Dec 17 03:30:49 2019 New Revision: 355842 URL: https://svnweb.freebsd.org/changeset/base/355842 Log: kbd: const'ify a couple of keyboard_driver fields Nothing modifies these things, but const'ify out of an abundance of caution. If we could const'ify the definition in each keyboard driver, I likely would- improper mutations here can lead to misbehavior or slightly more annoying to debug state. Modified: head/sys/dev/kbd/kbdreg.h Modified: head/sys/dev/kbd/kbdreg.h ============================================================================== --- head/sys/dev/kbd/kbdreg.h Tue Dec 17 03:20:37 2019 (r355841) +++ head/sys/dev/kbd/kbdreg.h Tue Dec 17 03:30:49 2019 (r355842) @@ -96,12 +96,17 @@ typedef struct keyboard_switch { kbd_diag_t *diag; } keyboard_switch_t; -/* keyboard driver */ +/* + * Keyboard driver definition. Some of these be immutable after definition + * time, e.g. one shouldn't be able to rename a driver or use a different kbdsw + * entirely, but patching individual methods is acceptable. + */ typedef struct keyboard_driver { SLIST_ENTRY(keyboard_driver) link; - char *name; - keyboard_switch_t *kbdsw; - int (*configure)(int); /* backdoor for the console driver */ + const char * const name; + keyboard_switch_t * const kbdsw; + /* backdoor for the console driver */ + int (* const configure)(int); } keyboard_driver_t; /* keyboard */ From owner-svn-src-head@freebsd.org Tue Dec 17 04:21:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CAB2C1DB3B8; Tue, 17 Dec 2019 04:21:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cQ274ys2z3JMk; Tue, 17 Dec 2019 04:21:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5C7785C3; Tue, 17 Dec 2019 04:21:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBH4LZcH035589; Tue, 17 Dec 2019 04:21:35 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBH4LZd8035588; Tue, 17 Dec 2019 04:21:35 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912170421.xBH4LZd8035588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 Dec 2019 04:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355843 - head/sys/cam/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/nvme X-SVN-Commit-Revision: 355843 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 04:21:35 -0000 Author: imp Date: Tue Dec 17 04:21:35 2019 New Revision: 355843 URL: https://svnweb.freebsd.org/changeset/base/355843 Log: Revert r355831 It wasn't supposed to change the defaults, but actually does. Back this out until that can be sorted out. Modified: head/sys/cam/nvme/nvme_da.c Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Tue Dec 17 03:30:49 2019 (r355842) +++ head/sys/cam/nvme/nvme_da.c Tue Dec 17 04:21:35 2019 (r355843) @@ -177,14 +177,6 @@ static int nda_max_trim_entries = NDA_MAX_TRIM_ENTRIES SYSCTL_INT(_kern_cam_nda, OID_AUTO, max_trim, CTLFLAG_RDTUN, &nda_max_trim_entries, NDA_MAX_TRIM_ENTRIES, "Maximum number of BIO_DELETE to send down as a DSM TRIM."); -static int nda_goal_trim_entries = NDA_MAX_TRIM_ENTRIES / 2; -SYSCTL_INT(_kern_cam_nda, OID_AUTO, goal_trim, CTLFLAG_RDTUN, - &nda_goal_trim_entries, NDA_MAX_TRIM_ENTRIES / 2, - "Number of BIO_DELETE to try to accumulate before sending a DSM TRIM."); -static int nda_trim_ticks = 50; /* 50ms ~ 1000 Hz */ -SYSCTL_INT(_kern_cam_nda, OID_AUTO, trim_ticks, CTLFLAG_RDTUN, - &nda_trim_ticks, 50, - "Number of ticks to hold BIO_DELETEs before sending down a trim"); /* * All NVMe media is non-rotational, so all nvme device instances @@ -749,9 +741,6 @@ ndaregister(struct cam_periph *periph, void *arg) free(softc, M_DEVBUF); return(CAM_REQ_CMP_ERR); } - /* Statically set these for the moment */ - cam_iosched_set_trim_goal(softc->cam_iosched, nda_goal_trim_entries); - cam_iosched_set_trim_ticks(softc->cam_iosched, nda_trim_ticks); /* ident_data parsing */ From owner-svn-src-head@freebsd.org Tue Dec 17 04:42:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4702B1DB7D3; Tue, 17 Dec 2019 04:42:38 +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 47cQVP5xs1z3KBt; Tue, 17 Dec 2019 04:42:37 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id h4gpimwZhkqGXh4griQ1F5; Mon, 16 Dec 2019 21:42:34 -0700 X-Authority-Analysis: v=2.3 cv=c/jVvi1l c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=pxVhFHJ0LMsA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=_G6RStKDQ7vUjxhPL5gA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id B803EDB2; Mon, 16 Dec 2019 20:42:30 -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 xBH4gU6q063780; Mon, 16 Dec 2019 20:42:30 -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 xBH4gUOg063777; Mon, 16 Dec 2019 20:42:30 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201912170442.xBH4gUOg063777@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: "Pedro F. Giffuni" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355828 - head/sys/sys In-reply-to: <201912162355.xBGNtUq6078840@repo.freebsd.org> References: <201912162355.xBGNtUq6078840@repo.freebsd.org> Comments: In-reply-to "Pedro F. Giffuni" message dated "Mon, 16 Dec 2019 23:55:30 +0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 16 Dec 2019 20:42:30 -0800 X-CMAE-Envelope: MS4wfM3IjWBGR6DVrQeMpGdq5YM3vE+Buu7fMEZ6FWsjJQiLRu/MVvNGfPefvkijA+/742US6GGf21wW26p9rHm0Liqga9WW4VHzB6YiQwvIVjvPQcUp/eE6 IQayKM9llz87LO7HqPW9kshwy6AEhsm9T7bRPABKRwXXiYu1CW3SToYZ7OJvB3A4jc4O7d0+kSxTObphjdmyy4WDX/YEcq2cBqFiDoPMu1zw5yVhJPBoVccP KUbi6E9ONid4HVjgKARsc9+Wyj0qGz++uB0P8QV2u70hiiQ1S2qnuqwpPyPm3Sgj X-Rspamd-Queue-Id: 47cQVP5xs1z3KBt 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]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 04:42:38 -0000 In message <201912162355.xBGNtUq6078840@repo.freebsd.org>, "Pedro F. Giffuni" w rites: > Author: pfg > Date: Mon Dec 16 23:55:30 2019 > New Revision: 355828 > URL: https://svnweb.freebsd.org/changeset/base/355828 > > Log: > Double the size of ARG_MAX on LP64 platforms. > > As modern software keeps growing in size, we get requests to update the > value of ARG_MAX in order to link the resulting object files. Other OSs > have much higher values but Increasiong ARG_MAX has a multiplied effect on > KVA, so just bumping this value is dangerous in some archs like ARM32 that > can exhaust KVA rather easily. > > While it would be better to have a unique value for all archs, other OSs > (Illumos in partidular) can have different ARG_MAX limits depending on the > platform, For now we want to be really conservative so we are avoidng > the change on ILP32 and in the alternative case we only double it since tha > t > seems to work well enough for recent Code Aster. > > I was planning to bump the _FreeBSD_version but it was bumped recently > (r355798) so we can reuse the 1300068 value for this change. This doesn't seem right. Each bump should be for a distinct change and documented as such. Also, it's not like we're saving any build time anyway. sys/syslimits.h will cause a substantial portion to be rebuilt anyway. > > PR: 241710 > MFC after: 5 days > > Modified: > head/sys/sys/syslimits.h > > Modified: head/sys/sys/syslimits.h > ============================================================================= > = > --- head/sys/sys/syslimits.h Mon Dec 16 23:08:09 2019 (r355827) > +++ head/sys/sys/syslimits.h Mon Dec 16 23:55:30 2019 (r355828) > @@ -48,7 +48,11 @@ > * Do not add any new variables here. (See the comment at the end of > * the file for why.) > */ > -#define ARG_MAX 262144 /* max bytes for an exec functi > on */ > +#ifndef __ILP32__ > +#define ARG_MAX (2 * 256 * 1024) /* max bytes for an exec functi > on */ > +#else > +#define ARG_MAX (256 * 1024) /* max bytes for KVA-starved ar > chs */ > +#endif > #ifndef CHILD_MAX > #define CHILD_MAX 40 /* max simultaneous processes * > / > #endif > -- 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-head@freebsd.org Tue Dec 17 04:47:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20CDC1DB97C for ; Tue, 17 Dec 2019 04:47:33 +0000 (UTC) (envelope-from wlosh@bsdimp.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 47cQc42zf5z3KPs for ; Tue, 17 Dec 2019 04:47:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x731.google.com with SMTP id c16so3505979qko.6 for ; Mon, 16 Dec 2019 20:47:32 -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=m7mWsPvAmx0ETpv8HLmw7B+yESp7TI9t38AKzV53q7A=; b=iZHIpG1pQUshE2GCfD0FCR8K3ztZufrg03ilbuohh/+c8lyL0QDaT/Gcmusvb8YImD e8o0GoeLEilS04SlAa9/1eM9tyztpI+D5zJBh9mKuzF17S5tQNAtiSms5VghjFSxRPB7 nOdjez59WECyDgu4PDxIiV73t8YK+phSTiX+qhrhqpwubo/N50ruL1rNChF7LH4/aoNf n24CpAk0UQhZ49Jg9yHUowz6+kkiYfAFKUjlK6l4vloFWzDuwtgGqi0L/GzFFlFWQKde TEhq8feUisWdy7teqvg8XfODns0X2gL3JtFOm92KOddMZQ9yiNpFxWyRIpsWzmm5Eina fL4Q== 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=m7mWsPvAmx0ETpv8HLmw7B+yESp7TI9t38AKzV53q7A=; b=BfcyS2wtlpe9RNxfTj5oxsYIeZwLrv4bvcnX/GUtojbZ0gwkyZN7maG7eDHBbhN7xt SK8qrOC1bwjiY/eofDVW49pSnBDtqv12y0/jf4XP0eOWaibZsCyFxI7t9LcuY/dFbCR+ kHX0gCEFfTOcwFKi/T5n/SH2o/QOQTQrNECNHLsXeAcFIV/md2Tc4Vl3OptD5sYHe5G4 1s2k0ZAU17vASpFLG6FCUOsfm5cumd8U/fOCoCwtR1iG0Phy2gyDamd1g7aBWHPw+T8f IeA+p8wJQcl5sMFqhO6A+gl9xJK8O58XODMdwHrV2CXqbEclRMUkL+QxoSdxfZ9w6xPk VP/w== X-Gm-Message-State: APjAAAVnYT7u0qFUDGGlke57FBwLMDu/+MZT0ittAYS58EWhgfQnsub2 ndp8If/IChiGLgICrGgo5Hkgah0o7WIYZjF2sheLwQ== X-Google-Smtp-Source: APXvYqyrrxriu7Ep/ulvUq6DpVGJLQkJJKBe7Szl71mkQ8llRFINAdE2iFOZCuXudKnJn3AORn1G0r+J7m6QLoJkpCs= X-Received: by 2002:a05:620a:94f:: with SMTP id w15mr3050422qkw.380.1576558050809; Mon, 16 Dec 2019 20:47:30 -0800 (PST) MIME-Version: 1.0 References: <201912162355.xBGNtUq6078840@repo.freebsd.org> <201912170442.xBH4gUOg063777@slippy.cwsent.com> In-Reply-To: <201912170442.xBH4gUOg063777@slippy.cwsent.com> From: Warner Losh Date: Mon, 16 Dec 2019 21:47:18 -0700 Message-ID: Subject: Re: svn commit: r355828 - head/sys/sys To: Cy Schubert Cc: "Pedro F. Giffuni" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 47cQc42zf5z3KPs X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=iZHIpG1p; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::731) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-4.68 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; 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-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[1.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]; 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.68)[ip: (-9.25), ipnet: 2607:f8b0::/32(-2.19), asn: 15169(-1.90), 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 04:47:33 -0000 On Mon, Dec 16, 2019, 9:42 PM Cy Schubert wrote: > In message <201912162355.xBGNtUq6078840@repo.freebsd.org>, "Pedro F. > Giffuni" w > rites: > > Author: pfg > > Date: Mon Dec 16 23:55:30 2019 > > New Revision: 355828 > > URL: https://svnweb.freebsd.org/changeset/base/355828 > > > > Log: > > Double the size of ARG_MAX on LP64 platforms. > > > > As modern software keeps growing in size, we get requests to update the > > value of ARG_MAX in order to link the resulting object files. Other OSs > > have much higher values but Increasiong ARG_MAX has a multiplied > effect on > > KVA, so just bumping this value is dangerous in some archs like ARM32 > that > > can exhaust KVA rather easily. > > > > While it would be better to have a unique value for all archs, other > OSs > > (Illumos in partidular) can have different ARG_MAX limits depending on > the > > platform, For now we want to be really conservative so we are avoidng > > the change on ILP32 and in the alternative case we only double it > since tha > > t > > seems to work well enough for recent Code Aster. > > > > I was planning to bump the _FreeBSD_version but it was bumped recently > > (r355798) so we can reuse the 1300068 value for this change. > > This doesn't seem right. Each bump should be for a distinct change and > documented as such. > In the past we've said to piggy back versions when less than a day has passed since the last bump. The hard part on this is that follow through on actually documenting both has been lax. Warner Also, it's not like we're saving any build time anyway. sys/syslimits.h > will cause a substantial portion to be rebuilt anyway. > > > > > PR: 241710 > > MFC after: 5 days > > > > Modified: > > head/sys/sys/syslimits.h > > > > Modified: head/sys/sys/syslimits.h > > > ============================================================================= > > = > > --- head/sys/sys/syslimits.h Mon Dec 16 23:08:09 2019 (r355827) > > +++ head/sys/sys/syslimits.h Mon Dec 16 23:55:30 2019 (r355828) > > @@ -48,7 +48,11 @@ > > * Do not add any new variables here. (See the comment at the end of > > * the file for why.) > > */ > > -#define ARG_MAX 262144 /* max bytes for an exec > functi > > on */ > > +#ifndef __ILP32__ > > +#define ARG_MAX (2 * 256 * 1024) /* max bytes for an exec > functi > > on */ > > +#else > > +#define ARG_MAX (256 * 1024) /* max bytes for > KVA-starved ar > > chs */ > > +#endif > > #ifndef CHILD_MAX > > #define CHILD_MAX 40 /* max simultaneous > processes * > > / > > #endif > > > > > -- > 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-head@freebsd.org Tue Dec 17 04:57:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D419C1DBC02; Tue, 17 Dec 2019 04:57:48 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (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 47cQqv5CZRz3Kpv; Tue, 17 Dec 2019 04:57:47 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id h4vWinyZcRnrKh4vXil0uq; Mon, 16 Dec 2019 21:57:45 -0700 X-Authority-Analysis: v=2.3 cv=L7FjvNb8 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=pxVhFHJ0LMsA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=ddDh4kZccAIXLlhEL-cA:9 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id D22A8E34; Mon, 16 Dec 2019 20:57:41 -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 xBH4vfHE082134; Mon, 16 Dec 2019 20:57:41 -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 xBH4vfuY082131; Mon, 16 Dec 2019 20:57:41 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201912170457.xBH4vfuY082131@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: Warner Losh cc: Cy Schubert , "Pedro F. Giffuni" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355828 - head/sys/sys In-reply-to: References: <201912162355.xBGNtUq6078840@repo.freebsd.org> <201912170442.xBH4gUOg063777@slippy.cwsent.com> Comments: In-reply-to Warner Losh message dated "Mon, 16 Dec 2019 21:47:18 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 16 Dec 2019 20:57:41 -0800 X-CMAE-Envelope: MS4wfFNj5wUva9Vpgpp+1VCAid+kwQt5fOeD77lUF/i4ec8TLs0OJ5Xp5XLCzvUcbPZeoboyQruvZ3IVgGQBdNdlFB0PDnjp52veHnMEmwVnntrvmkjTINYS SXAfb9XIDZ6f7/bL2SkDPjGWVauh3/m2jQf9XM7j8dcWbQrCMtjYYaDx33y0EJO5GEbiiNq2kg3DcMXGqUdf+wQBlHPjiEYKKPM6mVMH1bZLhAGowZpo87uZ DHKUj97ITM6FA/ig5gEMpwMhL3MAgY8F5zvFpn6V0ONDUuq5tKuMGSDqGfnNJgN+gg/HV8w2z+5Fp8nc6MnW7g== X-Rspamd-Queue-Id: 47cQqv5CZRz3Kpv 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.136.137) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-4.01 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; 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)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCPT_COUNT_FIVE(0.00)[6]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[137.136.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.31)[ip: (-5.97), ipnet: 64.59.128.0/20(-3.09), asn: 6327(-2.39), country: CA(-0.09)]; FROM_EQ_ENVFROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 04:57:48 -0000 In message , Warner Losh writes: > --0000000000009630860599df06a0 > Content-Type: text/plain; charset="UTF-8" > > On Mon, Dec 16, 2019, 9:42 PM Cy Schubert wrote: > > > In message <201912162355.xBGNtUq6078840@repo.freebsd.org>, "Pedro F. > > Giffuni" w > > rites: > > > Author: pfg > > > Date: Mon Dec 16 23:55:30 2019 > > > New Revision: 355828 > > > URL: https://svnweb.freebsd.org/changeset/base/355828 > > > > > > Log: > > > Double the size of ARG_MAX on LP64 platforms. > > > > > > As modern software keeps growing in size, we get requests to update the > > > value of ARG_MAX in order to link the resulting object files. Other OSs > > > have much higher values but Increasiong ARG_MAX has a multiplied > > effect on > > > KVA, so just bumping this value is dangerous in some archs like ARM32 > > that > > > can exhaust KVA rather easily. > > > > > > While it would be better to have a unique value for all archs, other > > OSs > > > (Illumos in partidular) can have different ARG_MAX limits depending on > > the > > > platform, For now we want to be really conservative so we are avoidng > > > the change on ILP32 and in the alternative case we only double it > > since tha > > > t > > > seems to work well enough for recent Code Aster. > > > > > > I was planning to bump the _FreeBSD_version but it was bumped recently > > > (r355798) so we can reuse the 1300068 value for this change. > > > > This doesn't seem right. Each bump should be for a distinct change and > > documented as such. > > > > In the past we've said to piggy back versions when less than a day has > passed since the last bump. The hard part on this is that follow through on > actually documenting both has been lax. We document this kind of thing on the wiki, but the PITA of opening a browser. Would it be better to have a similar type of file like RELNOTES and UPDATING to document version bumps? It seems a little silly, though, to have yet another file, maybe we could incorporate that into RELNOTES in the form of: rNNNNNN: Some verbiage. -- 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-head@freebsd.org Tue Dec 17 05:04:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 255261DBE06 for ; Tue, 17 Dec 2019 05:04:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (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 47cQzh23pfz3LCq for ; Tue, 17 Dec 2019 05:04:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82b.google.com with SMTP id t3so454806qtr.11 for ; Mon, 16 Dec 2019 21:04:32 -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=Aq85GCYTZT80xFXJyOnkIU9ERqxc0EhxZUHKU2ZYfzo=; b=XsRYftZxQneAzSQMaVw1RIp4YBb/IoT7iqd0gQwMgFWieWNtutuHUDj4i+TVED23OS GMiy0dpVXks9IdqSeAkNJOF21/RBuP8EdX1i+zFiLzAyXnwZcJL9/SZqZdKUwKCwH5JN iVyYqYRM0TA2HT+GIrDhnuUO+DV9Ycutx5Omq4lwHBDnTYyC2caDPFfPt7zPAE2mlWN1 AyX4f566Zx3sLpW1bVJO/SWZ1/6xpHMvlwLZ5rtbSE3MVztWmHjAABgk6uqUG8ZF3eFR ZYMpBDWQ+duih3lcbESpzo6Pmn4/sc5obyKEdVftwrAY+Fu6c1uvynW3zEJ94yls7VtU lQLw== 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=Aq85GCYTZT80xFXJyOnkIU9ERqxc0EhxZUHKU2ZYfzo=; b=IMhmk3sTwnAgddLTeKtJ0/6BZvWIiR0NRgMB0sP/BeA8ctKVxA2KP1+oXehqRcJowf obJCSkinrhuj9vaafhZlBRPjens0Jdubh8WASZ0agbMKCyik98bgrhjHBq7LT4VUOmfm WXqu5e2nAYTK08lE7As51HhfJU5pp2w6H7MRbhMLkdCFQiuaXOdIZHnp4p1v7QXIxuQy 012bLPxAeEt8fo4WGUZuZKuclyyWGcIVuB6v0p0lSFu/V45FFm3xtqI2xU9ZHo/xMzW6 vrGUZ62pxFVEgImCwkv8VPAAYq/yvqIBy2yH5/i+OY3Yd07VroxgR+8vNBdq9JHtHtaF BMWg== X-Gm-Message-State: APjAAAUzw6Wu1z48ksK1XgQq6WVIzKTrDTh1P5SeaiZvvviHRHKAVwmd OkswrOrGRUgIS81q9NrOftuHWso7VxnsyxM+WqdwCw== X-Google-Smtp-Source: APXvYqz8QqoEj+lYPv9fMd13iURYelQcVO3kJvpIdpgbQALIoO6rmEje8tW1mnkTrdaWyHs/GWBfmcr9yTwY/S1zmx4= X-Received: by 2002:ac8:3198:: with SMTP id h24mr2879801qte.291.1576559071082; Mon, 16 Dec 2019 21:04:31 -0800 (PST) MIME-Version: 1.0 References: <201912162355.xBGNtUq6078840@repo.freebsd.org> <201912170442.xBH4gUOg063777@slippy.cwsent.com> <201912170457.xBH4vfuY082131@slippy.cwsent.com> In-Reply-To: <201912170457.xBH4vfuY082131@slippy.cwsent.com> From: Warner Losh Date: Mon, 16 Dec 2019 22:04:18 -0700 Message-ID: Subject: Re: svn commit: r355828 - head/sys/sys To: Cy Schubert Cc: "Pedro F. Giffuni" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 47cQzh23pfz3LCq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=XsRYftZx; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::82b) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-4.70 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; 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-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[b.2.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.70)[ip: (-9.35), ipnet: 2607:f8b0::/32(-2.19), asn: 15169(-1.90), 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 05:04:33 -0000 On Mon, Dec 16, 2019, 9:57 PM Cy Schubert wrote: > In message > om> > , Warner Losh writes: > > --0000000000009630860599df06a0 > > Content-Type: text/plain; charset="UTF-8" > > > > On Mon, Dec 16, 2019, 9:42 PM Cy Schubert > wrote: > > > > > In message <201912162355.xBGNtUq6078840@repo.freebsd.org>, "Pedro F. > > > Giffuni" w > > > rites: > > > > Author: pfg > > > > Date: Mon Dec 16 23:55:30 2019 > > > > New Revision: 355828 > > > > URL: https://svnweb.freebsd.org/changeset/base/355828 > > > > > > > > Log: > > > > Double the size of ARG_MAX on LP64 platforms. > > > > > > > > As modern software keeps growing in size, we get requests to > update the > > > > value of ARG_MAX in order to link the resulting object files. > Other OSs > > > > have much higher values but Increasiong ARG_MAX has a multiplied > > > effect on > > > > KVA, so just bumping this value is dangerous in some archs like > ARM32 > > > that > > > > can exhaust KVA rather easily. > > > > > > > > While it would be better to have a unique value for all archs, > other > > > OSs > > > > (Illumos in partidular) can have different ARG_MAX limits > depending on > > > the > > > > platform, For now we want to be really conservative so we are > avoidng > > > > the change on ILP32 and in the alternative case we only double it > > > since tha > > > > t > > > > seems to work well enough for recent Code Aster. > > > > > > > > I was planning to bump the _FreeBSD_version but it was bumped > recently > > > > (r355798) so we can reuse the 1300068 value for this change. > > > > > > This doesn't seem right. Each bump should be for a distinct change and > > > documented as such. > > > > > > > In the past we've said to piggy back versions when less than a day has > > passed since the last bump. The hard part on this is that follow through > on > > actually documenting both has been lax. > > We document this kind of thing on the wiki, but the PITA of opening a > browser. Would it be better to have a similar type of file like RELNOTES > and UPDATING to document version bumps? It seems a little silly, though, > to > have yet another file, maybe we could incorporate that into RELNOTES in > the > form of: > > rNNNNNN: > Some verbiage. > We document it in the porters handbook. But I do see the appeal of being able to find it in a svn log param.h. too bad the version bumps aren't all usefully documented in the commit message... porters handbook is the best source Warner Warner -- > 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-head@freebsd.org Tue Dec 17 08:30:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D146E1E024B; Tue, 17 Dec 2019 08:30:11 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cWXz5H8fz40Zg; Tue, 17 Dec 2019 08:30:11 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B0719B068; Tue, 17 Dec 2019 08:30:11 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBH8UBld081170; Tue, 17 Dec 2019 08:30:11 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBH8UB13081169; Tue, 17 Dec 2019 08:30:11 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201912170830.xBH8UB13081169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 17 Dec 2019 08:30:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355844 - head/stand/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/efi/libefi X-SVN-Commit-Revision: 355844 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 08:30:11 -0000 Author: tsoome Date: Tue Dec 17 08:30:11 2019 New Revision: 355844 URL: https://svnweb.freebsd.org/changeset/base/355844 Log: loader.efi: efi_readkey_ex needs to key despite the shift status or toggle status From UEFI specification 2.8, page 434: "It should also be noted that certain input devices may not be able to produce shift or toggle state information, and in those cases the high order bit in the respective Toggle and Shift state fields should not be active." But we still need to check for ScanCode and UnicodeChar. PR: 242660 Reported by: Trond Endrestol MFC after: 1 week Modified: head/stand/efi/libefi/efi_console.c Modified: head/stand/efi/libefi/efi_console.c ============================================================================== --- head/stand/efi/libefi/efi_console.c Tue Dec 17 04:21:35 2019 (r355843) +++ head/stand/efi/libefi/efi_console.c Tue Dec 17 08:30:11 2019 (r355844) @@ -1126,11 +1126,15 @@ efi_readkey_ex(void) kp->UnicodeChar++; } } - if (kp->ScanCode == 0 && kp->UnicodeChar == 0) - return (false); - keybuf_inschar(kp); - return (true); } + /* + * The shift state and/or toggle state may not be valid, + * but we still can have ScanCode or UnicodeChar. + */ + if (kp->ScanCode == 0 && kp->UnicodeChar == 0) + return (false); + keybuf_inschar(kp); + return (true); } return (false); } From owner-svn-src-head@freebsd.org Tue Dec 17 09:13:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6168E1E14D0; Tue, 17 Dec 2019 09:13:49 +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 47cXWK1zqjz43Lf; Tue, 17 Dec 2019 09:13:49 +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 3F738B96D; Tue, 17 Dec 2019 09:13:49 +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 xBH9DnDP010893; Tue, 17 Dec 2019 09:13:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBH9DnTn010892; Tue, 17 Dec 2019 09:13:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201912170913.xBH9DnTn010892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 17 Dec 2019 09:13:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355847 - head/usr.bin/diff3 X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/diff3 X-SVN-Commit-Revision: 355847 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 09:13:49 -0000 Author: bapt Date: Tue Dec 17 09:13:48 2019 New Revision: 355847 URL: https://svnweb.freebsd.org/changeset/base/355847 Log: Use strtoimax. Use existing strtoimax instead of reinventing it Modified: head/usr.bin/diff3/diff3.c Modified: head/usr.bin/diff3/diff3.c ============================================================================== --- head/usr.bin/diff3/diff3.c Tue Dec 17 08:57:01 2019 (r355846) +++ head/usr.bin/diff3/diff3.c Tue Dec 17 09:13:48 2019 (r355847) @@ -84,6 +84,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -132,7 +134,6 @@ static bool duplicate(struct range *, struct range *); static int edit(struct diff *, bool, int); static char *getchange(FILE *); static char *get_line(FILE *, size_t *); -static int number(char **); static int readin(int fd, struct diff **); static int skip(int, int, const char *); static void change(int, struct range *, bool); @@ -188,16 +189,16 @@ readin(int fd, struct diff **dd) for (i=0; (p = getchange(f)); i++) { if (i >= szchanges - 1) increase(); - a = b = number(&p); + a = b = (int)strtoimax(p, &p, 10); if (*p == ',') { p++; - b = number(&p); + b = (int)strtoimax(p, &p, 10); } kind = *p++; - c = d = number(&p); + c = d = (int)strtoimax(p, &p, 10); if (*p==',') { p++; - d = number(&p); + d = (int)strtoimax(p, &p, 10); } if (kind == 'a') a++; @@ -238,17 +239,6 @@ diffexec(const char *diffprog, char **diffargv, int fd } close(fd[1]); return (pd); -} - -static int -number(char **lc) -{ - int nn; - - nn = 0; - while (isdigit((unsigned char)(**lc))) - nn = nn*10 + *(*lc)++ - '0'; - return (nn); } static char * From owner-svn-src-head@freebsd.org Tue Dec 17 09:39:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8DE921E1C48; Tue, 17 Dec 2019 09:39:28 +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 47cY4v2t97z451Q; Tue, 17 Dec 2019 09:39:26 +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 xBH9dGlH096829; Tue, 17 Dec 2019 01:39:16 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id xBH9dFhD096828; Tue, 17 Dec 2019 01:39:15 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201912170939.xBH9dFhD096828@gndrsh.dnsmgr.net> Subject: Re: svn commit: r355737 - head/share/man/man9 In-Reply-To: To: Warner Losh Date: Tue, 17 Dec 2019 01:39:15 -0800 (PST) CC: "Rodney W. Grimes" , Warner Losh , 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: 47cY4v2t97z451Q X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd@gndrsh.dnsmgr.net X-Spamd-Result: default: False [0.68 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; NEURAL_HAM_MEDIUM(-0.47)[-0.466,0]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_SPAM_LONG(0.21)[0.213,0]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.04)[ip: (0.14), ipnet: 69.59.192.0/19(0.07), asn: 13868(0.02), country: US(-0.05)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 09:39:28 -0000 > On Sun, Dec 15, 2019, 11:51 AM Rodney W. Grimes > wrote: > > > > Author: imp > > > Date: Fri Dec 13 22:32:05 2019 > > > New Revision: 355737 > > > URL: https://svnweb.freebsd.org/changeset/base/355737 > > > > > > Log: > > > Better copyright advice > > > > > > Document the common practices around copyrights with "all rights > > reserved" in > > > them as new copyright notices get added. > > > > > > It's an open question qhether to point people at the fact that since > > the Berne > > > convention was ratified, All rights reserved is largely obsolete. > > > https://en.wikipedia.org/wiki/All_rights_reserved#Obsolescence has the > > > details. The committer's guide will be revised shortly, and it's > > likely that's a > > > better place for this discussion. If not, I'll add a blurb here. > > > > > > Reviewed by: jhb@, brooks@ > > > Differential Review: https://reviews.freebsd.org/D22800 > > > > I object to the a review that specifically invites people to it, > > is authored and committed in anything short of 24 hours and more > > reasonable to actually ALLOW people time to repond of 72 hours. > > > > The project has no fixed policies around reviews and giving time. Several > people did look at it and approve it before I committed it. Then I'll be blunt, if your going to manually add me to a review do not commit it until you have given me 72 hours to respond, if you can not have that respect for my time to response DO NOT MANUALLY INVITE ME TO YOUR REVIEW. > Having said that, this isn't like you've lost your ability to say something > forever now that this is in the tree. If you have suggestions to > improvement, I'm all ears. > > I like your notion around (c) being noise, but I'll address that in the > review. > > Warner > > > Regards, > > Rod > > > > > > Better copyright advice > > AcceptedPublic > > Authored by imp on Fri, Dec 13, 12:33. > > > > > Modified: > > > head/share/man/man9/style.9 > > > > > > Modified: head/share/man/man9/style.9 > > > > > ============================================================================== > > > --- head/share/man/man9/style.9 Fri Dec 13 22:04:13 2019 > > (r355736) > > > +++ head/share/man/man9/style.9 Fri Dec 13 22:32:05 2019 > > (r355737) > > > @@ -1,6 +1,5 @@ > > > .\"- > > > -.\" Copyright (c) 1995-2005 The FreeBSD Project > > > -.\" All rights reserved. > > > +.\" Copyright (c) 1995-2019 The FreeBSD Project > > > .\" > > > .\" Redistribution and use in source and binary forms, with or without > > > .\" modification, are permitted provided that the following conditions > > > @@ -26,7 +25,7 @@ > > > .\" From: @(#)style 1.14 (Berkeley) 4/28/95 > > > .\" $FreeBSD$ > > > .\" > > > -.Dd June 3, 2019 > > > +.Dd December 13, 2019 > > > .Dt STYLE 9 > > > .Os > > > .Sh NAME > > > @@ -84,8 +83,32 @@ comments. > > > Comments starting in columns other than the first are never > > > considered license statements. > > > Use the appropriate SPDX-License-Identifier line before the copyright. > > > +If the copyright assertion contains the phrase > > > +.Dq Li "All Rights Reserved" > > > +that should be on the same line as the word > > > +.Dq Li "Copyright" . > > > +You should not insert a new copyright line between an old > > > +copyright line and this phrase. > > > +Instead, you should insert a new copyright phrase after > > > +a pre-existing > > > +.Dq Li "All Rights Reserved" > > > +line. > > > +When making changes, it is acceptable to fold an > > > +.Dq Li "All Rights Reserved" > > > +line with each of the > > > +.Dq Li "Copyright" > > > +lines. > > > +For files that have the > > > +.Dq Li "All Rights Reserved" > > > +line on the same line(s) as the word > > > +.Dq Li "Copyright" , > > > +new copyright assertions should be added last. > > > +New > > > +.Dq Li "Copyright" > > > +lines should only be added when making substantial changes to the file, > > > +not for trivial changes. > > > .Pp > > > -After any copyright header, there is a blank line, and the > > > +After any copyright and license comment, there is a blank line, and the > > > .Li $\&FreeBSD$ > > > for non C/C++ language source files. > > > Version control system ID tags should only exist once in a file > > > > > > > -- > > Rod Grimes > > rgrimes@freebsd.org > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Dec 17 10:55:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 52CC51E39E3; Tue, 17 Dec 2019 10:55:29 +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 47cZmd1Jx2z4B0p; Tue, 17 Dec 2019 10:55:29 +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 2387ECD5C; Tue, 17 Dec 2019 10:55:29 +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 xBHAtS13069601; Tue, 17 Dec 2019 10:55:28 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBHAtSUr069600; Tue, 17 Dec 2019 10:55:28 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201912171055.xBHAtSUr069600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 17 Dec 2019 10:55:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355852 - 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: 355852 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 10:55:29 -0000 Author: manu Date: Tue Dec 17 10:55:28 2019 New Revision: 355852 URL: https://svnweb.freebsd.org/changeset/base/355852 Log: arm64: rockchip: rk_pinctrl: Fix clear bits in SYSCON_MODIFY r351187 change the SYSCON_WRITE to SYSCON_MODIFY but didn't changed the mask variable that used to hold the bitmask in the upper 16 bits of the register that control which bits are changed. So we ended up clearing bit from the upper 16bits half which are always 0 after a read. Use the correct bit mask for bits that we want to clear. MFC after: 3 days Modified: head/sys/arm64/rockchip/rk_pinctrl.c Modified: head/sys/arm64/rockchip/rk_pinctrl.c ============================================================================== --- head/sys/arm64/rockchip/rk_pinctrl.c Tue Dec 17 10:26:44 2019 (r355851) +++ head/sys/arm64/rockchip/rk_pinctrl.c Tue Dec 17 10:55:28 2019 (r355852) @@ -882,7 +882,7 @@ rk_pinctrl_configure_pin(struct rk_pinctrl_softc *sc, reg += bank * 0x10 + ((pin / 8) * 0x4); bit = (pin % 8) * 2; - mask = (0x3 << bit) << 16; + mask = (0x3 << bit); SYSCON_MODIFY_4(syscon, reg, mask, bias << bit | (mask << 16)); } @@ -890,7 +890,7 @@ rk_pinctrl_configure_pin(struct rk_pinctrl_softc *sc, rv = rk_pinctrl_parse_drive(sc, pin_conf, bank, subbank, &drive, ®); if (rv == 0) { bit = (pin % 8) * 2; - mask = (0x3 << bit) << 16; + mask = (0x3 << bit); SYSCON_MODIFY_4(syscon, reg, mask, drive << bit | (mask << 16)); } From owner-svn-src-head@freebsd.org Tue Dec 17 10:57:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9262B1E3B87; Tue, 17 Dec 2019 10:57:32 +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 47cZq037YXz4BJ3; Tue, 17 Dec 2019 10:57:32 +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 6200FCD5D; Tue, 17 Dec 2019 10:57:32 +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 xBHAvWjD069736; Tue, 17 Dec 2019 10:57:32 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBHAvWAr069735; Tue, 17 Dec 2019 10:57:32 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201912171057.xBHAvWAr069735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 17 Dec 2019 10:57:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355853 - 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: 355853 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 10:57:32 -0000 Author: manu Date: Tue Dec 17 10:57:31 2019 New Revision: 355853 URL: https://svnweb.freebsd.org/changeset/base/355853 Log: arm64: rockchip: rk_gpio: Fix pin number The maxpin counter starts at 0, fix one by one error. This is still not totally correct for some banks in some SoC that have fewer pins but this will be dealt with in another commit. MFC after: 3 days Modified: head/sys/arm64/rockchip/rk_gpio.c Modified: head/sys/arm64/rockchip/rk_gpio.c ============================================================================== --- head/sys/arm64/rockchip/rk_gpio.c Tue Dec 17 10:55:28 2019 (r355852) +++ head/sys/arm64/rockchip/rk_gpio.c Tue Dec 17 10:57:31 2019 (r355853) @@ -194,7 +194,7 @@ rk_gpio_pin_max(device_t dev, int *maxpin) /* Each bank have always 32 pins */ /* XXX not true*/ - *maxpin = 32; + *maxpin = 31; return (0); } From owner-svn-src-head@freebsd.org Tue Dec 17 11:03:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED1121E3E36; Tue, 17 Dec 2019 11:03:32 +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 47cZxw5nnTz4Bnk; Tue, 17 Dec 2019 11:03:32 +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 C217CCF29; Tue, 17 Dec 2019 11:03:32 +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 xBHB3WlA075268; Tue, 17 Dec 2019 11:03:32 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBHB3WAa075267; Tue, 17 Dec 2019 11:03:32 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201912171103.xBHB3WAa075267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 17 Dec 2019 11:03:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355854 - head/usr.bin/diff3 X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/diff3 X-SVN-Commit-Revision: 355854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 11:03:33 -0000 Author: bapt Date: Tue Dec 17 11:03:32 2019 New Revision: 355854 URL: https://svnweb.freebsd.org/changeset/base/355854 Log: Replace homemade getline(3) by actual getline(3) Modified: head/usr.bin/diff3/diff3.c Modified: head/usr.bin/diff3/diff3.c ============================================================================== --- head/usr.bin/diff3/diff3.c Tue Dec 17 10:57:31 2019 (r355853) +++ head/usr.bin/diff3/diff3.c Tue Dec 17 11:03:32 2019 (r355854) @@ -257,28 +257,16 @@ getchange(FILE *b) static char * get_line(FILE *b, size_t *n) { - char *cp; - size_t len; - static char *buf; - static size_t bufsize; + ssize_t len; + static char *buf = NULL; + static size_t bufsize = 0; - if ((cp = fgetln(b, &len)) == NULL) + if ((len = getline(&buf, &bufsize, b)) < 0) return (NULL); - if (cp[len - 1] != '\n') - len++; - if (len + 1 > bufsize) { - do { - bufsize += 1024; - } while (len + 1 > bufsize); - if ((buf = realloc(buf, bufsize)) == NULL) - err(EXIT_FAILURE, NULL); - } - memcpy(buf, cp, len - 1); - buf[len - 1] = '\n'; - buf[len] = '\0'; if (n != NULL) *n = len; + return (buf); } From owner-svn-src-head@freebsd.org Tue Dec 17 14:18:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B624B1E95BD for ; Tue, 17 Dec 2019 14:18:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) (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 47cgGk0pcJz4NpS for ; Tue, 17 Dec 2019 14:18:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x729.google.com with SMTP id z76so5349740qka.2 for ; Tue, 17 Dec 2019 06:18:21 -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=EGUQAW/aH6+oZSS3xUykghxjtpvvOqGY/AAjwTKX7J8=; b=DcqlUBiX5GrH3tVlgomH2iLXo8DFDSwY8iWiYN4GZOF/j1F/tS4aye1HH2+35YBBKc PVRdq8OBA8bGHrFlQsglVII5Oj1wQMOfY1yrxLBeY02g4vdvbGwaBH8PxJ6op4lixLuU vOyj4Cq95K9ZLKeVIcMJelRsrDZcBJdUnKCtzQ/PNdFan8+9ZsXMoSxjY00037BRJ6lE 2HEFjM0MmN5e1hjDgNd62WQ+sgIHteop7el4rRfAaIOuWmXCdBz5lCar03a/xyGowwUY 09OWT1FdOpK+ffEWQvo2Qu3R1kkO0huMmPzWBFzGLHBxfdjRdzAghe9ehPsAtLRKF5Q8 7tKA== 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=EGUQAW/aH6+oZSS3xUykghxjtpvvOqGY/AAjwTKX7J8=; b=KS8kYzt52816q+uxYCzWNBRflnixZTT27CDpcUZq5L9rbQBlORVq1T/2NwQIbzy5L3 DEKbj6jwKgyioeXDGH+O6baXYYzFthBqbSIDRIMoK9yIJzg4xJi4EX17tE/qPB3DS8ot 3fVL51xn5k4lXv2I9zaedNrZeVccnsB+8EyeSosffTfL/RzBBTL25Dieq3GDLCUSVvzp Ljm2Y+8/5crU76EWOs99/RJO5oBHLIs7nbWPMzeeLG4/9jvclAUB85OL2g/Ota2emDlX zGLBc5NomCVuk47fxHeaW8XsjRVlLkGPaqei/EBD6dnivZISBG7ysvhpZWwd4NZ11UBx cT/w== X-Gm-Message-State: APjAAAVV7fjq6EkiE8wkWWH1bc9xNhuvO2BZtvFRSVMj0vABZ3kd+Jg3 RVwqSQX5YbXFno54Ue2Ugk/G0CYqPf7C7U0hx488ri1R/XQ= X-Google-Smtp-Source: APXvYqywFkQuJXOm1bUGTt8sfyA9TsTB261Q5eTMPe3t07Jhp99GUvytls3vZnjYpyoXPg/cTpcazqvnREAEfLddi0c= X-Received: by 2002:a37:4f8e:: with SMTP id d136mr5079626qkb.495.1576592300746; Tue, 17 Dec 2019 06:18:20 -0800 (PST) MIME-Version: 1.0 References: <201912170939.xBH9dFhD096828@gndrsh.dnsmgr.net> In-Reply-To: <201912170939.xBH9dFhD096828@gndrsh.dnsmgr.net> From: Warner Losh Date: Tue, 17 Dec 2019 07:18:09 -0700 Message-ID: Subject: Re: svn commit: r355737 - head/share/man/man9 To: "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 47cgGk0pcJz4NpS X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=DcqlUBiX; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::729) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-4.66 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[9.2.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]; 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.66)[ip: (-9.18), ipnet: 2607:f8b0::/32(-2.19), asn: 15169(-1.90), 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 14:18:22 -0000 On Tue, Dec 17, 2019 at 2:39 AM Rodney W. Grimes wrote: > > On Sun, Dec 15, 2019, 11:51 AM Rodney W. Grimes < > freebsd@gndrsh.dnsmgr.net> > > wrote: > > > > > > Author: imp > > > > Date: Fri Dec 13 22:32:05 2019 > > > > New Revision: 355737 > > > > URL: https://svnweb.freebsd.org/changeset/base/355737 > > > > > > > > Log: > > > > Better copyright advice > > > > > > > > Document the common practices around copyrights with "all rights > > > reserved" in > > > > them as new copyright notices get added. > > > > > > > > It's an open question qhether to point people at the fact that > since > > > the Berne > > > > convention was ratified, All rights reserved is largely obsolete. > > > > https://en.wikipedia.org/wiki/All_rights_reserved#Obsolescence > has the > > > > details. The committer's guide will be revised shortly, and it's > > > likely that's a > > > > better place for this discussion. If not, I'll add a blurb here. > > > > > > > > Reviewed by: jhb@, brooks@ > > > > Differential Review: https://reviews.freebsd.org/D22800 > > > > > > I object to the a review that specifically invites people to it, > > > is authored and committed in anything short of 24 hours and more > > > reasonable to actually ALLOW people time to repond of 72 hours. > > > > > > > The project has no fixed policies around reviews and giving time. Several > > people did look at it and approve it before I committed it. > > Then I'll be blunt, if your going to manually add me to a review > do not commit it until you have given me 72 hours to respond, if > you can not have that respect for my time to response DO NOT MANUALLY > INVITE ME TO YOUR REVIEW. > Sure, I'll respect your wishes, but I don't have to worry about that with anybody else. They just give the feedback when they get a chance to do so... Warner > > Having said that, this isn't like you've lost your ability to say > something > > forever now that this is in the tree. If you have suggestions to > > improvement, I'm all ears. > > > > I like your notion around (c) being noise, but I'll address that in the > > review. > > > > Warner > > > > > > Regards, > > > Rod > > > > > > > > > Better copyright advice > > > AcceptedPublic > > > Authored by imp on Fri, Dec 13, 12:33. > > > > > > > Modified: > > > > head/share/man/man9/style.9 > > > > > > > > Modified: head/share/man/man9/style.9 > > > > > > > > ============================================================================== > > > > --- head/share/man/man9/style.9 Fri Dec 13 22:04:13 2019 > > > (r355736) > > > > +++ head/share/man/man9/style.9 Fri Dec 13 22:32:05 2019 > > > (r355737) > > > > @@ -1,6 +1,5 @@ > > > > .\"- > > > > -.\" Copyright (c) 1995-2005 The FreeBSD Project > > > > -.\" All rights reserved. > > > > +.\" Copyright (c) 1995-2019 The FreeBSD Project > > > > .\" > > > > .\" Redistribution and use in source and binary forms, with or > without > > > > .\" modification, are permitted provided that the following > conditions > > > > @@ -26,7 +25,7 @@ > > > > .\" From: @(#)style 1.14 (Berkeley) 4/28/95 > > > > .\" $FreeBSD$ > > > > .\" > > > > -.Dd June 3, 2019 > > > > +.Dd December 13, 2019 > > > > .Dt STYLE 9 > > > > .Os > > > > .Sh NAME > > > > @@ -84,8 +83,32 @@ comments. > > > > Comments starting in columns other than the first are never > > > > considered license statements. > > > > Use the appropriate SPDX-License-Identifier line before the > copyright. > > > > +If the copyright assertion contains the phrase > > > > +.Dq Li "All Rights Reserved" > > > > +that should be on the same line as the word > > > > +.Dq Li "Copyright" . > > > > +You should not insert a new copyright line between an old > > > > +copyright line and this phrase. > > > > +Instead, you should insert a new copyright phrase after > > > > +a pre-existing > > > > +.Dq Li "All Rights Reserved" > > > > +line. > > > > +When making changes, it is acceptable to fold an > > > > +.Dq Li "All Rights Reserved" > > > > +line with each of the > > > > +.Dq Li "Copyright" > > > > +lines. > > > > +For files that have the > > > > +.Dq Li "All Rights Reserved" > > > > +line on the same line(s) as the word > > > > +.Dq Li "Copyright" , > > > > +new copyright assertions should be added last. > > > > +New > > > > +.Dq Li "Copyright" > > > > +lines should only be added when making substantial changes to the > file, > > > > +not for trivial changes. > > > > .Pp > > > > -After any copyright header, there is a blank line, and the > > > > +After any copyright and license comment, there is a blank line, and > the > > > > .Li $\&FreeBSD$ > > > > for non C/C++ language source files. > > > > Version control system ID tags should only exist once in a file > > > > > > > > > > -- > > > Rod Grimes > > > rgrimes@freebsd.org > > > > > -- > Rod Grimes > rgrimes@freebsd.org > On Tue, Dec 17, 2019 at 2:39 AM Rodney W. Grimes wrote: > > On Sun, Dec 15, 2019, 11:51 AM Rodney W. Grimes < > freebsd@gndrsh.dnsmgr.net> > > wrote: > > > > > > Author: imp > > > > Date: Fri Dec 13 22:32:05 2019 > > > > New Revision: 355737 > > > > URL: https://svnweb.freebsd.org/changeset/base/355737 > > > > > > > > Log: > > > > Better copyright advice > > > > > > > > Document the common practices around copyrights with "all rights > > > reserved" in > > > > them as new copyright notices get added. > > > > > > > > It's an open question qhether to point people at the fact that > since > > > the Berne > > > > convention was ratified, All rights reserved is largely obsolete. > > > > https://en.wikipedia.org/wiki/All_rights_reserved#Obsolescence > has the > > > > details. The committer's guide will be revised shortly, and it's > > > likely that's a > > > > better place for this discussion. If not, I'll add a blurb here. > > > > > > > > Reviewed by: jhb@, brooks@ > > > > Differential Review: https://reviews.freebsd.org/D22800 > > > > > > I object to the a review that specifically invites people to it, > > > is authored and committed in anything short of 24 hours and more > > > reasonable to actually ALLOW people time to repond of 72 hours. > > > > > > > The project has no fixed policies around reviews and giving time. Several > > people did look at it and approve it before I committed it. > > Then I'll be blunt, if your going to manually add me to a review > do not commit it until you have given me 72 hours to respond, if > you can not have that respect for my time to response DO NOT MANUALLY > INVITE ME TO YOUR REVIEW. > > > > Having said that, this isn't like you've lost your ability to say > something > > forever now that this is in the tree. If you have suggestions to > > improvement, I'm all ears. > > > > I like your notion around (c) being noise, but I'll address that in the > > review. > > > > Warner > > > > > > Regards, > > > Rod > > > > > > > > > Better copyright advice > > > AcceptedPublic > > > Authored by imp on Fri, Dec 13, 12:33. > > > > > > > Modified: > > > > head/share/man/man9/style.9 > > > > > > > > Modified: head/share/man/man9/style.9 > > > > > > > > ============================================================================== > > > > --- head/share/man/man9/style.9 Fri Dec 13 22:04:13 2019 > > > (r355736) > > > > +++ head/share/man/man9/style.9 Fri Dec 13 22:32:05 2019 > > > (r355737) > > > > @@ -1,6 +1,5 @@ > > > > .\"- > > > > -.\" Copyright (c) 1995-2005 The FreeBSD Project > > > > -.\" All rights reserved. > > > > +.\" Copyright (c) 1995-2019 The FreeBSD Project > > > > .\" > > > > .\" Redistribution and use in source and binary forms, with or > without > > > > .\" modification, are permitted provided that the following > conditions > > > > @@ -26,7 +25,7 @@ > > > > .\" From: @(#)style 1.14 (Berkeley) 4/28/95 > > > > .\" $FreeBSD$ > > > > .\" > > > > -.Dd June 3, 2019 > > > > +.Dd December 13, 2019 > > > > .Dt STYLE 9 > > > > .Os > > > > .Sh NAME > > > > @@ -84,8 +83,32 @@ comments. > > > > Comments starting in columns other than the first are never > > > > considered license statements. > > > > Use the appropriate SPDX-License-Identifier line before the > copyright. > > > > +If the copyright assertion contains the phrase > > > > +.Dq Li "All Rights Reserved" > > > > +that should be on the same line as the word > > > > +.Dq Li "Copyright" . > > > > +You should not insert a new copyright line between an old > > > > +copyright line and this phrase. > > > > +Instead, you should insert a new copyright phrase after > > > > +a pre-existing > > > > +.Dq Li "All Rights Reserved" > > > > +line. > > > > +When making changes, it is acceptable to fold an > > > > +.Dq Li "All Rights Reserved" > > > > +line with each of the > > > > +.Dq Li "Copyright" > > > > +lines. > > > > +For files that have the > > > > +.Dq Li "All Rights Reserved" > > > > +line on the same line(s) as the word > > > > +.Dq Li "Copyright" , > > > > +new copyright assertions should be added last. > > > > +New > > > > +.Dq Li "Copyright" > > > > +lines should only be added when making substantial changes to the > file, > > > > +not for trivial changes. > > > > .Pp > > > > -After any copyright header, there is a blank line, and the > > > > +After any copyright and license comment, there is a blank line, and > the > > > > .Li $\&FreeBSD$ > > > > for non C/C++ language source files. > > > > Version control system ID tags should only exist once in a file > > > > > > > > > > -- > > > Rod Grimes > > > rgrimes@freebsd.org > > > > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-head@freebsd.org Tue Dec 17 14:53:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65FFB1EA64C; Tue, 17 Dec 2019 14:53:56 +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 47ch3m22X5z4Qg9; Tue, 17 Dec 2019 14:53:56 +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 408B0F92B; Tue, 17 Dec 2019 14:53:56 +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 xBHEruNb011569; Tue, 17 Dec 2019 14:53:56 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBHEruLG011568; Tue, 17 Dec 2019 14:53:56 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201912171453.xBHEruLG011568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 17 Dec 2019 14:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355855 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 355855 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 14:53:56 -0000 Author: mjg Date: Tue Dec 17 14:53:55 2019 New Revision: 355855 URL: https://svnweb.freebsd.org/changeset/base/355855 Log: Convert zpcpu_* inlines to macros and add zpcpu_replace. This allows them to do basic type casting internally, effectively relieving consumers from having to cast on their own. Modified: head/sys/sys/pcpu.h Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Tue Dec 17 11:03:32 2019 (r355854) +++ head/sys/sys/pcpu.h Tue Dec 17 14:53:55 2019 (r355855) @@ -228,28 +228,30 @@ extern struct pcpu *cpuid_to_pcpu[]; #define curproc (curthread->td_proc) /* Accessor to elements allocated via UMA_ZONE_PCPU zone. */ -static inline void * -zpcpu_get(void *base) -{ +#define zpcpu_get(base) ({ \ + __typeof(base) _ptr = (void *)((char *)(base) + UMA_PCPU_ALLOC_SIZE * curcpu); \ + _ptr; \ +}) - return ((char *)(base) + UMA_PCPU_ALLOC_SIZE * curcpu); -} +#define zpcpu_get_cpu(base, cpu) ({ \ + __typeof(base) _ptr = (void *)((char *)(base) + UMA_PCPU_ALLOC_SIZE * cpu); \ + _ptr; \ +}) -static inline void * -zpcpu_get_cpu(void *base, int cpu) -{ - - return ((char *)(base) + UMA_PCPU_ALLOC_SIZE * cpu); -} - /* * This operation is NOT atomic and does not post any barriers. * If you use this the assumption is that the target CPU will not * be modifying this variable. * If you need atomicity use xchg. * */ +#define zpcpu_replace(base, val) ({ \ + __typeof(val) _old = *(__typeof(base))zpcpu_get(base); \ + *(__typeof(val) *)zpcpu_get(base) = val; \ + _old; \ +}) + #define zpcpu_replace_cpu(base, val, cpu) ({ \ - __typeof(val) _old = *(__typeof(val) *)zpcpu_get_cpu(base, cpu);\ + __typeof(val) _old = *(__typeof(base))zpcpu_get_cpu(base, cpu); \ *(__typeof(val) *)zpcpu_get_cpu(base, cpu) = val; \ _old; \ }) From owner-svn-src-head@freebsd.org Tue Dec 17 15:10:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 596681EAB57; Tue, 17 Dec 2019 15:10:31 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) (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 47chQt3Pxrz4Rdp; Tue, 17 Dec 2019 15:10:30 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f48.google.com with SMTP id v3so11396754ioj.5; Tue, 17 Dec 2019 07:10:30 -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:content-transfer-encoding; bh=PhSAipLDE3+cWG8jFicMjeCsrfe9ry1FUcttMydCiZ0=; b=NVZNn8yX2VdQb7oL2+Mjcc41jn09rGpn4lvrMX2VJzIGcPbdtKuemBcnE+zZ/NP+xS W3eDzFRAYc4eli7cDbFHlYg2KKjRtSvovB1a1FP8/o6OyTrcJm2+E4tmQHe/lo9wv7sV BHZ7MnGx7Sc0v1O0nZro8u+lN1fkWyzKJJQ3sHxcf6lynlyjTR0oIvHGHoP1zLdX6Buh JtXegfkmjpjDqXO4ndXnmhn4HTy4w7Rp3ln5lTBdAGI17k9MHKexcbaUJJ1b8hl2bAOv fX9gbgAqmj6mYcrz66E3vaFMov3Jvhm+dLiwKE2hk0JJytMtlByfnhNuELMgzcfGw39Z KlVw== X-Gm-Message-State: APjAAAXIeVOrvBzm02p7h5DA6I6P0IfaK1HufGwo+pfMrWsKGyi07kt4 F17FT9+oDsrTP0JGfflHo10EDiXzQ3BEAtf2Rk4mDPF/ X-Google-Smtp-Source: APXvYqxXlI0yrlBAKKZ+D6RZtZ+4ehrjPb1awcw8qOCvDCz0IQNLWZpEH4IVDcxF2EWoVYXyRn+fJidQadYcg3ZYALk= X-Received: by 2002:a05:6638:72c:: with SMTP id j12mr17743245jad.136.1576595428353; Tue, 17 Dec 2019 07:10:28 -0800 (PST) MIME-Version: 1.0 References: <201912101435.xBAEZcIQ005147@repo.freebsd.org> <592493f2-556d-ec0c-aa8a-788e47c26e1d@freebsd.org> In-Reply-To: From: Ed Maste Date: Tue, 17 Dec 2019 05:47:18 -0500 Message-ID: Subject: Re: svn commit: r355585 - head/share/vt/keymaps To: =?UTF-8?B?U3RlZmFuIEXDn2Vy?= Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 47chQt3Pxrz4Rdp 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.48 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-4.36 / 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)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17: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]; IP_SCORE(-2.36)[ip: (-6.72), ipnet: 209.85.128.0/17(-3.12), asn: 15169(-1.90), country: US(-0.05)]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[48.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)[48.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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 15:10:31 -0000 On Tue, 10 Dec 2019 at 15:01, Stefan E=C3=9Fer wrote: > > I might restart that effort, if there is interest (important keymaps > missing in FreeBSD, but available for Linux). As someone who really only deals with US layout keyboards I don't have a good handle on what might be missing. It would be good to get feedback (beyond what's in PRs) about keymap issues. From owner-svn-src-head@freebsd.org Tue Dec 17 15:56:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 06FAA1EB9D7; Tue, 17 Dec 2019 15:56:49 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cjSJ6QFJz4V8M; Tue, 17 Dec 2019 15:56:48 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D76F218419; Tue, 17 Dec 2019 15:56:48 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBHFumtd047128; Tue, 17 Dec 2019 15:56:48 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBHFumLK047127; Tue, 17 Dec 2019 15:56:48 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201912171556.xBHFumLK047127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 17 Dec 2019 15:56:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355858 - head/sys/dev/ow X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/ow X-SVN-Commit-Revision: 355858 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 15:56:49 -0000 Author: ian Date: Tue Dec 17 15:56:48 2019 New Revision: 355858 URL: https://svnweb.freebsd.org/changeset/base/355858 Log: Update owc_gpiobus (one-wire over gpio) to the modern gpio_pin interface. It used to be required that a device be a child of gpiobus(4) to manipulate gpio pins. That requirement didn't work well for FDT-based systems with many cross-hierarchy users of gpio, so a more modern framework was created that removed the old hierarchy requirement. These changes adapt the owc_gpiobus driver to use the newer gpio_pin_* functions to acquire, release, and manipulate gpio pins. This allows a single driver to work for both hinted-attachment and fdt-based systems, and removes the requirement that any one-wire fdt nodes must appear at the root of the devicetree. Differential Revision: https://reviews.freebsd.org/D22710 Modified: head/sys/dev/ow/owc_gpiobus.c Modified: head/sys/dev/ow/owc_gpiobus.c ============================================================================== --- head/sys/dev/ow/owc_gpiobus.c Tue Dec 17 15:03:51 2019 (r355857) +++ head/sys/dev/ow/owc_gpiobus.c Tue Dec 17 15:56:48 2019 (r355858) @@ -38,17 +38,21 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #ifdef FDT -#include #include #include -#endif -#include -#include "gpiobus_if.h" +static struct ofw_compat_data compat_data[] = { + {"w1-gpio", true}, + {NULL, false} +}; +OFWBUS_PNP_INFO(compat_data); +SIMPLEBUS_PNP_INFO(compat_data); +#endif /* FDT */ -#include - #define OW_PIN 0 #define OWC_GPIOBUS_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) @@ -61,7 +65,7 @@ __FBSDID("$FreeBSD$"); struct owc_gpiobus_softc { device_t sc_dev; - device_t sc_busdev; + gpio_pin_t sc_pin; struct mtx sc_mtx; }; @@ -69,68 +73,69 @@ static int owc_gpiobus_probe(device_t); static int owc_gpiobus_attach(device_t); static int owc_gpiobus_detach(device_t); -#ifdef FDT -static void -owc_gpiobus_identify(driver_t *driver, device_t bus) +static int +owc_gpiobus_probe(device_t dev) { - phandle_t w1, root; + int rv; /* - * Find all the 1-wire bus pseudo-nodes that are - * at the top level of the FDT. Would be nice to - * somehow preserve the node name of these busses, - * but there's no good place to put it. The driver's - * name is used for the device name, and the 1-wire - * bus overwrites the description. + * By default we only bid to attach if specifically added by our parent + * (usually via hint.owc_gpiobus.#.at=busname). On FDT systems we bid + * as the default driver based on being configured in the FDT data. */ - root = OF_finddevice("/"); - if (root == -1) - return; - for (w1 = OF_child(root); w1 != 0; w1 = OF_peer(w1)) { - if (!fdt_is_compatible_strict(w1, "w1-gpio")) - continue; - if (!OF_hasprop(w1, "gpios")) - continue; - ofw_gpiobus_add_fdt_child(bus, driver->name, w1); - } -} -#endif + rv = BUS_PROBE_NOWILDCARD; -static int -owc_gpiobus_probe(device_t dev) -{ #ifdef FDT - if (!ofw_bus_status_okay(dev)) - return (ENXIO); + if (ofw_bus_status_okay(dev) && + ofw_bus_search_compatible(dev, compat_data)->ocd_data) + rv = BUS_PROBE_DEFAULT; +#endif - if (ofw_bus_is_compatible(dev, "w1-gpio")) { - device_set_desc(dev, "FDT GPIO attached one-wire bus"); - return (BUS_PROBE_DEFAULT); - } + device_set_desc(dev, "GPIO one-wire bus"); - return (ENXIO); -#else - device_set_desc(dev, "GPIO attached one-wire bus"); - return 0; -#endif + return (rv); } static int owc_gpiobus_attach(device_t dev) { struct owc_gpiobus_softc *sc; - device_t *kids; - int nkid; + int err; sc = device_get_softc(dev); sc->sc_dev = dev; - sc->sc_busdev = device_get_parent(dev); + +#ifdef FDT + /* Try to configure our pin from fdt data on fdt-based systems. */ + err = gpio_pin_get_by_ofw_idx(dev, ofw_bus_get_node(dev), OW_PIN, + &sc->sc_pin); +#else + err = ENOENT; +#endif + /* + * If we didn't get configured by fdt data and our parent is gpiobus, + * see if we can be configured by the bus (allows hinted attachment even + * on fdt-based systems). + */ + if (err != 0 && + strcmp("gpiobus", device_get_name(device_get_parent(dev))) == 0) + err = gpio_pin_get_by_child_index(dev, OW_PIN, &sc->sc_pin); + + /* If we didn't get configured by either method, whine and punt. */ + if (err != 0) { + device_printf(sc->sc_dev, + "cannot acquire gpio pin (config error)\n"); + return (err); + } + OWC_GPIOBUS_LOCK_INIT(sc); - nkid = 0; - if (device_get_children(dev, &kids, &nkid) == 0) - free(kids, M_TEMP); - if (nkid == 0) - device_add_child(dev, "ow", -1); + + /* + * Add the ow bus as a child, but defer probing and attaching it until + * interrupts work, because we can't do IO for them until we can read + * the system timecounter (which initializes after device attachments). + */ + device_add_child(sc->sc_dev, "ow", -1); return (bus_delayed_attach_children(dev)); } @@ -138,10 +143,16 @@ static int owc_gpiobus_detach(device_t dev) { struct owc_gpiobus_softc *sc; + int err; sc = device_get_softc(dev); + + if ((err = device_delete_children(dev)) != 0) + return (err); + + gpio_pin_release(sc->sc_pin); OWC_GPIOBUS_LOCK_DESTROY(sc); - bus_generic_detach(dev); + return (0); } @@ -154,18 +165,10 @@ owc_gpiobus_detach(device_t dev) * These macros let what why we're doing stuff shine in the code * below, and let the how be confined to here. */ -#define GETBUS(sc) GPIOBUS_ACQUIRE_BUS((sc)->sc_busdev, \ - (sc)->sc_dev, GPIOBUS_WAIT) -#define RELBUS(sc) GPIOBUS_RELEASE_BUS((sc)->sc_busdev, \ - (sc)->sc_dev) -#define OUTPIN(sc) GPIOBUS_PIN_SETFLAGS((sc)->sc_busdev, \ - (sc)->sc_dev, OW_PIN, GPIO_PIN_OUTPUT) -#define INPIN(sc) GPIOBUS_PIN_SETFLAGS((sc)->sc_busdev, \ - (sc)->sc_dev, OW_PIN, GPIO_PIN_INPUT) -#define GETPIN(sc, bit) GPIOBUS_PIN_GET((sc)->sc_busdev, \ - (sc)->sc_dev, OW_PIN, bit) -#define LOW(sc) GPIOBUS_PIN_SET((sc)->sc_busdev, \ - (sc)->sc_dev, OW_PIN, GPIO_PIN_LOW) +#define OUTPIN(sc) gpio_pin_setflags((sc)->sc_pin, GPIO_PIN_OUTPUT) +#define INPIN(sc) gpio_pin_setflags((sc)->sc_pin, GPIO_PIN_INPUT) +#define GETPIN(sc, bp) gpio_pin_is_active((sc)->sc_pin, (bp)) +#define LOW(sc) gpio_pin_set_active((sc)->sc_pin, false) /* * WRITE-ONE (see owll_if.m for timings) From Figure 4-1 AN-937 @@ -183,12 +186,8 @@ static int owc_gpiobus_write_one(device_t dev, struct ow_timing *t) { struct owc_gpiobus_softc *sc; - int error; sc = device_get_softc(dev); - error = GETBUS(sc); - if (error != 0) - return (error); critical_enter(); @@ -203,8 +202,6 @@ owc_gpiobus_write_one(device_t dev, struct ow_timing * critical_exit(); - RELBUS(sc); - return (0); } @@ -224,12 +221,8 @@ static int owc_gpiobus_write_zero(device_t dev, struct ow_timing *t) { struct owc_gpiobus_softc *sc; - int error; sc = device_get_softc(dev); - error = GETBUS(sc); - if (error != 0) - return (error); critical_enter(); @@ -244,8 +237,6 @@ owc_gpiobus_write_zero(device_t dev, struct ow_timing critical_exit(); - RELBUS(sc); - return (0); } @@ -268,13 +259,10 @@ static int owc_gpiobus_read_data(device_t dev, struct ow_timing *t, int *bit) { struct owc_gpiobus_softc *sc; - int error, sample; + bool sample; sbintime_t then, now; sc = device_get_softc(dev); - error = GETBUS(sc); - if (error != 0) - return (error); critical_enter(); @@ -293,7 +281,7 @@ owc_gpiobus_read_data(device_t dev, struct ow_timing * do { now = sbinuptime(); GETPIN(sc, &sample); - } while (now - then < (t->t_rdv + 2) * SBT_1US && sample == 0); + } while (now - then < (t->t_rdv + 2) * SBT_1US && sample == false); critical_exit(); if (now - then < t->t_rdv * SBT_1US) @@ -306,9 +294,7 @@ owc_gpiobus_read_data(device_t dev, struct ow_timing * now = sbinuptime(); } while (now - then < (t->t_slot + t->t_rec) * SBT_1US); - RELBUS(sc); - - return (error); + return (0); } /* @@ -324,32 +310,31 @@ owc_gpiobus_read_data(device_t dev, struct ow_timing * * || * * Note: for Regular Speed operations, tRSTL + tR should be less than 960us to - * avoid interferring with other devices on the bus + * avoid interfering with other devices on the bus. + * + * Return values in *bit: + * -1 = Bus wiring error (stuck low). + * 0 = no presence pulse + * 1 = presence pulse detected */ static int owc_gpiobus_reset_and_presence(device_t dev, struct ow_timing *t, int *bit) { struct owc_gpiobus_softc *sc; - int error; - int buf = -1; + bool sample; sc = device_get_softc(dev); - error = GETBUS(sc); - if (error != 0) - return (error); /* * Read the current state of the bus. The steady state of an idle bus is * high. Badly wired buses that are missing the required pull up, or * that have a short circuit to ground cause all kinds of mischief when - * we try to read them later. Return EIO and release the bus if the bus - * is currently low. + * we try to read them later. Return EIO if the bus is currently low. */ INPIN(sc); - GETPIN(sc, &buf); - if (buf == 0) { + GETPIN(sc, &sample); + if (sample == false) { *bit = -1; - RELBUS(sc); return (EIO); } @@ -365,8 +350,8 @@ owc_gpiobus_reset_and_presence(device_t dev, struct ow DELAY(t->t_pdh + t->t_pdl / 2); /* Read presence pulse */ - GETPIN(sc, &buf); - *bit = !!buf; + GETPIN(sc, &sample); + *bit = sample; critical_exit(); @@ -377,15 +362,12 @@ owc_gpiobus_reset_and_presence(device_t dev, struct ow * window. It should return to high. If it is low, then we have some * problem and should abort the reset. */ - GETPIN(sc, &buf); - if (buf == 0) { + GETPIN(sc, &sample); + if (sample == false) { *bit = -1; - RELBUS(sc); return (EIO); } - RELBUS(sc); - return (0); } @@ -393,9 +375,6 @@ static devclass_t owc_gpiobus_devclass; static device_method_t owc_gpiobus_methods[] = { /* Device interface */ -#ifdef FDT - DEVMETHOD(device_identify, owc_gpiobus_identify), -#endif DEVMETHOD(device_probe, owc_gpiobus_probe), DEVMETHOD(device_attach, owc_gpiobus_attach), DEVMETHOD(device_detach, owc_gpiobus_detach), @@ -412,6 +391,10 @@ static driver_t owc_gpiobus_driver = { owc_gpiobus_methods, sizeof(struct owc_gpiobus_softc), }; + +#ifdef FDT +DRIVER_MODULE(owc_gpiobus, simplebus, owc_gpiobus_driver, owc_gpiobus_devclass, 0, 0); +#endif DRIVER_MODULE(owc_gpiobus, gpiobus, owc_gpiobus_driver, owc_gpiobus_devclass, 0, 0); MODULE_DEPEND(owc_gpiobus, ow, 1, 1, 1); From owner-svn-src-head@freebsd.org Tue Dec 17 16:08:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE09A1EBE03; Tue, 17 Dec 2019 16:08:09 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cjjP5sTJz4VnT; Tue, 17 Dec 2019 16:08:09 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C45A718632; Tue, 17 Dec 2019 16:08:09 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBHG890h053009; Tue, 17 Dec 2019 16:08:09 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBHG877O052999; Tue, 17 Dec 2019 16:08:07 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201912171608.xBHG877O052999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 17 Dec 2019 16:08:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355859 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 355859 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 16:08:09 -0000 Author: rrs Date: Tue Dec 17 16:08:07 2019 New Revision: 355859 URL: https://svnweb.freebsd.org/changeset/base/355859 Log: This commit is a bit of a re-arrange of deck chairs. It gets both rack and bbr ready for the completion of the STATs framework in FreeBSD. For now if you don't have both NF_stats and stats on it disables them. As soon as the rest of the stats framework lands we can remove that restriction and then just uses stats when defined. Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D22479 Modified: head/sys/netinet/tcp_stacks/bbr.c head/sys/netinet/tcp_stacks/rack.c head/sys/netinet/tcp_stacks/rack_bbr_common.c head/sys/netinet/tcp_stacks/rack_bbr_common.h head/sys/netinet/tcp_stacks/sack_filter.c head/sys/netinet/tcp_stacks/tcp_bbr.h head/sys/netinet/tcp_stacks/tcp_rack.h head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Tue Dec 17 15:56:48 2019 (r355858) +++ head/sys/netinet/tcp_stacks/bbr.c Tue Dec 17 16:08:07 2019 (r355859) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016-2019 + * Copyright (c) 2016-9 * Netflix Inc. * All rights reserved. * @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ratelimit.h" #include "opt_kern_tls.h" #include +#include #include #include #ifdef TCP_HHOOK @@ -57,9 +58,9 @@ __FBSDID("$FreeBSD$"); #endif #include #include +#ifdef STATS #include #include -#ifdef NETFLIX_STATS #include /* Must come after qmath.h and tree.h */ #endif #include @@ -161,9 +162,8 @@ static int32_t bbr_num_pktepo_for_del_limit = BBR_NUM_ static int32_t bbr_hardware_pacing_limit = 8000; static int32_t bbr_quanta = 3; /* How much extra quanta do we get? */ static int32_t bbr_no_retran = 0; -static int32_t bbr_tcp_map_entries_limit = 1500; -static int32_t bbr_tcp_map_split_limit = 256; + static int32_t bbr_error_base_paceout = 10000; /* usec to pace */ static int32_t bbr_max_net_error_cnt = 10; /* Should the following be dynamic too -- loss wise */ @@ -3381,8 +3381,8 @@ bbr_alloc(struct tcp_bbr *bbr) static struct bbr_sendmap * bbr_alloc_full_limit(struct tcp_bbr *bbr) { - if ((bbr_tcp_map_entries_limit > 0) && - (bbr->r_ctl.rc_num_maps_alloced >= bbr_tcp_map_entries_limit)) { + if ((V_tcp_map_entries_limit > 0) && + (bbr->r_ctl.rc_num_maps_alloced >= V_tcp_map_entries_limit)) { BBR_STAT_INC(bbr_alloc_limited); if (!bbr->alloc_limit_reported) { bbr->alloc_limit_reported = 1; @@ -3402,8 +3402,8 @@ bbr_alloc_limit(struct tcp_bbr *bbr, uint8_t limit_typ if (limit_type) { /* currently there is only one limit type */ - if (bbr_tcp_map_split_limit > 0 && - bbr->r_ctl.rc_num_split_allocs >= bbr_tcp_map_split_limit) { + if (V_tcp_map_split_limit > 0 && + bbr->r_ctl.rc_num_split_allocs >= V_tcp_map_split_limit) { BBR_STAT_INC(bbr_split_limited); if (!bbr->alloc_limit_reported) { bbr->alloc_limit_reported = 1; @@ -3685,7 +3685,7 @@ bbr_ack_received(struct tcpcb *tp, struct tcp_bbr *bbr uint32_t cwnd, target_cwnd, saved_bytes, maxseg; int32_t meth; -#ifdef NETFLIX_STATS +#ifdef STATS if ((tp->t_flags & TF_GPUTINPROG) && SEQ_GEQ(th->th_ack, tp->gput_ack)) { /* @@ -6510,7 +6510,7 @@ tcp_bbr_xmit_timer_commit(struct tcp_bbr *bbr, struct } TCPSTAT_INC(tcps_rttupdated); tp->t_rttupdated++; -#ifdef NETFLIX_STATS +#ifdef STATS stats_voi_update_abs_u32(tp->t_stats, VOI_TCP_RTT, imax(0, rtt_ticks)); #endif /* @@ -8490,6 +8490,7 @@ dodata: /* XXX */ return (0); } } + #endif if (DELAY_ACK(tp, bbr, nsegs) || tfo_syn) { bbr->bbr_segs_rcvd += max(1, nsegs); @@ -8698,6 +8699,7 @@ bbr_do_fastnewdata(struct mbuf *m, struct tcphdr *th, * reassembly queue and we have enough buffer space to take it. */ nsegs = max(1, m->m_pkthdr.lro_nsegs); + #ifdef NETFLIX_SB_LIMITS if (so->so_rcv.sb_shlim) { mcnt = m_memcnt(m); @@ -8746,6 +8748,7 @@ bbr_do_fastnewdata(struct mbuf *m, struct tcphdr *th, newsize, so, NULL)) so->so_rcv.sb_flags &= ~SB_AUTOSIZE; m_adj(m, drop_hdrlen); /* delayed header drop */ + #ifdef NETFLIX_SB_LIMITS appended = #endif @@ -11561,7 +11564,7 @@ bbr_do_segment_nounlock(struct mbuf *m, struct tcphdr * the scale is zero. */ tiwin = th->th_win << tp->snd_scale; -#ifdef NETFLIX_STATS +#ifdef STATS stats_voi_update_abs_ulong(tp->t_stats, VOI_TCP_FRWIN, tiwin); #endif /* @@ -11960,7 +11963,7 @@ bbr_do_send_accounting(struct tcpcb *tp, struct tcp_bb if ((tp->t_flags & TF_FORCEDATA) && len == 1) { /* Window probe */ TCPSTAT_INC(tcps_sndprobe); -#ifdef NETFLIX_STATS +#ifdef STATS stats_voi_update_abs_u32(tp->t_stats, VOI_TCP_RETXPB, len); #endif @@ -11981,7 +11984,7 @@ bbr_do_send_accounting(struct tcpcb *tp, struct tcp_bb tp->t_sndrexmitpack++; TCPSTAT_INC(tcps_sndrexmitpack); TCPSTAT_ADD(tcps_sndrexmitbyte, len); -#ifdef NETFLIX_STATS +#ifdef STATS stats_voi_update_abs_u32(tp->t_stats, VOI_TCP_RETXPB, len); #endif @@ -12017,7 +12020,7 @@ bbr_do_send_accounting(struct tcpcb *tp, struct tcp_bb /* Place in 17's the total sent */ counter_u64_add(bbr_state_resend[17], len); counter_u64_add(bbr_state_lost[17], len); -#ifdef NETFLIX_STATS +#ifdef STATS stats_voi_update_abs_u64(tp->t_stats, VOI_TCP_TXPB, len); #endif @@ -12517,8 +12520,8 @@ recheck_resend: * as long as we are not retransmiting. */ if ((rsm == NULL) && - (bbr_tcp_map_entries_limit > 0) && - (bbr->r_ctl.rc_num_maps_alloced >= bbr_tcp_map_entries_limit)) { + (V_tcp_map_entries_limit > 0) && + (bbr->r_ctl.rc_num_maps_alloced >= V_tcp_map_entries_limit)) { BBR_STAT_INC(bbr_alloc_limited); if (!bbr->alloc_limit_reported) { bbr->alloc_limit_reported = 1; @@ -13256,7 +13259,6 @@ send: SOCKBUF_UNLOCK(&so->so_snd); return (EHOSTUNREACH); } - hdrlen += sizeof(struct udphdr); } #endif @@ -14276,7 +14278,7 @@ nomore: bbr_start_hpts_timer(bbr, tp, cts, 11, slot, 0); return (error); } -#ifdef NETFLIX_STATS +#ifdef STATS } else if (((tp->t_flags & TF_GPUTINPROG) == 0) && len && (rsm == NULL) && Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Tue Dec 17 15:56:48 2019 (r355858) +++ head/sys/netinet/tcp_stacks/rack.c Tue Dec 17 16:08:07 2019 (r355859) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016-2019 Netflix, Inc. + * Copyright (c) 2016-9 Netflix, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ratelimit.h" #include "opt_kern_tls.h" #include +#include #include #include #ifdef TCP_HHOOK @@ -52,7 +53,7 @@ __FBSDID("$FreeBSD$"); #endif #include #include -#ifdef NETFLIX_STATS +#ifdef STATS #include #include #include /* Must come after qmath.h and tree.h */ @@ -187,21 +188,6 @@ static int32_t rack_persist_max = 1000; /* 1 Second */ static int32_t rack_sack_not_required = 0; /* set to one to allow non-sack to use rack */ static int32_t rack_hw_tls_max_seg = 0; /* 0 means use hw-tls single segment */ -/* Sack attack detection thresholds and such */ -static int32_t tcp_force_detection = 0; - -#ifdef NETFLIX_EXP_DETECTION -static int32_t tcp_sack_to_ack_thresh = 700; /* 70 % */ -static int32_t tcp_sack_to_move_thresh = 600; /* 60 % */ -static int32_t tcp_restoral_thresh = 650; /* 65 % (sack:2:ack -5%) */ -static int32_t tcp_attack_on_turns_on_logging = 0; -static int32_t tcp_map_minimum = 500; -#endif -static int32_t tcp_sad_decay_val = 800; -static int32_t tcp_sad_pacing_interval = 2000; -static int32_t tcp_sad_low_pps = 100; - - /* * Currently regular tcp has a rto_min of 30ms * the backoff goes 12 times so that ends up @@ -226,10 +212,7 @@ static int32_t rack_always_send_oldest = 0; static int32_t rack_use_sack_filter = 1; static int32_t rack_tlp_threshold_use = TLP_USE_TWO_ONE; static int32_t rack_per_of_gp = 50; -static int32_t rack_tcp_map_entries_limit = 1500; -static int32_t rack_tcp_map_split_limit = 256; - /* Rack specific counters */ counter_u64_t rack_badfr; counter_u64_t rack_badfr_bytes; @@ -1577,9 +1560,9 @@ rack_alloc(struct tcp_rack *rack) static struct rack_sendmap * rack_alloc_full_limit(struct tcp_rack *rack) { - if ((rack_tcp_map_entries_limit > 0) && + if ((V_tcp_map_entries_limit > 0) && (rack->do_detection == 0) && - (rack->r_ctl.rc_num_maps_alloced >= rack_tcp_map_entries_limit)) { + (rack->r_ctl.rc_num_maps_alloced >= V_tcp_map_entries_limit)) { counter_u64_add(rack_to_alloc_limited, 1); if (!rack->alloc_limit_reported) { rack->alloc_limit_reported = 1; @@ -1598,9 +1581,9 @@ rack_alloc_limit(struct tcp_rack *rack, uint8_t limit_ if (limit_type) { /* currently there is only one limit type */ - if (rack_tcp_map_split_limit > 0 && + if (V_tcp_map_split_limit > 0 && (rack->do_detection == 0) && - rack->r_ctl.rc_num_split_allocs >= rack_tcp_map_split_limit) { + rack->r_ctl.rc_num_split_allocs >= V_tcp_map_split_limit) { counter_u64_add(rack_split_limited, 1); if (!rack->alloc_limit_reported) { rack->alloc_limit_reported = 1; @@ -1648,7 +1631,7 @@ static void rack_ack_received(struct tcpcb *tp, struct tcp_rack *rack, struct tcphdr *th, uint16_t nsegs, uint16_t type, int32_t recovery) { -#ifdef NETFLIX_STATS +#ifdef STATS int32_t gput; #endif @@ -1671,7 +1654,7 @@ rack_ack_received(struct tcpcb *tp, struct tcp_rack *r tp->ccv->flags &= ~CCF_CWND_LIMITED; if (type == CC_ACK) { -#ifdef NETFLIX_STATS +#ifdef STATS stats_voi_update_abs_s32(tp->t_stats, VOI_TCP_CALCFRWINDIFF, ((int32_t) tp->snd_cwnd) - tp->snd_wnd); if ((tp->t_flags & TF_GPUTINPROG) && @@ -1725,7 +1708,7 @@ rack_ack_received(struct tcpcb *tp, struct tcp_rack *r tp->ccv->curack = th->th_ack; CC_ALGO(tp)->ack_received(tp->ccv, type); } -#ifdef NETFLIX_STATS +#ifdef STATS stats_voi_update_abs_ulong(tp->t_stats, VOI_TCP_LCWIN, tp->snd_cwnd); #endif if (rack->r_ctl.rc_rack_largest_cwnd < tp->snd_cwnd) { @@ -2436,6 +2419,7 @@ rack_start_hpts_timer(struct tcp_rack *rack, struct tc slot = 1; } hpts_timeout = rack_timer_start(tp, rack, cts, sup_rack); +#ifdef NETFLIX_EXP_DETECTION if (rack->sack_attack_disable && (slot < USEC_TO_MSEC(tcp_sad_pacing_interval))) { /* @@ -2450,6 +2434,7 @@ rack_start_hpts_timer(struct tcp_rack *rack, struct tc */ slot = USEC_TO_MSEC(tcp_sad_pacing_interval); } +#endif if (tp->t_flags & TF_DELACK) { delayed_ack = TICKS_2_MSEC(tcp_delacktime); rack->r_ctl.rc_hpts_flags |= PACE_TMR_DELACK; @@ -3776,7 +3761,8 @@ refind: seq_out = rack_update_entry(tp, rack, nrsm, ts, &len); if (len == 0) { return; - } + } else if (len > 0) + goto refind; } } /* @@ -3912,7 +3898,7 @@ tcp_rack_xmit_timer_commit(struct tcp_rack *rack, stru TCPSTAT_INC(tcps_rttupdated); rack_log_rtt_upd(tp, rack, rtt, o_srtt, o_var); tp->t_rttupdated++; -#ifdef NETFLIX_STATS +#ifdef STATS stats_voi_update_abs_u32(tp->t_stats, VOI_TCP_RTT, imax(0, rtt)); #endif tp->t_rxtshift = 0; @@ -4620,6 +4606,7 @@ rack_peer_reneges(struct tcp_rack *rack, struct rack_s static void rack_do_decay(struct tcp_rack *rack) { +#ifdef NETFLIX_EXP_DETECTION struct timeval res; #define timersub(tvp, uvp, vvp) \ @@ -4670,6 +4657,7 @@ rack_do_decay(struct tcp_rack *rack) rack->r_ctl.sack_noextra_move = ctf_decay_count(rack->r_ctl.sack_noextra_move, tcp_sad_decay_val); } +#endif } static void @@ -7406,9 +7394,11 @@ rack_init(struct tcpcb *tp) rack->r_ctl.rc_last_time_decay = rack->r_ctl.rc_last_ack; rack->r_ctl.rc_tlp_rxt_last_time = tcp_ts_getticks(); /* Do we force on detection? */ +#ifdef NETFLIX_EXP_DETECTION if (tcp_force_detection) rack->do_detection = 1; else +#endif rack->do_detection = 0; if (tp->snd_una != tp->snd_max) { /* Create a send map for the current outstanding data */ @@ -7701,7 +7691,7 @@ rack_do_segment_nounlock(struct mbuf *m, struct tcphdr * the scale is zero. */ tiwin = th->th_win << tp->snd_scale; -#ifdef NETFLIX_STATS +#ifdef STATS stats_voi_update_abs_ulong(tp->t_stats, VOI_TCP_FRWIN, tiwin); #endif if (tiwin > rack->r_ctl.rc_high_rwnd) @@ -8390,8 +8380,8 @@ again: */ if ((rsm == NULL) && (rack->do_detection == 0) && - (rack_tcp_map_entries_limit > 0) && - (rack->r_ctl.rc_num_maps_alloced >= rack_tcp_map_entries_limit)) { + (V_tcp_map_entries_limit > 0) && + (rack->r_ctl.rc_num_maps_alloced >= V_tcp_map_entries_limit)) { counter_u64_add(rack_to_alloc_limited, 1); if (!rack->alloc_limit_reported) { rack->alloc_limit_reported = 1; @@ -9318,7 +9308,7 @@ send: } if ((tp->t_flags & TF_FORCEDATA) && len == 1) { TCPSTAT_INC(tcps_sndprobe); -#ifdef NETFLIX_STATS +#ifdef STATS if (SEQ_LT(tp->snd_nxt, tp->snd_max)) stats_voi_update_abs_u32(tp->t_stats, VOI_TCP_RETXPB, len); @@ -9339,14 +9329,14 @@ send: TCPSTAT_INC(tcps_sndrexmitpack); TCPSTAT_ADD(tcps_sndrexmitbyte, len); } -#ifdef NETFLIX_STATS +#ifdef STATS stats_voi_update_abs_u32(tp->t_stats, VOI_TCP_RETXPB, len); #endif } else { TCPSTAT_INC(tcps_sndpack); TCPSTAT_ADD(tcps_sndbyte, len); -#ifdef NETFLIX_STATS +#ifdef STATS stats_voi_update_abs_u64(tp->t_stats, VOI_TCP_TXPB, len); #endif @@ -9929,7 +9919,7 @@ out: tp->t_rtseq = startseq; TCPSTAT_INC(tcps_segstimed); } -#ifdef NETFLIX_STATS +#ifdef STATS if (!(tp->t_flags & TF_GPUTINPROG) && len) { tp->t_flags |= TF_GPUTINPROG; tp->gput_seq = startseq; @@ -10142,7 +10132,7 @@ rack_set_sockopt(struct socket *so, struct sockopt *so rack = (struct tcp_rack *)tp->t_fb_ptr; switch (sopt->sopt_name) { case TCP_RACK_DO_DETECTION: - RACK_OPTS_INC(tcp_rack_no_sack); + RACK_OPTS_INC(tcp_rack_do_detection); if (optval == 0) rack->do_detection = 0; else Modified: head/sys/netinet/tcp_stacks/rack_bbr_common.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack_bbr_common.c Tue Dec 17 15:56:48 2019 (r355858) +++ head/sys/netinet/tcp_stacks/rack_bbr_common.c Tue Dec 17 16:08:07 2019 (r355859) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016-2018 + * Copyright (c) 2016-9 * Netflix Inc. * All rights reserved. * @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ratelimit.h" #include "opt_kern_tls.h" #include +#include #include #include #ifdef TCP_HHOOK @@ -133,8 +134,6 @@ __FBSDID("$FreeBSD$"); * Common TCP Functions - These are shared by borth * rack and BBR. */ - - #ifdef KERN_TLS uint32_t ctf_get_opt_tls_size(struct socket *so, uint32_t rwnd) Modified: head/sys/netinet/tcp_stacks/rack_bbr_common.h ============================================================================== --- head/sys/netinet/tcp_stacks/rack_bbr_common.h Tue Dec 17 15:56:48 2019 (r355858) +++ head/sys/netinet/tcp_stacks/rack_bbr_common.h Tue Dec 17 16:08:07 2019 (r355859) @@ -1,5 +1,5 @@ -#ifndef __pacer_timer_h__ -#define __pacer_timer_h__ +#ifndef __rack_bbr_common_h__ +#define __rack_bbr_common_h__ /*- * Copyright (c) 2017-9 Netflix, Inc. * @@ -26,6 +26,12 @@ * * __FBSDID("$FreeBSD$"); */ + +/* XXXLAS: Couple STATS to NETFLIX_STATS until stats(3) is fully upstreamed. */ +#ifndef NETFLIX_STATS +#undef STATS +#endif + /* Common defines and such used by both RACK and BBR */ /* Special values for mss accounting array */ #define TCP_MSS_ACCT_JUSTRET 0 @@ -46,7 +52,24 @@ #define PROGRESS_CLEAR 3 #define PROGRESS_START 4 +/* codes for just-return */ +#define CTF_JR_SENT_DATA 0 +#define CTF_JR_CWND_LIMITED 1 +#define CTF_JR_RWND_LIMITED 2 +#define CTF_JR_APP_LIMITED 3 +#define CTF_JR_ASSESSING 4 +#define CTF_JR_PERSISTS 5 +#define CTF_JR_PRR 6 +/* Compat. */ +#define BBR_JR_SENT_DATA CTF_JR_SENT_DATA +#define BBR_JR_CWND_LIMITED CTF_JR_CWND_LIMITED +#define BBR_JR_RWND_LIMITED CTF_JR_RWND_LIMITED +#define BBR_JR_APP_LIMITED CTF_JR_APP_LIMITED +#define BBR_JR_ASSESSING CTF_JR_ASSESSING +#define BBR_JR_PERSISTS CTF_JR_PERSISTS +#define BBR_JR_PRR CTF_JR_PRR + /* RTT sample methods */ #define USE_RTT_HIGH 0 #define USE_RTT_LOW 1 @@ -58,6 +81,13 @@ #define MS_IN_USEC 1000 #define USEC_TO_MSEC(x) (x / MS_IN_USEC) #define TCP_TS_OVERHEAD 12 /* Overhead of having Timestamps on */ + +/* Bits per second in bytes per second */ +#define FORTY_EIGHT_MBPS 6000000 /* 48 megabits in bytes */ +#define THIRTY_MBPS 3750000 /* 30 megabits in bytes */ +#define TWENTY_THREE_MBPS 2896000 +#define FIVETWELVE_MBPS 64000000 /* 512 megabits in bytes */ +#define ONE_POINT_TWO_MEG 150000 /* 1.2 megabits in bytes */ #ifdef _KERNEL /* We have only 7 bits in rack so assert its true */ Modified: head/sys/netinet/tcp_stacks/sack_filter.c ============================================================================== --- head/sys/netinet/tcp_stacks/sack_filter.c Tue Dec 17 15:56:48 2019 (r355858) +++ head/sys/netinet/tcp_stacks/sack_filter.c Tue Dec 17 16:08:07 2019 (r355859) @@ -25,11 +25,16 @@ */ #include __FBSDID("$FreeBSD$"); +#ifndef _KERNEL +#define _WANT_TCPCB 1 +#endif #include #include #include +#ifdef _KERNEL #include #include +#endif #include #include #include Modified: head/sys/netinet/tcp_stacks/tcp_bbr.h ============================================================================== --- head/sys/netinet/tcp_stacks/tcp_bbr.h Tue Dec 17 15:56:48 2019 (r355858) +++ head/sys/netinet/tcp_stacks/tcp_bbr.h Tue Dec 17 16:08:07 2019 (r355859) @@ -128,12 +128,6 @@ TAILQ_HEAD(bbr_head, bbr_sendmap); * an clear to start measuring */ #define BBR_RED_BW_PE_NOEARLY_OUT 7 /* Set pkt epoch judged that we do not * get out of jail early */ -/* codes for just-return */ -#define BBR_JR_SENT_DATA 0 -#define BBR_JR_CWND_LIMITED 1 -#define BBR_JR_RWND_LIMITED 2 -#define BBR_JR_APP_LIMITED 3 -#define BBR_JR_ASSESSING 4 /* For calculating a rate */ #define BBR_CALC_BW 1 #define BBR_CALC_LOSS 2 @@ -384,13 +378,6 @@ struct bbr_log_sysctl_out { #define BBR_REDUCE_AT_FR 5 #define BBR_BIG_LOG_SIZE 300000 - -/* Bits per second in bytes per second */ -#define FORTY_EIGHT_MBPS 6000000 /* 48 megabits in bytes */ -#define THIRTY_MBPS 3750000 /* 30 megabits in bytes */ -#define TWENTY_THREE_MBPS 2896000 -#define FIVETWELVE_MBPS 64000000 /* 512 megabits in bytes */ -#define ONE_POINT_TWO_MEG 150000 /* 1.2 megabits in bytes */ struct bbr_stats { uint64_t bbr_badfr; /* 0 */ Modified: head/sys/netinet/tcp_stacks/tcp_rack.h ============================================================================== --- head/sys/netinet/tcp_stacks/tcp_rack.h Tue Dec 17 15:56:48 2019 (r355858) +++ head/sys/netinet/tcp_stacks/tcp_rack.h Tue Dec 17 16:08:07 2019 (r355859) @@ -137,7 +137,7 @@ struct rack_opts_stats { uint64_t tcp_rack_min_pace_seg; uint64_t tcp_rack_min_pace; uint64_t tcp_rack_cheat; - uint64_t tcp_rack_no_sack; + uint64_t tcp_rack_do_detection; }; #define TLP_USE_ID 1 /* Internet draft behavior */ Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Tue Dec 17 15:56:48 2019 (r355858) +++ head/sys/netinet/tcp_subr.c Tue Dec 17 16:08:07 2019 (r355859) @@ -138,6 +138,58 @@ VNET_DEFINE(int, tcp_mssdflt) = TCP_MSS; VNET_DEFINE(int, tcp_v6mssdflt) = TCP6_MSS; #endif +#ifdef NETFLIX_EXP_DETECTION +/* Sack attack detection thresholds and such */ +SYSCTL_NODE(_net_inet_tcp, OID_AUTO, sack_attack, CTLFLAG_RW, 0, + "Sack Attack detection thresholds"); +int32_t tcp_force_detection = 0; +SYSCTL_INT(_net_inet_tcp_sack_attack, OID_AUTO, force_detection, + CTLFLAG_RW, + &tcp_force_detection, 0, + "Do we force detection even if the INP has it off?"); +int32_t tcp_sack_to_ack_thresh = 700; /* 70 % */ +SYSCTL_INT(_net_inet_tcp_sack_attack, OID_AUTO, sack_to_ack_thresh, + CTLFLAG_RW, + &tcp_sack_to_ack_thresh, 700, + "Percentage of sacks to acks we must see above (10.1 percent is 101)?"); +int32_t tcp_sack_to_move_thresh = 600; /* 60 % */ +SYSCTL_INT(_net_inet_tcp_sack_attack, OID_AUTO, move_thresh, + CTLFLAG_RW, + &tcp_sack_to_move_thresh, 600, + "Percentage of sack moves we must see above (10.1 percent is 101)"); +int32_t tcp_restoral_thresh = 650; /* 65 % (sack:2:ack -5%) */ +SYSCTL_INT(_net_inet_tcp_sack_attack, OID_AUTO, restore_thresh, + CTLFLAG_RW, + &tcp_restoral_thresh, 550, + "Percentage of sack to ack percentage we must see below to restore(10.1 percent is 101)"); +int32_t tcp_sad_decay_val = 800; +SYSCTL_INT(_net_inet_tcp_sack_attack, OID_AUTO, decay_per, + CTLFLAG_RW, + &tcp_sad_decay_val, 800, + "The decay percentage (10.1 percent equals 101 )"); +int32_t tcp_map_minimum = 500; +SYSCTL_INT(_net_inet_tcp_sack_attack, OID_AUTO, nummaps, + CTLFLAG_RW, + &tcp_map_minimum, 500, + "Number of Map enteries before we start detection"); +int32_t tcp_attack_on_turns_on_logging = 0; +SYSCTL_INT(_net_inet_tcp_sack_attack, OID_AUTO, attacks_logged, + CTLFLAG_RW, + &tcp_attack_on_turns_on_logging, 0, + "When we have a positive hit on attack, do we turn on logging?"); +int32_t tcp_sad_pacing_interval = 2000; +SYSCTL_INT(_net_inet_tcp_sack_attack, OID_AUTO, sad_pacing_int, + CTLFLAG_RW, + &tcp_sad_pacing_interval, 2000, + "What is the minimum pacing interval for a classified attacker?"); + +int32_t tcp_sad_low_pps = 100; +SYSCTL_INT(_net_inet_tcp_sack_attack, OID_AUTO, sad_low_pps, + CTLFLAG_RW, + &tcp_sad_low_pps, 100, + "What is the input pps that below which we do not decay?"); +#endif + struct rwlock tcp_function_lock; static int @@ -240,6 +292,34 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, soreceive_stream, VNET_DEFINE(uma_zone_t, sack_hole_zone); #define V_sack_hole_zone VNET(sack_hole_zone) +VNET_DEFINE(uint32_t, tcp_map_entries_limit) = 0; /* unlimited */ +static int +sysctl_net_inet_tcp_map_limit_check(SYSCTL_HANDLER_ARGS) +{ + int error; + uint32_t new; + + new = V_tcp_map_entries_limit; + error = sysctl_handle_int(oidp, &new, 0, req); + if (error == 0 && req->newptr) { + /* only allow "0" and value > minimum */ + if (new > 0 && new < TCP_MIN_MAP_ENTRIES_LIMIT) + error = EINVAL; + else + V_tcp_map_entries_limit = new; + } + return (error); +} +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, map_limit, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + &VNET_NAME(tcp_map_entries_limit), 0, + &sysctl_net_inet_tcp_map_limit_check, "IU", + "Total sendmap entries limit"); + +VNET_DEFINE(uint32_t, tcp_map_split_limit) = 0; /* unlimited */ +SYSCTL_UINT(_net_inet_tcp, OID_AUTO, split_limit, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(tcp_map_split_limit), 0, + "Total sendmap split entries limit"); #ifdef TCP_HHOOK VNET_DEFINE(struct hhook_head *, tcp_hhh[HHOOK_TCP_LAST+1]); Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Tue Dec 17 15:56:48 2019 (r355858) +++ head/sys/netinet/tcp_var.h Tue Dec 17 16:08:07 2019 (r355859) @@ -235,6 +235,9 @@ struct tcptemp { struct tcphdr tt_t; }; +/* Minimum map entries limit value, if set */ +#define TCP_MIN_MAP_ENTRIES_LIMIT 128 + /* * TODO: We yet need to brave plowing in * to tcp_input() and the pru_usrreq() block. @@ -790,6 +793,8 @@ VNET_DECLARE(int, tcp_ecn_maxretries); VNET_DECLARE(int, tcp_initcwnd_segments); VNET_DECLARE(int, tcp_insecure_rst); VNET_DECLARE(int, tcp_insecure_syn); +VNET_DECLARE(uint32_t, tcp_map_entries_limit); +VNET_DECLARE(uint32_t, tcp_map_split_limit); VNET_DECLARE(int, tcp_minmss); VNET_DECLARE(int, tcp_mssdflt); #ifdef STATS @@ -830,6 +835,8 @@ VNET_DECLARE(struct inpcbinfo, tcbinfo); #define V_tcp_initcwnd_segments VNET(tcp_initcwnd_segments) #define V_tcp_insecure_rst VNET(tcp_insecure_rst) #define V_tcp_insecure_syn VNET(tcp_insecure_syn) +#define V_tcp_map_entries_limit VNET(tcp_map_entries_limit) +#define V_tcp_map_split_limit VNET(tcp_map_split_limit) #define V_tcp_minmss VNET(tcp_minmss) #define V_tcp_mssdflt VNET(tcp_mssdflt) #ifdef STATS @@ -845,7 +852,6 @@ VNET_DECLARE(struct inpcbinfo, tcbinfo); #define V_tcp_udp_tunneling_overhead VNET(tcp_udp_tunneling_overhead) #define V_tcp_udp_tunneling_port VNET(tcp_udp_tunneling_port) - #ifdef TCP_HHOOK VNET_DECLARE(struct hhook_head *, tcp_hhh[HHOOK_TCP_LAST + 1]); #define V_tcp_hhh VNET(tcp_hhh) @@ -914,6 +920,19 @@ extern counter_u64_t tcp_inp_lro_compressed; extern counter_u64_t tcp_inp_lro_single_push; extern counter_u64_t tcp_inp_lro_locks_taken; extern counter_u64_t tcp_inp_lro_sack_wake; + +#ifdef NETFLIX_EXP_DETECTION +/* Various SACK attack thresholds */ +extern int32_t tcp_force_detection; +extern int32_t tcp_sack_to_ack_thresh; +extern int32_t tcp_sack_to_move_thresh; +extern int32_t tcp_restoral_thresh; +extern int32_t tcp_sad_decay_val; +extern int32_t tcp_sad_pacing_interval; +extern int32_t tcp_sad_low_pps; +extern int32_t tcp_map_minimum; +extern int32_t tcp_attack_on_turns_on_logging; +#endif uint32_t tcp_maxmtu(struct in_conninfo *, struct tcp_ifcap *); uint32_t tcp_maxmtu6(struct in_conninfo *, struct tcp_ifcap *); From owner-svn-src-head@freebsd.org Tue Dec 17 17:03:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C338B1ECDCA; Tue, 17 Dec 2019 17:03:03 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47ckwl4nyJz4Y7V; Tue, 17 Dec 2019 17:03:03 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FDC5190BC; Tue, 17 Dec 2019 17:03:03 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBHH339T087601; Tue, 17 Dec 2019 17:03:03 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBHH33Ym087599; Tue, 17 Dec 2019 17:03:03 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201912171703.xBHH33Ym087599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 17 Dec 2019 17:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355860 - in head/sys: arm/freescale/imx arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: arm/freescale/imx arm64/rockchip X-SVN-Commit-Revision: 355860 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 17:03:03 -0000 Author: ian Date: Tue Dec 17 17:03:03 2019 New Revision: 355860 URL: https://svnweb.freebsd.org/changeset/base/355860 Log: Remove unnecessary MODULE_DEPEND() from imx_i2c.c, and also from rk_i2c where it got copied to. Modified: head/sys/arm/freescale/imx/imx_i2c.c head/sys/arm64/rockchip/rk_i2c.c Modified: head/sys/arm/freescale/imx/imx_i2c.c ============================================================================== --- head/sys/arm/freescale/imx/imx_i2c.c Tue Dec 17 16:08:07 2019 (r355859) +++ head/sys/arm/freescale/imx/imx_i2c.c Tue Dec 17 17:03:03 2019 (r355860) @@ -193,7 +193,6 @@ static devclass_t i2c_devclass; DRIVER_MODULE(imx_i2c, simplebus, i2c_driver, i2c_devclass, 0, 0); DRIVER_MODULE(ofw_iicbus, imx_i2c, ofw_iicbus_driver, ofw_iicbus_devclass, 0, 0); MODULE_DEPEND(imx_i2c, iicbus, 1, 1, 1); -MODULE_DEPEND(imx_i2c, ofw_iicbus, 1, 1, 1); SIMPLEBUS_PNP_INFO(compat_data); static phandle_t Modified: head/sys/arm64/rockchip/rk_i2c.c ============================================================================== --- head/sys/arm64/rockchip/rk_i2c.c Tue Dec 17 16:08:07 2019 (r355859) +++ head/sys/arm64/rockchip/rk_i2c.c Tue Dec 17 17:03:03 2019 (r355860) @@ -699,5 +699,4 @@ EARLY_DRIVER_MODULE(rk_i2c, simplebus, rk_i2c_driver, EARLY_DRIVER_MODULE(ofw_iicbus, rk_i2c, ofw_iicbus_driver, ofw_iicbus_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); MODULE_DEPEND(rk_i2c, iicbus, 1, 1, 1); -MODULE_DEPEND(rk_i2c, ofw_iicbus, 1, 1, 1); MODULE_VERSION(rk_i2c, 1); From owner-svn-src-head@freebsd.org Tue Dec 17 17:17:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C7E2A1ED120; Tue, 17 Dec 2019 17:17:25 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) (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 47clFJ18jWz4Ydw; Tue, 17 Dec 2019 17:17:23 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward100q.mail.yandex.net (forward100q.mail.yandex.net [IPv6:2a02:6b8:c0e:4b:0:640:4012:bb97]) by forward102j.mail.yandex.net (Yandex) with ESMTP id 22F97F200BA; Tue, 17 Dec 2019 20:17:20 +0300 (MSK) Received: from mxback2q.mail.yandex.net (mxback2q.mail.yandex.net [IPv6:2a02:6b8:c0e:40:0:640:9c8c:4946]) by forward100q.mail.yandex.net (Yandex) with ESMTP id 1CCA87080004; Tue, 17 Dec 2019 20:17:20 +0300 (MSK) Received: from vla4-a16f3368381d.qloud-c.yandex.net (vla4-a16f3368381d.qloud-c.yandex.net [2a02:6b8:c17:d85:0:640:a16f:3368]) by mxback2q.mail.yandex.net (mxback/Yandex) with ESMTP id AIAWy8FpPE-HJd4HkJK; Tue, 17 Dec 2019 20:17:20 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1576603040; bh=DEjhmYtBNrU7L4R8gbxb4b0vYu/BmpMgpPzwqUQE1LA=; h=In-Reply-To:From:Date:References:To:Subject:Message-ID; b=TLr/aEfVACksWVcHCAB4Itz/YMSHbztXjfaD+w72gDq1fQKonGq1kfqx9+UAeW4fl xT0F/2y3y6VK7xw2G58f7/EgzfsUkxqxw1yEm88i5eAmNBFMmogvCP7Ns0hYM1rtpA vH6jzQxph7mlCOltTPFt2f8JfTJtJDsGAcaOq95w= Received: by vla4-a16f3368381d.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id 5wY9MyfDJt-HJVKtfXw; Tue, 17 Dec 2019 20:17:19 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Subject: Re: svn commit: r341578 - head/sys/dev/mlx5/mlx5_en To: Hans Petter Selasky , Slava Shwartsman , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051420.wB5EKwxr099242@repo.freebsd.org> <8715aa7b-ceea-7cfd-1980-a260c98070d5@yandex.ru> <6151923d-05bb-b945-359e-d632708ba021@selasky.org> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= mQENBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAG0JUFuZHJleSBWLiBFbHN1a292IDxidTdjaGVyQHlhbmRleC5ydT6JATgEEwECACIFAkwB F1kCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEAHF6gQQyKF6qmYIAI6ekfm1VA4T vqankI1ISE6ku4jV7UlpIQlEbE7/8n3Zd6teJ+pGOQhN5qk8QE7utdPdbktAzi+x7LIJVzUw 4TywZLXGrkP7VKYkfg6oyCGyzITghefQeJtr2TN4hYCkzPWpylkue8MtmqfZv/6royqwTbN+ +E09FQNvTgRUYJYTeQ1qOsxNRycwvw3dr2rOfuxShbzaHBB1pBIjGrMg8fC5pd65ACH5zuFV A0CoTNGMDrEZSfBkTW604UUHFFXeCoC3dwDZRKOWJ3GmMXns65Ai5YkA63BSHEE1Qle3VBhd cG1w0CB5FBV3pB27UVnf0jEbysrDqW4qN7XMRFSWNAy5AQ0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAYkBHwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <60698d75-ca26-da71-682c-ec7d24f0eab6@yandex.ru> Date: Tue, 17 Dec 2019 20:14:35 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <6151923d-05bb-b945-359e-d632708ba021@selasky.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="C3uohgIZIngDLk3qugCqJrUeptLYnHMh7" X-Rspamd-Queue-Id: 47clFJ18jWz4Ydw X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yandex.ru header.s=mail header.b=TLr/aEfV; dmarc=pass (policy=none) header.from=yandex.ru; spf=pass (mx1.freebsd.org: domain of bu7cher@yandex.ru designates 5.45.198.243 as permitted sender) smtp.mailfrom=bu7cher@yandex.ru X-Spamd-Result: default: False [-6.20 / 15.00]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:5.45.192.0/19]; FREEMAIL_FROM(0.00)[yandex.ru]; HAS_ATTACHMENT(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[yandex.ru:+]; DMARC_POLICY_ALLOW(-0.50)[yandex.ru,none]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[243.198.45.5.list.dnswl.org : 127.0.5.1]; ASN(0.00)[asn:13238, ipnet:5.45.192.0/18, country:RU]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[yandex.ru:s=mail]; FROM_HAS_DN(0.00)[]; FREEMAIL_ENVFROM(0.00)[yandex.ru]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain]; IP_SCORE(0.00)[ipnet: 5.45.192.0/18(-4.82), asn: 13238(-3.78), country: RU(0.01)]; IP_SCORE_FREEMAIL(0.00)[]; DWL_DNSWL_LOW(-1.00)[yandex.ru.dwl.dnswl.org : 127.0.5.1]; TO_MATCH_ENVRCPT_SOME(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 17:17:25 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --C3uohgIZIngDLk3qugCqJrUeptLYnHMh7 Content-Type: multipart/mixed; boundary="YAMnh3pzM1iWcSxXeJlDRplnwIdZABgpc"; protected-headers="v1" From: "Andrey V. Elsukov" To: Hans Petter Selasky , Slava Shwartsman , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <60698d75-ca26-da71-682c-ec7d24f0eab6@yandex.ru> Subject: Re: svn commit: r341578 - head/sys/dev/mlx5/mlx5_en References: <201812051420.wB5EKwxr099242@repo.freebsd.org> <8715aa7b-ceea-7cfd-1980-a260c98070d5@yandex.ru> <6151923d-05bb-b945-359e-d632708ba021@selasky.org> In-Reply-To: <6151923d-05bb-b945-359e-d632708ba021@selasky.org> --YAMnh3pzM1iWcSxXeJlDRplnwIdZABgpc Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 13.12.2019 17:27, Hans Petter Selasky wrote: > On 2019-12-13 14:40, Andrey V. Elsukov wrote: >> On 05.12.2018 17:20, Slava Shwartsman wrote: >>> Author: slavash >>> Date: Wed Dec=C2=A0 5 14:20:57 2018 >>> New Revision: 341578 >>> URL: https://svnweb.freebsd.org/changeset/base/341578 >>> >>> Log: >>> =C2=A0=C2=A0 mlx5en: Remove the DRBR and associated logic in the tran= smit path. >>> =C2=A0=C2=A0 =C2=A0=C2=A0 The hardware queues are deep enough current= ly and using the >>> DRBR and associated >>> =C2=A0=C2=A0 callbacks only leads to more task switching in the TX pa= th. The is >>> also a race >>> =C2=A0=C2=A0 setting the queue_state which can lead to hung TX rings.= >> >> JFYI. We have compared the same router+firewall workloads on the host >> with this change and before, and I can say, that without DRBR on TX no= w >> we constantly have several percents of packets drops due to ENOBUFS >> error from mlx5e_xmit(). >> >=20 > Have you tried to tune the TX/RX parameters? >=20 > Especially the tx_queue_size . We use the following settings: % sysctl dev.mce.4.conf. | grep que dev.mce.4.conf.rx_queue_size: 16384 dev.mce.4.conf.tx_queue_size: 16384 dev.mce.4.conf.rx_queue_size_max: 16384 dev.mce.4.conf.tx_queue_size_max: 16384 Also, previously I have patched MLX5E_SQ_TX_QUEUE_SIZE value up to 16384.= --=20 WBR, Andrey V. Elsukov --YAMnh3pzM1iWcSxXeJlDRplnwIdZABgpc-- --C3uohgIZIngDLk3qugCqJrUeptLYnHMh7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAl35DPsACgkQAcXqBBDI oXpjAAgAjWJhnrYCqMijx0rsjTxwwVfVGImL4JpYARwEJ8TKNk/5tYyH8WNb9LrS GQoE0dSoalxgSc5m7hV/LlX1qi188h2j3+FljiekU0It8RiIWAzvIMp9xpFwDpi4 nZ5O9ppAJ+O3XFOV9K4P3R/5l4mPy9AVAmYDnk9qMKGfk7L/Pej8fFq/h0s3Vo9o Zq67OGTRkfqRQLUiMRfrIo+mM46NWAW6Z/8Wo1Gu23mkOif4DIUP0HeJLyU+/nl/ 1WtD3NGprsN1IXqF7D32L7HAeTfvF8GF9TOTNm3QIi+vhZQtwL0grG+cxjcVHIU3 arCa/iuWJkbZJcPucTv+yczzQDXsGg== =DBXn -----END PGP SIGNATURE----- --C3uohgIZIngDLk3qugCqJrUeptLYnHMh7-- From owner-svn-src-head@freebsd.org Tue Dec 17 18:14:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ACD651EE6DE; Tue, 17 Dec 2019 18:14:36 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (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 47cmWH6BjRz4cWT; Tue, 17 Dec 2019 18:14:35 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-oi1-f175.google.com with SMTP id k4so1756119oik.2; Tue, 17 Dec 2019 10:14:35 -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:content-transfer-encoding; bh=Vo+NQA9e303OuVzvIyiKD/SymH6xRGqFl3UAiI7WTS0=; b=TmAFVirwRFrqDTgszVDysEEY4hzKnkwaJKEJEBigcD/lZlJdKf/J+YcKhsez/xnDAH L5bF1LVyWW+dKVaxPEtJ60N79Br8WIo1l+lzOPU4hdi49nqhR0NyDwugzw8bCvdWNKxU ThIZ6+FILKAQZs9iuIO0qsPM32+jZJjP+oBLmaHg91bAPBoMRL2F8PAkIEvah6DgVtNh m1fX33Mi17zFQtk2gT1aeh4byMM/+vSGf1QEJXZeW6fPVIzK32J6pv1t7qVV//EP3fDZ iIBOlFDFQVfIWcSzJipDnSFvbN1uXCKuYIPUXTpQLjSa8dzgYv0Jczf1po6dXY5vR/Pf fMgQ== X-Gm-Message-State: APjAAAUuQhnaxpozzSP7UW9ze+M70Am6lN2r627Nt/4axdlUfg1NgJL9 WR3e9TYyxw+EbfVmdeAu7QdVMMeQJiZ3PtX66QI= X-Google-Smtp-Source: APXvYqxdF9WW0AbY1+kxaS2fl9D9gF8inuQOoUuXDI6R39e6vG0OHdTed7JzOWS22vZXGAJg1y/JcE9nHngTSO4ghjA= X-Received: by 2002:aca:a9c5:: with SMTP id s188mr1206431oie.154.1576606474756; Tue, 17 Dec 2019 10:14:34 -0800 (PST) MIME-Version: 1.0 References: <201912162007.xBGK74ij043925@repo.freebsd.org> In-Reply-To: From: Edward Napierala Date: Tue, 17 Dec 2019 18:14:23 +0000 Message-ID: Subject: Re: svn commit: r355818 - in head: share/man/man4 sys/amd64/linux sys/amd64/linux32 sys/arm64/linux sys/compat/linux sys/i386/linux To: Enji Cooper Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 47cmWH6BjRz4cWT X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of etnapierala@gmail.com designates 209.85.167.175 as permitted sender) smtp.mailfrom=etnapierala@gmail.com X-Spamd-Result: default: False [-3.08 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[175.167.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.08)[ip: (-0.32), ipnet: 209.85.128.0/17(-3.12), asn: 15169(-1.90), country: US(-0.05)]; FORGED_SENDER(0.30)[trasz@freebsd.org,etnapierala@gmail.com]; FREEMAIL_TO(0.00)[gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[175.167.85.209.rep.mailspike.net : 127.0.0.17]; 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)[trasz@freebsd.org,etnapierala@gmail.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 18:14:36 -0000 On Mon, 16 Dec 2019 at 20:59, Enji Cooper wrote: > > > > On Dec 16, 2019, at 12:07, Edward Tomasz Napierala = wrote: > > > > =EF=BB=BFAuthor: trasz > > Date: Mon Dec 16 20:07:04 2019 > > New Revision: 355818 > > URL: https://svnweb.freebsd.org/changeset/base/355818 > > > > Log: > > Add compat.linux.emul_path, so it can be set to something other > > than "/compat/linux". Useful when you have several compat directories > > with different Linux versions and you don't want to clash with files > > installed by linux-c7 packages. > > Hi Edward! > Great feature :).. i was wondering if it made sense to implement this= sysctl as a per-jail setting so one jail could have one setting and anothe= r have another setting? Arguably, one could just leave the default, but it= =E2=80=99s a just thought I had when reading your commit message. Thanks! Yes, eventually this could be turned into a per-jail parameter. In most cases it just doesn't matter within a jail, though - for Linux jails you probably want to have a usual Linux root filesystem, without /compat/linux; thus, linuxulator path translation will be a nop. From owner-svn-src-head@freebsd.org Tue Dec 17 18:28:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76E311EEAB4; Tue, 17 Dec 2019 18:28:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cmqC2bQSz4d57; Tue, 17 Dec 2019 18:28:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from [192.168.0.5] (unknown [181.52.72.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: pfg) by smtp.freebsd.org (Postfix) with ESMTPSA id D4ADEAD72; Tue, 17 Dec 2019 18:28:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Subject: Re: svn commit: r355828 - head/sys/sys To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201912162355.xBGNtUq6078840@repo.freebsd.org> <201912170442.xBH4gUOg063777@slippy.cwsent.com> From: Pedro Giffuni Organization: FreeBSD Message-ID: Date: Tue, 17 Dec 2019 13:28:20 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <201912170442.xBH4gUOg063777@slippy.cwsent.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 18:28:23 -0000 On 16/12/2019 23:42, Cy Schubert wrote: > In message <201912162355.xBGNtUq6078840@repo.freebsd.org>, "Pedro F. > Giffuni" w > rites: >> Author: pfg >> Date: Mon Dec 16 23:55:30 2019 >> New Revision: 355828 >> URL: https://svnweb.freebsd.org/changeset/base/355828 >> >> Log: >> Double the size of ARG_MAX on LP64 platforms. >> >> As modern software keeps growing in size, we get requests to update the >> value of ARG_MAX in order to link the resulting object files. Other OSs >> have much higher values but Increasiong ARG_MAX has a multiplied effect on >> KVA, so just bumping this value is dangerous in some archs like ARM32 that >> can exhaust KVA rather easily. >> >> While it would be better to have a unique value for all archs, other OSs >> (Illumos in partidular) can have different ARG_MAX limits depending on the >> platform, For now we want to be really conservative so we are avoidng >> the change on ILP32 and in the alternative case we only double it since tha >> t >> seems to work well enough for recent Code Aster. >> >> I was planning to bump the _FreeBSD_version but it was bumped recently >> (r355798) so we can reuse the 1300068 value for this change. > This doesn't seem right. Each bump should be for a distinct change and > documented as such. TBH, it is just not worth it: this change will currently benefit only one port (french/aster) and the update won't be committed until after the MFC is done. It is rather more painful that the change only fixes the case for some platforms. Pedro. > Also, it's not like we're saving any build time anyway. sys/syslimits.h > will cause a substantial portion to be rebuilt anyway. > >> >> PR: 241710 >> MFC after: 5 days >> >> Modified: >> head/sys/sys/syslimits.h >> >> Modified: head/sys/sys/syslimits.h >> ============================================================================= >> = >> --- head/sys/sys/syslimits.h Mon Dec 16 23:08:09 2019 (r355827) >> +++ head/sys/sys/syslimits.h Mon Dec 16 23:55:30 2019 (r355828) >> @@ -48,7 +48,11 @@ >> * Do not add any new variables here. (See the comment at the end of >> * the file for why.) >> */ >> -#define ARG_MAX 262144 /* max bytes for an exec functi >> on */ >> +#ifndef __ILP32__ >> +#define ARG_MAX (2 * 256 * 1024) /* max bytes for an exec functi >> on */ >> +#else >> +#define ARG_MAX (256 * 1024) /* max bytes for KVA-starved ar >> chs */ >> +#endif >> #ifndef CHILD_MAX >> #define CHILD_MAX 40 /* max simultaneous processes * >> / >> #endif >> > From owner-svn-src-head@freebsd.org Tue Dec 17 19:01:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 509C41EF28F; Tue, 17 Dec 2019 19:01:10 +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 47cnY219jkz4fdK; Tue, 17 Dec 2019 19:01:10 +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 23BEA1A4CA; Tue, 17 Dec 2019 19:01:10 +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 xBHJ1ABS054187; Tue, 17 Dec 2019 19:01:10 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBHJ1AHg054186; Tue, 17 Dec 2019 19:01:10 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201912171901.xBHJ1AHg054186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 17 Dec 2019 19:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355861 - head/tests/sys/geom/class/multipath X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/geom/class/multipath X-SVN-Commit-Revision: 355861 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 19:01:10 -0000 Author: lwhsu Date: Tue Dec 17 19:01:09 2019 New Revision: 355861 URL: https://svnweb.freebsd.org/changeset/base/355861 Log: Temporarily skip failing sys.geom.class.multipath.failloop.failloop on i386 CI PR: 242689 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/geom/class/multipath/failloop.sh Modified: head/tests/sys/geom/class/multipath/failloop.sh ============================================================================== --- head/tests/sys/geom/class/multipath/failloop.sh Tue Dec 17 17:03:03 2019 (r355860) +++ head/tests/sys/geom/class/multipath/failloop.sh Tue Dec 17 19:01:09 2019 (r355861) @@ -36,6 +36,11 @@ failloop_head() } failloop_body() { + if [ "$(atf_config_get ci false)" = "true" ] && \ + [ "$(uname -p)" = "i386" ]; then + atf_skip "https://bugs.freebsd.org/242689" + fi + sysctl -n kern.geom.notaste > kern.geom.notaste.txt load_gnop load_gmultipath From owner-svn-src-head@freebsd.org Tue Dec 17 21:34:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B84381CAC2A; Tue, 17 Dec 2019 21:34: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 47cry64Krlz3KK6; Tue, 17 Dec 2019 21:34: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 8FD441C18A; Tue, 17 Dec 2019 21:34: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 xBHLYcvf049061; Tue, 17 Dec 2019 21:34:38 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBHLYc0A049060; Tue, 17 Dec 2019 21:34:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201912172134.xBHLYc0A049060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 17 Dec 2019 21:34:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355864 - head/sys/dev/an X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/an X-SVN-Commit-Revision: 355864 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 21:34:38 -0000 Author: markj Date: Tue Dec 17 21:34:38 2019 New Revision: 355864 URL: https://svnweb.freebsd.org/changeset/base/355864 Log: an(4): Require privileges for all SIOCGAIRONET requests. SIOCGAIRONET allows userspace to query an(4) for various device properties and configuration, which appears to potentially include sensitive information such as WEP keys (an(4) seems to predate WPA). Also avoid races by copying in the request structure to a temporary buffer before locking and modifying the device softc. Reported by: Ilja Van Sprundel MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/an/if_an.c Modified: head/sys/dev/an/if_an.c ============================================================================== --- head/sys/dev/an/if_an.c Tue Dec 17 20:30:32 2019 (r355863) +++ head/sys/dev/an/if_an.c Tue Dec 17 21:34:38 2019 (r355864) @@ -1875,6 +1875,7 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t da int len; int i, max; struct an_softc *sc; + struct an_req *areq; struct ifreq *ifr; struct thread *td = curthread; struct ieee80211req *ireq; @@ -1934,17 +1935,21 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t da error = 0; break; case SIOCGAIRONET: - error = copyin(ifr_data_get_ptr(ifr), &sc->areq, - sizeof(sc->areq)); - if (error != 0) + error = priv_check(td, PRIV_DRIVER); + if (error) break; + areq = malloc(sizeof(*areq), M_TEMP, M_WAITOK); + error = copyin(ifr_data_get_ptr(ifr), areq, sizeof(*areq)); + if (error != 0) { + free(areq, M_TEMP); + break; + } AN_LOCK(sc); + memcpy(&sc->areq, areq, sizeof(sc->areq)); #ifdef ANCACHE if (sc->areq.an_type == AN_RID_ZERO_CACHE) { - error = priv_check(td, PRIV_DRIVER); - if (error) - break; sc->an_sigitems = sc->an_nextitem = 0; + free(areq, M_TEMP); break; } else if (sc->areq.an_type == AN_RID_READ_CACHE) { char *pt = (char *)&sc->areq.an_val; @@ -1960,12 +1965,14 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t da #endif if (an_read_record(sc, (struct an_ltv_gen *)&sc->areq)) { AN_UNLOCK(sc); + free(areq, M_TEMP); error = EINVAL; break; } + memcpy(areq, &sc->areq, sizeof(*areq)); AN_UNLOCK(sc); - error = copyout(&sc->areq, ifr_data_get_ptr(ifr), - sizeof(sc->areq)); + error = copyout(areq, ifr_data_get_ptr(ifr), sizeof(*areq)); + free(areq, M_TEMP); break; case SIOCSAIRONET: if ((error = priv_check(td, PRIV_DRIVER))) From owner-svn-src-head@freebsd.org Tue Dec 17 21:53:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3218E1CB317; Tue, 17 Dec 2019 21:53:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47csMl0Yb7z3LBd; Tue, 17 Dec 2019 21:53:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E84D91C52C; Tue, 17 Dec 2019 21:53:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBHLrMTg060712; Tue, 17 Dec 2019 21:53:22 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBHLrMBY060711; Tue, 17 Dec 2019 21:53:22 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912172153.xBHLrMBY060711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 Dec 2019 21:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355865 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 355865 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 21:53:23 -0000 Author: imp Date: Tue Dec 17 21:53:22 2019 New Revision: 355865 URL: https://svnweb.freebsd.org/changeset/base/355865 Log: Revert r355833 While it works on nda, it fails on ada and/or da for at least zfs with a modify after free issue on a trim BIO. Revert while I rework it to fix those devices. Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Tue Dec 17 21:34:38 2019 (r355864) +++ head/sys/cam/cam_iosched.c Tue Dec 17 21:53:22 2019 (r355865) @@ -281,8 +281,6 @@ struct cam_iosched_softc { int trim_ticks; /* Max ticks to hold trims */ int last_trim_tick; /* Last 'tick' time ld a trim */ int queued_trims; /* Number of trims in the queue */ - int max_trims; /* Maximum number of trims pending at once */ - int pend_trims; /* Number of pending trims now */ #ifdef CAM_IOSCHED_DYNAMIC int read_bias; /* Read bias setting */ int current_read_bias; /* Current read bias state */ @@ -709,6 +707,11 @@ cam_iosched_cl_maybe_steer(struct control_loop *clp) } #endif +/* + * Trim or similar currently pending completion. Should only be set for + * those drivers wishing only one Trim active at a time. + */ +#define CAM_IOSCHED_FLAG_TRIM_ACTIVE (1ul << 0) /* Callout active, and needs to be torn down */ #define CAM_IOSCHED_FLAG_CALLOUT_ACTIVE (1ul << 1) @@ -781,7 +784,8 @@ cam_iosched_has_more_trim(struct cam_iosched_softc *is return false; } - return isc->pend_trims <= isc->max_trims && bp != NULL; + /* NB: Should perhaps have a max trim active independent of I/O limiters */ + return !(isc->flags & CAM_IOSCHED_FLAG_TRIM_ACTIVE) && bp != NULL; } #define cam_iosched_sort_queue(isc) ((isc)->sort_io_queue >= 0 ? \ @@ -1105,7 +1109,6 @@ cam_iosched_init(struct cam_iosched_softc **iscp, stru (*iscp)->sort_io_queue = -1; bioq_init(&(*iscp)->bio_queue); bioq_init(&(*iscp)->trim_queue); - (*iscp)->max_trims = 1; #ifdef CAM_IOSCHED_DYNAMIC if (do_dynamic_iosched) { bioq_init(&(*iscp)->write_queue); @@ -1641,7 +1644,7 @@ void cam_iosched_trim_done(struct cam_iosched_softc *isc) { - isc->pend_trims--; + isc->flags &= ~CAM_IOSCHED_FLAG_TRIM_ACTIVE; } /* @@ -1709,7 +1712,7 @@ void cam_iosched_submit_trim(struct cam_iosched_softc *isc) { - isc->pend_trims++; + isc->flags |= CAM_IOSCHED_FLAG_TRIM_ACTIVE; } /* @@ -1954,8 +1957,8 @@ DB_SHOW_COMMAND(iosched, cam_iosched_db_show) db_printf("Trim Q len %d\n", biolen(&isc->trim_queue)); db_printf("read_bias: %d\n", isc->read_bias); db_printf("current_read_bias: %d\n", isc->current_read_bias); - db_printf("Trims active %d\n", isc->pend_trims); - db_printf("Max trims active %d\n", isc->max_trims); + db_printf("Trim active? %s\n", + (isc->flags & CAM_IOSCHED_FLAG_TRIM_ACTIVE) ? "yes" : "no"); } #endif #endif From owner-svn-src-head@freebsd.org Tue Dec 17 22:58:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D3EB1CC821; Tue, 17 Dec 2019 22:58:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47ctpS0Dvcz3NXV; Tue, 17 Dec 2019 22:58:08 +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 030391CFF6; Tue, 17 Dec 2019 22:58:08 +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 xBHMw7ND096272; Tue, 17 Dec 2019 22:58:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBHMw77a096270; Tue, 17 Dec 2019 22:58:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201912172258.xBHMw77a096270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 17 Dec 2019 22:58:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355866 - in head/share/man: man4 man9 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/share/man: man4 man9 X-SVN-Commit-Revision: 355866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 22:58:08 -0000 Author: jhb Date: Tue Dec 17 22:58:07 2019 New Revision: 355866 URL: https://svnweb.freebsd.org/changeset/base/355866 Log: Update the crypto(4) and crypto(9) manpages. There are probably bits that are still wrong, but this fixes some things at least: - Add named arguments to the functions in crypto(9). - Add missing algorithms. - Don't mention arguments that don't exist in crypto_register. - Add CIOGSESSION2. - Remove CIOCNFSESSION. - Clarify some stale language that assumed an fd had only one sesson. - Note that you have to use CRIOGET and add a note in BUGS lamenting that one has to use CRIOGET. - Various other cleanups. Reviewed by: cem (earlier version) MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D22784 Modified: head/share/man/man4/crypto.4 head/share/man/man9/crypto.9 Modified: head/share/man/man4/crypto.4 ============================================================================== --- head/share/man/man4/crypto.4 Tue Dec 17 21:53:22 2019 (r355865) +++ head/share/man/man4/crypto.4 Tue Dec 17 22:58:07 2019 (r355866) @@ -78,7 +78,7 @@ The .Nm driver gives user-mode applications access to hardware-accelerated -cryptographic transforms, as implemented by the +cryptographic transforms as implemented by the .Xr crypto 9 in-kernel interface. .Pp @@ -87,15 +87,15 @@ The special device provides an .Xr ioctl 2 based interface. -User-mode applications should open the special device, +User-mode applications open the special device and then issue .Xr ioctl 2 calls on the descriptor. User-mode access to .Pa /dev/crypto -is controlled by three +is controlled by two .Xr sysctl 8 -variables, +variables: .Ic kern.userasymcrypto and .Ic kern.cryptodevallowsoft . @@ -103,8 +103,8 @@ and The .Nm device provides two distinct modes of operation: one mode for -symmetric-keyed cryptographic requests, and a second mode for -both asymmetric-key (public-key/private-key) requests, and for +symmetric-keyed cryptographic requests and digests, and a second mode for +both asymmetric-key (public-key/private-key) requests and modular arithmetic (for Diffie-Hellman key exchange and other cryptographic protocols). The two modes are described separately below. @@ -113,12 +113,22 @@ Regardless of whether symmetric-key or asymmetric-key to be performed, use of the device requires a basic series of steps: .Bl -enum .It -Open a file descriptor for the device. -See -.Xr open 2 . +Open the +.Pa /dev/crypto +device. .It -If any symmetric operation will be performed, -create one session, with +Create a new cryptography file descriptor via +.Dv CRIOGET +to use for all subsequent +.Xr ioctl 2 +commands. +.It +Close the +.Pa /dev/crypto +device. +.It +If any symmetric-keyed cryptographic or digest operations will be performed, +create a session with .Dv CIOCGSESSION . Most applications will require at least one symmetric session. Since cipher and MAC keys are tied to sessions, many @@ -134,11 +144,13 @@ or .Dv CIOCKEY (asymmetric). .It -Destroy one session with +Optionally destroy a session with .Dv CIOCFSESSION . .It -Close the device with +Close the cryptography file descriptor with .Xr close 2 . +This will automatically close any remaining sessions associated with the +file desriptor. .El .Sh SYMMETRIC-KEY OPERATION The symmetric-key operation mode provides a context-based API @@ -196,9 +208,9 @@ struct session_op { u_int32_t mac; /* e.g. CRYPTO_MD5_HMAC */ u_int32_t keylen; /* cipher key */ - void * key; + const void *key; int mackeylen; /* mac key */ - void * mackey; + const void *mackey; u_int32_t ses; /* returns: ses # */ }; @@ -241,12 +253,36 @@ and the key value in the octets addressed by .Fa sessp-\*[Gt]mackeylen . .\" .Pp -Support for a specific combination of fused privacy and +Support for a specific combination of fused privacy and integrity-check algorithms depends on whether the underlying hardware supports that combination. Not all combinations are supported by all hardware, even if the hardware supports each operation as a stand-alone non-fused operation. +.It Dv CIOCGSESSION2 Fa struct session2_op *sessp +.Bd -literal +struct session2_op { + u_int32_t cipher; /* e.g. CRYPTO_DES_CBC */ + u_int32_t mac; /* e.g. CRYPTO_MD5_HMAC */ + + u_int32_t keylen; /* cipher key */ + const void *key; + int mackeylen; /* mac key */ + const void *mackey; + + u_int32_t ses; /* returns: ses # */ + int crid; /* driver id + flags (rw) */ + int pad[4]; /* for future expansion */ +}; + +.Ed +This request is similar to CIOGSESSION except that +.Fa sessp-\*[Gt]crid +requests either a specific crypto device or a class of devices (software vs +hardware). +The +.Fa sessp-\*[Gt]pad +field must be initialized to zero. .It Dv CIOCCRYPT Fa struct crypt_op *cr_op .Bd -literal struct crypt_op { @@ -261,9 +297,6 @@ struct crypt_op { .Ed Request a symmetric-key (or hash) operation. -The file descriptor argument to -.Xr ioctl 2 -must have been bound to a valid session. To encrypt, set .Fa cr_op-\*[Gt]op to @@ -315,21 +348,8 @@ but provides additional data in .Fa cr_aead-\*[Gt]aad to include in the authentication mode. .It Dv CIOCFSESSION Fa u_int32_t ses_id -Destroys the /dev/crypto session associated with the file-descriptor -argument. -.It Dv CIOCNFSESSION Fa struct crypt_sfop *sfop ; -.Bd -literal -struct crypt_sfop { - size_t count; - u_int32_t *sesid; -}; - -.Ed -Destroys the -.Fa sfop-\*[Gt]count -sessions specified by the -.Fa sfop -array of session identifiers. +Destroys the session identified by +.Fa ses_id . .El .\" .Sh ASYMMETRIC-KEY OPERATION @@ -435,8 +455,10 @@ algorithm, you must supply a suitably-sized buffer. .Pp The scheme for passing arguments for asymmetric requests is baroque. .Pp -The naming inconsistency between .Dv CRIOGET -and the various +should not exist. +It should be possible to use the .Dv CIOC Ns \&* -names is an unfortunate historical artifact. +commands directly on a +.Pa /dev/crypto +file descriptor. Modified: head/share/man/man9/crypto.9 ============================================================================== --- head/share/man/man9/crypto.9 Tue Dec 17 21:53:22 2019 (r355865) +++ head/share/man/man9/crypto.9 Tue Dec 17 22:58:07 2019 (r355866) @@ -26,35 +26,35 @@ .Sh SYNOPSIS .In opencrypto/cryptodev.h .Ft int32_t -.Fn crypto_get_driverid device_t size_t int +.Fn crypto_get_driverid "device_t dev" "size_t session_size" "int flags" .Ft int -.Fn crypto_register uint32_t int uint16_t uint32_t "int \*[lp]*\*[rp]\*[lp]void *, uint32_t *, struct cryptoini *\*[rp]" "int \*[lp]*\*[rp]\*[lp]void *, uint64_t\*[rp]" "int \*[lp]*\*[rp]\*[lp]void *, struct cryptop *\*[rp]" "void *" +.Fn crypto_register "uint32_t driverid" "int alg" "uint16_t maxoplen" "uint32_t flags" .Ft int -.Fn crypto_kregister uint32_t int uint32_t "int \*[lp]*\*[rp]\*[lp]void *, struct cryptkop *\*[rp]" "void *" +.Fn crypto_kregister "uint32_t driverid" "int kalg" "uint32_t flags" .Ft int -.Fn crypto_unregister uint32_t int +.Fn crypto_unregister "uint32_t driverid" "int alg" .Ft int -.Fn crypto_unregister_all uint32_t +.Fn crypto_unregister_all "uint32_t driverid" .Ft void -.Fn crypto_done "struct cryptop *" +.Fn crypto_done "struct cryptop *crp" .Ft void -.Fn crypto_kdone "struct cryptkop *" +.Fn crypto_kdone "struct cryptkop *krp" .Ft int -.Fn crypto_find_driver "const char *" +.Fn crypto_find_driver "const char *match" .Ft int -.Fn crypto_newsession "crypto_session_t *" "struct cryptoini *" int +.Fn crypto_newsession "crypto_session_t *cses" "struct cryptoini *cri" "int crid" .Ft int -.Fn crypto_freesession crypto_session_t +.Fn crypto_freesession "crypto_session_t cses" .Ft int -.Fn crypto_dispatch "struct cryptop *" +.Fn crypto_dispatch "struct cryptop *crp" .Ft int -.Fn crypto_kdispatch "struct cryptkop *" +.Fn crypto_kdispatch "struct cryptkop *krp" .Ft int -.Fn crypto_unblock uint32_t int +.Fn crypto_unblock "uint32_t driverid" "int what" .Ft "struct cryptop *" -.Fn crypto_getreq int +.Fn crypto_getreq "int num" .Ft void -.Fn crypto_freereq void +.Fn crypto_freereq "struct cryptop *crp" .Bd -literal #define CRYPTO_SYMQ 0x1 #define CRYPTO_ASYMQ 0x2 @@ -160,33 +160,48 @@ For session initialization and teardown no callback me .Pp The .Fn crypto_find_driver -function may be called to return the specific id of the provided name. -If the specified driver could not be found, the returned id is -1. +returns the driver id of the device whose name matches +.Fa match . +.Fa match +can either be the exact name of a device including the unit +or the driver name without a unit. +In the latter case, +the id of the first device with the matching driver name is returned. +If no matching device is found, +the value -1 is returned. .Pp The .Fn crypto_newsession routine is called by consumers of cryptographic services (such as the .Xr ipsec 4 stack) that wish to establish a new session with the framework. -The second argument contains all the necessary information for +The +.Fa cri +argument points to a +.Vt cryptoini +structure containing all the necessary information for the driver to establish the session. -The third argument is either a specific driver id, or one or both -of +The +.Fa crid +argument is either a specific driver id or a bitmask of flags. +The flags are .Dv CRYPTOCAP_F_HARDWARE , to select hardware devices, or .Dv CRYPTOCAP_F_SOFTWARE , to select software devices. -If both are specified, a hardware device will be returned -before a software device will be. -On success, the value pointed to by the first argument will be the opaque -session handle. -The various fields in the +If both are specified, hardware devices are preferred over software +devices. +On success, the opaque session handle of the new session will be stored in +.Fa *cses . +The .Vt cryptoini -structure are: +structure pointed to by +.Fa cri +contains these fields: .Bl -tag -width ".Va cri_next" .It Va cri_alg -Contains an algorithm identifier. +An algorithm identifier. Currently supported algorithms are: .Pp .Bl -tag -width ".Dv CRYPTO_RIPEMD160_HMAC" -compact @@ -194,14 +209,19 @@ Currently supported algorithms are: .It Dv CRYPTO_AES_192_NIST_GMAC .It Dv CRYPTO_AES_256_NIST_GMAC .It Dv CRYPTO_AES_CBC +.It Dv CRYPTO_AES_CCM_16 +.It Dv CRYPTO_AES_CCM_CBC_MAC .It Dv CRYPTO_AES_ICM .It Dv CRYPTO_AES_NIST_GCM_16 .It Dv CRYPTO_AES_NIST_GMAC .It Dv CRYPTO_AES_XTS .It Dv CRYPTO_ARC4 +.It Dv CRYPTO_BLAKE2B +.It Dv CRYPTO_BLAKE2S .It Dv CRYPTO_BLF_CBC .It Dv CRYPTO_CAMELLIA_CBC .It Dv CRYPTO_CAST_CBC +.It Dv CRYPTO_CHACHA20 .It Dv CRYPTO_DEFLATE_COMP .It Dv CRYPTO_DES_CBC .It Dv CRYPTO_3DES_CBC @@ -210,43 +230,52 @@ Currently supported algorithms are: .It Dv CRYPTO_MD5_KPDK .It Dv CRYPTO_NULL_HMAC .It Dv CRYPTO_NULL_CBC +.It Dv CRYPTO_POLY1305 +.It Dv CRYPTO_RIPEMD160 .It Dv CRYPTO_RIPEMD160_HMAC .It Dv CRYPTO_SHA1 .It Dv CRYPTO_SHA1_HMAC .It Dv CRYPTO_SHA1_KPDK +.It Dv CRYPTO_SHA2_224 +.It Dv CRYPTO_SHA2_224_HMAC +.It Dv CRYPTO_SHA2_256 .It Dv CRYPTO_SHA2_256_HMAC +.It Dv CRYPTO_SHA2_384 .It Dv CRYPTO_SHA2_384_HMAC +.It Dv CRYPTO_SHA2_512 .It Dv CRYPTO_SHA2_512_HMAC .It Dv CRYPTO_SKIPJACK_CBC .El .It Va cri_klen -Specifies the length of the key in bits, for variable-size key -algorithms. +For variable-size key algorithms, the length of the key in bits. .It Va cri_mlen -Specifies how many bytes from the calculated hash should be copied back. -0 means entire hash. +If non-zero, truncate the calculated hash to this many bytes. .It Va cri_key -Contains the key to be used with the algorithm. +The key to be used. .It Va cri_iv -Contains an explicit initialization vector (IV), if it does not prefix +An explicit initialization vector if it does not prefix the data. This field is ignored during initialization .Pq Nm crypto_newsession . If no IV is explicitly passed (see below on details), a random IV is used by the device driver processing the request. .It Va cri_next -Contains a pointer to another +Pointer to another .Vt cryptoini structure. -Multiple such structures may be linked to establish multi-algorithm sessions -.Xr ( ipsec 4 -is an example consumer of such a feature). +This is used to establish dual-algorithm sessions, such as combining a +cipher with a MAC. .El .Pp The .Vt cryptoini -structure and its contents will not be modified by the framework (or -the drivers used). +structure and its contents will not be modified or referenced by the +framework or any cryptographic drivers. +The memory associated with +.Fa cri +can be released once +.Fn crypto_newsession +returns. .Pp .Fn crypto_freesession is called with the session handle returned by @@ -260,28 +289,22 @@ The various fields in the structure are: .Bl -tag -width ".Va crp_callback" .It Va crp_session -Contains the session handle. +The session handle. .It Va crp_ilen -Indicates the total length in bytes of the buffer to be processed. +The total length in bytes of the buffer to be processed. .It Va crp_olen On return, contains the total length of the result. For symmetric crypto operations, this will be the same as the input length. This will be used if the framework needs to allocate a new buffer for the result (or for re-formatting the input). .It Va crp_callback -This routine is invoked upon completion of the request, whether -successful or not. -It is invoked through the -.Fn crypto_done -routine. -If the request was not successful, an error code is set in the +Callback routine invoked when a request is completed via +.Fn crypto_done . +The callback routine should inspect the .Va crp_etype -field. -It is the responsibility of the callback routine to set the appropriate -.Xr spl 9 -level. +to determine if the request was successfully completed. .It Va crp_etype -Contains the error type, if any errors were encountered, or zero if +The error type, if any errors were encountered, or zero if the request was successfully processed. If the .Er EAGAIN @@ -296,8 +319,7 @@ This mechanism is used by the framework to perform session migration (move a session from one driver to another, because of availability, performance, or other considerations). .Pp -Note that this field only makes sense when examined by -the callback routine specified in +This field is only valid in the context of the callback routine specified by .Va crp_callback . Errors are returned to the invoker of .Fn crypto_process @@ -306,19 +328,17 @@ routine (i.e., if the pointer passed is .Dv NULL or if no callback routine was specified). .It Va crp_flags -Is a bitmask of flags associated with this request. +A bitmask of flags associated with this request. Currently defined flags are: .Bl -tag -width ".Dv CRYPTO_F_CBIFSYNC" .It Dv CRYPTO_F_IMBUF -The buffer pointed to by -.Va crp_buf -is an mbuf chain. +The buffer is an mbuf chain pointed to by +.Va crp_mbuf . .It Dv CRYPTO_F_IOV -The buffer pointed to by -.Va crp_buf -is an +The buffer is a .Vt uio -structure. +structure pointed to by +.Va crp_uio . .It Dv CRYPTO_F_BATCH Batch operation if possible. .It Dv CRYPTO_F_CBIMM @@ -344,18 +364,31 @@ Only relevant if the flag is set and if the operation is synchronous. .El .It Va crp_buf -Points to the input buffer. -On return (when the callback is invoked), -it contains the result of the request. -The input buffer may be an mbuf -chain or a contiguous buffer, -depending on +Data buffer unless +.Dv CRYPTO_F_IMBUF +or +.Dv CRYPTO_F_IOV +is set in .Va crp_flags . +The length in bytes is set in +.Va crp_ilen . +.It Va crp_mbuf +Data buffer mbuf chain when +.Dv CRYPTO_F_IMBUF +is set in +.Va crp_flags . +.It Va crp_uio +.Vt struct uio +data buffer when +.Dv CRYPTO_F_IOV +is set in +.Va crp_flags . .It Va crp_opaque -This is passed through the crypto framework untouched and is +Cookie passed through the crypto framework untouched. +It is intended for the invoking application's use. .It Va crp_desc -This is a linked list of descriptors. +A linked list of descriptors. Each descriptor provides information about what type of cryptographic operation should be done on the input buffer. @@ -429,9 +462,7 @@ operations the offset of the IV is provided by the field. This flag is typically used when the IV is calculated .Dq "on the fly" -by the consumer, and does not precede the data (some -.Xr ipsec 4 -configurations, and the encrypted swap are two such examples). +by the consumer, and does not precede the data. .It Dv CRD_F_KEY_EXPLICIT For encryption and authentication (MAC) algorithms, this bit is set when the key is explicitly provided by the consumer in the @@ -468,9 +499,10 @@ block of data. .Fn crypto_getreq allocates a .Vt cryptop -structure with a linked list of as many +structure with a linked list of +.Fa num .Vt cryptodesc -structures as were specified in the argument passed to it. +structures. .Pp .Fn crypto_freereq deallocates a structure @@ -500,10 +532,10 @@ This variable indicates whether lower level reasons for operation failure. .It Va krp_iparams -Number if input parameters to the specified operation. +Number of input parameters to the specified operation. Note that each operation has a (typically hardwired) number of such parameters. .It Va krp_oparams -Number if output parameters from the specified operation. +Number of output parameters from the specified operation. Note that each operation has a (typically hardwired) number of such parameters. .It Va krp_kvp An array of kernel memory blocks containing the parameters. @@ -540,7 +572,7 @@ The .Dv CRYPTOCAP_F_SYNC may also be specified, and should be specified if the driver does all of it's operations synchronously. -Drivers must pass the size of their session struct as the second argument. +Drivers must pass the size of their session structure as the second argument. An appropriately sized memory will be allocated by the framework, zeroed, and passed to the driver's .Fn newsession @@ -551,14 +583,6 @@ For each algorithm the driver supports, it must then c The first two arguments are the driver and algorithm identifiers. The next two arguments specify the largest possible operator length (in bits, important for public key operations) and flags for this algorithm. -The last four arguments must be provided in the first call to -.Fn crypto_register -and are ignored in all subsequent calls. -They are pointers to three -driver-provided functions that the framework may call to establish new -cryptographic context with the driver, free already established -context, and ask for a request to be processed (encrypt, decrypt, -etc.); and an opaque parameter to pass when calling each of these routines. .Pp .Fn crypto_unregister is called by drivers that wish to withdraw support for an algorithm. From owner-svn-src-head@freebsd.org Tue Dec 17 23:01:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4EEF1CCAB3; Tue, 17 Dec 2019 23:01:38 +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 47cttV3wJkz3Ntn; Tue, 17 Dec 2019 23:01:38 +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 679D31D083; Tue, 17 Dec 2019 23:01:38 +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 xBHN1cJE000424; Tue, 17 Dec 2019 23:01:38 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBHN1bAE000421; Tue, 17 Dec 2019 23:01:37 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912172301.xBHN1bAE000421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 17 Dec 2019 23:01:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355867 - in head/sys: arm/broadcom/bcm2835 arm/conf conf X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: arm/broadcom/bcm2835 arm/conf conf X-SVN-Commit-Revision: 355867 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 23:01:38 -0000 Author: kevans Date: Tue Dec 17 23:01:37 2019 New Revision: 355867 URL: https://svnweb.freebsd.org/changeset/base/355867 Log: arm: add SOC_BRCM_BCM2837 option, include it in GENERIC We use armv7/GENERIC for the RPI2 images. The original RPI2 is actually a 32-bit BCM2836, but v1.2 was upgraded to the 64-bit BCM2837. The project continues to provide the RPI2 image as armv7, as it's the lowest common denominator of the two. Historically, we've just kind of implicitly acknowledged this by including some bcm2837 bits on a SOC_BCM2836 kernel config -- this worked until r354875 added code that actually cared. Acknowledge formally that BCM2837 is valid in arm32. This name is inconsistent with the other BCM* SOC on !arm64 for two reasons: 1. It's a pre-existing option on arm64, and 2. the naming convention on arm/ should've arguably changed to include BRCM #1 seems to be a convincing enough argument to maintain the existing name for it. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c head/sys/arm/conf/GENERIC head/sys/conf/options.arm Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Tue Dec 17 22:58:07 2019 (r355866) +++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Tue Dec 17 23:01:37 2019 (r355867) @@ -139,7 +139,7 @@ FDT_PLATFORM_DEF2(bcm2835, bcm2835_legacy, "bcm2835 (l FDT_PLATFORM_DEF2(bcm2835, bcm2835, "bcm2835", 0, "brcm,bcm2835", 100); #endif -#ifdef SOC_BCM2836 +#if defined(SOC_BCM2836) || defined(SOC_BRCM_BCM2837) static platform_method_t bcm2836_methods[] = { PLATFORMMETHOD(platform_devmap_init, bcm2836_devmap_init), PLATFORMMETHOD(platform_late_init, bcm2835_late_init), @@ -155,4 +155,4 @@ static platform_method_t bcm2836_methods[] = { FDT_PLATFORM_DEF2(bcm2836, bcm2836_legacy, "bcm2836 (legacy)", 0, "brcm,bcm2709", 100); FDT_PLATFORM_DEF2(bcm2836, bcm2836, "bcm2836", 0, "brcm,bcm2836", 100); FDT_PLATFORM_DEF2(bcm2836, bcm2837, "bcm2837", 0, "brcm,bcm2837", 100); -#endif +#endif /* defined(SOC_BCM2836) || defined(SOC_BRCM_BCM2837) */ Modified: head/sys/arm/conf/GENERIC ============================================================================== --- head/sys/arm/conf/GENERIC Tue Dec 17 22:58:07 2019 (r355866) +++ head/sys/arm/conf/GENERIC Tue Dec 17 23:01:37 2019 (r355867) @@ -57,6 +57,7 @@ options SOC_ALLWINNER_A83T options SOC_ALLWINNER_H2PLUS options SOC_ALLWINNER_H3 options SOC_BCM2836 +options SOC_BRCM_BCM2837 options SOC_MV_ARMADA38X options SOC_MV_ARMADAXP options SOC_TI_AM335X Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Tue Dec 17 22:58:07 2019 (r355866) +++ head/sys/conf/options.arm Tue Dec 17 23:01:37 2019 (r355867) @@ -47,6 +47,7 @@ SOC_ALTERA_ARRIA10 opt_global.h SOC_ALTERA_CYCLONE5 opt_global.h SOC_BCM2835 opt_global.h SOC_BCM2836 opt_global.h +SOC_BRCM_BCM2837 opt_global.h SOC_IMX51 opt_global.h SOC_IMX53 opt_global.h SOC_IMX6 opt_global.h From owner-svn-src-head@freebsd.org Tue Dec 17 23:07:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0065A1CCC2E; Tue, 17 Dec 2019 23:07:53 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (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 47cv1h5vLVz3P8d; Tue, 17 Dec 2019 23:07:52 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 163793C0199; Tue, 17 Dec 2019 23:07:46 +0000 (UTC) Date: Tue, 17 Dec 2019 23:07:46 +0000 From: Brooks Davis To: Pedro Giffuni Cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355828 - head/sys/sys Message-ID: <20191217230746.GB25842@spindle.one-eyed-alien.net> References: <201912162355.xBGNtUq6078840@repo.freebsd.org> <201912170442.xBH4gUOg063777@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="neYutvxvOLaeuPCA" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 47cv1h5vLVz3P8d 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]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Dec 2019 23:07:53 -0000 --neYutvxvOLaeuPCA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 17, 2019 at 01:28:20PM -0500, Pedro Giffuni wrote: > On 16/12/2019 23:42, Cy Schubert wrote: > > In message <201912162355.xBGNtUq6078840@repo.freebsd.org>, "Pedro F. > > Giffuni" w > > rites: > >> Author: pfg > >> Date: Mon Dec 16 23:55:30 2019 > >> New Revision: 355828 > >> URL: https://svnweb.freebsd.org/changeset/base/355828 > >> > >> Log: > >> Double the size of ARG_MAX on LP64 platforms. > >> =20 > >> As modern software keeps growing in size, we get requests to update= the > >> value of ARG_MAX in order to link the resulting object files. Other= OSs > >> have much higher values but Increasiong ARG_MAX has a multiplied ef= fect on > >> KVA, so just bumping this value is dangerous in some archs like ARM= 32 that > >> can exhaust KVA rather easily. > >> =20 > >> While it would be better to have a unique value for all archs, othe= r OSs > >> (Illumos in partidular) can have different ARG_MAX limits depending= on the > >> platform, For now we want to be really conservative so we are avoi= dng > >> the change on ILP32 and in the alternative case we only double it s= ince tha > >> t > >> seems to work well enough for recent Code Aster. > >> =20 > >> I was planning to bump the _FreeBSD_version but it was bumped recen= tly > >> (r355798) so we can reuse the 1300068 value for this change. > > This doesn't seem right. Each bump should be for a distinct change and > > documented as such. >=20 > TBH, it is just not worth it: this change will currently benefit only=20 > one port (french/aster) and the update won't be committed until after=20 > the MFC is done. An MFC is a quite long-term solution. If merged to 11 and 12 then any workarounds can't be removed until 11.3 and 12.1 are EOL since we'll be building packages there until that point. -- Brooks --neYutvxvOLaeuPCA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJd+V/BAAoJEKzQXbSebgfAEusH/0C2BEO1GFQaGD9BLw1TqW8k RBtIn6BEY+fd/xih14ZA5cdC+UzJ0OvbkTXxwf8yrbPbfwANitcxO9zlG13qCRzG +vZ/8HdPfbH5qhWmvoDOG2U3WnKaSsJAW9IYAoO3Au2ulMU68Wm+IyHLPKTKhCxw srXXt6eCM1fLkb2IOPS85Hg6D+iLE9PQg1IsVc1X+MgYPoWaISPcqp7bdIXKpK4a whnQmvfBJOhoOTg15+cl5ohXh2uaAiLyYs4ekm8Pouy6zUCDcTXMSVdRVE+YgLBe D3ejVd9T9IOXAaMVPQx5mxZKDy623fLjCZvL41jL3F8VUI7ZSieEmoYJf2vO804= =fqzI -----END PGP SIGNATURE----- --neYutvxvOLaeuPCA-- From owner-svn-src-head@freebsd.org Wed Dec 18 01:27:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9BF51CF982; Wed, 18 Dec 2019 01:27:50 +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 47cy7B4y6Wz40WK; Wed, 18 Dec 2019 01:27:50 +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 A539E1EB10; Wed, 18 Dec 2019 01:27:50 +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 xBI1RoSE083670; Wed, 18 Dec 2019 01:27:50 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBI1RoXd083668; Wed, 18 Dec 2019 01:27:50 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201912180127.xBI1RoXd083668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 18 Dec 2019 01:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355871 - in head/share/man: man4 man9 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/share/man: man4 man9 X-SVN-Commit-Revision: 355871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2019 01:27:50 -0000 Author: jhb Date: Wed Dec 18 01:27:49 2019 New Revision: 355871 URL: https://svnweb.freebsd.org/changeset/base/355871 Log: Bump Dd for changes in r355866. Pointy hat to: jhb MFC after: 2 weeks Modified: head/share/man/man4/crypto.4 head/share/man/man9/crypto.9 Modified: head/share/man/man4/crypto.4 ============================================================================== --- head/share/man/man4/crypto.4 Wed Dec 18 00:12:30 2019 (r355870) +++ head/share/man/man4/crypto.4 Wed Dec 18 01:27:49 2019 (r355871) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 21, 2017 +.Dd December 17, 2019 .Dt CRYPTO 4 .Os .Sh NAME Modified: head/share/man/man9/crypto.9 ============================================================================== --- head/share/man/man9/crypto.9 Wed Dec 18 00:12:30 2019 (r355870) +++ head/share/man/man9/crypto.9 Wed Dec 18 01:27:49 2019 (r355871) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 17, 2018 +.Dd December 17, 2019 .Dt CRYPTO 9 .Os .Sh NAME From owner-svn-src-head@freebsd.org Wed Dec 18 01:33:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80B471CFC82; Wed, 18 Dec 2019 01:33:21 +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 47cyFY2qQZz40xL; Wed, 18 Dec 2019 01:33:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C1B01ECCA; Wed, 18 Dec 2019 01:33:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBI1XLE5089238; Wed, 18 Dec 2019 01:33:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBI1XL47089237; Wed, 18 Dec 2019 01:33:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201912180133.xBI1XL47089237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 18 Dec 2019 01:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355872 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 355872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2019 01:33:21 -0000 Author: jhb Date: Wed Dec 18 01:33:20 2019 New Revision: 355872 URL: https://svnweb.freebsd.org/changeset/base/355872 Log: Add a structure for the AAD used in TLS 1.3. While here, add RFC numbers to comments about nonce and AAD data for TLS 1.2. Reviewed by: gallatin Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D22801 Modified: head/sys/sys/ktls.h Modified: head/sys/sys/ktls.h ============================================================================== --- head/sys/sys/ktls.h Wed Dec 18 01:27:49 2019 (r355871) +++ head/sys/sys/ktls.h Wed Dec 18 01:33:20 2019 (r355872) @@ -50,7 +50,7 @@ struct tls_record_layer { #define TLS_RLTYPE_APP 23 /* - * Nonce for GCM. + * Nonce for GCM for TLS 1.2 per RFC 5288. */ struct tls_nonce_data { uint8_t fixed[TLS_AEAD_GCM_LEN]; @@ -58,7 +58,7 @@ struct tls_nonce_data { } __packed; /* - * AEAD additional data format per RFC. + * AEAD additional data format for TLS 1.2 per RFC 5246. */ struct tls_aead_data { uint64_t seq; /* In network order */ @@ -66,6 +66,16 @@ struct tls_aead_data { uint8_t tls_vmajor; uint8_t tls_vminor; uint16_t tls_length; +} __packed; + +/* + * AEAD additional data format for TLS 1.3 per RFC 8446. + */ +struct tls_aead_data_13 { + uint8_t type; + uint8_t tls_vmajor; + uint8_t tls_vminor; + uint16_t tls_length; } __packed; /* From owner-svn-src-head@freebsd.org Wed Dec 18 01:37:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C36291CFDD3; Wed, 18 Dec 2019 01:37:00 +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 47cyKm4lsSz416V; Wed, 18 Dec 2019 01:37:00 +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 9E5F11ECD0; Wed, 18 Dec 2019 01:37: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 xBI1b0U4089450; Wed, 18 Dec 2019 01:37:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBI1b0KB089449; Wed, 18 Dec 2019 01:37:00 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201912180137.xBI1b0KB089449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 18 Dec 2019 01:37:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355873 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 355873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2019 01:37:00 -0000 Author: jhb Date: Wed Dec 18 01:37:00 2019 New Revision: 355873 URL: https://svnweb.freebsd.org/changeset/base/355873 Log: Add support for TLS 1.3 using AES-GCM to the OCF backend for KTLS. Reviewed by: gallatin Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D22802 Modified: head/sys/opencrypto/ktls_ocf.c Modified: head/sys/opencrypto/ktls_ocf.c ============================================================================== --- head/sys/opencrypto/ktls_ocf.c Wed Dec 18 01:33:20 2019 (r355872) +++ head/sys/opencrypto/ktls_ocf.c Wed Dec 18 01:37:00 2019 (r355873) @@ -60,13 +60,21 @@ static MALLOC_DEFINE(M_KTLS_OCF, "ktls_ocf", "OCF KTLS SYSCTL_DECL(_kern_ipc_tls); SYSCTL_DECL(_kern_ipc_tls_stats); -static counter_u64_t ocf_gcm_crypts; -SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, ocf_gcm_crypts, CTLFLAG_RD, - &ocf_gcm_crypts, - "Total number of OCF GCM encryption operations"); +static SYSCTL_NODE(_kern_ipc_tls_stats, OID_AUTO, ocf, CTLFLAG_RD, 0, + "Kernel TLS offload via OCF stats"); +static counter_u64_t ocf_tls12_gcm_crypts; +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls12_gcm_crypts, + CTLFLAG_RD, &ocf_tls12_gcm_crypts, + "Total number of OCF TLS 1.2 GCM encryption operations"); + +static counter_u64_t ocf_tls13_gcm_crypts; +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, tls13_gcm_crypts, + CTLFLAG_RD, &ocf_tls13_gcm_crypts, + "Total number of OCF TLS 1.3 GCM encryption operations"); + static counter_u64_t ocf_retries; -SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, ocf_retries, CTLFLAG_RD, +SYSCTL_COUNTER_U64(_kern_ipc_tls_stats_ocf, OID_AUTO, retries, CTLFLAG_RD, &ocf_retries, "Number of OCF encryption operation retries"); @@ -84,9 +92,10 @@ ktls_ocf_callback(struct cryptop *crp) } static int -ktls_ocf_encrypt(struct ktls_session *tls, const struct tls_record_layer *hdr, - uint8_t *trailer, struct iovec *iniov, struct iovec *outiov, int iovcnt, - uint64_t seqno, uint8_t record_type __unused) +ktls_ocf_tls12_gcm_encrypt(struct ktls_session *tls, + const struct tls_record_layer *hdr, uint8_t *trailer, struct iovec *iniov, + struct iovec *outiov, int iovcnt, uint64_t seqno, + uint8_t record_type __unused) { struct uio uio; struct tls_aead_data ad; @@ -127,7 +136,7 @@ ktls_ocf_encrypt(struct ktls_session *tls, const struc iov[0].iov_base = &ad; iov[0].iov_len = sizeof(ad); uio.uio_resid = sizeof(ad); - + /* * OCF always does encryption in place, so copy the data if * needed. Ugh. @@ -171,7 +180,7 @@ ktls_ocf_encrypt(struct ktls_session *tls, const struc crde->crd_flags = CRD_F_ENCRYPT | CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT; memcpy(crde->crd_iv, &nd, sizeof(nd)); - counter_u64_add(ocf_gcm_crypts, 1); + counter_u64_add(ocf_tls12_gcm_crypts, 1); for (;;) { error = crypto_dispatch(crp); if (error) @@ -198,6 +207,118 @@ ktls_ocf_encrypt(struct ktls_session *tls, const struc return (error); } +static int +ktls_ocf_tls13_gcm_encrypt(struct ktls_session *tls, + const struct tls_record_layer *hdr, uint8_t *trailer, struct iovec *iniov, + struct iovec *outiov, int iovcnt, uint64_t seqno, uint8_t record_type) +{ + struct uio uio; + struct tls_aead_data_13 ad; + char nonce[12]; + struct cryptodesc *crde, *crda; + struct cryptop *crp; + struct ocf_session *os; + struct ocf_operation *oo; + struct iovec *iov; + int i, error; + + os = tls->cipher; + + oo = malloc(sizeof(*oo) + (iovcnt + 2) * sizeof(*iov), M_KTLS_OCF, + M_WAITOK | M_ZERO); + oo->os = os; + iov = oo->iov; + + crp = crypto_getreq(2); + if (crp == NULL) { + free(oo, M_KTLS_OCF); + return (ENOMEM); + } + + /* Setup the nonce. */ + memcpy(nonce, tls->params.iv, tls->params.iv_len); + *(uint64_t *)(nonce + 4) ^= htobe64(seqno); + + /* Setup the AAD. */ + ad.type = hdr->tls_type; + ad.tls_vmajor = hdr->tls_vmajor; + ad.tls_vminor = hdr->tls_vminor; + ad.tls_length = hdr->tls_length; + iov[0].iov_base = &ad; + iov[0].iov_len = sizeof(ad); + uio.uio_resid = sizeof(ad); + + /* + * OCF always does encryption in place, so copy the data if + * needed. Ugh. + */ + for (i = 0; i < iovcnt; i++) { + iov[i + 1] = outiov[i]; + if (iniov[i].iov_base != outiov[i].iov_base) + memcpy(outiov[i].iov_base, iniov[i].iov_base, + outiov[i].iov_len); + uio.uio_resid += outiov[i].iov_len; + } + + trailer[0] = record_type; + iov[iovcnt + 1].iov_base = trailer; + iov[iovcnt + 1].iov_len = AES_GMAC_HASH_LEN + 1; + uio.uio_resid += AES_GMAC_HASH_LEN + 1; + + uio.uio_iov = iov; + uio.uio_iovcnt = iovcnt + 2; + uio.uio_offset = 0; + uio.uio_segflg = UIO_SYSSPACE; + uio.uio_td = curthread; + + crp->crp_session = os->sid; + crp->crp_flags = CRYPTO_F_IOV | CRYPTO_F_CBIMM; + crp->crp_uio = &uio; + crp->crp_ilen = uio.uio_resid; + crp->crp_opaque = oo; + crp->crp_callback = ktls_ocf_callback; + + crde = crp->crp_desc; + crda = crde->crd_next; + + crda->crd_alg = os->crda_alg; + crda->crd_skip = 0; + crda->crd_len = sizeof(ad); + crda->crd_inject = crp->crp_ilen - AES_GMAC_HASH_LEN; + + crde->crd_alg = CRYPTO_AES_NIST_GCM_16; + crde->crd_skip = sizeof(ad); + crde->crd_len = crp->crp_ilen - (sizeof(ad) + AES_GMAC_HASH_LEN); + crde->crd_flags = CRD_F_ENCRYPT | CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT; + memcpy(crde->crd_iv, nonce, sizeof(nonce)); + + counter_u64_add(ocf_tls13_gcm_crypts, 1); + for (;;) { + error = crypto_dispatch(crp); + if (error) + break; + + mtx_lock(&os->lock); + while (!oo->done) + mtx_sleep(oo, &os->lock, 0, "ocfktls", 0); + mtx_unlock(&os->lock); + + if (crp->crp_etype != EAGAIN) { + error = crp->crp_etype; + break; + } + + crp->crp_etype = 0; + crp->crp_flags &= ~CRYPTO_F_DONE; + oo->done = false; + counter_u64_add(ocf_retries, 1); + } + + crypto_freereq(crp); + free(oo, M_KTLS_OCF); + return (error); +} + static void ktls_ocf_free(struct ktls_session *tls) { @@ -221,8 +342,6 @@ ktls_ocf_try(struct socket *so, struct ktls_session *t switch (tls->params.cipher_algorithm) { case CRYPTO_AES_NIST_GCM_16: - if (tls->params.iv_len != TLS_AEAD_GCM_LEN) - return (EINVAL); switch (tls->params.cipher_key_len) { case 128 / 8: cria.cri_alg = CRYPTO_AES_128_NIST_GMAC; @@ -240,10 +359,10 @@ ktls_ocf_try(struct socket *so, struct ktls_session *t return (EPROTONOSUPPORT); } - /* Only TLS 1.1 and TLS 1.2 are currently supported. */ + /* Only TLS 1.2 and 1.3 are supported. */ if (tls->params.tls_vmajor != TLS_MAJOR_VER_ONE || - tls->params.tls_vminor < TLS_MINOR_VER_ONE || - tls->params.tls_vminor > TLS_MINOR_VER_TWO) + tls->params.tls_vminor < TLS_MINOR_VER_TWO || + tls->params.tls_vminor > TLS_MINOR_VER_THREE) return (EPROTONOSUPPORT); os = malloc(sizeof(*os), M_KTLS_OCF, M_NOWAIT | M_ZERO); @@ -265,7 +384,10 @@ ktls_ocf_try(struct socket *so, struct ktls_session *t os->crda_alg = cria.cri_alg; mtx_init(&os->lock, "ktls_ocf", NULL, MTX_DEF); tls->cipher = os; - tls->sw_encrypt = ktls_ocf_encrypt; + if (tls->params.tls_vminor == TLS_MINOR_VER_THREE) + tls->sw_encrypt = ktls_ocf_tls13_gcm_encrypt; + else + tls->sw_encrypt = ktls_ocf_tls12_gcm_encrypt; tls->free = ktls_ocf_free; return (0); } @@ -284,14 +406,16 @@ ktls_ocf_modevent(module_t mod, int what, void *arg) switch (what) { case MOD_LOAD: - ocf_gcm_crypts = counter_u64_alloc(M_WAITOK); + ocf_tls12_gcm_crypts = counter_u64_alloc(M_WAITOK); + ocf_tls13_gcm_crypts = counter_u64_alloc(M_WAITOK); ocf_retries = counter_u64_alloc(M_WAITOK); return (ktls_crypto_backend_register(&ocf_backend)); case MOD_UNLOAD: error = ktls_crypto_backend_deregister(&ocf_backend); if (error) return (error); - counter_u64_free(ocf_gcm_crypts); + counter_u64_free(ocf_tls12_gcm_crypts); + counter_u64_free(ocf_tls13_gcm_crypts); counter_u64_free(ocf_retries); return (0); default: From owner-svn-src-head@freebsd.org Wed Dec 18 01:56:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 85E011D049C; Wed, 18 Dec 2019 01:56: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 47cymR2xGFz421w; Wed, 18 Dec 2019 01:56:39 +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 5FDF91F076; Wed, 18 Dec 2019 01:56:39 +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 xBI1udlf001526; Wed, 18 Dec 2019 01:56:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBI1udpn001525; Wed, 18 Dec 2019 01:56:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201912180156.xBI1udpn001525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 18 Dec 2019 01:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355874 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2019 01:56:39 -0000 Author: markj Date: Wed Dec 18 01:56:38 2019 New Revision: 355874 URL: https://svnweb.freebsd.org/changeset/base/355874 Log: Fix the aflag shift on big-endian platforms after r355672. The structure offset is zero regardless of endianness. Reported by: brooks Pointy hat: markj Modified: head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Wed Dec 18 01:37:00 2019 (r355873) +++ head/sys/vm/vm_page.h Wed Dec 18 01:56:38 2019 (r355874) @@ -763,7 +763,11 @@ void vm_page_assert_pga_writeable(vm_page_t m, uint16_ #define VM_PAGE_ASSERT_PGA_WRITEABLE(m, bits) (void)0 #endif -#define VM_PAGE_AFLAG_SHIFT (__offsetof(vm_page_astate_t, flags) * NBBY) +#if BYTE_ORDER == BIG_ENDIAN +#define VM_PAGE_AFLAG_SHIFT 16 +#else +#define VM_PAGE_AFLAG_SHIFT 0 +#endif /* * Load a snapshot of a page's 32-bit atomic state. From owner-svn-src-head@freebsd.org Wed Dec 18 02:29:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 949281D0FA0; Wed, 18 Dec 2019 02:29: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 47czVJ35RYz43Cr; Wed, 18 Dec 2019 02:29: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 653F71F5C8; Wed, 18 Dec 2019 02:29: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 xBI2TSWM019563; Wed, 18 Dec 2019 02:29:28 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBI2TSfk019562; Wed, 18 Dec 2019 02:29:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912180229.xBI2TSfk019562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 18 Dec 2019 02:29:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355875 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 355875 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2019 02:29:28 -0000 Author: kevans Date: Wed Dec 18 02:29:27 2019 New Revision: 355875 URL: https://svnweb.freebsd.org/changeset/base/355875 Log: bcm2835_vcbus: add legacy compat mappings I've opted for just duplicating the two entries needed for this, rather than writing any other mechanism for maintaining two root compat entries to map to one config, for simplicity. We'll eventually declare these legacy DTB unsupported, but let's not do that yet while there's no real burden. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c Wed Dec 18 01:56:38 2019 (r355874) +++ head/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c Wed Dec 18 02:29:27 2019 (r355875) @@ -152,13 +152,27 @@ static struct bcm283x_memory_soc_cfg { bus_addr_t busdma_lowaddr; } bcm283x_memory_configs[] = { #ifdef SOC_BCM2835 + /* Legacy */ { .memmap = bcm2835_memmap, + .soc_compat = "raspberrypi,model-b", + .busdma_lowaddr = BUS_SPACE_MAXADDR_32BIT, + }, + /* Modern */ + { + .memmap = bcm2835_memmap, .soc_compat = "brcm,bcm2835", .busdma_lowaddr = BUS_SPACE_MAXADDR_32BIT, }, #endif #ifdef SOC_BCM2836 + /* Legacy */ + { + .memmap = bcm2836_memmap, + .soc_compat = "brcm,bcm2709", + .busdma_lowaddr = BUS_SPACE_MAXADDR_32BIT, + }, + /* Modern */ { .memmap = bcm2836_memmap, .soc_compat = "brcm,bcm2836", From owner-svn-src-head@freebsd.org Wed Dec 18 02:37:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 776CA1D124F; Wed, 18 Dec 2019 02:37:16 +0000 (UTC) (envelope-from pfg@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 47czgJ2RYQz43j6; Wed, 18 Dec 2019 02:37:16 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from [192.168.0.5] (unknown [181.52.72.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: pfg) by smtp.freebsd.org (Postfix) with ESMTPSA id 83819E56F; Wed, 18 Dec 2019 02:37:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Subject: Re: svn commit: r355828 - head/sys/sys To: Brooks Davis Cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201912162355.xBGNtUq6078840@repo.freebsd.org> <201912170442.xBH4gUOg063777@slippy.cwsent.com> <20191217230746.GB25842@spindle.one-eyed-alien.net> From: Pedro Giffuni Organization: FreeBSD Message-ID: Date: Tue, 17 Dec 2019 21:37:09 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <20191217230746.GB25842@spindle.one-eyed-alien.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2019 02:37:16 -0000 On 17/12/2019 18:07, Brooks Davis wrote: > On Tue, Dec 17, 2019 at 01:28:20PM -0500, Pedro Giffuni wrote: >> On 16/12/2019 23:42, Cy Schubert wrote: >>> In message <201912162355.xBGNtUq6078840@repo.freebsd.org>, "Pedro F. >>> Giffuni" w >>> rites: >>>> Author: pfg >>>> Date: Mon Dec 16 23:55:30 2019 >>>> New Revision: 355828 >>>> URL: https://svnweb.freebsd.org/changeset/base/355828 >>>> >>>> Log: >>>> Double the size of ARG_MAX on LP64 platforms. >>>> >>>> As modern software keeps growing in size, we get requests to update the >>>> value of ARG_MAX in order to link the resulting object files. Other OSs >>>> have much higher values but Increasiong ARG_MAX has a multiplied effect on >>>> KVA, so just bumping this value is dangerous in some archs like ARM32 that >>>> can exhaust KVA rather easily. >>>> >>>> While it would be better to have a unique value for all archs, other OSs >>>> (Illumos in partidular) can have different ARG_MAX limits depending on the >>>> platform, For now we want to be really conservative so we are avoidng >>>> the change on ILP32 and in the alternative case we only double it since tha >>>> t >>>> seems to work well enough for recent Code Aster. >>>> >>>> I was planning to bump the _FreeBSD_version but it was bumped recently >>>> (r355798) so we can reuse the 1300068 value for this change. >>> This doesn't seem right. Each bump should be for a distinct change and >>> documented as such. >> TBH, it is just not worth it: this change will currently benefit only >> one port (french/aster) and the update won't be committed until after >> the MFC is done. > An MFC is a quite long-term solution. If merged to 11 and 12 then any > workarounds can't be removed until 11.3 and 12.1 are EOL since we'll be > building packages there until that point. Yes. I am planning to MFC only to 12-stable as 11-stable may not be worth bothering. Pedro. > -- Brooks From owner-svn-src-head@freebsd.org Wed Dec 18 06:22:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 28DF51D5616; Wed, 18 Dec 2019 06:22:29 +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 47d4g90Hhqz4DjN; Wed, 18 Dec 2019 06:22: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 051AE220EC; Wed, 18 Dec 2019 06:22: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 xBI6MSAt058721; Wed, 18 Dec 2019 06:22:28 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBI6MSsZ058720; Wed, 18 Dec 2019 06:22:28 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201912180622.xBI6MSsZ058720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 18 Dec 2019 06:22:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355876 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 355876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2019 06:22:29 -0000 Author: cem Date: Wed Dec 18 06:22:28 2019 New Revision: 355876 URL: https://svnweb.freebsd.org/changeset/base/355876 Log: acpi(4): Add _CID to PNP info string While a given ACPI device may have 0-N compatibility IDs, in practice most seem to have 0 or 1. If one is present, emit it as part of the PNP info string associated with a device. This could enable MODULE_PNP_INFO-based automatic kldload for ACPI drivers associated with a given _CID (but without a good _HID or _UID identifier). Reviewed by: imp, jhb Differential Revision: https://reviews.freebsd.org/D22846 Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Wed Dec 18 02:29:27 2019 (r355875) +++ head/sys/dev/acpica/acpi.c Wed Dec 18 06:22:28 2019 (r355876) @@ -884,11 +884,14 @@ acpi_child_pnpinfo_str_method(device_t cbdev, device_t return (0); } - snprintf(buf, buflen, "_HID=%s _UID=%lu", + snprintf(buf, buflen, "_HID=%s _UID=%lu _CID=%s", (adinfo->Valid & ACPI_VALID_HID) ? adinfo->HardwareId.String : "none", (adinfo->Valid & ACPI_VALID_UID) ? - strtoul(adinfo->UniqueId.String, NULL, 10) : 0UL); + strtoul(adinfo->UniqueId.String, NULL, 10) : 0UL, + ((adinfo->Valid & ACPI_VALID_CID) && + adinfo->CompatibleIdList.Count > 0) ? + adinfo->CompatibleIdList.Ids[0].String : "none"); AcpiOsFree(adinfo); return (0); From owner-svn-src-head@freebsd.org Wed Dec 18 06:27:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E63F11D5753; Wed, 18 Dec 2019 06:27:57 +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 47d4nS6Rmsz4Dsw; Wed, 18 Dec 2019 06:27:56 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.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 39750260197; Wed, 18 Dec 2019 07:27:47 +0100 (CET) Subject: Re: svn commit: r341578 - head/sys/dev/mlx5/mlx5_en To: "Andrey V. Elsukov" , Slava Shwartsman , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051420.wB5EKwxr099242@repo.freebsd.org> <8715aa7b-ceea-7cfd-1980-a260c98070d5@yandex.ru> <6151923d-05bb-b945-359e-d632708ba021@selasky.org> <60698d75-ca26-da71-682c-ec7d24f0eab6@yandex.ru> From: Hans Petter Selasky Message-ID: <8a1d1216-f15d-7fe0-b55c-04b999f8a947@selasky.org> Date: Wed, 18 Dec 2019 07:26:46 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <60698d75-ca26-da71-682c-ec7d24f0eab6@yandex.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 47d4nS6Rmsz4Dsw 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.93 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(-2.63)[ip: (-9.18), ipnet: 2a01:4f8::/29(-2.42), asn: 24940(-1.55), country: DE(-0.02)]; FREEMAIL_TO(0.00)[yandex.ru]; 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2019 06:27:58 -0000 On 2019-12-17 18:14, Andrey V. Elsukov wrote: > On 13.12.2019 17:27, Hans Petter Selasky wrote: >> On 2019-12-13 14:40, Andrey V. Elsukov wrote: >>> On 05.12.2018 17:20, Slava Shwartsman wrote: >>>> Author: slavash >>>> Date: Wed Dec  5 14:20:57 2018 >>>> New Revision: 341578 >>>> URL: https://svnweb.freebsd.org/changeset/base/341578 >>>> >>>> Log: >>>>    mlx5en: Remove the DRBR and associated logic in the transmit path. >>>>       The hardware queues are deep enough currently and using the >>>> DRBR and associated >>>>    callbacks only leads to more task switching in the TX path. The is >>>> also a race >>>>    setting the queue_state which can lead to hung TX rings. >>> >>> JFYI. We have compared the same router+firewall workloads on the host >>> with this change and before, and I can say, that without DRBR on TX now >>> we constantly have several percents of packets drops due to ENOBUFS >>> error from mlx5e_xmit(). >>> >> >> Have you tried to tune the TX/RX parameters? >> >> Especially the tx_queue_size . > > We use the following settings: > % sysctl dev.mce.4.conf. | grep que > dev.mce.4.conf.rx_queue_size: 16384 > dev.mce.4.conf.tx_queue_size: 16384 > dev.mce.4.conf.rx_queue_size_max: 16384 > dev.mce.4.conf.tx_queue_size_max: 16384 > > Also, previously I have patched MLX5E_SQ_TX_QUEUE_SIZE value up to 16384. Hi, What about the other parameters. Did you tune any of those? At what rate does this happen? Can you send me the full dev.mce.4 sysctl tree off-list? --HPS From owner-svn-src-head@freebsd.org Wed Dec 18 09:08:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 320641D94AF; Wed, 18 Dec 2019 09:08:13 +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 47d8LN2dSXz4MJm; Wed, 18 Dec 2019 09:08:12 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.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 06392260197; Wed, 18 Dec 2019 09:57:29 +0100 (CET) Subject: Re: svn commit: r341578 - head/sys/dev/mlx5/mlx5_en From: Hans Petter Selasky To: "Andrey V. Elsukov" , Slava Shwartsman , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051420.wB5EKwxr099242@repo.freebsd.org> <8715aa7b-ceea-7cfd-1980-a260c98070d5@yandex.ru> <6151923d-05bb-b945-359e-d632708ba021@selasky.org> <60698d75-ca26-da71-682c-ec7d24f0eab6@yandex.ru> <8a1d1216-f15d-7fe0-b55c-04b999f8a947@selasky.org> Message-ID: Date: Wed, 18 Dec 2019 09:56:01 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <8a1d1216-f15d-7fe0-b55c-04b999f8a947@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 47d8LN2dSXz4MJm 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.93 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(-2.63)[ip: (-9.18), ipnet: 2a01:4f8::/29(-2.42), asn: 24940(-1.55), country: DE(-0.02)]; FREEMAIL_TO(0.00)[yandex.ru]; 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-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2019 09:08:13 -0000 On 2019-12-18 07:26, Hans Petter Selasky wrote: > On 2019-12-17 18:14, Andrey V. Elsukov wrote: >> On 13.12.2019 17:27, Hans Petter Selasky wrote: >>> On 2019-12-13 14:40, Andrey V. Elsukov wrote: >>>> On 05.12.2018 17:20, Slava Shwartsman wrote: >>>>> Author: slavash >>>>> Date: Wed Dec  5 14:20:57 2018 >>>>> New Revision: 341578 >>>>> URL: https://svnweb.freebsd.org/changeset/base/341578 >>>>> >>>>> Log: >>>>>     mlx5en: Remove the DRBR and associated logic in the transmit path. >>>>>        The hardware queues are deep enough currently and using the >>>>> DRBR and associated >>>>>     callbacks only leads to more task switching in the TX path. The is >>>>> also a race >>>>>     setting the queue_state which can lead to hung TX rings. >>>> >>>> JFYI. We have compared the same router+firewall workloads on the host >>>> with this change and before, and I can say, that without DRBR on TX now >>>> we constantly have several percents of packets drops due to ENOBUFS >>>> error from mlx5e_xmit(). >>>> >>> >>> Have you tried to tune the TX/RX parameters? >>> >>> Especially the tx_queue_size . >> >> We use the following settings: >> % sysctl dev.mce.4.conf. | grep que >> dev.mce.4.conf.rx_queue_size: 16384 >> dev.mce.4.conf.tx_queue_size: 16384 >> dev.mce.4.conf.rx_queue_size_max: 16384 >> dev.mce.4.conf.tx_queue_size_max: 16384 >> >> Also, previously I have patched MLX5E_SQ_TX_QUEUE_SIZE value up to 16384. > > Hi, > > What about the other parameters. Did you tune any of those? > > At what rate does this happen? > > Can you send me the full dev.mce.4 sysctl tree off-list? > Are you using any performance options like RSS in the kernel? How many NUMA domains does this machine have? Have you tuned the driver threads, like binding interrupt threads to CPU's? --HPS From owner-svn-src-head@freebsd.org Wed Dec 18 09:30:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 85E4A1D9A15; Wed, 18 Dec 2019 09:30:33 +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 47d8r932Fyz4NBQ; Wed, 18 Dec 2019 09:30:33 +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 633E0240FD; Wed, 18 Dec 2019 09:30:33 +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 xBI9UXWK067574; Wed, 18 Dec 2019 09:30:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBI9UXBn067572; Wed, 18 Dec 2019 09:30:33 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201912180930.xBI9UXBn067572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 18 Dec 2019 09:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355879 - in head/sys: compat/linuxkpi/common/src kern X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/src kern X-SVN-Commit-Revision: 355879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2019 09:30:33 -0000 Author: hselasky Date: Wed Dec 18 09:30:32 2019 New Revision: 355879 URL: https://svnweb.freebsd.org/changeset/base/355879 Log: Restore important comment in RCU/EPOCH support in FreeBSD after r355784. Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_rcu.c head/sys/kern/subr_epoch.c Modified: head/sys/compat/linuxkpi/common/src/linux_rcu.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_rcu.c Wed Dec 18 08:39:24 2019 (r355878) +++ head/sys/compat/linuxkpi/common/src/linux_rcu.c Wed Dec 18 09:30:32 2019 (r355879) @@ -259,6 +259,15 @@ linux_synchronize_rcu_cb(ck_epoch_t *epoch __unused, c sched_prio(td, prio); /* task switch */ mi_switch(SW_VOL | SWT_RELINQUISH); + /* + * It is important the thread lock is dropped + * while yielding to allow other threads to + * acquire the lock pointed to by + * TDQ_LOCKPTR(td). Currently mi_switch() will + * unlock the thread lock before + * returning. Else a deadlock like situation + * might happen. + */ thread_lock(td); } } else { Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Wed Dec 18 08:39:24 2019 (r355878) +++ head/sys/kern/subr_epoch.c Wed Dec 18 09:30:32 2019 (r355879) @@ -578,6 +578,13 @@ epoch_block_handler_preempt(struct ck_epoch *global __ */ counter_u64_add(switch_count, 1); mi_switch(SW_VOL | SWT_RELINQUISH); + /* + * It is important the thread lock is dropped while yielding + * to allow other threads to acquire the lock pointed to by + * TDQ_LOCKPTR(td). Currently mi_switch() will unlock the + * thread lock before returning. Else a deadlock like + * situation might happen. + */ thread_lock(td); } From owner-svn-src-head@freebsd.org Wed Dec 18 11:42:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0AB001DC6CE for ; Wed, 18 Dec 2019 11:42:37 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) (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 47dCmX00Zgz4V4Y for ; Wed, 18 Dec 2019 11:42:35 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm1-x32d.google.com with SMTP id u2so1535344wmc.3 for ; Wed, 18 Dec 2019 03:42:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=dYsUu6WNhgu4zsHjN+bmglIu4xtOzhDY+vuwM0lrAEg=; b=1oGqlOe5fvS8jeBYFvgNBsVI64ObqiACfYtgvd4mIIJCifCeuY7mFeJXwZoy+Y7XbM tcMYvpeqEBMkoLPpDM+pNQQhRXkaQIfsEl1KSsaWzA6fJRnfjyVbTBEMJ1Ow5TTGihhs on2fgnwj9lJDrNYF6MhgSh7s2tLuVWG+nMFJS4aEm5MWmytCb8g/qLdMDZy+GdxoA2sA JQVmBgsjBKM82GjyP3bz+/+kXDvc6isB29q6o2kbCxF7QjOZftcp4OD0jGhzOBJtzpYE NdZk78eQPpogAxZPxO+SQZCR2IetfxweBVijjgMO0/VIvsZxSXv4yo0vDq3hNm1xj3aK Cg3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=dYsUu6WNhgu4zsHjN+bmglIu4xtOzhDY+vuwM0lrAEg=; b=jgx9lEO4d+nCHtfKYzzKFBXK+5IlGpcKOMUnDYdzviy6zqFqQcHY7WqkyFZYZHWlkv LpzcjCezl5onfXYs1WFedi3o08db5vYMf47UdNHLvwy+iLCysbMdml7FkNAcI68guuwS 697OZ7eU+Sh2mmIL0uFeAuc13YSdJF0x9jkV5YW0XdnjYHweKVMgXxFFbyHbD4BJokiV qW0UOHvyNDCopBfUDQyZRNHG9qi0855sRaQo/Fo9I55ILqhFiLv04E5Cdck3hmSUo4Ow Y0ofDs9sVeWBFjZMPSV+wIcoO5zLQtTL+JNLFl8nzXjpPJH82aK522xni6BjIv1/3YtN JT/g== X-Gm-Message-State: APjAAAX+7v/qE3uLQmyK1wIW2svVVtT5m5bYT4NiO9boZ+6/E2Nz9ifj CjsziG3HFYrC07JKlEyXpmznsl1CtiM= X-Google-Smtp-Source: APXvYqyZNibdqvg4SuQ+llz4VO0iPY/QIuQ8BYqJeSXIEVG04tkVsDWsOyzWgU6J9dQj0lnZyv2n3w== X-Received: by 2002:a1c:7508:: with SMTP id o8mr2697597wmc.74.1576669353523; Wed, 18 Dec 2019 03:42:33 -0800 (PST) Received: from [10.44.128.75] ([193.117.175.106]) by smtp.gmail.com with ESMTPSA id f1sm2271215wru.6.2019.12.18.03.42.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Dec 2019 03:42:32 -0800 (PST) Subject: Re: svn commit: r355831 - head/sys/cam/nvme To: Warner Losh Cc: Warner Losh , src-committers , svn-src-all , svn-src-head References: <201912170011.xBH0Bm5I088826@repo.freebsd.org> <4c5ce3c8-d074-f907-af03-20f4752f428c@multiplay.co.uk> From: Steven Hartland Message-ID: <8185819d-aa76-a184-4710-37bfc60c6cd8@multiplay.co.uk> Date: Wed, 18 Dec 2019 11:42:31 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Rspamd-Queue-Id: 47dCmX00Zgz4V4Y X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=multiplay-co-uk.20150623.gappssmtp.com header.s=20150623 header.b=1oGqlOe5; dmarc=pass (policy=none) header.from=multiplay.co.uk; spf=pass (mx1.freebsd.org: domain of steven.hartland@multiplay.co.uk designates 2a00:1450:4864:20::32d as permitted sender) smtp.mailfrom=steven.hartland@multiplay.co.uk X-Spamd-Result: default: False [-5.76 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[multiplay-co-uk.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[multiplay-co-uk.20150623.gappssmtp.com:+]; DMARC_POLICY_ALLOW(-0.50)[multiplay.co.uk,none]; RCVD_IN_DNSWL_NONE(0.00)[d.2.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:+,1:+,2:~]; IP_SCORE(-2.76)[ip: (-9.19), ipnet: 2a00:1450::/32(-2.66), asn: 15169(-1.90), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2019 11:42:37 -0000 Thanks for all the feedback Warner, some more comments in line below, would be interested in your thoughts. On 17/12/2019 02:53, Warner Losh wrote: > On Mon, Dec 16, 2019, 5:28 PM Steven Hartland > > wrote: > > Be aware that ZFS already does a pretty decent job of this > already, so the statement about upper layers isn't true for all. > It even has different priorities > for different request types so I'm a little concerned that doing > it at both layers could cause issues. > > > ZFS' BIO_DELETE scheduling works well for enterprise drives, but needs > tuning the further away you get from enterprise performance. I don't > anticipate any effect on performance here since this is not enabled by > default, unless I've messed something up (and if I have screwed this > up, please let me know). I've honestly not tried to enable these > things on ZFS. > > In addition to this if its anything like SSD's numbers of requests > are only a small part of the story with total trim size being the > other one. I this case you could hit total desired size with just > one BIO_DELETE request. > > With this code what's the impact of this? > > > You're correct.  It tends to be the number of segments and/or the size > of the segment. This steers cases where the number of segments > dominates. For cases where total size dominates, you're often better > off using the I/O scheduler to rate limit the size of the trims. This is also one of the reasons I introduced kern.geom.dev.delete_max_sectors. It would be worth at some time writing up a guide to all the logic in the various layers with regards to how we treat TRIM requests. There are quite few elements now and I don't believe its clear where they all are and what they are trying to achieve, which makes it easy for them to start fighting against either other. > This feature is designed to allow a large number of files to be > deleted at once while doing the trims from them a little at a time to > even the load out. That's pretty similar in concept to our current ZFS TRIM code, only time will tell once the new upstream gets merged, if this is still the case.    Regards    Steve From owner-svn-src-head@freebsd.org Wed Dec 18 12:06:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 420051DD9B0; Wed, 18 Dec 2019 12:06: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 47dDJC0sGYz4WVX; Wed, 18 Dec 2019 12:06: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 13DBE25EBA; Wed, 18 Dec 2019 12:06: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 xBIC6YZa061594; Wed, 18 Dec 2019 12:06:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBIC6YDL061592; Wed, 18 Dec 2019 12:06:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201912181206.xBIC6YDL061592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 18 Dec 2019 12:06:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355881 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 355881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2019 12:06:35 -0000 Author: hselasky Date: Wed Dec 18 12:06:34 2019 New Revision: 355881 URL: https://svnweb.freebsd.org/changeset/base/355881 Log: Leave multicast group before reaping and committing state for both IPv4 and IPv6. This fixes a regression issue after r349369. When trying to exit a multicast group before closing the socket, a multicast leave packet should be sent. Differential Revision: https://reviews.freebsd.org/D22848 PR: 242677 Reviewed by: bz (network) Tested by: Aleksandr Fedorov MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/netinet/in_mcast.c head/sys/netinet6/in6_mcast.c Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Wed Dec 18 11:48:50 2019 (r355880) +++ head/sys/netinet/in_mcast.c Wed Dec 18 12:06:34 2019 (r355881) @@ -2409,6 +2409,12 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop if (is_final) { ip_mfilter_remove(&imo->imo_head, imf); imf_leave(imf); + + /* + * Give up the multicast address record to which + * the membership points. + */ + (void) in_leavegroup_locked(imf->imf_inm, imf); } else { if (imf->imf_st[0] == MCAST_EXCLUDE) { error = EADDRNOTAVAIL; @@ -2463,14 +2469,8 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop out_inp_locked: INP_WUNLOCK(inp); - if (is_final && imf) { - /* - * Give up the multicast address record to which - * the membership points. - */ - (void) in_leavegroup_locked(imf->imf_inm, imf); + if (is_final && imf) ip_mfilter_free(imf); - } IN_MULTI_UNLOCK(); return (error); Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Wed Dec 18 11:48:50 2019 (r355880) +++ head/sys/netinet6/in6_mcast.c Wed Dec 18 12:06:34 2019 (r355881) @@ -2328,6 +2328,12 @@ in6p_leave_group(struct inpcb *inp, struct sockopt *so if (is_final) { ip6_mfilter_remove(&imo->im6o_head, imf); im6f_leave(imf); + + /* + * Give up the multicast address record to which + * the membership points. + */ + (void)in6_leavegroup_locked(inm, imf); } else { if (imf->im6f_st[0] == MCAST_EXCLUDE) { error = EADDRNOTAVAIL; @@ -2384,14 +2390,8 @@ in6p_leave_group(struct inpcb *inp, struct sockopt *so out_in6p_locked: INP_WUNLOCK(inp); - if (is_final && imf) { - /* - * Give up the multicast address record to which - * the membership points. - */ - (void)in6_leavegroup_locked(inm, imf); + if (is_final && imf) ip6_mfilter_free(imf); - } IN6_MULTI_UNLOCK(); return (error); From owner-svn-src-head@freebsd.org Wed Dec 18 12:30:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 555F21DE118; Wed, 18 Dec 2019 12:30:56 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) (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 47dDrG2KYjz4XYn; Wed, 18 Dec 2019 12:30:53 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback3g.mail.yandex.net (mxback3g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:164]) by forward102o.mail.yandex.net (Yandex) with ESMTP id 324366682356; Wed, 18 Dec 2019 15:30:50 +0300 (MSK) Received: from myt4-07bed427b9db.qloud-c.yandex.net (myt4-07bed427b9db.qloud-c.yandex.net [2a02:6b8:c00:887:0:640:7be:d427]) by mxback3g.mail.yandex.net (mxback/Yandex) with ESMTP id UjC4EgpAPG-UoSmoCiD; Wed, 18 Dec 2019 15:30:50 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1576672250; bh=tj1Hmc3UdJDdB4w/01FPFFbU4EpI02XbVfrTqs+bGkQ=; h=In-Reply-To:From:Date:References:To:Subject:Message-ID; b=ml83l2buXhypZroC+lHGyGXQNbQXjnQ+ljgsQzt2R1cur5f9PUmOBJciW7U9atp5H 0kzJdgdLR9dHkGZbfSv+2XHR4nC/AO1jktYC3zyCW3YCEoQbtCThjtP++ZzLe1qIdn 5V9affekWKmC6qkfK87CFPVtXu6wNW91+UDm0uGg= Received: by myt4-07bed427b9db.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id 4QwfXWVKBn-UnUiiMHZ; Wed, 18 Dec 2019 15:30:49 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Subject: Re: svn commit: r343631 - in head: . sbin sbin/pfilctl share/man/man9 sys/contrib/ipfilter/netinet sys/net sys/netinet sys/netinet6 sys/netpfil/ipfw sys/netpfil/pf To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201901312301.x0VN13lM097213@repo.freebsd.org> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= mQENBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAG0JUFuZHJleSBWLiBFbHN1a292IDxidTdjaGVyQHlhbmRleC5ydT6JATgEEwECACIFAkwB F1kCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEAHF6gQQyKF6qmYIAI6ekfm1VA4T vqankI1ISE6ku4jV7UlpIQlEbE7/8n3Zd6teJ+pGOQhN5qk8QE7utdPdbktAzi+x7LIJVzUw 4TywZLXGrkP7VKYkfg6oyCGyzITghefQeJtr2TN4hYCkzPWpylkue8MtmqfZv/6royqwTbN+ +E09FQNvTgRUYJYTeQ1qOsxNRycwvw3dr2rOfuxShbzaHBB1pBIjGrMg8fC5pd65ACH5zuFV A0CoTNGMDrEZSfBkTW604UUHFFXeCoC3dwDZRKOWJ3GmMXns65Ai5YkA63BSHEE1Qle3VBhd cG1w0CB5FBV3pB27UVnf0jEbysrDqW4qN7XMRFSWNAy5AQ0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAYkBHwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: Date: Wed, 18 Dec 2019 15:27:58 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <201901312301.x0VN13lM097213@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="a7nsQTPZBur41JjqANZm3RUKBGJfa16NX" X-Rspamd-Queue-Id: 47dDrG2KYjz4XYn X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yandex.ru header.s=mail header.b=ml83l2bu; dmarc=pass (policy=none) header.from=yandex.ru; spf=pass (mx1.freebsd.org: domain of bu7cher@yandex.ru designates 37.140.190.182 as permitted sender) smtp.mailfrom=bu7cher@yandex.ru X-Spamd-Result: default: False [-6.20 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[yandex.ru]; R_SPF_ALLOW(-0.20)[+ip4:37.140.128.0/18]; HAS_ATTACHMENT(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[yandex.ru:+]; DMARC_POLICY_ALLOW(-0.50)[yandex.ru,none]; SIGNED_PGP(-2.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[182.190.140.37.list.dnswl.org : 127.0.5.1]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~]; IP_SCORE(0.00)[ip: (-9.88), ipnet: 37.140.128.0/18(-4.81), asn: 13238(-3.79), country: RU(0.01)]; FREEMAIL_ENVFROM(0.00)[yandex.ru]; ASN(0.00)[asn:13238, ipnet:37.140.128.0/18, country:RU]; MID_RHS_MATCH_FROM(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[yandex.ru:s=mail]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain]; RCVD_TLS_LAST(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; DWL_DNSWL_LOW(-1.00)[yandex.ru.dwl.dnswl.org : 127.0.5.1]; RWL_MAILSPIKE_POSSIBLE(0.00)[182.190.140.37.rep.mailspike.net : 127.0.0.17] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2019 12:30:56 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --a7nsQTPZBur41JjqANZm3RUKBGJfa16NX Content-Type: multipart/mixed; boundary="smYsCYNnfwvYhp1wjHjnzubMUhCdNK0MW"; protected-headers="v1" From: "Andrey V. Elsukov" To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r343631 - in head: . sbin sbin/pfilctl share/man/man9 sys/contrib/ipfilter/netinet sys/net sys/netinet sys/netinet6 sys/netpfil/ipfw sys/netpfil/pf References: <201901312301.x0VN13lM097213@repo.freebsd.org> In-Reply-To: <201901312301.x0VN13lM097213@repo.freebsd.org> --smYsCYNnfwvYhp1wjHjnzubMUhCdNK0MW Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 01.02.2019 02:01, Gleb Smirnoff wrote: > Author: glebius > Date: Thu Jan 31 23:01:03 2019 > New Revision: 343631 > URL: https://svnweb.freebsd.org/changeset/base/343631 >=20 > Log: > New pfil(9) KPI together with newborn pfil API and control utility. > =20 > The KPI have been reviewed and cleansed of features that were planned= > back 20 years ago and never implemented. The pfil(9) internals have > been made opaque to protocols with only returned types and function > declarations exposed. The KPI is made more strict, but at the same ti= me > more extensible, as kernel uses same command structures that userland= > ioctl uses. > =20 > In nutshell [KA]PI is about declaring filtering points, declaring > filters and linking and unlinking them together. > =20 > New [KA]PI makes it possible to reconfigure pfil(9) configuration: > change order of hooks, rehook filter from one filtering point to a > different one, disconnect a hook on output leaving it on input only, > prepend/append a filter to existing list of filters. > =20 > Now it possible for a single packet filter to provide multiple rulese= ts > that may be linked to different points. Think of per-interface ACLs i= n > Cisco or Juniper. None of existing packet filters yet support that, > however limited usage is already possible, e.g. default ruleset can > be moved to single interface, as soon as interface would pride their > filtering points. > =20 > Another future feature is possiblity to create pfil heads, that provi= de > not an mbuf pointer but just a memory pointer with length. That would= > allow filtering at very early stages of a packet lifecycle, e.g. when= > packet has just been received by a NIC and no mbuf was yet allocated.= It seems that this commit has changed the error code returned from ip[6]_output() when a packet is blocked. Previously it was EACCES, but now it became EPERM. Was it intentional? --=20 WBR, Andrey V. Elsukov --smYsCYNnfwvYhp1wjHjnzubMUhCdNK0MW-- --a7nsQTPZBur41JjqANZm3RUKBGJfa16NX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAl36G04ACgkQAcXqBBDI oXqmyAf8CbZmnbYgkuv6czq3jjlqqyXJo3NrqXLgKVjiuvoAUyh7LVIoVoec/LYe P6h0TlI2VAZghUMjeRMTiIVpIUjSTAHQJIxYLINfMIJmAaVjE+UQn12RCnbRt/wh EJtIIlyd4HG7STKhe9bgqIV55o+nvtWB58vpw+hp/vB0TaVRp+Vqi76IuWNmFZhB KSu8XoygS005mtLGr6xjEUpvGCHpsflKQkXc+Y+H0t1utJgofHgdv9BHm14Ut4pm CqGpOLH0/aXQGcMC40IPHlPyS0A8sHqEn3E97ucLezWOfhRNWP4if55e1XT0dl8K YpgrDCA8HgC9JFJ+Na7WXldFcrlIxA== =WVtX -----END PGP SIGNATURE----- --a7nsQTPZBur41JjqANZm3RUKBGJfa16NX-- From owner-svn-src-head@freebsd.org Wed Dec 18 16:01:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5753C1E1EA6; Wed, 18 Dec 2019 16:01:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47dKW01hPRz4kGb; Wed, 18 Dec 2019 16:01:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3512D809; Wed, 18 Dec 2019 16:01:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBIG1F1k096464; Wed, 18 Dec 2019 16:01:15 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBIG1F9P096463; Wed, 18 Dec 2019 16:01:15 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912181601.xBIG1F9P096463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 18 Dec 2019 16:01:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355882 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 355882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2019 16:01:16 -0000 Author: imp Date: Wed Dec 18 16:01:15 2019 New Revision: 355882 URL: https://svnweb.freebsd.org/changeset/base/355882 Log: Drop a sleepable lock when we plan on sleeping g_io_speedup waits for the completion of the speedup request before proceeding using biowait(), but check_clear_deps is called with the softdeps lock held (which is non-sleepable). It's safe to drop this lock around the call to speedup, so do that. Submitted by: Peter Holm Reviewed by: kib@ Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Wed Dec 18 12:06:34 2019 (r355881) +++ head/sys/ufs/ffs/ffs_softdep.c Wed Dec 18 16:01:15 2019 (r355882) @@ -13744,6 +13744,7 @@ static void check_clear_deps(mp) struct mount *mp; { + struct ufsmount *ump; size_t resid; /* @@ -13751,8 +13752,11 @@ check_clear_deps(mp) * that have been delayed for performance reasons should * proceed to help alleviate the shortage faster. */ - g_io_speedup(0, BIO_SPEEDUP_TRIM | BIO_SPEEDUP_WRITE, &resid, - VFSTOUFS(mp)->um_cp); + ump = VFSTOUFS(mp); + FREE_LOCK(ump); + g_io_speedup(0, BIO_SPEEDUP_TRIM | BIO_SPEEDUP_WRITE, &resid, ump->um_cp); + ACQUIRE_LOCK(ump); + /* * If we are suspended, it may be because of our using From owner-svn-src-head@freebsd.org Wed Dec 18 16:54:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB7451E3258; Wed, 18 Dec 2019 16:54:01 +0000 (UTC) (envelope-from lists@yamagi.org) Received: from mail1.yamagi.org (mail1.yamagi.org [IPv6:2001:19f0:b001:853::3]) (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 47dLgr4CPBz4nNv; Wed, 18 Dec 2019 16:54:00 +0000 (UTC) (envelope-from lists@yamagi.org) Received: from [2001:470:6845:1:bc89:e268:2ad5:517c] (helo=killua.home.yamagi.org) by mail1.yamagi.org with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3 (FreeBSD)) (envelope-from ) id 1ihca8-0002uP-VT; Wed, 18 Dec 2019 17:53:54 +0100 Date: Wed, 18 Dec 2019 17:53:41 +0100 From: Yamagi To: vmaffione@FreeBSD.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355301 - head/usr.sbin/bhyve Message-Id: <20191218175341.214724de595423ecfe528dff@yamagi.org> In-Reply-To: <201912022051.xB2Kplot078056@repo.freebsd.org> References: <201912022051.xB2Kplot078056@repo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA256"; boundary="Signature=_Wed__18_Dec_2019_17_53_41_+0100_DAj1qso_aVhziwSm" X-Rspamd-Queue-Id: 47dLgr4CPBz4nNv X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of lists@yamagi.org designates 2001:19f0:b001:853::3 as permitted sender) smtp.mailfrom=lists@yamagi.org X-Spamd-Result: default: False [-4.33 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[yamagi.org]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-0.43)[asn: 20473(-2.12), country: US(-0.05)]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:20473, ipnet:2001:19f0:b000::/38, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2019 16:54:01 -0000 --Signature=_Wed__18_Dec_2019_17_53_41_+0100_DAj1qso_aVhziwSm Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, the change to the defintion of 'const char *vbuf' in rfb.c is wrong. The protocol version string must be send as "RFB 003.008\n" and not as "RFB 003.008\n\r", otherwise the VNC client isn't able to complete the handshake (it doesn't recognize the protocol version). While it stays connected, it doesn't show anything. This patch fixes it for me: diff --git a/usr.sbin/bhyve/rfb.c b/usr.sbin/bhyve/rfb.c index b8fe6e3137d..9c8c6eb0764 100644 --- a/usr.sbin/bhyve/rfb.c +++ b/usr.sbin/bhyve/rfb.c @@ -744,7 +744,7 @@ rfb_wr_thr(void *arg) void rfb_handle(struct rfb_softc *rc, int cfd) { - const char *vbuf =3D "RFB 003.008\n\r"; + const char *vbuf =3D "RFB 003.008\n"; unsigned char buf[80]; unsigned char *message =3D NULL; Regards, Yamagi On Mon, 2 Dec 2019 20:51:47 +0000 (UTC) Vincenzo Maffione wrote: > Author: vmaffione > Date: Mon Dec 2 20:51:46 2019 > New Revision: 355301 > URL: https://svnweb.freebsd.org/changeset/base/355301 >=20 > Log: > bhyve: uniform printf format string newlines > =20 > Some of the printf statements only use LF to get a newline. However, a = CR character is also required for the serial console to print debug logs in= a nice way. > Fix those code locations that only use LF, by adding a CR character. > =20 > Reviewed by: markj, aleksandr.fedorov@itglobal.com > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D22552 --Signature=_Wed__18_Dec_2019_17_53_41_+0100_DAj1qso_aVhziwSm Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEOXu/lxyufwz0gC5x6xRy5x1QJRUFAl36WZUACgkQ6xRy5x1Q JRW4mQ/+MKlZap5WgUc4GhNf/DGfXLkOTRcf+/DjQhLjSTjW4lu9QLA70yuQMkTu QaLqrMWX5L6xdYLWuBNtrAglaC5ECJJHnEcXB17JpQgUn/cLFmjqDYdaznjc/X7S 7GvTPu7rgWk1kz7sASGEjsW+4UgU0iFVPBZYUVJvc5YJKvNfAf3EcV5vIjEXjouS GM5juH1llHl3dAQU4eHwI8DRieJGvp37irLz/JKJrb/i5rtMoGVB74SM4jfOk/7d zf6F2yketl0Ct5spq2vhr46URzaUeOBnTMIdnUPQycJjSbw8Oq+j9VTOyeN7YKJ8 UJHBYhg+HzrF7J0Jc/45fi3Y6yNh7KYvPxeu051ZKKHwg5ZabbpRjVUvfpcrEXTM z4F0lhOBsII/HA/9G5kiJMCrk4Im/2K1vg6vNGdNSYzengBZi4/wlqUwKLe5luMY 6PAjTZCKr2/3z4CHcZJLlfh3hv7UvPVZ2a6wI2VBD+GHOgJdIpzK9HZYvXFs5N0+ KS/ThrB2dDK+3KpbbOffk5FFmvpVEMtMkyzzC+OQVl1EZ6hqhcFxrHeolYrUp4oU GhC+oKFRx8Iic/XUIkiPh43mTGOEmFG83RsQ94L5ZxIgRkbYdASwtsczB7NHO3yn n5X3HM5TYy+pE9QbY8qyuu1pcSTvXCtW8dejBOe5YcJCtnaPKBE= =X39R -----END PGP SIGNATURE----- --Signature=_Wed__18_Dec_2019_17_53_41_+0100_DAj1qso_aVhziwSm-- From owner-svn-src-head@freebsd.org Wed Dec 18 18:21:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5495E1E4110; Wed, 18 Dec 2019 18:21:40 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47dNd02Knrz4rbn; Wed, 18 Dec 2019 18:21:40 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B07520CB; Wed, 18 Dec 2019 18:21:40 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBIILelD085189; Wed, 18 Dec 2019 18:21:40 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBIILeTV085187; Wed, 18 Dec 2019 18:21:40 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201912181821.xBIILeTV085187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Wed, 18 Dec 2019 18:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355883 - in head/sys: amd64/amd64 arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm64/arm64 X-SVN-Commit-Revision: 355883 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2019 18:21:40 -0000 Author: alc Date: Wed Dec 18 18:21:39 2019 New Revision: 355883 URL: https://svnweb.freebsd.org/changeset/base/355883 Log: When pmap_enter_{l2,pde}() are called to create a kernel mapping, they are incrementing (and decrementing) the ref_count on kernel page table pages. They should not do this. Kernel page table pages are expected to have a fixed ref_count. Address this problem by refactoring pmap_alloc{_l2,pde}() and their callers. This also eliminates some duplicated code from the callers. Correctly implement PMAP_ENTER_NOREPLACE in pmap_enter_{l2,pde}() on kernel mappings. Reduce code duplication by defining a function, pmap_abort_ptp(), for handling a common error case. Handle a possible page table page leak in pmap_copy(). Suppose that we are determining whether to copy a superpage mapping. If we abort because there is already a mapping in the destination pmap at the current address, then simply decrementing the page table page's ref_count is correct, because the page table page must have a ref_count > 1. However, if we abort because we failed to allocate a PV entry, this might be a just allocated page table page that has a ref_count = 1, so we should call pmap_abort_ptp(). Simplify error handling in pmap_enter_quick_locked(). Reviewed by: kib, markj (an earlier) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D22763 Modified: head/sys/amd64/amd64/pmap.c head/sys/arm64/arm64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Dec 18 16:01:15 2019 (r355882) +++ head/sys/amd64/amd64/pmap.c Wed Dec 18 18:21:39 2019 (r355883) @@ -1202,6 +1202,7 @@ static void pmap_pvh_free(struct md_page *pvh, pmap_t static pv_entry_t pmap_pvh_remove(struct md_page *pvh, pmap_t pmap, vm_offset_t va); +static void pmap_abort_ptp(pmap_t pmap, vm_offset_t va, vm_page_t mpte); static int pmap_change_props_locked(vm_offset_t va, vm_size_t size, vm_prot_t prot, int mode, int flags); static boolean_t pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va); @@ -1256,7 +1257,7 @@ static void pmap_update_pde_invalidate(pmap_t, vm_offs static vm_page_t _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp); -static vm_page_t pmap_allocpde(pmap_t pmap, vm_offset_t va, +static pd_entry_t *pmap_alloc_pde(pmap_t pmap, vm_offset_t va, vm_page_t *pdpgp, struct rwlock **lockp); static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, struct rwlock **lockp); @@ -3601,6 +3602,27 @@ pmap_unuse_pt(pmap_t pmap, vm_offset_t va, pd_entry_t return (pmap_unwire_ptp(pmap, va, mpte, free)); } +/* + * Release a page table page reference after a failed attempt to create a + * mapping. + */ +static void +pmap_abort_ptp(pmap_t pmap, vm_offset_t va, vm_page_t mpte) +{ + struct spglist free; + + SLIST_INIT(&free); + if (pmap_unwire_ptp(pmap, va, mpte, &free)) { + /* + * Although "va" was never mapped, paging-structure caches + * could nonetheless have entries that refer to the freed + * page table pages. Invalidate those entries. + */ + pmap_invalidate_page(pmap, va); + vm_page_free_pages_toq(&free, true); + } +} + void pmap_pinit0(pmap_t pmap) { @@ -3906,30 +3928,44 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, str return (m); } -static vm_page_t -pmap_allocpde(pmap_t pmap, vm_offset_t va, struct rwlock **lockp) +static pd_entry_t * +pmap_alloc_pde(pmap_t pmap, vm_offset_t va, vm_page_t *pdpgp, + struct rwlock **lockp) { - vm_pindex_t pdpindex, ptepindex; pdp_entry_t *pdpe, PG_V; + pd_entry_t *pde; vm_page_t pdpg; + vm_pindex_t pdpindex; PG_V = pmap_valid_bit(pmap); retry: pdpe = pmap_pdpe(pmap, va); if (pdpe != NULL && (*pdpe & PG_V) != 0) { - /* Add a reference to the pd page. */ - pdpg = PHYS_TO_VM_PAGE(*pdpe & PG_FRAME); - pdpg->ref_count++; - } else { + pde = pmap_pdpe_to_pde(pdpe, va); + if (va < VM_MAXUSER_ADDRESS) { + /* Add a reference to the pd page. */ + pdpg = PHYS_TO_VM_PAGE(*pdpe & PG_FRAME); + pdpg->ref_count++; + } else + pdpg = NULL; + } else if (va < VM_MAXUSER_ADDRESS) { /* Allocate a pd page. */ - ptepindex = pmap_pde_pindex(va); - pdpindex = ptepindex >> NPDPEPGSHIFT; + pdpindex = pmap_pde_pindex(va) >> NPDPEPGSHIFT; pdpg = _pmap_allocpte(pmap, NUPDE + pdpindex, lockp); - if (pdpg == NULL && lockp != NULL) - goto retry; - } - return (pdpg); + if (pdpg == NULL) { + if (lockp != NULL) + goto retry; + else + return (NULL); + } + pde = (pd_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pdpg)); + pde = &pde[pmap_pde_index(va)]; + } else + panic("pmap_alloc_pde: missing page table page for va %#lx", + va); + *pdpgp = pdpg; + return (pde); } static vm_page_t @@ -6218,6 +6254,24 @@ pmap_enter_2mpage(pmap_t pmap, vm_offset_t va, vm_page } /* + * Returns true if every page table entry in the specified page table page is + * zero. + */ +static bool +pmap_every_pte_zero(vm_paddr_t pa) +{ + pt_entry_t *pt_end, *pte; + + KASSERT((pa & PAGE_MASK) == 0, ("pa is misaligned")); + pte = (pt_entry_t *)PHYS_TO_DMAP(pa); + for (pt_end = pte + NPTEPG; pte < pt_end; pte++) { + if (*pte != 0) + return (false); + } + return (true); +} + +/* * Tries to create the specified 2MB page mapping. Returns KERN_SUCCESS if * the mapping was created, and either KERN_FAILURE or KERN_RESOURCE_SHORTAGE * otherwise. Returns KERN_FAILURE if PMAP_ENTER_NOREPLACE was specified and @@ -6252,8 +6306,8 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t " in pmap %p", va, pmap); return (KERN_FAILURE); } - if ((pdpg = pmap_allocpde(pmap, va, (flags & PMAP_ENTER_NOSLEEP) != 0 ? - NULL : lockp)) == NULL) { + if ((pde = pmap_alloc_pde(pmap, va, &pdpg, (flags & + PMAP_ENTER_NOSLEEP) != 0 ? NULL : lockp)) == NULL) { CTR2(KTR_PMAP, "pmap_enter_pde: failure for va %#lx" " in pmap %p", va, pmap); return (KERN_RESOURCE_SHORTAGE); @@ -6265,11 +6319,7 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t * it could sleep. */ if (!pmap_pkru_same(pmap, va, va + NBPDR)) { - SLIST_INIT(&free); - if (pmap_unwire_ptp(pmap, va, pdpg, &free)) { - pmap_invalidate_page(pmap, va); - vm_page_free_pages_toq(&free, true); - } + pmap_abort_ptp(pmap, va, pdpg); return (KERN_FAILURE); } if (va < VM_MAXUSER_ADDRESS && pmap->pm_type == PT_X86) { @@ -6277,14 +6327,18 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t newpde |= pmap_pkru_get(pmap, va); } - pde = (pd_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pdpg)); - pde = &pde[pmap_pde_index(va)]; + /* + * If there are existing mappings, either abort or remove them. + */ oldpde = *pde; if ((oldpde & PG_V) != 0) { - KASSERT(pdpg->ref_count > 1, + KASSERT(pdpg == NULL || pdpg->ref_count > 1, ("pmap_enter_pde: pdpg's reference count is too low")); - if ((flags & PMAP_ENTER_NOREPLACE) != 0) { - pdpg->ref_count--; + if ((flags & PMAP_ENTER_NOREPLACE) != 0 && (va < + VM_MAXUSER_ADDRESS || (oldpde & PG_PS) != 0 || + pmap_every_pte_zero(oldpde & PG_FRAME))) { + if (pdpg != NULL) + pdpg->ref_count--; CTR2(KTR_PMAP, "pmap_enter_pde: failure for va %#lx" " in pmap %p", va, pmap); return (KERN_FAILURE); @@ -6294,7 +6348,7 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t if ((oldpde & PG_PS) != 0) { /* * The reference to the PD page that was acquired by - * pmap_allocpde() ensures that it won't be freed. + * pmap_alloc_pde() ensures that it won't be freed. * However, if the PDE resulted from a promotion, then * a reserved PT page could be freed. */ @@ -6308,8 +6362,14 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t pmap_invalidate_all(pmap); pmap_delayed_invl_finish(); } - vm_page_free_pages_toq(&free, true); - if (va >= VM_MAXUSER_ADDRESS) { + if (va < VM_MAXUSER_ADDRESS) { + vm_page_free_pages_toq(&free, true); + KASSERT(*pde == 0, ("pmap_enter_pde: non-zero pde %p", + pde)); + } else { + KASSERT(SLIST_EMPTY(&free), + ("pmap_enter_pde: freed kernel page table page")); + /* * Both pmap_remove_pde() and pmap_remove_ptes() will * leave the kernel page table page zero filled. @@ -6317,26 +6377,16 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t mt = PHYS_TO_VM_PAGE(*pde & PG_FRAME); if (pmap_insert_pt_page(pmap, mt, false)) panic("pmap_enter_pde: trie insert failed"); - } else - KASSERT(*pde == 0, ("pmap_enter_pde: non-zero pde %p", - pde)); + } } + if ((newpde & PG_MANAGED) != 0) { /* * Abort this mapping if its PV entry could not be created. */ if (!pmap_pv_insert_pde(pmap, va, newpde, flags, lockp)) { - SLIST_INIT(&free); - if (pmap_unwire_ptp(pmap, va, pdpg, &free)) { - /* - * Although "va" is not mapped, paging- - * structure caches could nonetheless have - * entries that refer to the freed page table - * pages. Invalidate those entries. - */ - pmap_invalidate_page(pmap, va); - vm_page_free_pages_toq(&free, true); - } + if (pdpg != NULL) + pmap_abort_ptp(pmap, va, pdpg); CTR2(KTR_PMAP, "pmap_enter_pde: failure for va %#lx" " in pmap %p", va, pmap); return (KERN_RESOURCE_SHORTAGE); @@ -6361,8 +6411,8 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t pde_store(pde, newpde); atomic_add_long(&pmap_pde_mappings, 1); - CTR2(KTR_PMAP, "pmap_enter_pde: success for va %#lx" - " in pmap %p", va, pmap); + CTR2(KTR_PMAP, "pmap_enter_pde: success for va %#lx in pmap %p", + va, pmap); return (KERN_SUCCESS); } @@ -6437,7 +6487,6 @@ static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp) { - struct spglist free; pt_entry_t newpte, *pte, PG_V; KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva || @@ -6494,11 +6543,9 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v pte = vtopte(va); } if (*pte) { - if (mpte != NULL) { + if (mpte != NULL) mpte->ref_count--; - mpte = NULL; - } - return (mpte); + return (NULL); } /* @@ -6506,21 +6553,9 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v */ if ((m->oflags & VPO_UNMANAGED) == 0 && !pmap_try_insert_pv_entry(pmap, va, m, lockp)) { - if (mpte != NULL) { - SLIST_INIT(&free); - if (pmap_unwire_ptp(pmap, va, mpte, &free)) { - /* - * Although "va" is not mapped, paging- - * structure caches could nonetheless have - * entries that refer to the freed page table - * pages. Invalidate those entries. - */ - pmap_invalidate_page(pmap, va); - vm_page_free_pages_toq(&free, true); - } - mpte = NULL; - } - return (mpte); + if (mpte != NULL) + pmap_abort_ptp(pmap, va, mpte); + return (NULL); } /* @@ -6620,8 +6655,8 @@ pmap_object_init_pt(pmap_t pmap, vm_offset_t addr, vm_ PMAP_LOCK(pmap); for (pa = ptepa | pmap_cache_bits(pmap, pat_mode, 1); pa < ptepa + size; pa += NBPDR) { - pdpg = pmap_allocpde(pmap, addr, NULL); - if (pdpg == NULL) { + pde = pmap_alloc_pde(pmap, addr, &pdpg, NULL); + if (pde == NULL) { /* * The creation of mappings below is only an * optimization. If a page directory page @@ -6632,8 +6667,6 @@ pmap_object_init_pt(pmap_t pmap, vm_offset_t addr, vm_ addr += NBPDR; continue; } - pde = (pd_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pdpg)); - pde = &pde[pmap_pde_index(addr)]; if ((*pde & PG_V) == 0) { pde_store(pde, pa | PG_PS | PG_M | PG_A | PG_U | PG_RW | PG_V); @@ -6747,7 +6780,6 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ vm_offset_t src_addr) { struct rwlock *lock; - struct spglist free; pml4_entry_t *pml4e; pdp_entry_t *pdpe; pd_entry_t *pde, srcptepaddr; @@ -6818,12 +6850,9 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ if (srcptepaddr & PG_PS) { if ((addr & PDRMASK) != 0 || addr + NBPDR > end_addr) continue; - dst_pdpg = pmap_allocpde(dst_pmap, addr, NULL); - if (dst_pdpg == NULL) + pde = pmap_alloc_pde(dst_pmap, addr, &dst_pdpg, NULL); + if (pde == NULL) break; - pde = (pd_entry_t *) - PHYS_TO_DMAP(VM_PAGE_TO_PHYS(dst_pdpg)); - pde = &pde[pmap_pde_index(addr)]; if (*pde == 0 && ((srcptepaddr & PG_MANAGED) == 0 || pmap_pv_insert_pde(dst_pmap, addr, srcptepaddr, PMAP_ENTER_NORECLAIM, &lock))) { @@ -6832,7 +6861,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ PAGE_SIZE); atomic_add_long(&pmap_pde_mappings, 1); } else - dst_pdpg->ref_count--; + pmap_abort_ptp(dst_pmap, addr, dst_pdpg); continue; } @@ -6877,19 +6906,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ *dst_pte = ptetemp & ~(PG_W | PG_M | PG_A); pmap_resident_count_inc(dst_pmap, 1); } else { - SLIST_INIT(&free); - if (pmap_unwire_ptp(dst_pmap, addr, dstmpte, - &free)) { - /* - * Although "addr" is not mapped, - * paging-structure caches could - * nonetheless have entries that refer - * to the freed page table pages. - * Invalidate those entries. - */ - pmap_invalidate_page(dst_pmap, addr); - vm_page_free_pages_toq(&free, true); - } + pmap_abort_ptp(dst_pmap, addr, dstmpte); goto out; } /* Have we copied all of the valid mappings? */ Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Wed Dec 18 16:01:15 2019 (r355882) +++ head/sys/arm64/arm64/pmap.c Wed Dec 18 18:21:39 2019 (r355883) @@ -331,6 +331,7 @@ static void pmap_pvh_free(struct md_page *pvh, pmap_t static pv_entry_t pmap_pvh_remove(struct md_page *pvh, pmap_t pmap, vm_offset_t va); +static void pmap_abort_ptp(pmap_t pmap, vm_offset_t va, vm_page_t mpte); static bool pmap_activate_int(pmap_t pmap); static void pmap_alloc_asid(pmap_t pmap); static int pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode); @@ -1500,6 +1501,29 @@ pmap_unuse_pt(pmap_t pmap, vm_offset_t va, pd_entry_t return (pmap_unwire_l3(pmap, va, mpte, free)); } +/* + * Release a page table page reference after a failed attempt to create a + * mapping. + */ +static void +pmap_abort_ptp(pmap_t pmap, vm_offset_t va, vm_page_t mpte) +{ + struct spglist free; + + SLIST_INIT(&free); + if (pmap_unwire_l3(pmap, va, mpte, &free)) { + /* + * Although "va" was never mapped, the TLB could nonetheless + * have intermediate entries that refer to the freed page + * table pages. Invalidate those entries. + * + * XXX redundant invalidation (See _pmap_unwire_l3().) + */ + pmap_invalidate_page(pmap, va); + vm_page_free_pages_toq(&free, true); + } +} + void pmap_pinit0(pmap_t pmap) { @@ -1677,27 +1701,41 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str return (m); } -static vm_page_t -pmap_alloc_l2(pmap_t pmap, vm_offset_t va, struct rwlock **lockp) +static pd_entry_t * +pmap_alloc_l2(pmap_t pmap, vm_offset_t va, vm_page_t *l2pgp, + struct rwlock **lockp) { - pd_entry_t *l1; + pd_entry_t *l1, *l2; vm_page_t l2pg; vm_pindex_t l2pindex; retry: l1 = pmap_l1(pmap, va); if (l1 != NULL && (pmap_load(l1) & ATTR_DESCR_MASK) == L1_TABLE) { - /* Add a reference to the L2 page. */ - l2pg = PHYS_TO_VM_PAGE(pmap_load(l1) & ~ATTR_MASK); - l2pg->ref_count++; - } else { + l2 = pmap_l1_to_l2(l1, va); + if (va < VM_MAXUSER_ADDRESS) { + /* Add a reference to the L2 page. */ + l2pg = PHYS_TO_VM_PAGE(pmap_load(l1) & ~ATTR_MASK); + l2pg->ref_count++; + } else + l2pg = NULL; + } else if (va < VM_MAXUSER_ADDRESS) { /* Allocate a L2 page. */ l2pindex = pmap_l2_pindex(va) >> Ln_ENTRIES_SHIFT; l2pg = _pmap_alloc_l3(pmap, NUL2E + l2pindex, lockp); - if (l2pg == NULL && lockp != NULL) - goto retry; - } - return (l2pg); + if (l2pg == NULL) { + if (lockp != NULL) + goto retry; + else + return (NULL); + } + l2 = (pd_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(l2pg)); + l2 = &l2[pmap_l2_index(va)]; + } else + panic("pmap_alloc_l2: missing page table page for va %#lx", + va); + *l2pgp = l2pg; + return (l2); } static vm_page_t @@ -3553,6 +3591,24 @@ pmap_enter_2mpage(pmap_t pmap, vm_offset_t va, vm_page } /* + * Returns true if every page table entry in the specified page table is + * zero. + */ +static bool +pmap_every_pte_zero(vm_paddr_t pa) +{ + pt_entry_t *pt_end, *pte; + + KASSERT((pa & PAGE_MASK) == 0, ("pa is misaligned")); + pte = (pt_entry_t *)PHYS_TO_DMAP(pa); + for (pt_end = pte + Ln_ENTRIES; pte < pt_end; pte++) { + if (*pte != 0) + return (false); + } + return (true); +} + +/* * Tries to create the specified 2MB page mapping. Returns KERN_SUCCESS if * the mapping was created, and either KERN_FAILURE or KERN_RESOURCE_SHORTAGE * otherwise. Returns KERN_FAILURE if PMAP_ENTER_NOREPLACE was specified and @@ -3573,23 +3629,26 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t PMAP_LOCK_ASSERT(pmap, MA_OWNED); - if ((l2pg = pmap_alloc_l2(pmap, va, (flags & PMAP_ENTER_NOSLEEP) != 0 ? - NULL : lockp)) == NULL) { + if ((l2 = pmap_alloc_l2(pmap, va, &l2pg, (flags & + PMAP_ENTER_NOSLEEP) != 0 ? NULL : lockp)) == NULL) { CTR2(KTR_PMAP, "pmap_enter_l2: failure for va %#lx in pmap %p", va, pmap); return (KERN_RESOURCE_SHORTAGE); } - l2 = (pd_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(l2pg)); - l2 = &l2[pmap_l2_index(va)]; + /* + * If there are existing mappings, either abort or remove them. + */ if ((old_l2 = pmap_load(l2)) != 0) { - KASSERT(l2pg->ref_count > 1, + KASSERT(l2pg == NULL || l2pg->ref_count > 1, ("pmap_enter_l2: l2pg's ref count is too low")); - if ((flags & PMAP_ENTER_NOREPLACE) != 0) { - l2pg->ref_count--; - CTR2(KTR_PMAP, - "pmap_enter_l2: failure for va %#lx in pmap %p", - va, pmap); + if ((flags & PMAP_ENTER_NOREPLACE) != 0 && (va < + VM_MAXUSER_ADDRESS || (old_l2 & ATTR_DESCR_MASK) == + L2_BLOCK || pmap_every_pte_zero(old_l2 & ~ATTR_MASK))) { + if (l2pg != NULL) + l2pg->ref_count--; + CTR2(KTR_PMAP, "pmap_enter_l2: failure for va %#lx" + " in pmap %p", va, pmap); return (KERN_FAILURE); } SLIST_INIT(&free); @@ -3599,8 +3658,14 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t else pmap_remove_l3_range(pmap, old_l2, va, va + L2_SIZE, &free, lockp); - vm_page_free_pages_toq(&free, true); - if (va >= VM_MAXUSER_ADDRESS) { + if (va < VM_MAXUSER_ADDRESS) { + vm_page_free_pages_toq(&free, true); + KASSERT(pmap_load(l2) == 0, + ("pmap_enter_l2: non-zero L2 entry %p", l2)); + } else { + KASSERT(SLIST_EMPTY(&free), + ("pmap_enter_l2: freed kernel page table page")); + /* * Both pmap_remove_l2() and pmap_remove_l3_range() * will leave the kernel page table page zero filled. @@ -3612,9 +3677,7 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t panic("pmap_enter_l2: trie insert failed"); pmap_clear(l2); pmap_invalidate_page(pmap, va); - } else - KASSERT(pmap_load(l2) == 0, - ("pmap_enter_l2: non-zero L2 entry %p", l2)); + } } if ((new_l2 & ATTR_SW_MANAGED) != 0) { @@ -3622,20 +3685,8 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t * Abort this mapping if its PV entry could not be created. */ if (!pmap_pv_insert_l2(pmap, va, new_l2, flags, lockp)) { - SLIST_INIT(&free); - if (pmap_unwire_l3(pmap, va, l2pg, &free)) { - /* - * Although "va" is not mapped, the TLB could - * nonetheless have intermediate entries that - * refer to the freed page table pages. - * Invalidate those entries. - * - * XXX redundant invalidation (See - * _pmap_unwire_l3().) - */ - pmap_invalidate_page(pmap, va); - vm_page_free_pages_toq(&free, true); - } + if (l2pg != NULL) + pmap_abort_ptp(pmap, va, l2pg); CTR2(KTR_PMAP, "pmap_enter_l2: failure for va %#lx in pmap %p", va, pmap); @@ -3736,7 +3787,6 @@ static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp) { - struct spglist free; pd_entry_t *pde; pt_entry_t *l2, *l3, l3_val; vm_paddr_t pa; @@ -3810,11 +3860,9 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v * Abort if a mapping already exists. */ if (pmap_load(l3) != 0) { - if (mpte != NULL) { + if (mpte != NULL) mpte->ref_count--; - mpte = NULL; - } - return (mpte); + return (NULL); } /* @@ -3822,15 +3870,9 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v */ if ((m->oflags & VPO_UNMANAGED) == 0 && !pmap_try_insert_pv_entry(pmap, va, m, lockp)) { - if (mpte != NULL) { - SLIST_INIT(&free); - if (pmap_unwire_l3(pmap, va, mpte, &free)) { - pmap_invalidate_page(pmap, va); - vm_page_free_pages_toq(&free, true); - } - mpte = NULL; - } - return (mpte); + if (mpte != NULL) + pmap_abort_ptp(pmap, va, mpte); + return (NULL); } /* @@ -3984,7 +4026,6 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ vm_offset_t src_addr) { struct rwlock *lock; - struct spglist free; pd_entry_t *l0, *l1, *l2, srcptepaddr; pt_entry_t *dst_pte, mask, nbits, ptetemp, *src_pte; vm_offset_t addr, end_addr, va_next; @@ -4027,12 +4068,9 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ if ((addr & L2_OFFSET) != 0 || addr + L2_SIZE > end_addr) continue; - dst_l2pg = pmap_alloc_l2(dst_pmap, addr, NULL); - if (dst_l2pg == NULL) + l2 = pmap_alloc_l2(dst_pmap, addr, &dst_l2pg, NULL); + if (l2 == NULL) break; - l2 = (pd_entry_t *) - PHYS_TO_DMAP(VM_PAGE_TO_PHYS(dst_l2pg)); - l2 = &l2[pmap_l2_index(addr)]; if (pmap_load(l2) == 0 && ((srcptepaddr & ATTR_SW_MANAGED) == 0 || pmap_pv_insert_l2(dst_pmap, addr, srcptepaddr, @@ -4046,7 +4084,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ PAGE_SIZE); atomic_add_long(&pmap_l2_mappings, 1); } else - dst_l2pg->ref_count--; + pmap_abort_ptp(dst_pmap, addr, dst_l2pg); continue; } KASSERT((srcptepaddr & ATTR_DESCR_MASK) == L2_TABLE, @@ -4093,21 +4131,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ pmap_store(dst_pte, (ptetemp & ~mask) | nbits); pmap_resident_count_inc(dst_pmap, 1); } else { - SLIST_INIT(&free); - if (pmap_unwire_l3(dst_pmap, addr, dstmpte, - &free)) { - /* - * Although "addr" is not mapped, - * the TLB could nonetheless have - * intermediate entries that refer - * to the freed page table pages. - * Invalidate those entries. - * - * XXX redundant invalidation - */ - pmap_invalidate_page(dst_pmap, addr); - vm_page_free_pages_toq(&free, true); - } + pmap_abort_ptp(dst_pmap, addr, dstmpte); goto out; } /* Have we copied all of the valid mappings? */ From owner-svn-src-head@freebsd.org Wed Dec 18 18:43:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA8741E46C4; Wed, 18 Dec 2019 18:43:44 +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 47dP6S4YTFz4sZC; Wed, 18 Dec 2019 18:43:44 +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 979EF259F; Wed, 18 Dec 2019 18:43:44 +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 xBIIhi8K097427; Wed, 18 Dec 2019 18:43:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBIIhiCO097426; Wed, 18 Dec 2019 18:43:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201912181843.xBIIhiCO097426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 18 Dec 2019 18:43:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355884 - head/sbin/devd X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sbin/devd X-SVN-Commit-Revision: 355884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2019 18:43:44 -0000 Author: mav Date: Wed Dec 18 18:43:44 2019 New Revision: 355884 URL: https://svnweb.freebsd.org/changeset/base/355884 Log: Add missing "ereport." prefixes of ZFS events. I was unable to find time when those were working. I think they have been broken for at least 5 years or even longer. Discussed with: avg@ MFC after: 1 month Modified: head/sbin/devd/zfs.conf Modified: head/sbin/devd/zfs.conf ============================================================================== --- head/sbin/devd/zfs.conf Wed Dec 18 18:21:39 2019 (r355883) +++ head/sbin/devd/zfs.conf Wed Dec 18 18:43:44 2019 (r355884) @@ -4,55 +4,55 @@ notify 10 { match "system" "ZFS"; - match "type" "fs.zfs.checksum"; + match "type" "ereport.fs.zfs.checksum"; action "logger -p local7.warn -t ZFS 'checksum mismatch, zpool=$pool path=$vdev_path offset=$zio_offset size=$zio_size'"; }; notify 10 { match "system" "ZFS"; - match "type" "fs.zfs.io"; + match "type" "ereport.fs.zfs.io"; action "logger -p local7.warn -t ZFS 'vdev I/O failure, zpool=$pool path=$vdev_path offset=$zio_offset size=$zio_size error=$zio_err'"; }; notify 10 { match "system" "ZFS"; - match "type" "fs.zfs.data"; + match "type" "ereport.fs.zfs.data"; action "logger -p local7.warn -t ZFS 'pool I/O failure, zpool=$pool error=$zio_err'"; }; notify 10 { match "system" "ZFS"; - match "type" "fs.zfs.zpool"; + match "type" "ereport.fs.zfs.zpool"; action "logger -p local7.err -t ZFS 'failed to load zpool $pool'"; }; notify 10 { match "system" "ZFS"; - match "type" "fs.zfs.vdev\..*"; + match "type" "ereport.fs.zfs.vdev\..*"; action "logger -p local7.err -t ZFS 'vdev problem, zpool=$pool path=$vdev_path type=$type'"; }; notify 10 { match "system" "ZFS"; - match "type" "fs.zfs.io_failure"; + match "type" "ereport.fs.zfs.io_failure"; action "logger -p local7.alert -t ZFS 'catastrophic pool I/O failure, zpool=$pool'"; }; notify 10 { match "system" "ZFS"; - match "type" "fs.zfs.probe_failure"; + match "type" "ereport.fs.zfs.probe_failure"; action "logger -p local7.err -t ZFS 'vdev probe failure, zpool=$pool path=$vdev_path'"; }; notify 10 { match "system" "ZFS"; - match "type" "fs.zfs.log_replay"; + match "type" "ereport.fs.zfs.log_replay"; action "logger -p local7.err -t ZFS 'pool log replay failure, zpool=$pool'"; }; notify 10 { match "system" "ZFS"; - match "type" "fs.zfs.config_cache_write"; + match "type" "ereport.fs.zfs.config_cache_write"; action "logger -p local7.warn -t ZFS 'failed to write zpool.cache, zpool=$pool'"; }; From owner-svn-src-head@freebsd.org Wed Dec 18 18:44:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5DF481E4737; Wed, 18 Dec 2019 18:44:17 +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 47dP751qY2z4shg; Wed, 18 Dec 2019 18:44:17 +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 39DC125A0; Wed, 18 Dec 2019 18:44:17 +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 xBIIiHKI097526; Wed, 18 Dec 2019 18:44:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBIIiHiw097524; Wed, 18 Dec 2019 18:44:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201912181844.xBIIiHiw097524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 18 Dec 2019 18:44:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355885 - head/sys/dev/oce X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/oce X-SVN-Commit-Revision: 355885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2019 18:44:17 -0000 Author: markj Date: Wed Dec 18 18:44:16 2019 New Revision: 355885 URL: https://svnweb.freebsd.org/changeset/base/355885 Log: oce: Tighten input validation in the SIOCGI2C handler. Missing validation meant that it was possible to read 8 bytes beyond the end of sfp_vpd_dump_buffer. Reported by: Ilja Van Sprundel Reviewed by: delphij, ram MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22859 Modified: head/sys/dev/oce/oce_if.c Modified: head/sys/dev/oce/oce_if.c ============================================================================== --- head/sys/dev/oce/oce_if.c Wed Dec 18 18:43:44 2019 (r355884) +++ head/sys/dev/oce/oce_if.c Wed Dec 18 18:44:16 2019 (r355885) @@ -593,27 +593,26 @@ oce_ioctl(struct ifnet *ifp, u_long command, caddr_t d if (rc) break; - if (i2c.dev_addr != PAGE_NUM_A0 && - i2c.dev_addr != PAGE_NUM_A2) { + if (i2c.dev_addr == PAGE_NUM_A0) { + offset = i2c.offset; + } else if (i2c.dev_addr == PAGE_NUM_A2) { + offset = TRANSCEIVER_A0_SIZE + i2c.offset; + } else { rc = EINVAL; break; } - if (i2c.len > sizeof(i2c.data)) { + if (i2c.len > sizeof(i2c.data) || + i2c.len + offset > sizeof(sfp_vpd_dump_buffer)) { rc = EINVAL; break; } rc = oce_mbox_read_transrecv_data(sc, i2c.dev_addr); - if(rc) { + if (rc) { rc = -rc; break; } - - if (i2c.dev_addr == PAGE_NUM_A0) - offset = i2c.offset; - else - offset = TRANSCEIVER_A0_SIZE + i2c.offset; memcpy(&i2c.data[0], &sfp_vpd_dump_buffer[offset], i2c.len); From owner-svn-src-head@freebsd.org Wed Dec 18 19:10:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BAEFC1E4C24; Wed, 18 Dec 2019 19:10:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47dPjL4ZSKz4tkr; Wed, 18 Dec 2019 19:10:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 939C22925; Wed, 18 Dec 2019 19:10:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBIJAUC3010135; Wed, 18 Dec 2019 19:10:30 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBIJAUGt010134; Wed, 18 Dec 2019 19:10:30 GMT (envelope-from np@FreeBSD.org) Message-Id: <201912181910.xBIJAUGt010134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 18 Dec 2019 19:10:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355886 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 355886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2019 19:10:30 -0000 Author: np Date: Wed Dec 18 19:10:30 2019 New Revision: 355886 URL: https://svnweb.freebsd.org/changeset/base/355886 Log: cxgbe(4): check if the firmware supports FW_RI_FR_NSMR_TPTE_WR work request. This is used by iw_cxgbe to figure out how best to register memory. MFC after: 1 month Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Dec 18 18:44:16 2019 (r355885) +++ head/sys/dev/cxgbe/t4_main.c Wed Dec 18 19:10:30 2019 (r355886) @@ -4379,6 +4379,14 @@ get_params__post_init(struct adapter *sc) else sc->params.ulptx_memwrite_dsgl = false; + /* FW_RI_FR_NSMR_TPTE_WR support */ + param[0] = FW_PARAM_DEV(RI_FR_NSMR_TPTE_WR); + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 1, param, val); + if (rc == 0) + sc->params.fr_nsmr_tpte_wr_support = val[0] != 0; + else + sc->params.fr_nsmr_tpte_wr_support = false; + /* get capabilites */ bzero(&caps, sizeof(caps)); caps.op_to_write = htobe32(V_FW_CMD_OP(FW_CAPS_CONFIG_CMD) | From owner-svn-src-head@freebsd.org Wed Dec 18 21:41:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F403A1E6E6A; Wed, 18 Dec 2019 21:41:53 +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 47dT416FtDz3JB5; Wed, 18 Dec 2019 21:41:53 +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 D1F9347E0; Wed, 18 Dec 2019 21:41:53 +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 xBILfrDx003899; Wed, 18 Dec 2019 21:41:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBILfr8u003898; Wed, 18 Dec 2019 21:41:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201912182141.xBILfr8u003898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 18 Dec 2019 21:41:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355887 - head/sys/dev/vnic X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/vnic X-SVN-Commit-Revision: 355887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2019 21:41:54 -0000 Author: markj Date: Wed Dec 18 21:41:53 2019 New Revision: 355887 URL: https://svnweb.freebsd.org/changeset/base/355887 Log: vnic: Relax PHY node matching after r336281. The phy name may apparently be followed by a number in some systems. Allow that. PR: 242654 Reported and tested by: Marcel MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vnic/thunder_bgx_fdt.c Modified: head/sys/dev/vnic/thunder_bgx_fdt.c ============================================================================== --- head/sys/dev/vnic/thunder_bgx_fdt.c Wed Dec 18 19:10:30 2019 (r355886) +++ head/sys/dev/vnic/thunder_bgx_fdt.c Wed Dec 18 21:41:53 2019 (r355887) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -151,6 +152,7 @@ bgx_fdt_phy_name_match(struct bgx *bgx, char *phy_name { const char *type; ssize_t sz; + char last; switch (bgx->qlm_mode) { case QLM_MODE_SGMII: @@ -193,10 +195,11 @@ bgx_fdt_phy_name_match(struct bgx *bgx, char *phy_name if (sz > size) return (FALSE); - if (strncmp(phy_name, type, sz - 1) == 0 && - (phy_name[sz - 1] == '\0' || phy_name[sz - 1] == '@')) - return (TRUE); - + if (strncmp(phy_name, type, sz - 1) == 0) { + last = phy_name[sz - 1]; + if (last == '\0' || last == '@' || isdigit(last)) + return (TRUE); + } return (FALSE); } From owner-svn-src-head@freebsd.org Wed Dec 18 22:10:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E55651E7BB0; Wed, 18 Dec 2019 22:10:56 +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 47dTjX5n3Tz3L7s; Wed, 18 Dec 2019 22:10:56 +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 C17984C13; Wed, 18 Dec 2019 22:10:56 +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 xBIMAumg021495; Wed, 18 Dec 2019 22:10:56 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBIMAuZb021493; Wed, 18 Dec 2019 22:10:56 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201912182210.xBIMAuZb021493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 18 Dec 2019 22:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355888 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 355888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2019 22:10:57 -0000 Author: melifaro Date: Wed Dec 18 22:10:56 2019 New Revision: 355888 URL: https://svnweb.freebsd.org/changeset/base/355888 Log: Remove useless code from in6_rmx.c The code in questions walks IPv6 tree every 60 seconds and looks into the routes with non-zero expiration time (typically, redirected routes). For each such route it sets RTF_PROBEMTU flag at the expiration time. No other part of the kernel checks for RTF_PROBEMTU flag. RTF_PROBEMTU was defined 21 years ago, 30 Jun 1999, as RTF_PROTO1. RTF_PROTO1 is a de-facto standard indication of a route installed by a routing daemon for a last decade. Reviewed by: bz, ae MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D22865 Modified: head/sys/netinet/icmp6.h head/sys/netinet6/in6_rmx.c Modified: head/sys/netinet/icmp6.h ============================================================================== --- head/sys/netinet/icmp6.h Wed Dec 18 21:41:53 2019 (r355887) +++ head/sys/netinet/icmp6.h Wed Dec 18 22:10:56 2019 (r355888) @@ -687,8 +687,6 @@ void kmod_icmp6stat_inc(int statnum); #define ICMPV6CTL_NODEINFO_OLDMCPREFIX 25 #define ICMPV6CTL_MAXID 26 -#define RTF_PROBEMTU RTF_PROTO1 - #ifdef _KERNEL # ifdef __STDC__ struct rtentry; Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Wed Dec 18 21:41:53 2019 (r355887) +++ head/sys/netinet6/in6_rmx.c Wed Dec 18 22:10:56 2019 (r355888) @@ -153,64 +153,8 @@ in6_addroute(void *v_arg, void *n_arg, struct radix_he } /* - * Age old PMTUs. - */ -struct mtuex_arg { - struct rib_head *rnh; - time_t nextstop; -}; -VNET_DEFINE_STATIC(struct callout, rtq_mtutimer); -#define V_rtq_mtutimer VNET(rtq_mtutimer) - -static int -in6_mtuexpire(struct rtentry *rt, void *rock) -{ - struct mtuex_arg *ap = rock; - - if (rt->rt_expire && !(rt->rt_flags & RTF_PROBEMTU)) { - if (rt->rt_expire <= time_uptime) { - rt->rt_flags |= RTF_PROBEMTU; - } else { - ap->nextstop = lmin(ap->nextstop, rt->rt_expire); - } - } - - return (0); -} - -#define MTUTIMO_DEFAULT (60*1) - -static void -in6_mtutimo_setwa(struct rib_head *rnh, uint32_t fibum, int af, - void *_arg) -{ - struct mtuex_arg *arg; - - arg = (struct mtuex_arg *)_arg; - - arg->rnh = rnh; -} - -static void -in6_mtutimo(void *rock) -{ - CURVNET_SET_QUIET((struct vnet *) rock); - struct timeval atv; - struct mtuex_arg arg; - - rt_foreach_fib_walk(AF_INET6, in6_mtutimo_setwa, in6_mtuexpire, &arg); - - atv.tv_sec = MTUTIMO_DEFAULT; - atv.tv_usec = 0; - callout_reset(&V_rtq_mtutimer, tvtohz(&atv), in6_mtutimo, rock); - CURVNET_RESTORE(); -} - -/* * Initialize our routing tree. */ -VNET_DEFINE_STATIC(int, _in6_rt_was_here); -#define V__in6_rt_was_here VNET(_in6_rt_was_here) int in6_inithead(void **head, int off) @@ -224,12 +168,6 @@ in6_inithead(void **head, int off) rh->rnh_addaddr = in6_addroute; *head = (void *)rh; - if (V__in6_rt_was_here == 0) { - callout_init(&V_rtq_mtutimer, 1); - in6_mtutimo(curvnet); /* kick off timeout first time */ - V__in6_rt_was_here = 1; - } - return (1); } @@ -238,7 +176,6 @@ int in6_detachhead(void **head, int off) { - callout_drain(&V_rtq_mtutimer); rt_table_destroy((struct rib_head *)(*head)); return (1); From owner-svn-src-head@freebsd.org Wed Dec 18 23:00:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE7381C8779; Wed, 18 Dec 2019 23:00:56 +0000 (UTC) (envelope-from mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47dVqD4lLSz3N5X; Wed, 18 Dec 2019 23:00:56 +0000 (UTC) (envelope-from mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E25955E1; Wed, 18 Dec 2019 23:00:56 +0000 (UTC) (envelope-from mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBIN0uvR048893; Wed, 18 Dec 2019 23:00:56 GMT (envelope-from mp@FreeBSD.org) Received: (from mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBIN0uXb048892; Wed, 18 Dec 2019 23:00:56 GMT (envelope-from mp@FreeBSD.org) Message-Id: <201912182300.xBIN0uXb048892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mp set sender to mp@FreeBSD.org using -f From: Mark Peek Date: Wed, 18 Dec 2019 23:00:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355889 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: mp X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 355889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2019 23:00:56 -0000 Author: mp Date: Wed Dec 18 23:00:56 2019 New Revision: 355889 URL: https://svnweb.freebsd.org/changeset/base/355889 Log: Remove VMware MSI-X from the PCI blacklist. First reported against ESXi 5.0, PCI passthrough was not working due to MSI-X issues. However, this issue was fixed via patch releases against ESXi 5.5 and 6.0 in 2016. Given ESXi 5.5 and earlier have been EOL, this patch removes the VMware MSI-X blacklist entries in the quirk table. PR: 203874 Reviewed by: imp, jhb MFC after: 1 month Sponsored by: VMware Differential Revision: https://reviews.freebsd.org/D22819 Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed Dec 18 22:10:56 2019 (r355888) +++ head/sys/dev/pci/pci.c Wed Dec 18 23:00:56 2019 (r355889) @@ -275,13 +275,6 @@ static const struct pci_quirk pci_quirks[] = { { 0x74501022, PCI_QUIRK_DISABLE_MSI, 0, 0 }, /* - * MSI-X allocation doesn't work properly for devices passed through - * by VMware up to at least ESXi 5.1. - */ - { 0x079015ad, PCI_QUIRK_DISABLE_MSIX, 0, 0 }, /* PCI/PCI-X */ - { 0x07a015ad, PCI_QUIRK_DISABLE_MSIX, 0, 0 }, /* PCIe */ - - /* * Some virtualization environments emulate an older chipset * but support MSI just fine. QEMU uses the Intel 82440. */ From owner-svn-src-head@freebsd.org Thu Dec 19 02:40:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E84041D1AB2; Thu, 19 Dec 2019 02:40:05 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47dbh55ssPz47Wd; Thu, 19 Dec 2019 02:40:05 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4B4E7E0A; Thu, 19 Dec 2019 02:40:05 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBJ2e5Dp079038; Thu, 19 Dec 2019 02:40:05 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBJ2e5PD079036; Thu, 19 Dec 2019 02:40:05 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201912190240.xBJ2e5PD079036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Thu, 19 Dec 2019 02:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355904 - in head: lib/libmagic lib/libpmc share/mk X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head: lib/libmagic lib/libpmc share/mk X-SVN-Commit-Revision: 355904 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2019 02:40:06 -0000 Author: sjg Date: Thu Dec 19 02:40:04 2019 New Revision: 355904 URL: https://svnweb.freebsd.org/changeset/base/355904 Log: Tweaks for DIRDEPS_BUILD libmagic only depend on mkmagic if not DIRDEPS_BUILD libpmc fix -I for libpmcstat local.dirdeps.mk be even more careful about adding gnu/lib/csu to DIRDEPS Reviewed by: bdrewery Differential Revision: https://reviews.freebsd.org/D22872 Modified: head/lib/libmagic/Makefile head/lib/libpmc/Makefile head/share/mk/local.dirdeps.mk Modified: head/lib/libmagic/Makefile ============================================================================== --- head/lib/libmagic/Makefile Thu Dec 19 02:32:37 2019 (r355903) +++ head/lib/libmagic/Makefile Thu Dec 19 02:40:04 2019 (r355904) @@ -37,7 +37,7 @@ MAGFILES= ${CONTRDIR}/magic/Header \ magic: ${MAGFILES} cat ${.ALLSRC:O} > ${.TARGET} -magic.mgc: mkmagic magic +magic.mgc: magic ${BTOOLSPATH:U.}/mkmagic magic .if ${MACHINE} == "host" || ${MK_DIRDEPS_BUILD} == "no" @@ -51,6 +51,8 @@ mkmagic: apprentice.c cdf_time.c encoding.c funcs.c ma .endif .if ${MK_DIRDEPS_BUILD} == "yes" BTOOLSPATH= ${HOST_OBJTOP}/${RELDIR} +.else +magic.mgc: mkmagic .endif FILEVER!= awk '$$1 == "\#define" && $$2 == "VERSION" { print $$3; exit }' \ Modified: head/lib/libpmc/Makefile ============================================================================== --- head/lib/libpmc/Makefile Thu Dec 19 02:32:37 2019 (r355903) +++ head/lib/libpmc/Makefile Thu Dec 19 02:40:04 2019 (r355904) @@ -20,7 +20,7 @@ EVENT_ARCH="powerpc" .if ${MK_DIRDEPS_BUILD} == "yes" # avoid circular dependency -CFLAGS+= -I${RELDIR:H}/libpmcstat +CFLAGS+= -I${SRCTOP}/${RELDIR:H}/libpmcstat GENDIRDEPS_FILTER+= N${RELDIR:H}/libpmcstat JEVENTS?= ${HOST_OBJTOP}/${RELDIR}/pmu-events/jevents .else Modified: head/share/mk/local.dirdeps.mk ============================================================================== --- head/share/mk/local.dirdeps.mk Thu Dec 19 02:32:37 2019 (r355903) +++ head/share/mk/local.dirdeps.mk Thu Dec 19 02:40:04 2019 (r355904) @@ -222,7 +222,7 @@ DIRDEPS += targets/pseudo/stage .endif # this one is too pervasive -.if ${MK_BSD_CRTBEGIN} == "no" && ${DEP_RELDIR} != "gnu/lib/csu" +.if ${MK_BSD_CRTBEGIN} == "no" && ${DEP_RELDIR:N.:Ngnu/lib/csu:Ninclude*:Ntargets/*} != "" DIRDEPS+= gnu/lib/csu .endif From owner-svn-src-head@freebsd.org Thu Dec 19 03:54:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5AA071D3962; Thu, 19 Dec 2019 03:54:41 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (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 47ddL75Tsrz4CNw; Thu, 19 Dec 2019 03:54:39 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id hmtWi59hsRnrKhmtXisJIZ; Wed, 18 Dec 2019 20:54:37 -0700 X-Authority-Analysis: v=2.3 cv=L7FjvNb8 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=IkcTkHD0fZMA:10 a=pxVhFHJ0LMsA:10 a=vaJtXVxTAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=-lIj-iCUnQlwtHlztJ0A:9 a=QEXdDO2ut3YA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=Z5ABNNGmrOfJ6cZ5bIyy:22 a=bWyr8ysk75zN3GCy5bjg:22 Received: from [192.168.1.105] (S0106002401cb186f.gv.shawcable.net [70.67.125.17]) by spqr.komquats.com (Postfix) with ESMTPSA id 10B9B1200; Wed, 18 Dec 2019 19:54:34 -0800 (PST) Date: Wed, 18 Dec 2019 07:09:45 -0800 User-Agent: K-9 Mail for Android In-Reply-To: References: <201901312301.x0VN13lM097213@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: svn commit: r343631 - in head: . sbin sbin/pfilctl share/man/man9 sys/contrib/ipfilter/netinet sys/net sys/netinet sys/netinet6 sys/netpfil/ipfw sys/netpfil/pf To: "Andrey V. Elsukov" , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Cy Schubert Message-ID: X-CMAE-Envelope: MS4wfLcJ2koVMk//iOrcgtELErJUtWPUsS+J+yLbI8+LsR9PjSEkfGAD2R9uq3uAwxVb3I++yBo23XbmZpe88v87pUlxuAH2UEilXy/1KQ/WoO7+pmc0PDhB WIJlgObMVXOMyaiLxueqrmwfakgdO2GCZAcixwXdv8v44qdwGKBVJ08h23PCJVA2NgQJrS11FfWbj/rsOjMIb2k6xvNsLJF8JxGjWe0AtxSHCvNr3SXJ6Hmq Vo5zpsmMif9HSw70yt6IGBvR84tCXrmQhhdp51FU2K+08KtCl7QIgw67nwylXRTMwqfUoRS6VKBK3oSG5eDM7w== X-Rspamd-Queue-Id: 47ddL75Tsrz4CNw 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.136.138) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-4.53 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[]; FREEMAIL_TO(0.00)[yandex.ru]; RCVD_IN_DNSWL_LOW(-0.10)[138.136.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]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-2.33)[ip: (-6.07), ipnet: 64.59.128.0/20(-3.09), asn: 6327(-2.40), country: CA(-0.09)]; FROM_EQ_ENVFROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2019 03:54:41 -0000 On December 18, 2019 4:27:58 AM PST, "Andrey V=2E Elsukov" wrote: >On 01=2E02=2E2019 02:01, Gleb Smirnoff wrote: >> Author: glebius >> Date: Thu Jan 31 23:01:03 2019 >> New Revision: 343631 >> URL: https://svnweb=2Efreebsd=2Eorg/changeset/base/343631 >>=20 >> Log: >> New pfil(9) KPI together with newborn pfil API and control utility=2E >> =20 >> The KPI have been reviewed and cleansed of features that were >planned >> back 20 years ago and never implemented=2E The pfil(9) internals >have >> been made opaque to protocols with only returned types and function >> declarations exposed=2E The KPI is made more strict, but at the same >time >> more extensible, as kernel uses same command structures that >userland >> ioctl uses=2E >> =20 >> In nutshell [KA]PI is about declaring filtering points, declaring >> filters and linking and unlinking them together=2E >> =20 >> New [KA]PI makes it possible to reconfigure pfil(9) configuration: >> change order of hooks, rehook filter from one filtering point to a >> different one, disconnect a hook on output leaving it on input >only, >> prepend/append a filter to existing list of filters=2E >> =20 >> Now it possible for a single packet filter to provide multiple >rulesets >> that may be linked to different points=2E Think of per-interface ACLs >in >> Cisco or Juniper=2E None of existing packet filters yet support that, >> however limited usage is already possible, e=2Eg=2E default ruleset c= an >> be moved to single interface, as soon as interface would pride >their >> filtering points=2E >> =20 >> Another future feature is possiblity to create pfil heads, that >provide >> not an mbuf pointer but just a memory pointer with length=2E That >would >> allow filtering at very early stages of a packet lifecycle, e=2Eg=2E >when >> packet has just been received by a NIC and no mbuf was yet >allocated=2E >It seems that this commit has changed the error code returned from >ip[6]_output() when a packet is blocked=2E Previously it was EACCES, but >now it became EPERM=2E Was it intentional? EPERM, operation not permitted regardless of privilege, is more appropriat= e=2E=20 --=20 Pardon the typos and autocorrect, small keyboard in use=2E=20 Cy Schubert FreeBSD UNIX: Web: https://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E Sent from my Android device with K-9 Mail=2E Please excuse my brevity=2E From owner-svn-src-head@freebsd.org Thu Dec 19 08:52:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 919CF1D9DF6; Thu, 19 Dec 2019 08:52:17 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47dlxY3JVCz4Qdw; Thu, 19 Dec 2019 08:52:17 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53A6EC382; Thu, 19 Dec 2019 08:52:17 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBJ8qHRA002681; Thu, 19 Dec 2019 08:52:17 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBJ8qGJi002679; Thu, 19 Dec 2019 08:52:16 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201912190852.xBJ8qGJi002679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 19 Dec 2019 08:52:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355907 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 355907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2019 08:52:17 -0000 Author: andrew Date: Thu Dec 19 08:52:16 2019 New Revision: 355907 URL: https://svnweb.freebsd.org/changeset/base/355907 Log: Stop speculation past an eret instruction On arm64 the eret instruction is used to return from an exception handler. Some implementations may speculate past this instruction into the next function. As the user may control many registers in these functions add a synchronisation barrier sequence after the eret instruction to stop these CPUs from speculating out of the exception handler. PR: 242676 Submitted by: Anthony Steinhauser (previous version) MFC after: 1 week Modified: head/sys/arm64/arm64/exception.S head/sys/arm64/arm64/swtch.S head/sys/arm64/include/asm.h Modified: head/sys/arm64/arm64/exception.S ============================================================================== --- head/sys/arm64/arm64/exception.S Thu Dec 19 04:58:11 2019 (r355906) +++ head/sys/arm64/arm64/exception.S Thu Dec 19 08:52:16 2019 (r355907) @@ -175,7 +175,7 @@ ENTRY(handle_el1h_sync) mov x1, sp bl do_el1h_sync restore_registers 1 - eret + ERET END(handle_el1h_sync) ENTRY(handle_el1h_irq) @@ -183,7 +183,7 @@ ENTRY(handle_el1h_irq) mov x0, sp bl intr_irq_handler restore_registers 1 - eret + ERET END(handle_el1h_irq) ENTRY(handle_el0_sync) @@ -194,7 +194,7 @@ ENTRY(handle_el0_sync) bl do_el0_sync do_ast restore_registers 0 - eret + ERET END(handle_el0_sync) ENTRY(handle_el0_irq) @@ -203,7 +203,7 @@ ENTRY(handle_el0_irq) bl intr_irq_handler do_ast restore_registers 0 - eret + ERET END(handle_el0_irq) ENTRY(handle_serror) Modified: head/sys/arm64/arm64/swtch.S ============================================================================== --- head/sys/arm64/arm64/swtch.S Thu Dec 19 04:58:11 2019 (r355906) +++ head/sys/arm64/arm64/swtch.S Thu Dec 19 08:52:16 2019 (r355907) @@ -253,7 +253,7 @@ ENTRY(fork_trampoline) * No need for interrupts reenabling since PSR * will be set to the desired value anyway. */ - eret + ERET END(fork_trampoline) Modified: head/sys/arm64/include/asm.h ============================================================================== --- head/sys/arm64/include/asm.h Thu Dec 19 04:58:11 2019 (r355906) +++ head/sys/arm64/include/asm.h Thu Dec 19 08:52:16 2019 (r355907) @@ -90,4 +90,16 @@ .inst 0xd500409f | (1 << 8); /* Set PAN */ \ 999: +/* + * Some AArch64 CPUs speculate past an eret instruction. As the user may + * control the registers at this point add a speculation barrier usable on + * all AArch64 CPUs after the eret instruction. + * TODO: ARMv8.5 adds a specific instruction for this, we could use that + * if we know we are running on something that supports it. + */ +#define ERET \ + eret; \ + dsb sy; \ + isb + #endif /* _MACHINE_ASM_H_ */ From owner-svn-src-head@freebsd.org Thu Dec 19 09:19:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C80F41DAA4C; Thu, 19 Dec 2019 09:19:28 +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 47dmXw4tR4z4RrG; Thu, 19 Dec 2019 09:19:28 +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 A2D23C848; Thu, 19 Dec 2019 09:19:28 +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 xBJ9JS4S014839; Thu, 19 Dec 2019 09:19:28 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBJ9JSXS014836; Thu, 19 Dec 2019 09:19:28 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201912190919.xBJ9JSXS014836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Thu, 19 Dec 2019 09:19:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355908 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 355908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2019 09:19:28 -0000 Author: melifaro Date: Thu Dec 19 09:19:27 2019 New Revision: 355908 URL: https://svnweb.freebsd.org/changeset/base/355908 Log: svn-commit.tmp Modified: head/sys/netpfil/ipfw/ip_fw_table.c head/sys/netpfil/ipfw/ip_fw_table.h head/sys/netpfil/ipfw/ip_fw_table_value.c Modified: head/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table.c Thu Dec 19 08:52:16 2019 (r355907) +++ head/sys/netpfil/ipfw/ip_fw_table.c Thu Dec 19 09:19:27 2019 (r355908) @@ -623,7 +623,7 @@ restart: * * May release/reacquire UH_WLOCK. */ - error = ipfw_link_table_values(ch, &ts); + error = ipfw_link_table_values(ch, &ts, flags); if (error != 0) goto cleanup; if (ts.modified != 0) @@ -654,6 +654,14 @@ restart: num = 0; /* check limit before adding */ if ((error = check_table_limit(tc, ptei)) == 0) { + /* + * It should be safe to insert a record w/o + * a properly-linked value if atomicity is + * not required. + * + * If the added item does not have a valid value + * index, it would get rejected by ta->add(). + * */ error = ta->add(tc->astate, KIDX_TO_TI(ch, kidx), ptei, v, &num); /* Set status flag to inform userland */ Modified: head/sys/netpfil/ipfw/ip_fw_table.h ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table.h Thu Dec 19 08:52:16 2019 (r355907) +++ head/sys/netpfil/ipfw/ip_fw_table.h Thu Dec 19 09:19:27 2019 (r355908) @@ -168,7 +168,8 @@ struct table_config; struct tableop_state; void ipfw_table_value_init(struct ip_fw_chain *ch, int first); void ipfw_table_value_destroy(struct ip_fw_chain *ch, int last); -int ipfw_link_table_values(struct ip_fw_chain *ch, struct tableop_state *ts); +int ipfw_link_table_values(struct ip_fw_chain *ch, struct tableop_state *ts, + uint8_t flags); void ipfw_garbage_table_values(struct ip_fw_chain *ch, struct table_config *tc, struct tentry_info *tei, uint32_t count, int rollback); void ipfw_import_table_value_v1(ipfw_table_value *iv); Modified: head/sys/netpfil/ipfw/ip_fw_table_value.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table_value.c Thu Dec 19 08:52:16 2019 (r355907) +++ head/sys/netpfil/ipfw/ip_fw_table_value.c Thu Dec 19 09:19:27 2019 (r355908) @@ -363,7 +363,7 @@ rollback_table_values(struct tableop_state *ts) */ static int alloc_table_vidx(struct ip_fw_chain *ch, struct tableop_state *ts, - struct namedobj_instance *vi, uint16_t *pvidx) + struct namedobj_instance *vi, uint16_t *pvidx, uint8_t flags) { int error, vlimit; uint16_t vidx; @@ -384,16 +384,13 @@ alloc_table_vidx(struct ip_fw_chain *ch, struct tableo } vlimit = ts->ta->vlimit; - if (vlimit != 0 && vidx >= vlimit) { + if (vlimit != 0 && vidx >= vlimit && !(flags & IPFW_CTF_ATOMIC)) { /* * Algorithm is not able to store given index. * We have to rollback state, start using * per-table value array or return error * if we're already using it. - * - * TODO: do not rollback state if - * atomicity is not required. */ if (ts->vshared != 0) { /* shared -> per-table */ @@ -426,9 +423,10 @@ ipfw_garbage_table_values(struct ip_fw_chain *ch, stru * either (1) we are successful / partially successful, * in that case we need * * to ignore ADDED entries values - * * rollback every other values (either UPDATED since - * old value has been stored there, or some failure like - * EXISTS or LIMIT or simply "ignored" case. + * * rollback every other values if atomicity is not + * * required (either UPDATED since old value has been + * stored there, or some failure like EXISTS or LIMIT + * or simply "ignored" case. * * (2): atomic rollback of partially successful operation * in that case we simply need to unref all entries. @@ -473,7 +471,8 @@ ipfw_garbage_table_values(struct ip_fw_chain *ch, stru * Success: return 0. */ int -ipfw_link_table_values(struct ip_fw_chain *ch, struct tableop_state *ts) +ipfw_link_table_values(struct ip_fw_chain *ch, struct tableop_state *ts, + uint8_t flags) { int error, i, found; struct namedobj_instance *vi; @@ -577,7 +576,7 @@ ipfw_link_table_values(struct ip_fw_chain *ch, struct } /* May perform UH unlock/lock */ - error = alloc_table_vidx(ch, ts, vi, &vidx); + error = alloc_table_vidx(ch, ts, vi, &vidx, flags); if (error != 0) { ts->opstate.func(ts->tc, &ts->opstate); return (error); From owner-svn-src-head@freebsd.org Thu Dec 19 09:27:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 928F31DACFC; Thu, 19 Dec 2019 09:27:04 +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 47dmjf5fD1z4SGD; Thu, 19 Dec 2019 09:27:02 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from mxback2q.mail.yandex.net (mxback2q.mail.yandex.net [IPv6:2a02:6b8:c0e:40:0:640:9c8c:4946]) by forward501j.mail.yandex.net (Yandex) with ESMTP id C4EB93380712; Thu, 19 Dec 2019 12:26:58 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback2q.mail.yandex.net (mxback/Yandex) with ESMTP id 1nH4cb4Scw-QvdG49O2; Thu, 19 Dec 2019 12:26:57 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1576747617; bh=05wo2e8Qlfl1UNMLqfNdqzJr16FoqGTi2SVEnfM5zVA=; h=References:Date:Message-Id:Subject:In-Reply-To:To:From; b=puy0F2KYOB32FGinKsihTKdndaynm1owSDwmTU/VzpcA0DttpWlZNpQVm6NSe6Sap AWswWbRoIp2BlTYFPIk5CgeQeJuM1zOogW/1Hy496Ain9gGK8yV5ZY64gKwCdifGhU LnAO1dY4oNQZMi0zIQ77Oev1rMiU0qW5M27GYvi0= Received: by vla3-985002032993.qloud-c.yandex.net with HTTP; Thu, 19 Dec 2019 12:26:57 +0300 From: Alexander V. Chernikov To: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: <201912190919.xBJ9JSXS014836@repo.freebsd.org> References: <201912190919.xBJ9JSXS014836@repo.freebsd.org> Subject: Re: svn commit: r355908 - head/sys/netpfil/ipfw MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Thu, 19 Dec 2019 09:26:57 +0000 Message-Id: <38008821576747617@vla3-985002032993.qloud-c.yandex.net> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 X-Rspamd-Queue-Id: 47dmjf5fD1z4SGD X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ipfw.ru header.s=mail header.b=puy0F2KY; dmarc=none; spf=pass (mx1.freebsd.org: domain of melifaro@ipfw.ru designates 5.45.198.251 as permitted sender) smtp.mailfrom=melifaro@ipfw.ru X-Spamd-Result: default: False [-4.32 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[ipfw.ru:s=mail]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:5.45.192.0/19]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[ipfw.ru]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-1.72)[ipnet: 5.45.192.0/18(-4.82), asn: 13238(-3.79), country: RU(0.01)]; DKIM_TRACE(0.00)[ipfw.ru:+]; TO_DN_EQ_ADDR_ALL(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[251.198.45.5.list.dnswl.org : 127.0.5.1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13238, ipnet:5.45.192.0/18, country:RU]; RCVD_TLS_LAST(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2019 09:27:04 -0000 19.12.2019, 09:19, "Alexander V. Chernikov" : > Author: melifaro > Date: Thu Dec 19 09:19:27 2019 > New Revision: 355908 > URL: https://svnweb.freebsd.org/changeset/base/355908 > > Log: >   svn-commit.tmp Should have been ipfw: Don't rollback state in alloc_table_vidx() if atomicity is not required. Submitted by: Neel Chauhan MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D22662 > > Modified: >   head/sys/netpfil/ipfw/ip_fw_table.c >   head/sys/netpfil/ipfw/ip_fw_table.h >   head/sys/netpfil/ipfw/ip_fw_table_value.c > > Modified: head/sys/netpfil/ipfw/ip_fw_table.c > ============================================================================== > --- head/sys/netpfil/ipfw/ip_fw_table.c Thu Dec 19 08:52:16 2019 (r355907) > +++ head/sys/netpfil/ipfw/ip_fw_table.c Thu Dec 19 09:19:27 2019 (r355908) > @@ -623,7 +623,7 @@ restart: >           * >           * May release/reacquire UH_WLOCK. >           */ > - error = ipfw_link_table_values(ch, &ts); > + error = ipfw_link_table_values(ch, &ts, flags); >          if (error != 0) >                  goto cleanup; >          if (ts.modified != 0) > @@ -654,6 +654,14 @@ restart: >                  num = 0; >                  /* check limit before adding */ >                  if ((error = check_table_limit(tc, ptei)) == 0) { > + /* > + * It should be safe to insert a record w/o > + * a properly-linked value if atomicity is > + * not required. > + * > + * If the added item does not have a valid value > + * index, it would get rejected by ta->add(). > + * */ >                          error = ta->add(tc->astate, KIDX_TO_TI(ch, kidx), >                              ptei, v, &num); >                          /* Set status flag to inform userland */ > > Modified: head/sys/netpfil/ipfw/ip_fw_table.h > ============================================================================== > --- head/sys/netpfil/ipfw/ip_fw_table.h Thu Dec 19 08:52:16 2019 (r355907) > +++ head/sys/netpfil/ipfw/ip_fw_table.h Thu Dec 19 09:19:27 2019 (r355908) > @@ -168,7 +168,8 @@ struct table_config; >  struct tableop_state; >  void ipfw_table_value_init(struct ip_fw_chain *ch, int first); >  void ipfw_table_value_destroy(struct ip_fw_chain *ch, int last); > -int ipfw_link_table_values(struct ip_fw_chain *ch, struct tableop_state *ts); > +int ipfw_link_table_values(struct ip_fw_chain *ch, struct tableop_state *ts, > + uint8_t flags); >  void ipfw_garbage_table_values(struct ip_fw_chain *ch, struct table_config *tc, >      struct tentry_info *tei, uint32_t count, int rollback); >  void ipfw_import_table_value_v1(ipfw_table_value *iv); > > Modified: head/sys/netpfil/ipfw/ip_fw_table_value.c > ============================================================================== > --- head/sys/netpfil/ipfw/ip_fw_table_value.c Thu Dec 19 08:52:16 2019 (r355907) > +++ head/sys/netpfil/ipfw/ip_fw_table_value.c Thu Dec 19 09:19:27 2019 (r355908) > @@ -363,7 +363,7 @@ rollback_table_values(struct tableop_state *ts) >   */ >  static int >  alloc_table_vidx(struct ip_fw_chain *ch, struct tableop_state *ts, > - struct namedobj_instance *vi, uint16_t *pvidx) > + struct namedobj_instance *vi, uint16_t *pvidx, uint8_t flags) >  { >          int error, vlimit; >          uint16_t vidx; > @@ -384,16 +384,13 @@ alloc_table_vidx(struct ip_fw_chain *ch, struct tableo >          } > >          vlimit = ts->ta->vlimit; > - if (vlimit != 0 && vidx >= vlimit) { > + if (vlimit != 0 && vidx >= vlimit && !(flags & IPFW_CTF_ATOMIC)) { > >                  /* >                   * Algorithm is not able to store given index. >                   * We have to rollback state, start using >                   * per-table value array or return error >                   * if we're already using it. > - * > - * TODO: do not rollback state if > - * atomicity is not required. >                   */ >                  if (ts->vshared != 0) { >                          /* shared -> per-table */ > @@ -426,9 +423,10 @@ ipfw_garbage_table_values(struct ip_fw_chain *ch, stru >           * either (1) we are successful / partially successful, >           * in that case we need >           * * to ignore ADDED entries values > - * * rollback every other values (either UPDATED since > - * old value has been stored there, or some failure like > - * EXISTS or LIMIT or simply "ignored" case. > + * * rollback every other values if atomicity is not > + * * required (either UPDATED since old value has been > + * stored there, or some failure like EXISTS or LIMIT > + * or simply "ignored" case. >           * >           * (2): atomic rollback of partially successful operation >           * in that case we simply need to unref all entries. > @@ -473,7 +471,8 @@ ipfw_garbage_table_values(struct ip_fw_chain *ch, stru >   * Success: return 0. >   */ >  int > -ipfw_link_table_values(struct ip_fw_chain *ch, struct tableop_state *ts) > +ipfw_link_table_values(struct ip_fw_chain *ch, struct tableop_state *ts, > + uint8_t flags) >  { >          int error, i, found; >          struct namedobj_instance *vi; > @@ -577,7 +576,7 @@ ipfw_link_table_values(struct ip_fw_chain *ch, struct >                  } > >                  /* May perform UH unlock/lock */ > - error = alloc_table_vidx(ch, ts, vi, &vidx); > + error = alloc_table_vidx(ch, ts, vi, &vidx, flags); >                  if (error != 0) { >                          ts->opstate.func(ts->tc, &ts->opstate); >                          return (error); From owner-svn-src-head@freebsd.org Thu Dec 19 10:20:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 577781DC120; Thu, 19 Dec 2019 10:20:39 +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 47dnvW1XTSz4W2W; Thu, 19 Dec 2019 10:20:39 +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 30200D2E8; Thu, 19 Dec 2019 10:20:39 +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 xBJAKdHJ050899; Thu, 19 Dec 2019 10:20:39 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBJAKcVn050896; Thu, 19 Dec 2019 10:20:38 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201912191020.xBJAKcVn050896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Thu, 19 Dec 2019 10:20:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355909 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 355909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2019 10:20:39 -0000 Author: melifaro Date: Thu Dec 19 10:20:38 2019 New Revision: 355909 URL: https://svnweb.freebsd.org/changeset/base/355909 Log: Revert r355908 to commit it with a proper message. Modified: head/sys/netpfil/ipfw/ip_fw_table.c head/sys/netpfil/ipfw/ip_fw_table.h head/sys/netpfil/ipfw/ip_fw_table_value.c Modified: head/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table.c Thu Dec 19 09:19:27 2019 (r355908) +++ head/sys/netpfil/ipfw/ip_fw_table.c Thu Dec 19 10:20:38 2019 (r355909) @@ -623,7 +623,7 @@ restart: * * May release/reacquire UH_WLOCK. */ - error = ipfw_link_table_values(ch, &ts, flags); + error = ipfw_link_table_values(ch, &ts); if (error != 0) goto cleanup; if (ts.modified != 0) @@ -654,14 +654,6 @@ restart: num = 0; /* check limit before adding */ if ((error = check_table_limit(tc, ptei)) == 0) { - /* - * It should be safe to insert a record w/o - * a properly-linked value if atomicity is - * not required. - * - * If the added item does not have a valid value - * index, it would get rejected by ta->add(). - * */ error = ta->add(tc->astate, KIDX_TO_TI(ch, kidx), ptei, v, &num); /* Set status flag to inform userland */ Modified: head/sys/netpfil/ipfw/ip_fw_table.h ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table.h Thu Dec 19 09:19:27 2019 (r355908) +++ head/sys/netpfil/ipfw/ip_fw_table.h Thu Dec 19 10:20:38 2019 (r355909) @@ -168,8 +168,7 @@ struct table_config; struct tableop_state; void ipfw_table_value_init(struct ip_fw_chain *ch, int first); void ipfw_table_value_destroy(struct ip_fw_chain *ch, int last); -int ipfw_link_table_values(struct ip_fw_chain *ch, struct tableop_state *ts, - uint8_t flags); +int ipfw_link_table_values(struct ip_fw_chain *ch, struct tableop_state *ts); void ipfw_garbage_table_values(struct ip_fw_chain *ch, struct table_config *tc, struct tentry_info *tei, uint32_t count, int rollback); void ipfw_import_table_value_v1(ipfw_table_value *iv); Modified: head/sys/netpfil/ipfw/ip_fw_table_value.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table_value.c Thu Dec 19 09:19:27 2019 (r355908) +++ head/sys/netpfil/ipfw/ip_fw_table_value.c Thu Dec 19 10:20:38 2019 (r355909) @@ -363,7 +363,7 @@ rollback_table_values(struct tableop_state *ts) */ static int alloc_table_vidx(struct ip_fw_chain *ch, struct tableop_state *ts, - struct namedobj_instance *vi, uint16_t *pvidx, uint8_t flags) + struct namedobj_instance *vi, uint16_t *pvidx) { int error, vlimit; uint16_t vidx; @@ -384,13 +384,16 @@ alloc_table_vidx(struct ip_fw_chain *ch, struct tableo } vlimit = ts->ta->vlimit; - if (vlimit != 0 && vidx >= vlimit && !(flags & IPFW_CTF_ATOMIC)) { + if (vlimit != 0 && vidx >= vlimit) { /* * Algorithm is not able to store given index. * We have to rollback state, start using * per-table value array or return error * if we're already using it. + * + * TODO: do not rollback state if + * atomicity is not required. */ if (ts->vshared != 0) { /* shared -> per-table */ @@ -423,10 +426,9 @@ ipfw_garbage_table_values(struct ip_fw_chain *ch, stru * either (1) we are successful / partially successful, * in that case we need * * to ignore ADDED entries values - * * rollback every other values if atomicity is not - * * required (either UPDATED since old value has been - * stored there, or some failure like EXISTS or LIMIT - * or simply "ignored" case. + * * rollback every other values (either UPDATED since + * old value has been stored there, or some failure like + * EXISTS or LIMIT or simply "ignored" case. * * (2): atomic rollback of partially successful operation * in that case we simply need to unref all entries. @@ -471,8 +473,7 @@ ipfw_garbage_table_values(struct ip_fw_chain *ch, stru * Success: return 0. */ int -ipfw_link_table_values(struct ip_fw_chain *ch, struct tableop_state *ts, - uint8_t flags) +ipfw_link_table_values(struct ip_fw_chain *ch, struct tableop_state *ts) { int error, i, found; struct namedobj_instance *vi; @@ -576,7 +577,7 @@ ipfw_link_table_values(struct ip_fw_chain *ch, struct } /* May perform UH unlock/lock */ - error = alloc_table_vidx(ch, ts, vi, &vidx, flags); + error = alloc_table_vidx(ch, ts, vi, &vidx); if (error != 0) { ts->opstate.func(ts->tc, &ts->opstate); return (error); From owner-svn-src-head@freebsd.org Thu Dec 19 10:22:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 396841DC310; Thu, 19 Dec 2019 10:22:17 +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 47dnxP0lxxz4WFW; Thu, 19 Dec 2019 10:22:17 +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 1545AD478; Thu, 19 Dec 2019 10:22:17 +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 xBJAMGFG055642; Thu, 19 Dec 2019 10:22:16 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBJAMGOm055640; Thu, 19 Dec 2019 10:22:16 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201912191022.xBJAMGOm055640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Thu, 19 Dec 2019 10:22:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355910 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 355910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2019 10:22:17 -0000 Author: melifaro Date: Thu Dec 19 10:22:16 2019 New Revision: 355910 URL: https://svnweb.freebsd.org/changeset/base/355910 Log: ipfw: Don't rollback state in alloc_table_vidx() if atomicity is not required. Submitted by: Neel Chauhan MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D22662 Modified: head/sys/netpfil/ipfw/ip_fw_table.c head/sys/netpfil/ipfw/ip_fw_table.h head/sys/netpfil/ipfw/ip_fw_table_value.c Modified: head/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table.c Thu Dec 19 10:20:38 2019 (r355909) +++ head/sys/netpfil/ipfw/ip_fw_table.c Thu Dec 19 10:22:16 2019 (r355910) @@ -623,7 +623,7 @@ restart: * * May release/reacquire UH_WLOCK. */ - error = ipfw_link_table_values(ch, &ts); + error = ipfw_link_table_values(ch, &ts, flags); if (error != 0) goto cleanup; if (ts.modified != 0) @@ -654,6 +654,14 @@ restart: num = 0; /* check limit before adding */ if ((error = check_table_limit(tc, ptei)) == 0) { + /* + * It should be safe to insert a record w/o + * a properly-linked value if atomicity is + * not required. + * + * If the added item does not have a valid value + * index, it would get rejected by ta->add(). + * */ error = ta->add(tc->astate, KIDX_TO_TI(ch, kidx), ptei, v, &num); /* Set status flag to inform userland */ Modified: head/sys/netpfil/ipfw/ip_fw_table.h ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table.h Thu Dec 19 10:20:38 2019 (r355909) +++ head/sys/netpfil/ipfw/ip_fw_table.h Thu Dec 19 10:22:16 2019 (r355910) @@ -168,7 +168,8 @@ struct table_config; struct tableop_state; void ipfw_table_value_init(struct ip_fw_chain *ch, int first); void ipfw_table_value_destroy(struct ip_fw_chain *ch, int last); -int ipfw_link_table_values(struct ip_fw_chain *ch, struct tableop_state *ts); +int ipfw_link_table_values(struct ip_fw_chain *ch, struct tableop_state *ts, + uint8_t flags); void ipfw_garbage_table_values(struct ip_fw_chain *ch, struct table_config *tc, struct tentry_info *tei, uint32_t count, int rollback); void ipfw_import_table_value_v1(ipfw_table_value *iv); Modified: head/sys/netpfil/ipfw/ip_fw_table_value.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_table_value.c Thu Dec 19 10:20:38 2019 (r355909) +++ head/sys/netpfil/ipfw/ip_fw_table_value.c Thu Dec 19 10:22:16 2019 (r355910) @@ -363,7 +363,7 @@ rollback_table_values(struct tableop_state *ts) */ static int alloc_table_vidx(struct ip_fw_chain *ch, struct tableop_state *ts, - struct namedobj_instance *vi, uint16_t *pvidx) + struct namedobj_instance *vi, uint16_t *pvidx, uint8_t flags) { int error, vlimit; uint16_t vidx; @@ -384,16 +384,13 @@ alloc_table_vidx(struct ip_fw_chain *ch, struct tableo } vlimit = ts->ta->vlimit; - if (vlimit != 0 && vidx >= vlimit) { + if (vlimit != 0 && vidx >= vlimit && !(flags & IPFW_CTF_ATOMIC)) { /* * Algorithm is not able to store given index. * We have to rollback state, start using * per-table value array or return error * if we're already using it. - * - * TODO: do not rollback state if - * atomicity is not required. */ if (ts->vshared != 0) { /* shared -> per-table */ @@ -426,9 +423,10 @@ ipfw_garbage_table_values(struct ip_fw_chain *ch, stru * either (1) we are successful / partially successful, * in that case we need * * to ignore ADDED entries values - * * rollback every other values (either UPDATED since - * old value has been stored there, or some failure like - * EXISTS or LIMIT or simply "ignored" case. + * * rollback every other values if atomicity is not + * * required (either UPDATED since old value has been + * stored there, or some failure like EXISTS or LIMIT + * or simply "ignored" case. * * (2): atomic rollback of partially successful operation * in that case we simply need to unref all entries. @@ -473,7 +471,8 @@ ipfw_garbage_table_values(struct ip_fw_chain *ch, stru * Success: return 0. */ int -ipfw_link_table_values(struct ip_fw_chain *ch, struct tableop_state *ts) +ipfw_link_table_values(struct ip_fw_chain *ch, struct tableop_state *ts, + uint8_t flags) { int error, i, found; struct namedobj_instance *vi; @@ -577,7 +576,7 @@ ipfw_link_table_values(struct ip_fw_chain *ch, struct } /* May perform UH unlock/lock */ - error = alloc_table_vidx(ch, ts, vi, &vidx); + error = alloc_table_vidx(ch, ts, vi, &vidx, flags); if (error != 0) { ts->opstate.func(ts->tc, &ts->opstate); return (error); From owner-svn-src-head@freebsd.org Thu Dec 19 15:36:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 649921E374A; Thu, 19 Dec 2019 15:36: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 47dwvP26hMz3Jyd; Thu, 19 Dec 2019 15:36: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 43D5C18BCC; Thu, 19 Dec 2019 15:36:01 +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 xBJFa1v0038464; Thu, 19 Dec 2019 15:36:01 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBJFa1nZ038463; Thu, 19 Dec 2019 15:36:01 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201912191536.xBJFa1nZ038463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 19 Dec 2019 15:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355912 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 355912 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2019 15:36:01 -0000 Author: jhb Date: Thu Dec 19 15:36:00 2019 New Revision: 355912 URL: https://svnweb.freebsd.org/changeset/base/355912 Log: Trim a spurious carriage return from the RFB signature string added in r355301. Submitted by: Yamagi Modified: head/usr.sbin/bhyve/rfb.c Modified: head/usr.sbin/bhyve/rfb.c ============================================================================== --- head/usr.sbin/bhyve/rfb.c Thu Dec 19 15:11:01 2019 (r355911) +++ head/usr.sbin/bhyve/rfb.c Thu Dec 19 15:36:00 2019 (r355912) @@ -744,7 +744,7 @@ rfb_wr_thr(void *arg) void rfb_handle(struct rfb_softc *rc, int cfd) { - const char *vbuf = "RFB 003.008\n\r"; + const char *vbuf = "RFB 003.008\n"; unsigned char buf[80]; unsigned char *message = NULL; From owner-svn-src-head@freebsd.org Thu Dec 19 16:39:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0068D1E4B9B; Thu, 19 Dec 2019 16:39:52 +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 47dyK45v8jz3MVw; Thu, 19 Dec 2019 16:39:52 +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 C157019691; Thu, 19 Dec 2019 16:39:52 +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 xBJGdqdC075458; Thu, 19 Dec 2019 16:39:52 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBJGdqkQ075457; Thu, 19 Dec 2019 16:39:52 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201912191639.xBJGdqkQ075457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Thu, 19 Dec 2019 16:39:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355913 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 355913 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2019 16:39:53 -0000 Author: dougm Date: Thu Dec 19 16:39:52 2019 New Revision: 355913 URL: https://svnweb.freebsd.org/changeset/base/355913 Log: Including into non-kernel software leads to a compilation error because, without _KERNEL defined, the macro TMPFS_VALIDATE_DIR is invoked, but never defined. User-level software that includes sys/tmpfs.h must define _KERNEL to make the definition of TMPFS_VALIDATE_DIR visible. This change puts all the inline functions that, directly or indirectly, invoke MPASS into the scope of the _KERNEL block, allowing many user-space includers of to stop defining _KERNEL. Reviewed by: alc, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22874 Modified: head/sys/fs/tmpfs/tmpfs.h Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Thu Dec 19 15:36:00 2019 (r355912) +++ head/sys/fs/tmpfs/tmpfs.h Thu Dec 19 16:39:52 2019 (r355913) @@ -493,8 +493,6 @@ size_t tmpfs_pages_used(struct tmpfs_mount *tmp); void tmpfs_subr_init(void); void tmpfs_subr_uninit(void); -#endif - /* * Macros/functions to convert from generic data structures to tmpfs * specific ones. @@ -536,5 +534,6 @@ tmpfs_use_nc(struct vnode *vp) return (!(VFS_TO_TMPFS(vp->v_mount)->tm_nonc)); } +#endif /* _KERNEL */ #endif /* _FS_TMPFS_TMPFS_H_ */ From owner-svn-src-head@freebsd.org Thu Dec 19 17:01:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F4C61E58AF; Thu, 19 Dec 2019 17:01:26 +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 47dyny2Qlgz3PCY; Thu, 19 Dec 2019 17:01:26 +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 4E90919A83; Thu, 19 Dec 2019 17:01:26 +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 xBJH1QWT090667; Thu, 19 Dec 2019 17:01:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBJH1Qnx090666; Thu, 19 Dec 2019 17:01:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912191701.xBJH1Qnx090666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 19 Dec 2019 17:01:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355914 - head/lib/libc/locale X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libc/locale X-SVN-Commit-Revision: 355914 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2019 17:01:26 -0000 Author: emaste Date: Thu Dec 19 17:01:25 2019 New Revision: 355914 URL: https://svnweb.freebsd.org/changeset/base/355914 Log: localeconv: correct grouping and mon_grouping per C/POSIX grouping and mon_grouping should be "" in the C locale. PR: 172215 MFC after: 6 weeks Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/locale/fix_grouping.c Modified: head/lib/libc/locale/fix_grouping.c ============================================================================== --- head/lib/libc/locale/fix_grouping.c Thu Dec 19 16:39:52 2019 (r355913) +++ head/lib/libc/locale/fix_grouping.c Thu Dec 19 17:01:25 2019 (r355914) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include -static const char nogrouping[] = { CHAR_MAX, '\0' }; +static const char nogrouping[] = { '\0' }; /* * Internal helper used to convert grouping sequences from string From owner-svn-src-head@freebsd.org Thu Dec 19 18:22:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07BA21E71B3; Thu, 19 Dec 2019 18:22:12 +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 47f0b76Ss3z3xb3; Thu, 19 Dec 2019 18:22:11 +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 D94311AA05; Thu, 19 Dec 2019 18:22:11 +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 xBJIMBF7038263; Thu, 19 Dec 2019 18:22:11 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBJIMBJ5038262; Thu, 19 Dec 2019 18:22:11 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201912191822.xBJIMBJ5038262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 19 Dec 2019 18:22:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355915 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355915 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2019 18:22:12 -0000 Author: jeff Date: Thu Dec 19 18:22:11 2019 New Revision: 355915 URL: https://svnweb.freebsd.org/changeset/base/355915 Log: Fix a bug in r355784. I missed a sched_add() call that needed to reacquire the thread lock. Reported by: mjg Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Thu Dec 19 17:01:25 2019 (r355914) +++ head/sys/kern/sched_ule.c Thu Dec 19 18:22:11 2019 (r355915) @@ -2689,7 +2689,7 @@ sched_affinity(struct thread *td) return; if (TD_ON_RUNQ(td)) { sched_rem(td); - sched_add(td, SRQ_BORING); + sched_add(td, SRQ_BORING | SRQ_HOLDTD); return; } if (!TD_IS_RUNNING(td)) From owner-svn-src-head@freebsd.org Thu Dec 19 19:34:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C2091E95C9; Thu, 19 Dec 2019 19:34:26 +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 47f2BT73PXz43Sr; Thu, 19 Dec 2019 19:34:25 +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 E89421B6A7; Thu, 19 Dec 2019 19:34:25 +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 xBJJYPqu080513; Thu, 19 Dec 2019 19:34:25 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBJJYPSD080512; Thu, 19 Dec 2019 19:34:25 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201912191934.xBJJYPSD080512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 19 Dec 2019 19:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355916 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355916 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2019 19:34:26 -0000 Author: markj Date: Thu Dec 19 19:34:25 2019 New Revision: 355916 URL: https://svnweb.freebsd.org/changeset/base/355916 Log: Fix SIGINFO stack collection to ignore threads with swapped-out stacks. We by definition cannot trace the stack of such a thread. Also remove a redundant stack_zero() call in the SIGINFO handler, the stack structure is cleared by the MD stack_capture(). Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/tty_info.c Modified: head/sys/kern/tty_info.c ============================================================================== --- head/sys/kern/tty_info.c Thu Dec 19 18:22:11 2019 (r355915) +++ head/sys/kern/tty_info.c Thu Dec 19 19:34:25 2019 (r355916) @@ -338,8 +338,9 @@ tty_info(struct tty *tp) pctcpu = (sched_pctcpu(td) * 10000 + FSCALE / 2) >> FSHIFT; #ifdef STACK if (tty_info_kstacks) { - stack_zero(&stack); - if (TD_IS_SWAPPED(td) || TD_IS_RUNNING(td)) + if (TD_IS_SWAPPED(td)) + sterr = ENOENT; + else if (TD_IS_RUNNING(td)) sterr = stack_save_td_running(&stack, td); else { stack_save_td(&stack, td); From owner-svn-src-head@freebsd.org Thu Dec 19 22:35:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50C4A1ECB16; Thu, 19 Dec 2019 22:35:17 +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 47f6C91Ry5z4BWg; Thu, 19 Dec 2019 22:35:17 +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 2D0881D6C4; Thu, 19 Dec 2019 22:35:17 +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 xBJMZG47085503; Thu, 19 Dec 2019 22:35:16 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBJMZGVo085502; Thu, 19 Dec 2019 22:35:16 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <201912192235.xBJMZGVo085502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Thu, 19 Dec 2019 22:35:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355917 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 355917 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2019 22:35:17 -0000 Author: bdragon Date: Thu Dec 19 22:35:16 2019 New Revision: 355917 URL: https://svnweb.freebsd.org/changeset/base/355917 Log: [PowerPC] Only move linker sets to .data on ELFv1 In r268055, powerpc64 was special cased regarding linker sets to not mark the function pointer as 'const'. This appears to have been done to ensure the compiler generates the function descriptors correctly. When non-const, the function descriptors will end up in the .data.rel.local section, and the linker set symbols will get relocations pointing to them there. Since function pointers on ELFv2 are "just" pointers like other platforms, we can leave them const like they are on every other platform. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D22796 Modified: head/sys/sys/linker_set.h Modified: head/sys/sys/linker_set.h ============================================================================== --- head/sys/sys/linker_set.h Thu Dec 19 19:34:25 2019 (r355916) +++ head/sys/sys/linker_set.h Thu Dec 19 22:35:16 2019 (r355917) @@ -42,8 +42,11 @@ * For ELF, this is done by constructing a separate segment for each set. */ -#if defined(__powerpc64__) +#if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1) /* + * ELFv1 pointers to functions are actaully pointers to function + * descriptors. + * * Move the symbol pointer from ".text" to ".data" segment, to make * the GCC compiler happy: */ From owner-svn-src-head@freebsd.org Fri Dec 20 03:38:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5DB441CAF8D; Fri, 20 Dec 2019 03:38:22 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47fDwt1sThz4Q4D; Fri, 20 Dec 2019 03:38:22 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B3B720CD2; Fri, 20 Dec 2019 03:38:22 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBK3cMR4062536; Fri, 20 Dec 2019 03:38:22 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBK3cLxi062532; Fri, 20 Dec 2019 03:38:21 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201912200338.xBK3cLxi062532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Fri, 20 Dec 2019 03:38:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355920 - head/sys/riscv/sifive X-SVN-Group: head X-SVN-Commit-Author: philip X-SVN-Commit-Paths: head/sys/riscv/sifive X-SVN-Commit-Revision: 355920 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 03:38:22 -0000 Author: philip Date: Fri Dec 20 03:38:21 2019 New Revision: 355920 URL: https://svnweb.freebsd.org/changeset/base/355920 Log: riscv/sifive: add SiFive FU540 PRCI driver The SiFive FU540 Power Reset Clocking Interrupt block contains a PLL that turns the input crystal (33.3MHz) into a 1-1.5GHz clock. This clock in turn is divided by two to produce the tlclk, which is fed into devices such as the SPI and I2C controllers. Register a new clock device for the PRCI so that those devices can read the correct clock through the clk framework. Submitted by: kp Sponsored by: Axiado Added: head/sys/riscv/sifive/ head/sys/riscv/sifive/files.sifive (contents, props changed) head/sys/riscv/sifive/fu540_prci.c (contents, props changed) head/sys/riscv/sifive/std.sifive (contents, props changed) Added: head/sys/riscv/sifive/files.sifive ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/sifive/files.sifive Fri Dec 20 03:38:21 2019 (r355920) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +riscv/sifive/fu540_prci.c standard Added: head/sys/riscv/sifive/fu540_prci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/sifive/fu540_prci.c Fri Dec 20 03:38:21 2019 (r355920) @@ -0,0 +1,268 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Axiado Corporation + * All rights reserved. + * + * This software was developed in part by Kristof Provost under contract for + * Axiado 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include + +static struct resource_spec prci_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + RESOURCE_SPEC_END +}; + +struct prci_softc { + device_t dev; + + struct mtx mtx; + + struct clkdom *clkdom; + struct resource *res; + bus_space_tag_t bst; + bus_space_handle_t bsh; +}; + +struct prci_clk_pll_sc { + struct prci_softc *parent_sc; +}; + +#define PRCI_LOCK(sc) mtx_lock(&(sc)->mtx) +#define PRCI_UNLOCK(sc) mtx_unlock(&(sc)->mtx) +#define PRCI_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mtx, MA_OWNED); +#define PRCI_ASSERT_UNLOCKED(sc) mtx_assert(&(sc)->mtx, MA_NOTOWNED); + +#define PRCI_COREPLL 0x4 +#define PRCI_COREPLL_DIVR_MASK 0x3f +#define PRCI_COREPLL_DIVR_SHIFT 0 +#define PRCI_COREPLL_DIVF_MASK 0x7fc0 +#define PRCI_COREPLL_DIVF_SHIFT 6 +#define PRCI_COREPLL_DIVQ_MASK 0x38000 +#define PRCI_COREPLL_DIVQ_SHIFT 15 + +#define PRCI_READ(_sc, _reg) \ + bus_space_read_4((_sc)->bst, (_sc)->bsh, (_reg)) + +static int +prci_clk_pll_init(struct clknode *clk, device_t dev) +{ + + clknode_init_parent_idx(clk, 0); + + return (0); +} + +static int +prci_clk_pll_recalc(struct clknode *clk, uint64_t *freq) +{ + struct prci_clk_pll_sc *sc; + struct clknode *parent_clk; + uint32_t val; + uint64_t refclk, divf, divq, divr; + int err; + + KASSERT(freq != NULL, ("freq cannot be NULL")); + + sc = clknode_get_softc(clk); + + PRCI_LOCK(sc->parent_sc); + + /* Get refclock frequency. */ + parent_clk = clknode_get_parent(clk); + err = clknode_get_freq(parent_clk, &refclk); + if (err) { + device_printf(sc->parent_sc->dev, + "Failed to get refclk frequency\n"); + PRCI_UNLOCK(sc->parent_sc); + return (err); + } + + /* Calculate the PLL output */ + val = PRCI_READ(sc->parent_sc, PRCI_COREPLL); + + divf = (val & PRCI_COREPLL_DIVF_MASK) >> PRCI_COREPLL_DIVF_SHIFT; + divq = (val & PRCI_COREPLL_DIVQ_MASK) >> PRCI_COREPLL_DIVQ_SHIFT; + divr = (val & PRCI_COREPLL_DIVR_MASK) >> PRCI_COREPLL_DIVR_SHIFT; + + *freq = refclk / (divr + 1) * (2 * (divf + 1)) / (1 << divq); + + PRCI_UNLOCK(sc->parent_sc); + + return (0); +} + +static clknode_method_t prci_clk_pll_clknode_methods[] = { + CLKNODEMETHOD(clknode_init, prci_clk_pll_init), + CLKNODEMETHOD(clknode_recalc_freq, prci_clk_pll_recalc), + CLKNODEMETHOD_END +}; + +DEFINE_CLASS_1(prci_clk_pll_clknode, prci_clk_pll_clknode_class, + prci_clk_pll_clknode_methods, sizeof(struct prci_clk_pll_sc), + clknode_class); + +static int +prci_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "sifive,aloeprci0")) + return (ENXIO); + + device_set_desc(dev, "SiFive FU540 Power Reset Clocking Interrupt"); + + return (BUS_PROBE_DEFAULT); +} + +static void +prci_pll_register(struct prci_softc *parent_sc, struct clknode_init_def *clkdef) +{ + struct clknode *clk; + struct prci_clk_pll_sc *sc; + + clk = clknode_create(parent_sc->clkdom, &prci_clk_pll_clknode_class, + clkdef); + if (clk == NULL) + panic("Failed to create clknode"); + + sc = clknode_get_softc(clk); + sc->parent_sc = parent_sc; + + clknode_register(parent_sc->clkdom, clk); +} + +static int +prci_attach(device_t dev) +{ + struct clknode_init_def clkdef; + struct prci_softc *sc; + clk_t clk_parent; + phandle_t node; + int i, ncells, error; + + sc = device_get_softc(dev); + sc->dev = dev; + + mtx_init(&sc->mtx, device_get_nameunit(sc->dev), NULL, MTX_DEF); + + error = bus_alloc_resources(dev, prci_spec, &sc->res); + if (error) { + device_printf(dev, "Couldn't allocate resources\n"); + goto fail; + } + sc->bst = rman_get_bustag(sc->res); + sc->bsh = rman_get_bushandle(sc->res); + + node = ofw_bus_get_node(dev); + error = ofw_bus_parse_xref_list_get_length(node, "clocks", + "#clock-cells", &ncells); + if (error != 0 || ncells != 1) { + device_printf(dev, "couldn't find parent clock\n"); + goto fail; + } + + bzero(&clkdef, sizeof(clkdef)); + clkdef.id = 0; + clkdef.name = "coreclk"; + clkdef.parent_names = mallocarray(ncells, sizeof(char *), M_OFWPROP, + M_WAITOK); + for (i = 0; i < ncells; i++) { + error = clk_get_by_ofw_index(dev, 0, i, &clk_parent); + if (error != 0) { + device_printf(dev, "cannot get clock %d\n", error); + goto fail1; + } + clkdef.parent_names[i] = clk_get_name(clk_parent); + if (bootverbose) + device_printf(dev, "clk parent: %s\n", + clkdef.parent_names[i]); + clk_release(clk_parent); + } + clkdef.parent_cnt = ncells; + + sc->clkdom = clkdom_create(dev); + if (sc->clkdom == NULL) { + device_printf(dev, "Couldn't create clock domain\n"); + goto fail; + } + + /* We can't free a clkdom, so from now on we cannot fail. */ + prci_pll_register(sc, &clkdef); + + error = clkdom_finit(sc->clkdom); + if (error) + panic("Couldn't finalise clock domain"); + + return (0); + +fail1: + free(clkdef.parent_names, M_OFWPROP); + +fail: + bus_release_resources(dev, prci_spec, &sc->res); + mtx_destroy(&sc->mtx); + return (error); +} + +static device_method_t prci_methods[] = { + DEVMETHOD(device_probe, prci_probe), + DEVMETHOD(device_attach, prci_attach), + + DEVMETHOD_END +}; + +static driver_t prci_driver = { + "fu540prci", + prci_methods, + sizeof(struct prci_softc) +}; + +static devclass_t prci_devclass; + +EARLY_DRIVER_MODULE(fu540prci, simplebus, prci_driver, prci_devclass, 0, 0, + BUS_PASS_BUS); Added: head/sys/riscv/sifive/std.sifive ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/sifive/std.sifive Fri Dec 20 03:38:21 2019 (r355920) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +files "../sifive/files.sifive" From owner-svn-src-head@freebsd.org Fri Dec 20 03:40:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F21D71CB07E; Fri, 20 Dec 2019 03:40:04 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47fDyr6BpZz4QCx; Fri, 20 Dec 2019 03:40:04 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CFE3620CDE; Fri, 20 Dec 2019 03:40:04 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBK3e4vX062705; Fri, 20 Dec 2019 03:40:04 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBK3e4N7062702; Fri, 20 Dec 2019 03:40:04 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201912200340.xBK3e4N7062702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Fri, 20 Dec 2019 03:40:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355921 - head/sys/riscv/sifive X-SVN-Group: head X-SVN-Commit-Author: philip X-SVN-Commit-Paths: head/sys/riscv/sifive X-SVN-Commit-Revision: 355921 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 03:40:05 -0000 Author: philip Date: Fri Dec 20 03:40:04 2019 New Revision: 355921 URL: https://svnweb.freebsd.org/changeset/base/355921 Log: riscv/sifive: add FU540 SPI controller driver Initial working prototype of the Serial Peripheral Interface controller in the SiFive FU540 SoC. Reviewed by: kp Sponsored by: Axiado Added: head/sys/riscv/sifive/fu540_spi.c (contents, props changed) Modified: head/sys/riscv/sifive/files.sifive (contents, props changed) Modified: head/sys/riscv/sifive/files.sifive ============================================================================== --- head/sys/riscv/sifive/files.sifive Fri Dec 20 03:38:21 2019 (r355920) +++ head/sys/riscv/sifive/files.sifive Fri Dec 20 03:40:04 2019 (r355921) @@ -1,3 +1,4 @@ # $FreeBSD$ riscv/sifive/fu540_prci.c standard +riscv/sifive/fu540_spi.c optional fu540spi spibus Added: head/sys/riscv/sifive/fu540_spi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/sifive/fu540_spi.c Fri Dec 20 03:40:04 2019 (r355921) @@ -0,0 +1,403 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Axiado Corporation + * All rights reserved. + * + * This software was developed in part by Philip Paeps and Kristof Provost + * under contract for Axiado 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include + +#include +#include + +#include "spibus_if.h" + +#if 1 +#define DBGPRINT(dev, fmt, args...) \ + device_printf(dev, "%s: " fmt "\n", __func__, ## args) +#else +#define DBGPRINT(dev, fmt, args...) +#endif + +static struct resource_spec fuspi_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + RESOURCE_SPEC_END +}; + +struct fuspi_softc { + device_t dev; + device_t parent; + + struct mtx mtx; + + struct resource *res; + bus_space_tag_t bst; + bus_space_handle_t bsh; + + void *ih; + + clk_t clk; + uint32_t cs_max; +}; + +#define FUSPI_LOCK(sc) mtx_lock(&(sc)->mtx) +#define FUSPI_UNLOCK(sc) mtx_unlock(&(sc)->mtx) +#define FUSPI_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mtx, MA_OWNED); +#define FUSPI_ASSERT_UNLOCKED(sc) mtx_assert(&(sc)->mtx, MA_NOTOWNED); + +/* + * Register offsets. + * From Sifive-Unleashed-FU540-C000-v1.0.pdf page 101. + */ +#define FUSPI_REG_SCKDIV 0x00 /* Serial clock divisor */ +#define FUSPI_REG_SCKMODE 0x04 /* Serial clock mode */ +#define FUSPI_REG_CSID 0x10 /* Chip select ID */ +#define FUSPI_REG_CSDEF 0x14 /* Chip select default */ +#define FUSPI_REG_CSMODE 0x18 /* Chip select mode */ +#define FUSPI_REG_DELAY0 0x28 /* Delay control 0 */ +#define FUSPI_REG_DELAY1 0x2C /* Delay control 1 */ +#define FUSPI_REG_FMT 0x40 /* Frame format */ +#define FUSPI_REG_TXDATA 0x48 /* Tx FIFO data */ +#define FUSPI_REG_RXDATA 0x4C /* Rx FIFO data */ +#define FUSPI_REG_TXMARK 0x50 /* Tx FIFO watermark */ +#define FUSPI_REG_RXMARK 0x54 /* Rx FIFO watermark */ +#define FUSPI_REG_FCTRL 0x60 /* SPI flash interface control* */ +#define FUSPI_REG_FFMT 0x64 /* SPI flash instruction format* */ +#define FUSPI_REG_IE 0x70 /* SPI interrupt enable */ +#define FUSPI_REG_IP 0x74 /* SPI interrupt pending */ + +#define FUSPI_SCKDIV_MASK 0xfff + +#define FUSPI_CSDEF_ALL ((1 << sc->cs_max)-1) + +#define FUSPI_CSMODE_AUTO 0x0U +#define FUSPI_CSMODE_HOLD 0x2U +#define FUSPI_CSMODE_OFF 0x3U + +#define FUSPI_TXDATA_DATA_MASK 0xff +#define FUSPI_TXDATA_FULL (1 << 31) + +#define FUSPI_RXDATA_DATA_MASK 0xff +#define FUSPI_RXDATA_EMPTY (1 << 31) + +#define FUSPI_SCKMODE_PHA (1 << 0) +#define FUSPI_SCKMODE_POL (1 << 1) + +#define FUSPI_FMT_PROTO_SINGLE 0x0U +#define FUSPI_FMT_PROTO_DUAL 0x1U +#define FUSPI_FMT_PROTO_QUAD 0x2U +#define FUSPI_FMT_PROTO_MASK 0x3U +#define FUSPI_FMT_ENDIAN (1 << 2) +#define FUSPI_FMT_DIR (1 << 3) +#define FUSPI_FMT_LEN(x) ((uint32_t)(x) << 16) +#define FUSPI_FMT_LEN_MASK (0xfU << 16) + +#define FUSPI_FIFO_DEPTH 8 + +#define FUSPI_READ(_sc, _reg) \ + bus_space_read_4((_sc)->bst, (_sc)->bsh, (_reg)) +#define FUSPI_WRITE(_sc, _reg, _val) \ + bus_space_write_4((_sc)->bst, (_sc)->bsh, (_reg), (_val)) + +static void +fuspi_tx(struct fuspi_softc *sc, uint8_t *buf, uint32_t bufsiz) +{ + uint32_t val; + uint8_t *p, *end; + + KASSERT(buf != NULL, ("TX buffer cannot be NULL")); + + end = buf + bufsiz; + for (p = buf; p < end; p++) { + do { + val = FUSPI_READ(sc, FUSPI_REG_TXDATA); + } while (val & FUSPI_TXDATA_FULL); + val = *p; + FUSPI_WRITE(sc, FUSPI_REG_TXDATA, val); + } +} + +static void +fuspi_rx(struct fuspi_softc *sc, uint8_t *buf, uint32_t bufsiz) +{ + uint32_t val; + uint8_t *p, *end; + + KASSERT(buf != NULL, ("RX buffer cannot be NULL")); + KASSERT(bufsiz <= FUSPI_FIFO_DEPTH, + ("Cannot receive more than %d bytes at a time\n", + FUSPI_FIFO_DEPTH)); + + end = buf + bufsiz; + for (p = buf; p < end; p++) { + do { + val = FUSPI_READ(sc, FUSPI_REG_RXDATA); + } while (val & FUSPI_RXDATA_EMPTY); + *p = val & FUSPI_RXDATA_DATA_MASK; + }; +} + +static int +fuspi_xfer_buf(struct fuspi_softc *sc, uint8_t *rxbuf, uint8_t *txbuf, + uint32_t txlen, uint32_t rxlen) +{ + uint32_t bytes; + + KASSERT(txlen == rxlen, ("TX and RX lengths must be equal")); + KASSERT(rxbuf != NULL, ("RX buffer cannot be NULL")); + KASSERT(txbuf != NULL, ("TX buffer cannot be NULL")); + + while (txlen) { + bytes = (txlen > FUSPI_FIFO_DEPTH) ? FUSPI_FIFO_DEPTH : txlen; + fuspi_tx(sc, txbuf, bytes); + txbuf += bytes; + fuspi_rx(sc, rxbuf, bytes); + rxbuf += bytes; + txlen -= bytes; + } + + return (0); +} + +static int +fuspi_setup(struct fuspi_softc *sc, uint32_t cs, uint32_t mode, + uint32_t freq) +{ + uint32_t csmode, fmt, sckdiv, sckmode; + uint64_t clock; + int ret; + + FUSPI_ASSERT_LOCKED(sc); + + ret = clk_get_freq(sc->clk, &clock); + if (ret) { + device_printf(sc->dev, "Cannot get clock frequency: %d\n", ret); + return (ret); + } + + /* + * Fsck = Fin / 2 * (div + 1) + * -> div = Fin / (2 * Fsck) - 1 + */ + sckdiv = (howmany(clock >> 1, freq) - 1) & FUSPI_SCKDIV_MASK; + FUSPI_WRITE(sc, FUSPI_REG_SCKDIV, sckdiv); + + switch (mode) { + case SPIBUS_MODE_CPHA: + sckmode = FUSPI_SCKMODE_PHA; + break; + case SPIBUS_MODE_CPOL: + sckmode = FUSPI_SCKMODE_POL; + break; + case SPIBUS_MODE_CPOL_CPHA: + sckmode = FUSPI_SCKMODE_PHA | FUSPI_SCKMODE_POL; + break; + } + FUSPI_WRITE(sc, FUSPI_REG_SCKMODE, sckmode); + + csmode = FUSPI_CSMODE_HOLD; + if (cs & SPIBUS_CS_HIGH) + csmode = FUSPI_CSMODE_AUTO; + FUSPI_WRITE(sc, FUSPI_REG_CSMODE, csmode); + + FUSPI_WRITE(sc, FUSPI_REG_CSID, cs & ~SPIBUS_CS_HIGH); + + fmt = FUSPI_FMT_PROTO_SINGLE | FUSPI_FMT_LEN(8); + FUSPI_WRITE(sc, FUSPI_REG_FMT, fmt); + + return (0); +} + +static int +fuspi_transfer(device_t dev, device_t child, struct spi_command *cmd) +{ + struct fuspi_softc *sc; + uint32_t clock, cs, csdef, mode; + int err; + + KASSERT(cmd->tx_cmd_sz == cmd->rx_cmd_sz, + ("TX and RX command sizes must be equal")); + KASSERT(cmd->tx_data_sz == cmd->rx_data_sz, + ("TX and RX data sizes must be equal")); + + sc = device_get_softc(dev); + spibus_get_cs(child, &cs); + spibus_get_clock(child, &clock); + spibus_get_mode(child, &mode); + + if (cs > sc->cs_max) { + device_printf(sc->dev, "Invalid chip select %u\n", cs); + return (EINVAL); + } + + FUSPI_LOCK(sc); + device_busy(sc->dev); + + err = fuspi_setup(sc, cs, mode, clock); + if (err != 0) { + FUSPI_UNLOCK(sc); + return (err); + } + + err = 0; + if (cmd->tx_cmd_sz > 0) + err = fuspi_xfer_buf(sc, cmd->rx_cmd, cmd->tx_cmd, + cmd->tx_cmd_sz, cmd->rx_cmd_sz); + if (cmd->tx_data_sz > 0 && err == 0) + err = fuspi_xfer_buf(sc, cmd->rx_data, cmd->tx_data, + cmd->tx_data_sz, cmd->rx_data_sz); + + /* Deassert chip select. */ + csdef = FUSPI_CSDEF_ALL & ~(1 << cs); + FUSPI_WRITE(sc, FUSPI_REG_CSDEF, csdef); + FUSPI_WRITE(sc, FUSPI_REG_CSDEF, FUSPI_CSDEF_ALL); + + device_unbusy(sc->dev); + FUSPI_UNLOCK(sc); + + return (err); +} + +static int +fuspi_attach(device_t dev) +{ + struct fuspi_softc *sc; + int error; + + sc = device_get_softc(dev); + sc->dev = dev; + + mtx_init(&sc->mtx, device_get_nameunit(sc->dev), NULL, MTX_DEF); + + error = bus_alloc_resources(dev, fuspi_spec, &sc->res); + if (error) { + device_printf(dev, "Couldn't allocate resources\n"); + goto fail; + } + sc->bst = rman_get_bustag(sc->res); + sc->bsh = rman_get_bushandle(sc->res); + + error = clk_get_by_ofw_index(dev, 0, 0, &sc->clk); + if (error) { + device_printf(dev, "Couldn't allocate clock: %d\n", error); + goto fail; + } + error = clk_enable(sc->clk); + if (error) { + device_printf(dev, "Couldn't enable clock: %d\n", error); + goto fail; + } + + /* + * From Sifive-Unleashed-FU540-C000-v1.0.pdf page 103: + * csdef is cs_width bits wide and all ones on reset. + */ + sc->cs_max = FUSPI_READ(sc, FUSPI_REG_CSDEF); + + /* + * We don't support the direct-mapped flash interface. + * Disable it. + */ + FUSPI_WRITE(sc, FUSPI_REG_FCTRL, 0x0); + + /* Probe and attach the spibus when interrupts are available. */ + sc->parent = device_add_child(dev, "spibus", -1); + config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); + + return (0); + +fail1: + bus_release_resources(dev, fuspi_spec, &sc->res); + +fail: + mtx_destroy(&sc->mtx); + return (error); +} + +static int +fuspi_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "sifive,spi0")) + return (ENXIO); + + device_set_desc(dev, "SiFive FU540 SPI controller"); + + return (BUS_PROBE_DEFAULT); +} + +static phandle_t +fuspi_get_node(device_t bus, device_t dev) +{ + + return (ofw_bus_get_node(bus)); +} + +static device_method_t fuspi_methods[] = { + DEVMETHOD(device_probe, fuspi_probe), + DEVMETHOD(device_attach, fuspi_attach), + + DEVMETHOD(spibus_transfer, fuspi_transfer), + + DEVMETHOD(ofw_bus_get_node, fuspi_get_node), + + DEVMETHOD_END +}; + +static driver_t fuspi_driver = { + "fu540spi", + fuspi_methods, + sizeof(struct fuspi_softc) +}; + +static devclass_t fuspi_devclass; + +DRIVER_MODULE(fu540spi, simplebus, fuspi_driver, fuspi_devclass, 0, 0); +DRIVER_MODULE(ofw_spibus, fu540spi, ofw_spibus_driver, ofw_spibus_devclass, 0, 0); +MODULE_DEPEND(fu540spi, ofw_spibus, 1, 1, 1); From owner-svn-src-head@freebsd.org Fri Dec 20 03:40:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EDB421CB0A9; Fri, 20 Dec 2019 03:40:07 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47fDyv66ncz4QFD; Fri, 20 Dec 2019 03:40:07 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD48720CE0; Fri, 20 Dec 2019 03:40:07 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBK3e7Dd062753; Fri, 20 Dec 2019 03:40:07 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBK3e7o5062752; Fri, 20 Dec 2019 03:40:07 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201912200340.xBK3e7o5062752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Fri, 20 Dec 2019 03:40:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355922 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: philip X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 355922 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 03:40:08 -0000 Author: philip Date: Fri Dec 20 03:40:07 2019 New Revision: 355922 URL: https://svnweb.freebsd.org/changeset/base/355922 Log: iicoc: minor whitespace and style(9) fixes No functional changes. This commit will make upcoming changes which do affect functionality easier to read. Reviewed by: kp Sponsored by: Axiado Modified: head/sys/dev/iicbus/iicoc.c Modified: head/sys/dev/iicbus/iicoc.c ============================================================================== --- head/sys/dev/iicbus/iicoc.c Fri Dec 20 03:40:04 2019 (r355921) +++ head/sys/dev/iicbus/iicoc.c Fri Dec 20 03:40:07 2019 (r355922) @@ -14,7 +14,7 @@ * 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 BROADCOM ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -33,23 +33,23 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include -#include #include #include -#include #include -#include +#include #include #include #include "iicbus_if.h" +#include "iicoc.h" static devclass_t iicoc_devclass; @@ -64,24 +64,24 @@ static int iicoc_start(device_t dev, u_char slave, int static int iicoc_stop(device_t dev); static int iicoc_read(device_t dev, char *buf, int len, int *read, int last, int delay); -static int iicoc_write(device_t dev, const char *buf, +static int iicoc_write(device_t dev, const char *buf, int len, int *sent, int timeout); static int iicoc_repeated_start(device_t dev, u_char slave, int timeout); struct iicoc_softc { - device_t dev; /* Self */ + device_t dev; /* Self */ u_int reg_shift; /* Chip specific */ u_int clockfreq; u_int i2cfreq; struct resource *mem_res; /* Memory resource */ int mem_rid; - int sc_started; + int sc_started; uint8_t i2cdev_addr; device_t iicbus; struct mtx sc_mtx; }; -static void +static void iicoc_dev_write(device_t dev, int reg, int value) { struct iicoc_softc *sc; @@ -90,7 +90,7 @@ iicoc_dev_write(device_t dev, int reg, int value) bus_write_1(sc->mem_res, reg<reg_shift, value); } -static int +static int iicoc_dev_read(device_t dev, int reg) { uint8_t val; @@ -124,7 +124,7 @@ iicoc_rd_cmd(device_t dev, uint8_t cmd) device_printf(dev, "read: Timeout waiting for TIP clear.\n"); return (-1); } - data = iicoc_dev_read(dev, OC_I2C_DATA_REG); + data = iicoc_dev_read(dev, OC_I2C_DATA_REG); return (data); } @@ -144,9 +144,10 @@ iicoc_wr_cmd(device_t dev, uint8_t data, uint8_t cmd) static int iicoc_wr_ack_cmd(device_t dev, uint8_t data, uint8_t cmd) { - if (iicoc_wr_cmd(dev, data, cmd) < 0) - return (-1); - + + if (iicoc_wr_cmd(dev, data, cmd) < 0) + return (-1); + if (iicoc_dev_read(dev, OC_I2C_STATUS_REG) & OC_STATUS_NACK) { device_printf(dev, "write: I2C command ACK Error.\n"); return (IIC_ENOACK); @@ -154,7 +155,7 @@ iicoc_wr_ack_cmd(device_t dev, uint8_t data, uint8_t c return (0); } -static int +static int iicoc_init(device_t dev) { struct iicoc_softc *sc; @@ -162,7 +163,7 @@ iicoc_init(device_t dev) sc = device_get_softc(dev); value = iicoc_dev_read(dev, OC_I2C_CTRL_REG); - iicoc_dev_write(dev, OC_I2C_CTRL_REG, + iicoc_dev_write(dev, OC_I2C_CTRL_REG, value & ~(OC_CONTROL_EN | OC_CONTROL_IEN)); value = (sc->clockfreq/(5 * sc->i2cfreq)) - 1; iicoc_dev_write(dev, OC_I2C_PRESCALE_LO_REG, value & 0xff); @@ -179,7 +180,7 @@ static int iicoc_probe(device_t dev) { struct iicoc_softc *sc; - + sc = device_get_softc(dev); if ((pci_get_vendor(dev) == 0x184e) && (pci_get_device(dev) == 0x1011)) { @@ -230,13 +231,14 @@ iicoc_attach(device_t dev) static int iicoc_detach(device_t dev) { + bus_generic_detach(dev); device_delete_children(dev); return (0); } -static int +static int iicoc_start(device_t dev, u_char slave, int timeout) { int error = IIC_EBUSERR; @@ -252,12 +254,12 @@ iicoc_start(device_t dev, u_char slave, int timeout) /* Write Slave Address */ if (iicoc_wr_ack_cmd(dev, slave, OC_COMMAND_START)) { - device_printf(dev, + device_printf(dev, "I2C write slave address [0x%x] failed.\n", slave); error = IIC_ENOACK; - goto i2c_stx_error; + goto i2c_stx_error; } - + /* Verify Arbitration is not Lost */ if (iicoc_dev_read(dev, OC_I2C_STATUS_REG) & OC_STATUS_AL) { device_printf(dev, "I2C Bus Arbitration Lost, Aborting.\n"); @@ -267,6 +269,7 @@ iicoc_start(device_t dev, u_char slave, int timeout) error = IIC_NOERR; mtx_unlock(&sc->sc_mtx); return (error); + i2c_stx_error: iicoc_dev_write(dev, OC_I2C_CMD_REG, OC_COMMAND_STOP); iicoc_wait_on_status(dev, OC_STATUS_BUSY); /* wait for idle */ @@ -274,7 +277,7 @@ i2c_stx_error: return (error); } -static int +static int iicoc_stop(device_t dev) { int error = 0; @@ -286,12 +289,10 @@ iicoc_stop(device_t dev) iicoc_wait_on_status(dev, OC_STATUS_BUSY); /* wait for idle */ mtx_unlock(&sc->sc_mtx); return (error); - } -static int -iicoc_write(device_t dev, const char *buf, int len, - int *sent, int timeout /* us */ ) +static int +iicoc_write(device_t dev, const char *buf, int len, int *sent, int timeout) { uint8_t value; int i; @@ -300,7 +301,7 @@ iicoc_write(device_t dev, const char *buf, int len, /* Write Slave Offset */ if (iicoc_wr_ack_cmd(dev, value, OC_COMMAND_WRITE)) { device_printf(dev, "I2C write slave offset failed.\n"); - goto i2c_tx_error; + goto i2c_tx_error; } for (i = 1; i < len; i++) { @@ -309,7 +310,7 @@ iicoc_write(device_t dev, const char *buf, int len, if (iicoc_wr_cmd(dev, value, OC_COMMAND_WRITE)) { device_printf(dev, "I2C write data byte %d failed.\n", i); - goto i2c_tx_error; + goto i2c_tx_error; } } *sent = len; @@ -319,9 +320,8 @@ i2c_tx_error: return (IIC_EBUSERR); } -static int -iicoc_read(device_t dev, char *buf, int len, int *read, int last, - int delay) +static int +iicoc_read(device_t dev, char *buf, int len, int *read, int last, int delay) { int data, i; uint8_t cmd; @@ -331,17 +331,17 @@ iicoc_read(device_t dev, char *buf, int len, int *read cmd = (i == len - 1) ? OC_COMMAND_RDNACK : OC_COMMAND_READ; data = iicoc_rd_cmd(dev, cmd); if (data < 0) { - device_printf(dev, + device_printf(dev, "I2C read data byte %d failed.\n", i); goto i2c_rx_error; } buf[i] = (uint8_t)data; } - + *read = len; return (IIC_NOERR); -i2c_rx_error: +i2c_rx_error: return (IIC_EBUSERR); } @@ -361,6 +361,7 @@ iicoc_reset(device_t dev, u_char speed, u_char addr, u static int iicoc_repeated_start(device_t dev, u_char slave, int timeout) { + return 0; } @@ -375,7 +376,7 @@ static device_method_t iicoc_methods[] = { DEVMETHOD(iicbus_repeated_start, iicoc_repeated_start), DEVMETHOD(iicbus_start, iicoc_start), DEVMETHOD(iicbus_stop, iicoc_stop), - DEVMETHOD(iicbus_reset, iicoc_reset), + DEVMETHOD(iicbus_reset, iicoc_reset), DEVMETHOD(iicbus_write, iicoc_write), DEVMETHOD(iicbus_read, iicoc_read), DEVMETHOD(iicbus_transfer, iicbus_transfer_gen), From owner-svn-src-head@freebsd.org Fri Dec 20 03:40:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 334F81CB192; Fri, 20 Dec 2019 03:40:48 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47fDzh0DZfz4QTl; Fri, 20 Dec 2019 03:40:48 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0304820CF7; Fri, 20 Dec 2019 03:40:48 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBK3elbo063549; Fri, 20 Dec 2019 03:40:47 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBK3elKE063545; Fri, 20 Dec 2019 03:40:47 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201912200340.xBK3elKE063545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Fri, 20 Dec 2019 03:40:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355923 - in head/sys: conf dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: philip X-SVN-Commit-Paths: in head/sys: conf dev/iicbus X-SVN-Commit-Revision: 355923 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 03:40:48 -0000 Author: philip Date: Fri Dec 20 03:40:46 2019 New Revision: 355923 URL: https://svnweb.freebsd.org/changeset/base/355923 Log: iicoc: split up common core and PCI bus specifics The OpenCores I2C IP core can be found on any bus. Split out the PCI bus specifics into their own file, only compiled on systems with PCI. Reviewed by: kp Sponsored by: Axiado Added: head/sys/dev/iicbus/iicoc_pci.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/iicbus/iicoc.c head/sys/dev/iicbus/iicoc.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Dec 20 03:40:07 2019 (r355922) +++ head/sys/conf/files Fri Dec 20 03:40:46 2019 (r355923) @@ -1797,6 +1797,7 @@ dev/iicbus/iiconf.c optional iicbus dev/iicbus/iicsmb.c optional iicsmb \ dependency "iicbus_if.h" dev/iicbus/iicoc.c optional iicoc +dev/iicbus/iicoc_pci.c optional iicoc pci dev/iicbus/isl12xx.c optional isl12xx dev/iicbus/lm75.c optional lm75 dev/iicbus/nxprtc.c optional nxprtc | pcf8563 Modified: head/sys/dev/iicbus/iicoc.c ============================================================================== --- head/sys/dev/iicbus/iicoc.c Fri Dec 20 03:40:07 2019 (r355922) +++ head/sys/dev/iicbus/iicoc.c Fri Dec 20 03:40:46 2019 (r355923) @@ -45,42 +45,13 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include - #include "iicbus_if.h" #include "iicoc.h" -static devclass_t iicoc_devclass; +devclass_t iicoc_devclass; -/* - * Device methods - */ -static int iicoc_probe(device_t); -static int iicoc_attach(device_t); -static int iicoc_detach(device_t); +DRIVER_MODULE(iicbus, iicoc, iicbus_driver, iicbus_devclass, 0, 0); -static int iicoc_start(device_t dev, u_char slave, int timeout); -static int iicoc_stop(device_t dev); -static int iicoc_read(device_t dev, char *buf, - int len, int *read, int last, int delay); -static int iicoc_write(device_t dev, const char *buf, - int len, int *sent, int timeout); -static int iicoc_repeated_start(device_t dev, u_char slave, int timeout); - -struct iicoc_softc { - device_t dev; /* Self */ - u_int reg_shift; /* Chip specific */ - u_int clockfreq; - u_int i2cfreq; - struct resource *mem_res; /* Memory resource */ - int mem_rid; - int sc_started; - uint8_t i2cdev_addr; - device_t iicbus; - struct mtx sc_mtx; -}; - static void iicoc_dev_write(device_t dev, int reg, int value) { @@ -155,7 +126,7 @@ iicoc_wr_ack_cmd(device_t dev, uint8_t data, uint8_t c return (0); } -static int +int iicoc_init(device_t dev) { struct iicoc_softc *sc; @@ -176,71 +147,9 @@ iicoc_init(device_t dev) return ((value & OC_CONTROL_EN) == 0); } -static int -iicoc_probe(device_t dev) +int +iicoc_iicbus_start(device_t dev, u_char slave, int timeout) { - struct iicoc_softc *sc; - - sc = device_get_softc(dev); - if ((pci_get_vendor(dev) == 0x184e) && - (pci_get_device(dev) == 0x1011)) { - sc->clockfreq = XLP_I2C_CLKFREQ; - sc->i2cfreq = XLP_I2C_FREQ; - sc->reg_shift = 2; - device_set_desc(dev, "Netlogic XLP I2C Controller"); - return (BUS_PROBE_DEFAULT); - } - return (ENXIO); -} - - -/* - * We add all the devices which we know about. - * The generic attach routine will attach them if they are alive. - */ -static int -iicoc_attach(device_t dev) -{ - int bus; - struct iicoc_softc *sc; - - sc = device_get_softc(dev); - bus = device_get_unit(dev); - - sc->dev = dev; - mtx_init(&sc->sc_mtx, "iicoc", "iicoc", MTX_DEF); - sc->mem_rid = 0; - sc->mem_res = bus_alloc_resource_anywhere(dev, - SYS_RES_MEMORY, &sc->mem_rid, 0x100, RF_ACTIVE); - - if (sc->mem_res == NULL) { - device_printf(dev, "Could not allocate bus resource.\n"); - return (-1); - } - iicoc_init(dev); - sc->iicbus = device_add_child(dev, "iicbus", -1); - if (sc->iicbus == NULL) { - device_printf(dev, "Could not allocate iicbus instance.\n"); - return (-1); - } - bus_generic_attach(dev); - - return (0); -} - -static int -iicoc_detach(device_t dev) -{ - - bus_generic_detach(dev); - device_delete_children(dev); - - return (0); -} - -static int -iicoc_start(device_t dev, u_char slave, int timeout) -{ int error = IIC_EBUSERR; struct iicoc_softc *sc; @@ -277,8 +186,8 @@ i2c_stx_error: return (error); } -static int -iicoc_stop(device_t dev) +int +iicoc_iicbus_stop(device_t dev) { int error = 0; struct iicoc_softc *sc; @@ -291,8 +200,9 @@ iicoc_stop(device_t dev) return (error); } -static int -iicoc_write(device_t dev, const char *buf, int len, int *sent, int timeout) +int +iicoc_iicbus_write(device_t dev, const char *buf, int len, int *sent, + int timeout) { uint8_t value; int i; @@ -320,8 +230,9 @@ i2c_tx_error: return (IIC_EBUSERR); } -static int -iicoc_read(device_t dev, char *buf, int len, int *read, int last, int delay) +int +iicoc_iicbus_read(device_t dev, char *buf, int len, int *read, int last, + int delay) { int data, i; uint8_t cmd; @@ -345,8 +256,8 @@ i2c_rx_error: return (IIC_EBUSERR); } -static int -iicoc_reset(device_t dev, u_char speed, u_char addr, u_char *oldadr) +int +iicoc_iicbus_reset(device_t dev, u_char speed, u_char addr, u_char *oldadr) { int error; struct iicoc_softc *sc; @@ -358,37 +269,9 @@ iicoc_reset(device_t dev, u_char speed, u_char addr, u return (error); } -static int -iicoc_repeated_start(device_t dev, u_char slave, int timeout) +int +iicoc_iicbus_repeated_start(device_t dev, u_char slave, int timeout) { return 0; } - -static device_method_t iicoc_methods[] = { - /* device interface */ - DEVMETHOD(device_probe, iicoc_probe), - DEVMETHOD(device_attach, iicoc_attach), - DEVMETHOD(device_detach, iicoc_detach), - - /* iicbus interface */ - DEVMETHOD(iicbus_callback, iicbus_null_callback), - DEVMETHOD(iicbus_repeated_start, iicoc_repeated_start), - DEVMETHOD(iicbus_start, iicoc_start), - DEVMETHOD(iicbus_stop, iicoc_stop), - DEVMETHOD(iicbus_reset, iicoc_reset), - DEVMETHOD(iicbus_write, iicoc_write), - DEVMETHOD(iicbus_read, iicoc_read), - DEVMETHOD(iicbus_transfer, iicbus_transfer_gen), - - DEVMETHOD_END -}; - -static driver_t iicoc_driver = { - "iicoc", - iicoc_methods, - sizeof(struct iicoc_softc), -}; - -DRIVER_MODULE(iicoc, pci, iicoc_driver, iicoc_devclass, 0, 0); -DRIVER_MODULE(iicbus, iicoc, iicbus_driver, iicbus_devclass, 0, 0); Modified: head/sys/dev/iicbus/iicoc.h ============================================================================== --- head/sys/dev/iicbus/iicoc.h Fri Dec 20 03:40:07 2019 (r355922) +++ head/sys/dev/iicbus/iicoc.h Fri Dec 20 03:40:46 2019 (r355923) @@ -77,4 +77,30 @@ #define OC_STATUS_TIP 0x02 /* Transfer in Progress */ #define OC_STATUS_IF 0x01 /* Intr. Pending Flag */ +struct iicoc_softc { + device_t dev; /* Self */ + u_int reg_shift; /* Chip specific */ + u_int clockfreq; + u_int i2cfreq; + struct resource *mem_res; /* Memory resource */ + int mem_rid; + int sc_started; + uint8_t i2cdev_addr; + device_t iicbus; + struct mtx sc_mtx; +}; + #endif + +extern devclass_t iicoc_devclass; + +int iicoc_iicbus_start(device_t dev, u_char slave, int timeout); +int iicoc_iicbus_stop(device_t dev); +int iicoc_iicbus_read(device_t dev, char *buf, int len, int *read, int last, + int delay); +int iicoc_iicbus_write(device_t dev, const char *buf, int len, int *sent, + int timeout); +int iicoc_iicbus_repeated_start(device_t dev, u_char slave, int timeout); +int iicoc_iicbus_reset(device_t dev, u_char speed, u_char addr, u_char *oldadr); + +int iicoc_init(device_t dev); Added: head/sys/dev/iicbus/iicoc_pci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iicbus/iicoc_pci.c Fri Dec 20 03:40:46 2019 (r355923) @@ -0,0 +1,143 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2003-2012 Broadcom Corporation + * 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include "iicbus_if.h" +#include "iicoc.h" + +static int +iicoc_detach(device_t dev) +{ + struct iicoc_softc *sc; + + sc = device_get_softc(dev); + device_delete_children(dev); + bus_generic_detach(dev); + bus_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, &sc->mem_res); + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +/* + * We add all the devices which we know about. + * The generic attach routine will attach them if they are alive. + */ +static int +iicoc_attach(device_t dev) +{ + int bus; + struct iicoc_softc *sc; + + sc = device_get_softc(dev); + bus = device_get_unit(dev); + + sc->dev = dev; + mtx_init(&sc->sc_mtx, "iicoc", "iicoc", MTX_DEF); + sc->mem_rid = 0; + sc->mem_res = bus_alloc_resource_anywhere(dev, + SYS_RES_MEMORY, &sc->mem_rid, 0x100, RF_ACTIVE); + + if (sc->mem_res == NULL) { + device_printf(dev, "Could not allocate bus resource.\n"); + return (-1); + } + iicoc_init(dev); + sc->iicbus = device_add_child(dev, "iicbus", -1); + if (sc->iicbus == NULL) { + device_printf(dev, "Could not allocate iicbus instance.\n"); + bus_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, + &sc->mem_res); + mtx_destroy(&sc->sc_mtx); + return (-1); + } + bus_generic_attach(dev); + + return (0); +} + +static int +iicoc_probe(device_t dev) +{ + struct iicoc_softc *sc; + + sc = device_get_softc(dev); + if ((pci_get_vendor(dev) == 0x184e) && + (pci_get_device(dev) == 0x1011)) { + sc->clockfreq = XLP_I2C_CLKFREQ; + sc->i2cfreq = XLP_I2C_FREQ; + sc->reg_shift = 2; + device_set_desc(dev, "Netlogic XLP I2C Controller"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); +} + +static device_method_t iicoc_methods[] = { + /* device interface */ + DEVMETHOD(device_probe, iicoc_probe), + DEVMETHOD(device_attach, iicoc_attach), + DEVMETHOD(device_detach, iicoc_detach), + + /* iicbus interface */ + DEVMETHOD(iicbus_callback, iicbus_null_callback), + DEVMETHOD(iicbus_repeated_start, iicoc_iicbus_repeated_start), + DEVMETHOD(iicbus_start, iicoc_iicbus_start), + DEVMETHOD(iicbus_stop, iicoc_iicbus_stop), + DEVMETHOD(iicbus_reset, iicoc_iicbus_reset), + DEVMETHOD(iicbus_write, iicoc_iicbus_write), + DEVMETHOD(iicbus_read, iicoc_iicbus_read), + DEVMETHOD(iicbus_transfer, iicbus_transfer_gen), + + DEVMETHOD_END +}; + +static driver_t iicoc_driver = { + "iicoc", + iicoc_methods, + sizeof(struct iicoc_softc), +}; + +DRIVER_MODULE(iicoc, pci, iicoc_driver, iicoc_devclass, 0, 0); From owner-svn-src-head@freebsd.org Fri Dec 20 03:40:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E6821CB1B9; Fri, 20 Dec 2019 03:40:51 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47fDzl2p5bz4Qcd; Fri, 20 Dec 2019 03:40:51 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A27820CFA; Fri, 20 Dec 2019 03:40:51 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBK3epwQ063598; Fri, 20 Dec 2019 03:40:51 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBK3epN5063596; Fri, 20 Dec 2019 03:40:51 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201912200340.xBK3epN5063596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Fri, 20 Dec 2019 03:40:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355924 - in head/sys: conf dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: philip X-SVN-Commit-Paths: in head/sys: conf dev/iicbus X-SVN-Commit-Revision: 355924 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 03:40:51 -0000 Author: philip Date: Fri Dec 20 03:40:50 2019 New Revision: 355924 URL: https://svnweb.freebsd.org/changeset/base/355924 Log: iicoc: add FDT bus attachment This adds support for OpenCores I2C master controllers on FDT systems. Reviewed by: kp Sponsored by: Axiado Added: head/sys/dev/iicbus/iicoc_fdt.c (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Dec 20 03:40:46 2019 (r355923) +++ head/sys/conf/files Fri Dec 20 03:40:50 2019 (r355924) @@ -1797,6 +1797,7 @@ dev/iicbus/iiconf.c optional iicbus dev/iicbus/iicsmb.c optional iicsmb \ dependency "iicbus_if.h" dev/iicbus/iicoc.c optional iicoc +dev/iicbus/iicoc_fdt.c optional iicoc fdt dev/iicbus/iicoc_pci.c optional iicoc pci dev/iicbus/isl12xx.c optional isl12xx dev/iicbus/lm75.c optional lm75 Added: head/sys/dev/iicbus/iicoc_fdt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iicbus/iicoc_fdt.c Fri Dec 20 03:40:50 2019 (r355924) @@ -0,0 +1,188 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Axiado Corporation. + * All rights reserved. + * + * This software was developed in part by Philip Paeps under contract for + * Axiado 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include + +#include "iicbus_if.h" +#include "iicoc.h" + +static struct ofw_compat_data compat_data[] = { + { "opencores,i2c-ocores", 1 }, + { NULL, 0 } +}; + +static struct resource_spec iicoc_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + RESOURCE_SPEC_END +}; + +static phandle_t +iicoc_get_node(device_t bus, device_t dev) +{ + + /* Share controller node with iicbus device. */ + return (ofw_bus_get_node(bus)); +} + +static int +iicoc_attach(device_t dev) +{ + struct iicoc_softc *sc; + phandle_t node; + clk_t clock; + uint64_t clockfreq; + int error; + + sc = device_get_softc(dev); + sc->dev = dev; + + mtx_init(&sc->sc_mtx, "iicoc", "iicoc", MTX_DEF); + + error = bus_alloc_resources(dev, iicoc_spec, &sc->mem_res); + if (error) { + device_printf(dev, "Could not allocate bus resource.\n"); + goto fail; + } + + node = ofw_bus_get_node(dev); + sc->reg_shift = 0; + OF_getencprop(node, "reg-shift", &sc->reg_shift, + sizeof(sc->reg_shift)); + + error = clk_get_by_ofw_index(dev, 0, 0, &clock); + if (error) { + device_printf(dev, "Couldn't get clock\n"); + goto fail; + } + error = clk_enable(clock); + if (error) { + device_printf(dev, "Couldn't enable clock\n"); + goto fail1; + } + error = clk_get_freq(clock, &clockfreq); + if (error) { + device_printf(dev, "Couldn't get clock frequency\n"); + goto fail1; + } + if (clockfreq > UINT_MAX) { + device_printf(dev, "Unsupported clock frequency\n"); + goto fail1; + } + sc->clockfreq = (u_int)clockfreq; + sc->i2cfreq = XLP_I2C_FREQ; + iicoc_init(dev); + + sc->iicbus = device_add_child(dev, "iicbus", -1); + if (sc->iicbus == NULL) { + device_printf(dev, "Could not allocate iicbus instance.\n"); + error = ENXIO; + goto fail1; + } + + /* Probe and attach the iicbus when interrupts are available. */ + config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); + + return (0); + +fail1: + clk_disable(clock); + +fail: + bus_release_resources(dev, iicoc_spec, &sc->mem_res); + mtx_destroy(&sc->sc_mtx); + return (error); +} + +static int +iicoc_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, "OpenCores I2C master controller"); + + return (BUS_PROBE_DEFAULT); +} + +static device_method_t iicoc_methods[] = { + /* device interface */ + DEVMETHOD(device_probe, iicoc_probe), + DEVMETHOD(device_attach, iicoc_attach), + + /* ofw interface */ + DEVMETHOD(ofw_bus_get_node, iicoc_get_node), + + /* iicbus interface */ + DEVMETHOD(iicbus_callback, iicbus_null_callback), + DEVMETHOD(iicbus_repeated_start, iicoc_iicbus_repeated_start), + DEVMETHOD(iicbus_start, iicoc_iicbus_start), + DEVMETHOD(iicbus_stop, iicoc_iicbus_stop), + DEVMETHOD(iicbus_reset, iicoc_iicbus_reset), + DEVMETHOD(iicbus_write, iicoc_iicbus_write), + DEVMETHOD(iicbus_read, iicoc_iicbus_read), + DEVMETHOD(iicbus_transfer, iicbus_transfer_gen), + + DEVMETHOD_END +}; + +static driver_t iicoc_driver = { + "iicoc", + iicoc_methods, + sizeof(struct iicoc_softc), +}; + +DRIVER_MODULE(iicoc, simplebus, iicoc_driver, iicoc_devclass, 0, 0); +DRIVER_MODULE(ofw_iicbus, iicoc, ofw_iicbus_driver, ofw_iicbus_devclass, 0, 0); +MODULE_DEPEND(iicoc, iicbus, 1, 1, 1); +MODULE_DEPEND(iicoc, ofw_iicbus, 1, 1, 1); From owner-svn-src-head@freebsd.org Fri Dec 20 03:40:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C76E1CB1ED; Fri, 20 Dec 2019 03:40:54 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47fDzp1rpVz4QjP; Fri, 20 Dec 2019 03:40:54 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A50620CFD; Fri, 20 Dec 2019 03:40:54 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBK3esrp063643; Fri, 20 Dec 2019 03:40:54 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBK3esV1063642; Fri, 20 Dec 2019 03:40:54 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201912200340.xBK3esV1063642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Fri, 20 Dec 2019 03:40:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355925 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: philip X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 355925 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 03:40:54 -0000 Author: philip Date: Fri Dec 20 03:40:53 2019 New Revision: 355925 URL: https://svnweb.freebsd.org/changeset/base/355925 Log: Print upper 32 bits in devmap table entries If the devmap entry uses the upper 32 bits they wouldn't be printed in devmap_dump_table(). This fixes that. Submitted by: Nicholas O'Brien Sponsored by: Axiado Modified: head/sys/kern/subr_devmap.c Modified: head/sys/kern/subr_devmap.c ============================================================================== --- head/sys/kern/subr_devmap.c Fri Dec 20 03:40:50 2019 (r355924) +++ head/sys/kern/subr_devmap.c Fri Dec 20 03:40:53 2019 (r355925) @@ -73,7 +73,7 @@ devmap_dump_table(int (*prfunc)(const char *, ...)) prfunc("Static device mappings:\n"); for (pd = devmap_table; pd->pd_size != 0; ++pd) { - prfunc(" 0x%08x - 0x%08x mapped at VA 0x%08x\n", + prfunc(" 0x%08jx - 0x%08jx mapped at VA 0x%08jx\n", pd->pd_pa, pd->pd_pa + pd->pd_size - 1, pd->pd_va); } } From owner-svn-src-head@freebsd.org Fri Dec 20 05:15:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1DEEE1CD57F; Fri, 20 Dec 2019 05:15:04 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47fH4R6qYHz4Vfq; Fri, 20 Dec 2019 05:15:03 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E138921ECD; Fri, 20 Dec 2019 05:15:03 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBK5F3WQ021811; Fri, 20 Dec 2019 05:15:03 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBK5F3sa021810; Fri, 20 Dec 2019 05:15:03 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201912200515.xBK5F3sa021810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Fri, 20 Dec 2019 05:15:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355926 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: philip X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 355926 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 05:15:04 -0000 Author: philip Date: Fri Dec 20 05:15:03 2019 New Revision: 355926 URL: https://svnweb.freebsd.org/changeset/base/355926 Log: iicoc: fix the build on PCI machines Pointy hat to: philip Modified: head/sys/dev/iicbus/iicoc_pci.c (contents, props changed) Modified: head/sys/dev/iicbus/iicoc_pci.c ============================================================================== --- head/sys/dev/iicbus/iicoc_pci.c Fri Dec 20 03:40:53 2019 (r355925) +++ head/sys/dev/iicbus/iicoc_pci.c Fri Dec 20 05:15:03 2019 (r355926) @@ -55,7 +55,7 @@ iicoc_detach(device_t dev) sc = device_get_softc(dev); device_delete_children(dev); bus_generic_detach(dev); - bus_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, &sc->mem_res); + bus_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, sc->mem_res); mtx_destroy(&sc->sc_mtx); return (0); @@ -89,7 +89,7 @@ iicoc_attach(device_t dev) if (sc->iicbus == NULL) { device_printf(dev, "Could not allocate iicbus instance.\n"); bus_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, - &sc->mem_res); + sc->mem_res); mtx_destroy(&sc->sc_mtx); return (-1); } From owner-svn-src-head@freebsd.org Fri Dec 20 05:30:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46C661CDAA8; Fri, 20 Dec 2019 05:30:25 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47fHQ90ytWz4WG1; Fri, 20 Dec 2019 05:30:25 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from weatherwax.trouble.is (weatherwax.trouble.is [46.235.227.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "weatherwax.trouble.is", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: philip/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 060E44D4F; Fri, 20 Dec 2019 05:30:25 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from rincewind.trouble.is (rincewind.trouble.is [IPv6:2a01:4f9:2a:1715::1:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "rincewind.trouble.is", Issuer "Let's Encrypt Authority X3" (verified OK)) by weatherwax.trouble.is (Postfix) with ESMTPS id 47fHQ755g9z13Qj; Fri, 20 Dec 2019 05:30:23 +0000 (UTC) Received: by rincewind.trouble.is (Postfix, authenticated sender philip) id 47fHQ366WSz43xq; Fri, 20 Dec 2019 05:30:19 +0000 (UTC) From: "Philip Paeps" To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355926 - head/sys/dev/iicbus Date: Fri, 20 Dec 2019 13:30:13 +0800 X-Clacks-Overhead: GNU Terry Pratchett X-Mailer: MailMate (1.13.1r5672) Message-ID: In-Reply-To: <201912200515.xBK5F3sa021810@repo.freebsd.org> References: <201912200515.xBK5F3sa021810@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 05:30:25 -0000 On 2019-12-20 13:15:03 (+0800), Philip Paeps wrote: > Author: philip > Date: Fri Dec 20 05:15:03 2019 > New Revision: 355926 > URL: https://svnweb.freebsd.org/changeset/base/355926 > > Log: > iicoc: fix the build on PCI machines > > Pointy hat to: philip Sorry about that! Philip -- Philip Paeps Senior Reality Engineer Alternative Enterprises From owner-svn-src-head@freebsd.org Fri Dec 20 08:31:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6516F1D27E1; Fri, 20 Dec 2019 08:31:24 +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 47fMR024btz4gD5; Fri, 20 Dec 2019 08:31:24 +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 4277524203; Fri, 20 Dec 2019 08:31:24 +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 xBK8VOVk039722; Fri, 20 Dec 2019 08:31:24 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBK8VOfE039721; Fri, 20 Dec 2019 08:31:24 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201912200831.xBK8VOfE039721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 20 Dec 2019 08:31:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355930 - head/sys/dev/random X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/random X-SVN-Commit-Revision: 355930 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 08:31:24 -0000 Author: cem Date: Fri Dec 20 08:31:23 2019 New Revision: 355930 URL: https://svnweb.freebsd.org/changeset/base/355930 Log: random(4): Fortuna: Enable concurrent generation by default for 13 Flip the knob added in r349154 to "enabled." The commit message from that revision and associated code comment describe the rationale, implementation, and motivation for the new default in detail. I have dog-fooded this configuration on my own systems for six months, for what that's worth. For end-users: the result is just as secure. The benefit is a faster, more responsive system when processes produce significant demand on random(4). As mentioned in the earlier commit, the prior behavior may be restored by setting the kern.random.fortuna.concurrent_read="0" knob in loader.conf(5). This scales the random generation side of random(4) somewhat, although there is still a global mutex being shared by all cores and rand_harvestq; the situation is generally much better than it was before on small CPU systems, but do not expect miracles on 256-core systems running 256-thread full-rate random(4) read. Work is ongoing to address both the generation-side (in more depth) and the harvest-side scaling problems. Approved by: csprng(delphij, markm) Tested by: markm Differential Revision: https://reviews.freebsd.org/D22879 Modified: head/sys/dev/random/fortuna.c Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Fri Dec 20 08:15:55 2019 (r355929) +++ head/sys/dev/random/fortuna.c Fri Dec 20 08:31:23 2019 (r355930) @@ -125,14 +125,14 @@ static struct fortuna_state { } fortuna_state; /* - * This knob enables or disables Concurrent Reads. The plan is to turn it on - * by default sometime before 13.0 branches. + * This knob enables or disables the "Concurrent Reads" Fortuna feature. * - * The benefit is improved concurrency in Fortuna. That is reflected in two - * related aspects: + * The benefit of Concurrent Reads is improved concurrency in Fortuna. That is + * reflected in two related aspects: * - * 1. Concurrent devrandom readers can achieve similar throughput to a single - * reader thread. + * 1. Concurrent full-rate devrandom readers can achieve similar throughput to + * a single reader thread (at least up to a modest number of cores; the + * non-concurrent design falls over at 2 readers). * * 2. The rand_harvestq process spends much less time spinning when one or more * readers is processing a large request. Partially this is due to @@ -142,16 +142,20 @@ static struct fortuna_state { * mutexes assume that a lock holder currently on CPU will release the lock * quickly, and spin if the owning thread is currently running. * + * (There is no reason rand_harvestq necessarily has to use the same lock as + * the generator, or that it must necessarily drop and retake locks + * repeatedly, but that is the current status quo.) + * * The concern is that the reduced lock scope might results in a less safe * random(4) design. However, the reduced-lock scope design is still * fundamentally Fortuna. This is discussed below. * * Fortuna Read() only needs mutual exclusion between readers to correctly - * update the shared read-side state: just C, the 128-bit counter, and K, the - * current cipher key. + * update the shared read-side state: C, the 128-bit counter; and K, the + * current cipher/PRF key. * * In the Fortuna design, the global counter C should provide an independent - * range of values per generator (CTR-mode cipher or similar) invocation. + * range of values per request. * * Under lock, we can save a copy of C on the stack, and increment the global C * by the number of blocks a Read request will require. @@ -159,7 +163,7 @@ static struct fortuna_state { * Still under lock, we can save a copy of the key K on the stack, and then * perform the usual key erasure K' <- Keystream(C, K, ...). This does require * generating 256 bits (32 bytes) of cryptographic keystream output with the - * global lock held, but that's all; none of the user keystream generation must + * global lock held, but that's all; none of the API keystream generation must * be performed under lock. * * At this point, we may unlock. @@ -210,7 +214,7 @@ static struct fortuna_state { * 2: <- GenBytes() * 2:Unlock() * - * Just prior to unlock, shared state is still identical: + * Just prior to unlock, global state is identical: * ------------------------------------------------------ * * C'''' == (C_0 + N + 1) + M + 1 C'''' == (C_0 + N + 1) + M + 1 @@ -243,7 +247,7 @@ static struct fortuna_state { * * (stack_C == C_0; stack_K == K_0; stack_C' == C''; stack_K' == K'.) */ -static bool fortuna_concurrent_read __read_frequently = false; +static bool fortuna_concurrent_read __read_frequently = true; #ifdef _KERNEL static struct sysctl_ctx_list random_clist; From owner-svn-src-head@freebsd.org Fri Dec 20 15:25:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E7F21DC1DA; Fri, 20 Dec 2019 15:25:09 +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 47fXcP1Kw6z44SJ; Fri, 20 Dec 2019 15:25:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24A2FBAD; Fri, 20 Dec 2019 15:25:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBKFP8VL084314; Fri, 20 Dec 2019 15:25:08 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBKFP8nX084311; Fri, 20 Dec 2019 15:25:08 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201912201525.xBKFP8nX084311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 20 Dec 2019 15:25:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355931 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 355931 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 15:25:09 -0000 Author: tuexen Date: Fri Dec 20 15:25:08 2019 New Revision: 355931 URL: https://svnweb.freebsd.org/changeset/base/355931 Log: Improve input validation for some parameters having a too small reported length. Thanks to Natalie Silvanovich from Google for finding one of these issues in the SCTP userland stack and reporting it. MFC after: 1 week Modified: head/sys/netinet/sctp_auth.c head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_auth.c ============================================================================== --- head/sys/netinet/sctp_auth.c Fri Dec 20 08:31:23 2019 (r355930) +++ head/sys/netinet/sctp_auth.c Fri Dec 20 15:25:08 2019 (r355931) @@ -1397,7 +1397,8 @@ sctp_auth_get_cookie_params(struct sctp_tcb *stcb, str ptype = ntohs(phdr->param_type); plen = ntohs(phdr->param_length); - if ((plen == 0) || (offset + plen > length)) + if ((plen < sizeof(struct sctp_paramhdr)) || + (offset + plen > length)) break; if (ptype == SCTP_RANDOM) { Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Fri Dec 20 08:31:23 2019 (r355930) +++ head/sys/netinet/sctp_pcb.c Fri Dec 20 15:25:08 2019 (r355931) @@ -6202,7 +6202,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s if (offset + plen > limit) { break; } - if (plen == 0) { + if (plen < sizeof(struct sctp_paramhdr)) { break; } #ifdef INET @@ -6427,6 +6427,9 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s } if (plen > sizeof(lstore)) { return (-23); + } + if (plen < sizeof(struct sctp_asconf_addrv4_param)) { + return (-101); } phdr = sctp_get_next_param(m, offset, (struct sctp_paramhdr *)&lstore, From owner-svn-src-head@freebsd.org Fri Dec 20 15:28:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4CB8B1DC398; Fri, 20 Dec 2019 15:28:41 +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 47fXhT1Hrrz44h6; Fri, 20 Dec 2019 15:28:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2342CBB0; Fri, 20 Dec 2019 15:28:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBKFSe9a084512; Fri, 20 Dec 2019 15:28:40 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBKFSevD084511; Fri, 20 Dec 2019 15:28:40 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912201528.xBKFSevD084511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 20 Dec 2019 15:28:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355932 - head/sys/arm/versatile X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/versatile X-SVN-Commit-Revision: 355932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 15:28:41 -0000 Author: kevans Date: Fri Dec 20 15:28:40 2019 New Revision: 355932 URL: https://svnweb.freebsd.org/changeset/base/355932 Log: VERSATILEPB: Unbreak after r355796 r355796 provided genkbd_get_fkeystr/genkbd_diag private and the default for get_fkeystr/diag if these members are NULL. Follow suit here. Modified: head/sys/arm/versatile/pl050.c Modified: head/sys/arm/versatile/pl050.c ============================================================================== --- head/sys/arm/versatile/pl050.c Fri Dec 20 15:25:08 2019 (r355931) +++ head/sys/arm/versatile/pl050.c Fri Dec 20 15:28:40 2019 (r355932) @@ -578,9 +578,7 @@ static keyboard_switch_t kmisw = { .clear_state = &kmi_clear_state, .get_state = &kmi_get_state, .set_state = &kmi_set_state, - .get_fkeystr = &genkbd_get_fkeystr, .poll = &kmi_poll, - .diag = &genkbd_diag, }; KEYBOARD_DRIVER(kmi, kmisw, kmi_configure); From owner-svn-src-head@freebsd.org Fri Dec 20 16:20:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E770F1DD610; Fri, 20 Dec 2019 16:20:38 +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 47fYrQ5t7pz47Fg; Fri, 20 Dec 2019 16:20:38 +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 C51BD14A0; Fri, 20 Dec 2019 16:20:38 +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 xBKGKccX014688; Fri, 20 Dec 2019 16:20:38 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBKGKciY014687; Fri, 20 Dec 2019 16:20:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912201620.xBKGKciY014687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 20 Dec 2019 16:20:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355935 - head/sys/dev/vt X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/vt X-SVN-Commit-Revision: 355935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 16:20:39 -0000 Author: kevans Date: Fri Dec 20 16:20:38 2019 New Revision: 355935 URL: https://svnweb.freebsd.org/changeset/base/355935 Log: vt: fix post-boot keyboard attachment With absolutely no keyboards attached and no kbdmux in kernel, we descend down this error path. 0 is a valid keyboard index, so leaving vd->vd_keyboard at 0 when there's no keyboard found is objectively wrong as later attachment of a keyboard will fail -- it gets index 0, and vt thinks it's already using that keyboard. This is decidedly the corniest of corner cases, but it's easy enough to get correct that we should do so. Tested in a kernel without atkbdc, atkbd, psm, kbdmux, ukbd, hyperv then loading ukbd post-boot and attaching a usb keyboard. Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Fri Dec 20 16:05:29 2019 (r355934) +++ head/sys/dev/vt/vt_core.c Fri Dec 20 16:20:38 2019 (r355935) @@ -1039,6 +1039,13 @@ vt_allocate_keyboard(struct vt_device *vd) DPRINTF(20, "%s: no kbdmux allocated\n", __func__); idx0 = kbd_allocate("*", -1, vd, vt_kbdevent, vd); if (idx0 < 0) { + /* + * We don't have a keyboard yet, so we must invalidate + * vd->vd_keyboard so that later keyboard attachment can + * succeed. Any value >= 0 can accidentally match a + * keyboard. + */ + vd->vd_keyboard = -1; DPRINTF(10, "%s: No keyboard found.\n", __func__); return (-1); } From owner-svn-src-head@freebsd.org Fri Dec 20 16:22:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 167361DD7F6; Fri, 20 Dec 2019 16:22:16 +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 47fYtH6r2hz47cL; Fri, 20 Dec 2019 16:22:15 +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 E54A11532; Fri, 20 Dec 2019 16:22:15 +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 xBKGMF50019522; Fri, 20 Dec 2019 16:22:15 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBKGMEdl019516; Fri, 20 Dec 2019 16:22:14 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912201622.xBKGMEdl019516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 20 Dec 2019 16:22:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355936 - in head/sys: arm/broadcom/bcm2835 arm/freescale/imx arm/ti/am335x arm/versatile powerpc/ofw X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: arm/broadcom/bcm2835 arm/freescale/imx arm/ti/am335x arm/versatile powerpc/ofw X-SVN-Commit-Revision: 355936 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 16:22:16 -0000 Author: kevans Date: Fri Dec 20 16:22:14 2019 New Revision: 355936 URL: https://svnweb.freebsd.org/changeset/base/355936 Log: Kill off dummy kbd drivers As far as I can tell, these are an artifact of times when linker sets couldn't be empty, otherwise the kernel build would fail due to unresolved symbols. hselasky fixed this in r268138, and I've audited the kbd portions to make sure nothing would blow up due to the empty linker set and successfully compiled+ran a kernel with no keyboard support at all. Kill them off now since they're no longer required. MFC after: 1 week Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c head/sys/arm/freescale/imx/imx51_ipuv3.c head/sys/arm/ti/am335x/am335x_lcd_syscons.c head/sys/arm/versatile/versatile_clcd.c head/sys/powerpc/ofw/ofw_syscons.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Fri Dec 20 16:20:38 2019 (r355935) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Fri Dec 20 16:22:14 2019 (r355936) @@ -850,22 +850,3 @@ bcmfb_putm(video_adapter_t *adp, int x, int y, uint8_t return (0); } - -/* - * Define a stub keyboard driver in case one hasn't been - * compiled into the kernel - */ -#include -#include - -static int dummy_kbd_configure(int flags); - -keyboard_switch_t bcmdummysw; - -static int -dummy_kbd_configure(int flags) -{ - - return (0); -} -KEYBOARD_DRIVER(bcmdummy, bcmdummysw, dummy_kbd_configure); Modified: head/sys/arm/freescale/imx/imx51_ipuv3.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_ipuv3.c Fri Dec 20 16:20:38 2019 (r355935) +++ head/sys/arm/freescale/imx/imx51_ipuv3.c Fri Dec 20 16:22:14 2019 (r355936) @@ -878,22 +878,3 @@ ipu3fb_putm(video_adapter_t *adp, int x, int y, uint8_ return (0); } - -/* - * Define a stub keyboard driver in case one hasn't been - * compiled into the kernel - */ -#include -#include - -static int dummy_kbd_configure(int flags); - -keyboard_switch_t ipu3dummysw; - -static int -dummy_kbd_configure(int flags) -{ - - return (0); -} -KEYBOARD_DRIVER(ipu3dummy, ipu3dummysw, dummy_kbd_configure); Modified: head/sys/arm/ti/am335x/am335x_lcd_syscons.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_lcd_syscons.c Fri Dec 20 16:20:38 2019 (r355935) +++ head/sys/arm/ti/am335x/am335x_lcd_syscons.c Fri Dec 20 16:22:14 2019 (r355936) @@ -770,22 +770,3 @@ int am335x_lcd_syscons_setup(vm_offset_t vaddr, vm_pad return (0); } - -/* - * Define a stub keyboard driver in case one hasn't been - * compiled into the kernel - */ -#include -#include - -static int dummy_kbd_configure(int flags); - -keyboard_switch_t am335x_dummysw; - -static int -dummy_kbd_configure(int flags) -{ - - return (0); -} -KEYBOARD_DRIVER(am335x_dummy, am335x_dummysw, dummy_kbd_configure); Modified: head/sys/arm/versatile/versatile_clcd.c ============================================================================== --- head/sys/arm/versatile/versatile_clcd.c Fri Dec 20 16:20:38 2019 (r355935) +++ head/sys/arm/versatile/versatile_clcd.c Fri Dec 20 16:22:14 2019 (r355936) @@ -920,22 +920,3 @@ versatilefb_putm(video_adapter_t *adp, int x, int y, u return (0); } - -/* - * Define a stub keyboard driver in case one hasn't been - * compiled into the kernel - */ -#include -#include - -static int dummy_kbd_configure(int flags); - -keyboard_switch_t bcmdummysw; - -static int -dummy_kbd_configure(int flags) -{ - - return (0); -} -KEYBOARD_DRIVER(bcmdummy, bcmdummysw, dummy_kbd_configure); Modified: head/sys/powerpc/ofw/ofw_syscons.c ============================================================================== --- head/sys/powerpc/ofw/ofw_syscons.c Fri Dec 20 16:20:38 2019 (r355935) +++ head/sys/powerpc/ofw/ofw_syscons.c Fri Dec 20 16:22:14 2019 (r355936) @@ -1049,25 +1049,6 @@ static devclass_t sc_devclass; DRIVER_MODULE(ofwfb, nexus, ofwfb_sc_driver, sc_devclass, 0, 0); /* - * Define a stub keyboard driver in case one hasn't been - * compiled into the kernel - */ -#include -#include - -static int dummy_kbd_configure(int flags); - -keyboard_switch_t dummysw; - -static int -dummy_kbd_configure(int flags) -{ - - return (0); -} -KEYBOARD_DRIVER(dummy, dummysw, dummy_kbd_configure); - -/* * Utility routines from */ void From owner-svn-src-head@freebsd.org Fri Dec 20 17:15:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 89D721DED56; Fri, 20 Dec 2019 17:15:10 +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 47fb3L36Rvz4BYv; Fri, 20 Dec 2019 17:15:10 +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 61BFE1F90; Fri, 20 Dec 2019 17:15:10 +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 xBKHFAEM049329; Fri, 20 Dec 2019 17:15:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBKHFAfd049327; Fri, 20 Dec 2019 17:15:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201912201715.xBKHFAfd049327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 20 Dec 2019 17:15:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355937 - head/sys/dev/vt X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/vt X-SVN-Commit-Revision: 355937 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 17:15:10 -0000 Author: kevans Date: Fri Dec 20 17:15:09 2019 New Revision: 355937 URL: https://svnweb.freebsd.org/changeset/base/355937 Log: vt: store a pointer to the keyboard instead of index This effectively reverts r355935, but is functionally equivalent. We gain no benefit from storing the index and repeatedly fetching the keyboard with `kbd_get_keyboard` when we need it. We'll be notified when it's going away so we can clean up the pointer. All existing references were trivially converted. Only once instance actually needed the index. Modified: head/sys/dev/vt/vt.h head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Fri Dec 20 16:22:14 2019 (r355936) +++ head/sys/dev/vt/vt.h Fri Dec 20 17:15:09 2019 (r355937) @@ -158,7 +158,7 @@ struct vt_device { #define VDF_QUIET_BELL 0x80 /* Disable bell. */ #define VDF_SUSPENDED 0x100 /* Device has been suspended. */ #define VDF_DOWNGRADE 0x8000 /* The driver is being downgraded. */ - int vd_keyboard; /* (G) Keyboard index. */ + struct keyboard *vd_keyboard; /* (G) Keyboard. */ unsigned int vd_kbstate; /* (?) Device unit. */ unsigned int vd_unit; /* (c) Device unit. */ int vd_altbrk; /* (?) Alt break seq. state */ Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Fri Dec 20 16:22:14 2019 (r355936) +++ head/sys/dev/vt/vt_core.c Fri Dec 20 17:15:09 2019 (r355937) @@ -605,8 +605,7 @@ vt_window_switch(struct vt_window *vw) /* Restore per-window keyboard mode. */ mtx_lock(&Giant); - kbd = kbd_get_keyboard(vd->vd_keyboard); - if (kbd != NULL) { + if ((kbd = vd->vd_keyboard) != NULL) { if (curvw->vw_kbdmode == K_XLATE) vt_save_kbd_state(curvw, kbd); @@ -982,7 +981,7 @@ vt_kbdevent(keyboard_t *kbd, int event, void *arg) break; case KBDIO_UNLOADING: mtx_lock(&Giant); - vd->vd_keyboard = -1; + vd->vd_keyboard = NULL; kbd_release(kbd, (void *)vd); mtx_unlock(&Giant); return (0); @@ -1039,19 +1038,14 @@ vt_allocate_keyboard(struct vt_device *vd) DPRINTF(20, "%s: no kbdmux allocated\n", __func__); idx0 = kbd_allocate("*", -1, vd, vt_kbdevent, vd); if (idx0 < 0) { - /* - * We don't have a keyboard yet, so we must invalidate - * vd->vd_keyboard so that later keyboard attachment can - * succeed. Any value >= 0 can accidentally match a - * keyboard. - */ - vd->vd_keyboard = -1; DPRINTF(10, "%s: No keyboard found.\n", __func__); return (-1); } + k0 = kbd_get_keyboard(idx0); } - vd->vd_keyboard = idx0; - DPRINTF(20, "%s: vd_keyboard = %d\n", __func__, vd->vd_keyboard); + vd->vd_keyboard = k0; + DPRINTF(20, "%s: vd_keyboard = %d\n", __func__, + vd->vd_keyboard->kb_index); if (vd->vd_curwindow == &vt_conswindow) { for (i = 0; i < grabbed; ++i) @@ -1540,8 +1534,7 @@ vtterm_cngetc(struct terminal *tm) } /* Stripped down keyboard handler. */ - kbd = kbd_get_keyboard(vd->vd_keyboard); - if (kbd == NULL) + if ((kbd = vd->vd_keyboard) == NULL) return (-1); /* Force keyboard input mode to K_XLATE */ @@ -1617,8 +1610,7 @@ vtterm_cngrab(struct terminal *tm) if (!cold) vt_window_switch(vw); - kbd = kbd_get_keyboard(vd->vd_keyboard); - if (kbd == NULL) + if ((kbd = vd->vd_keyboard) == NULL) return; if (vw->vw_grabbed++ > 0) @@ -1648,8 +1640,7 @@ vtterm_cnungrab(struct terminal *tm) vw = tm->tm_softc; vd = vw->vw_device; - kbd = kbd_get_keyboard(vd->vd_keyboard); - if (kbd == NULL) + if ((kbd = vd->vd_keyboard) == NULL) return; if (--vw->vw_grabbed > 0) @@ -2189,8 +2180,7 @@ skip_thunk: error = 0; mtx_lock(&Giant); - kbd = kbd_get_keyboard(vd->vd_keyboard); - if (kbd != NULL) + if ((kbd = vd->vd_keyboard) != NULL) error = kbdd_ioctl(kbd, cmd, data); mtx_unlock(&Giant); if (error == ENOIOCTL) { @@ -2208,8 +2198,7 @@ skip_thunk: if (vw == vd->vd_curwindow) { mtx_lock(&Giant); - kbd = kbd_get_keyboard(vd->vd_keyboard); - if (kbd != NULL) + if ((kbd = vd->vd_keyboard) != NULL) error = vt_save_kbd_state(vw, kbd); mtx_unlock(&Giant); @@ -2234,8 +2223,7 @@ skip_thunk: error = 0; if (vw == vd->vd_curwindow) { mtx_lock(&Giant); - kbd = kbd_get_keyboard(vd->vd_keyboard); - if (kbd != NULL) + if ((kbd = vd->vd_keyboard) != NULL) error = vt_update_kbd_state(vw, kbd); mtx_unlock(&Giant); } @@ -2247,8 +2235,7 @@ skip_thunk: if (vw == vd->vd_curwindow) { mtx_lock(&Giant); - kbd = kbd_get_keyboard(vd->vd_keyboard); - if (kbd != NULL) + if ((kbd = vd->vd_keyboard) != NULL) error = vt_save_kbd_leds(vw, kbd); mtx_unlock(&Giant); @@ -2273,8 +2260,7 @@ skip_thunk: error = 0; if (vw == vd->vd_curwindow) { mtx_lock(&Giant); - kbd = kbd_get_keyboard(vd->vd_keyboard); - if (kbd != NULL) + if ((kbd = vd->vd_keyboard) != NULL) error = vt_update_kbd_leds(vw, kbd); mtx_unlock(&Giant); } @@ -2290,8 +2276,7 @@ skip_thunk: if (vw == vd->vd_curwindow) { mtx_lock(&Giant); - kbd = kbd_get_keyboard(vd->vd_keyboard); - if (kbd != NULL) + if ((kbd = vd->vd_keyboard) != NULL) error = vt_save_kbd_mode(vw, kbd); mtx_unlock(&Giant); @@ -2316,8 +2301,7 @@ skip_thunk: error = 0; if (vw == vd->vd_curwindow) { mtx_lock(&Giant); - kbd = kbd_get_keyboard(vd->vd_keyboard); - if (kbd != NULL) + if ((kbd = vd->vd_keyboard) != NULL) error = vt_update_kbd_mode(vw, kbd); mtx_unlock(&Giant); } @@ -2362,8 +2346,7 @@ skip_thunk: if (vw == vd->vd_curwindow) { mtx_lock(&Giant); - kbd = kbd_get_keyboard(vd->vd_keyboard); - if (kbd != NULL) + if ((kbd = vd->vd_keyboard) != NULL) vt_save_kbd_state(vw, kbd); mtx_unlock(&Giant); } @@ -2482,7 +2465,8 @@ skip_thunk: case CONS_SETKBD: /* set the new keyboard */ mtx_lock(&Giant); error = 0; - if (vd->vd_keyboard != *(int *)data) { + if (vd->vd_keyboard == NULL || + vd->vd_keyboard->kb_index != *(int *)data) { kbd = kbd_get_keyboard(*(int *)data); if (kbd == NULL) { mtx_unlock(&Giant); @@ -2491,13 +2475,11 @@ skip_thunk: i = kbd_allocate(kbd->kb_name, kbd->kb_unit, (void *)vd, vt_kbdevent, vd); if (i >= 0) { - if (vd->vd_keyboard != -1) { - kbd = kbd_get_keyboard(vd->vd_keyboard); + if ((kbd = vd->vd_keyboard) != NULL) { vt_save_kbd_state(vd->vd_curwindow, kbd); kbd_release(kbd, (void *)vd); } - kbd = kbd_get_keyboard(i); - vd->vd_keyboard = i; + kbd = vd->vd_keyboard = kbd_get_keyboard(i); vt_update_kbd_mode(vd->vd_curwindow, kbd); vt_update_kbd_state(vd->vd_curwindow, kbd); @@ -2510,16 +2492,11 @@ skip_thunk: case CONS_RELKBD: /* release the current keyboard */ mtx_lock(&Giant); error = 0; - if (vd->vd_keyboard != -1) { - kbd = kbd_get_keyboard(vd->vd_keyboard); - if (kbd == NULL) { - mtx_unlock(&Giant); - return (EINVAL); - } + if ((kbd = vd->vd_keyboard) != NULL) { vt_save_kbd_state(vd->vd_curwindow, kbd); error = kbd_release(kbd, (void *)vd); if (error == 0) { - vd->vd_keyboard = -1; + vd->vd_keyboard = NULL; } } mtx_unlock(&Giant); From owner-svn-src-head@freebsd.org Fri Dec 20 17:21:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 560711DEF84; Fri, 20 Dec 2019 17:21:58 +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 47fbCB1hJPz4C5Z; Fri, 20 Dec 2019 17:21:58 +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 3548F212F; Fri, 20 Dec 2019 17:21:58 +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 xBKHLwDd051959; Fri, 20 Dec 2019 17:21:58 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBKHLwkv051958; Fri, 20 Dec 2019 17:21:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201912201721.xBKHLwkv051958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 20 Dec 2019 17:21:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355938 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 355938 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 17:21:58 -0000 Author: markj Date: Fri Dec 20 17:21:57 2019 New Revision: 355938 URL: https://svnweb.freebsd.org/changeset/base/355938 Log: Fix a memory leak in if_delgroups() introduced in r334118. PR: 242712 Submitted by: ghuckriede@blackberry.com MFC after: 3 days Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Fri Dec 20 17:15:09 2019 (r355937) +++ head/sys/net/if.c Fri Dec 20 17:21:57 2019 (r355938) @@ -1597,6 +1597,7 @@ if_delgroups(struct ifnet *ifp) ifgl->ifgl_group); free(ifgl->ifgl_group, M_TEMP); } + free(ifgl, M_TEMP); EVENTHANDLER_INVOKE(group_change_event, groupname); IFNET_WLOCK(); From owner-svn-src-head@freebsd.org Fri Dec 20 19:53:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA77A1E1D75; Fri, 20 Dec 2019 19:53:18 +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 47ffYp4Yd6z4Kcn; Fri, 20 Dec 2019 19:53:18 +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 7EB613FA1; Fri, 20 Dec 2019 19:53:18 +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 xBKJrINs043524; Fri, 20 Dec 2019 19:53:18 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBKJr5B7043461; Fri, 20 Dec 2019 19:53:05 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201912201953.xBKJr5B7043461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 20 Dec 2019 19:53:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355940 - in head: . contrib/compiler-rt contrib/libc++ contrib/libunwind contrib/llvm contrib/llvm-project/clang contrib/llvm-project/compiler-rt contrib/llvm-project/libcxx contrib/ll... X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: . contrib/compiler-rt contrib/libc++ contrib/libunwind contrib/llvm contrib/llvm-project/clang contrib/llvm-project/compiler-rt contrib/llvm-project/libcxx contrib/llvm-project/libunwind cont... X-SVN-Commit-Revision: 355940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 19:53:18 -0000 Author: dim Date: Fri Dec 20 19:53:05 2019 New Revision: 355940 URL: https://svnweb.freebsd.org/changeset/base/355940 Log: Move all sources from the llvm project into contrib/llvm-project. This uses the new layout of the upstream repository, which was recently migrated to GitHub, and converted into a "monorepo". That is, most of the earlier separate sub-projects with their own branches and tags were consolidated into one top-level directory, and are now branched and tagged together. Updating the vendor area to match this layout is next. Added: - copied from r355939, vendor/llvm-project/master/ head/contrib/llvm-project/clang/ - copied from r355939, head/contrib/llvm/tools/clang/ head/contrib/llvm-project/compiler-rt/ - copied from r355939, head/contrib/compiler-rt/ head/contrib/llvm-project/libcxx/ - copied from r355939, head/contrib/libc++/ head/contrib/llvm-project/libunwind/ - copied from r355939, head/contrib/libunwind/ head/contrib/llvm-project/lld/ - copied from r355939, head/contrib/llvm/tools/lld/ head/contrib/llvm-project/lldb/ - copied from r355939, head/contrib/llvm/tools/lldb/ head/contrib/llvm-project/llvm/ - copied from r355939, head/contrib/llvm/ head/contrib/llvm-project/openmp/ - copied from r355939, head/contrib/openmp/ Directory Properties: head/contrib/llvm-project/ (props changed) Deleted: head/contrib/compiler-rt/ head/contrib/libc++/ head/contrib/libunwind/ head/contrib/llvm/ head/contrib/llvm-project/llvm/tools/clang/ head/contrib/llvm-project/llvm/tools/lld/ head/contrib/llvm-project/llvm/tools/lldb/ head/contrib/openmp/ Modified: head/MAINTAINERS head/gnu/usr.bin/cc/include/Makefile head/lib/clang/clang.build.mk head/lib/clang/clang.pre.mk head/lib/clang/libclang/Makefile head/lib/clang/liblldb/Makefile head/lib/clang/libllvm/Makefile head/lib/clang/libllvmminimal/Makefile head/lib/clang/lldb.pre.mk head/lib/clang/llvm.build.mk head/lib/clang/llvm.pre.mk head/lib/libblocksruntime/Makefile head/lib/libc++/Makefile head/lib/libc++experimental/Makefile head/lib/libc/arm/aeabi/Makefile.inc head/lib/libclang_rt/Makefile.inc head/lib/libcompiler_rt/Makefile.inc head/lib/libexecinfo/Makefile head/lib/libgcc_eh/Makefile.inc head/lib/libomp/Makefile head/share/doc/llvm/Makefile head/share/doc/llvm/clang/Makefile head/share/mk/bsd.clang-analyze.mk head/stand/i386/boot2/Makefile head/stand/libsa/Makefile head/sys/modules/aesni/Makefile head/sys/modules/blake2/Makefile head/usr.bin/clang/bugpoint/Makefile head/usr.bin/clang/clang-format/Makefile head/usr.bin/clang/clang-tblgen/Makefile head/usr.bin/clang/clang/Makefile head/usr.bin/clang/llc/Makefile head/usr.bin/clang/lld/Makefile head/usr.bin/clang/lldb-tblgen/Makefile head/usr.bin/clang/lldb/Makefile head/usr.bin/clang/lli/Makefile head/usr.bin/clang/llvm-ar/Makefile head/usr.bin/clang/llvm-as/Makefile head/usr.bin/clang/llvm-bcanalyzer/Makefile head/usr.bin/clang/llvm-cov/Makefile head/usr.bin/clang/llvm-cxxdump/Makefile head/usr.bin/clang/llvm-cxxfilt/Makefile head/usr.bin/clang/llvm-diff/Makefile head/usr.bin/clang/llvm-dis/Makefile head/usr.bin/clang/llvm-dwarfdump/Makefile head/usr.bin/clang/llvm-extract/Makefile head/usr.bin/clang/llvm-link/Makefile head/usr.bin/clang/llvm-lto/Makefile head/usr.bin/clang/llvm-lto2/Makefile head/usr.bin/clang/llvm-mc/Makefile head/usr.bin/clang/llvm-mca/Makefile head/usr.bin/clang/llvm-modextract/Makefile head/usr.bin/clang/llvm-nm/Makefile head/usr.bin/clang/llvm-objcopy/Makefile head/usr.bin/clang/llvm-objdump/Makefile head/usr.bin/clang/llvm-pdbutil/Makefile head/usr.bin/clang/llvm-profdata/Makefile head/usr.bin/clang/llvm-rtdyld/Makefile head/usr.bin/clang/llvm-symbolizer/Makefile head/usr.bin/clang/llvm-tblgen/Makefile head/usr.bin/clang/llvm-xray/Makefile head/usr.bin/clang/opt/Makefile Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Fri Dec 20 18:23:50 2019 (r355939) +++ head/MAINTAINERS Fri Dec 20 19:53:05 2019 (r355940) @@ -38,14 +38,15 @@ subsystem login notes ath(4) adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org contrib/atf ngie,#test Pre-commit review requested. contrib/capsicum-test ngie,#capsicum,#test Pre-commit review requested. -contrib/compiler-rt dim Pre-commit review preferred. contrib/googletest ngie,#test Pre-commit review requested. -contrib/ipfilter cy Pre-commit review requested. -contrib/libc++ dim Pre-commit review preferred. -contrib/libcxxrt dim Pre-commit review preferred. -contrib/libunwind dim,emaste,jhb Pre-commit review preferred. -contrib/llvm dim Pre-commit review preferred. -contrib/llvm/tools/lldb dim,emaste Pre-commit review preferred. +contrib/ipfilter cy Pre-commit review requested. +contrib/libcxxrt dim,emaste Pre-commit review preferred. +contrib/llvm-project/compiler-rt dim Pre-commit review preferred. +contrib/llvm-project/libcxx dim Pre-commit review preferred. +contrib/llvm-project/libunwind dim,emaste,jhb Pre-commit review preferred. +contrib/llvm-project/lldb dim,emaste Pre-commit review preferred. +contrib/llvm-project/llvm dim Pre-commit review preferred. +contrib/llvm-project/openmp dim,emaste Pre-commit review preferred. contrib/netbsd-tests ngie,#test Pre-commit review requested. contrib/pjdfstest asomers,ngie,pjd,#test Pre-commit review requested. *env(3) secteam Due to the problematic security history of this Modified: head/gnu/usr.bin/cc/include/Makefile ============================================================================== --- head/gnu/usr.bin/cc/include/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/gnu/usr.bin/cc/include/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -6,7 +6,7 @@ INCSDIR=${INCLUDEDIR}/gcc/${GCCVER} -.PATH: ${GCCDIR}/config/${GCC_CPU} ${SRCTOP}/contrib/llvm/tools/clang/lib/Headers +.PATH: ${GCCDIR}/config/${GCC_CPU} ${SRCTOP}/contrib/llvm-project/clang/lib/Headers .if ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "amd64" INCS= ammintrin.h emmintrin.h mmintrin.h mm3dnow.h pmmintrin.h \ Modified: head/lib/clang/clang.build.mk ============================================================================== --- head/lib/clang/clang.build.mk Fri Dec 20 18:23:50 2019 (r355939) +++ head/lib/clang/clang.build.mk Fri Dec 20 19:53:05 2019 (r355940) @@ -2,16 +2,8 @@ .include -.ifndef LLVM_SRCS -.error Please define LLVM_SRCS before including this file -.endif - .ifndef CLANG_SRCS .error Please define CLANG_SRCS before including this file -.endif - -.ifndef SRCDIR -.error Please define SRCDIR before including this file .endif CFLAGS+= -I${CLANG_SRCS}/include Modified: head/lib/clang/clang.pre.mk ============================================================================== --- head/lib/clang/clang.pre.mk Fri Dec 20 18:23:50 2019 (r355939) +++ head/lib/clang/clang.pre.mk Fri Dec 20 19:53:05 2019 (r355940) @@ -2,6 +2,6 @@ .include "llvm.pre.mk" -CLANG_SRCS= ${LLVM_SRCS}/tools/clang +CLANG_SRCS= ${LLVM_BASE}/clang CLANG_TBLGEN?= clang-tblgen Modified: head/lib/clang/libclang/Makefile ============================================================================== --- head/lib/clang/libclang/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/lib/clang/libclang/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -18,7 +18,7 @@ CFLAGS.Targets.cpp+= -include ../freebsd_cc_version.h CXXFLAGS.Module.cpp+= -fpermissive .endif -SRCDIR= tools/clang/lib +SRCDIR= clang/lib # Explanation of different SRCS variants below: # SRCS_MIN: always required, even for bootstrap Modified: head/lib/clang/liblldb/Makefile ============================================================================== --- head/lib/clang/liblldb/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/lib/clang/liblldb/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -3,7 +3,7 @@ .include "../lldb.pre.mk" LIB= lldb -SRCDIR= tools/lldb/source +SRCDIR= lldb/source CFLAGS+= -I${LLDB_SRCS}/include CFLAGS+= -I${LLDB_SRCS}/source Modified: head/lib/clang/libllvm/Makefile ============================================================================== --- head/lib/clang/libllvm/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/lib/clang/libllvm/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -24,7 +24,7 @@ CFLAGS+= -I${LLVM_SRCS}/lib/Target/${arch} . endif .endfor -SRCDIR= lib +SRCDIR= llvm/lib # Explanation of different SRCS variants below: # SRCS_MIN: always required, even for bootstrap Modified: head/lib/clang/libllvmminimal/Makefile ============================================================================== --- head/lib/clang/libllvmminimal/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/lib/clang/libllvmminimal/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -5,7 +5,7 @@ LIB= llvmminimal INTERNALLIB= -SRCDIR= lib +SRCDIR= llvm/lib SRCS+= Demangle/ItaniumDemangle.cpp SRCS+= Support/APFloat.cpp SRCS+= Support/APInt.cpp Modified: head/lib/clang/lldb.pre.mk ============================================================================== --- head/lib/clang/lldb.pre.mk Fri Dec 20 18:23:50 2019 (r355939) +++ head/lib/clang/lldb.pre.mk Fri Dec 20 19:53:05 2019 (r355940) @@ -2,4 +2,4 @@ .include "clang.pre.mk" -LLDB_SRCS= ${LLVM_SRCS}/tools/lldb +LLDB_SRCS= ${LLVM_BASE}/lldb Modified: head/lib/clang/llvm.build.mk ============================================================================== --- head/lib/clang/llvm.build.mk Fri Dec 20 18:23:50 2019 (r355939) +++ head/lib/clang/llvm.build.mk Fri Dec 20 19:53:05 2019 (r355940) @@ -2,6 +2,10 @@ .include +.ifndef LLVM_BASE +.error Please define LLVM_BASE before including this file +.endif + .ifndef LLVM_SRCS .error Please define LLVM_SRCS before including this file .endif @@ -10,7 +14,7 @@ .error Please define SRCDIR before including this file .endif -.PATH: ${LLVM_SRCS}/${SRCDIR} +.PATH: ${LLVM_BASE}/${SRCDIR} CFLAGS+= -I${SRCTOP}/lib/clang/include CFLAGS+= -I${LLVM_SRCS}/include Modified: head/lib/clang/llvm.pre.mk ============================================================================== --- head/lib/clang/llvm.pre.mk Fri Dec 20 18:23:50 2019 (r355939) +++ head/lib/clang/llvm.pre.mk Fri Dec 20 19:53:05 2019 (r355940) @@ -1,5 +1,7 @@ + # $FreeBSD$ -LLVM_SRCS= ${SRCTOP}/contrib/llvm +LLVM_BASE= ${SRCTOP}/contrib/llvm-project +LLVM_SRCS= ${LLVM_BASE}/llvm LLVM_TBLGEN?= llvm-tblgen Modified: head/lib/libblocksruntime/Makefile ============================================================================== --- head/lib/libblocksruntime/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/lib/libblocksruntime/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -6,7 +6,7 @@ SHLIB_MAJOR=0 CFLAGS+=-I${.CURDIR} WARNS?= 2 -.PATH: ${SRCTOP}/contrib/compiler-rt/lib/BlocksRuntime +.PATH: ${SRCTOP}/contrib/llvm-project/compiler-rt/lib/BlocksRuntime INCS= Block.h Block_private.h SRCS= data.c runtime.c Modified: head/lib/libc++/Makefile ============================================================================== --- head/lib/libc++/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/lib/libc++/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -4,8 +4,8 @@ PACKAGE= clibs _LIBCXXRTDIR= ${SRCTOP}/contrib/libcxxrt -HDRDIR= ${SRCTOP}/contrib/libc++/include -SRCDIR= ${SRCTOP}/contrib/libc++/src +HDRDIR= ${SRCTOP}/contrib/llvm-project/libcxx/include +SRCDIR= ${SRCTOP}/contrib/llvm-project/libcxx/src CXXINCLUDEDIR= ${INCLUDEDIR}/c++/v${SHLIB_MAJOR} .if ${MACHINE_CPUARCH} == "arm" STATIC_CXXFLAGS+= -mlong-calls Modified: head/lib/libc++experimental/Makefile ============================================================================== --- head/lib/libc++experimental/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/lib/libc++experimental/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -3,7 +3,7 @@ .include PACKAGE= clibs -SRCDIR= ${SRCTOP}/contrib/libc++ +SRCDIR= ${SRCTOP}/contrib/llvm-project/libcxx LIB= c++experimental NO_PIC= Modified: head/lib/libc/arm/aeabi/Makefile.inc ============================================================================== --- head/lib/libc/arm/aeabi/Makefile.inc Fri Dec 20 18:23:50 2019 (r355939) +++ head/lib/libc/arm/aeabi/Makefile.inc Fri Dec 20 19:53:05 2019 (r355940) @@ -21,7 +21,7 @@ SRCS+= aeabi_vfp_double.S \ # libc. This causes issues when other parts of libc call these functions. # We work around this by including these functions in libc but mark them as # hidden so users of libc will not pick up these versions. -.PATH: ${SRCTOP}/contrib/compiler-rt/lib/builtins/arm +.PATH: ${SRCTOP}/contrib/llvm-project/compiler-rt/lib/builtins/arm SRCS+= aeabi_memcmp.S \ aeabi_memcpy.S \ Modified: head/lib/libclang_rt/Makefile.inc ============================================================================== --- head/lib/libclang_rt/Makefile.inc Fri Dec 20 18:23:50 2019 (r355939) +++ head/lib/libclang_rt/Makefile.inc Fri Dec 20 19:53:05 2019 (r355940) @@ -10,7 +10,7 @@ CRTARCH?= armhf .else CRTARCH?= ${MACHINE_ARCH:C/amd64/x86_64/} .endif -CRTSRC= ${SRCTOP}/contrib/compiler-rt +CRTSRC= ${SRCTOP}/contrib/llvm-project/compiler-rt .PATH: ${CRTSRC}/lib Modified: head/lib/libcompiler_rt/Makefile.inc ============================================================================== --- head/lib/libcompiler_rt/Makefile.inc Fri Dec 20 18:23:50 2019 (r355939) +++ head/lib/libcompiler_rt/Makefile.inc Fri Dec 20 19:53:05 2019 (r355940) @@ -2,7 +2,7 @@ CRTARCH= ${MACHINE_CPUARCH:C/amd64/x86_64/} -CRTSRC= ${SRCTOP}/contrib/compiler-rt/lib/builtins +CRTSRC= ${SRCTOP}/contrib/llvm-project/compiler-rt/lib/builtins .PATH: ${CRTSRC}/${CRTARCH} .PATH: ${CRTSRC} Modified: head/lib/libexecinfo/Makefile ============================================================================== --- head/lib/libexecinfo/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/lib/libexecinfo/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -11,7 +11,7 @@ SHLIB_MAJOR= 1 INCS= execinfo.h SRCS= backtrace.c symtab.c unwind.c -CFLAGS+= -I${SRCTOP}/contrib/libunwind/include +CFLAGS+= -I${SRCTOP}/contrib/llvm-project/libunwind/include LIBADD= elf Modified: head/lib/libgcc_eh/Makefile.inc ============================================================================== --- head/lib/libgcc_eh/Makefile.inc Fri Dec 20 18:23:50 2019 (r355939) +++ head/lib/libgcc_eh/Makefile.inc Fri Dec 20 19:53:05 2019 (r355940) @@ -1,8 +1,8 @@ # $FreeBSD$ -COMPILERRTDIR= ${SRCTOP}/contrib/compiler-rt -UNWINDINCDIR= ${SRCTOP}/contrib/libunwind/include -UNWINDSRCDIR= ${SRCTOP}/contrib/libunwind/src +COMPILERRTDIR= ${SRCTOP}/contrib/llvm-project/compiler-rt +UNWINDINCDIR= ${SRCTOP}/contrib/llvm-project/libunwind/include +UNWINDSRCDIR= ${SRCTOP}/contrib/llvm-project/libunwind/src STATIC_CFLAGS+=${PICFLAG} -fvisibility=hidden -DVISIBILITY_HIDDEN @@ -35,5 +35,5 @@ STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC # Probably need to just move this earlier or use CXXFLAGS .if ${MK_DIRDEPS_BUILD} == "yes" # Avoid dependency on lib/libc++ -CFLAGS+= -isystem ${SRCTOP}/contrib/libc++/include -nostdinc++ +CFLAGS+= -isystem ${SRCTOP}/contrib/llvm-project/libcxx/include -nostdinc++ .endif Modified: head/lib/libomp/Makefile ============================================================================== --- head/lib/libomp/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/lib/libomp/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -4,7 +4,7 @@ SHLIB_NAME= libomp.so -OMPSRC= ${SRCTOP}/contrib/openmp/runtime/src +OMPSRC= ${SRCTOP}/contrib/llvm-project/openmp/runtime/src ITTSRC= ${OMPSRC}/thirdparty/ittnotify .PATH: ${OMPSRC} .PATH: ${ITTSRC} Modified: head/share/doc/llvm/Makefile ============================================================================== --- head/share/doc/llvm/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/share/doc/llvm/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -2,7 +2,7 @@ SUBDIR= clang -SRCDIR= ${SRCTOP}/contrib/llvm +SRCDIR= ${SRCTOP}/contrib/llvm-project/llvm .PATH: ${SRCDIR} ${SRCDIR}/lib/Support Modified: head/share/doc/llvm/clang/Makefile ============================================================================== --- head/share/doc/llvm/clang/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/share/doc/llvm/clang/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -1,6 +1,6 @@ # $FreeBSD$ -SRCDIR= ${SRCTOP}/contrib/llvm/tools/clang +SRCDIR= ${SRCTOP}/contrib/llvm-project/clang .PATH: ${SRCDIR} Modified: head/share/mk/bsd.clang-analyze.mk ============================================================================== --- head/share/mk/bsd.clang-analyze.mk Fri Dec 20 18:23:50 2019 (r355939) +++ head/share/mk/bsd.clang-analyze.mk Fri Dec 20 19:53:05 2019 (r355940) @@ -14,7 +14,7 @@ # html - generate html in obj.plist/ directories. # plist - generate xml obj.plist files. # See also: -# contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/Analyses.def +# contrib/llvm-project/clang/include/clang/StaticAnalyzer/Core/Analyses.def # # CLANG_ANALYZE_OUTPUT_DIR Sets which directory output set by # CLANG_ANALYZE_OUTPUT is placed into. Modified: head/stand/i386/boot2/Makefile ============================================================================== --- head/stand/i386/boot2/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/stand/i386/boot2/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -79,7 +79,7 @@ boot2.bin: boot2.out ${OBJCOPY} -S -O binary boot2.out ${.TARGET} # For __ashldi3 -.PATH: ${SRCTOP}/contrib/compiler-rt/lib/builtins +.PATH: ${SRCTOP}/contrib/llvm-project/compiler-rt/lib/builtins CFLAGS.ashldi3.c= -Wno-missing-prototypes -Wno-missing-declarations CLEANFILES+= ashldi3.o Modified: head/stand/libsa/Makefile ============================================================================== --- head/stand/libsa/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/stand/libsa/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -53,7 +53,7 @@ CFLAGS.clang+= -mno-movt .endif CFLAGS.clang+= -mfpu=none -.PATH: ${SRCTOP}/contrib/compiler-rt/lib/builtins/arm/ +.PATH: ${SRCTOP}/contrib/llvm-project/compiler-rt/lib/builtins/arm/ SRCS+= aeabi_idivmod.S aeabi_ldivmod.S aeabi_uidivmod.S aeabi_uldivmod.S SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S aeabi_memset.S .endif @@ -63,7 +63,7 @@ SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S a .endif # Compiler support functions -.PATH: ${SRCTOP}/contrib/compiler-rt/lib/builtins/ +.PATH: ${SRCTOP}/contrib/llvm-project/compiler-rt/lib/builtins/ # __clzsi2 and ctzsi2 for various builtin functions SRCS+= clzsi2.c ctzsi2.c # Divide and modulus functions called by the compiler Modified: head/sys/modules/aesni/Makefile ============================================================================== --- head/sys/modules/aesni/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/sys/modules/aesni/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -1,7 +1,7 @@ # $FreeBSD$ .PATH: ${SRCTOP}/sys/crypto/aesni -.PATH: ${SRCTOP}/contrib/llvm/tools/clang/lib/Headers +.PATH: ${SRCTOP}/contrib/llvm-project/clang/lib/Headers KMOD= aesni SRCS= aesni.c Modified: head/sys/modules/blake2/Makefile ============================================================================== --- head/sys/modules/blake2/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/sys/modules/blake2/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -3,7 +3,7 @@ .PATH: ${SRCTOP}/sys/contrib/libb2 .PATH: ${SRCTOP}/sys/crypto/blake2 .PATH: ${SRCTOP}/sys/opencrypto -.PATH: ${SRCTOP}/contrib/llvm/tools/clang/lib/Headers +.PATH: ${SRCTOP}/contrib/llvm-project/clang/lib/Headers KMOD = blake2 Modified: head/usr.bin/clang/bugpoint/Makefile ============================================================================== --- head/usr.bin/clang/bugpoint/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/bugpoint/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -2,7 +2,7 @@ PROG_CXX= bugpoint -SRCDIR= tools/bugpoint +SRCDIR= llvm/tools/bugpoint SRCS+= BugDriver.cpp SRCS+= CrashDebugger.cpp SRCS+= ExecutionDriver.cpp Modified: head/usr.bin/clang/clang-format/Makefile ============================================================================== --- head/usr.bin/clang/clang-format/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/clang-format/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -3,7 +3,7 @@ PROG_CXX= clang-format MAN= -SRCDIR= tools/clang/tools/clang-format +SRCDIR= clang/tools/clang-format SRCS+= ClangFormat.cpp .include "../clang.prog.mk" Modified: head/usr.bin/clang/clang-tblgen/Makefile ============================================================================== --- head/usr.bin/clang/clang-tblgen/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/clang-tblgen/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -3,7 +3,7 @@ PROG_CXX= clang-tblgen MAN= -SRCDIR= tools/clang/utils/TableGen +SRCDIR= clang/utils/TableGen SRCS+= ClangASTNodesEmitter.cpp SRCS+= ClangAttrEmitter.cpp SRCS+= ClangCommentCommandInfoEmitter.cpp Modified: head/usr.bin/clang/clang/Makefile ============================================================================== --- head/usr.bin/clang/clang/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/clang/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -4,7 +4,7 @@ PROG_CXX= clang -SRCDIR= tools/clang/tools/driver +SRCDIR= clang/tools/driver SRCS+= cc1_main.cpp SRCS+= cc1as_main.cpp SRCS+= cc1gen_reproducer_main.cpp Modified: head/usr.bin/clang/llc/Makefile ============================================================================== --- head/usr.bin/clang/llc/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llc/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -2,7 +2,7 @@ PROG_CXX= llc -SRCDIR= tools/llc +SRCDIR= llvm/tools/llc SRCS+= llc.cpp LIBADD+= z Modified: head/usr.bin/clang/lld/Makefile ============================================================================== --- head/usr.bin/clang/lld/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/lld/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -2,8 +2,9 @@ .include -LLVM_SRCS= ${SRCTOP}/contrib/llvm -LLD_SRCS= ${LLVM_SRCS}/tools/lld +LLVM_BASE= ${SRCTOP}/contrib/llvm-project +LLVM_SRCS= ${LLVM_BASE}/llvm +LLD_SRCS= ${LLVM_BASE}/lld PACKAGE= lld PROG_CXX= ld.lld @@ -24,7 +25,7 @@ CFLAGS+= -I${LLD_SRCS}/include CFLAGS+= -I${.OBJDIR} CFLAGS+= -I${OBJTOP}/lib/clang/libllvm -SRCDIR= tools/lld +SRCDIR= lld SRCS+= Common/Args.cpp SRCS+= Common/ErrorHandler.cpp SRCS+= Common/Filesystem.cpp Modified: head/usr.bin/clang/lldb-tblgen/Makefile ============================================================================== --- head/usr.bin/clang/lldb-tblgen/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/lldb-tblgen/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -3,7 +3,7 @@ PROG_CXX= lldb-tblgen MAN= -SRCDIR= tools/lldb/utils/TableGen +SRCDIR= lldb/utils/TableGen SRCS+= LLDBOptionDefEmitter.cpp SRCS+= LLDBTableGen.cpp Modified: head/usr.bin/clang/lldb/Makefile ============================================================================== --- head/usr.bin/clang/lldb/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/lldb/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -10,7 +10,7 @@ PROG_CXX= lldb CFLAGS+= -I${LLDB_SRCS}/include CFLAGS+= -I${.OBJDIR} -SRCDIR= tools/lldb/tools/driver +SRCDIR= lldb/tools/driver SRCS+= Driver.cpp .include "${SRCTOP}/lib/clang/clang.build.mk" Modified: head/usr.bin/clang/lli/Makefile ============================================================================== --- head/usr.bin/clang/lli/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/lli/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -2,7 +2,7 @@ PROG_CXX= lli -SRCDIR= tools/lli +SRCDIR= llvm/tools/lli SRCS+= lli.cpp LIBADD+= z Modified: head/usr.bin/clang/llvm-ar/Makefile ============================================================================== --- head/usr.bin/clang/llvm-ar/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-ar/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -2,7 +2,7 @@ PROG_CXX= llvm-ar -SRCDIR= tools/llvm-ar +SRCDIR= llvm/tools/llvm-ar SRCS+= llvm-ar.cpp LIBADD+= z Modified: head/usr.bin/clang/llvm-as/Makefile ============================================================================== --- head/usr.bin/clang/llvm-as/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-as/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -2,7 +2,7 @@ PROG_CXX= llvm-as -SRCDIR= tools/llvm-as +SRCDIR= llvm/tools/llvm-as SRCS+= llvm-as.cpp .include "../llvm.prog.mk" Modified: head/usr.bin/clang/llvm-bcanalyzer/Makefile ============================================================================== --- head/usr.bin/clang/llvm-bcanalyzer/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-bcanalyzer/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -2,7 +2,7 @@ PROG_CXX= llvm-bcanalyzer -SRCDIR= tools/llvm-bcanalyzer +SRCDIR= llvm/tools/llvm-bcanalyzer SRCS+= llvm-bcanalyzer.cpp .include "../llvm.prog.mk" Modified: head/usr.bin/clang/llvm-cov/Makefile ============================================================================== --- head/usr.bin/clang/llvm-cov/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-cov/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -8,7 +8,7 @@ LINKS= ${BINDIR}/llvm-cov ${BINDIR}/gcov MLINKS= llvm-cov.1 gcov.1 .endif -SRCDIR= tools/llvm-cov +SRCDIR= llvm/tools/llvm-cov SRCS+= CodeCoverage.cpp SRCS+= CoverageExporterJson.cpp SRCS+= CoverageExporterLcov.cpp Modified: head/usr.bin/clang/llvm-cxxdump/Makefile ============================================================================== --- head/usr.bin/clang/llvm-cxxdump/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-cxxdump/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -3,7 +3,7 @@ PROG_CXX= llvm-cxxdump MAN= -SRCDIR= tools/llvm-cxxdump +SRCDIR= llvm/tools/llvm-cxxdump SRCS+= Error.cpp SRCS+= llvm-cxxdump.cpp Modified: head/usr.bin/clang/llvm-cxxfilt/Makefile ============================================================================== --- head/usr.bin/clang/llvm-cxxfilt/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-cxxfilt/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -3,7 +3,7 @@ PROG_CXX= llvm-cxxfilt MAN= -SRCDIR= tools/llvm-cxxfilt +SRCDIR= llvm/tools/llvm-cxxfilt SRCS+= llvm-cxxfilt.cpp .include "../llvm.prog.mk" Modified: head/usr.bin/clang/llvm-diff/Makefile ============================================================================== --- head/usr.bin/clang/llvm-diff/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-diff/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -2,7 +2,7 @@ PROG_CXX= llvm-diff -SRCDIR= tools/llvm-diff +SRCDIR= llvm/tools/llvm-diff SRCS+= DiffConsumer.cpp SRCS+= DiffLog.cpp SRCS+= DifferenceEngine.cpp Modified: head/usr.bin/clang/llvm-dis/Makefile ============================================================================== --- head/usr.bin/clang/llvm-dis/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-dis/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -2,7 +2,7 @@ PROG_CXX= llvm-dis -SRCDIR= tools/llvm-dis +SRCDIR= llvm/tools/llvm-dis SRCS+= llvm-dis.cpp .include "../llvm.prog.mk" Modified: head/usr.bin/clang/llvm-dwarfdump/Makefile ============================================================================== --- head/usr.bin/clang/llvm-dwarfdump/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-dwarfdump/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -2,7 +2,7 @@ PROG_CXX= llvm-dwarfdump -SRCDIR= tools/llvm-dwarfdump +SRCDIR= llvm/tools/llvm-dwarfdump SRCS+= Statistics.cpp SRCS+= llvm-dwarfdump.cpp Modified: head/usr.bin/clang/llvm-extract/Makefile ============================================================================== --- head/usr.bin/clang/llvm-extract/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-extract/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -2,7 +2,7 @@ PROG_CXX= llvm-extract -SRCDIR= tools/llvm-extract +SRCDIR= llvm/tools/llvm-extract SRCS+= llvm-extract.cpp LIBADD+= z Modified: head/usr.bin/clang/llvm-link/Makefile ============================================================================== --- head/usr.bin/clang/llvm-link/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-link/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -2,7 +2,7 @@ PROG_CXX= llvm-link -SRCDIR= tools/llvm-link +SRCDIR= llvm/tools/llvm-link SRCS+= llvm-link.cpp .include "../llvm.prog.mk" Modified: head/usr.bin/clang/llvm-lto/Makefile ============================================================================== --- head/usr.bin/clang/llvm-lto/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-lto/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -3,7 +3,7 @@ PROG_CXX= llvm-lto MAN= -SRCDIR= tools/llvm-lto +SRCDIR= llvm/tools/llvm-lto SRCS= llvm-lto.cpp LIBADD+= z Modified: head/usr.bin/clang/llvm-lto2/Makefile ============================================================================== --- head/usr.bin/clang/llvm-lto2/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-lto2/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -3,7 +3,7 @@ PROG_CXX= llvm-lto2 MAN= -SRCDIR= tools/llvm-lto2 +SRCDIR= llvm/tools/llvm-lto2 SRCS= llvm-lto2.cpp LIBADD+= z Modified: head/usr.bin/clang/llvm-mc/Makefile ============================================================================== --- head/usr.bin/clang/llvm-mc/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-mc/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -3,7 +3,7 @@ PROG_CXX= llvm-mc MAN= -SRCDIR= tools/llvm-mc +SRCDIR= llvm/tools/llvm-mc SRCS+= Disassembler.cpp SRCS+= llvm-mc.cpp Modified: head/usr.bin/clang/llvm-mca/Makefile ============================================================================== --- head/usr.bin/clang/llvm-mca/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-mca/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -2,7 +2,7 @@ PROG_CXX= llvm-mca -SRCDIR= tools/llvm-mca +SRCDIR= llvm/tools/llvm-mca SRCS+= CodeRegion.cpp SRCS+= CodeRegionGenerator.cpp SRCS+= PipelinePrinter.cpp @@ -18,7 +18,7 @@ SRCS+= Views/TimelineView.cpp SRCS+= Views/View.cpp SRCS+= llvm-mca.cpp -CFLAGS+= -I${LLVM_SRCS}/${SRCDIR} +CFLAGS+= -I${LLVM_BASE}/${SRCDIR} LIBADD+= z Modified: head/usr.bin/clang/llvm-modextract/Makefile ============================================================================== --- head/usr.bin/clang/llvm-modextract/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-modextract/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -3,7 +3,7 @@ PROG_CXX= llvm-modextract MAN= -SRCDIR= tools/llvm-modextract +SRCDIR= llvm/tools/llvm-modextract SRCS= llvm-modextract.cpp .include "../llvm.prog.mk" Modified: head/usr.bin/clang/llvm-nm/Makefile ============================================================================== --- head/usr.bin/clang/llvm-nm/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-nm/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -2,7 +2,7 @@ PROG_CXX= llvm-nm -SRCDIR= tools/llvm-nm +SRCDIR= llvm/tools/llvm-nm SRCS+= llvm-nm.cpp LIBADD+= z Modified: head/usr.bin/clang/llvm-objcopy/Makefile ============================================================================== --- head/usr.bin/clang/llvm-objcopy/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-objcopy/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -3,7 +3,7 @@ PROG_CXX= llvm-objcopy MAN= -SRCDIR= tools/llvm-objcopy +SRCDIR= llvm/tools/llvm-objcopy SRCS+= Buffer.cpp SRCS+= COFF/COFFObjcopy.cpp SRCS+= COFF/Object.cpp @@ -21,15 +21,15 @@ SRCS+= llvm-objcopy.cpp .include "${SRCTOP}/lib/clang/llvm.pre.mk" CFLAGS+= -I${.OBJDIR} -CFLAGS+= -I${LLVM_SRCS}/${SRCDIR} +CFLAGS+= -I${LLVM_BASE}/${SRCDIR} .include "${SRCTOP}/lib/clang/llvm.build.mk" .for hdr in ObjcopyOpts StripOpts -${hdr}.inc: ${LLVM_SRCS}/${SRCDIR}/${hdr}.td +${hdr}.inc: ${LLVM_BASE}/${SRCDIR}/${hdr}.td ${LLVM_TBLGEN} -gen-opt-parser-defs \ -I ${LLVM_SRCS}/include -d ${.TARGET}.d -o ${.TARGET} \ - ${LLVM_SRCS}/${SRCDIR}/${hdr}.td + ${LLVM_BASE}/${SRCDIR}/${hdr}.td TGHDRS+= ${hdr}.inc .endfor Modified: head/usr.bin/clang/llvm-objdump/Makefile ============================================================================== --- head/usr.bin/clang/llvm-objdump/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-objdump/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -2,7 +2,7 @@ PROG_CXX= llvm-objdump -SRCDIR= tools/llvm-objdump +SRCDIR= llvm/tools/llvm-objdump SRCS+= COFFDump.cpp SRCS+= ELFDump.cpp SRCS+= MachODump.cpp Modified: head/usr.bin/clang/llvm-pdbutil/Makefile ============================================================================== --- head/usr.bin/clang/llvm-pdbutil/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-pdbutil/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -2,7 +2,7 @@ PROG_CXX= llvm-pdbutil -SRCDIR= tools/llvm-pdbutil +SRCDIR= llvm/tools/llvm-pdbutil SRCS+= BytesOutputStyle.cpp SRCS+= DumpOutputStyle.cpp SRCS+= ExplainOutputStyle.cpp Modified: head/usr.bin/clang/llvm-profdata/Makefile ============================================================================== --- head/usr.bin/clang/llvm-profdata/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-profdata/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -2,7 +2,7 @@ PROG_CXX= llvm-profdata -SRCDIR= tools/llvm-profdata +SRCDIR= llvm/tools/llvm-profdata SRCS+= llvm-profdata.cpp LIBADD+= z Modified: head/usr.bin/clang/llvm-rtdyld/Makefile ============================================================================== --- head/usr.bin/clang/llvm-rtdyld/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-rtdyld/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -3,7 +3,7 @@ PROG_CXX= llvm-rtdyld MAN= -SRCDIR= tools/llvm-rtdyld +SRCDIR= llvm/tools/llvm-rtdyld SRCS+= llvm-rtdyld.cpp LIBADD+= z Modified: head/usr.bin/clang/llvm-symbolizer/Makefile ============================================================================== --- head/usr.bin/clang/llvm-symbolizer/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-symbolizer/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -2,7 +2,7 @@ PROG_CXX= llvm-symbolizer -SRCDIR= tools/llvm-symbolizer +SRCDIR= llvm/tools/llvm-symbolizer SRCS+= llvm-symbolizer.cpp LIBADD+= z Modified: head/usr.bin/clang/llvm-tblgen/Makefile ============================================================================== --- head/usr.bin/clang/llvm-tblgen/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-tblgen/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -2,7 +2,7 @@ PROG_CXX= llvm-tblgen -SRCDIR= utils/TableGen +SRCDIR= llvm/utils/TableGen SRCS+= AsmMatcherEmitter.cpp SRCS+= AsmWriterEmitter.cpp SRCS+= AsmWriterInst.cpp Modified: head/usr.bin/clang/llvm-xray/Makefile ============================================================================== --- head/usr.bin/clang/llvm-xray/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/llvm-xray/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -3,7 +3,7 @@ PROG_CXX= llvm-xray MAN= -SRCDIR= tools/llvm-xray +SRCDIR= llvm/tools/llvm-xray SRCS+= func-id-helper.cpp SRCS+= llvm-xray.cpp SRCS+= xray-account.cpp Modified: head/usr.bin/clang/opt/Makefile ============================================================================== --- head/usr.bin/clang/opt/Makefile Fri Dec 20 18:23:50 2019 (r355939) +++ head/usr.bin/clang/opt/Makefile Fri Dec 20 19:53:05 2019 (r355940) @@ -2,7 +2,7 @@ PROG_CXX= opt -SRCDIR= tools/opt +SRCDIR= llvm/tools/opt SRCS+= AnalysisWrappers.cpp SRCS+= BreakpointPrinter.cpp SRCS+= Debugify.cpp From owner-svn-src-head@freebsd.org Fri Dec 20 20:10:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5534C1E20E4; Fri, 20 Dec 2019 20:10: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 47ffxb1L5Pz4LGC; Fri, 20 Dec 2019 20:10: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 2504741DB; Fri, 20 Dec 2019 20:10: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 xBKKAQ0Z050110; Fri, 20 Dec 2019 20:10:26 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBKKAQci050109; Fri, 20 Dec 2019 20:10:26 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201912202010.xBKKAQci050109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 20 Dec 2019 20:10:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355941 - head/sys/dev/mii X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/mii X-SVN-Commit-Revision: 355941 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 20:10:27 -0000 Author: markj Date: Fri Dec 20 20:10:26 2019 New Revision: 355941 URL: https://svnweb.freebsd.org/changeset/base/355941 Log: mii(4): Fix ivars leak when the bus device or bus children detach. PR: 242727 Submitted by: ghuckriede@blackberry.com MFC after: 1 week Modified: head/sys/dev/mii/mii.c Modified: head/sys/dev/mii/mii.c ============================================================================== --- head/sys/dev/mii/mii.c Fri Dec 20 19:53:05 2019 (r355940) +++ head/sys/dev/mii/mii.c Fri Dec 20 20:10:26 2019 (r355941) @@ -60,6 +60,7 @@ MODULE_VERSION(miibus, 1); #include "miibus_if.h" static device_attach_t miibus_attach; +static bus_child_detached_t miibus_child_detached; static bus_child_location_str_t miibus_child_location_str; static bus_child_pnpinfo_str_t miibus_child_pnpinfo_str; static device_detach_t miibus_detach; @@ -85,6 +86,7 @@ static device_method_t miibus_methods[] = { /* bus interface */ DEVMETHOD(bus_print_child, miibus_print_child), DEVMETHOD(bus_read_ivar, miibus_read_ivar), + DEVMETHOD(bus_child_detached, miibus_child_detached), DEVMETHOD(bus_child_pnpinfo_str, miibus_child_pnpinfo_str), DEVMETHOD(bus_child_location_str, miibus_child_location_str), DEVMETHOD(bus_hinted_child, miibus_hinted_child), @@ -160,13 +162,25 @@ static int miibus_detach(device_t dev) { struct mii_data *mii; + struct miibus_ivars *ivars; + ivars = device_get_ivars(dev); bus_generic_detach(dev); mii = device_get_softc(dev); ifmedia_removeall(&mii->mii_media); + free(ivars, M_DEVBUF); mii->mii_ifp = NULL; return (0); +} + +static void +miibus_child_detached(device_t dev, device_t child) +{ + struct mii_attach_args *args; + + args = device_get_ivars(child); + free(args, M_DEVBUF); } static int From owner-svn-src-head@freebsd.org Fri Dec 20 20:15:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8F4271E22C8; Fri, 20 Dec 2019 20:15:35 +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 47fg3W3JH9z4Ld0; Fri, 20 Dec 2019 20:15:35 +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 5286A4392; Fri, 20 Dec 2019 20:15:35 +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 xBKKFZ1x055706; Fri, 20 Dec 2019 20:15:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBKKFZSK055705; Fri, 20 Dec 2019 20:15:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201912202015.xBKKFZSK055705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 20 Dec 2019 20:15:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355942 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 355942 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 20:15:35 -0000 Author: markj Date: Fri Dec 20 20:15:34 2019 New Revision: 355942 URL: https://svnweb.freebsd.org/changeset/base/355942 Log: Deduplicate code between if_delgroup() and if_delgroups(). Fix some style in if_addgroup(). No functional change intended. Reviewed by: hselasky MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22892 Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Fri Dec 20 20:10:26 2019 (r355941) +++ head/sys/net/if.c Fri Dec 20 20:15:34 2019 (r355942) @@ -1455,14 +1455,12 @@ if_addgroup(struct ifnet *ifp, const char *groupname) return (EEXIST); } - if ((ifgl = (struct ifg_list *)malloc(sizeof(struct ifg_list), M_TEMP, - M_NOWAIT)) == NULL) { + if ((ifgl = malloc(sizeof(*ifgl), M_TEMP, M_NOWAIT)) == NULL) { IFNET_WUNLOCK(); return (ENOMEM); } - if ((ifgm = (struct ifg_member *)malloc(sizeof(struct ifg_member), - M_TEMP, M_NOWAIT)) == NULL) { + if ((ifgm = malloc(sizeof(*ifgm), M_TEMP, M_NOWAIT)) == NULL) { free(ifgl, M_TEMP); IFNET_WUNLOCK(); return (ENOMEM); @@ -1473,8 +1471,7 @@ if_addgroup(struct ifnet *ifp, const char *groupname) break; if (ifg == NULL) { - if ((ifg = (struct ifg_group *)malloc(sizeof(struct ifg_group), - M_TEMP, M_NOWAIT)) == NULL) { + if ((ifg = malloc(sizeof(*ifg), M_TEMP, M_NOWAIT)) == NULL) { free(ifgl, M_TEMP); free(ifgm, M_TEMP); IFNET_WUNLOCK(); @@ -1506,39 +1503,36 @@ if_addgroup(struct ifnet *ifp, const char *groupname) } /* - * Remove a group from an interface + * Helper function to remove a group out of an interface. Expects the global + * ifnet lock to be write-locked, and drops it before returning. */ -int -if_delgroup(struct ifnet *ifp, const char *groupname) +static void +_if_delgroup_locked(struct ifnet *ifp, struct ifg_list *ifgl, + const char *groupname) { - struct ifg_list *ifgl; - struct ifg_member *ifgm; - int freeifgl; + struct ifg_member *ifgm; + bool freeifgl; - IFNET_WLOCK(); - CK_STAILQ_FOREACH(ifgl, &ifp->if_groups, ifgl_next) - if (!strcmp(ifgl->ifgl_group->ifg_group, groupname)) - break; - if (ifgl == NULL) { - IFNET_WUNLOCK(); - return (ENOENT); - } + IFNET_WLOCK_ASSERT(); - freeifgl = 0; IF_ADDR_WLOCK(ifp); CK_STAILQ_REMOVE(&ifp->if_groups, ifgl, ifg_list, ifgl_next); IF_ADDR_WUNLOCK(ifp); - CK_STAILQ_FOREACH(ifgm, &ifgl->ifgl_group->ifg_members, ifgm_next) - if (ifgm->ifgm_ifp == ifp) + CK_STAILQ_FOREACH(ifgm, &ifgl->ifgl_group->ifg_members, ifgm_next) { + if (ifgm->ifgm_ifp == ifp) { + CK_STAILQ_REMOVE(&ifgl->ifgl_group->ifg_members, ifgm, + ifg_member, ifgm_next); break; + } + } - if (ifgm != NULL) - CK_STAILQ_REMOVE(&ifgl->ifgl_group->ifg_members, ifgm, ifg_member, ifgm_next); - if (--ifgl->ifgl_group->ifg_refcnt == 0) { - CK_STAILQ_REMOVE(&V_ifg_head, ifgl->ifgl_group, ifg_group, ifg_next); - freeifgl = 1; + CK_STAILQ_REMOVE(&V_ifg_head, ifgl->ifgl_group, ifg_group, + ifg_next); + freeifgl = true; + } else { + freeifgl = false; } IFNET_WUNLOCK(); @@ -1551,7 +1545,27 @@ if_delgroup(struct ifnet *ifp, const char *groupname) free(ifgl, M_TEMP); EVENTHANDLER_INVOKE(group_change_event, groupname); +} +/* + * Remove a group from an interface + */ +int +if_delgroup(struct ifnet *ifp, const char *groupname) +{ + struct ifg_list *ifgl; + + IFNET_WLOCK(); + CK_STAILQ_FOREACH(ifgl, &ifp->if_groups, ifgl_next) + if (strcmp(ifgl->ifgl_group->ifg_group, groupname) == 0) + break; + if (ifgl == NULL) { + IFNET_WUNLOCK(); + return (ENOENT); + } + + _if_delgroup_locked(ifp, ifgl, groupname); + return (0); } @@ -1561,45 +1575,13 @@ if_delgroup(struct ifnet *ifp, const char *groupname) static void if_delgroups(struct ifnet *ifp) { - struct ifg_list *ifgl; - struct ifg_member *ifgm; + struct ifg_list *ifgl; char groupname[IFNAMSIZ]; - int ifglfree; IFNET_WLOCK(); - while (!CK_STAILQ_EMPTY(&ifp->if_groups)) { - ifgl = CK_STAILQ_FIRST(&ifp->if_groups); - + while ((ifgl = CK_STAILQ_FIRST(&ifp->if_groups)) != NULL) { strlcpy(groupname, ifgl->ifgl_group->ifg_group, IFNAMSIZ); - - IF_ADDR_WLOCK(ifp); - CK_STAILQ_REMOVE(&ifp->if_groups, ifgl, ifg_list, ifgl_next); - IF_ADDR_WUNLOCK(ifp); - - CK_STAILQ_FOREACH(ifgm, &ifgl->ifgl_group->ifg_members, ifgm_next) - if (ifgm->ifgm_ifp == ifp) - break; - - if (ifgm != NULL) - CK_STAILQ_REMOVE(&ifgl->ifgl_group->ifg_members, ifgm, ifg_member, - ifgm_next); - ifglfree = 0; - if (--ifgl->ifgl_group->ifg_refcnt == 0) { - CK_STAILQ_REMOVE(&V_ifg_head, ifgl->ifgl_group, ifg_group, ifg_next); - ifglfree = 1; - } - - IFNET_WUNLOCK(); - epoch_wait_preempt(net_epoch_preempt); - free(ifgm, M_TEMP); - if (ifglfree) { - EVENTHANDLER_INVOKE(group_detach_event, - ifgl->ifgl_group); - free(ifgl->ifgl_group, M_TEMP); - } - free(ifgl, M_TEMP); - EVENTHANDLER_INVOKE(group_change_event, groupname); - + _if_delgroup_locked(ifp, ifgl, groupname); IFNET_WLOCK(); } IFNET_WUNLOCK(); @@ -1681,7 +1663,7 @@ if_getgroupmembers(struct ifgroupreq *ifgr) IFNET_RLOCK(); CK_STAILQ_FOREACH(ifg, &V_ifg_head, ifg_next) - if (!strcmp(ifg->ifg_group, ifgr->ifgr_name)) + if (strcmp(ifg->ifg_group, ifgr->ifgr_name) == 0) break; if (ifg == NULL) { IFNET_RUNLOCK(); From owner-svn-src-head@freebsd.org Fri Dec 20 20:24:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F5301E2628; Fri, 20 Dec 2019 20:24:00 +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 47fgFD2hXFz4MDQ; Fri, 20 Dec 2019 20:24:00 +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 57AA9456C; Fri, 20 Dec 2019 20:24:00 +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 xBKKO0GM061450; Fri, 20 Dec 2019 20:24:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBKKO0dr061449; Fri, 20 Dec 2019 20:24:00 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201912202024.xBKKO0dr061449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 Dec 2019 20:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355943 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 355943 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 20:24:00 -0000 Author: emaste Date: Fri Dec 20 20:23:59 2019 New Revision: 355943 URL: https://svnweb.freebsd.org/changeset/base/355943 Log: add LDNS build knob dependency on OPENSSL Reported by: Michael Dexter's run of the Build Options Survey MFC after: 1 week 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 Fri Dec 20 20:15:34 2019 (r355942) +++ head/share/mk/src.opts.mk Fri Dec 20 20:23:59 2019 (r355943) @@ -464,11 +464,6 @@ MK_CASPER:= no MK_LIBTHR:= no .endif -.if ${MK_LDNS} == "no" -MK_LDNS_UTILS:= no -MK_UNBOUND:= no -.endif - .if ${MK_SOURCELESS} == "no" MK_SOURCELESS_HOST:= no MK_SOURCELESS_UCODE:= no @@ -514,6 +509,12 @@ MK_NLS_CATALOGS:= no .if ${MK_OPENSSL} == "no" MK_OPENSSH:= no MK_KERBEROS:= no +MK_LDNS:= no +.endif + +.if ${MK_LDNS} == "no" +MK_LDNS_UTILS:= no +MK_UNBOUND:= no .endif .if ${MK_PF} == "no" From owner-svn-src-head@freebsd.org Fri Dec 20 20:46:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 891031E2DF5; Fri, 20 Dec 2019 20:46:27 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47fgl7379Pz4NNW; Fri, 20 Dec 2019 20:46:27 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6680948F8; Fri, 20 Dec 2019 20:46:27 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBKKkR6I073926; Fri, 20 Dec 2019 20:46:27 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBKKkRYR073925; Fri, 20 Dec 2019 20:46:27 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201912202046.xBKKkRYR073925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 20 Dec 2019 20:46:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355946 - in head/sys: amd64/amd64 arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm64/arm64 X-SVN-Commit-Revision: 355946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 20:46:27 -0000 Author: alc Date: Fri Dec 20 20:46:26 2019 New Revision: 355946 URL: https://svnweb.freebsd.org/changeset/base/355946 Log: Correct a mistakenly inverted condition in r355833. Noticed by: kib X-MFC with: r355833 Modified: head/sys/amd64/amd64/pmap.c head/sys/arm64/arm64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Dec 20 20:46:11 2019 (r355945) +++ head/sys/amd64/amd64/pmap.c Fri Dec 20 20:46:26 2019 (r355946) @@ -6336,7 +6336,7 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t ("pmap_enter_pde: pdpg's reference count is too low")); if ((flags & PMAP_ENTER_NOREPLACE) != 0 && (va < VM_MAXUSER_ADDRESS || (oldpde & PG_PS) != 0 || - pmap_every_pte_zero(oldpde & PG_FRAME))) { + !pmap_every_pte_zero(oldpde & PG_FRAME))) { if (pdpg != NULL) pdpg->ref_count--; CTR2(KTR_PMAP, "pmap_enter_pde: failure for va %#lx" Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Fri Dec 20 20:46:11 2019 (r355945) +++ head/sys/arm64/arm64/pmap.c Fri Dec 20 20:46:26 2019 (r355946) @@ -3644,7 +3644,7 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t ("pmap_enter_l2: l2pg's ref count is too low")); if ((flags & PMAP_ENTER_NOREPLACE) != 0 && (va < VM_MAXUSER_ADDRESS || (old_l2 & ATTR_DESCR_MASK) == - L2_BLOCK || pmap_every_pte_zero(old_l2 & ~ATTR_MASK))) { + L2_BLOCK || !pmap_every_pte_zero(old_l2 & ~ATTR_MASK))) { if (l2pg != NULL) l2pg->ref_count--; CTR2(KTR_PMAP, "pmap_enter_l2: failure for va %#lx" From owner-svn-src-head@freebsd.org Fri Dec 20 20:58:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8CB3A1E31EE; Fri, 20 Dec 2019 20:58:14 +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 47fh0k2xlfz4P9X; Fri, 20 Dec 2019 20:58:14 +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 5C0794AB3; Fri, 20 Dec 2019 20:58:14 +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 xBKKwEWX080099; Fri, 20 Dec 2019 20:58:14 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBKKwEok080098; Fri, 20 Dec 2019 20:58:14 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201912202058.xBKKwEok080098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 20 Dec 2019 20:58:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355948 - 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: 355948 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 20:58:14 -0000 Author: dim Date: Fri Dec 20 20:58:13 2019 New Revision: 355948 URL: https://svnweb.freebsd.org/changeset/base/355948 Log: Bootstrap mergeinfo for contrib/llvm-project Merge (record-only) the following paths to contrib/llvm-project: * ^/vendor/llvm-project/master * ^/vendor/llvm-project/release-8.x * ^/vendor/llvm-project/release-9.x Modified: Directory Properties: head/contrib/llvm-project/ (props changed) 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-head@freebsd.org Fri Dec 20 21:11:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF5C31E3573; Fri, 20 Dec 2019 21:11:00 +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 47fhHS65r5z4Ppf; Fri, 20 Dec 2019 21:11:00 +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 CCB464CA9; Fri, 20 Dec 2019 21:11:00 +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 xBKLB0u2086925; Fri, 20 Dec 2019 21:11:00 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBKLB0JA086924; Fri, 20 Dec 2019 21:11:00 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201912202111.xBKLB0JA086924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 20 Dec 2019 21:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355949 - head/sys/dev/random X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/random X-SVN-Commit-Revision: 355949 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 21:11:01 -0000 Author: cem Date: Fri Dec 20 21:11:00 2019 New Revision: 355949 URL: https://svnweb.freebsd.org/changeset/base/355949 Log: random(4): Flip default Fortuna generator over to Chacha20 The implementation was landed in r344913 and has had some bake time (at least on my personal systems). There is some discussion of the motivation for defaulting to this cipher as a PRF in the commit log for r344913. As documented in that commit, administrators can retain the prior (AES-ICM) mode of operation by setting the 'kern.random.use_chacha20_cipher' tunable to 0 in loader.conf(5). Approved by: csprng(delphij, markm) Differential Revision: https://reviews.freebsd.org/D22878 Modified: head/sys/dev/random/hash.c Modified: head/sys/dev/random/hash.c ============================================================================== --- head/sys/dev/random/hash.c Fri Dec 20 20:58:13 2019 (r355948) +++ head/sys/dev/random/hash.c Fri Dec 20 21:11:00 2019 (r355949) @@ -68,18 +68,18 @@ CTASSERT(RANDOM_KEYSIZE == 2*RANDOM_BLOCKSIZE); _Static_assert(CHACHA_STATELEN == RANDOM_BLOCKSIZE, ""); /* - * Experimental Chacha20-based PRF for Fortuna keystream primitive. For now, - * disabled by default. But we may enable it in the future. + * Knob to control use of Chacha20-based PRF for Fortuna keystream primitive. * * Benefits include somewhat faster keystream generation compared with - * unaccelerated AES-ICM. + * unaccelerated AES-ICM; reseeding is much cheaper than computing AES key + * schedules. */ -bool random_chachamode __read_frequently = false; +bool random_chachamode __read_frequently = true; #ifdef _KERNEL SYSCTL_BOOL(_kern_random, OID_AUTO, use_chacha20_cipher, CTLFLAG_RDTUN, &random_chachamode, 0, - "If non-zero, use the ChaCha20 cipher for randomdev PRF. " - "If zero, use AES-ICM cipher for randomdev PRF (default)."); + "If non-zero, use the ChaCha20 cipher for randomdev PRF (default). " + "If zero, use AES-ICM cipher for randomdev PRF (12.x default)."); #endif /* Initialise the hash */ From owner-svn-src-head@freebsd.org Fri Dec 20 21:18:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 479621E38BD; Fri, 20 Dec 2019 21:18:35 +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 47fhSC1DDDz4QRT; Fri, 20 Dec 2019 21:18:35 +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 211964E5E; Fri, 20 Dec 2019 21:18:35 +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 xBKLIYlY092230; Fri, 20 Dec 2019 21:18:34 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBKLIYTV092229; Fri, 20 Dec 2019 21:18:34 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201912202118.xBKLIYTV092229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 20 Dec 2019 21:18:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355951 - head/contrib/llvm-project/llvm/lib/Target/WebAssembly/InstPrinter X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm-project/llvm/lib/Target/WebAssembly/InstPrinter X-SVN-Commit-Revision: 355951 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 21:18:35 -0000 Author: dim Date: Fri Dec 20 21:18:34 2019 New Revision: 355951 URL: https://svnweb.freebsd.org/changeset/base/355951 Log: Merge empty dir updates from r355950 in vendor/llvm-project. Deleted: head/contrib/llvm-project/llvm/lib/Target/WebAssembly/InstPrinter/ Modified: Directory Properties: head/contrib/llvm-project/ (props changed) head/contrib/llvm-project/clang/ (props changed) head/contrib/llvm-project/compiler-rt/ (props changed) head/contrib/llvm-project/lldb/ (props changed) head/contrib/llvm-project/llvm/ (props changed) From owner-svn-src-head@freebsd.org Fri Dec 20 21:25:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E3371E3B8B; Fri, 20 Dec 2019 21:25:52 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47fhcc2j3Xz4R2l; Fri, 20 Dec 2019 21:25:52 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57E5F5014; Fri, 20 Dec 2019 21:25:52 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBKLPqiw098283; Fri, 20 Dec 2019 21:25:52 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBKLPqAB098282; Fri, 20 Dec 2019 21:25:52 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201912202125.xBKLPqAB098282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 20 Dec 2019 21:25:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355954 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 355954 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 21:25:52 -0000 Author: rmacklem Date: Fri Dec 20 21:25:51 2019 New Revision: 355954 URL: https://svnweb.freebsd.org/changeset/base/355954 Log: Update the man page to reflect the addition of NFSv4.2 (r355677). Include references to NFSv4.2 and associated RFCs. Also clarify when a Linux client needs to set vfs.nfsd.flexlinuxhack if a pNFS server is in use. This is a content change. Modified: head/usr.sbin/nfsd/nfsd.8 Modified: head/usr.sbin/nfsd/nfsd.8 ============================================================================== --- head/usr.sbin/nfsd/nfsd.8 Fri Dec 20 21:25:22 2019 (r355953) +++ head/usr.sbin/nfsd/nfsd.8 Fri Dec 20 21:25:51 2019 (r355954) @@ -28,7 +28,7 @@ .\" @(#)nfsd.8 8.4 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd February 14, 2019 +.Dd December 20, 2019 .Dt NFSD 8 .Os .Sh NAME @@ -222,9 +222,15 @@ RFC1094, .%T "NFS: Network File System Version 3 Protocol Specification" , RFC1813, .%T "Network File System (NFS) Version 4 Protocol" , -RFC3530 and +RFC7530, .%T "Network File System (NFS) Version 4 Minor Version 1 Protocol" , -RFC5661. +RFC5661, +.%T "Network File System (NFS) Version 4 Minor Version 2 Protocol" , +RFC7862, +.%T "File System Extended Attributes in NFSv4" , +RFC8276 and +.%T "Parallel NFS (pNFS) Flexible File Layout" , +RFC8435. .Pp If .Nm @@ -323,13 +329,13 @@ and then restart it, after the .Xr gssd 8 is running. .Pp -If mirroring is enabled via the -.Fl m -option and there are Linux clients doing NFSv4.1 mounts, those clients -need to be patched to support the -.Dq tightly coupled -variant of -the Flexible File layout or the +For a Flexible File Layout pNFS server, +if there are Linux clients doing NFSv4.1 or NFSv4.2 mounts, those +clients might need the .Xr sysctl 8 vfs.nfsd.flexlinuxhack -must be set to one on the MDS as a workaround. +to be set to one on the MDS as a workaround. +.Pp +Linux 5.n kernels appear to have been patched such that this +.Xr sysctl 8 +does not need to be set. From owner-svn-src-head@freebsd.org Fri Dec 20 21:31:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AAA971E3F0B; Fri, 20 Dec 2019 21:31:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47fhkh493Vz4RW1; Fri, 20 Dec 2019 21:31:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A1F4504C; Fri, 20 Dec 2019 21:31:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBKLV8pM000879; Fri, 20 Dec 2019 21:31:08 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBKLV8bR000878; Fri, 20 Dec 2019 21:31:08 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201912202131.xBKLV8bR000878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 20 Dec 2019 21:31:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355956 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 355956 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 21:31:08 -0000 Author: rmacklem Date: Fri Dec 20 21:31:08 2019 New Revision: 355956 URL: https://svnweb.freebsd.org/changeset/base/355956 Log: Update the man page to reflect the addition of NFSv4.2 (r355677). Include references to NFSv4.2 and associated RFCs and note new features present in NFSv4.2. This is a content change. Modified: head/usr.sbin/nfsd/nfsv4.4 Modified: head/usr.sbin/nfsd/nfsv4.4 ============================================================================== --- head/usr.sbin/nfsd/nfsv4.4 Fri Dec 20 21:30:51 2019 (r355955) +++ head/usr.sbin/nfsd/nfsv4.4 Fri Dec 20 21:31:08 2019 (r355956) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 19, 2017 +.Dd December 20, 2019 .Dt NFSV4 4 .Os .Sh NAME @@ -34,8 +34,11 @@ The NFS client and server provides support for the .Tn NFSv4 specification; see -.%T "Network File System (NFS) Version 4 Protocol RFC 7530" and -.%T "Network File System (NFS) Version 4 Minor Version 1 Protocol RFC 5661" . +.%T "Network File System (NFS) Version 4 Protocol RFC 7530" , +.%T "Network File System (NFS) Version 4 Minor Version 1 Protocol RFC 5661" , +.%T "Network File System (NFS) Version 4 Minor Version 2 Protocol RFC 7862" , +.%T "File System Extended Attributes in NFSv4 RFC 8276" and +.%T "Parallel NFS (pNFS) Flexible File Layout RFC 8435" . The protocol is somewhat similar to NFS Version 3, but differs in significant ways. It uses a single compound RPC that concatenates operations to-gether. @@ -76,6 +79,12 @@ It provides several optional features not present in N (not yet implemented) - Delegations, which allow a client to operate on a file locally - pNFS, where I/O operations are separated from Metadata operations +And for NFSv4.2 only +- User namespace extended attributes +- lseek(SEEK_DATA/SEEK_HOLE) +- File copying done locally on the server for copy_file_range(2) +- posix_fallocate(2) +- posix_fadvise(POSIX_FADV_WILLNEED/POSIX_FADV_DONTNEED) .Ed .Pp The @@ -306,7 +315,7 @@ N.N.N.N.N.N where the first 4 Ns are the host IP address and the last two are the port# in network byte order (all decimal #s in the range 0-255). .Pp -For NFSv4.1, the callback path (called a backchannel) uses the same TCP connection as the mount, +For NFSv4.1 and NFSv4.2, the callback path (called a backchannel) uses the same TCP connection as the mount, so none of the above applies and should work through gateways without any issues. .Pp From owner-svn-src-head@freebsd.org Fri Dec 20 21:33:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1AA1E1E3FDC; Fri, 20 Dec 2019 21:33:13 +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 47fhn46wHyz4RrV; Fri, 20 Dec 2019 21:33:12 +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 E8C4E51EB; Fri, 20 Dec 2019 21:33:12 +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 xBKLXCxe004029; Fri, 20 Dec 2019 21:33:12 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBKLXC1V004028; Fri, 20 Dec 2019 21:33:12 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201912202133.xBKLXC1V004028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 20 Dec 2019 21:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355957 - head/contrib/llvm-project/clang/lib/Basic X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm-project/clang/lib/Basic X-SVN-Commit-Revision: 355957 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 21:33:13 -0000 Author: dim Date: Fri Dec 20 21:33:12 2019 New Revision: 355957 URL: https://svnweb.freebsd.org/changeset/base/355957 Log: Merge diff elimination updates from r355953 into vendor/llvm-project. Modified: head/contrib/llvm-project/clang/lib/Basic/Version.cpp Directory Properties: head/contrib/llvm-project/ (props changed) head/contrib/llvm-project/clang/ (props changed) Modified: head/contrib/llvm-project/clang/lib/Basic/Version.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Basic/Version.cpp Fri Dec 20 21:31:08 2019 (r355956) +++ head/contrib/llvm-project/clang/lib/Basic/Version.cpp Fri Dec 20 21:33:12 2019 (r355957) @@ -35,7 +35,7 @@ std::string getClangRepositoryPath() { // If the CLANG_REPOSITORY is empty, try to use the SVN keyword. This helps us // pick up a tag in an SVN export, for example. - StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_900/final/lib/Basic/Version.cpp $"); + StringRef SVNRepository("$URL$"); if (URL.empty()) { URL = SVNRepository.slice(SVNRepository.find(':'), SVNRepository.find("/lib/Basic")); From owner-svn-src-head@freebsd.org Fri Dec 20 21:41:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B2DC51E44FF; Fri, 20 Dec 2019 21:41:33 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47fhyj426pz4SNm; Fri, 20 Dec 2019 21:41:33 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 800F25265; Fri, 20 Dec 2019 21:41:33 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBKLfXZ3009040; Fri, 20 Dec 2019 21:41:33 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBKLfXo9009039; Fri, 20 Dec 2019 21:41:33 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201912202141.xBKLfXo9009039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 20 Dec 2019 21:41:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355958 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 355958 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 21:41:33 -0000 Author: rmacklem Date: Fri Dec 20 21:41:33 2019 New Revision: 355958 URL: https://svnweb.freebsd.org/changeset/base/355958 Log: Update the man page to reflect the addition of NFSv4.2 (r355677). Include references to NFSv4.2 and Flexible File layout, plus clarify when vfs.nfsd.flexlinuxhack needs to be set for Linux pNFS clients. Also update the man page to reflect the addition of SpaceUsed to the attributes stored in the extended attribute on the MDS (r354158). This is a content change. Modified: head/usr.sbin/nfsd/pnfs.4 Modified: head/usr.sbin/nfsd/pnfs.4 ============================================================================== --- head/usr.sbin/nfsd/pnfs.4 Fri Dec 20 21:33:12 2019 (r355957) +++ head/usr.sbin/nfsd/pnfs.4 Fri Dec 20 21:41:33 2019 (r355958) @@ -23,19 +23,21 @@ .\" .\" $FreeBSD$ .\" -.Dd August 5, 2018 +.Dd December 20, 2019 .Dt PNFS 4 .Os .Sh NAME .Nm pNFS -.Nd NFS Version 4.1 Parallel NFS Protocol +.Nd NFS Version 4.1 and 4.2 Parallel NFS Protocol .Sh DESCRIPTION -The NFSv4.1 client and server provides support for the +The NFSv4.1 and NFSv4.2 client and server provides support for the .Tn pNFS specification; see -.%T "Network File System (NFS) Version 4 Minor Version 1 Protocol RFC 5661" . -A pNFS service separates Read/Write operations from all other NFSv4.1 -operations, which are referred to as Metadata operations. +.%T "Network File System (NFS) Version 4 Minor Version 1 Protocol RFC 5661" , +.%T "Network File System (NFS) Version 4 Minor Version 2 Protocol RFC 7862" and +.%T "Parallel NFS (pNFS) Flexible File Layout RFC 8435" . +A pNFS service separates Read/Write operations from all other NFSv4.1 and +NFSv4.2 operations, which are referred to as Metadata operations. The Read/Write operations are performed directly on the Data Server (DS) where the file's data resides, bypassing the NFS server. All other file operations are performed on the NFS server, which is referred to @@ -45,8 +47,8 @@ NFS clients that do not support perform Read/Write operations on the MDS, which acts as a proxy for the appropriate DS(s). .Pp -The NFSv4.1 protocol provides two pieces of information to pNFS aware -clients that allow them to perform Read/Write operations directly on +The NFSv4.1 and NFSv4.2 protocols provide two pieces of information to pNFS +aware clients that allow them to perform Read/Write operations directly on the DS. .Pp The first is DeviceInfo, which is static information defining the DS @@ -72,20 +74,21 @@ at least for certain layout types such as the Flexible .Pp The FreeBSD client and server supports two layout types. .Pp -The File Layout is described in RFC5661 and uses the NFSv4.1 protocol +The File Layout is described in RFC5661 and uses the NFSv4.1 or NFSv4.2 protocol to perform I/O on the DS. It does not support client aware DS mirroring and, as such, the FreeBSD server only provides File Layout support for non-mirrored configurations. .Pp -The Flexible File Layout allows the use of the NFSv3, NFSv4.0 or NFSv4.1 -protocol to perform I/O on the DS and does support client aware mirroring. +The Flexible File Layout allows the use of the NFSv3, NFSv4.0, NFSv4.1 or +NFSv4.2 protocol to perform I/O on the DS and does support client aware +mirroring. As such, the FreeBSD server uses Flexible File Layout layouts for the mirrored DS configurations. The FreeBSD server supports the .Dq tightly coupled -variant and all DSs use the -NFSv4.1 protocol for I/O operations. +variant and all DSs allow use of the +NFSv4.2 or NFSv4.1 protocol for I/O operations. Clients that support the Flexible File Layout will do writes and commits to all DS mirrors in the mirror set. .Pp @@ -107,6 +110,7 @@ A FreeBSD client must be running the .Xr nfscbd 8 daemon and use the mount options +.Dq nfsv4,minorversion=2,pnfs or .Dq nfsv4,minorversion=1,pnfs . .Pp When files are created, the MDS creates a file tree identical to what a @@ -120,7 +124,7 @@ attribute name space: pnfsd.dsfile - This extended attrbute stores the information that the MDS needs to find the data file on a DS(s) for this file. pnfsd.dsattr - This extended attribute stores the Size, AccessTime, - ModifyTime and Change attributes for the file. + ModifyTime, Change and SpaceUsed attributes for the file. .Ed .Pp For each regular (VREG) file, the MDS creates a data file on one @@ -142,7 +146,8 @@ or Flexible File Layout layouts and associated DeviceInfo. For non-pNFS aware NFS clients, the pNFS service appears just like a normal NFS service. -For the non-pNFS aware client, the MDS will perform I/O operations on the appropriate DS(s), acting as +For the non-pNFS aware client, the MDS will perform I/O operations on the +appropriate DS(s), acting as a proxy for the non-pNFS aware client. This is also true for NFSv3 and NFSv4.0 mounts, since these are always non-pNFS aware. @@ -182,16 +187,17 @@ For Linux 4.17-rc2 kernels, I have not seen client cra but it only supports the .Dq loosely coupled variant. -To make it work correctly when mounting the FreeBSD server, you must either -patch the Flexible File Layout client driver with a patch like: -.Bd -literal -offset indent -http://people.freebsd.org/~rmacklem/flexfile.patch -.Ed -.sp -or set the sysctl +To make it work correctly when mounting the FreeBSD server, you must +set the sysctl .Dq vfs.nfsd.flexlinuxhack to one so that it works around the Linux client driver's limitations. +Wihout this sysctl being set, there will be access errors, since the Linux +client will use the authenticator in the layout (uid=999, gid=999) and not +the authenticator specified in the RPC header. +.Pp +Linux 5.n kernels appear to be patched so that it uses the authenticator +in the RPC header and, as such, the above sysctl should not need to be set. .Pp Since the MDS cannot be mirrored, it is a single point of failure just as a non From owner-svn-src-head@freebsd.org Fri Dec 20 21:42:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BCB3C1E4779; Fri, 20 Dec 2019 21:42:10 +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 47fhzQ526jz4SZt; Fri, 20 Dec 2019 21:42:10 +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 A78CE53A0; Fri, 20 Dec 2019 21:42:10 +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 xBKLgACg009811; Fri, 20 Dec 2019 21:42:10 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBKLgAaj009810; Fri, 20 Dec 2019 21:42:10 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201912202142.xBKLgAaj009810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 20 Dec 2019 21:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355959 - 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: 355959 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 21:42:10 -0000 Author: dim Date: Fri Dec 20 21:42:10 2019 New Revision: 355959 URL: https://svnweb.freebsd.org/changeset/base/355959 Log: Consolidate FREEBSD-Xlist files of different llvm sub-projects into one. Added: head/contrib/llvm-project/FREEBSD-Xlist (contents, props changed) Deleted: head/contrib/llvm-project/clang/FREEBSD-Xlist head/contrib/llvm-project/compiler-rt/FREEBSD-Xlist head/contrib/llvm-project/libcxx/FREEBSD-Xlist head/contrib/llvm-project/libcxx/FREEBSD-upgrade head/contrib/llvm-project/libunwind/FREEBSD-Xlist head/contrib/llvm-project/lld/FREEBSD-Xlist head/contrib/llvm-project/lldb/FREEBSD-Xlist head/contrib/llvm-project/llvm/FREEBSD-Xlist head/contrib/llvm-project/openmp/FREEBSD-Xlist Added: head/contrib/llvm-project/FREEBSD-Xlist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm-project/FREEBSD-Xlist Fri Dec 20 21:42:10 2019 (r355959) @@ -0,0 +1,1000 @@ +# $FreeBSD$ +.arcconfig +.clang-format +.clang-tidy +.gitignore +README.md +clang/.arcconfig +clang/.clang-format +clang/.clang-tidy +clang/.gitignore +clang/CMakeLists.txt +clang/CODE_OWNERS.TXT +clang/INPUTS/ +clang/INSTALL.txt +clang/ModuleInfo.txt +clang/NOTES.txt +clang/README.txt +clang/bindings/ +clang/cmake/ +clang/docs/ +clang/examples/ +clang/include/CMakeLists.txt +clang/include/clang/AST/CMakeLists.txt +clang/include/clang/Basic/CMakeLists.txt +clang/include/clang/Basic/Version.inc.in +clang/include/clang/CMakeLists.txt +clang/include/clang/Config/ +clang/include/clang/Driver/CMakeLists.txt +clang/include/clang/Parse/CMakeLists.txt +clang/include/clang/Sema/CMakeLists.txt +clang/include/clang/Serialization/CMakeLists.txt +clang/include/clang/StaticAnalyzer/Checkers/CMakeLists.txt +clang/lib/ARCMigrate/CMakeLists.txt +clang/lib/AST/CMakeLists.txt +clang/lib/ASTMatchers/CMakeLists.txt +clang/lib/ASTMatchers/Dynamic/CMakeLists.txt +clang/lib/Analysis/CMakeLists.txt +clang/lib/Analysis/plugins/CMakeLists.txt +clang/lib/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt +clang/lib/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt +clang/lib/Analysis/plugins/SampleAnalyzer/CMakeLists.txt +clang/lib/Basic/CMakeLists.txt +clang/lib/CMakeLists.txt +clang/lib/CodeGen/CMakeLists.txt +clang/lib/CodeGen/README.txt +clang/lib/CrossTU/CMakeLists.txt +clang/lib/DirectoryWatcher/CMakeLists.txt +clang/lib/Driver/CMakeLists.txt +clang/lib/Edit/CMakeLists.txt +clang/lib/Format/CMakeLists.txt +clang/lib/Frontend/CMakeLists.txt +clang/lib/Frontend/Rewrite/CMakeLists.txt +clang/lib/FrontendTool/CMakeLists.txt +clang/lib/Headers/CMakeLists.txt +clang/lib/Index/CMakeLists.txt +clang/lib/Lex/CMakeLists.txt +clang/lib/Parse/CMakeLists.txt +clang/lib/Rewrite/CMakeLists.txt +clang/lib/Sema/CMakeLists.txt +clang/lib/Serialization/CMakeLists.txt +clang/lib/StaticAnalyzer/CMakeLists.txt +clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt +clang/lib/StaticAnalyzer/Core/CMakeLists.txt +clang/lib/StaticAnalyzer/Frontend/CMakeLists.txt +clang/lib/StaticAnalyzer/README.txt +clang/lib/Tooling/ASTDiff/CMakeLists.txt +clang/lib/Tooling/CMakeLists.txt +clang/lib/Tooling/Core/CMakeLists.txt +clang/lib/Tooling/DependencyScanning/CMakeLists.txt +clang/lib/Tooling/Inclusions/CMakeLists.txt +clang/lib/Tooling/Refactoring/CMakeLists.txt +clang/lib/Tooling/Syntax/CMakeLists.txt +clang/runtime/ +clang/test/ +clang/tools/CMakeLists.txt +clang/tools/arcmt-test/ +clang/tools/c-arcmt-test/ +clang/tools/c-index-test/ +clang/tools/clang-check/ +clang/tools/clang-diff/ +clang/tools/clang-extdef-mapping/ +clang/tools/clang-format/CMakeLists.txt +clang/tools/clang-format/clang-format-bbedit.applescript +clang/tools/clang-format/clang-format-diff.py +clang/tools/clang-format/clang-format-sublime.py +clang/tools/clang-format/clang-format-test.el +clang/tools/clang-format/clang-format.el +clang/tools/clang-format/clang-format.py +clang/tools/clang-format/fuzzer/ +clang/tools/clang-format/git-clang-format +clang/tools/clang-format-vs/ +clang/tools/clang-fuzzer/ +clang/tools/clang-import-test/ +clang/tools/clang-offload-bundler/ +clang/tools/clang-refactor/ +clang/tools/clang-rename/ +clang/tools/clang-scan-deps/ +clang/tools/clang-shlib/ +clang/tools/diag-build/ +clang/tools/diagtool/ +clang/tools/driver/CMakeLists.txt +clang/tools/driver/Info.plist.in +clang/tools/libclang/ +clang/tools/scan-build/ +clang/tools/scan-build-py/ +clang/tools/scan-view/ +clang/unittests/ +clang/utils/ABITest/ +clang/utils/CIndex/ +clang/utils/CaptureCmd +clang/utils/ClangDataFormat.py +clang/utils/ClangVisualizers/ +clang/utils/CmpDriver +clang/utils/FindSpecRefs +clang/utils/FuzzTest +clang/utils/TableGen/CMakeLists.txt +clang/utils/TestUtils/ +clang/utils/VtableTest/ +clang/utils/analyzer/ +clang/utils/bash-autocomplete.sh +clang/utils/builtin-defines.c +clang/utils/check_cfc/ +clang/utils/clangdiag.py +clang/utils/creduce-clang-crash.py +clang/utils/find-unused-diagnostics.sh +clang/utils/hmaptool/ +clang/utils/make-ast-dump-check.sh +clang/utils/modfuzz.py +clang/utils/perf-training/ +clang/utils/token-delta.py +clang/utils/valgrind/ +clang/www/ +clang-tools-extra/ +compiler-rt/.arcconfig +compiler-rt/.gitignore +compiler-rt/CMakeLists.txt +compiler-rt/CODE_OWNERS.TXT +compiler-rt/cmake/ +compiler-rt/docs/ +compiler-rt/include/CMakeLists.txt +compiler-rt/lib/CMakeLists.txt +compiler-rt/lib/asan/.clang-format +compiler-rt/lib/asan/CMakeLists.txt +compiler-rt/lib/asan/scripts/ +compiler-rt/lib/asan/tests/ +compiler-rt/lib/builtins/CMakeLists.txt +compiler-rt/lib/builtins/Darwin-excludes/ +compiler-rt/lib/builtins/macho_embedded/ +compiler-rt/lib/cfi/CMakeLists.txt +compiler-rt/lib/crt/CMakeLists.txt +compiler-rt/lib/dfsan/.clang-format +compiler-rt/lib/dfsan/CMakeLists.txt +compiler-rt/lib/dfsan/scripts/ +compiler-rt/lib/fuzzer/CMakeLists.txt +compiler-rt/lib/fuzzer/afl/ +compiler-rt/lib/fuzzer/build.sh +compiler-rt/lib/fuzzer/dataflow/ +compiler-rt/lib/fuzzer/scripts/ +compiler-rt/lib/fuzzer/standalone/ +compiler-rt/lib/fuzzer/tests/ +compiler-rt/lib/gwp_asan/CMakeLists.txt +compiler-rt/lib/gwp_asan/tests/ +compiler-rt/lib/hwasan/.clang-format +compiler-rt/lib/hwasan/CMakeLists.txt +compiler-rt/lib/interception/.clang-format +compiler-rt/lib/interception/CMakeLists.txt +compiler-rt/lib/interception/tests/ +compiler-rt/lib/lsan/.clang-format +compiler-rt/lib/lsan/CMakeLists.txt +compiler-rt/lib/msan/.clang-format +compiler-rt/lib/msan/CMakeLists.txt +compiler-rt/lib/msan/tests/ +compiler-rt/lib/profile/CMakeLists.txt +compiler-rt/lib/safestack/.clang-format +compiler-rt/lib/safestack/CMakeLists.txt +compiler-rt/lib/sanitizer_common/.clang-format +compiler-rt/lib/sanitizer_common/.clang-tidy +compiler-rt/lib/sanitizer_common/CMakeLists.txt +compiler-rt/lib/sanitizer_common/scripts/ +compiler-rt/lib/sanitizer_common/tests/ +compiler-rt/lib/scudo/CMakeLists.txt +compiler-rt/lib/scudo/standalone/CMakeLists.txt +compiler-rt/lib/scudo/standalone/tests/ +compiler-rt/lib/stats/CMakeLists.txt +compiler-rt/lib/tsan/.clang-format +compiler-rt/lib/tsan/CMakeLists.txt +compiler-rt/lib/tsan/analyze_libtsan.sh +compiler-rt/lib/tsan/check_analyze.sh +compiler-rt/lib/tsan/check_cmake.sh +compiler-rt/lib/tsan/dd/CMakeLists.txt +compiler-rt/lib/tsan/go/build.bat +compiler-rt/lib/tsan/go/buildgo.sh +compiler-rt/lib/tsan/tests/ +compiler-rt/lib/ubsan/CMakeLists.txt +compiler-rt/lib/ubsan_minimal/CMakeLists.txt +compiler-rt/lib/xray/CMakeLists.txt +compiler-rt/lib/xray/tests/ +compiler-rt/test/ +compiler-rt/unittests/ +compiler-rt/utils/ +compiler-rt/www/ +debuginfo-tests/ +libclc/ +libcxx/.arcconfig +libcxx/.clang-format +libcxx/.gitignore +libcxx/CMakeLists.txt +libcxx/NOTES.TXT +libcxx/TODO.TXT +libcxx/appveyor-reqs-install.cmd +libcxx/appveyor.yml +libcxx/benchmarks/ +libcxx/cmake/ +libcxx/docs/ +libcxx/fuzzing/ +libcxx/include/CMakeLists.txt +libcxx/include/__config_site.in +libcxx/include/support/ +libcxx/lib/ +libcxx/src/support/solaris/ +libcxx/src/support/win32/ +libcxx/test/ +libcxx/utils/ +libcxx/www/ +libcxxabi/ +libunwind/.arcconfig +libunwind/.clang-format +libunwind/CMakeLists.txt +libunwind/cmake/ +libunwind/docs/ +libunwind/src/CMakeLists.txt +libunwind/test/ +lld/MinGW/ +lld/cmake/ +lld/test/ +lld/unittests/ +lld/utils/ +lld/wasm/ +lldb/.arcconfig +lldb/.clang-format +lldb/.gitignore +lldb/CMakeLists.txt +lldb/CODE_OWNERS.txt +lldb/INSTALL.txt +lldb/cmake/ +lldb/docs/.htaccess +lldb/docs/CMakeLists.txt +lldb/docs/_static/ +lldb/docs/conf.py +lldb/docs/doxygen-mainpage.dox +lldb/docs/doxygen.cfg.in +lldb/docs/index.rst +lldb/docs/lldb-for-gdb-users.txt +lldb/docs/lldb-gdb-remote.txt +lldb/docs/lldb-platform-packets.txt +lldb/docs/resources/ +lldb/docs/status/ +lldb/docs/structured_data/ +lldb/docs/testsuite/ +lldb/docs/use/ +lldb/examples/ +lldb/include/lldb/Host/Config.h +lldb/include/lldb/Host/android/ +lldb/include/lldb/Host/linux/ +lldb/include/lldb/Host/macosx/ +lldb/include/lldb/Host/windows/ +lldb/lit/ +lldb/lldb.xcodeproj/ +lldb/lldb.xcworkspace/ +lldb/packages/ +lldb/resources/ +lldb/scripts/ +lldb/source/API/CMakeLists.txt +lldb/source/Breakpoint/CMakeLists.txt +lldb/source/CMakeLists.txt +lldb/source/Commands/CMakeLists.txt +lldb/source/Core/CMakeLists.txt +lldb/source/DataFormatters/CMakeLists.txt +lldb/source/Expression/CMakeLists.txt +lldb/source/Host/CMakeLists.txt +lldb/source/Host/android/ +lldb/source/Host/linux/ +lldb/source/Host/macosx/ +lldb/source/Host/windows/ +lldb/source/Initialization/CMakeLists.txt +lldb/source/Interpreter/CMakeLists.txt +lldb/source/Plugins/ABI/CMakeLists.txt +lldb/source/Plugins/ABI/MacOSX-arm/CMakeLists.txt +lldb/source/Plugins/ABI/MacOSX-arm64/CMakeLists.txt +lldb/source/Plugins/ABI/MacOSX-i386/CMakeLists.txt +lldb/source/Plugins/ABI/SysV-arm/CMakeLists.txt +lldb/source/Plugins/ABI/SysV-arm64/CMakeLists.txt +lldb/source/Plugins/ABI/SysV-hexagon/CMakeLists.txt +lldb/source/Plugins/ABI/SysV-i386/CMakeLists.txt +lldb/source/Plugins/ABI/SysV-mips/CMakeLists.txt +lldb/source/Plugins/ABI/SysV-mips64/CMakeLists.txt +lldb/source/Plugins/ABI/SysV-ppc/CMakeLists.txt +lldb/source/Plugins/ABI/SysV-ppc64/CMakeLists.txt +lldb/source/Plugins/ABI/SysV-s390x/CMakeLists.txt +lldb/source/Plugins/ABI/SysV-x86_64/CMakeLists.txt +lldb/source/Plugins/ABI/Windows-x86_64/CMakeLists.txt +lldb/source/Plugins/Architecture/Arm/CMakeLists.txt +lldb/source/Plugins/Architecture/CMakeLists.txt +lldb/source/Plugins/Architecture/Mips/CMakeLists.txt +lldb/source/Plugins/Architecture/PPC64/CMakeLists.txt +lldb/source/Plugins/CMakeLists.txt +lldb/source/Plugins/Disassembler/CMakeLists.txt +lldb/source/Plugins/Disassembler/llvm/CMakeLists.txt +lldb/source/Plugins/DynamicLoader/CMakeLists.txt +lldb/source/Plugins/DynamicLoader/Darwin-Kernel/ +lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/CMakeLists.txt +lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/ +lldb/source/Plugins/DynamicLoader/POSIX-DYLD/CMakeLists.txt +lldb/source/Plugins/DynamicLoader/Static/CMakeLists.txt +lldb/source/Plugins/DynamicLoader/Windows-DYLD/CMakeLists.txt +lldb/source/Plugins/ExpressionParser/CMakeLists.txt +lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt +lldb/source/Plugins/Instruction/ARM/CMakeLists.txt +lldb/source/Plugins/Instruction/ARM64/CMakeLists.txt +lldb/source/Plugins/Instruction/CMakeLists.txt +lldb/source/Plugins/Instruction/MIPS/CMakeLists.txt +lldb/source/Plugins/Instruction/MIPS64/CMakeLists.txt +lldb/source/Plugins/Instruction/PPC64/CMakeLists.txt +lldb/source/Plugins/InstrumentationRuntime/ASan/CMakeLists.txt +lldb/source/Plugins/InstrumentationRuntime/CMakeLists.txt +lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/CMakeLists.txt +lldb/source/Plugins/InstrumentationRuntime/TSan/CMakeLists.txt +lldb/source/Plugins/InstrumentationRuntime/UBSan/CMakeLists.txt +lldb/source/Plugins/JITLoader/CMakeLists.txt +lldb/source/Plugins/JITLoader/GDB/CMakeLists.txt +lldb/source/Plugins/Language/CMakeLists.txt +lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt +lldb/source/Plugins/Language/ClangCommon/CMakeLists.txt +lldb/source/Plugins/Language/ObjC/CMakeLists.txt +lldb/source/Plugins/Language/ObjCPlusPlus/CMakeLists.txt +lldb/source/Plugins/LanguageRuntime/CMakeLists.txt +lldb/source/Plugins/LanguageRuntime/CPlusPlus/CMakeLists.txt +lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/CMakeLists.txt +lldb/source/Plugins/LanguageRuntime/Go/ +lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt +lldb/source/Plugins/LanguageRuntime/ObjC/CMakeLists.txt +lldb/source/Plugins/LanguageRuntime/RenderScript/CMakeLists.txt +lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt +lldb/source/Plugins/MemoryHistory/CMakeLists.txt +lldb/source/Plugins/MemoryHistory/asan/CMakeLists.txt +lldb/source/Plugins/ObjectContainer/BSD-Archive/CMakeLists.txt +lldb/source/Plugins/ObjectContainer/CMakeLists.txt +lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ +lldb/source/Plugins/ObjectFile/Breakpad/CMakeLists.txt +lldb/source/Plugins/ObjectFile/CMakeLists.txt +lldb/source/Plugins/ObjectFile/ELF/CMakeLists.txt +lldb/source/Plugins/ObjectFile/JIT/CMakeLists.txt +lldb/source/Plugins/ObjectFile/Mach-O/ +lldb/source/Plugins/ObjectFile/PECOFF/ +lldb/source/Plugins/OperatingSystem/CMakeLists.txt +lldb/source/Plugins/OperatingSystem/Python/CMakeLists.txt +lldb/source/Plugins/Platform/Android/ +lldb/source/Plugins/Platform/CMakeLists.txt +lldb/source/Plugins/Platform/FreeBSD/CMakeLists.txt +lldb/source/Plugins/Platform/Linux/ +lldb/source/Plugins/Platform/MacOSX/ +lldb/source/Plugins/Platform/NetBSD/CMakeLists.txt +lldb/source/Plugins/Platform/OpenBSD/CMakeLists.txt +lldb/source/Plugins/Platform/POSIX/CMakeLists.txt +lldb/source/Plugins/Platform/Windows/ +lldb/source/Plugins/Platform/gdb-server/CMakeLists.txt +lldb/source/Plugins/Process/CMakeLists.txt +lldb/source/Plugins/Process/FreeBSD/CMakeLists.txt +lldb/source/Plugins/Process/Linux/ +lldb/source/Plugins/Process/MacOSX-Kernel/ +lldb/source/Plugins/Process/NetBSD/CMakeLists.txt +lldb/source/Plugins/Process/POSIX/CMakeLists.txt +lldb/source/Plugins/Process/Utility/CMakeLists.txt +lldb/source/Plugins/Process/Windows/ +lldb/source/Plugins/Process/elf-core/CMakeLists.txt +lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt +lldb/source/Plugins/Process/mach-core/ +lldb/source/Plugins/Process/minidump/CMakeLists.txt +lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt +lldb/source/Plugins/ScriptInterpreter/None/CMakeLists.txt +lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt +lldb/source/Plugins/StructuredData/CMakeLists.txt +lldb/source/Plugins/StructuredData/DarwinLog/CMakeLists.txt +lldb/source/Plugins/SymbolFile/Breakpad/CMakeLists.txt +lldb/source/Plugins/SymbolFile/CMakeLists.txt +lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt +lldb/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt +lldb/source/Plugins/SymbolFile/PDB/CMakeLists.txt +lldb/source/Plugins/SymbolFile/Symtab/CMakeLists.txt +lldb/source/Plugins/SymbolVendor/CMakeLists.txt +lldb/source/Plugins/SymbolVendor/ELF/CMakeLists.txt +lldb/source/Plugins/SymbolVendor/MacOSX/ +lldb/source/Plugins/SystemRuntime/ +lldb/source/Plugins/UnwindAssembly/CMakeLists.txt +lldb/source/Plugins/UnwindAssembly/InstEmulation/CMakeLists.txt +lldb/source/Plugins/UnwindAssembly/x86/CMakeLists.txt +lldb/source/Symbol/CMakeLists.txt +lldb/source/Target/CMakeLists.txt +lldb/source/Utility/CMakeLists.txt +lldb/test/ +lldb/third_party/ +lldb/tools/CMakeLists.txt +lldb/tools/argdumper/CMakeLists.txt +lldb/tools/darwin-debug/ +lldb/tools/darwin-threads/ +lldb/tools/debugserver/ +lldb/tools/driver/CMakeLists.txt +lldb/tools/driver/lldb-Info.plist +lldb/tools/intel-features/ +lldb/tools/lldb-instr/CMakeLists.txt +lldb/tools/lldb-mi/CMakeLists.txt +lldb/tools/lldb-mi/lldb-Info.plist +lldb/tools/lldb-perf/ +lldb/tools/lldb-server/CMakeLists.txt +lldb/tools/lldb-test/ +lldb/tools/lldb-vscode/ +lldb/unittests/ +lldb/use_lldb_suite_root.py +lldb/utils/TableGen/CMakeLists.txt +lldb/utils/git-svn/ +lldb/utils/lit-cpuid/ +lldb/utils/lldb-dotest/ +lldb/utils/lui/ +lldb/utils/misc/ +lldb/utils/sync-source/ +lldb/utils/test/ +lldb/utils/vim-lldb/ +llgo/ +llvm/.arcconfig +llvm/.clang-format +llvm/.clang-tidy +llvm/.gitattributes +llvm/.gitignore +llvm/CMakeLists.txt +llvm/CODE_OWNERS.TXT +llvm/CREDITS.TXT +llvm/LLVMBuild.txt +llvm/README.txt +llvm/RELEASE_TESTERS.TXT +llvm/benchmarks/ +llvm/bindings/ +llvm/cmake/ +llvm/configure +llvm/docs/ +llvm/examples/ +llvm/include/llvm/CMakeLists.txt +llvm/include/llvm/Config/ +llvm/include/llvm/IR/CMakeLists.txt +llvm/include/llvm/Support/CMakeLists.txt +llvm/include/llvm/Support/LICENSE.TXT +llvm/lib/Analysis/CMakeLists.txt +llvm/lib/Analysis/LLVMBuild.txt +llvm/lib/Analysis/README.txt +llvm/lib/AsmParser/CMakeLists.txt +llvm/lib/AsmParser/LLVMBuild.txt +llvm/lib/BinaryFormat/CMakeLists.txt +llvm/lib/BinaryFormat/LLVMBuild.txt +llvm/lib/Bitcode/CMakeLists.txt +llvm/lib/Bitcode/LLVMBuild.txt +llvm/lib/Bitcode/Reader/CMakeLists.txt +llvm/lib/Bitcode/Reader/LLVMBuild.txt +llvm/lib/Bitcode/Writer/CMakeLists.txt +llvm/lib/Bitcode/Writer/LLVMBuild.txt +llvm/lib/Bitstream/CMakeLists.txt +llvm/lib/Bitstream/LLVMBuild.txt +llvm/lib/Bitstream/Reader/CMakeLists.txt +llvm/lib/Bitstream/Reader/LLVMBuild.txt +llvm/lib/CMakeLists.txt +llvm/lib/CodeGen/AsmPrinter/CMakeLists.txt +llvm/lib/CodeGen/AsmPrinter/LLVMBuild.txt +llvm/lib/CodeGen/CMakeLists.txt +llvm/lib/CodeGen/GlobalISel/CMakeLists.txt +llvm/lib/CodeGen/GlobalISel/LLVMBuild.txt +llvm/lib/CodeGen/LLVMBuild.txt +llvm/lib/CodeGen/MIRParser/CMakeLists.txt +llvm/lib/CodeGen/MIRParser/LLVMBuild.txt +llvm/lib/CodeGen/README.txt +llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt +llvm/lib/CodeGen/SelectionDAG/LLVMBuild.txt +llvm/lib/DebugInfo/CMakeLists.txt +llvm/lib/DebugInfo/CodeView/CMakeLists.txt +llvm/lib/DebugInfo/CodeView/LLVMBuild.txt +llvm/lib/DebugInfo/DWARF/CMakeLists.txt +llvm/lib/DebugInfo/DWARF/LLVMBuild.txt +llvm/lib/DebugInfo/GSYM/CMakeLists.txt +llvm/lib/DebugInfo/GSYM/LLVMBuild.txt +llvm/lib/DebugInfo/LLVMBuild.txt +llvm/lib/DebugInfo/MSF/CMakeLists.txt +llvm/lib/DebugInfo/MSF/LLVMBuild.txt +llvm/lib/DebugInfo/PDB/CMakeLists.txt +llvm/lib/DebugInfo/PDB/LLVMBuild.txt +llvm/lib/DebugInfo/Symbolize/CMakeLists.txt +llvm/lib/DebugInfo/Symbolize/LLVMBuild.txt +llvm/lib/Demangle/CMakeLists.txt +llvm/lib/Demangle/LLVMBuild.txt +llvm/lib/ExecutionEngine/CMakeLists.txt +llvm/lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt +llvm/lib/ExecutionEngine/IntelJITEvents/LLVMBuild.txt +llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt +llvm/lib/ExecutionEngine/Interpreter/LLVMBuild.txt +llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt +llvm/lib/ExecutionEngine/JITLink/LLVMBuild.txt +llvm/lib/ExecutionEngine/LLVMBuild.txt +llvm/lib/ExecutionEngine/MCJIT/CMakeLists.txt +llvm/lib/ExecutionEngine/MCJIT/LLVMBuild.txt +llvm/lib/ExecutionEngine/OProfileJIT/CMakeLists.txt +llvm/lib/ExecutionEngine/OProfileJIT/LLVMBuild.txt +llvm/lib/ExecutionEngine/Orc/CMakeLists.txt +llvm/lib/ExecutionEngine/Orc/LLVMBuild.txt +llvm/lib/ExecutionEngine/PerfJITEvents/CMakeLists.txt +llvm/lib/ExecutionEngine/PerfJITEvents/LLVMBuild.txt +llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt +llvm/lib/ExecutionEngine/RuntimeDyld/LLVMBuild.txt +llvm/lib/FuzzMutate/CMakeLists.txt +llvm/lib/FuzzMutate/LLVMBuild.txt +llvm/lib/Fuzzer/ +llvm/lib/IR/CMakeLists.txt +llvm/lib/IR/LLVMBuild.txt +llvm/lib/IRReader/CMakeLists.txt +llvm/lib/IRReader/LLVMBuild.txt +llvm/lib/LLVMBuild.txt +llvm/lib/LTO/CMakeLists.txt +llvm/lib/LTO/LLVMBuild.txt +llvm/lib/LineEditor/CMakeLists.txt +llvm/lib/LineEditor/LLVMBuild.txt +llvm/lib/Linker/CMakeLists.txt +llvm/lib/Linker/LLVMBuild.txt +llvm/lib/MC/CMakeLists.txt +llvm/lib/MC/LLVMBuild.txt +llvm/lib/MC/MCDisassembler/CMakeLists.txt +llvm/lib/MC/MCDisassembler/LLVMBuild.txt +llvm/lib/MC/MCParser/CMakeLists.txt +llvm/lib/MC/MCParser/LLVMBuild.txt +llvm/lib/MCA/CMakeLists.txt +llvm/lib/MCA/LLVMBuild.txt +llvm/lib/Object/CMakeLists.txt +llvm/lib/Object/LLVMBuild.txt +llvm/lib/ObjectYAML/CMakeLists.txt +llvm/lib/ObjectYAML/LLVMBuild.txt +llvm/lib/Option/CMakeLists.txt +llvm/lib/Option/LLVMBuild.txt +llvm/lib/Passes/CMakeLists.txt +llvm/lib/Passes/LLVMBuild.txt +llvm/lib/ProfileData/CMakeLists.txt +llvm/lib/ProfileData/Coverage/CMakeLists.txt +llvm/lib/ProfileData/Coverage/LLVMBuild.txt +llvm/lib/ProfileData/LLVMBuild.txt +llvm/lib/Remarks/CMakeLists.txt +llvm/lib/Remarks/LLVMBuild.txt +llvm/lib/Support/CMakeLists.txt +llvm/lib/Support/LLVMBuild.txt +llvm/lib/TableGen/CMakeLists.txt +llvm/lib/TableGen/LLVMBuild.txt +llvm/lib/Target/AArch64/AsmParser/CMakeLists.txt +llvm/lib/Target/AArch64/AsmParser/LLVMBuild.txt +llvm/lib/Target/AArch64/CMakeLists.txt +llvm/lib/Target/AArch64/Disassembler/CMakeLists.txt +llvm/lib/Target/AArch64/Disassembler/LLVMBuild.txt +llvm/lib/Target/AArch64/LLVMBuild.txt +llvm/lib/Target/AArch64/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/AArch64/MCTargetDesc/LLVMBuild.txt +llvm/lib/Target/AArch64/TargetInfo/CMakeLists.txt +llvm/lib/Target/AArch64/TargetInfo/LLVMBuild.txt +llvm/lib/Target/AArch64/Utils/CMakeLists.txt +llvm/lib/Target/AArch64/Utils/LLVMBuild.txt +llvm/lib/Target/AMDGPU/AsmParser/CMakeLists.txt +llvm/lib/Target/AMDGPU/AsmParser/LLVMBuild.txt +llvm/lib/Target/AMDGPU/CMakeLists.txt +llvm/lib/Target/AMDGPU/Disassembler/CMakeLists.txt +llvm/lib/Target/AMDGPU/Disassembler/LLVMBuild.txt +llvm/lib/Target/AMDGPU/LLVMBuild.txt +llvm/lib/Target/AMDGPU/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/AMDGPU/MCTargetDesc/LLVMBuild.txt +llvm/lib/Target/AMDGPU/TargetInfo/CMakeLists.txt +llvm/lib/Target/AMDGPU/TargetInfo/LLVMBuild.txt +llvm/lib/Target/AMDGPU/Utils/CMakeLists.txt +llvm/lib/Target/AMDGPU/Utils/LLVMBuild.txt +llvm/lib/Target/ARC/CMakeLists.txt +llvm/lib/Target/ARC/Disassembler/CMakeLists.txt +llvm/lib/Target/ARC/Disassembler/LLVMBuild.txt +llvm/lib/Target/ARC/LLVMBuild.txt +llvm/lib/Target/ARC/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/ARC/MCTargetDesc/LLVMBuild.txt +llvm/lib/Target/ARC/TargetInfo/CMakeLists.txt +llvm/lib/Target/ARC/TargetInfo/LLVMBuild.txt +llvm/lib/Target/ARM/AsmParser/CMakeLists.txt +llvm/lib/Target/ARM/AsmParser/LLVMBuild.txt +llvm/lib/Target/ARM/CMakeLists.txt +llvm/lib/Target/ARM/Disassembler/CMakeLists.txt +llvm/lib/Target/ARM/Disassembler/LLVMBuild.txt +llvm/lib/Target/ARM/LLVMBuild.txt +llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/ARM/MCTargetDesc/LLVMBuild.txt +llvm/lib/Target/ARM/README-Thumb.txt +llvm/lib/Target/ARM/README-Thumb2.txt +llvm/lib/Target/ARM/README.txt +llvm/lib/Target/ARM/TargetInfo/CMakeLists.txt +llvm/lib/Target/ARM/TargetInfo/LLVMBuild.txt +llvm/lib/Target/ARM/Utils/CMakeLists.txt +llvm/lib/Target/ARM/Utils/LLVMBuild.txt +llvm/lib/Target/AVR/AsmParser/CMakeLists.txt +llvm/lib/Target/AVR/AsmParser/LLVMBuild.txt +llvm/lib/Target/AVR/CMakeLists.txt +llvm/lib/Target/AVR/Disassembler/CMakeLists.txt +llvm/lib/Target/AVR/Disassembler/LLVMBuild.txt +llvm/lib/Target/AVR/LLVMBuild.txt +llvm/lib/Target/AVR/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/AVR/MCTargetDesc/LLVMBuild.txt +llvm/lib/Target/AVR/TargetInfo/CMakeLists.txt +llvm/lib/Target/AVR/TargetInfo/LLVMBuild.txt +llvm/lib/Target/BPF/AsmParser/CMakeLists.txt +llvm/lib/Target/BPF/AsmParser/LLVMBuild.txt +llvm/lib/Target/BPF/CMakeLists.txt +llvm/lib/Target/BPF/Disassembler/CMakeLists.txt +llvm/lib/Target/BPF/Disassembler/LLVMBuild.txt +llvm/lib/Target/BPF/LLVMBuild.txt +llvm/lib/Target/BPF/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/BPF/MCTargetDesc/LLVMBuild.txt +llvm/lib/Target/BPF/TargetInfo/CMakeLists.txt +llvm/lib/Target/BPF/TargetInfo/LLVMBuild.txt +llvm/lib/Target/CMakeLists.txt +llvm/lib/Target/Hexagon/AsmParser/CMakeLists.txt +llvm/lib/Target/Hexagon/AsmParser/LLVMBuild.txt +llvm/lib/Target/Hexagon/CMakeLists.txt +llvm/lib/Target/Hexagon/Disassembler/CMakeLists.txt +llvm/lib/Target/Hexagon/Disassembler/LLVMBuild.txt +llvm/lib/Target/Hexagon/LLVMBuild.txt +llvm/lib/Target/Hexagon/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/Hexagon/MCTargetDesc/LLVMBuild.txt +llvm/lib/Target/Hexagon/TargetInfo/CMakeLists.txt +llvm/lib/Target/Hexagon/TargetInfo/LLVMBuild.txt +llvm/lib/Target/LLVMBuild.txt +llvm/lib/Target/Lanai/AsmParser/CMakeLists.txt +llvm/lib/Target/Lanai/AsmParser/LLVMBuild.txt +llvm/lib/Target/Lanai/CMakeLists.txt +llvm/lib/Target/Lanai/Disassembler/CMakeLists.txt +llvm/lib/Target/Lanai/Disassembler/LLVMBuild.txt +llvm/lib/Target/Lanai/LLVMBuild.txt +llvm/lib/Target/Lanai/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/Lanai/MCTargetDesc/LLVMBuild.txt +llvm/lib/Target/Lanai/TargetInfo/CMakeLists.txt +llvm/lib/Target/Lanai/TargetInfo/LLVMBuild.txt +llvm/lib/Target/MSP430/AsmParser/CMakeLists.txt +llvm/lib/Target/MSP430/AsmParser/LLVMBuild.txt +llvm/lib/Target/MSP430/CMakeLists.txt +llvm/lib/Target/MSP430/Disassembler/CMakeLists.txt +llvm/lib/Target/MSP430/Disassembler/LLVMBuild.txt +llvm/lib/Target/MSP430/LLVMBuild.txt +llvm/lib/Target/MSP430/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/MSP430/MCTargetDesc/LLVMBuild.txt +llvm/lib/Target/MSP430/README.txt +llvm/lib/Target/MSP430/TargetInfo/CMakeLists.txt +llvm/lib/Target/MSP430/TargetInfo/LLVMBuild.txt +llvm/lib/Target/Mips/AsmParser/CMakeLists.txt +llvm/lib/Target/Mips/AsmParser/LLVMBuild.txt +llvm/lib/Target/Mips/CMakeLists.txt +llvm/lib/Target/Mips/Disassembler/CMakeLists.txt +llvm/lib/Target/Mips/Disassembler/LLVMBuild.txt +llvm/lib/Target/Mips/LLVMBuild.txt +llvm/lib/Target/Mips/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/Mips/MCTargetDesc/LLVMBuild.txt +llvm/lib/Target/Mips/TargetInfo/CMakeLists.txt +llvm/lib/Target/Mips/TargetInfo/LLVMBuild.txt +llvm/lib/Target/NVPTX/CMakeLists.txt +llvm/lib/Target/NVPTX/LLVMBuild.txt +llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/NVPTX/MCTargetDesc/LLVMBuild.txt +llvm/lib/Target/NVPTX/TargetInfo/CMakeLists.txt +llvm/lib/Target/NVPTX/TargetInfo/LLVMBuild.txt +llvm/lib/Target/PowerPC/AsmParser/CMakeLists.txt +llvm/lib/Target/PowerPC/AsmParser/LLVMBuild.txt +llvm/lib/Target/PowerPC/CMakeLists.txt +llvm/lib/Target/PowerPC/Disassembler/CMakeLists.txt +llvm/lib/Target/PowerPC/Disassembler/LLVMBuild.txt +llvm/lib/Target/PowerPC/LLVMBuild.txt +llvm/lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/PowerPC/MCTargetDesc/LLVMBuild.txt +llvm/lib/Target/PowerPC/README.txt +llvm/lib/Target/PowerPC/README_ALTIVEC.txt +llvm/lib/Target/PowerPC/TargetInfo/CMakeLists.txt +llvm/lib/Target/PowerPC/TargetInfo/LLVMBuild.txt +llvm/lib/Target/README.txt +llvm/lib/Target/RISCV/AsmParser/CMakeLists.txt +llvm/lib/Target/RISCV/AsmParser/LLVMBuild.txt +llvm/lib/Target/RISCV/CMakeLists.txt +llvm/lib/Target/RISCV/Disassembler/CMakeLists.txt +llvm/lib/Target/RISCV/Disassembler/LLVMBuild.txt +llvm/lib/Target/RISCV/LLVMBuild.txt +llvm/lib/Target/RISCV/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/RISCV/MCTargetDesc/LLVMBuild.txt +llvm/lib/Target/RISCV/TargetInfo/CMakeLists.txt +llvm/lib/Target/RISCV/TargetInfo/LLVMBuild.txt +llvm/lib/Target/RISCV/Utils/CMakeLists.txt +llvm/lib/Target/RISCV/Utils/LLVMBuild.txt +llvm/lib/Target/Sparc/AsmParser/CMakeLists.txt +llvm/lib/Target/Sparc/AsmParser/LLVMBuild.txt +llvm/lib/Target/Sparc/CMakeLists.txt +llvm/lib/Target/Sparc/Disassembler/CMakeLists.txt +llvm/lib/Target/Sparc/Disassembler/LLVMBuild.txt +llvm/lib/Target/Sparc/LLVMBuild.txt +llvm/lib/Target/Sparc/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/Sparc/MCTargetDesc/LLVMBuild.txt +llvm/lib/Target/Sparc/README.txt +llvm/lib/Target/Sparc/TargetInfo/CMakeLists.txt +llvm/lib/Target/Sparc/TargetInfo/LLVMBuild.txt +llvm/lib/Target/SystemZ/AsmParser/CMakeLists.txt +llvm/lib/Target/SystemZ/AsmParser/LLVMBuild.txt +llvm/lib/Target/SystemZ/CMakeLists.txt +llvm/lib/Target/SystemZ/Disassembler/CMakeLists.txt +llvm/lib/Target/SystemZ/Disassembler/LLVMBuild.txt +llvm/lib/Target/SystemZ/LLVMBuild.txt +llvm/lib/Target/SystemZ/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/SystemZ/MCTargetDesc/LLVMBuild.txt +llvm/lib/Target/SystemZ/TargetInfo/CMakeLists.txt +llvm/lib/Target/SystemZ/TargetInfo/LLVMBuild.txt +llvm/lib/Target/WebAssembly/AsmParser/CMakeLists.txt +llvm/lib/Target/WebAssembly/AsmParser/LLVMBuild.txt +llvm/lib/Target/WebAssembly/CMakeLists.txt +llvm/lib/Target/WebAssembly/Disassembler/CMakeLists.txt +llvm/lib/Target/WebAssembly/Disassembler/LLVMBuild.txt +llvm/lib/Target/WebAssembly/LLVMBuild.txt +llvm/lib/Target/WebAssembly/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/WebAssembly/MCTargetDesc/LLVMBuild.txt +llvm/lib/Target/WebAssembly/TargetInfo/CMakeLists.txt +llvm/lib/Target/WebAssembly/TargetInfo/LLVMBuild.txt +llvm/lib/Target/X86/AsmParser/CMakeLists.txt +llvm/lib/Target/X86/AsmParser/LLVMBuild.txt +llvm/lib/Target/X86/CMakeLists.txt +llvm/lib/Target/X86/Disassembler/CMakeLists.txt +llvm/lib/Target/X86/Disassembler/LLVMBuild.txt +llvm/lib/Target/X86/LLVMBuild.txt +llvm/lib/Target/X86/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/X86/MCTargetDesc/LLVMBuild.txt +llvm/lib/Target/X86/README-FPStack.txt +llvm/lib/Target/X86/README-SSE.txt +llvm/lib/Target/X86/README-X86-64.txt +llvm/lib/Target/X86/README.txt +llvm/lib/Target/X86/TargetInfo/CMakeLists.txt +llvm/lib/Target/X86/TargetInfo/LLVMBuild.txt +llvm/lib/Target/X86/Utils/CMakeLists.txt +llvm/lib/Target/X86/Utils/LLVMBuild.txt +llvm/lib/Target/XCore/CMakeLists.txt +llvm/lib/Target/XCore/Disassembler/CMakeLists.txt +llvm/lib/Target/XCore/Disassembler/LLVMBuild.txt +llvm/lib/Target/XCore/LLVMBuild.txt +llvm/lib/Target/XCore/MCTargetDesc/CMakeLists.txt +llvm/lib/Target/XCore/MCTargetDesc/LLVMBuild.txt +llvm/lib/Target/XCore/README.txt +llvm/lib/Target/XCore/TargetInfo/CMakeLists.txt +llvm/lib/Target/XCore/TargetInfo/LLVMBuild.txt +llvm/lib/Testing/CMakeLists.txt +llvm/lib/Testing/LLVMBuild.txt +llvm/lib/Testing/Support/CMakeLists.txt +llvm/lib/Testing/Support/LLVMBuild.txt +llvm/lib/TextAPI/CMakeLists.txt +llvm/lib/TextAPI/LLVMBuild.txt +llvm/lib/ToolDrivers/CMakeLists.txt +llvm/lib/ToolDrivers/LLVMBuild.txt +llvm/lib/ToolDrivers/llvm-dlltool/CMakeLists.txt +llvm/lib/ToolDrivers/llvm-dlltool/LLVMBuild.txt +llvm/lib/ToolDrivers/llvm-lib/CMakeLists.txt +llvm/lib/ToolDrivers/llvm-lib/LLVMBuild.txt +llvm/lib/Transforms/AggressiveInstCombine/CMakeLists.txt +llvm/lib/Transforms/AggressiveInstCombine/LLVMBuild.txt +llvm/lib/Transforms/CMakeLists.txt +llvm/lib/Transforms/Coroutines/CMakeLists.txt +llvm/lib/Transforms/Coroutines/LLVMBuild.txt +llvm/lib/Transforms/Hello/ +llvm/lib/Transforms/IPO/CMakeLists.txt +llvm/lib/Transforms/IPO/LLVMBuild.txt +llvm/lib/Transforms/InstCombine/CMakeLists.txt +llvm/lib/Transforms/InstCombine/LLVMBuild.txt +llvm/lib/Transforms/Instrumentation/CMakeLists.txt +llvm/lib/Transforms/Instrumentation/LLVMBuild.txt +llvm/lib/Transforms/LLVMBuild.txt +llvm/lib/Transforms/ObjCARC/CMakeLists.txt +llvm/lib/Transforms/ObjCARC/LLVMBuild.txt +llvm/lib/Transforms/Scalar/CMakeLists.txt +llvm/lib/Transforms/Scalar/LLVMBuild.txt +llvm/lib/Transforms/Utils/CMakeLists.txt +llvm/lib/Transforms/Utils/LLVMBuild.txt +llvm/lib/Transforms/Vectorize/CMakeLists.txt +llvm/lib/Transforms/Vectorize/LLVMBuild.txt +llvm/lib/WindowsManifest/CMakeLists.txt +llvm/lib/WindowsManifest/LLVMBuild.txt +llvm/lib/XRay/CMakeLists.txt +llvm/lib/XRay/LLVMBuild.txt +llvm/llvm.spec.in +llvm/projects/ +llvm/resources/ +llvm/runtimes/ +llvm/test/ +llvm/tools/CMakeLists.txt +llvm/tools/LLVMBuild.txt +llvm/tools/bugpoint/CMakeLists.txt +llvm/tools/bugpoint/LLVMBuild.txt +llvm/tools/bugpoint-passes/ +llvm/tools/dsymutil/ +llvm/tools/gold/ +llvm/tools/llc/CMakeLists.txt +llvm/tools/llc/LLVMBuild.txt +llvm/tools/lli/CMakeLists.txt +llvm/tools/lli/ChildTarget/CMakeLists.txt +llvm/tools/lli/ChildTarget/LLVMBuild.txt +llvm/tools/lli/LLVMBuild.txt +llvm/tools/llvm-ar/CMakeLists.txt +llvm/tools/llvm-ar/LLVMBuild.txt +llvm/tools/llvm-as/CMakeLists.txt +llvm/tools/llvm-as/LLVMBuild.txt +llvm/tools/llvm-as-fuzzer/ +llvm/tools/llvm-bcanalyzer/CMakeLists.txt +llvm/tools/llvm-bcanalyzer/LLVMBuild.txt +llvm/tools/llvm-c-test/ +llvm/tools/llvm-cat/ +llvm/tools/llvm-cfi-verify/ +llvm/tools/llvm-config/ +llvm/tools/llvm-cov/CMakeLists.txt +llvm/tools/llvm-cov/LLVMBuild.txt +llvm/tools/llvm-cvtres/ +llvm/tools/llvm-cxxdump/CMakeLists.txt +llvm/tools/llvm-cxxdump/LLVMBuild.txt +llvm/tools/llvm-cxxfilt/CMakeLists.txt +llvm/tools/llvm-cxxmap/CMakeLists.txt +llvm/tools/llvm-cxxmap/LLVMBuild.txt +llvm/tools/llvm-diff/CMakeLists.txt +llvm/tools/llvm-diff/LLVMBuild.txt +llvm/tools/llvm-dis/CMakeLists.txt +llvm/tools/llvm-dis/LLVMBuild.txt +llvm/tools/llvm-dwarfdump/CMakeLists.txt +llvm/tools/llvm-dwarfdump/LLVMBuild.txt +llvm/tools/llvm-dwarfdump/fuzzer/ +llvm/tools/llvm-dwp/ +llvm/tools/llvm-elfabi/ +llvm/tools/llvm-exegesis/ +llvm/tools/llvm-extract/CMakeLists.txt +llvm/tools/llvm-extract/LLVMBuild.txt +llvm/tools/llvm-go/ +llvm/tools/llvm-isel-fuzzer/ +llvm/tools/llvm-itanium-demangle-fuzzer/ +llvm/tools/llvm-jitlink/ +llvm/tools/llvm-jitlistener/ +llvm/tools/llvm-link/CMakeLists.txt +llvm/tools/llvm-link/LLVMBuild.txt +llvm/tools/llvm-lipo/ +llvm/tools/llvm-lto/CMakeLists.txt +llvm/tools/llvm-lto/LLVMBuild.txt +llvm/tools/llvm-lto2/CMakeLists.txt +llvm/tools/llvm-lto2/LLVMBuild.txt +llvm/tools/llvm-mc/CMakeLists.txt +llvm/tools/llvm-mc/LLVMBuild.txt +llvm/tools/llvm-mc-assemble-fuzzer/ +llvm/tools/llvm-mc-disassemble-fuzzer/ +llvm/tools/llvm-mca/CMakeLists.txt +llvm/tools/llvm-mca/LLVMBuild.txt +llvm/tools/llvm-microsoft-demangle-fuzzer/ +llvm/tools/llvm-modextract/CMakeLists.txt +llvm/tools/llvm-modextract/LLVMBuild.txt +llvm/tools/llvm-mt/ +llvm/tools/llvm-nm/CMakeLists.txt +llvm/tools/llvm-nm/LLVMBuild.txt +llvm/tools/llvm-objcopy/CMakeLists.txt +llvm/tools/llvm-objcopy/LLVMBuild.txt +llvm/tools/llvm-objdump/CMakeLists.txt +llvm/tools/llvm-objdump/LLVMBuild.txt +llvm/tools/llvm-opt-fuzzer/ +llvm/tools/llvm-opt-report/ +llvm/tools/llvm-pdbutil/CMakeLists.txt +llvm/tools/llvm-pdbutil/LLVMBuild.txt +llvm/tools/llvm-profdata/CMakeLists.txt +llvm/tools/llvm-profdata/LLVMBuild.txt +llvm/tools/llvm-rc/ +llvm/tools/llvm-readobj/CMakeLists.txt +llvm/tools/llvm-readobj/LLVMBuild.txt +llvm/tools/llvm-rtdyld/CMakeLists.txt +llvm/tools/llvm-rtdyld/LLVMBuild.txt +llvm/tools/llvm-shlib/ +llvm/tools/llvm-size/ +llvm/tools/llvm-special-case-list-fuzzer/ +llvm/tools/llvm-split/ +llvm/tools/llvm-stress/CMakeLists.txt +llvm/tools/llvm-stress/LLVMBuild.txt +llvm/tools/llvm-strings/ +llvm/tools/llvm-symbolizer/CMakeLists.txt +llvm/tools/llvm-undname/ +llvm/tools/llvm-xray/CMakeLists.txt +llvm/tools/llvm-yaml-numeric-parser-fuzzer/ +llvm/tools/lto/ +llvm/tools/msbuild/ +llvm/tools/obj2yaml/ +llvm/tools/opt/CMakeLists.txt +llvm/tools/opt/LLVMBuild.txt +llvm/tools/opt-viewer/ +llvm/tools/remarks-shlib/ +llvm/tools/sancov/ +llvm/tools/sanstats/ +llvm/tools/verify-uselistorder/ +llvm/tools/xcode-toolchain/ +llvm/tools/yaml2obj/ +llvm/unittests/ +llvm/utils/DSAclean.py +llvm/utils/DSAextract.py +llvm/utils/FileCheck/ +llvm/utils/GenLibDeps.pl +llvm/utils/GetRepositoryPath +llvm/utils/GetSourceVersion +llvm/utils/KillTheDoctor/ +llvm/utils/LLVMBuild.txt +llvm/utils/LLVMVisualizers/ +llvm/utils/Misc/ +llvm/utils/PerfectShuffle/ +llvm/utils/Reviewing/ +llvm/utils/TableGen/CMakeLists.txt +llvm/utils/TableGen/LLVMBuild.txt +llvm/utils/TableGen/tdtags +llvm/utils/Target/ +llvm/utils/UpdateCMakeLists.pl +llvm/utils/UpdateTestChecks/ +llvm/utils/abtest.py +llvm/utils/benchmark/ +llvm/utils/bisect +llvm/utils/bisect-skip-count +llvm/utils/bugpoint/ +llvm/utils/bugpoint_gisel_reducer.py +llvm/utils/check-each-file +llvm/utils/chunk-print-before-all.py +llvm/utils/clang-parse-diagnostics-file +llvm/utils/codegen-diff +llvm/utils/collect_and_build_with_pgo.py +llvm/utils/count/ +llvm/utils/countloc.sh +llvm/utils/create_ladder_graph.py +llvm/utils/crosstool/ +llvm/utils/demangle_tree.py +llvm/utils/docker/ +llvm/utils/emacs/ +llvm/utils/extract_symbols.py +llvm/utils/extract_vplan.py +llvm/utils/findmisopt +llvm/utils/findoptdiff +llvm/utils/findsym.pl +llvm/utils/fpcmp/ +llvm/utils/gdb-scripts/ +llvm/utils/getsrcs.sh +llvm/utils/git-svn/ +llvm/utils/gn/ +llvm/utils/indirect_calls.py +llvm/utils/jedit/ +llvm/utils/kate/ +llvm/utils/lint/ +llvm/utils/lit/ +llvm/utils/lldbDataFormatters.py +llvm/utils/llvm-build/ +llvm/utils/llvm-compilers-check +llvm/utils/llvm-gisel-cov.py +llvm/utils/llvm-lit/ +llvm/utils/llvm-native-gxx +llvm/utils/llvm.grm +llvm/utils/llvmdo +llvm/utils/llvmgrep +llvm/utils/not/ +llvm/utils/prepare-code-coverage-artifact.py +llvm/utils/release/ +llvm/utils/sanitizers/ +llvm/utils/schedcover.py +llvm/utils/shuffle_fuzz.py +llvm/utils/shuffle_select_fuzz_tester.py +llvm/utils/sort_includes.py +llvm/utils/testgen/ +llvm/utils/textmate/ +llvm/utils/unicode-case-fold.py +llvm/utils/unittest/ +llvm/utils/update_analyze_test_checks.py +llvm/utils/update_cc_test_checks.py +llvm/utils/update_llc_test_checks.py +llvm/utils/update_mca_test_checks.py +llvm/utils/update_mir_test_checks.py +llvm/utils/update_test_checks.py +llvm/utils/valgrind/ +llvm/utils/vim/ +llvm/utils/vscode/ +llvm/utils/wciia.py +llvm/utils/yaml-bench/ +openmp/.arcconfig +openmp/.gitignore +openmp/CMakeLists.txt +openmp/README.rst +openmp/cmake/ +openmp/libomptarget/ +openmp/runtime/.clang-format +openmp/runtime/CMakeLists.txt +openmp/runtime/README.txt +openmp/runtime/cmake/ +openmp/runtime/doc/ +openmp/runtime/src/CMakeLists.txt +openmp/runtime/test/ +openmp/runtime/tools/ +openmp/www/ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Dec 20 21:45:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D3E0D1E4833; Fri, 20 Dec 2019 21:45:20 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47fj345LCrz4SlF; Fri, 20 Dec 2019 21:45:20 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE52853CA; Fri, 20 Dec 2019 21:45:20 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBKLjKxx010025; Fri, 20 Dec 2019 21:45:20 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBKLjKRo010024; Fri, 20 Dec 2019 21:45:20 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201912202145.xBKLjKRo010024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 20 Dec 2019 21:45:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355960 - head/usr.sbin/nfsd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/nfsd X-SVN-Commit-Revision: 355960 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 21:45:20 -0000 Author: rmacklem Date: Fri Dec 20 21:45:20 2019 New Revision: 355960 URL: https://svnweb.freebsd.org/changeset/base/355960 Log: Update the man page to reflect the addition of NFSv4.2 (r355677). Update all the references to NFSv4.1, so that they apply to NFSv4.1 and NFSv4.2. Also, change the MDS->DS mounts to use NFSv4.2, so that both versions of the protocol can be used against the server with pNFS enabled. This is a content change. Modified: head/usr.sbin/nfsd/pnfsserver.4 Modified: head/usr.sbin/nfsd/pnfsserver.4 ============================================================================== --- head/usr.sbin/nfsd/pnfsserver.4 Fri Dec 20 21:42:10 2019 (r355959) +++ head/usr.sbin/nfsd/pnfsserver.4 Fri Dec 20 21:45:20 2019 (r355960) @@ -23,12 +23,12 @@ .\" .\" $FreeBSD$ .\" -.Dd August 8, 2018 +.Dd December 20, 2019 .Dt PNFSSERVER 4 .Os .Sh NAME .Nm pNFSserver -.Nd NFS Version 4.1 Parallel NFS Protocol Server +.Nd NFS Version 4.1 and 4.2 Parallel NFS Protocol Server .Sh DESCRIPTION A set of FreeBSD servers may be configured to provide a .Xr pnfs 4 @@ -37,13 +37,23 @@ One FreeBSD system needs to be configured as a MetaDat at least one additional FreeBSD system needs to be configured as one or more Data Servers (DS)s. .Pp -These FreeBSD systems are configured to be NFSv4.1 servers, see +These FreeBSD systems are configured to be NFSv4.1 and NFSv4.2 +servers, see .Xr nfsd 8 and .Xr exports 5 -if you are not familiar with configuring a NFSv4.1 server. +if you are not familiar with configuring a NFSv4.n server. +All DS(s) and the MDS should support NFSv4.2 as well as NFSv4.1. +Mixing an MDS that supports NFSv4.2 with any DS(s) that do not support +NFSv4.2 will not work correctly. +As such, all DS(s) must be upgraded from +.Fx 12 +to +.Fx 13 +before upgrading the MDS. .Sh DS server configuration -The DS(s) need to be configured as NFSv4.1 server(s), with a top level exported +The DS(s) need to be configured as NFSv4.1 and NFSv4.2 server(s), +with a top level exported directory used for storage of data files. This directory must be owned by .Dq root @@ -89,8 +99,8 @@ DS system. .Sh MDS server configuration The MDS must be a separate FreeBSD system from the FreeBSD DS system(s) and NFS clients. -It is configured as a NFSv4.1 server with file system(s) exported to -clients. +It is configured as a NFSv4.1 and NFSv4.2 server with +file system(s) exported to clients. However, the .Dq -p command line argument for @@ -99,7 +109,7 @@ is used to indicate that it is running as the MDS for .Pp The DS(s) must all be mounted on the MDS using the following mount options: .Bd -literal -offset indent -nfsv4,minorversion=1,soft,retrans=2 +nfsv4,minorversion=2,soft,retrans=2 .Ed .sp so that they can be defined as DSs in the @@ -112,10 +122,10 @@ For example, if there are four DSs named nfsv4-data[0- .Xr fstab 5 lines might look like: .Bd -literal -offset -nfsv4-data0:/ /data0 nfs rw,nfsv4,minorversion=1,soft,retrans=2 0 0 -nfsv4-data1:/ /data1 nfs rw,nfsv4,minorversion=1,soft,retrans=2 0 0 -nfsv4-data2:/ /data2 nfs rw,nfsv4,minorversion=1,soft,retrans=2 0 0 -nfsv4-data3:/ /data3 nfs rw,nfsv4,minorversion=1,soft,retrans=2 0 0 +nfsv4-data0:/ /data0 nfs rw,nfsv4,minorversion=2,soft,retrans=2 0 0 +nfsv4-data1:/ /data1 nfs rw,nfsv4,minorversion=2,soft,retrans=2 0 0 +nfsv4-data2:/ /data2 nfs rw,nfsv4,minorversion=2,soft,retrans=2 0 0 +nfsv4-data3:/ /data3 nfs rw,nfsv4,minorversion=2,soft,retrans=2 0 0 .Ed .sp The @@ -201,7 +211,8 @@ For a service that will store a large number of files set much larger, to avoid the number of entries in a subdirectory from getting too large. .Sh Client mounts -Once operational, NFSv4.1 FreeBSD client mounts done with the +Once operational, NFSv4.1 or NFSv4.2 FreeBSD client mounts +done with the .Dq pnfs option should do I/O directly on the DSs. The clients mounting the MDS must be running the @@ -325,7 +336,7 @@ directory for storage of data files just like it did w Mount it on the MDS exactly as you did before disabling it. For the nfsv4-data3 example, the command would be: .Bd -literal -offset -# mount -t nfs -o nfsv4,minorversion=1,soft,retrans=2 nfsv4-data3:/ /data3 +# mount -t nfs -o nfsv4,minorversion=2,soft,retrans=2 nfsv4-data3:/ /data3 .Ed .sp Then restart the nfsd to re-enable the DS. @@ -403,7 +414,7 @@ http://people.freebsd.org/~rmacklem/pnfs-planb-setup.t .Sh HISTORY The .Nm -command first appeared in +service first appeared in .Fx 12.0 . .Sh BUGS Since the MDS cannot be mirrored, it is a single point of failure just From owner-svn-src-head@freebsd.org Fri Dec 20 21:56:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 668531E4B91; Fri, 20 Dec 2019 21:56:29 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47fjHx20vSz4TLW; Fri, 20 Dec 2019 21:56:29 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 402C055A1; Fri, 20 Dec 2019 21:56:29 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBKLuT9s016565; Fri, 20 Dec 2019 21:56:29 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBKLuThD016564; Fri, 20 Dec 2019 21:56:29 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201912202156.xBKLuThD016564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 20 Dec 2019 21:56:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355962 - head/lib/libsecureboot X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: head/lib/libsecureboot X-SVN-Commit-Revision: 355962 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 21:56:29 -0000 Author: sjg Date: Fri Dec 20 21:56:28 2019 New Revision: 355962 URL: https://svnweb.freebsd.org/changeset/base/355962 Log: Avoid unused vars when VE_ECDSA_HASH_AGAIN undefined Reviewed by: emaste MFC after: 1 week Modified: head/lib/libsecureboot/vets.c Modified: head/lib/libsecureboot/vets.c ============================================================================== --- head/lib/libsecureboot/vets.c Fri Dec 20 21:55:13 2019 (r355961) +++ head/lib/libsecureboot/vets.c Fri Dec 20 21:56:28 2019 (r355962) @@ -642,9 +642,10 @@ hexdigest(char *buf, size_t bufsz, unsigned char *foo, static unsigned char * verify_ec(br_x509_pkey *pk, const char *file, const char *sigfile) { - char hexbuf[br_sha512_SIZE * 2 + 2]; +#ifdef VE_ECDSA_HASH_AGAIN + char *hex, hexbuf[br_sha512_SIZE * 2 + 2]; +#endif unsigned char rhbuf[br_sha512_SIZE]; - char *hex; br_sha256_context ctx; unsigned char *fcp, *scp; size_t flen, slen, plen; From owner-svn-src-head@freebsd.org Fri Dec 20 22:14:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3064D1E5739; Fri, 20 Dec 2019 22:14:26 +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 47fjhd3tRFz4W7F; Fri, 20 Dec 2019 22:14:25 +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 xBKMEGcG032832 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 20 Dec 2019 14:14:16 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id xBKMEFro032831; Fri, 20 Dec 2019 14:14:15 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Fri, 20 Dec 2019 14:14:15 -0800 From: Gleb Smirnoff To: "Andrey V. Elsukov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r343631 - in head: . sbin sbin/pfilctl share/man/man9 sys/contrib/ipfilter/netinet sys/net sys/netinet sys/netinet6 sys/netpfil/ipfw sys/netpfil/pf Message-ID: <20191220221415.GU2706@FreeBSD.org> References: <201901312301.x0VN13lM097213@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="w2JjAQZceEVGylhD" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 47fjhd3tRFz4W7F X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.92 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.97)[-0.974,0]; NEURAL_HAM_LONG(-0.94)[-0.944,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2019 22:14:26 -0000 --w2JjAQZceEVGylhD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Dec 18, 2019 at 03:27:58PM +0300, Andrey V. Elsukov wrote: A> > Log: A> > New pfil(9) KPI together with newborn pfil API and control utility. A> > A> > The KPI have been reviewed and cleansed of features that were planned A> > back 20 years ago and never implemented. The pfil(9) internals have A> > been made opaque to protocols with only returned types and function A> > declarations exposed. The KPI is made more strict, but at the same time A> > more extensible, as kernel uses same command structures that userland A> > ioctl uses. A> > A> > In nutshell [KA]PI is about declaring filtering points, declaring A> > filters and linking and unlinking them together. A> > A> > New [KA]PI makes it possible to reconfigure pfil(9) configuration: A> > change order of hooks, rehook filter from one filtering point to a A> > different one, disconnect a hook on output leaving it on input only, A> > prepend/append a filter to existing list of filters. A> > A> > Now it possible for a single packet filter to provide multiple rulesets A> > that may be linked to different points. Think of per-interface ACLs in A> > Cisco or Juniper. None of existing packet filters yet support that, A> > however limited usage is already possible, e.g. default ruleset can A> > be moved to single interface, as soon as interface would pride their A> > filtering points. A> > A> > Another future feature is possiblity to create pfil heads, that provide A> > not an mbuf pointer but just a memory pointer with length. That would A> > allow filtering at very early stages of a packet lifecycle, e.g. when A> > packet has just been received by a NIC and no mbuf was yet allocated. A> It seems that this commit has changed the error code returned from A> ip[6]_output() when a packet is blocked. Previously it was EACCES, but A> now it became EPERM. Was it intentional? I don't think that was intentional. Can you please review this patch? -- Gleb Smirnoff --w2JjAQZceEVGylhD Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="EACCES.diff" Index: sys/net/if_bridge.c =================================================================== --- sys/net/if_bridge.c (revision 355964) +++ sys/net/if_bridge.c (working copy) @@ -3191,7 +3191,7 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, dir == PFIL_OUT && ifp != NULL) { switch (pfil_run_hooks(V_link_pfil_head, mp, ifp, dir, NULL)) { case PFIL_DROPPED: - return (EPERM); + return (EACCES); case PFIL_CONSUMED: return (0); } @@ -3312,7 +3312,7 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, case PFIL_CONSUMED: return (0); case PFIL_DROPPED: - return (EPERM); + return (EACCES); default: break; } Index: sys/netinet/ip_output.c =================================================================== --- sys/netinet/ip_output.c (revision 355964) +++ sys/netinet/ip_output.c (working copy) @@ -130,7 +130,7 @@ ip_output_pfil(struct mbuf **mp, struct ifnet *ifp odst.s_addr = ip->ip_dst.s_addr; switch (pfil_run_hooks(V_inet_pfil_head, mp, ifp, pflags, inp)) { case PFIL_DROPPED: - *error = EPERM; + *error = EACCES; /* FALLTHROUGH */ case PFIL_CONSUMED: return 1; /* Finished */ Index: sys/netinet6/ip6_output.c =================================================================== --- sys/netinet6/ip6_output.c (revision 355964) +++ sys/netinet6/ip6_output.c (working copy) @@ -898,7 +898,7 @@ again: ip6 = mtod(m, struct ip6_hdr *); break; case PFIL_DROPPED: - error = EPERM; + error = EACCES; /* FALLTHROUGH */ case PFIL_CONSUMED: goto done; --w2JjAQZceEVGylhD-- From owner-svn-src-head@freebsd.org Sat Dec 21 02:43:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 799CF1EC565; Sat, 21 Dec 2019 02:43:21 +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 47fqfx2fYCz3Fx7; Sat, 21 Dec 2019 02:43:21 +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 564498A4B; Sat, 21 Dec 2019 02:43:21 +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 xBL2hLcH088205; Sat, 21 Dec 2019 02:43:21 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBL2hLnv088204; Sat, 21 Dec 2019 02:43:21 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201912210243.xBL2hLnv088204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Sat, 21 Dec 2019 02:43:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355969 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 355969 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2019 02:43:21 -0000 Author: rlibby Date: Sat Dec 21 02:43:20 2019 New Revision: 355969 URL: https://svnweb.freebsd.org/changeset/base/355969 Log: gcc: quiet Wattribute for no_sanitize("address") This is an unfortunate instance where the __has_attribute check does not function usefully. Gcc does have the attribute, but for gcc it only applies to functions, not variables, and trying to apply it to a variable generates Wattribute. So far we only apply the attribute to variables. Only enable the attribute for clang, for now. Reviewed by: Anton Rang Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22875 Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sat Dec 21 02:40:40 2019 (r355968) +++ head/sys/sys/cdefs.h Sat Dec 21 02:43:20 2019 (r355969) @@ -873,8 +873,12 @@ /* Function should not be analyzed. */ #define __no_lock_analysis __lock_annotate(no_thread_safety_analysis) -/* Function or variable should not be sanitized, ie. by AddressSanitizer */ -#if __has_attribute(no_sanitize) +/* + * Function or variable should not be sanitized, i.e. by AddressSanitizer. + * GCC has the nosanitize attribute, but as a function attribute only, and + * warns on use as a variable attribute. + */ +#if __has_attribute(no_sanitize) && defined(__clang__) #define __nosanitizeaddress __attribute__((no_sanitize("address"))) #else #define __nosanitizeaddress From owner-svn-src-head@freebsd.org Sat Dec 21 02:43:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B3E01EC5FF; Sat, 21 Dec 2019 02:43:38 +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 47fqgF6cDFz3G5h; Sat, 21 Dec 2019 02:43:37 +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 DE3568A54; Sat, 21 Dec 2019 02:43:37 +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 xBL2hbhR088269; Sat, 21 Dec 2019 02:43:37 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBL2hbnK088268; Sat, 21 Dec 2019 02:43:37 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201912210243.xBL2hbnK088268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Sat, 21 Dec 2019 02:43:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355970 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 355970 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2019 02:43:38 -0000 Author: rlibby Date: Sat Dec 21 02:43:37 2019 New Revision: 355970 URL: https://svnweb.freebsd.org/changeset/base/355970 Log: gcc9: quiet Waddress-of-packed-member for kernel build This is lame, but it's what we already do for the clang build. We take misaligned pointers into network header structures in many places. Reviewed by: ian Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22876 Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Sat Dec 21 02:43:20 2019 (r355969) +++ head/sys/conf/kern.mk Sat Dec 21 02:43:37 2019 (r355970) @@ -70,6 +70,9 @@ CWARNEXTRA+= -Wno-error=memset-elt-size .if ${COMPILER_VERSION} >= 80000 CWARNEXTRA+= -Wno-error=packed-not-aligned .endif +.if ${COMPILER_VERSION} >= 90100 +CWARNEXTRA+= -Wno-address-of-packed-member +.endif .else # For gcc 4.2, eliminate the too-often-wrong warnings about uninitialized vars. CWARNEXTRA?= -Wno-uninitialized From owner-svn-src-head@freebsd.org Sat Dec 21 02:43:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E51691EC6C1; Sat, 21 Dec 2019 02:43:49 +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 47fqgT5rJJz3GFC; Sat, 21 Dec 2019 02:43:49 +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 C2D188A5D; Sat, 21 Dec 2019 02:43:49 +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 xBL2hnP0088330; Sat, 21 Dec 2019 02:43:49 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBL2hn9P088329; Sat, 21 Dec 2019 02:43:49 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201912210243.xBL2hn9P088329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Sat, 21 Dec 2019 02:43:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355971 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 355971 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2019 02:43:50 -0000 Author: rlibby Date: Sat Dec 21 02:43:49 2019 New Revision: 355971 URL: https://svnweb.freebsd.org/changeset/base/355971 Log: gcc9: quiet Waddress-of-packed-member for user build Disable the warning for WARNS <= 3. This is lame, but it's what we already do for the clang build. Reviewed by: dim Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22889 Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Sat Dec 21 02:43:37 2019 (r355970) +++ head/share/mk/bsd.sys.mk Sat Dec 21 02:43:49 2019 (r355971) @@ -94,6 +94,9 @@ CWARNFLAGS.clang+= -Wno-unused-local-typedef .if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 40000 CWARNFLAGS.clang+= -Wno-address-of-packed-member .endif +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 90100 +CWARNFLAGS.gcc+= -Wno-address-of-packed-member +.endif .if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 70000 && \ ${MACHINE_CPUARCH} == "arm" && !${MACHINE_ARCH:Marmv[67]*} CWARNFLAGS.clang+= -Wno-atomic-alignment From owner-svn-src-head@freebsd.org Sat Dec 21 02:44:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7F0C1EC773; Sat, 21 Dec 2019 02:44:01 +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 47fqgj4VYcz3GQw; Sat, 21 Dec 2019 02:44:01 +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 952BA8A5F; Sat, 21 Dec 2019 02:44:01 +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 xBL2i1Ro088424; Sat, 21 Dec 2019 02:44:01 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBL2i1RF088422; Sat, 21 Dec 2019 02:44:01 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201912210244.xBL2i1RF088422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Sat, 21 Dec 2019 02:44:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355972 - in head: sbin/camcontrol sys/sys X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: in head: sbin/camcontrol sys/sys X-SVN-Commit-Revision: 355972 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2019 02:44:01 -0000 Author: rlibby Date: Sat Dec 21 02:44:00 2019 New Revision: 355972 URL: https://svnweb.freebsd.org/changeset/base/355972 Log: Declare packed struct ata_params as 2-byte-aligned This avoids gcc9 warning about unaligned access to the structure when casting to uint16_t pointer type. Submitted by: imp Reviewed by: imp Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22888 Modified: head/sbin/camcontrol/camcontrol.c head/sys/sys/ata.h Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Sat Dec 21 02:43:49 2019 (r355971) +++ head/sbin/camcontrol/camcontrol.c Sat Dec 21 02:44:00 2019 (r355972) @@ -2355,7 +2355,7 @@ ataidentify(struct cam_device *device, int retry_count if (arglist & CAM_ARG_VERBOSE) { printf("%s%d: Raw identify data:\n", device->device_name, device->dev_unit_num); - dump_data((void*)ident_buf, sizeof(struct ata_params)); + dump_data((uint16_t *)ident_buf, sizeof(struct ata_params)); } if (ident_buf->support.command1 & ATA_SUPPORT_PROTECTED) { Modified: head/sys/sys/ata.h ============================================================================== --- head/sys/sys/ata.h Sat Dec 21 02:43:49 2019 (r355971) +++ head/sys/sys/ata.h Sat Dec 21 02:44:00 2019 (r355972) @@ -311,7 +311,7 @@ struct ata_params { /*223*/ u_int16_t transport_minor; u_int16_t reserved224[31]; /*255*/ u_int16_t integrity; -} __packed; +} __packed __aligned(2); /* ATA Dataset Management */ #define ATA_DSM_BLK_SIZE 512 From owner-svn-src-head@freebsd.org Sat Dec 21 02:44:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C8EB1EC7DA; Sat, 21 Dec 2019 02:44:14 +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 47fqgy1qs1z3GYj; Sat, 21 Dec 2019 02:44:14 +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 3A2998A68; Sat, 21 Dec 2019 02:44:14 +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 xBL2iE5m088487; Sat, 21 Dec 2019 02:44:14 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBL2iElH088486; Sat, 21 Dec 2019 02:44:14 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201912210244.xBL2iElH088486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Sat, 21 Dec 2019 02:44:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355973 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Commit-Revision: 355973 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2019 02:44:14 -0000 Author: rlibby Date: Sat Dec 21 02:44:13 2019 New Revision: 355973 URL: https://svnweb.freebsd.org/changeset/base/355973 Log: dtrace: avoid gcc9 Walloca-larger-than gcc9 grew a new warning for unbounded allocas, such as the one in dt_options_load. Remove both uses of alloca in dt_options.c. Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22880 Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c Sat Dec 21 02:44:00 2019 (r355972) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c Sat Dec 21 02:44:13 2019 (r355973) @@ -38,9 +38,6 @@ #include #include #include -#ifdef illumos -#include -#endif #include #include @@ -162,26 +159,40 @@ dt_opt_cpp_path(dtrace_hdl_t *dtp, const char *arg, ui static int dt_opt_cpp_opts(dtrace_hdl_t *dtp, const char *arg, uintptr_t option) { - char *buf; + char *buf = NULL; size_t len; const char *opt = (const char *)option; + int ret; - if (opt == NULL || arg == NULL) - return (dt_set_errno(dtp, EDT_BADOPTVAL)); + if (opt == NULL || arg == NULL) { + ret = dt_set_errno(dtp, EDT_BADOPTVAL); + goto out; + } - if (dtp->dt_pcb != NULL) - return (dt_set_errno(dtp, EDT_BADOPTCTX)); + if (dtp->dt_pcb != NULL) { + ret = dt_set_errno(dtp, EDT_BADOPTCTX); + goto out; + } len = strlen(opt) + strlen(arg) + 1; - buf = alloca(len); + if ((buf = dt_alloc(dtp, len)) == NULL) { + ret = dt_set_errno(dtp, EDT_NOMEM); + goto out; + } (void) strcpy(buf, opt); (void) strcat(buf, arg); - if (dt_cpp_add_arg(dtp, buf) == NULL) - return (dt_set_errno(dtp, EDT_NOMEM)); + if (dt_cpp_add_arg(dtp, buf) == NULL) { + ret = dt_set_errno(dtp, EDT_NOMEM); + goto out; + } - return (0); + ret = 0; +out: + if (buf != NULL) + dt_free(dtp, buf); + return (ret); } /*ARGSUSED*/ @@ -885,27 +896,35 @@ dt_options_load(dtrace_hdl_t *dtp) dof_hdr_t hdr, *dof; dof_sec_t *sec; size_t offs; - int i; + int i, ret; /* * To load the option values, we need to ask the kernel to provide its * DOF, which we'll sift through to look for OPTDESC sections. */ + dof = &hdr; bzero(&hdr, sizeof (dof_hdr_t)); hdr.dofh_loadsz = sizeof (dof_hdr_t); #ifdef illumos - if (dt_ioctl(dtp, DTRACEIOC_DOFGET, &hdr) == -1) + if (dt_ioctl(dtp, DTRACEIOC_DOFGET, dof) == -1) #else - dof = &hdr; if (dt_ioctl(dtp, DTRACEIOC_DOFGET, &dof) == -1) #endif - return (dt_set_errno(dtp, errno)); + { + ret = dt_set_errno(dtp, errno); + goto out; + } - if (hdr.dofh_loadsz < sizeof (dof_hdr_t)) - return (dt_set_errno(dtp, EINVAL)); + if (hdr.dofh_loadsz < sizeof (dof_hdr_t)) { + ret = dt_set_errno(dtp, EINVAL); + goto out; + } - dof = alloca(hdr.dofh_loadsz); + if ((dof = dt_alloc(dtp, hdr.dofh_loadsz)) == NULL) { + ret = dt_set_errno(dtp, EDT_NOMEM); + goto out; + } bzero(dof, sizeof (dof_hdr_t)); dof->dofh_loadsz = hdr.dofh_loadsz; @@ -917,7 +936,10 @@ dt_options_load(dtrace_hdl_t *dtp) #else if (dt_ioctl(dtp, DTRACEIOC_DOFGET, &dof) == -1) #endif - return (dt_set_errno(dtp, errno)); + { + ret = dt_set_errno(dtp, errno); + goto out; + } for (i = 0; i < dof->dofh_secnum; i++) { sec = (dof_sec_t *)(uintptr_t)((uintptr_t)dof + @@ -942,7 +964,11 @@ dt_options_load(dtrace_hdl_t *dtp) dtp->dt_options[opt->dofo_option] = opt->dofo_value; } - return (0); + ret = 0; +out: + if (dof != NULL && dof != &hdr) + dt_free(dtp, dof); + return (ret); } typedef struct dt_option { From owner-svn-src-head@freebsd.org Sat Dec 21 02:44:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E9E7D1EC83C; Sat, 21 Dec 2019 02:44:26 +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 47fqhB5v9gz3Gh6; Sat, 21 Dec 2019 02:44:26 +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 C58628A69; Sat, 21 Dec 2019 02:44:26 +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 xBL2iQIj088546; Sat, 21 Dec 2019 02:44:26 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBL2iQ4x088545; Sat, 21 Dec 2019 02:44:26 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201912210244.xBL2iQ4x088545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Sat, 21 Dec 2019 02:44:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355974 - head/lib/libdevdctl X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/lib/libdevdctl X-SVN-Commit-Revision: 355974 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2019 02:44:27 -0000 Author: rlibby Date: Sat Dec 21 02:44:26 2019 New Revision: 355974 URL: https://svnweb.freebsd.org/changeset/base/355974 Log: libdevdctl: g++9 avoid Wdeprecated-copy g++9 now warns about having defined an assignment operator but using the default copy constructor, or vice versa. Avoid the issue in libdevdctl by just using the default assignment operator too. Reviewed by: asomers, dim Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22887 Modified: head/lib/libdevdctl/guid.h Modified: head/lib/libdevdctl/guid.h ============================================================================== --- head/lib/libdevdctl/guid.h Sat Dec 21 02:44:13 2019 (r355973) +++ head/lib/libdevdctl/guid.h Sat Dec 21 02:44:26 2019 (r355974) @@ -70,9 +70,6 @@ class Guid (public) Guid(const std::string &guid); static Guid InvalidGuid(); - /* Assignment */ - Guid& operator=(const Guid& rhs); - /* Test the validity of this guid. */ bool IsValid() const; @@ -108,13 +105,6 @@ inline Guid Guid::InvalidGuid() { return (Guid(INVALID_GUID)); -} - -inline Guid& -Guid::operator=(const Guid &rhs) -{ - m_GUID = rhs.m_GUID; - return (*this); } inline bool From owner-svn-src-head@freebsd.org Sat Dec 21 02:44:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D3DF61EC899; Sat, 21 Dec 2019 02:44:38 +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 47fqhQ58hmz3GpW; Sat, 21 Dec 2019 02:44:38 +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 AC28D8A6A; Sat, 21 Dec 2019 02:44:38 +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 xBL2icSd088605; Sat, 21 Dec 2019 02:44:38 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBL2icr2088604; Sat, 21 Dec 2019 02:44:38 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201912210244.xBL2icr2088604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Sat, 21 Dec 2019 02:44:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355975 - head/contrib/jemalloc/src X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/contrib/jemalloc/src X-SVN-Commit-Revision: 355975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2019 02:44:38 -0000 Author: rlibby Date: Sat Dec 21 02:44:38 2019 New Revision: 355975 URL: https://svnweb.freebsd.org/changeset/base/355975 Log: jemalloc: pick from upstream: Fix GCC-9.1 warning with macro GET_ARG_NUMERIC Pick 2d6d099fed05b1509e81e54458516528bfbbf38d from upstream jemalloc: Fix GCC-9.1 warning with macro GET_ARG_NUMERIC GCC-9.1 reports following error when trying to compile file src/malloc_io.c and with CFLAGS='-Werror' : src/malloc_io.c: In function ‘malloc_vsnprintf’: src/malloc_io.c:369:2: error: case label value exceeds maximum value for type [-Werror] 369 | case '?' | 0x80: \ | ^~~~ src/malloc_io.c:581:5: note: in expansion of macro ‘GET_ARG_NUMERIC’ 581 | GET_ARG_NUMERIC(val, 'p'); | ^~~~~~~~~~~~~~~ ... cc1: all warnings being treated as errors make: *** [Makefile:388: src/malloc_io.sym.o] Error 1 The warning is reported as by default the type 'char' is 'signed char' and or-ing 0x80 will turn the case label char negative which will be beyond the printable ascii range (0 - 127). The patch fixes this by explicitly casting the 'len' variable as unsigned char' inside the 'switch' statement so that value of expression " '?' | 0x80 " falls within the legal values of the variable 'len'. Discussed with: jasone (maintainer) Sponsored by: Dell EMC Isilon Modified: head/contrib/jemalloc/src/malloc_io.c Modified: head/contrib/jemalloc/src/malloc_io.c ============================================================================== --- head/contrib/jemalloc/src/malloc_io.c Sat Dec 21 02:44:26 2019 (r355974) +++ head/contrib/jemalloc/src/malloc_io.c Sat Dec 21 02:44:38 2019 (r355975) @@ -376,7 +376,7 @@ malloc_vsnprintf(char *str, size_t size, const char *f } \ } while (0) #define GET_ARG_NUMERIC(val, len) do { \ - switch (len) { \ + switch ((unsigned char)len) { \ case '?': \ val = va_arg(ap, int); \ break; \ From owner-svn-src-head@freebsd.org Sat Dec 21 02:44:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9570A1EC907; Sat, 21 Dec 2019 02:44:50 +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 47fqhf3XyWz3GxJ; Sat, 21 Dec 2019 02:44:50 +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 74DFB8A76; Sat, 21 Dec 2019 02:44:50 +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 xBL2io9m088665; Sat, 21 Dec 2019 02:44:50 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBL2ioc8088664; Sat, 21 Dec 2019 02:44:50 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201912210244.xBL2ioc8088664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Sat, 21 Dec 2019 02:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355976 - head/contrib/googletest/googlemock/include/gmock/internal X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/contrib/googletest/googlemock/include/gmock/internal X-SVN-Commit-Revision: 355976 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2019 02:44:50 -0000 Author: rlibby Date: Sat Dec 21 02:44:50 2019 New Revision: 355976 URL: https://svnweb.freebsd.org/changeset/base/355976 Log: googletest: pick from upstream: Don't allow signed/unsigned wchar_t in gcc 9 and later Pick 711fccf8317b4fb7adc21c00fc1e20823c5d875f from upstream googletest: Don't allow signed/unsigned wchar_t in gcc 9 and later Upstream pull request: https://github.com/google/googletest/pull/2270 Sponsored by: Dell EMC Isilon Modified: head/contrib/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h Modified: head/contrib/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h ============================================================================== --- head/contrib/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h Sat Dec 21 02:44:38 2019 (r355975) +++ head/contrib/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h Sat Dec 21 02:44:50 2019 (r355976) @@ -125,8 +125,11 @@ struct LinkedPtrLessThan { // // To gcc, // wchar_t == signed wchar_t != unsigned wchar_t == unsigned int +// +// gcc-9 appears to treat signed/unsigned wchar_t as ill-formed +// regardless of the signage of its underlying type. #ifdef __GNUC__ -#if !defined(__WCHAR_UNSIGNED__) +#if !defined(__WCHAR_UNSIGNED__) && (__GNUC__ < 9) // signed/unsigned wchar_t are valid types. # define GMOCK_HAS_SIGNED_WCHAR_T_ 1 #endif From owner-svn-src-head@freebsd.org Sat Dec 21 04:44:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98B3B1EF049; Sat, 21 Dec 2019 04:44:18 +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 47ftLV3VwHz3N8h; Sat, 21 Dec 2019 04:44:18 +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 6E996A198; Sat, 21 Dec 2019 04:44:18 +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 xBL4iIWe060696; Sat, 21 Dec 2019 04:44:18 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBL4iIRB060695; Sat, 21 Dec 2019 04:44:18 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201912210444.xBL4iIRB060695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 21 Dec 2019 04:44:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355977 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 355977 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2019 04:44:18 -0000 Author: jhibbits Date: Sat Dec 21 04:44:17 2019 New Revision: 355977 URL: https://svnweb.freebsd.org/changeset/base/355977 Log: powerpc: Only build mpc85xx i2c driver for mpc85xx No need to build it for every other platform. Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sat Dec 21 02:44:50 2019 (r355976) +++ head/sys/conf/files.powerpc Sat Dec 21 04:44:17 2019 (r355977) @@ -139,7 +139,7 @@ powerpc/mpc85xx/ds1553_core.c optional ds1553 powerpc/mpc85xx/fsl_diu.c optional mpc85xx diu powerpc/mpc85xx/fsl_espi.c optional mpc85xx spibus powerpc/mpc85xx/fsl_sata.c optional mpc85xx ata -powerpc/mpc85xx/i2c.c optional iicbus +powerpc/mpc85xx/i2c.c optional mpc85xx iicbus powerpc/mpc85xx/isa.c optional mpc85xx isa powerpc/mpc85xx/lbc.c optional mpc85xx powerpc/mpc85xx/mpc85xx.c optional mpc85xx From owner-svn-src-head@freebsd.org Sat Dec 21 05:03:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C33961EF7FC; Sat, 21 Dec 2019 05:03:22 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47ftmV4k9mz3NxZ; Sat, 21 Dec 2019 05:03:22 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D3AEA531; Sat, 21 Dec 2019 05:03:22 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBL53Mv8072173; Sat, 21 Dec 2019 05:03:22 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBL53LCh072168; Sat, 21 Dec 2019 05:03:21 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201912210503.xBL53LCh072168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Sat, 21 Dec 2019 05:03:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355978 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: philip X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 355978 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2019 05:03:22 -0000 Author: philip Date: Sat Dec 21 05:03:21 2019 New Revision: 355978 URL: https://svnweb.freebsd.org/changeset/base/355978 Log: top: display battery capacity remaining Submitted by: Antranig Vartanian Reviewed by: imp, philip Differential Revision: https://reviews.freebsd.org/D22871 Modified: head/usr.bin/top/display.c head/usr.bin/top/display.h head/usr.bin/top/machine.c head/usr.bin/top/machine.h head/usr.bin/top/top.c Modified: head/usr.bin/top/display.c ============================================================================== --- head/usr.bin/top/display.c Sat Dec 21 04:44:17 2019 (r355977) +++ head/usr.bin/top/display.c Sat Dec 21 05:03:21 2019 (r355978) @@ -1322,6 +1322,15 @@ i_uptime(struct timeval *bt, time_t *tod) } } +void +i_battery(int nbat, int batt) +{ + + if (nbat > 0) { + printf("; battery: %d%%", batt); + } +} + #define SETUPBUFFER_MIN_SCREENWIDTH 80 #define SETUPBUFFER_REQUIRED_ADDBUFSIZ 2 Modified: head/usr.bin/top/display.h ============================================================================== --- head/usr.bin/top/display.h Sat Dec 21 04:44:17 2019 (r355977) +++ head/usr.bin/top/display.h Sat Dec 21 05:03:21 2019 (r355978) @@ -14,6 +14,7 @@ void i_header(const char *text); void display_header(int t); int display_init(struct statics *statics); void i_arc(int *stats); +void i_battery(int nbat, int batt); void i_carc(int *stats); void i_cpustates(int *states); void i_loadave(int mpid, double *avenrun); Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Sat Dec 21 04:44:17 2019 (r355977) +++ head/usr.bin/top/machine.c Sat Dec 21 05:03:21 2019 (r355978) @@ -211,6 +211,10 @@ static long *pcpu_cp_old; static long *pcpu_cp_diff; static int *pcpu_cpu_states; +/* Battery units and states */ +static int battery_units; +static int battery_life; + static int compare_swap(const void *a, const void *b); static int compare_jid(const void *a, const void *b); static int compare_pid(const void *a, const void *b); @@ -373,6 +377,12 @@ machine_init(struct statics *statics) pcpu_cpu_states = calloc(ncpus * CPUSTATES, sizeof(int)); statics->ncpus = ncpus; + /* Allocate state of battery units reported via ACPI. */ + battery_units = 0; + size = sizeof(int); + sysctlbyname("hw.acpi.battery.units", &battery_units, &size, NULL, 0); + statics->nbatteries = battery_units; + update_layout(); /* all done! */ @@ -579,6 +589,12 @@ get_system_info(struct system_info *si) } else { si->boottime.tv_sec = -1; } + + battery_life = 0; + if (battery_units > 0) { + GETSYSCTL("hw.acpi.battery.life", battery_life); + } + si->battery = battery_life; } #define NOPROC ((void *)-1) Modified: head/usr.bin/top/machine.h ============================================================================== --- head/usr.bin/top/machine.h Sat Dec 21 04:44:17 2019 (r355977) +++ head/usr.bin/top/machine.h Sat Dec 21 05:03:21 2019 (r355978) @@ -30,6 +30,7 @@ struct statics const char * const *carc_names; const char * const *swap_names; const char * const *order_names; + int nbatteries; int ncpus; }; @@ -50,6 +51,7 @@ struct system_info int *carc; int *swap; struct timeval boottime; + int battery; int ncpus; }; Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Sat Dec 21 04:44:17 2019 (r355977) +++ head/usr.bin/top/top.c Sat Dec 21 05:03:21 2019 (r355978) @@ -619,6 +619,9 @@ restart: (*d_loadave)(system_info.last_pid, system_info.load_avg); + /* display the battery info (if any) */ + i_battery(statics.nbatteries, system_info.battery); + /* display the current time */ /* this method of getting the time SHOULD be fairly portable */ time(&curr_time); From owner-svn-src-head@freebsd.org Sat Dec 21 11:38:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DFB111D123B; Sat, 21 Dec 2019 11:38:48 +0000 (UTC) (envelope-from arrowd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47g3Xm5czmz49jn; Sat, 21 Dec 2019 11:38:48 +0000 (UTC) (envelope-from arrowd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC4B1EC2D; Sat, 21 Dec 2019 11:38:48 +0000 (UTC) (envelope-from arrowd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBLBcmqm001608; Sat, 21 Dec 2019 11:38:48 GMT (envelope-from arrowd@FreeBSD.org) Received: (from arrowd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBLBcmhQ001607; Sat, 21 Dec 2019 11:38:48 GMT (envelope-from arrowd@FreeBSD.org) Message-Id: <201912211138.xBLBcmhQ001607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arrowd set sender to arrowd@FreeBSD.org using -f From: Gleb Popov Date: Sat, 21 Dec 2019 11:38:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355980 - head/sys/contrib/ncsw/Peripherals/QM X-SVN-Group: head X-SVN-Commit-Author: arrowd X-SVN-Commit-Paths: head/sys/contrib/ncsw/Peripherals/QM X-SVN-Commit-Revision: 355980 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2019 11:38:48 -0000 Author: arrowd (ports committer) Date: Sat Dec 21 11:38:48 2019 New Revision: 355980 URL: https://svnweb.freebsd.org/changeset/base/355980 Log: Don't shift 32-bit value by more than 32 bits. PR: 207854 Approved by: emaste Modified: head/sys/contrib/ncsw/Peripherals/QM/qm_portal_fqr.c Modified: head/sys/contrib/ncsw/Peripherals/QM/qm_portal_fqr.c ============================================================================== --- head/sys/contrib/ncsw/Peripherals/QM/qm_portal_fqr.c Sat Dec 21 07:38:14 2019 (r355979) +++ head/sys/contrib/ncsw/Peripherals/QM/qm_portal_fqr.c Sat Dec 21 11:38:48 2019 (r355980) @@ -1468,7 +1468,7 @@ static t_Error CalcWredCurve(t_QmCgWredCurve *p_WredCu for (tmpA=(uint32_t)(64*pres) ; tmpA<128*pres; tmpA += pres ) for (tmpN=7 ; tmpN<64; tmpN++ ) { - tmp = ABS((int)(slope - tmpA/(1< Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AEF781D2B56; Sat, 21 Dec 2019 12:15:10 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.88]) (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 47g4Lj05K3z4Cv9; Sat, 21 Dec 2019 12:15:08 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp.greenhost.nl ([213.108.110.112]) by smarthost1.greenhost.nl with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iidez-0007xN-44; Sat, 21 Dec 2019 13:15:05 +0100 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Philip Paeps" Subject: Re: svn commit: r355978 - head/usr.bin/top References: <201912210503.xBL53LCh072168@repo.freebsd.org> Date: Sat, 21 Dec 2019 13:15:08 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: <201912210503.xBL53LCh072168@repo.freebsd.org> User-Agent: Opera Mail/12.16 (FreeBSD) X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.2 X-Spam-Status: No, score=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 autolearn=disabled version=3.4.2 X-Scan-Signature: 3cea6f85c46863b7448b52c7b19d39b8 X-Rspamd-Queue-Id: 47g4Lj05K3z4Cv9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of ronald-lists@klop.ws designates 195.190.28.88 as permitted sender) smtp.mailfrom=ronald-lists@klop.ws X-Spamd-Result: default: False [-2.54 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:195.190.28.64/27]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[klop.ws]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; IP_SCORE(-0.75)[ip: (-0.84), ipnet: 195.190.28.0/24(-0.31), asn: 47172(-2.62), country: NL(0.03)]; RCVD_IN_DNSWL_NONE(0.00)[88.28.190.195.list.dnswl.org : 127.0.10.0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; ASN(0.00)[asn:47172, ipnet:195.190.28.0/24, country:NL]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2019 12:15:10 -0000 nice addition On Sat, 21 Dec 2019 06:03:21 +0100, Philip Paeps wrote: > Author: philip > Date: Sat Dec 21 05:03:21 2019 > New Revision: 355978 > URL: https://svnweb.freebsd.org/changeset/base/355978 > > Log: > top: display battery capacity remaining > Submitted by: Antranig Vartanian > Reviewed by: imp, philip > Differential Revision: https://reviews.freebsd.org/D22871 > > Modified: > head/usr.bin/top/display.c > head/usr.bin/top/display.h > head/usr.bin/top/machine.c > head/usr.bin/top/machine.h > head/usr.bin/top/top.c > > Modified: head/usr.bin/top/display.c > ============================================================================== > --- head/usr.bin/top/display.c Sat Dec 21 04:44:17 2019 (r355977) > +++ head/usr.bin/top/display.c Sat Dec 21 05:03:21 2019 (r355978) > @@ -1322,6 +1322,15 @@ i_uptime(struct timeval *bt, time_t *tod) > } > } > +void > +i_battery(int nbat, int batt) > +{ > + > + if (nbat > 0) { > + printf("; battery: %d%%", batt); > + } > +} > + > #define SETUPBUFFER_MIN_SCREENWIDTH 80 > #define SETUPBUFFER_REQUIRED_ADDBUFSIZ 2 > > Modified: head/usr.bin/top/display.h > ============================================================================== > --- head/usr.bin/top/display.h Sat Dec 21 04:44:17 2019 (r355977) > +++ head/usr.bin/top/display.h Sat Dec 21 05:03:21 2019 (r355978) > @@ -14,6 +14,7 @@ void i_header(const char *text); > void display_header(int t); > int display_init(struct statics *statics); > void i_arc(int *stats); > +void i_battery(int nbat, int batt); > void i_carc(int *stats); > void i_cpustates(int *states); > void i_loadave(int mpid, double *avenrun); > > Modified: head/usr.bin/top/machine.c > ============================================================================== > --- head/usr.bin/top/machine.c Sat Dec 21 04:44:17 2019 (r355977) > +++ head/usr.bin/top/machine.c Sat Dec 21 05:03:21 2019 (r355978) > @@ -211,6 +211,10 @@ static long *pcpu_cp_old; > static long *pcpu_cp_diff; > static int *pcpu_cpu_states; > +/* Battery units and states */ > +static int battery_units; > +static int battery_life; > + > static int compare_swap(const void *a, const void *b); > static int compare_jid(const void *a, const void *b); > static int compare_pid(const void *a, const void *b); > @@ -373,6 +377,12 @@ machine_init(struct statics *statics) > pcpu_cpu_states = calloc(ncpus * CPUSTATES, sizeof(int)); > statics->ncpus = ncpus; > + /* Allocate state of battery units reported via ACPI. */ > + battery_units = 0; > + size = sizeof(int); > + sysctlbyname("hw.acpi.battery.units", &battery_units, &size, NULL, 0); > + statics->nbatteries = battery_units; > + > update_layout(); > /* all done! */ > @@ -579,6 +589,12 @@ get_system_info(struct system_info *si) > } else { > si->boottime.tv_sec = -1; > } > + > + battery_life = 0; > + if (battery_units > 0) { > + GETSYSCTL("hw.acpi.battery.life", battery_life); > + } > + si->battery = battery_life; > } > #define NOPROC ((void *)-1) > > Modified: head/usr.bin/top/machine.h > ============================================================================== > --- head/usr.bin/top/machine.h Sat Dec 21 04:44:17 2019 (r355977) > +++ head/usr.bin/top/machine.h Sat Dec 21 05:03:21 2019 (r355978) > @@ -30,6 +30,7 @@ struct statics > const char * const *carc_names; > const char * const *swap_names; > const char * const *order_names; > + int nbatteries; > int ncpus; > }; > @@ -50,6 +51,7 @@ struct system_info > int *carc; > int *swap; > struct timeval boottime; > + int battery; > int ncpus; > }; > > Modified: head/usr.bin/top/top.c > ============================================================================== > --- head/usr.bin/top/top.c Sat Dec 21 04:44:17 2019 (r355977) > +++ head/usr.bin/top/top.c Sat Dec 21 05:03:21 2019 (r355978) > @@ -619,6 +619,9 @@ restart: > (*d_loadave)(system_info.last_pid, > system_info.load_avg); > + /* display the battery info (if any) */ > + i_battery(statics.nbatteries, system_info.battery); > + > /* display the current time */ > /* this method of getting the time SHOULD be fairly portable */ > time(&curr_time); > _______________________________________________ > 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" From owner-svn-src-head@freebsd.org Sat Dec 21 19:04:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 735521DA68B; Sat, 21 Dec 2019 19:04:06 +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 47gFQZ2Mk9z4XWg; Sat, 21 Dec 2019 19:04:06 +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 4C0D31BC3E; Sat, 21 Dec 2019 19:04:06 +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 xBLJ46gZ067200; Sat, 21 Dec 2019 19:04:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBLJ46l0067199; Sat, 21 Dec 2019 19:04:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201912211904.xBLJ46l0067199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 21 Dec 2019 19:04:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355985 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 355985 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2019 19:04:06 -0000 Author: markj Date: Sat Dec 21 19:04:05 2019 New Revision: 355985 URL: https://svnweb.freebsd.org/changeset/base/355985 Log: Fix VPO_UNMANAGED handling in vm_page_reclaim_run() after r353540. When allocating a replacement page we must clear VPO_UNMANAGED since we only ever reclaim pages from managed objects. vm_page_replace() does not handle this for us. Sprinkle some assertions to help catch this sort of issue. Reported by: pho Reviewed by: alc, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22868 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Dec 21 18:50:25 2019 (r355984) +++ head/sys/vm/vm_page.c Sat Dec 21 19:04:05 2019 (r355985) @@ -1724,6 +1724,9 @@ vm_page_replace(vm_page_t mnew, vm_object_t object, vm mnew->pindex = pindex; atomic_set_int(&mnew->ref_count, VPRC_OBJREF); mold = vm_radix_replace(&object->rtree, mnew); + KASSERT((mold->oflags & VPO_UNMANAGED) == + (mnew->oflags & VPO_UNMANAGED), + ("vm_page_replace: mismatched VPO_UNMANAGED")); /* Keep the resident page list in sorted order. */ TAILQ_INSERT_AFTER(&object->memq, mold, mnew, listq); @@ -2684,8 +2687,7 @@ retry: KASSERT(pmap_page_get_memattr(m) == VM_MEMATTR_DEFAULT, ("page %p has an unexpected memattr", m)); - KASSERT((m->oflags & (VPO_SWAPINPROG | - VPO_SWAPSLEEP | VPO_UNMANAGED)) == 0, + KASSERT(m->oflags == 0, ("page %p has unexpected oflags", m)); /* Don't care: PGA_NOSYNC. */ if (!vm_page_none_valid(m)) { @@ -2753,6 +2755,7 @@ retry: ~PGA_QUEUE_STATE_MASK; KASSERT(m_new->oflags == VPO_UNMANAGED, ("page %p is managed", m_new)); + m_new->oflags = 0; pmap_copy_page(m, m_new); m_new->valid = m->valid; m_new->dirty = m->dirty; @@ -3676,6 +3679,10 @@ vm_page_free_prep(vm_page_t m) panic("vm_page_free_prep: freeing shared busy page %p", m); if (m->object != NULL) { + KASSERT(((m->oflags & VPO_UNMANAGED) != 0) == + ((m->object->flags & OBJ_UNMANAGED) != 0), + ("vm_page_free_prep: managed flag mismatch for page %p", + m)); vm_page_object_remove(m); /* From owner-svn-src-head@freebsd.org Sat Dec 21 21:01:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 254151DC8AB; Sat, 21 Dec 2019 21:01:05 +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 47gJ1Y0yjbz4cwR; Sat, 21 Dec 2019 21:01:05 +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 01BD41D013; Sat, 21 Dec 2019 21:01:05 +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 xBLL147s033942; Sat, 21 Dec 2019 21:01:04 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBLL14sr033938; Sat, 21 Dec 2019 21:01:04 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201912212101.xBLL14sr033938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 21 Dec 2019 21:01:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355988 - in head: contrib/libpcap contrib/libpcap/cmake/Modules contrib/libpcap/doc contrib/libpcap/missing contrib/libpcap/msdos contrib/libpcap/pcap contrib/libpcap/rpcapd contrib/li... X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in head: contrib/libpcap contrib/libpcap/cmake/Modules contrib/libpcap/doc contrib/libpcap/missing contrib/libpcap/msdos contrib/libpcap/pcap contrib/libpcap/rpcapd contrib/libpcap/testprogs lib/libpc... X-SVN-Commit-Revision: 355988 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2019 21:01:05 -0000 Author: cy Date: Sat Dec 21 21:01:03 2019 New Revision: 355988 URL: https://svnweb.freebsd.org/changeset/base/355988 Log: MFV r353141 (by phillip): Update libpcap from 1.9.0 to 1.9.1. MFC after: 2 weeks Added: head/contrib/libpcap/CONTRIBUTING.md - copied unchanged from r353141, vendor/libpcap/dist/CONTRIBUTING.md head/contrib/libpcap/INSTALL.md - copied unchanged from r353141, vendor/libpcap/dist/INSTALL.md head/contrib/libpcap/README.md - copied unchanged from r353141, vendor/libpcap/dist/README.md head/contrib/libpcap/doc/ - copied from r353141, vendor/libpcap/dist/doc/ head/contrib/libpcap/missing/asprintf.c - copied unchanged from r353141, vendor/libpcap/dist/missing/asprintf.c head/contrib/libpcap/missing/strlcat.c - copied unchanged from r353141, vendor/libpcap/dist/missing/strlcat.c head/contrib/libpcap/missing/strlcpy.c - copied unchanged from r353141, vendor/libpcap/dist/missing/strlcpy.c head/contrib/libpcap/missing/win_asprintf.c - copied unchanged from r353141, vendor/libpcap/dist/missing/win_asprintf.c head/contrib/libpcap/pcap/socket.h - copied unchanged from r353141, vendor/libpcap/dist/pcap/socket.h head/contrib/libpcap/pcap_set_immediate_mode.3pcap.in - copied unchanged from r353141, vendor/libpcap/dist/pcap_set_immediate_mode.3pcap.in head/contrib/libpcap/pcap_set_protocol_linux.3pcap - copied unchanged from r353141, vendor/libpcap/dist/pcap_set_protocol_linux.3pcap head/contrib/libpcap/rpcapd/ - copied from r353141, vendor/libpcap/dist/rpcapd/ head/contrib/libpcap/testprogs/ - copied from r353141, vendor/libpcap/dist/testprogs/ Deleted: head/contrib/libpcap/CONTRIBUTING head/contrib/libpcap/INSTALL.txt head/contrib/libpcap/README head/contrib/libpcap/README.Win32 head/contrib/libpcap/README.aix head/contrib/libpcap/README.dag head/contrib/libpcap/README.hpux head/contrib/libpcap/README.linux head/contrib/libpcap/README.macos head/contrib/libpcap/README.septel head/contrib/libpcap/README.sita head/contrib/libpcap/README.tru64 head/contrib/libpcap/cmake/Modules/FindPthreads-w32.cmake head/contrib/libpcap/pcap_set_immediate_mode.3pcap head/contrib/libpcap/pcap_set_protocol.3pcap Modified: head/contrib/libpcap/CHANGES head/contrib/libpcap/CMakeLists.txt head/contrib/libpcap/CREDITS head/contrib/libpcap/Makefile.in head/contrib/libpcap/VERSION head/contrib/libpcap/aclocal.m4 head/contrib/libpcap/bpf_filter.c head/contrib/libpcap/cmake/Modules/FindPacket.cmake head/contrib/libpcap/cmakeconfig.h.in head/contrib/libpcap/config.guess head/contrib/libpcap/config.h.in head/contrib/libpcap/config.sub head/contrib/libpcap/configure head/contrib/libpcap/configure.ac head/contrib/libpcap/diag-control.h head/contrib/libpcap/fmtutils.c head/contrib/libpcap/fmtutils.h head/contrib/libpcap/ftmacros.h head/contrib/libpcap/gencode.c head/contrib/libpcap/gencode.h head/contrib/libpcap/grammar.y head/contrib/libpcap/missing/snprintf.c head/contrib/libpcap/missing/win_snprintf.c head/contrib/libpcap/msdos/readme.dos head/contrib/libpcap/nametoaddr.c head/contrib/libpcap/optimize.c head/contrib/libpcap/pcap-bpf.c head/contrib/libpcap/pcap-bt-linux.c head/contrib/libpcap/pcap-bt-monitor-linux.c head/contrib/libpcap/pcap-common.c head/contrib/libpcap/pcap-common.h head/contrib/libpcap/pcap-dag.c head/contrib/libpcap/pcap-dlpi.c head/contrib/libpcap/pcap-dos.c head/contrib/libpcap/pcap-filter.manmisc.in head/contrib/libpcap/pcap-int.h head/contrib/libpcap/pcap-libdlpi.c head/contrib/libpcap/pcap-linktype.manmisc.in head/contrib/libpcap/pcap-linux.c head/contrib/libpcap/pcap-netfilter-linux.c head/contrib/libpcap/pcap-netmap.c head/contrib/libpcap/pcap-new.c head/contrib/libpcap/pcap-npf.c head/contrib/libpcap/pcap-null.c head/contrib/libpcap/pcap-rpcap.c head/contrib/libpcap/pcap-rpcap.h head/contrib/libpcap/pcap-savefile.manfile.in head/contrib/libpcap/pcap-septel.c head/contrib/libpcap/pcap-sita.c head/contrib/libpcap/pcap-sita.html head/contrib/libpcap/pcap-snf.c head/contrib/libpcap/pcap-tc.c head/contrib/libpcap/pcap-tstamp.manmisc.in head/contrib/libpcap/pcap-usb-linux.c head/contrib/libpcap/pcap.3pcap.in head/contrib/libpcap/pcap.c head/contrib/libpcap/pcap/bpf.h head/contrib/libpcap/pcap/compiler-tests.h head/contrib/libpcap/pcap/dlt.h head/contrib/libpcap/pcap/funcattrs.h head/contrib/libpcap/pcap/nflog.h head/contrib/libpcap/pcap/pcap-inttypes.h head/contrib/libpcap/pcap/pcap.h head/contrib/libpcap/pcap/sll.h head/contrib/libpcap/pcap_activate.3pcap head/contrib/libpcap/pcap_breakloop.3pcap head/contrib/libpcap/pcap_can_set_rfmon.3pcap head/contrib/libpcap/pcap_compile.3pcap.in head/contrib/libpcap/pcap_create.3pcap head/contrib/libpcap/pcap_datalink.3pcap.in head/contrib/libpcap/pcap_datalink_name_to_val.3pcap head/contrib/libpcap/pcap_datalink_val_to_name.3pcap head/contrib/libpcap/pcap_dump.3pcap head/contrib/libpcap/pcap_dump_file.3pcap head/contrib/libpcap/pcap_dump_flush.3pcap head/contrib/libpcap/pcap_dump_ftell.3pcap head/contrib/libpcap/pcap_dump_open.3pcap.in head/contrib/libpcap/pcap_file.3pcap head/contrib/libpcap/pcap_fileno.3pcap head/contrib/libpcap/pcap_findalldevs.3pcap head/contrib/libpcap/pcap_freecode.3pcap head/contrib/libpcap/pcap_get_required_select_timeout.3pcap head/contrib/libpcap/pcap_get_selectable_fd.3pcap head/contrib/libpcap/pcap_get_tstamp_precision.3pcap.in head/contrib/libpcap/pcap_geterr.3pcap head/contrib/libpcap/pcap_inject.3pcap head/contrib/libpcap/pcap_is_swapped.3pcap head/contrib/libpcap/pcap_list_datalinks.3pcap.in head/contrib/libpcap/pcap_list_tstamp_types.3pcap.in head/contrib/libpcap/pcap_lookupdev.3pcap head/contrib/libpcap/pcap_lookupnet.3pcap head/contrib/libpcap/pcap_loop.3pcap head/contrib/libpcap/pcap_major_version.3pcap head/contrib/libpcap/pcap_next_ex.3pcap head/contrib/libpcap/pcap_offline_filter.3pcap head/contrib/libpcap/pcap_open_dead.3pcap.in head/contrib/libpcap/pcap_open_live.3pcap head/contrib/libpcap/pcap_open_offline.3pcap.in head/contrib/libpcap/pcap_set_datalink.3pcap head/contrib/libpcap/pcap_set_timeout.3pcap head/contrib/libpcap/pcap_set_tstamp_precision.3pcap.in head/contrib/libpcap/pcap_set_tstamp_type.3pcap.in head/contrib/libpcap/pcap_setdirection.3pcap head/contrib/libpcap/pcap_setfilter.3pcap head/contrib/libpcap/pcap_setnonblock.3pcap head/contrib/libpcap/pcap_snapshot.3pcap head/contrib/libpcap/pcap_stats.3pcap head/contrib/libpcap/pcap_strerror.3pcap head/contrib/libpcap/pcap_tstamp_type_name_to_val.3pcap head/contrib/libpcap/pcap_tstamp_type_val_to_name.3pcap head/contrib/libpcap/portability.h head/contrib/libpcap/rpcap-protocol.h head/contrib/libpcap/savefile.c head/contrib/libpcap/scanner.l head/contrib/libpcap/sf-pcap.c head/contrib/libpcap/sf-pcap.h head/contrib/libpcap/sf-pcapng.c head/contrib/libpcap/sf-pcapng.h head/contrib/libpcap/sockutils.c head/contrib/libpcap/sockutils.h head/lib/libpcap/Makefile head/lib/libpcap/config.h head/sys/net/dlt.h Directory Properties: head/contrib/libpcap/ (props changed) Modified: head/contrib/libpcap/CHANGES ============================================================================== --- head/contrib/libpcap/CHANGES Sat Dec 21 19:23:33 2019 (r355987) +++ head/contrib/libpcap/CHANGES Sat Dec 21 21:01:03 2019 (r355988) @@ -1,5 +1,129 @@ -Wednesday, Jan. 25, 2017 guy@alum.mit.edu +Sunday, July 22, 2018 + Summary for 1.9.1 libpcap release + Mention pcap_get_required_select_timeout() in the main pcap man page + Fix pcap-usb-linux.c build on systems with musl + Fix assorted man page and other documentation issues + Plug assorted memory leaks + Documentation changes to use https: + Changes to how time stamp calculations are done + Lots of tweaks to make newer compilers happier and warning-free and + to fix instances of C undefined behavior + Warn if AC_PROG_CC_C99 can't enable C99 support + Rename pcap_set_protocol() to pcap_set_protocol_linux(). + Align pcap_t private data on an 8-byte boundary. + Fix various error messages + Use 64-bit clean API in dag_findalldevs() + Fix cleaning up after some errors + Work around some ethtool ioctl bugs in newer Linux kernels (GitHub + issue #689) + Add backwards compatibility sections to some man pages (GitHub issue + #745) + Fix autotool configuration on AIX and macOS + Don't export bpf_filter_with_aux_data() or struct bpf_aux_data; + they're internal-only and subject to change + Fix pcapng block size checking + On macOS, don't build rpcapd or test programs any fatter than they + need to be + Fix reading of capture statistics for Linux USB + Fix packet size values for Linux USB packets (GitHub issue #808) + Check only VID in VLAN test in filterss (GitHub issue #461) + Fix pcap_list_datalinks on 802.11 devices on macOS + Fix overflows with very large snapshot length in pcap file + Improve parsing of rpcapd configuration file (GitHub issue #767) + Handle systems without strlcpy() or strlcat() better + Fix crashes and other errors with invalid filter expressions + Fix use of uninitialized file descriptor in remote capture + Fix some CMake issues + Fix some divide-by-zero issues with the filter compiler + Work around a GNU libc bug in pcap_nametonetaddr() + Add support for DLT_LINUX_SLL2 + Fix handling of the packet-count argument for Myricom SNF devices + Fix --disable-rdma in configure script (GitHub issue #782) + Fix compilation of TurboCap support (GitHub issue #764) + Constify first argument to pcap_findalldevs_ex() + Fix a number of issues when running rpcapd as an inetd-style daemon + Fix CMake issues with D-Bus libraries + In rpcapd, clean up termination of a capture session + Redo remote capture protocol negotiation + In rpcapd, report the same error for "invalid user name" and + "invalid password", to make brute-forcing harder + For remote captures, add an error code for "the server requires TLS" + Fix pcap_dump_fopen() on Windows to avoid clashes between + {Win,N}Pcap and application C runtimes + Fix exporting of functions from Windows DLLs (GitHub issue #810) + Fix building as part of Npcap + Allow rpcapd to rebind more rapidly + Fix building shared libpcap library on midipix (midipix.org) + Fix hack to detect UTF-16LE adapter names on Windows not to go past + the end of the string + Fix handling of "wireless WAN" (mobile phone network modems) on + Windows with WinPcap/Npcap (GitHub issue #824) + Have pcap_dump_open_append() create the dump file if it doesn't + exists (GitHub issue #247) + Fix the maxmum snapshot length for DLT_USBPCAP + Use -fPIC when building for 64-bit SPARC on Linux (GitHub issue #837) + Fix CMake 64-bit library installation directory on some Linux + distributions + Boost the TPACKET_V3 timeout to the maximum if a timeout of 0 was + specified + Five CVE-2019-15161, CVE-2019-15162, CVE-2019-15163, CVE-2019-15164, CVE-2019-15165 + Fixes for CVE-2018-16301, errors in pcapng reading. + PCAPNG reader applies some sanity checks before doing malloc(). + +Sunday, June 24, 2018, by mcr@sandelman.ca Summary for 1.9.0 libpcap release + Added testing system to libpcap, independent of tcpdump + Changes to how pcap_t is activated + Adding support for Large stream buffers on Endace DAG cards + Changes to BSD 3-clause license to 2-clause licence + Additions to TCP header parsing, per RFC3168 + Add CMake build process (extensive number of changes) + Assign a value for OpenBSD DLT_OPENFLOW. + Support setting non-blocking mode before activating. + Extensive build support for Windows VS2010 and MINGW (many many changes, over many months) + Added RPCAPD support when --enable-remote (default no) + Add the rpcap daemon source and build instructions. + Put back the greasy "save the capture filter string so we can tweak it" + hack, that keeps libpcap from capturing rpcap traffic. + Fixes for captures on MacOS, utun0 + fixes so that non-AF_INET addresses, are not ==AF_INET6 addresses. + Add a linktype for IBM SDLC frames containing SNA PDUs. + pcap_compile() in 1.8.0 and later is newly thread-safe. + bound snaplen for linux tpacket_v2 to ~64k + Make VLAN filter handle both metadata and inline tags + D-Bus captures can now be up to 128MB in size + Added LORATAP DLT value + Added DLT_VSOCK for http://qemu-project.org/Features/VirtioVsock + probe_devices() fixes not to overrun buffer for name of device + Add linux-specific pcap_set_protocol_linux() to allow specifying a specific capture protocol. + RDMA sniffing support for pcap + Add Nordic Semiconductor Bluetooth LE sniffer link-layer header type. + fixes for reading /etc/ethers + Make it possible to build on Windows without packet.dll. + Add tests for large file support on UN*X. + Solaris fixes to work with 2.8.6 + configuration test now looks for header files, not capture devices present + Fix to work with Berkeley YACC. + fixes for DragonBSD compilation of pcap-netmap.c + Clean up the ether_hostton() stuff. + Add an option to disable Linux memory-mapped capture support. + Add DAG API support checks. + Add Septel, Myricom SNF, and Riverbed TurboCap checks. + Add checks for Linux USB, Linux Bluetooth, D-Bus, and RDMA sniffing support. + Add a check for hardware time stamping on Linux. + Don't bother supporting pre-2005 Visual Studio. + Increased minimum autoconf version requirement to 2.64 + Add DLT value 273 for XRA-31 sniffer + Clean up handing of signal interrupts in pcap_read_nocb_remote(). + Use the XPG 4.2 versions of the networking APIs in Solaris. + Fix, and better explain, the "IPv6 means IPv6, not IPv4" option setting. + Explicitly warn that negative packet buffer timeouts should not be used. + rpcapd: Add support inetd-likes, including xinetd.conf, and systemd units + Rename DLT_IEEE802_15_4 to DLT_IEEE802_15_4_WITHFCS. + Add DISPLAYPORT AUX link type + Remove the sunos4 kernel modules and all references to them. + Add more interface flags to pcap_findalldevs(). + Summary for 1.9.0 libpcap release (to 2017-01-25 by guy@alum.mit.edu) Man page improvements Fix Linux cooked mode userspace filtering (GitHub pull request #429) Fix compilation if IPv6 support not enabled Modified: head/contrib/libpcap/CMakeLists.txt ============================================================================== --- head/contrib/libpcap/CMakeLists.txt Sat Dec 21 19:23:33 2019 (r355987) +++ head/contrib/libpcap/CMakeLists.txt Sat Dec 21 21:01:03 2019 (r355988) @@ -9,7 +9,7 @@ if(POLICY CMP0042) cmake_policy(SET CMP0042 OLD) endif() -set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules) project(pcap) @@ -136,83 +136,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") endif() # -# By default, build universal with the appropriate set of architectures -# for the OS on which we're doing the build. -# -if(APPLE AND "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "") - # - # Get the major version of Darwin. - # - string(REGEX MATCH "^([0-9]+)" SYSTEM_VERSION_MAJOR "${CMAKE_SYSTEM_VERSION}") - - if(SYSTEM_VERSION_MAJOR LESS 8) - # - # Pre-Tiger. Build only for 32-bit PowerPC. - # - set(CMAKE_OSX_ARCHITECTURES "ppc") - elseif(SYSTEM_VERSION_MAJOR EQUAL 8) - # - # Tiger. Is this prior to, or with, Intel support? - # - # Get the minor version of Darwin. - # - string(REPLACE "${SYSTEM_VERSION_MAJOR}." "" SYSTEM_MINOR_AND_PATCH_VERSION ${CMAKE_SYSTEM_VERSION}) - string(REGEX MATCH "^([0-9]+)" SYSTEM_VERSION_MINOR "${SYSTEM_MINOR_AND_PATCH_VERSION}") - if(SYSTEM_VERSION_MINOR LESS 4) - # - # Prior to Intel support. Build for 32-bit - # PowerPC and 64-bit PowerPC, with 32-bit PowerPC - # first. (I'm guessing that's what Apple does.) - # - set(CMAKE_OSX_ARCHITECTURES "ppc;ppc64") - elseif(SYSTEM_VERSION_MINOR LESS 7) - # - # With Intel support but prior to x86-64 support. - # Build for 32-bit PowerPC, 64-bit PowerPC, and x86, - # with 32-bit PowerPC first. - # (I'm guessing that's what Apple does.) - # - set(CMAKE_OSX_ARCHITECTURES "ppc;ppc64;i386") - else() - # - # With Intel support including x86-64 support. - # Build for 32-bit PowerPC, 64-bit PowerPC, x86, - # and x86-64, with 32-bit PowerPC first. - # (I'm guessing that's what Apple does.) - # - set(CMAKE_OSX_ARCHITECTURES "ppc;ppc64;i386;x86_64") - endif() - elseif(SYSTEM_VERSION_MAJOR EQUAL 9) - # - # Leopard. Build for 32-bit PowerPC, 64-bit - # PowerPC, x86, and x86-64, with 32-bit PowerPC - # first. (That's what Apple does.) - # - set(CMAKE_OSX_ARCHITECTURES "ppc;ppc64;i386;x86_64") - elseif(SYSTEM_VERSION_MAJOR EQUAL 10) - # - # Snow Leopard. Build for x86-64, x86, and - # 32-bit PowerPC, with x86-64 first. (That's - # what Apple does, even though Snow Leopard - # doesn't run on PPC, so PPC libpcap runs under - # Rosetta, and Rosetta doesn't support BPF - # ioctls, so PPC programs can't do live - # captures.) - # - set(CMAKE_OSX_ARCHITECTURES "x86_64;i386;ppc") - else() - # - # Post-Snow Leopard. Build for x86-64 and - # x86, with x86-64 first. (That's probably what - # Apple does, given that Rosetta is gone.) - # XXX - update if and when Apple drops support - # for 32-bit x86 code. - # - set(CMAKE_OSX_ARCHITECTURES "x86_64;i386") - endif() -endif() - -# # Additional capture modules. # option(DISABLE_USB "Disable USB sniffing support" OFF) @@ -233,7 +156,7 @@ option(DISABLE_RDMA "Disable RDMA sniffing support" OF option(DISABLE_DAG "Disable Endace DAG card support" OFF) option(DISABLE_SEPTEL "Disable Septel card support" OFF) -set(SEPTEL_ROOT "${CMAKE_SOURCE_DIR}/../septel" CACHE PATH "Path to directory with include and lib subdirectories for Septel API") +set(SEPTEL_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../septel" CACHE PATH "Path to directory with include and lib subdirectories for Septel API") option(DISABLE_SNF "Disable Myricom SNF support" OFF) @@ -251,7 +174,7 @@ option(YYDEBUG "Build parser debugging code" OFF) # Get, parse, format and set pcap's version string from [pcap_root]/VERSION # for later use. - + # Get MAJOR, MINOR, PATCH & SUFFIX file(STRINGS ${pcap_SOURCE_DIR}/VERSION PACKAGE_VERSION @@ -264,7 +187,7 @@ string(REGEX MATCH "^([0-9]+)" PACKAGE_VERSION_MAJOR " # Get MAJOR, MINOR & PATCH string(REGEX MATCH "^([0-9]+.)?([0-9]+.)?([0-9]+)" PACKAGE_VERSION_NOSUFFIX "${PACKAGE_VERSION}") -if(WIN32) +if(WIN32) # Convert PCAP_VERSION_NOSUFFIX to Windows preferred version format string(REPLACE "." "," PACKAGE_VERSION_PREDLL ${PACKAGE_VERSION_NOSUFFIX}) @@ -289,6 +212,7 @@ include_directories( include(CheckFunctionExists) include(CMakePushCheckState) +include(CheckSymbolExists) if(WIN32) @@ -310,6 +234,14 @@ if(WIN32) cmake_pop_check_state() endif(PACKET_FOUND) + message(STATUS "checking for Npcap's version.h") + check_symbol_exists(WINPCAP_PRODUCT_NAME "../../version.h" HAVE_VERSION_H) + if(HAVE_VERSION_H) + message(STATUS "HAVE version.h") + else(HAVE_VERSION_H) + message(STATUS "MISSING version.h") + endif(HAVE_VERSION_H) + endif(WIN32) if(MSVC) @@ -344,6 +276,11 @@ include(CheckStructHasMember) include(CheckTypeSize) # +# Tests are a bit expensive with Visual Studio on Windows, so, on +# Windows, we skip tests for UN*X-only headers and functions. +# + +# # Header files. # check_include_file(inttypes.h HAVE_INTTYPES_H) @@ -395,12 +332,44 @@ endif(NOT WIN32) # check_function_exists(strerror HAVE_STRERROR) check_function_exists(strerror_r HAVE_STRERROR_R) -check_function_exists(strerror_s HAVE_STRERROR_S) +if(HAVE_STRERROR_R) + # + # We have strerror_r; if we define _GNU_SOURCE, is it a + # POSIX-compliant strerror_r() or a GNU strerror_r()? + # + check_c_source_compiles( +"#define _GNU_SOURCE +#include + +/* Define it GNU-style; that will cause an error if it's not GNU-style */ +extern char *strerror_r(int, char *, size_t); + +int +main(void) +{ + return 0; +} +" + HAVE_GNU_STRERROR_R) + if(NOT HAVE_GNU_STRERROR_R) + set(HAVE_POSIX_STRERROR_R YES) + endif(NOT HAVE_GNU_STRERROR_R) +else(HAVE_STRERROR_R) + # + # We don't have strerror_r; do we have strerror_s? + # + check_function_exists(strerror_s HAVE_STRERROR_S) +endif(HAVE_STRERROR_R) check_function_exists(strlcpy HAVE_STRLCPY) check_function_exists(strlcat HAVE_STRLCAT) check_function_exists(snprintf HAVE_SNPRINTF) check_function_exists(vsnprintf HAVE_VSNPRINTF) +check_function_exists(asprintf HAVE_ASPRINTF) +check_function_exists(vasprintf HAVE_VASPRINTF) check_function_exists(strtok_r HAVE_STRTOK_R) +if(NOT WIN32) + check_function_exists(vsyslog HAVE_VSYSLOG) +endif() # # These tests are for network applications that need socket functions @@ -429,7 +398,6 @@ check_function_exists(strtok_r HAVE_STRTOK_R) # set(PCAP_LINK_LIBRARIES "") include(CheckLibraryExists) -include(CheckSymbolExists) if(WIN32) # # We need winsock2.h and ws2tcpip.h. @@ -865,11 +833,61 @@ set(PROJECT_SOURCE_LIST_C ) if(WIN32) - set(PROJECT_SOURCE_LIST_C ${PROJECT_SOURCE_LIST_C} missing/win_snprintf.c) + # + # For now, we assume we don't have snprintf() or that it's not one + # that behaves enough like C99's snprintf() for our purposes (i.e., + # it doesn't null-terminate the string if it truncates it to fit in + # the buffer), so we have to provide our own (a wrapper around + # _snprintf() that null-terminates the buffer). + # + # We also assume we don't have asprintf(), and provide an implementation + # that uses _vscprintf() to determine how big the string needs to be. + # + set(PROJECT_SOURCE_LIST_C ${PROJECT_SOURCE_LIST_C} + missing/win_snprintf.c missing/win_asprintf.c) else() + # + # Either: + # + # we have snprintf() and vsnprintf(), and have asprintf() and + # vasprintf(); + # + # we have snprintf() and vsnprintf(), but don't have asprintf() + # or vasprintf(); + # + # we have neither snprintf() nor vsnprintf(), and don't have + # asprintf() or vasprintf(), either. + # + # We assume that if we have asprintf() we have vasprintf(), as well + # as snprintf() and vsnprintf(), and that if we have snprintf() we + # have vsnprintf(). + # + # For the first case, we don't need any replacement routines. + # For the second case, we need replacement asprintf()/vasprintf() + # routines. + # For the third case, we need replacement snprintf()/vsnprintf() and + # asprintf()/vasprintf() routines. + # if(NOT HAVE_SNPRINTF) + # + # We assume we have none of them; missing/snprintf.c supplies + # all of them. + # set(PROJECT_SOURCE_LIST_C ${PROJECT_SOURCE_LIST_C} missing/snprintf.c) - endif(NOT HAVE_SNPRINTF) + elif(NOT HAVE_ASPRINTF) + # + # We assume we have snprintf()/vsnprintf() but lack + # asprintf()/vasprintf(); missing/asprintf.c supplies + # the latter (using vsnprintf()). + # + set(PROJECT_SOURCE_LIST_C ${PROJECT_SOURCE_LIST_C} missing/asprintf.c) + endif() + if(NOT HAVE_STRLCAT) + set(PROJECT_SOURCE_LIST_C ${PROJECT_SOURCE_LIST_C} missing/strlcat.c) + endif(NOT HAVE_STRLCAT) + if(NOT HAVE_STRLCPY) + set(PROJECT_SOURCE_LIST_C ${PROJECT_SOURCE_LIST_C} missing/strlcpy.c) + endif(NOT HAVE_STRLCPY) if(NOT HAVE_STRTOK_R) set(PROJECT_SOURCE_LIST_C ${PROJECT_SOURCE_LIST_C} missing/strtok_r.c) endif(NOT HAVE_STRTOK_R) @@ -931,13 +949,16 @@ else() # as it's a Linux, it should use packet sockets, # instead. # - # # We need: # # sys/types.h, because FreeBSD 10's net/bpf.h # requires that various BSD-style integer types # be defined; # + # sys/time.h, because AIX 5.2 and 5.3's net/bpf.h + # doesn't include it but does use struct timeval + # in ioctl definitions; + # # sys/ioctl.h and, if we have it, sys/ioccom.h, # because net/bpf.h defines ioctls; # @@ -952,9 +973,9 @@ else() # of those headers itself. # if(HAVE_SYS_IOCCOM_H) - check_symbol_exists(BIOCSETIF "sys/types.h;sys/ioctl.h;sys/socket.h;sys/ioccom.h;net/bpf.h;net/if.h" BPF_H_DEFINES_BIOCSETIF) + check_symbol_exists(BIOCSETIF "sys/types.h;sys/time.h;sys/ioctl.h;sys/socket.h;sys/ioccom.h;net/bpf.h;net/if.h" BPF_H_DEFINES_BIOCSETIF) else(HAVE_SYS_IOCCOM_H) - check_symbol_exists(BIOCSETIF "sys/types.h;sys/ioctl.h;sys/socket.h;net/bpf.h;net/if.h" BPF_H_DEFINES_BIOCSETIF) + check_symbol_exists(BIOCSETIF "sys/types.h;sys/time.h;sys/ioctl.h;sys/socket.h;net/bpf.h;net/if.h" BPF_H_DEFINES_BIOCSETIF) endif(HAVE_SYS_IOCCOM_H) endif(HAVE_NET_BPF_H) check_include_file(net/pfilt.h HAVE_NET_PFILT_H) @@ -1436,7 +1457,28 @@ if(NOT DISABLE_DBUS) set(PCAP_SUPPORT_DBUS TRUE) set(PROJECT_SOURCE_LIST_C ${PROJECT_SOURCE_LIST_C} pcap-dbus.c) include_directories(${DBUS_INCLUDE_DIRS}) - set(PCAP_LINK_LIBRARIES ${PCAP_LINK_LIBRARIES} ${DBUS_LIBRARIES}) + + # + # This "helpfully" supplies DBUS_LIBRARIES as a bunch of + # library names - not paths - and DBUS_LIBRARY_DIRS as + # a bunch of directories. + # + # CMake *really* doesn't like the notion of specifying "here are + # the directories in which to look for libraries" except in + # find_library() calls; it *really* prefers using full paths to + # library files, rather than library names. + # + # Find the libraries and add their full paths. + # + set(DBUS_LIBRARY_FULLPATHS) + foreach(_lib IN LISTS DBUS_LIBRARIES) + # + # Try to find this library, so we get its full path. + # + find_library(_libfullpath ${_lib} HINTS ${DBUS_LIBRARY_DIRS}) + list(APPEND DBUS_LIBRARY_FULLPATHS ${_libfullpath}) + endforeach() + set(PCAP_LINK_LIBRARIES ${PCAP_LINK_LIBRARIES} ${DBUS_LIBRARY_FULLPATHS}) endif(DBUS_FOUND) endif(NOT DISABLE_DBUS) @@ -1499,7 +1541,7 @@ if(NOT DISABLE_DAG) endif() endif() endif() -endif() +endif() # Check for Septel card support. set(PROJECT_EXTERNAL_OBJECT_LIST "") @@ -1521,7 +1563,7 @@ if(NOT DISABLE_SEPTEL) set(PROJECT_EXTERNAL_OBJECT_LIST ${PROJECT_EXTERNAL_OBJECT_LIST} "${SEPTEL_ROOT}/asciibin.o ${SEPTEL_ROOT}/bit2byte.o ${SEPTEL_ROOT}/confirm.o ${SEPTEL_ROOT}/fmtmsg.o ${SEPTEL_ROOT}/gct_unix.o ${SEPTEL_ROOT}/hqueue.o ${SEPTEL_ROOT}/ident.o ${SEPTEL_ROOT}/mem.o ${SEPTEL_ROOT}/pack.o ${SEPTEL_ROOT}/parse.o ${SEPTEL_ROOT}/pool.o ${SEPTEL_ROOT}/sdlsig.o ${SEPTEL_ROOT}/strtonum.o ${SEPTEL_ROOT}/timer.o ${SEPTEL_ROOT}/trace.o") set(HAVE_SEPTEL_API TRUE) endif() -endif() +endif() # Check for Myricom SNF support. if(NOT DISABLE_SNF) @@ -1542,7 +1584,7 @@ if(NOT DISABLE_SNF) set(HAVE_SNF_API TRUE) set(PCAP_LINK_LIBRARIES ${PCAP_LINK_LIBRARIES} ${SNF_LIBRARIES}) endif() -endif() +endif() # Check for Riverbed TurboCap support. if(NOT DISABLE_TC) @@ -1563,7 +1605,7 @@ if(NOT DISABLE_TC) set(HAVE_TC_API TRUE) set(PCAP_LINK_LIBRARIES "${PCAP_LINK_LIBRARIES} ${TC_LIBRARIES} ${CMAKE_USE_PTHREADS_INIT} stdc++") endif() -endif() +endif() # # Remote capture support. @@ -1582,7 +1624,7 @@ if(ENABLE_REMOTE) # the check. # cmake_push_check_state() - set(CMAKE_REQUIRED_INCLUDES ${CMAKE_SOURCE_DIR}) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}) check_struct_has_member("struct msghdr" msg_control "ftmacros.h;sys/socket.h" HAVE_STRUCT_MSGHDR_MSG_CONTROL) check_struct_has_member("struct msghdr" msg_flags "ftmacros.h;sys/socket.h" HAVE_STRUCT_MSGHDR_MSG_FLAGS) cmake_pop_check_state() @@ -1597,7 +1639,7 @@ endif(ENABLE_REMOTE) # # Check and add warning options if we have a .devel file. # -if(EXISTS ${CMAKE_SOURCE_DIR}/.devel OR EXISTS ${CMAKE_BINARY_DIR}/.devel) +if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.devel OR EXISTS ${CMAKE_BINARY_DIR}/.devel) # # Warning options. # @@ -1808,10 +1850,12 @@ set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR # # Assume, by default, no support for shared libraries and V7/BSD -# convention for man pages (file formats in section 5, miscellaneous -# info in section 7, administrative commands and daemons in section 8). +# convention for man pages (devices in section 4, file formats in +# section 5, miscellaneous info in section 7, administrative commands +# and daemons in section 8). Individual cases can override this. # Individual cases can override this. # +set(MAN_DEVICES 4) set(MAN_FILE_FORMATS 5) set(MAN_MISC_INFO 7) set(MAN_ADMIN_COMMANDS 8) @@ -1869,6 +1913,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "OSF1") # set(MAN_FILE_FORMATS 4) set(MAN_MISC_INFO 5) + set(MAN_DEVICES 7) elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_VERSION MATCHES "5[.][0-9.]*") # # SunOS 5.x. @@ -1892,6 +1937,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SY set(MAN_ADMIN_COMMANDS 1m) set(MAN_FILE_FORMATS 4) set(MAN_MISC_INFO 5) + set(MAN_DEVICES 7D) endif() endif() @@ -1944,6 +1990,16 @@ if(BUILD_SHARED_LIBS) add_dependencies(${LIBRARY_NAME} SerializeTarget) set_target_properties(${LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS BUILDING_PCAP) + # + # No matter what the library is called - it might be called "wpcap" + # in a Windows build - the symbol to define to indicate that we're + # building the library, rather than a program using the library, + # and thus that we're exporting functions defined in our public + # header files, rather than importing those functions, is + # pcap_EXPORTS. + # + set_target_properties(${LIBRARY_NAME} PROPERTIES + DEFINE_SYMBOL pcap_EXPORTS) endif(BUILD_SHARED_LIBS) add_library(${LIBRARY_NAME}_static STATIC @@ -1982,7 +2038,7 @@ if(WIN32) # For compatibility, build the shared library without the "lib" prefix on # MinGW as well. # - set_target_properties(${LIBRARY_NAME} PROPERTIES + set_target_properties(${LIBRARY_NAME} PROPERTIES PREFIX "" OUTPUT_NAME "${LIBRARY_NAME}" ) @@ -2020,6 +2076,118 @@ if(NOT C_ADDITIONAL_FLAGS STREQUAL "") set_target_properties(${LIBRARY_NAME}_static PROPERTIES COMPILE_FLAGS ${C_ADDITIONAL_FLAGS}) endif() +# +# On macOS, build libpcap for the appropriate architectures, if +# CMAKE_OSX_ARCHITECTURES isn't set (if it is, let that control +# the architectures for which to build it). +# +if(APPLE AND "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "") + # + # Get the major version of Darwin. + # + string(REGEX MATCH "^([0-9]+)" SYSTEM_VERSION_MAJOR "${CMAKE_SYSTEM_VERSION}") + + if(SYSTEM_VERSION_MAJOR LESS 8) + # + # Pre-Tiger. Build only for 32-bit PowerPC. + # + set(OSX_LIBRARY_ARCHITECTURES "ppc") + elseif(SYSTEM_VERSION_MAJOR EQUAL 8) + # + # Tiger. Is this prior to, or with, Intel support? + # + # Get the minor version of Darwin. + # + string(REPLACE "${SYSTEM_VERSION_MAJOR}." "" SYSTEM_MINOR_AND_PATCH_VERSION ${CMAKE_SYSTEM_VERSION}) + string(REGEX MATCH "^([0-9]+)" SYSTEM_VERSION_MINOR "${SYSTEM_MINOR_AND_PATCH_VERSION}") + if(SYSTEM_VERSION_MINOR LESS 4) + # + # Prior to Intel support. Build for 32-bit + # PowerPC and 64-bit PowerPC, with 32-bit PowerPC + # first. (I'm guessing that's what Apple does.) + # + set(OSX_LIBRARY_ARCHITECTURES "ppc;ppc64") + elseif(SYSTEM_VERSION_MINOR LESS 7) + # + # With Intel support but prior to x86-64 support. + # Build for 32-bit PowerPC, 64-bit PowerPC, and 32-bit x86, + # with 32-bit PowerPC first. + # (I'm guessing that's what Apple does.) + # + set(OSX_LIBRARY_ARCHITECTURES "ppc;ppc64;i386") + else() + # + # With Intel support including x86-64 support. + # Build for 32-bit PowerPC, 64-bit PowerPC, 32-bit x86, + # and x86-64, with 32-bit PowerPC first. + # (I'm guessing that's what Apple does.) + # + set(OSX_LIBRARY_ARCHITECTURES "ppc;ppc64;i386;x86_64") + endif() + elseif(SYSTEM_VERSION_MAJOR EQUAL 9) + # + # Leopard. Build for 32-bit PowerPC, 64-bit + # PowerPC, 32-bit x86, and x86-64, with 32-bit PowerPC + # first. (That's what Apple does.) + # + set(OSX_LIBRARY_ARCHITECTURES "ppc;ppc64;i386;x86_64") + elseif(SYSTEM_VERSION_MAJOR EQUAL 10) + # + # Snow Leopard. Build for x86-64, 32-bit x86, and + # 32-bit PowerPC, with x86-64 first. (That's + # what Apple does, even though Snow Leopard + # doesn't run on PPC, so PPC libpcap runs under + # Rosetta, and Rosetta doesn't support BPF + # ioctls, so PPC programs can't do live + # captures.) + # + set(OSX_LIBRARY_ARCHITECTURES "x86_64;i386;ppc") + else() + # + # Post-Snow Leopard. Build for x86-64 and 32-bit x86, + # with x86-64 first. (That's what Apple does) + # XXX - update if and when Apple drops support + # for 32-bit x86 code and if and when Apple adds + # ARM-based Macs. (You're on your own for iOS etc.) + # + # XXX - check whether we *can* build for i386 and, if not, + # suggest that the user install the /usr/include headers if + # they want to build fat. + # + cmake_push_check_state() + set(CMAKE_REQUIRED_FLAGS "-arch i386") + check_c_source_compiles( +"int +main(void) +{ + return 0; +} +" + X86_32_BIT_SUPPORTED) + cmake_pop_check_state() + if(X86_32_BIT_SUPPORTED) + set(OSX_LIBRARY_ARCHITECTURES "x86_64;i386") + else() + set(OSX_LIBRARY_ARCHITECTURES "x86_64") + if(SYSTEM_VERSION_MAJOR LESS 18) + # + # Pre-Mojave; the command-line tools should be sufficient to + # enable 32-bit x86 builds. + # + message(WARNING "Compiling for 32-bit x86 gives an error; try installing the command-line tools") + else() + message(WARNING "Compiling for 32-bit x86 gives an error; try installing the command-line tools and, after that, installing the /usr/include headers from the /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg package") + endif() + endif() + endif() + if(BUILD_SHARED_LIBS) + set_target_properties(${LIBRARY_NAME} PROPERTIES + OSX_ARCHITECTURES "${OSX_LIBRARY_ARCHITECTURES}") + endif(BUILD_SHARED_LIBS) + set_target_properties(${LIBRARY_NAME}_static PROPERTIES + OSX_ARCHITECTURES "${OSX_LIBRARY_ARCHITECTURES}") +endif() + ###################################### # Write out the config.h file ###################################### @@ -2079,6 +2247,7 @@ set(MAN3PCAP_EXPAND pcap_list_tstamp_types.3pcap.in pcap_open_dead.3pcap.in pcap_open_offline.3pcap.in + pcap_set_immediate_mode.3pcap.in pcap_set_tstamp_precision.3pcap.in pcap_set_tstamp_type.3pcap.in ) @@ -2114,9 +2283,8 @@ set(MAN3PCAP_NOEXPAND pcap_open_live.3pcap pcap_set_buffer_size.3pcap pcap_set_datalink.3pcap - pcap_set_immediate_mode.3pcap pcap_set_promisc.3pcap - pcap_set_protocol.3pcap + pcap_set_protocol_linux.3pcap pcap_set_rfmon.3pcap pcap_set_snaplen.3pcap pcap_set_timeout.3pcap @@ -2179,11 +2347,13 @@ if(WIN32) endif(NOT MINGW) endif(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8) else(WIN32) - install(TARGETS ${LIBRARY_NAME} ${LIBRARY_NAME_STATIC} DESTINATION lib) + install(TARGETS ${LIBRARY_NAME} ${LIBRARY_NAME_STATIC} DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}) endif(WIN32) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/pcap/ DESTINATION include/pcap) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pcap.h DESTINATION include) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pcap-bpf.h DESTINATION include) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pcap-namedb.h DESTINATION include) # On UN*X, and on Windows when not using MSVC, generate libpcap.pc and # pcap-config and process man pages and arrange that they be installed. @@ -2223,8 +2393,8 @@ if(NOT MSVC) foreach(LIB ${PCAP_LINK_LIBRARIES}) set(LIBS "${LIBS} -l${LIB}") endforeach(LIB) - configure_file(${CMAKE_SOURCE_DIR}/pcap-config.in ${CMAKE_CURRENT_BINARY_DIR}/pcap-config @ONLY) - configure_file(${CMAKE_SOURCE_DIR}/libpcap.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc @ONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pcap-config.in ${CMAKE_CURRENT_BINARY_DIR}/pcap-config @ONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpcap.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc @ONLY) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/pcap-config DESTINATION bin) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpcap.pc DESTINATION lib/pkgconfig) @@ -2236,17 +2406,17 @@ if(NOT MSVC) # set(MAN1 "") foreach(MANPAGE ${MAN1_NOEXPAND}) - set(MAN1 ${MAN1} ${CMAKE_SOURCE_DIR}/${MANPAGE}) + set(MAN1 ${MAN1} ${CMAKE_CURRENT_SOURCE_DIR}/${MANPAGE}) endforeach(MANPAGE) install(FILES ${MAN1} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) set(MAN3PCAP "") foreach(MANPAGE ${MAN3PCAP_NOEXPAND}) - set(MAN3PCAP ${MAN3PCAP} ${CMAKE_SOURCE_DIR}/${MANPAGE}) + set(MAN3PCAP ${MAN3PCAP} ${CMAKE_CURRENT_SOURCE_DIR}/${MANPAGE}) endforeach(MANPAGE) foreach(TEMPLATE_MANPAGE ${MAN3PCAP_EXPAND}) string(REPLACE ".in" "" MANPAGE ${TEMPLATE_MANPAGE}) - configure_file(${CMAKE_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE} @ONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE} @ONLY) set(MAN3PCAP ${MAN3PCAP} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE}) endforeach(TEMPLATE_MANPAGE) install(FILES ${MAN3PCAP} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) @@ -2270,7 +2440,7 @@ if(NOT MSVC) set(MANFILE "") foreach(TEMPLATE_MANPAGE ${MANFILE_EXPAND}) string(REPLACE ".manfile.in" ".${MAN_FILE_FORMATS}" MANPAGE ${TEMPLATE_MANPAGE}) - configure_file(${CMAKE_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE} @ONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE} @ONLY) set(MANFILE ${MANFILE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE}) endforeach(TEMPLATE_MANPAGE) install(FILES ${MANFILE} DESTINATION ${CMAKE_INSTALL_MANDIR}/man${MAN_FILE_FORMATS}) @@ -2278,7 +2448,7 @@ if(NOT MSVC) set(MANMISC "") foreach(TEMPLATE_MANPAGE ${MANMISC_EXPAND}) string(REPLACE ".manmisc.in" ".${MAN_MISC_INFO}" MANPAGE ${TEMPLATE_MANPAGE}) - configure_file(${CMAKE_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE} @ONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${TEMPLATE_MANPAGE} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE} @ONLY) set(MANMISC ${MANMISC} ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE}) endforeach(TEMPLATE_MANPAGE) install(FILES ${MANMISC} DESTINATION ${CMAKE_INSTALL_MANDIR}/man${MAN_MISC_INFO}) Copied: head/contrib/libpcap/CONTRIBUTING.md (from r353141, vendor/libpcap/dist/CONTRIBUTING.md) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libpcap/CONTRIBUTING.md Sat Dec 21 21:01:03 2019 (r355988, copy of r353141, vendor/libpcap/dist/CONTRIBUTING.md) @@ -0,0 +1,29 @@ +Guidelines for contributing +=========================== + +To report a security issue (segfault, buffer overflow, infinite loop, arbitrary +code execution etc) please send an e-mail to security@tcpdump.org, do not use +the bug tracker! + +To report a non-security problem (failure to compile, failure to capture packets +properly, missing support for a network interface type or DLT) please check +first that it reproduces with the latest stable release of libpcap. If it does, +please check that the problem reproduces with the current git master branch of +libpcap. If it does (and it is not a security-related problem, otherwise see +above), please navigate to https://github.com/the-tcpdump-group/libpcap/issues +and check if the problem has already been reported. If it has not, please open +a new issue and provide the following details: + +* libpcap version (e.g. from tcpdump --version) +* operating system name and version and any other details that may be relevant + (uname -a, compiler name and version, CPU type etc.) +* configure flags if any were used +* statement of the problem +* steps to reproduce + +Please note that if you know exactly how to solve the problem and the solution +would not be too intrusive, it would be best to contribute some development time +and open a pull request instead. + +Still not sure how to do? Feel free to [subscribe](https://www.tcpdump.org/#mailing-lists) +to the mailing list tcpdump-workers@lists.tcpdump.org and ask! Modified: head/contrib/libpcap/CREDITS ============================================================================== --- head/contrib/libpcap/CREDITS Sat Dec 21 19:23:33 2019 (r355987) +++ head/contrib/libpcap/CREDITS Sat Dec 21 21:01:03 2019 (r355988) @@ -1,21 +1,18 @@ -This file lists people who have contributed to libpcap: +This file lists people who have contributed to libpcap. -The current maintainers: - Bill Fenner +The current maintainers (in alphabetical order): Denis Ovsienko - Fulvio Risso + Francois-Xavier Le Bail Guy Harris - Hannes Gredler Michael Richardson - Francois-Xavier Le Bail -Additional people who have contributed patches: - +Additional people who have contributed patches (in alphabetical order): Akos Vandra Alan Bawden Albert Chin Alexander 'Leo' Bergolth Alexey Kuznetsov + Ali Abdulkadir Alon Bar-Lev Andres Perera Andrew Brown @@ -62,6 +59,7 @@ Additional people who have contributed patches: Gabor Tatarka Garrett Cooper George Neville-Neil + Gerard Garcia Gianluca Varenni Gilbert Hoyek Gisle Vanem @@ -99,6 +97,7 @@ Additional people who have contributed patches: Koryn Grant Kris Katterjohn Krzysztof Halasa + Lennert Buytenhek Lorenzo Cavallaro Loris Degioanni Love Hörnquist-Åstrand @@ -114,6 +113,7 @@ Additional people who have contributed patches: Márton Németh Matthew Luckie Max Laier + Michal Kubecek Michal Labedzki Michal Sekletar Mike Frysinger @@ -129,7 +129,7 @@ Additional people who have contributed patches: Olaf Kirch Ollie Wild Onno van der Linden - Paolo Abeni + Paolo Abeni Patrick Marie Patrick McHardy Paul Mundt @@ -145,6 +145,8 @@ Additional people who have contributed patches: Rick Jones Robert Edmonds Roberto Mariani + Rongxi Li + Roland Dreier Romain Francoise Sagun Shakya Scott Barron @@ -167,6 +169,7 @@ Additional people who have contributed patches: Wesley Shields Xianjie Zhang Xin Li + Xue Jiang Qing Yen Yen Lim Yoann Vandoorselaere Yvan Vanhullebus @@ -176,5 +179,8 @@ The original LBL crew: Craig Leres Van Jacobson -Past maintainers: - Jun-ichiro itojun Hagino Also see: http://www.wide.ad.jp/itojun-award/ +Past maintainers (in alphabetical order): + Bill Fenner + Fulvio Risso + Hannes Gredler + Jun-ichiro itojun Hagino Also see: http://www.wide.ad.jp/itojun-award/ Copied: head/contrib/libpcap/INSTALL.md (from r353141, vendor/libpcap/dist/INSTALL.md) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libpcap/INSTALL.md Sat Dec 21 21:01:03 2019 (r355988, copy of r353141, vendor/libpcap/dist/INSTALL.md) @@ -0,0 +1,352 @@ +To build libpcap, run "./configure" (a shell script). The configure +script will determine your system attributes and generate an +appropriate Makefile from Makefile.in. Next run "make". If everything +goes well you can su to root and run "make install". However, you need +not install libpcap if you just want to build tcpdump; just make sure +the tcpdump and libpcap directory trees have the same parent +directory. + +If configure says: + + configure: warning: cannot determine packet capture interface + configure: warning: (see INSTALL for more info) + +then your system either does not support packet capture or your system +does support packet capture but libpcap does not support that +particular type. (If you have HP-UX, see below.) If your system uses a +packet capture not supported by libpcap, please send us patches; don't +forget to include an autoconf fragment suitable for use in +configure.ac. + +It is possible to override the default packet capture type, although +the circumstance where this works are limited. For example if you have +installed bpf under SunOS 4 and wish to build a snit libpcap: + + ./configure --with-pcap=snit + +Another example is to force a supported packet capture type in the case +where the configure scripts fails to detect it. + +You will need an ANSI C compiler to build libpcap. The configure script +will abort if your compiler is not ANSI compliant. If this happens, use +the generally available GNU C compiler (GCC). + +You will need either Flex 2.5.31 or later, or a version of Lex +compatible with it (if any exist), to build libpcap. The configure +script will abort if there isn't any such program. If you have an older +version of Flex, or don't have a compatible version of Lex, the current +version of flex is available at flex.sourceforge.net. + +You will need either Bison, Berkeley YACC, or a version of YACC +compatible with them (if any exist), to build libpcap. The configure +script will abort if there isn't any such program. If you don't have +any such program, the current version of Bison can be found at +http://ftp.gnu.org/gnu/bison/ and the current version of Berkeley YACC +can be found at http://invisible-island.net/byacc/. + +Sometimes the stock C compiler does not interact well with Flex and +Bison. The list of problems includes undefined references for alloca. +You can get around this by installing GCC. + +If you use Solaris, there is a bug with bufmod(7) that is fixed in +Solaris 2.3.2 (aka SunOS 5.3.2). Setting a snapshot length with the +broken bufmod(7) results in data be truncated from the FRONT of the +packet instead of the end. The work around is to not set a snapshot +length but this results in performance problems since the entire packet +is copied to user space. If you must run an older version of Solaris, +there is a patch available from Sun; ask for bugid 1149065. After +installing the patch, use "setenv BUFMOD_FIXED" to enable use of +bufmod(7). However, we recommend you run a more current release of +Solaris. + +If you use the SPARCompiler, you must be careful to not use the +/usr/ucb/cc interface. If you do, you will get bogus warnings and +perhaps errors. Either make sure your path has /opt/SUNWspro/bin +before /usr/ucb or else: + + setenv CC /opt/SUNWspro/bin/cc + +before running configure. (You might have to do a "make distclean" +if you already ran configure once). + +If you are trying to do packet capture with a FORE ATM card, you may or +may not be able to. They usually only release their driver in object +code so unless their driver supports packet capture, there's not much +libpcap can do. + +If you get an error like: + + tcpdump: recv_ack: bind error 0x??? + +when using DLPI, look for the DL_ERROR_ACK error return values, usually +in /usr/include/sys/dlpi.h, and find the corresponding value. + +Under {DEC OSF/1, Digital UNIX, Tru64 UNIX}, packet capture must be +enabled before it can be used. For instructions on how to enable packet +filter support, see: + + ftp://ftp.digital.com/pub/Digital/dec-faq/Digital-UNIX + +Look for the "How do I configure the Berkeley Packet Filter and capture +tcpdump traces?" item. + +Once you enable packet filter support, your OSF system will support bpf *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Dec 21 21:02:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 710EF1DCAC6; Sat, 21 Dec 2019 21:02: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 47gJ3c37KDz4dFy; Sat, 21 Dec 2019 21:02: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 65A801D19D; Sat, 21 Dec 2019 21:02: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 xBLL2q29038021; Sat, 21 Dec 2019 21:02:52 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBLL2o0a038012; Sat, 21 Dec 2019 21:02:50 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201912212102.xBLL2o0a038012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 21 Dec 2019 21:02:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355989 - head/contrib/tcpdump X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/tcpdump X-SVN-Commit-Revision: 355989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2019 21:02:52 -0000 Author: cy Date: Sat Dec 21 21:02:50 2019 New Revision: 355989 URL: https://svnweb.freebsd.org/changeset/base/355989 Log: MFV r353143 (phillip): Update tcpdump from 4.9.2 to 4.9.3. MFC after: 2 weeks Added: head/contrib/tcpdump/configure.ac - copied unchanged from r353144, vendor/tcpdump/dist/configure.ac Modified: head/contrib/tcpdump/CHANGES head/contrib/tcpdump/CONTRIBUTING head/contrib/tcpdump/INSTALL.txt head/contrib/tcpdump/Makefile-devel-adds head/contrib/tcpdump/Makefile.in head/contrib/tcpdump/VERSION head/contrib/tcpdump/addrtoname.c head/contrib/tcpdump/config.guess head/contrib/tcpdump/config.h.in head/contrib/tcpdump/config.sub head/contrib/tcpdump/configure head/contrib/tcpdump/netdissect.h head/contrib/tcpdump/print-802_11.c head/contrib/tcpdump/print-aoe.c head/contrib/tcpdump/print-babel.c head/contrib/tcpdump/print-bfd.c head/contrib/tcpdump/print-bgp.c head/contrib/tcpdump/print-bootp.c head/contrib/tcpdump/print-dccp.c head/contrib/tcpdump/print-decnet.c head/contrib/tcpdump/print-domain.c head/contrib/tcpdump/print-dvmrp.c head/contrib/tcpdump/print-eigrp.c head/contrib/tcpdump/print-esp.c head/contrib/tcpdump/print-fr.c head/contrib/tcpdump/print-hncp.c head/contrib/tcpdump/print-icmp.c head/contrib/tcpdump/print-icmp6.c head/contrib/tcpdump/print-ipnet.c head/contrib/tcpdump/print-isakmp.c head/contrib/tcpdump/print-juniper.c head/contrib/tcpdump/print-l2tp.c head/contrib/tcpdump/print-ldp.c head/contrib/tcpdump/print-lmp.c head/contrib/tcpdump/print-nfs.c head/contrib/tcpdump/print-openflow.c head/contrib/tcpdump/print-ospf.c head/contrib/tcpdump/print-ospf6.c head/contrib/tcpdump/print-ppi.c head/contrib/tcpdump/print-rsvp.c head/contrib/tcpdump/print-rx.c head/contrib/tcpdump/print-sflow.c head/contrib/tcpdump/print-sl.c head/contrib/tcpdump/print-sll.c head/contrib/tcpdump/print-smb.c head/contrib/tcpdump/print-tcp.c head/contrib/tcpdump/print-vrrp.c head/contrib/tcpdump/print-vtp.c head/contrib/tcpdump/print-wb.c head/contrib/tcpdump/signature.c head/contrib/tcpdump/smbutil.c head/contrib/tcpdump/tcpdump.1.in head/contrib/tcpdump/tcpdump.c head/contrib/tcpdump/util-print.c Directory Properties: head/contrib/tcpdump/ (props changed) Modified: head/contrib/tcpdump/CHANGES ============================================================================== --- head/contrib/tcpdump/CHANGES Sat Dec 21 21:01:03 2019 (r355988) +++ head/contrib/tcpdump/CHANGES Sat Dec 21 21:02:50 2019 (r355989) @@ -1,3 +1,36 @@ +Friday, September 20, 2019, by mcr@sandelman.ca + A huge thank you to Denis, Francois-Xavier and Guy who did much of the heavy lifting. + Summary for 4.9.3 tcpdump release + Fix buffer overflow/overread vulnerabilities: + CVE-2017-16808 (AoE) + CVE-2018-14468 (FrameRelay) + CVE-2018-14469 (IKEv1) + CVE-2018-14470 (BABEL) + CVE-2018-14466 (AFS/RX) + CVE-2018-14461 (LDP) + CVE-2018-14462 (ICMP) + CVE-2018-14465 (RSVP) + CVE-2018-14881 (BGP) + CVE-2018-14464 (LMP) + CVE-2018-14463 (VRRP) + CVE-2018-14467 (BGP) + CVE-2018-10103 (SMB - partially fixed, but SMB printing disabled) + CVE-2018-10105 (SMB - too unreliably reproduced, SMB printing disabled) + CVE-2018-14880 (OSPF6) + CVE-2018-16451 (SMB) + CVE-2018-14882 (RPL) + CVE-2018-16227 (802.11) + CVE-2018-16229 (DCCP) + CVE-2018-16301 (was fixed in libpcap) + CVE-2018-16230 (BGP) + CVE-2018-16452 (SMB) + CVE-2018-16300 (BGP) + CVE-2018-16228 (HNCP) + CVE-2019-15166 (LMP) + CVE-2019-15167 (VRRP) + Fix for cmdline argument/local issues: + CVE-2018-14879 (tcpdump -V) + Sunday September 3, 2017 denis@ovsienko.info Summary for 4.9.2 tcpdump release Do not use getprotobynumber() for protocol name resolution. Do not do Modified: head/contrib/tcpdump/CONTRIBUTING ============================================================================== --- head/contrib/tcpdump/CONTRIBUTING Sat Dec 21 21:01:03 2019 (r355988) +++ head/contrib/tcpdump/CONTRIBUTING Sat Dec 21 21:02:50 2019 (r355989) @@ -31,7 +31,7 @@ Please note that if you know exactly how to solve the would not be too intrusive, it would be best to contribute some development time and open a pull request instead as discussed below. -Still not sure how to do? Feel free to [subscribe](http://www.tcpdump.org/#mailing-lists) +Still not sure how to do? Feel free to [subscribe](https://www.tcpdump.org/#mailing-lists) to the mailing list tcpdump-workers@lists.tcpdump.org and ask! Modified: head/contrib/tcpdump/INSTALL.txt ============================================================================== --- head/contrib/tcpdump/INSTALL.txt Sat Dec 21 21:01:03 2019 (r355988) +++ head/contrib/tcpdump/INSTALL.txt Sat Dec 21 21:02:50 2019 (r355989) @@ -63,7 +63,7 @@ config.guess - autoconf support config.h.in - autoconf input config.sub - autoconf support configure - configure script (run this first) -configure.in - configure script source +configure.ac - configure script source ether.h - Ethernet definitions ethertype.h - Ethernet type value definitions extract.h - alignment definitions Modified: head/contrib/tcpdump/Makefile-devel-adds ============================================================================== --- head/contrib/tcpdump/Makefile-devel-adds Sat Dec 21 21:01:03 2019 (r355988) +++ head/contrib/tcpdump/Makefile-devel-adds Sat Dec 21 21:02:50 2019 (r355989) @@ -2,12 +2,12 @@ # Auto-regenerate configure script or Makefile when things change. # From autoconf.info . Works best with GNU Make. # -${srcdir}/configure: configure.in aclocal.m4 +${srcdir}/configure: configure.ac aclocal.m4 cd ${srcdir} && autoconf # autoheader might not change config.h.in, so touch a stamp file. ${srcdir}/config.h.in: ${srcdir}/stamp-h.in -${srcdir}/stamp-h.in: configure.in aclocal.m4 +${srcdir}/stamp-h.in: configure.ac aclocal.m4 cd ${srcdir} && autoheader echo timestamp > ${srcdir}/stamp-h.in Modified: head/contrib/tcpdump/Makefile.in ============================================================================== --- head/contrib/tcpdump/Makefile.in Sat Dec 21 21:01:03 2019 (r355988) +++ head/contrib/tcpdump/Makefile.in Sat Dec 21 21:02:50 2019 (r355989) @@ -334,7 +334,7 @@ EXTRA_DIST = \ config.h.in \ config.sub \ configure \ - configure.in \ + configure.ac \ install-sh \ lbl/os-osf4.h \ lbl/os-solaris2.h \ @@ -366,7 +366,7 @@ EXTRA_DIST = \ win32/prj/WinDump.vcproj \ win32/src/ether_ntohost.c -TEST_DIST= `find tests \( -name 'DIFF' -prune \) -o \( -name NEW -prune \) -o -type f \! -name '.*' \! -name '*~' -print` +TEST_DIST= `git ls-files tests | grep -v 'tests/\..*'` all: $(PROG) $(LIBNETDISSECT) @@ -438,7 +438,7 @@ distclean: rm -rf autom4te.cache tests/DIFF tests/NEW check: tcpdump - (cd tests && ./TESTrun.sh) + (mkdir -p tests && SRCDIR=`cd ${srcdir}; pwd` && export SRCDIR && $$SRCDIR/tests/TESTrun.sh ) extags: $(TAGFILES) ctags $(TAGFILES) Modified: head/contrib/tcpdump/VERSION ============================================================================== --- head/contrib/tcpdump/VERSION Sat Dec 21 21:01:03 2019 (r355988) +++ head/contrib/tcpdump/VERSION Sat Dec 21 21:02:50 2019 (r355989) @@ -1 +1 @@ -4.9.2 +4.9.3 Modified: head/contrib/tcpdump/addrtoname.c ============================================================================== --- head/contrib/tcpdump/addrtoname.c Sat Dec 21 21:01:03 2019 (r355988) +++ head/contrib/tcpdump/addrtoname.c Sat Dec 21 21:02:50 2019 (r355989) @@ -125,7 +125,7 @@ win32_gethostbyaddr(const char *addr, int len, int typ hname, sizeof(hname), NULL, 0, 0)) { return NULL; } else { - strcpy(host.h_name, hname); + strlcpy(host.h_name, hname, NI_MAXHOST); return &host; } break; @@ -1247,10 +1247,7 @@ dnaddr_string(netdissect_options *ndo, u_short dnaddr) tp->addr = dnaddr; tp->nxt = newhnamemem(ndo); - if (ndo->ndo_nflag) - tp->name = dnnum_string(ndo, dnaddr); - else - tp->name = dnname_string(ndo, dnaddr); + tp->name = dnnum_string(ndo, dnaddr); return(tp->name); } Modified: head/contrib/tcpdump/config.guess ============================================================================== --- head/contrib/tcpdump/config.guess Sat Dec 21 21:01:03 2019 (r355988) +++ head/contrib/tcpdump/config.guess Sat Dec 21 21:02:50 2019 (r355989) @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2015 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2015-02-23' +timestamp='2018-07-06' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ timestamp='2015-02-23' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -27,7 +27,7 @@ timestamp='2015-02-23' # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . @@ -39,7 +39,7 @@ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -101,15 +101,15 @@ trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmd trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; +case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" ; for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; @@ -132,14 +132,14 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEAS UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "${UNAME_SYSTEM}" in +case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu - eval $set_cc_for_build - cat <<-EOF > $dummy.c + eval "$set_cc_for_build" + cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc @@ -149,13 +149,20 @@ Linux|GNU|GNU/*) LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + + # If ldd exists, use it to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi ;; esac # Note: order is significant - the case branches are not exclusive. -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -169,27 +176,30 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - /sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || \ + "/sbin/$sysctl" 2>/dev/null || \ + "/usr/sbin/$sysctl" 2>/dev/null || \ echo unknown)` - case "${UNAME_MACHINE_ARCH}" in + case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) - arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` - endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` - machine=${arch}${endian}-unknown + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine="${arch}${endian}"-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build + # to ELF recently (or will in the future) and ABI. + case "$UNAME_MACHINE_ARCH" in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval "$set_cc_for_build" if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -205,10 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE ;; esac # Determine ABI tags. - case "${UNAME_MACHINE_ARCH}" in + case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release @@ -216,39 +226,55 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in + case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}${abi}" + echo "$machine-${os}${release}${abi-}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" + exit ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; + *:Sortix:*:*) + echo "$UNAME_MACHINE"-unknown-sortix + exit ;; + *:Redox:*:*) + echo "$UNAME_MACHINE"-unknown-redox + exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -265,63 +291,54 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos + echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos + echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition @@ -333,7 +350,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} + echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos @@ -360,38 +377,38 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} + echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" + eval "$set_cc_for_build" + SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then - SUN_ARCH="x86_64" + SUN_ARCH=x86_64 fi fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in @@ -400,25 +417,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) - echo sparc-sun-sunos${UNAME_RELEASE} + echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} + echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not @@ -429,44 +446,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} + echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} + echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} + echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} + echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} + echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} + echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} + echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} + echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { @@ -475,23 +492,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} + echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax @@ -517,17 +534,17 @@ EOF AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] + if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ + [ "$TARGET_BINARY_INTERFACE"x = x ] then - echo m88k-dg-dgux${UNAME_RELEASE} + echo m88k-dg-dgux"$UNAME_RELEASE" else - echo m88k-dg-dguxbcs${UNAME_RELEASE} + echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else - echo i586-dg-dgux${UNAME_RELEASE} + echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) @@ -544,7 +561,7 @@ EOF echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id @@ -556,14 +573,14 @@ EOF if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #include main() @@ -574,7 +591,7 @@ EOF exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else @@ -588,7 +605,7 @@ EOF exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc @@ -597,18 +614,18 @@ EOF IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx @@ -623,28 +640,28 @@ EOF echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + case "$UNAME_MACHINE" in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + case "$sc_cpu_version" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + case "$sc_kernel_bits" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + if [ "$HP_ARCH" = "" ]; then + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include @@ -677,13 +694,13 @@ EOF exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = "hppa2.0w" ] + if [ "$HP_ARCH" = hppa2.0w ] then - eval $set_cc_for_build + eval "$set_cc_for_build" # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -694,23 +711,23 @@ EOF # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then - HP_ARCH="hppa2.0w" + HP_ARCH=hppa2.0w else - HP_ARCH="hppa64" + HP_ARCH=hppa64 fi fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} + echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #include int main () @@ -735,11 +752,11 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) @@ -748,7 +765,7 @@ EOF *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) @@ -756,9 +773,9 @@ EOF exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk + echo "$UNAME_MACHINE"-unknown-osf1mk else - echo ${UNAME_MACHINE}-unknown-osf1 + echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) @@ -783,127 +800,109 @@ EOF echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} + echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + case "$UNAME_PROCESSOR" in amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac + echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin + echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 + echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 + echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys + echo "$UNAME_MACHINE"-pc-msys exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 + echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case "$UNAME_MACHINE" in x86) - echo i586-pc-interix${UNAME_RELEASE} + echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} + echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} + echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin + echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix + *:Minix:*:*) + echo "$UNAME_MACHINE"-unknown-minix *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Dec 21 21:05:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9D921DCC31; Sat, 21 Dec 2019 21:05:54 +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 47gJ764y5Mz4dQs; Sat, 21 Dec 2019 21:05:54 +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 8C08F1D1A6; Sat, 21 Dec 2019 21:05:54 +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 xBLL5sA7038198; Sat, 21 Dec 2019 21:05:54 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBLL5sHC038197; Sat, 21 Dec 2019 21:05:54 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201912212105.xBLL5sHC038197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 21 Dec 2019 21:05:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355990 - head/contrib/libpcap X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/libpcap X-SVN-Commit-Revision: 355990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2019 21:05:54 -0000 Author: cy Date: Sat Dec 21 21:05:53 2019 New Revision: 355990 URL: https://svnweb.freebsd.org/changeset/base/355990 Log: MFV r355890: Fix libpcap issue #893: check for invalid IPv4 addresses. This fixes errors such as: tcpdump -i lagg0 net 999.999.999.999 This was originally discovered on a Red Hat 7.7 server and verified to also be a bug on FreeBSD. Obtained from: https://github.com/the-tcpdump-group/libpcap/commit/ \ 07070918d5e81a515315b395f334e52589fe0fb Fixed by: https://github.com/guyharris MFC after: 2 weeks Modified: head/contrib/libpcap/gencode.c head/contrib/libpcap/nametoaddr.c Directory Properties: head/contrib/libpcap/ (props changed) Modified: head/contrib/libpcap/gencode.c ============================================================================== --- head/contrib/libpcap/gencode.c Sat Dec 21 21:02:50 2019 (r355989) +++ head/contrib/libpcap/gencode.c Sat Dec 21 21:05:53 2019 (r355990) @@ -6955,11 +6955,15 @@ gen_mcode(compiler_state_t *cstate, const char *s1, co return (NULL); nlen = __pcap_atoin(s1, &n); + if (nlen < 0) + bpf_error(cstate, "invalid IPv4 address '%s'", s1); /* Promote short ipaddr */ n <<= 32 - nlen; if (s2 != NULL) { mlen = __pcap_atoin(s2, &m); + if (mlen < 0) + bpf_error(cstate, "invalid IPv4 address '%s'", s2); /* Promote short ipaddr */ m <<= 32 - mlen; if ((n & ~m) != 0) @@ -7017,8 +7021,11 @@ gen_ncode(compiler_state_t *cstate, const char *s, bpf vlen = __pcap_atodn(s, &v); if (vlen == 0) bpf_error(cstate, "malformed decnet address '%s'", s); - } else + } else { vlen = __pcap_atoin(s, &v); + if (vlen < 0) + bpf_error(cstate, "invalid IPv4 address '%s'", s); + } switch (q.addr) { Modified: head/contrib/libpcap/nametoaddr.c ============================================================================== --- head/contrib/libpcap/nametoaddr.c Sat Dec 21 21:02:50 2019 (r355989) +++ head/contrib/libpcap/nametoaddr.c Sat Dec 21 21:05:53 2019 (r355990) @@ -653,8 +653,15 @@ __pcap_atoin(const char *s, bpf_u_int32 *addr) len = 0; for (;;) { n = 0; - while (*s && *s != '.') + while (*s && *s != '.') { + if (n > 25) { + /* The result will be > 255 */ + return -1; + } n = n * 10 + *s++ - '0'; + } + if (n > 255) + return -1; *addr <<= 8; *addr |= n & 0xff; len += 8; From owner-svn-src-head@freebsd.org Sat Dec 21 22:32:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F9671DE548; Sat, 21 Dec 2019 22:32:25 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47gL2x2r47z3Cxd; Sat, 21 Dec 2019 22:32:25 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C95D1E178; Sat, 21 Dec 2019 22:32:25 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBLMWPTV090571; Sat, 21 Dec 2019 22:32:25 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBLMWPe4090570; Sat, 21 Dec 2019 22:32:25 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201912212232.xBLMWPe4090570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 21 Dec 2019 22:32:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355991 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 355991 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2019 22:32:25 -0000 Author: alc Date: Sat Dec 21 22:32:24 2019 New Revision: 355991 URL: https://svnweb.freebsd.org/changeset/base/355991 Log: Micro-optimize the control flow in _pmap_unwire_ptp(), and eliminate unnecessary parentheses. Reviewed by: kib, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22893 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Dec 21 21:05:53 2019 (r355990) +++ head/sys/amd64/amd64/pmap.c Sat Dec 21 22:32:24 2019 (r355991) @@ -3542,7 +3542,7 @@ _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_ /* * unmap the page table page */ - if (m->pindex >= (NUPDE + NUPDPE)) { + if (m->pindex >= NUPDE + NUPDPE) { /* PDP page */ pml4_entry_t *pml4; pml4 = pmap_pml4e(pmap, va); @@ -3569,8 +3569,7 @@ _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_ pdpg = PHYS_TO_VM_PAGE(*pmap_pdpe(pmap, va) & PG_FRAME); pmap_unwire_ptp(pmap, va, pdpg, free); - } - if (m->pindex >= NUPDE && m->pindex < (NUPDE + NUPDPE)) { + } else if (m->pindex < NUPDE + NUPDPE) { /* We just released a PD, unhold the matching PDP */ vm_page_t pdppg;